Starsector API
Loading...
Searching...
No Matches
RuggedConstruction.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.hullmods;
2
3import com.fs.starfarer.api.combat.BaseHullMod;
4import com.fs.starfarer.api.combat.MutableShipStatsAPI;
5import com.fs.starfarer.api.combat.ShipAPI.HullSize;
6import com.fs.starfarer.api.impl.campaign.ids.Stats;
7
8public class RuggedConstruction extends BaseHullMod {
9
10 public static float DEPLOYMENT_COST_MULT = 0.5f;
11
12// public static float MIN_HULL = 30f;
13// public static float MAX_HULL = 40f;
14//
15// public static float MIN_CR = 30f;
16// public static float MAX_CR = 40f;
17//
18// public static float CR_LOSS_WHEN_DISABLED = 0.1f;
19// public static float REPAIR_FRACTION = 0.5f;
20
21 public static float DMOD_EFFECT_MULT = 0.5f;
22 public static float DMOD_AVOID_CHANCE = 50f;
23
24 public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
26 //stats.getDynamic().getMod(Stats.DMOD_AVOID_PROB_MOD).modifyFlat(id, DMOD_AVOID_CHANCE * 0.01f);
28
30
31 //stats.getDynamic().getStat(Stats.CR_LOSS_WHEN_DISABLED_MULT).modifyMult(id, CR_LOSS_WHEN_DISABLED);
32 //stats.getDynamic().getMod(Stats.INSTA_REPAIR_FRACTION).modifyFlat(id, REPAIR_FRACTION + 0.45f);
33 //stats.getDynamic().getMod(Stats.INSTA_REPAIR_FRACTION).modifyFlat(id, REPAIR_FRACTION);
34
35
36// stats.getDynamic().getMod(Stats.RECOVERED_HULL_MIN).modifyFlat(id, MIN_HULL * 0.01f);
37// stats.getDynamic().getMod(Stats.RECOVERED_HULL_MAX).modifyFlat(id, MAX_HULL * 0.01f);
38// stats.getDynamic().getMod(Stats.RECOVERED_CR_MIN).modifyFlat(id, MIN_CR * 0.01f);
39// stats.getDynamic().getMod(Stats.RECOVERED_CR_MAX).modifyFlat(id, MAX_CR * 0.01f);
40
41// stats.getMinArmorFraction().modifyFlat(id, 0.1f);
42// stats.getBeamDamageTakenMult().modifyMult(id, 0.5f);
43
45 }
46
47 public String getDescriptionParam(int index, HullSize hullSize) {
48 if (index == 0) return "" + (int) Math.round((1f - DMOD_EFFECT_MULT) * 100f) + "%";
49 if (index == 1) return "" + (int) DMOD_AVOID_CHANCE + "%";
50 if (index == 2) return "" + (int) Math.round((1f - DEPLOYMENT_COST_MULT) * 100f) + "%";
51 return null;
52 }
53
54 @Override
55 public boolean affectsOPCosts() {
56 return true; // probably intended even though it doesn't, actually -am
57 }
58
59}
60
61
62
63
64
65
66
67
void modifyMult(String source, float value)
void modifyMult(String source, float value)
void modifyFlat(String source, float value)
static final String INDIVIDUAL_SHIP_RECOVERY_MOD
Definition Stats.java:200
String getDescriptionParam(int index, HullSize hullSize)
void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id)