Give Resource - KonradHeinser/EBSGFramework GitHub Wiki
This should not be confused with Resource Using Abilities, which alters the resource levels of the caster
This comp alters the resource levels of the target, with the base of the comp looking like so:
<comps>
<li Class="EBSGFramework.CompProperties_AbilityGiveResource">
</li>
</comps>
These are the nodes available in the comp:
- mainResourceGene : The GeneDef of the gene that gives the resource that needs to be offset. This is required
- amount : The amount to offset the resource by. Unlike the cost comp, this isn't based on the hemogen one, so a positive value increases the resource level and a negative value decreases the level. This is required
- statEffects : A special item that causes amount to change based on the stats specified, if any
- parentFactor : The StatDef of the caster that the amount is multiplied by
- parentFactorReq : Default (Always) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)
- parentDivisor : The StatDef of the caster that the amount is divided by
- parentDivisorReq : Default (Higher) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)
- otherFactor : The StatDef of the target that the amount is multiplied by
- otherFactorReq : Default (Always) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)
- otherDivisor : The StatDef of the target that the amount is divided by
- otherDivisorReq : Default (Higher) : Requirement for when the stat can actually take effect. The options are Always (no requirement), Higher (value must be above the stat's default value), and Lower (value must be below the stat's default value)
- applyTargetGainStat : Default (True) : Determines whether the gainStat defined by the main resource gene multiplies the amount. This can stack with otherFactor to cause the amount to be multiplied by two stats
- checkLimits : Default (False) : Determines if the ability should make sure it won't exceed the resource's max or go below 0. Even if this False, the value won't exceed the limits, any amount beyond those limits will just be ignored
This ability just gives 10 radiation to another pawn, similar to how the generator on the Resource Using Abilities page grants 10 radiation to the caster:
<AbilityDef>
<defName>RadiationGranter</defName>
<label>radiation granter</label>
<description>This just gives some radiation to provide an example.</description>
<iconPath>UI/Abilities/Longjump</iconPath>
<category>Sanguophage</category>
<cooldownTicksRange>60</cooldownTicksRange>
<hostile>false</hostile>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>13.9</range>
<warmupTime>0.5</warmupTime>
<soundCast>PiercingSpine_Launch</soundCast>
<requireLineOfSight>False</requireLineOfSight>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityGiveResource">
<amount>0.10</amount>
<mainResourceGene>SHG_Archetypes_Radiomancer</mainResourceGene>
</li>
</comps>
</AbilityDef>
This variation of the ability above instead gives an amount that scales with the target's Move Speed:
<AbilityDef>
<defName>RadiationGranter</defName>
<label>radiation granter</label>
<description>This just gives some radiation to provide an example.</description>
<iconPath>UI/Abilities/Longjump</iconPath>
<category>Sanguophage</category>
<cooldownTicksRange>60</cooldownTicksRange>
<hostile>false</hostile>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>13.9</range>
<warmupTime>0.5</warmupTime>
<soundCast>PiercingSpine_Launch</soundCast>
<requireLineOfSight>False</requireLineOfSight>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityGiveResource">
<amount>0.02</amount>
<mainResourceGene>SHG_Archetypes_Radiomancer</mainResourceGene>
<statEffects>
<otherFactor>MoveSpeed</otherFactor>
</statEffects>
</li>
</comps>
</AbilityDef>