Spell Effects and Handlers - HoraceAndTheSpider/Bloodwych-68k GitHub Wiki

Spell effects and handlers

SPS 439 dispatches the 32 player spells through a table of relative routine offsets. This page records what those handlers do after the common mana, failure, and fizzle checks described in Spell Casting Mechanics.

The value called power below is the signed casting-quality result retained by the common casting path. Several handlers transform it before storing an effect strength.

Timed champion effects

Armour, Deflect, Warpower, Vanish, Compass, Levitate, Antimage, and Trueview use one shared worn-spell record. Casting one replaces the previous worn spell rather than stacking a second record.

Spell Worn-effect type Power supplied to packing
Armour 0 power + 2, capped at 63
Deflect 1 power
Warpower 2 power
Vanish 3 power
Compass 4 power
Levitate 5 power
Antimage 6 power
Trueview 7 power

The common routine stores ((input power << 2) & $F8) | type. The type therefore occupies the low three bits of the packed effect byte. Armour alone adds two before this packing step.

Direct party and inventory effects

Spell Effect
Vitalise Restores vitality to members of the active party. Its initial strength is floor(power / 4) before the shared random restoration loop.
Renew Restores hit points to members of the active party. Its initial strength is floor(3 × power / 16) before the same random restoration loop.
Alchemy Tests the left hand, then the right. An eligible ordinary item from the armour-to-wand object range is replaced by coinage. The resulting quantity is power + 5 + existing coin count, capped at 99; existing coin markers in the champion's ordinary pockets are consolidated.
Recharge Recharges the first rechargeable profession ring found in the left or right hand. The new use count is floor(power / 8).

Communication and dungeon-cell effects

Spell Effect
Beguile Works through the communication interface. It adds floor(power / 4) + 1 to both of the target's interaction values and queues the Beguile visual effect.
Magelock Toggles the lock bit on the addressed side of a door cell.
Conceal Sets the concealed flag on the target map cell when its coordinates are valid.
Dispell Clears the concealed flag and removes supported linked magic-cell state.
Vivify Resolves its target through the existing Vivify/cell-interaction machinery rather than creating an ordinary projectile directly.
Formwall Creates a type-7 magic location with subtype 3 in an empty target cell and registers its packed location in the linked-feature list.
Mindrock Creates a type-7 magic location with subtype 2 in an empty target cell.

Formwall and Mindrock share a placement routine. Their stored strength band is (power + 2) << 2, with the subtype in the low two bits. See Map Location Data – Magic Locations for the cell representation and renderer behaviour.

Spawned and travelling effects

These handlers allocate a live dungeon record in front of the caster. Projectile codes $80 and above enter the airborne-spell path; Illusion and Summon use the monster-like branch of the same allocator.

Spell Live form/code Power passed to allocator Notes
Terror $8F power Uses the status-projectile branch.
Missile $8A floor(power / 2) Ordinary airborne effect.
Paralyze $8C power Uses the status-projectile branch.
Confuse $8B power Uses the status-projectile branch.
Firepath $87 power + 2 Uses the status-projectile branch; later dungeon handling can produce the Firepath location.
Illusion $65 power Uses the monster-like creation branch with Illusion-specific state.
Spelltap $8E power Uses the status-projectile branch.
Disrupt $83 2 × (power + 5) Airborne attack.
Fireball $80 floor(3 × power / 2) Airborne attack.
Wychwind eight × $81 2 × (power + 10) Creates eight projectiles using a fixed direction-adjustment sequence.
Arc Bolt $82 floor(3 × power / 2) Airborne attack.
Summon $64 power Uses the monster-like creation branch.
Blaze $84 floor((power + 10) / 2) Airborne attack.

Wychwind's eight direction adjustments are 0, 1, 2, 3, 0, 2, 2, 0. This small eight-byte sequence is executable mechanics supporting the handler, not a separately editable game-data resource.

The common allocator records the caster's position, floor, facing, player identity, effect power, and form. It also marks the destination cell as occupied and follows the same live-record capacity management used by other dungeon entities. Rendering codes and graphics layouts are documented under Airbourne Spells.