Regenerating Things - KonradHeinser/EBSGFramework GitHub Wiki
This comp causes things to regenerate over time. It is important to note that this will require the things to use tickerType normal due to how Rimworld thingcomps trigger, and does not cover using the thing as stuffing:
<comps>
<li Class="EBSGFramework.CompProperties_Regenerating">
</li>
</comps>
There are only two nodes available for this comp, the amount and the frequency:
- regenerationAmount : Default (1) : The change in hit points. Can technically be negative, but must always be an integer
- regenerationInterval : Default (60) : The number of ticks between regenerationAmounts. There are 60 ticks per second
Normal ticker node:
<tickerType>Normal</tickerType>
This example just takes all of the normal fabrication bench stuff, and makes it a regenerating variant
<ThingDef ParentName="BenchBase">
<defName>RegeneratingFabricationBench</defName>
<label>regenerating fabrication bench</label>
<description>Description.</description>
<thingClass>Building_WorkTable</thingClass>
<altitudeLayer>Building</altitudeLayer>
<passability>PassThroughOnly</passability>
<tickerType>Normal</tickerType>
<pathCost>50</pathCost>
<statBases>
<MaxHitPoints>300</MaxHitPoints>
<WorkToBuild>5000</WorkToBuild>
<Flammability>1.0</Flammability>
</statBases>
<minifiedDef />
<thingCategories Inherit="false" />
<size>(5,2)</size>
<costList>
<Steel>200</Steel>
<ComponentIndustrial>12</ComponentIndustrial>
<ComponentSpacer>2</ComponentSpacer>
</costList>
<comps>
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>ToolCabinet</li>
</linkableFacilities>
</li>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>250</basePowerConsumption>
<shortCircuitInRain>true</shortCircuitInRain>
</li>
<li Class="CompProperties_Flickable"/>
<li Class="CompProperties_Breakdownable"/>
<li Class="EBSGFramework.CompProperties_Regenerating" />
</comps>
<recipes>
<li>Make_ComponentIndustrial</li>
<li>Make_ComponentSpacer</li>
</recipes>
<graphicData>
<texPath>Things/Building/Production/FabricationBench</texPath>
<graphicClass>Graphic_Multi</graphicClass>
<shaderType>CutoutComplex</shaderType>
<drawSize>(7,4)</drawSize>
<damageData>
<cornerTL>Damage/Corner</cornerTL>
<cornerTR>Damage/Corner</cornerTR>
<cornerBL>Damage/Corner</cornerBL>
<cornerBR>Damage/Corner</cornerBR>
</damageData>
</graphicData>
<castEdgeShadows>true</castEdgeShadows>
<staticSunShadowHeight>0.20</staticSunShadowHeight>
<inspectorTabs>
<li>ITab_Bills</li>
</inspectorTabs>
<building>
<spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
</building>
<fillPercent>0.5</fillPercent>
<interactionCellOffset>(0,0,-1)</interactionCellOffset>
<hasInteractionCell>true</hasInteractionCell>
<terrainAffordanceNeeded>Heavy</terrainAffordanceNeeded>
<designationCategory>Production</designationCategory>
<uiOrder>2530</uiOrder>
<surfaceType>Item</surfaceType>
<designationHotKey>Misc12</designationHotKey>
<constructionSkillPrerequisite>6</constructionSkillPrerequisite>
<placeWorkers>
<li>PlaceWorker_ShowFacilitiesConnections</li>
<li>PlaceWorker_PreventInteractionSpotOverlap</li>
</placeWorkers>
<researchPrerequisites>
<li>Fabrication</li>
</researchPrerequisites>
</ThingDef>