Trigger Game Condition - KonradHeinser/EBSGFramework GitHub Wiki
This ability allows you to start new conditions like eclipses and cold snaps with an ability. Conditions can only be applied if the condition isn't active, and no mutually exclusive condition is active. The basic ability comp looks like this:
<comps>
<li Class="EBSGFramework.CompProperties_TriggerGameCondition">
</li>
</comps>
To make the comp only attempt one condition, there are only two tags involved:
- gameCondition : The GameConditionDef to trigger
- ticks : Default (60,000) : Number of ticks to have it trigger for
There is also the option to make a list of conditions to try to apply:
- onlyFirst : Default (True) : Only uses the first usable match on the list
- skipExisting : Default (True) : If not using onlyFirst, then this makes it so any non-usable conditions are simply skipped. This allows for partial successes, and if both this and onlyFirst are false, then the ability won't activate if any unusable conditions are found
- gameConditions : A special list that uses the GameConditionDef as the tag, and the duration (in ticks) for the value
<gameConditions>
<InsertDefNameHere>60000</InsertDefNameHere>
</gameConditions>
Example from SHG - Just the Radiomancer that put the current map into a cold snap for an entire quadrum when used:
<AbilityDef>
<defName>SHG_Radiomancer_NuclearWinter</defName>
<label>nuclear winter</label>
<description>There was a description here.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<displayGizmoWhileUndrafted>True</displayGizmoWhileUndrafted>
<disableGizmoWhileUndrafted>False</disableGizmoWhileUndrafted>
<aiCanUse>False</aiCanUse>
<cooldownTicksRange>60000</cooldownTicksRange>
<targetRequired>false</targetRequired>
<hostile>true</hostile>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<warmupTime>10</warmupTime>
<range>0.9</range>
<targetParams>
<canTargetSelf>true</canTargetSelf>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_TriggerGameCondition">
<gameConditions>
<ColdSnap>900000</ColdSnap>
</gameConditions>
</li>
</comps>
</AbilityDef>