001package com.fs.starfarer.api.impl.campaign.ghosts;
002
003import org.lwjgl.util.vector.Vector2f;
004
005import com.fs.starfarer.api.util.Misc;
006
007
008public class GBGoInDirection extends BaseGhostBehavior {
009        
010        protected float direction;
011        protected int maxBurn;
012        
013        public GBGoInDirection(float duration, float direction, int maxBurn) {
014                super(duration);
015                this.direction = direction;
016                this.maxBurn = maxBurn;
017        }
018
019
020
021        @Override
022        public void advance(float amount, SensorGhost ghost) {
023                super.advance(amount, ghost);
024                
025                Vector2f loc = Misc.getUnitVectorAtDegreeAngle(direction);
026                loc.scale(10000f);
027                Vector2f.add(loc, ghost.getEntity().getLocation(), loc);
028                ghost.moveTo(loc, maxBurn);
029                
030        }
031        
032        
033        
034}
035
036
037
038
039
040
041
042
043
044
045
046
047