Starsector API
Loading...
Searching...
No Matches
TestGhost.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.ghosts.types;
2
3import com.fs.starfarer.api.Global;
4import com.fs.starfarer.api.campaign.CampaignFleetAPI;
5import com.fs.starfarer.api.impl.campaign.ghosts.BaseSensorGhost;
6import com.fs.starfarer.api.impl.campaign.ghosts.GBFollow;
7import com.fs.starfarer.api.impl.campaign.ghosts.GBGoAwayFrom;
8import com.fs.starfarer.api.impl.campaign.ghosts.GBITooClose;
9import com.fs.starfarer.api.impl.campaign.ghosts.SensorGhostManager;
10
11public class TestGhost extends BaseSensorGhost {
12
14 super(manager, 30);
15
16 CampaignFleetAPI pf = Global.getSector().getPlayerFleet();
17 //initEntity(1000f, 200f);
18 initEntity(2000f, pf.getRadius());
19 placeNearPlayer(700f, 1200f);
20
21 //getMovement().getLocation().set(pf.getLocation().x + 900, pf.getLocationInHyperspace().y);
22
23 float delay = 0.05f + manager.getRandom().nextFloat() * 0.05f;
24 //addBehavior(new GBStayInPlace(1f));
25 //addBehavior(new GBEchoMovement(pf, delay, 5f));
26 //addBehavior(new GBIntercept(pf, 10f, 20, true));
27 //addBehavior(new GBIntercept(pf, 10f, 20, 500f, true));
28 //addBehavior(new GBCircle(pf, 10f, 50, 600f, -1f));
29
30 addBehavior(new GBFollow(pf, 1000f, 15, 1200f, 1800f));
31 addInterrupt(new GBITooClose(0f, pf, 300f));
32 addBehavior(new GBGoAwayFrom(10f, pf, 50));
33 }
34}
static SectorAPI getSector()
Definition Global.java:59
void addInterrupt(GhostBehaviorInterrupt interrupt)