Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()  (Read 4050 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile

What I'm trying to get done:  make a Hull Mod that won't allow other, similar Hull Mods to be stacked with it.

Basically, this code doesn't work at all:

Code
	@Override
public boolean isApplicableToShip(ShipAPI ship) {
return (
ship.getMutableStats().getBallisticWeaponRangeBonus().isUnmodified()
&& ship.getMutableStats().getEnergyWeaponRangeBonus().isUnmodified()
);
}

It always returns false, in a Mission.  I've triple-checked that nothing else modifies the ShipAPI MutableStats on my end.

So, I tried this instead:

Code
	@Override
public boolean isApplicableToShip(ShipAPI ship) {
return (
ship.getMutableStats().getBallisticWeaponRangeBonus().getBonusMult() <= 1.25f
&& ship.getMutableStats().getEnergyWeaponRangeBonus().getBonusMult() <= 1.25f
);
}

This "works", in the sense that another Hull Mod with identical code returns false when this one's active, but with pretty obvious problems.

So, why is .isUnmodified() returning false all the time?  That's a mystery; I don't have a way that I can dig that up. 

However, the other problem with the second code sample is that, while it works, it doesn't work if:

Code
	@Override
public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
MutableShipStatsAPI myStats = ship.getMutableStats();
myStats.getBallisticWeaponRangeBonus().modifyMult(id, 1.5f);
}

Now, this code's supposed to only apply after ship creation (says it right there on the tin).  So I'm really confused about why it's happening at all; the ShipAPI should have a flag saying it's been created and then this code should run, correct?  When we're applying Hull Mods in the Refit screen, when we exit that part of the UI, the ShipAPI should get destroyed and rebuilt every time a Hull Mod's been installed or removed, to avoid this logic problem, I'd think.  So, yeah, confused; using applyEffectsBeforeShipCreation() doesn't work, either.  I can't seem to get a practical filter working here.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #1 on: February 11, 2019, 02:11:44 PM »

So, why is .isUnmodified() returning false all the time?  That's a mystery; I don't have a way that I can dig that up.
Couldn't you just iterate through all the modifiers and log them, using MutableStat.getMultMods()?
(Also, you'll want to double-check flat mods and percentage mods as well as multiplicative ones; in addition, if you're looking at weapon ranges, there's getWeaponRangeMultPastThreshold that some crazy person could use to boost the range of long-range weapons.)
Logged
Wyvern is 100% correct about the math.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #2 on: February 11, 2019, 02:16:19 PM »

Hmm.  I'll try that and see what's in the log.

Wasn't worrying about additive / percent mods yet; was just building the test case, then hit this weird issue, lol.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #3 on: February 11, 2019, 02:40:05 PM »

OK.  This logic works, basically:

Code
package data.hullmods;

import java.util.HashMap;
import java.util.Map;

import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.MutableStat;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;

public class IntegratedTargetingUnit extends BaseHullMod {

private static final Map<HullSize,Float> MAG = new HashMap();

private String myID = ":";

static {
MAG.put(HullSize.FIGHTER, 25f);
MAG.put(HullSize.FRIGATE, 30f);
MAG.put(HullSize.DESTROYER, 35f);
MAG.put(HullSize.CRUISER, 40f);
MAG.put(HullSize.CAPITAL_SHIP, 45f);
}

@Override
public String getDescriptionParam(int index, HullSize hullSize) {
int hullInt = Math.round(MAG.get(hullSize));
if (index == 0) return "" + hullInt + "%";
if (index == 1) return "" + hullInt/2 + "%";
return null;
}

  @Override
public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
myID = id;
MutableShipStatsAPI myStats = ship.getMutableStats();
float thisMag = MAG.get(ship.getHullSize());
myStats.getBallisticWeaponRangeBonus().modifyMult(id, 1f + (thisMag * 0.01f));
myStats.getEnergyWeaponRangeBonus().modifyMult(id, 1f + (thisMag * 0.01f));
myStats.getTurnAcceleration().modifyMult(id, 1f - (thisMag / 2f * 0.01f));
myStats.getMaxTurnRate().modifyMult(id, 1f - (thisMag / 2f * 0.01f));
}

@Override
public boolean isApplicableToShip(ShipAPI ship) {
HashMap<String, MutableStat.StatMod> multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getMultBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
if(!modName.equalsIgnoreCase(myID)){
return false;
}
}
return true;
}

@Override
public String getUnapplicableReason(ShipAPI ship) {
return "Incompatible with other Hull Mods that increase ranges.";
}

}


This leaves some mysteries.  isUnmodified() should not be returning false; however, it is.  Note the role of the String myID; if it's really being applied to a ShipAPI after creation... then its value should be ":", not the valid ID, but there it is.  So the logic's blocking itself, clearly.

At least this gives me a method to filter; probably also have to check against Vanilla range debuffs, etc., so probably not this simplistic in the end, but this basically works as advertised.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #4 on: February 11, 2019, 03:02:53 PM »

Wasn't worrying about additive / percent mods yet; was just building the test case, then hit this weird issue, lol.
This leaves some mysteries.  isUnmodified() should not be returning false; however, it is.
You can't just ignore additive/percent mods and declare that isUnmodified is bugged; after all, if there's a flat or percent modifier, then iterating through multiplicative multipliers would turn up nothing but the stat as a whole would still be modified.

Also, the returned unapplicable reason doesn't match the current behavior; for one thing, it won't conflict with a mod that increases range via the other mod types; for another, it will conflict with things that use multiplicative modifiers to reduce weapon ranges.

And, last, the thing you're doing with setting myID to ":" is poorly coded; it's not clear what the intended goal of that chunk of code is, but as soon as applyEffectsAfterShipCreation has been called once, myID is no longer ":" for that entire object, regardless of when it might later be used.  In other words, you're making certain assumptions about the lifecycle of HullMod objects that are almost certainly false - and even if true, shouldn't be relied on.
Logged
Wyvern is 100% correct about the math.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #5 on: February 11, 2019, 03:12:49 PM »

You're right; I'm checking that possibility out now.  This next version does a layered check on mult, flat and percentage and checks to see whether it's a buff / debuff; if it's a debuff from a D-Mod, obviously we're OK with stacking a bonus on it.

The use of ":" was to test when that value gets set; apparently, before we get to Refit, probably when a .Variant with <insert Hull Mod> is loaded on the initial screen?  As it is, it's a nice way to avoid having to manually enter the string value of the ID, so it prevents some User Error.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Blothorn

  • Commander
  • ***
  • Posts: 116
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #6 on: February 11, 2019, 03:17:23 PM »

Your entire approach is problematic because this will only prevent your hullmod from being applied after the other; people will still be free to add your hull mod and then another modifying the same stats.

Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #7 on: February 11, 2019, 03:27:00 PM »

Well, that's pretty much what I'm trying to prevent; in Vanilla, the Hull Mods that deal with range just do a string-based filter to check against each other, not against mod stuff, etc.

So, this appears to work:

Code
	@Override
public boolean isApplicableToShip(ShipAPI ship) {
//MULT BONUSES
HashMap<String, MutableStat.StatMod> multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getMultBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
return false;
}
}
multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getMultBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
return false;
}
}
//FLAT BONUSES
multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getFlatBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getFlatBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
//PERCENT BONUSES
multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getPercentBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getPercentBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
return true;
}

If anybody's got a better idea, I'm all ears, but this appears to only allow installation of this thing if other things that give bonuses aren't already installed.

There's absolutely no way to stop mod-stuff that doesn't have logic like this from being stacked to produce ridiculously-OP results, no.  But that was already true.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Blothorn

  • Commander
  • ***
  • Posts: 116
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #8 on: February 11, 2019, 03:51:57 PM »

The problem is that you also don't stop the player from installing *any* range-boosting hullmod, including vanilla ones, after it.

There are best practices for this which I won't repeat here; this feels like reinventing the wheel as a square.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #9 on: February 11, 2019, 04:03:49 PM »

So far as I'm aware, there are absolutely zero examples of Hull Mods that prevent stacking that aren't using Alex's original string-based method.  I'm trying to get somewhere new here; if all mods used this method, you wouldn't have stacking problems at all.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #10 on: February 11, 2019, 04:10:28 PM »

if all mods used this method, you wouldn't have stacking problems at all.
A bad assumption, there.  General rule of thumb: never assume good behavior on the part of other bits of code - even (or perhaps especially) if it's your own code.  Which is one of the reasons your way of setting myID is a bad plan - sure, it may work in testing now, but if it ever does get called in the wrong order, you're going to have some really hard-to-debug problems.

Now, the check mechanism you have there seems like it'd be mostly-functional, but it does need to be paired with a mechanism to either block other hull mods, or to remove this mod if something incompatible is later applied.  Also, you're still missing a check on getWeaponRangeMultPastThreshold, which could be used to boost weapon range in a way that your current code won't see.
Logged
Wyvern is 100% correct about the math.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #11 on: February 11, 2019, 04:22:12 PM »

I'm in agreement that we can't presume it's safe to presume others' code plays nicely.  Let's see if we can remove offenders and allow installation, then de-installation if the order-of-installation is reversed (which is the hard part).
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #12 on: February 11, 2019, 04:49:02 PM »

Ah, now this is interesting.  Alex's code handles this conflict quite nicely!

If you have this:

Code
package data.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.MutableStat;
import com.fs.starfarer.api.combat.MutableStat.StatMod;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import java.util.HashMap;

public class DedicatedTargetingCore extends BaseHullMod {

private final float RANGE_BONUS = 25f;
private final float TURRET_TURN_NERF = 25f;

private String myID = ":";

@Override
public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "" + (int)Math.round(RANGE_BONUS) + "%";
if (index == 1) return "" + (int)Math.round(TURRET_TURN_NERF) + "%";
return null;
}

@Override
public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
myID = id;
MutableShipStatsAPI myStats = ship.getMutableStats();
myStats.getBallisticWeaponRangeBonus().modifyMult(id, 1f + (RANGE_BONUS * 0.01f));
myStats.getEnergyWeaponRangeBonus().modifyMult(id, 1f + (RANGE_BONUS * 0.01f));
myStats.getWeaponTurnRateBonus().modifyMult(id, 1 - (TURRET_TURN_NERF * 0.01f));
}

@Override
public boolean isApplicableToShip(ShipAPI ship) {
//MULT BONUSES
HashMap<String, MutableStat.StatMod> multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getMultBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
return false;
}
}
multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getMultBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
return false;
}
}
//FLAT BONUSES
multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getFlatBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getFlatBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
//PERCENT BONUSES
multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getPercentBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getPercentBonuses();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}

//WeaponRangeMultPastThreshold checks
multMods = ship.getMutableStats().getWeaponRangeMultPastThreshold().getMultMods();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
return false;
}
}
multMods = ship.getMutableStats().getWeaponRangeMultPastThreshold().getFlatMods();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
multMods = ship.getMutableStats().getWeaponRangeMultPastThreshold().getPercentMods();
for(MutableStat.StatMod modifier : multMods.values()){
String modName = modifier.getSource();
float modValue = modifier.getValue();
if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
return false;
}
}
return true;
}

@Override
public String getUnapplicableReason(ShipAPI ship) {
return "Incompatible with other Hull Mods that increase ranges.";
}

}

And you attempt to stack this on it (note that isApplicableToShip always returns true):

Code
package data.hullmods;

import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.MutableStat;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import java.util.HashMap;
import java.util.Map;

public class AdvancedTargetingCore extends BaseHullMod {

private static final Map<HullSize,Float> MAG = new HashMap();

private String myID = ":";

static {
MAG.put(HullSize.FIGHTER, -20f);
MAG.put(HullSize.FRIGATE, -20f);
MAG.put(HullSize.DESTROYER, -15f);
MAG.put(HullSize.CRUISER, -10f);
MAG.put(HullSize.CAPITAL_SHIP, -5f);
}

@Override
public boolean isApplicableToShip(ShipAPI ship) {
// //MULT BONUSES
// HashMap<String, MutableStat.StatMod> multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getMultBonuses();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
// return false;
// }
// }
// multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getMultBonuses();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
// return false;
// }
// }
// //FLAT BONUSES
// multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getFlatBonuses();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
// return false;
// }
// }
// multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getFlatBonuses();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
// return false;
// }
// }
// //PERCENT BONUSES
// multMods = ship.getMutableStats().getBallisticWeaponRangeBonus().getPercentBonuses();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
// return false;
// }
// }
// multMods = ship.getMutableStats().getEnergyWeaponRangeBonus().getPercentBonuses();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
// return false;
// }
// }
//
// //WeaponRangeMultPastThreshold checks
// multMods = ship.getMutableStats().getWeaponRangeMultPastThreshold().getMultMods();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 1.0f){
// return false;
// }
// }
// multMods = ship.getMutableStats().getWeaponRangeMultPastThreshold().getFlatMods();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
// return false;
// }
// }
// multMods = ship.getMutableStats().getWeaponRangeMultPastThreshold().getPercentMods();
// for(MutableStat.StatMod modifier : multMods.values()){
// String modName = modifier.getSource();
// float modValue = modifier.getValue();
// if(!modName.equalsIgnoreCase(myID) && modValue > 0f){
// return false;
// }
// }
return true;
}

@Override
public String getUnapplicableReason(ShipAPI ship) {
return "Incompatible with other Hull Mods that increase ranges.";
}

public static float RANGE_BONUS = 115f;
public static float PD_MINUS = 20f;

@Override
public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "" + (int)Math.round(RANGE_BONUS) + "%";
if (index == 1) return "" + (100 - (int)Math.round(PD_MINUS)) + "%";
if (index == 2) return "" + Math.round(MAG.get(hullSize)) + " su/sec.";
return null;
}


  @Override
public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
myID = id;
MutableShipStatsAPI myStats = ship.getMutableStats();
myStats.getBallisticWeaponRangeBonus().modifyMult(id, 1f + (RANGE_BONUS * 0.01f));
myStats.getEnergyWeaponRangeBonus().modifyMult(id, 1f + (RANGE_BONUS * 0.01f));
myStats.getNonBeamPDWeaponRangeBonus().modifyMult(id, 1f - (PD_MINUS * 0.01f));
myStats.getBeamPDWeaponRangeBonus().modifyMult(id, 1f - (PD_MINUS * 0.01f));
myStats.getMaxSpeed().modifyFlat(id, MAG.get(ship.getHullSize()));
}
}

This causes the first example with the checking-code to uninstall itself, but not the second one, and to make itself unavailable for install back again (with a clean explanation in the UI for end-users).  

Looks like success from here, other than, as Wyvern pointed out, using myID instead of an explicit string reference to the Hull Mod's ID string, which is easy enough to address.
« Last Edit: February 11, 2019, 04:50:34 PM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #13 on: February 11, 2019, 04:54:40 PM »

(Hmm - this looks like it's not going to be installable on a ship with an officer with Gunnery Implants, though I think Wyvern already pointed this out.)
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Can't Check MutableStat Properly in BaseHullMod.isApplicableToShip()
« Reply #14 on: February 11, 2019, 04:59:45 PM »

Strange.  Why would the Officer's effect apply while in the Refit UI? 

I can write around that, on the assumption that it's never removed by a mod or is removed from Vanilla, I suppose.  It does seem rather unlikely.
Logged
Please check out my SS projects :)
Xeno's Mod Pack
Pages: [1] 2