-
Notifications
You must be signed in to change notification settings - Fork 1
TakeDamage
NachoToast edited this page Mar 28, 2025
·
2 revisions
Applies a DamageDef to a pawn.
Source: TakeDamage.cs (V2.6)
<li Class="SCGF.Actions.TakeDamage">
<!-- Apply the 'Cut' DamageDef. -->
<damageDef>Cut</damageDef>
<!-- With a base amount of 4.5 -->
<amount>4.5</amount>
<!-- At 30% armour penetration. -->
<armorPenetration>0.3</armorPenetration>
<!-- Every 500 ticks (10 gas ticks). -->
<tickInterval>500</tickInterval>
<!-- Applied randomly to either the torso or heart. -->
<partsToAffect>
<li>Torso</li>
<li>Heart</li>
</partsToAffect>
</li>These properties must be defined!
| Type | DamageDef |
| Example |
<damageDef>Cut</damageDef> |
The damage type to apply.
| Type | Float |
| Default |
<amount>5</amount> |
Damage amount, cannot be less than 0.
| Type | Float |
| Default |
<armorPenetration>0</armorPenetration> |
Armor penetration (%), cannot be less than 0. Generally between 0 and 1 (inclusive), although can be greater.
| Type | List<BodyPartDef> |
| Default | Empty List |
| Example |
<partsToAffect>
<li>Torso</li>
<li>Heart</li>
</partsToAffect> |
List of body parts to apply the damage to.
If none are specified, the whole body will be the target. If multiple are specified, a random non-missing one is chosen based on it's coverage.

Noticed a mistake or have a suggestion to improve this page? Reach out via GitHub issues, Steam discussions, or mention me on Discord!