Starsector API
Loading...
Searching...
No Matches
GBITowardsDirection.java
Go to the documentation of this file.
1
package
com.fs.starfarer.api.impl.campaign.ghosts;
2
3
import
com.fs.starfarer.api.campaign.SectorEntityToken;
4
import
com.fs.starfarer.api.util.Misc;
5
6
public
class
GBITowardsDirection
extends
BaseGhostBehaviorInterrupt
{
7
8
protected
float
facing
;
9
protected
SectorEntityToken
from
;
10
11
public
GBITowardsDirection
(
float
delay
, SectorEntityToken
from
,
float
facing
) {
12
super(
delay
);
13
this.from =
from
;
14
this.facing =
facing
;
15
}
16
17
@Override
18
public
boolean
shouldInterruptBehavior
(
SensorGhost
ghost,
GhostBehavior
behavior) {
19
if
(
hasDelayRemaining
())
return
false
;
20
21
float
grace = 15f;
22
float
angle = Misc.getAngleInDegrees(
from
.getLocation(), ghost.
getEntity
().getLocation());
23
24
return
Misc.getAngleDiff(angle,
facing
) < grace;
25
}
26
27
28
}
com.fs.starfarer.api.impl.campaign.ghosts.BaseGhostBehaviorInterrupt
Definition
BaseGhostBehaviorInterrupt.java:5
com.fs.starfarer.api.impl.campaign.ghosts.BaseGhostBehaviorInterrupt.hasDelayRemaining
boolean hasDelayRemaining()
Definition
BaseGhostBehaviorInterrupt.java:21
com.fs.starfarer.api.impl.campaign.ghosts.BaseGhostBehaviorInterrupt.delay
float delay
Definition
BaseGhostBehaviorInterrupt.java:6
com.fs.starfarer.api.impl.campaign.ghosts.GBITowardsDirection
Definition
GBITowardsDirection.java:6
com.fs.starfarer.api.impl.campaign.ghosts.GBITowardsDirection.facing
float facing
Definition
GBITowardsDirection.java:8
com.fs.starfarer.api.impl.campaign.ghosts.GBITowardsDirection.GBITowardsDirection
GBITowardsDirection(float delay, SectorEntityToken from, float facing)
Definition
GBITowardsDirection.java:11
com.fs.starfarer.api.impl.campaign.ghosts.GBITowardsDirection.shouldInterruptBehavior
boolean shouldInterruptBehavior(SensorGhost ghost, GhostBehavior behavior)
Definition
GBITowardsDirection.java:18
com.fs.starfarer.api.impl.campaign.ghosts.GBITowardsDirection.from
SectorEntityToken from
Definition
GBITowardsDirection.java:9
com.fs.starfarer.api.impl.campaign.ghosts.GhostBehavior
Definition
GhostBehavior.java:3
com.fs.starfarer.api.impl.campaign.ghosts.SensorGhost
Definition
SensorGhost.java:11
com.fs.starfarer.api.impl.campaign.ghosts.SensorGhost.getEntity
CustomCampaignEntityAPI getEntity()
src
com
fs
starfarer
api
impl
campaign
ghosts
GBITowardsDirection.java
Generated by
1.9.8