Stats When Powered - Vanilla-Expanded/VanillaExpandedFramework GitHub Wiki

<- Back

CompProperties_StatsWhenPowered allows a building to have different stats when powered

        public List<StatModifier> poweredStatFactors;
        public List<StatModifier> poweredStatOffsets;
        public List<StatModifier> unpoweredStatFactors;
        public List<StatModifier> unpoweredStatOffsets;

        public bool clearRoomCacheOnPowerChange = false;
        public List<StatDef> clearStatCacheOnPowerChange;

        public bool onlyWorksIndoors = false;
        public bool onlyWorksOutdoors = false;

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag. For example, this is the air purifier in VE Furniture - Spacer

<comps>
	<li Class="VEF.Buildings.CompProperties_StatsWhenPowered">
  	      <poweredStatOffsets>
   	      	<Cleanliness>20</Cleanliness>
  	      </poweredStatOffsets>
   	     <onlyWorksIndoors>true</onlyWorksIndoors>
  	      <!-- The room stats aren't recalculated unless something forces the game to re-cache it, -->
  	      <!-- so we need a way to force it ourselves if we're changing a stat that affects a room. -->
  	      <clearRoomCacheOnPowerChange>true</clearRoomCacheOnPowerChange>
  	      <!-- Normally we wouldn't clear the stat, but since this stat directly affects -->
   	     <clearStatCacheOnPowerChange>
    	      	<li>Cleanliness</li>
	     </clearStatCacheOnPowerChange>
	</li>
</comps>
⚠️ **GitHub.com Fallback** ⚠️