1package com.fs.starfarer.api.impl.campaign.enc;
3import org.lwjgl.util.vector.Vector2f;
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.StarSystemAPI;
7import com.fs.starfarer.api.campaign.comm.IntelInfoPlugin;
8import com.fs.starfarer.api.impl.campaign.ids.Tags;
9import com.fs.starfarer.api.impl.campaign.intel.bases.LuddicPathBaseIntel;
10import com.fs.starfarer.api.impl.campaign.intel.bases.PirateBaseIntel;
11import com.fs.starfarer.api.util.Misc;
27 return getClass().getSimpleName();
55 if (base ==
null)
return 0f;
56 float dist = Misc.getDistance(base.getEntity().getLocationInHyperspace(), locInHyper);
70 LuddicPathBaseIntel closest =
null;
71 float minDist = Float.MAX_VALUE;
72 for (IntelInfoPlugin p :
Global.
getSector().getIntelManager().getIntel(LuddicPathBaseIntel.class)) {
73 LuddicPathBaseIntel intel = (LuddicPathBaseIntel) p;
74 if (intel.getEntity() ==
null || !intel.getEntity().isAlive())
continue;
75 float dist = Misc.getDistance(intel.getEntity().getLocationInHyperspace(), locInHyper);
86 if (base ==
null)
return 0f;
87 float dist = Misc.getDistance(base.getEntity().getLocationInHyperspace(), locInHyper);
101 PirateBaseIntel closest =
null;
102 float minDist = Float.MAX_VALUE;
103 for (IntelInfoPlugin p :
Global.
getSector().getIntelManager().getIntel(PirateBaseIntel.class)) {
104 PirateBaseIntel intel = (PirateBaseIntel) p;
105 if (intel.getEntity() ==
null || !intel.getEntity().isAlive())
continue;
106 float dist = Misc.getDistance(intel.getEntity().getLocationInHyperspace(), locInHyper);
108 if (dist < minDist) {
118 Vector2f min = Misc.getCoreMin();
119 Vector2f max = Misc.getCoreMax();
120 Vector2f core = Misc.getCoreCenter();
122 float across = Misc.getDistance(min, max);
123 float fullProximityAt = across * 0.5f;
126 float dist = Misc.getDistance(core, locInHyper);
127 if (dist < fullProximityAt) {
137 if (system ==
null)
return 0f;
138 float dist = Misc.getDistance(system.getLocation(), locInHyper);
153 StarSystemAPI closest =
null;
154 float minDist = Float.MAX_VALUE;
156 if (curr.hasTag(Tags.THEME_RUINS_MAIN)) {
157 float dist = Misc.getDistance(curr.getLocation(), locInHyper);
159 if (dist < minDist) {
static SectorAPI getSector()
static float RUINS_RANGE_FOR_FULL_PROXIMITY_FACTOR
static LuddicPathBaseIntel getClosestLuddicPathBase(Vector2f locInHyper, boolean onlyInProximity)
static float getCoreProximityFactor(Vector2f locInHyper)
static float getRuinsProximityFactor(StarSystemAPI system, Vector2f locInHyper)
float getCreatorTimeoutMax()
float getCreatorTimeoutMin()
float getPointTimeoutMax()
static float CORE_PROXIMITY_MAX_RANGE
static float PIRATE_AMBUSH_MAX_RANGE
void createEncounter(EncounterManager manager, EncounterPoint point)
static float getLuddicPathBaseProximityFactor(LuddicPathBaseIntel base, Vector2f locInHyper)
static PirateBaseIntel getClosestPirateBase(Vector2f locInHyper, boolean onlyInProximity)
static float PATHER_AMBUSH_RANGE_FOR_FULL_PROXIMITY_FACTOR
static StarSystemAPI getClosestSystemWithRuins(Vector2f locInHyper, boolean onlyInProximity)
static PirateBaseIntel getClosestPirateBase(Vector2f locInHyper)
static float RUINS_MAX_RANGE
static float PATHER_AMBUSH_MAX_RANGE
float getFrequencyForPoint(EncounterManager manager, EncounterPoint point)
static float getPirateBaseProximityFactor(PirateBaseIntel base, Vector2f locInHyper)
static StarSystemAPI getClosestSystemWithRuins(Vector2f locInHyper)
static LuddicPathBaseIntel getClosestLuddicPathBase(Vector2f locInHyper)
static float PIRATE_AMBUSH_RANGE_FOR_FULL_PROXIMITY_FACTOR
float getPointTimeoutMin()