Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: Blurple Berry on September 08, 2019, 04:16:45 AM

Title: pirate activity impact on colonies
Post by: Blurple Berry on September 08, 2019, 04:16:45 AM
how do i mod the negative modifiers (stab,accessibility,etc) that the tag "pirate activities" has on my (or anybody elses) colony?
like, what is the name of the file(s) with those values?

i really hate how the game forces you into conflict with the pirates #notmysandbox
severe impact on colonies is okay but a reasonable "live and let live" approach should be viable

--- edit

for anybody who is interested

i found the PirateActivity.java under starfarer.api/*/impl/campaign/intel/bases
from my limited understanding of code i derive that there is no floor to the stab and access penalties
the game will just increase the penalty value until the colony is at 0 stab and access

@Override
   public void setParam(Object param) {
      intel = (PirateBaseIntel) param;
   }


   public void apply(String id) {
      float accessibility = intel.getAccessibilityPenalty();
      float stability = intel.getStabilityPenalty();
      String name = "Pirate activity";
      if (accessibility != 0) {
         market.getAccessibilityMod().modifyFlat(id, -accessibility, name);
      }
      if (stability != 0) {
         market.getStability().modifyFlat(id, -stability, name);
      }
   }

   public void unapply(String id) {
      market.getAccessibilityMod().unmodifyFlat(id);
      market.getStability().unmodifyFlat(id);
   }

is there a way to implement a floor for the penalty value?
i mean not dynamic/based on the current colony status - a hard limit so to speak, like max stab penalty is 5 for example

sadly i have no idea how to do that - i can only "fix" the colony values ... if that is even how that works

--- edit 2

seems like i can't even do that
not smart enough, damn  ;D