Offset Needs Ability - KonradHeinser/EBSGFramework GitHub Wiki
This ability comp allows you to manipulate the need levels of pawns. This can use any specific NeedDef, or a completely random one the Rimworld gives it if you don't include the need node. For your basic comp, you'll need something like this:
<comps>
<li Class="EBSGFramework.CompProperties_AbilityOffsetNeed">
</li>
</comps>
These are the options available:
- needOffsets : A special list of items that specify how the target's needs changes. Each li has these options available
- need : The NeedDef to offset. If this is not added, a random need is chosen
- offset : Default (0) : The amount to offset the need by
- offsetFactorStat : A StatDef to multiply the offset by
- casterNeedOffsets : A special list of items that specify how the caster's needs change. Has the same options as needOffsets
- preventRepeats : Default (True) : When True, all randomly picked needs will avoid picking a need that the pawn has previously offset this cast
- Note : The order of the offsets matter for the prevention. For example, if you have it set to offset, Food, Random, and Rest in that order, Rest has a chance to be offset twice if random picks Rest, but Random is unable to pick Food because it is guaranteed to be offset by the li before it
Really simplistic examples of abilities that generate or burn joy(recreation). The parent just contains some basic stuff to allow the pawn to cast it only on themselves
<AbilityDef ParentName="EBSG_TestSelfCastBase">
<defName>Burner</defName>
<label>burner</label>
<description>This just burns a need to provide an example.</description>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityOffsetNeed">
<needOffsets>
<li>
<need>Joy</need>
<offset>-0.1</offset>
</li>
</needOffsets>
</li>
</comps>
</AbilityDef>
<AbilityDef ParentName="EBSG_TestSelfCastBase">
<defName>Generator</defName>
<label>generator</label>
<description>This just recovers a need to provide an example.</description>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityOffsetNeed">
<needOffsets>
<li>
<need>Joy</need>
<offset>0.1</offset>
</li>
</needOffsets>
</li>
</comps>
</AbilityDef>