001package com.fs.starfarer.api.impl.campaign.ghosts;
002
003import com.fs.starfarer.api.campaign.SectorEntityToken;
004import com.fs.starfarer.api.impl.campaign.terrain.HyperspaceTerrainPlugin;
005import com.fs.starfarer.api.impl.campaign.terrain.HyperspaceTerrainPlugin.CellState;
006import com.fs.starfarer.api.util.Misc;
007
008public class GBStormArea extends BaseGhostBehavior {
009
010        protected float radius;
011        
012        public GBStormArea(float radius) {
013                super(1f);
014                this.radius = radius;
015        }
016        
017        @Override
018        public void advance(float amount, SensorGhost ghost) {
019                super.advance(amount, ghost);
020                
021                SectorEntityToken entity = ghost.getEntity();
022                HyperspaceTerrainPlugin plugin = (HyperspaceTerrainPlugin) Misc.getHyperspaceTerrain().getPlugin();
023                if (plugin != null && entity.isInHyperspace()) {
024                        plugin.setTileState(entity.getLocation(), 1000f, 
025                                        CellState.SIGNAL, 
026                                        0f, 0.1f, 0.8f);
027                }
028                end();
029        }
030}