public override void Apply(ref float statValue, StatDef statDef, Thing thing) { ThingWithComps thingWithComps = (ThingWithComps)thing; CompAutomataDataHolder comp = thingWithComps.TryGetComp <CompAutomataDataHolder>(); statValue += Mathf.Max((comp?.MarketValue ?? 0f) * multiplier + addition, 0f); }
public override void Apply(ref float statValue, StatDef statDef, Thing thing) { ThingWithComps thingWithComps = (ThingWithComps)thing; CompAutomataDataHolder comp = thingWithComps.TryGetComp <CompAutomataDataHolder>(); if (comp != null) { float materialStat = GetMaterialStuffPower(comp.automataData.baseMaterialDef, statDef); statValue += Mathf.Max(materialStat * multiplier + addition, 0f); } }
public void CopyFrom(CompAutomataDataHolder other) { automataData = other.automataData; }