Starsector API
Loading...
Searching...
No Matches
AbyssalFrequencies.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.enc;
2
3import com.fs.starfarer.api.impl.campaign.DebugFlags;
4import com.fs.starfarer.api.impl.campaign.terrain.HyperspaceAbyssPluginImpl;
5import com.fs.starfarer.api.impl.campaign.terrain.HyperspaceAbyssPluginImpl.AbyssalEPData;
6
7public class AbyssalFrequencies {
8
9 public static float NO_ABYSS_ENCOUNTER_MULT = 10f;
10
11 public static float LIGHT_FREQ = 10f;
12 public static float ROGUE_REGULAR_FREQ = 5f;
13 public static float ROGUE_HINTS_FREQ = 5f;
14
16 if (!HyperspaceAbyssPluginImpl.EP_TYPE_ABYSSAL.equals(point.type)) return 0f;
17
18 float total = 0f;
20 if (!(c instanceof AbyssalNoEPEC)) {
21 // non-abyssal creators should return 0 for abyssal points
22 float f = c.getFrequencyForPoint(manager, point);
23 total += f;
24 }
25 }
26
28
29 return Math.min(10000f, Math.max(100f, total));
30 }
31
32 public static boolean isPointSuited(EncounterPoint point, boolean allowNearStar, float depthRequired) {
33 if (!HyperspaceAbyssPluginImpl.EP_TYPE_ABYSSAL.equals(point.type)) return false;
34 AbyssalEPData data = (AbyssalEPData) point.custom;
35 if (data.depth < depthRequired) return false;
36 if (!allowNearStar && data.nearest != null) return false;
37 return true;
38 }
39
40 public static float getAbyssalLightFrequency(EncounterManager manager, EncounterPoint point) {
41 if (!isPointSuited(point, false, HyperspaceAbyssPluginImpl.DEPTH_THRESHOLD_FOR_ABYSSAL_LIGHT)) {
42 return 0f;
43 }
44 return LIGHT_FREQ;
45 }
46
48 if (!isPointSuited(point, false, HyperspaceAbyssPluginImpl.DEPTH_THRESHOLD_FOR_ABYSSAL_STELLAR_OBJECT)) {
49 return 0f;
50 }
51 return ROGUE_REGULAR_FREQ;
52 }
53
55 if (!isPointSuited(point, false, HyperspaceAbyssPluginImpl.DEPTH_THRESHOLD_FOR_ABYSSAL_STELLAR_OBJECT)) {
56 return 0f;
57 }
59 return 1000000000f;
60 }
61 return ROGUE_HINTS_FREQ;
62 }
63
64
65
66}
67
68
69
70
71
static float getAbyssalRogueStellarObjectDireHintsFrequency(EncounterManager manager, EncounterPoint point)
static boolean isPointSuited(EncounterPoint point, boolean allowNearStar, float depthRequired)
static float getNoAbyssalEncounterFrequency(EncounterManager manager, EncounterPoint point)
static float getAbyssalLightFrequency(EncounterManager manager, EncounterPoint point)
static float getAbyssalRogueStellarObjectFrequency(EncounterManager manager, EncounterPoint point)