Skip to content

Elemental Damage

Every attack in Paper Mario has an element that determines how it interacts with defenses, immunities, and status effects. Elements control whether an attack triggers burn animations, gets blocked by ice shields, or bypasses certain defenses entirely.

Element types

ElementDescription
ELEMENT_NORMALStandard physical damage with no special properties.
ELEMENT_FIREFire damage. Triggers EVENT_BURN_HIT / EVENT_BURN_DEATH.
ELEMENT_WATERWater damage.
ELEMENT_ICEIce damage. Can freeze targets.
ELEMENT_MYSTERYSpecial damage type used by certain star powers.
ELEMENT_MAGICMagic damage, bypasses some physical defenses.
ELEMENT_SMASHHammer-type damage.
ELEMENT_JUMPJump-type damage.
ELEMENT_COSMICStar-based damage (e.g. Star Beam).
ELEMENT_BLASTExplosion damage. Can flip actors with ACTOR_EVENT_FLAG_FLIPABLE.
ELEMENT_SHOCKElectric damage. Triggers EVENT_SHOCK_HIT / EVENT_SHOCK_DEATH.
ELEMENT_QUAKEEarthquake damage. Only hits grounded actors.
ELEMENT_THROWThrowing damage (e.g. Kooper's shell).

ELEMENT_END (value 0) is a sentinel used to terminate defense tables, not an actual element.

Dealing elemental damage

To make an attack deal elemental damage, pass the corresponding DAMAGE_TYPE_ flag to EnemyDamageTarget. Each attack uses exactly one elemental flag, optionally combined with modifier flags:

// fire attack that doesn't make contact (e.g. fire breath)
Call(EnemyDamageTarget,actorID ACTOR_SELF,outResult LVar0,
    damageType (DAMAGE_TYPE_FIRE | DAMAGE_TYPE_NO_CONTACT),
    suppressEventFlags 0,debuffType 0,damageAmount 4,flagsModifier BS_FLAGS1_TRIGGER_EVENTS)

See Actor Attacks for the full damage-dealing pattern.

Defense tables

A DefenseTable maps elements to defense values. Positive values reduce damage, negative values increase it (weakness), and a value of 99 effectively grants immunity.

s32 DefenseTable[] = {
    ELEMENT_NORMAL,   1,   // 1 point of defense against normal attacks
    ELEMENT_FIRE,    99,   // immune to fire
    ELEMENT_WATER,   -2,   // takes 2 extra damage from water
    ELEMENT_ICE,     -2,   // takes 2 extra damage from ice
    ELEMENT_END,
};

Every element the actor can be hit by should have an entry. If an element is missing from the table, the defense defaults to 0.

Defense tables are set per-part in the ActorPartBlueprint. See Actor Parts for how parts are defined.

Element immunity flags

The .elementImmunityFlags field on an ActorPartBlueprint provides another layer of elemental defense. While defense tables reduce damage, immunity flags cause the attack to be completely ignored — the actor won't flinch or react at all.

ActorPartBlueprint ActorParts[] = {
    {
        .flags = ACTOR_PART_FLAG_PRIMARY_TARGET,
        .index = PRT_MAIN,
        // ...
        .elementImmunityFlags = ELEMENT_IMMUNITY_FLAG_FIRE,
    },
};

Elemental events

Fire and shock elements trigger special events in the event handler:

ElementHit eventDeath event
FireEVENT_BURN_HITEVENT_BURN_DEATH
ShockEVENT_SHOCK_HITEVENT_SHOCK_DEATH

Handle these events to play the appropriate burn or shock animations using EVS_Enemy_BurnHit or EVS_Enemy_ShockHit.

Other elements use the standard EVENT_HIT and EVENT_DEATH events.