Spell Casting Mechanics - HoraceAndTheSpider/Bloodwych-68k GitHub Wiki

In the context of the routine [Click_LaunchSpellFromBook], the two bytes in the champion data structure are used this way:

Byte $13 is the number of the spell that the player attempts to cast. Byte $14 is the spell power boost gained by spending additional mana.

Each spell is practiced individually by counting the number of times it has succeeded (all champions contribute to the same count, A high number of successes increase the chances of further successes for that particular spell.

In the following I will say that champions, wands, rings and spells 'matches' if their colour is identical.

Mana Cost

Attempting to cast a spell always reduces vitality (Byte 07) by 4 to a minimum of 0, and sets the attack cooldown timer (Byte $1B) to 15 ($F), but neither of these two stats have any effect on the spell success chance.

Each spell has a base mana cost that is derived from the first row of Table 1: Spells

Spell Number Name Class Spellcost Difficulty
1 Amour Serpent (Green) 1 1
2 Terror Chaos (Yellow) 2 2
3 Vitalise Dragon (Red) 2 3
4 Beguile Moon (Blue) 1 4
5 Deflect Chaos (Yellow) 1 5
6 Magelock Dragon (Red) 2 6
7 Conceal Moon (Blue) 2 7
8 Warpower Serpent (Green) 3 8
9 Missile Dragon (Red) 1 9
10 Vanish Moon (Blue) 3 10
11 Paralyze Serpent (Green) 2 11
12 Alchemy Chaos (Yellow) 5 12
13 Confuse Moon (Blue) 2 13
14 Levitate Serpent (Green) 2 14
15 Antimage Chaos (Yellow) 4 15
16 Recharge Dragon (Red) 5 16
17 TrueView Moon (Blue) 3 17
18 Renew Serpent (Green) 3 18
19 Vivify Chaos (Yellow) 7 19
20 Dispell Dragon (Red) 3 20
21 Firepath Dragon (Red) 4 21
22 Illusion Moon (Blue) 4 22
23 Compass Serpent (Green) 2 23
24 Spelltap Chaos (Yellow) 5 24
25 Disrupt 8 25
26 Fireball Dragon (Red) 3 26
27 Wychwind Moon (Blue) 7 27
28 ArcBolt Serpent (Green) 4 28
29 Formwall Serpent (Green) 5 29
30 Summon Chaos (Yellow) 6 30
31 Blaze Dragon (Red) 6 31
32 MindRock Moon (Blue) 4 32
33 Protect Ancient (Pink)
34 Phaze Ancient (Pink)
35 Enhance Ancient (Pink)
36 Inferno Ancient (Pink)
37 Nullify Ancient (Pink)
38 Restore Ancient (Pink)
39 Spray Ancient (Pink)
40 Vortex Ancient (Pink)

The base mana cost is

 2 * (Spellcost + 1)

e.g. spell 10 has base cost 8. If an attack bonus/penalty is applied to the spell (Byte 14), the base value is adjusted according to Table 2: Attack modifiers

Attack modifier -3 -2 -1 0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12
Additional mana -3 -2 -1 0 +3 +6 +10 +15 +21 +28 +36 +45 +55 +66 +78 +91

Mana used on a single spell can't exceed 99.

If the champion wears a ring matching the spell, a charge from that will be spent instead of using mana. Such spells are always cast unmodified (no attack bonus/penalty).

Casting success

If a champion matches the spell or is wielding a wand matching the spell, the base attack is given in ** Table 3A: Matching spell**. Otherwise the base attack is given in Table 3B: Non-matching spell.

Table 3: Matching/Non-Matching spells

Matching spell --- Non-matching spell ---
# Successes Base Attack # Successes Base Attack
0-4 0 + (X - 0)/1 0-9 0 + (X - 0)/2
5-14 0 + (X - 5)/2 10-29 0 + (X - 10)/4
15-34 0 + (X - 10)/4 30-69 0 + (X - 30)/8
35-74 0 + (X - 15)/8 70-127 0 + (X - 70)/16
75-127 0 + (X - 20)/16

Here #Successes is the accumulated number of times the spell has succeeded. (The count stops increasing after 127 successes)

The base attack is adjusted by caster class, Table 4: Class bonuses

Class Matching Bonus Level Bonus
Warrior +3 +2 / 4 levels
Wizard +5 +2 / 1 level
Adventurer +4 +2 / 2 levels
Cutpurse +4 +2 / 4 levels

The matching bonus of Table 4 applies when the champion matches the spell. If the champion does not match but is wielding a wand that matches the spell, a matching bonus of +3 is used instead. The level bonus is based on the level of the champion (Byte 0).

Next the attack bonus/penalty from mana adjustment (Byte 14) is added to the result. A further +5 is added if a PowerStaff is equipped.

Now subtract the spell difficulty found in Table 1.

Finally the Spell Cool Down Timer (Byte 15), is subtracted from the result. Only half the Spell Cool Down Timer is subtracted if spell, equipped wand and champion are all matching.

Spell Cool Down Timer then increases by Spellcost+5 (ref. Table 1) to a maximum of 100.

If the final attack value plus 3D6 is less than 0 the spell fails, otherwise the spell succeeds. :)

EDIT: The roll was of course the more natural 3D6 (three dice of value 0-5 plus 3)