Monster Attack Spells - HoraceAndTheSpider/Bloodwych-68k GitHub Wiki
Monsters choose from a 16-byte spellbook called MonsterAttackSpells, at
runtime address BEXT $1948 or SPS 439 $15C6. Each byte is either a low
selector or an already complete airborne-entity code. The casting routine ORs
the value with $80, so low selector $02, for example, becomes airborne
Arc Bolt code $82.
| Index | Spell | Stored byte | Effective airborne code |
|---|---|---|---|
$00 |
Missile | $0A |
$8A |
$01 |
Missile | $0A |
$8A |
$02 |
Fireball | $00 |
$80 |
$03 |
Confuse | $8B |
$8B |
$04 |
Confuse | $8B |
$8B |
$05 |
Fireball | $00 |
$80 |
$06 |
Wychwind | $01 |
$81 |
$07 |
Spelltap | $8E |
$8E |
$08 |
Disrupt | $83 |
$83 |
$09 |
Spelltap | $8E |
$8E |
$0A |
Spelltap | $8E |
$8E |
$0B |
Arc Bolt | $02 |
$82 |
$0C |
Arc Bolt | $02 |
$82 |
$0D |
Wychwind | $01 |
$81 |
$0E |
Fireball | $00 |
$80 |
$0F |
Disrupt | $83 |
$83 |
The stored and effective columns matter. The original $8E previously shown
for entries $0B and $0C would select Spelltap, not Arc Bolt. The executable
contains $02 in both entries.
Selection and power
Normal spellcasting monsters start with a random index from $00 to $0F.
Lower base levels right-shift that index up to three times, making the earlier
entries progressively more likely. The selected byte also carries bit 7 into
the power calculation: entries which already contain $80 use the flagged
power form, while low selectors do not.
The ordinary power calculation starts with the monster's base level, triples
it, and normally divides the result by two. Effective Wychwind ($81) and
Spelltap ($8E) skip the final division.
The Arc Bolt machine
Monster attack type 4 enters original label adrJA001664, correctly named
AttackType_ArcBoltMachine. It does not make a random choice. It supplies:
spellbook index = $0B
base power = $0C (12)
stored selector = $02
effective code = $82 (Arc Bolt)
final power = (12 × 3) / 2 = 18 ($12)
The label immediately after the no-spells entry, original adrCd001684, is
shared pursuit code which checks the second fixed player origin. It is reached
by both no-spells monsters and the Arc Bolt machine after casting, so it is not
the Arc Bolt machine's entry label.
The entity codes themselves are described on Airbourne Spells.