Destroy Items - KonradHeinser/EBSGFramework GitHub Wiki
This ability comp destroys a certain number of items at the target or around the target location. If targeting a stack of items, the number of items in the stack is reduced by the count, and if targeting an area by setting a Ability_EffectRadius the removal can take from multiple stacks. The base comp looks like this:
<comps>
<li Class="EBSGFramework.CompProperties_AbilityDestroyItem">
</li>
</comps>
These are the options available:
- options : A list of lists that represent what needs to be destroyed. The outer lists of li's each need to be fulfilled, while the ThingDefs and counts inside each li representing the individual options that can satisfy that li. See the examples for an actual representation of what it would look like
- addCostToStatSummary : Default (True) : Adds the cost to the description of the ability when players hover over the icon
This example turns some steel at a target location into a steel sword by using Add Things on Inventory when combined with this comp. The comp will function as long as the player targets either a stack of 50 steel or mineable steel:
<AbilityDef>
<defName>TransmuteToSword</defName>
<label>transmute to sword</label>
<description>Turn steel into a sword that is added to your inventory.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
<cooldownTicksRange>60</cooldownTicksRange>
<hostile>false</hostile>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>30</range>
<warmupTime>0.5</warmupTime>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetItems>True</canTargetItems>
<thingCategory>Item</thingCategory>
<mapObjectTargetsMustBeAutoAttackable>false</mapObjectTargetsMustBeAutoAttackable>
<canTargetPawns>False</canTargetPawns>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityDestroyItem">
<options>
<li>
<Steel>50</Steel>
<MineableSteel />
</li>
</options>
</li>
<li Class="EBSGFramework.CompProperties_AddItemToInventory">
<casterThing>MeleeWeapon_LongSword</casterThing>
<casterCount>1</casterCount>
<casterStuffing>Steel</casterStuffing>
</li>
</comps>
</AbilityDef>
This example takes a bunch of material around the pawn to add a cataphract armor and helmet by using Add Things on Inventory when combined with this comp. This has steel, plasteel, and uranium requirements, each one having options for laying around versions and mineable versions that are grabbed from anywhere within the area around the caster:
<AbilityDef>
<defName>ArmorUp</defName>
<label>armor up</label>
<description>Turn nearby material into a cataphract armor that is added to your inventory.</description>
<iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
<casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
<cooldownTicksRange>60</cooldownTicksRange>
<hostile>false</hostile>
<targetRequired>False</targetRequired>
<canUseAoeToGetTargets>False</canUseAoeToGetTargets>
<statBases>
<Ability_EffectRadius>4.9</Ability_EffectRadius>
</statBases>
<verbProperties>
<verbClass>Verb_CastAbility</verbClass>
<range>4.9</range>
<warmupTime>0.5</warmupTime>
<requireLineOfSight>False</requireLineOfSight>
<targetParams>
<canTargetSelf>True</canTargetSelf>
</targetParams>
</verbProperties>
<comps>
<li Class="EBSGFramework.CompProperties_AbilityDestroyItem">
<options>
<li>
<MineableSteel>2</MineableSteel>
<Steel>100</Steel>
</li>
<li>
<MineablePlasteel>6</MineablePlasteel>
<Plasteel>250</Plasteel>
</li>
<li>
<Uranium>50</Uranium>
<MineableUranium />
</li>
</options>
</li>
<li Class="EBSGFramework.CompProperties_AddItemToInventory">
<targetThing>Apparel_ArmorHelmetCataphract</targetThing>
<casterThing>Apparel_ArmorCataphract</casterThing>
</li>
</comps>
</AbilityDef>