Starsector API
Loading...
Searching...
No Matches
CBStats.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.missions.cb;
2
3import java.util.LinkedHashMap;
4import java.util.Map;
5
6import com.fs.starfarer.api.Global;
7import com.fs.starfarer.api.impl.campaign.missions.hub.BaseHubMission;
8import com.fs.starfarer.api.util.Pair;
9
10public class CBStats {
11
12 public static int BASE_REWARD = Global.getSettings().getInt("baseCustomBounty");
13 public static int REWARD_PER_DIFFICULTY = Global.getSettings().getInt("personCustomBountyPerLevel");
14
15 public static float DEFAULT_DAYS = 120;
16 public static float REMNANT_STATION_DAYS = 365;
17 public static float ENEMY_STATION_DAYS = 365;
18 public static float REMNANT_PLUS_DAYS = 0; // no time limit
19
20 // offer frequency
21 public static float PATHER_FREQ = 0.5f;
22 public static float PIRATE_FREQ = 1f;
23 public static float DESERTER_FREQ = 1f;
24 public static float DERELICT_FREQ = 0.5f;
25 public static float REMNANT_FREQ = 0.5f;
26 public static float REMNANT_STATION_FREQ = 0.5f;
27 public static float MERC_FREQ = 0.5f;
28 public static float REMNANT_PLUS_FREQ = 1f;
29 public static float ENEMY_STATION_FREQ = 0.5f;
30
31 // bounty mult
32 public static float PATHER_MULT = 0.8f;
33 public static float PIRATE_MULT = 0.8f;
34 public static float DESERTER_MULT = 1f;
35 public static float DERELICT_MULT = 1.2f;
36 public static float REMNANT_MULT = 1.75f;
37 public static float REMNANT_STATION_MULT = 2f;
38 public static float MERC_MULT = 2f;
39 public static float REMNANT_PLUS_MULT = 3f;
40 public static float ENEMY_STATION_MULT = 2f;
41
42 // difficulty thresholds, maps to a Pair
43 // if difficulty is >= Pair.one: the bounty is unavailable as a "more challenging" option
44 // if difficulty is >= Pair.two: the bounty is only available as an "easier" option
45 public static Map<Class, Pair<Integer, Integer>> THRESHOLDS =
46 new LinkedHashMap<Class, Pair<Integer,Integer>>();
47 public static void setThresholds(Class bounty, int challenging, int normal) {
48 THRESHOLDS.put(bounty, new Pair<Integer, Integer>(challenging, normal));
49 }
50 static {
51 setThresholds(CBPirate.class, 5, 8);
52 setThresholds(CBPather.class, 5, 8);
53 setThresholds(CBDeserter.class, 8, 12);
54 setThresholds(CBMerc.class, 12, 12);
55 setThresholds(CBDerelict.class, 12, 12);
56 setThresholds(CBRemnant.class, 12, 12);
57 setThresholds(CBRemnantPlus.class, 12, 12);
58 setThresholds(CBRemnantStation.class, 12, 12);
59 setThresholds(CBEnemyStation.class, 12, 12);
60 }
61 public static int getThresholdNotHigh(Class c) {
62 int result = 12;
63 if (!THRESHOLDS.containsKey(c)) return result;
64 return THRESHOLDS.get(c).one;
65 }
66 public static int getThresholdNotNormal(Class c) {
67 int result = 12;
68 if (!THRESHOLDS.containsKey(c)) return result;
69 return THRESHOLDS.get(c).two;
70 }
71
72
73 // offer frequency
74 public static float TRADER_FREQ = 1f;
75 public static float PATROL_FREQ = 1f;
76
77 // bounty mult
78 public static float TRADER_MULT = 0.5f;
79 public static float PATROL_MULT = 0.67f;
80
81
82
83 public static int getBaseBounty(int difficulty, float mult, BaseHubMission mission) {
84 int baseReward = CBStats.BASE_REWARD + difficulty * CBStats.REWARD_PER_DIFFICULTY;
85 baseReward *= mult;
86 if (mission != null) {
87 baseReward *= 0.9f + 0.2f * mission.getGenRandom().nextFloat();
88 baseReward = BaseHubMission.getRoundNumber(baseReward);
89 }
90 return baseReward;
91 }
92
93}
94
95
static SettingsAPI getSettings()
Definition Global.java:51
static int getBaseBounty(int difficulty, float mult, BaseHubMission mission)
Definition CBStats.java:83
static void setThresholds(Class bounty, int challenging, int normal)
Definition CBStats.java:47
static Map< Class, Pair< Integer, Integer > > THRESHOLDS
Definition CBStats.java:45