001package com.fs.starfarer.api.impl.campaign.missions.cb; 002 003import java.util.LinkedHashMap; 004import java.util.Map; 005 006import com.fs.starfarer.api.Global; 007import com.fs.starfarer.api.impl.campaign.missions.hub.BaseHubMission; 008import com.fs.starfarer.api.util.Pair; 009 010public class CBStats { 011 012 public static int BASE_REWARD = Global.getSettings().getInt("baseCustomBounty"); 013 public static int REWARD_PER_DIFFICULTY = Global.getSettings().getInt("personCustomBountyPerLevel"); 014 015 public static float DEFAULT_DAYS = 120; 016 public static float REMNANT_STATION_DAYS = 365; 017 public static float ENEMY_STATION_DAYS = 365; 018 public static float REMNANT_PLUS_DAYS = 0; // no time limit 019 020 // offer frequency 021 public static float PATHER_FREQ = 0.5f; 022 public static float PIRATE_FREQ = 1f; 023 public static float DESERTER_FREQ = 1f; 024 public static float DERELICT_FREQ = 0.5f; 025 public static float REMNANT_FREQ = 0.5f; 026 public static float REMNANT_STATION_FREQ = 0.5f; 027 public static float MERC_FREQ = 0.5f; 028 public static float REMNANT_PLUS_FREQ = 1f; 029 public static float ENEMY_STATION_FREQ = 0.5f; 030 031 // bounty mult 032 public static float PATHER_MULT = 0.8f; 033 public static float PIRATE_MULT = 0.8f; 034 public static float DESERTER_MULT = 1f; 035 public static float DERELICT_MULT = 1.2f; 036 public static float REMNANT_MULT = 1.75f; 037 public static float REMNANT_STATION_MULT = 2f; 038 public static float MERC_MULT = 2f; 039 public static float REMNANT_PLUS_MULT = 3f; 040 public static float ENEMY_STATION_MULT = 2f; 041 042 // difficulty thresholds, maps to a Pair 043 // if difficulty is >= Pair.one: the bounty is unavailable as a "more challenging" option 044 // if difficulty is >= Pair.two: the bounty is only available as an "easier" option 045 public static Map<Class, Pair<Integer, Integer>> THRESHOLDS = 046 new LinkedHashMap<Class, Pair<Integer,Integer>>(); 047 public static void setThresholds(Class bounty, int challenging, int normal) { 048 THRESHOLDS.put(bounty, new Pair<Integer, Integer>(challenging, normal)); 049 } 050 static { 051 setThresholds(CBPirate.class, 5, 8); 052 setThresholds(CBPather.class, 5, 8); 053 setThresholds(CBDeserter.class, 8, 12); 054 setThresholds(CBMerc.class, 12, 12); 055 setThresholds(CBDerelict.class, 12, 12); 056 setThresholds(CBRemnant.class, 12, 12); 057 setThresholds(CBRemnantPlus.class, 12, 12); 058 setThresholds(CBRemnantStation.class, 12, 12); 059 setThresholds(CBEnemyStation.class, 12, 12); 060 } 061 public static int getThresholdNotHigh(Class c) { 062 int result = 12; 063 if (!THRESHOLDS.containsKey(c)) return result; 064 return THRESHOLDS.get(c).one; 065 } 066 public static int getThresholdNotNormal(Class c) { 067 int result = 12; 068 if (!THRESHOLDS.containsKey(c)) return result; 069 return THRESHOLDS.get(c).two; 070 } 071 072 073 // offer frequency 074 public static float TRADER_FREQ = 1f; 075 public static float PATROL_FREQ = 1f; 076 077 // bounty mult 078 public static float TRADER_MULT = 0.5f; 079 public static float PATROL_MULT = 0.67f; 080 081 082 083 public static int getBaseBounty(int difficulty, float mult, BaseHubMission mission) { 084 int baseReward = CBStats.BASE_REWARD + difficulty * CBStats.REWARD_PER_DIFFICULTY; 085 baseReward *= mult; 086 if (mission != null) { 087 baseReward *= 0.9f + 0.2f * mission.getGenRandom().nextFloat(); 088 baseReward = BaseHubMission.getRoundNumber(baseReward); 089 } 090 return baseReward; 091 } 092 093} 094 095