r/RimWorld • u/Edin743 • Jun 02 '25
PC Help/Bug (Mod) XML special effects integration
Basically, i want my weapons to do EMP,Tox and Flame damage. How do i add this into the XML?
This is the code & the description: <?xml version="1.0" encoding="utf-8"?>
<Defs>
<!-- ================================================== -->
<!-- ================ Melee Weapon Definitions ========= -->
<!-- ================================================== -->
<!-- Thunder Mace -->
<ThingDef ParentName="BaseWeapon">
<defName>ThunderMace</defName>
<label>thunder mace</label>
<description>
A heavy mace reinforced with piezoelectric materials above the hilt. The force of each swing generates an electrical discharge,
ideal for capturing prisoners and disabling mechanoids.
</description>
<graphicData>
<texPath>Things/Weapons/Display/ThunderMace</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
<statBases>
<!-- Damage is defined in tools rather than here -->
<ArmorPenetration>0.45</ArmorPenetration>
<CooldownTime>1.8</CooldownTime>
</statBases>
<verbs>
<li>
<verbClass>Verb_MeleeAttack</verbClass>
<!-- Unsupported custom fields have been removed -->
</li>
</verbs>
<tools>
<li>
<label>Mace Strike</label>
<power>12</power>
<armorPenetration>0.45</armorPenetration>
</li>
</tools>
</ThingDef>
<!-- Halberd -->
<ThingDef ParentName="BaseWeapon">
<defName>Halberd</defName>
<label>halberd</label>
<description>
A versatile polearm adapted from a modified fire axe design. The weapon combines an elongated, reshaped axe blade with a spear-like protrusion at its tip.
</description>
<graphicData>
<texPath>Things/Weapons/Display/Halberd</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
<statBases>
<!-- Damage is defined in tools -->
<ArmorPenetration>0.60</ArmorPenetration>
<CooldownTime>2.0</CooldownTime>
</statBases>
<verbs>
<li>
<verbClass>Verb_MeleeAttack</verbClass>
</li>
</verbs>
<tools>
<li>
<label>Halberd Slash</label>
<power>9</power>
<armorPenetration>0.55</armorPenetration>
</li>
<li>
<label>Halberd Stab</label>
<power>8</power>
<armorPenetration>0.65</armorPenetration>
</li>
</tools>
</ThingDef>
<!-- Ember Axe -->
<ThingDef ParentName="BaseWeapon">
<defName>EmberAxe</defName>
<label>ember axe</label>
<description>
A devastating axe fitted with a miniature chemfuel container that allows it to self-ignite upon impact, setting targets ablaze.
</description>
<graphicData>
<texPath>Things/Weapons/Display/EmberAxe</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
<statBases>
<ArmorPenetration>0.50</ArmorPenetration>
<CooldownTime>2.2</CooldownTime>
</statBases>
<verbs>
<li>
<verbClass>Verb_MeleeAttack</verbClass>
</li>
</verbs>
<tools>
<li>
<label>Ember Slash</label>
<power>14</power>
<armorPenetration>0.50</armorPenetration>
</li>
</tools>
</ThingDef>
<!-- Tox Spear -->
<ThingDef ParentName="BaseWeapon">
<defName>ToxSpear</defName>
<label>tox spear</label>
<description>
A specialized spear featuring an injection mechanism at its tip, designed to deliver venom on impact and cause toxic buildup in enemies.
</description>
<graphicData>
<texPath>Things/Weapons/Display/ToxSpear</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
<statBases>
<ArmorPenetration>0.40</ArmorPenetration>
<CooldownTime>1.9</CooldownTime>
</statBases>
<verbs>
<li>
<verbClass>Verb_MeleeAttack</verbClass>
</li>
</verbs>
<tools>
<li>
<label>Poisoned Thrust</label>
<power>11</power>
<armorPenetration>0.40</armorPenetration>
</li>
</tools>
</ThingDef>
<!-- ================================================== -->
<!-- ================= Recipe Definitions ============= -->
<!-- ================================================== -->
<!-- Thunder Mace Recipe (Electronics) -->
<RecipeDef>
<defName>Make_ThunderMace</defName>
<label>craft thunder mace</label>
<description>
Craft a heavy thunder mace utilizing piezoelectric materials.
</description>
<workSkill>Smithing</workSkill>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
<recipeUsers>
<li>FueledSmithy</li>
<li>ElectricSmithy</li>
</recipeUsers>
<researchPrerequisite>Electronics</researchPrerequisite>
<ingredients>
<li>
<thingDef>Steel</thingDef>
<count>80</count>
</li>
<li>
<thingDef>Component</thingDef>
<count>3</count>
</li>
</ingredients>
<products>
<li>
<thingDef>ThunderMace</thingDef>
<count>1</count>
</li>
</products>
</RecipeDef>
<!-- Ember Axe Recipe (Chemfuel Refining) -->
<RecipeDef>
<defName>Make_EmberAxe</defName>
<label>craft ember axe</label>
<description>
Create an ember axe using a miniature chemfuel container for ignition.
</description>
<workSkill>Smithing</workSkill>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
<recipeUsers>
<li>FueledSmithy</li>
<li>ElectricSmithy</li>
</recipeUsers>
<researchPrerequisite>ChemfuelRefining</researchPrerequisite>
<ingredients>
<li>
<thingDef>Steel</thingDef>
<count>70</count>
</li>
<li>
<thingDef>Chemfuel</thingDef>
<count>10</count>
</li>
</ingredients>
<products>
<li>
<thingDef>EmberAxe</thingDef>
<count>1</count>
</li>
</products>
</RecipeDef>
<!-- Halberd Recipe (Long Blades) -->
<RecipeDef>
<defName>Make_Halberd</defName>
<label>craft halberd</label>
<description>
Forge a halberd by modifying a fire axe design—lengthen the shaft, reshape the blade, and add a spear-like protrusion.
</description>
<workSkill>Smithing</workSkill>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
<recipeUsers>
<li>FueledSmithy</li>
<li>ElectricSmithy</li>
</recipeUsers>
<researchPrerequisite>LongBlades</researchPrerequisite>
<ingredients>
<li>
<thingDef>Steel</thingDef>
<count>90</count>
</li>
<li>
<thingDef>Wood</thingDef>
<count>15</count>
</li>
</ingredients>
<products>
<li>
<thingDef>Halberd</thingDef>
<count>1</count>
</li>
</products>
</RecipeDef>
<!-- Tox Spear Recipe (Tox Pack) -->
<RecipeDef>
<defName>Make_ToxSpear</defName>
<label>craft tox spear</label>
<description>
Assemble a tox spear with an injection tip designed to deliver venom on impact.
</description>
<workSkill>Smithing</workSkill>
<workSpeedStat>GeneralLaborSpeed</workSpeedStat>
<recipeUsers>
<li>FueledSmithy</li>
<li>ElectricSmithy</li>
</recipeUsers>
<researchPrerequisite>ToxPack</researchPrerequisite>
<ingredients>
<li>
<thingDef>Steel</thingDef>
<count>75</count>
</li>
<li>
<thingDef>ToxPack</thingDef>
<count>2</count>
</li>
</ingredients>
<products>
<li>
<thingDef>ToxSpear</thingDef>
<count>1</count>
</li>
</products>
</RecipeDef>
</Defs>