After putting it off for almost the very end (yes, there is now light coming at the end of the tunnel), I am now working on spellcasting.
The reason for not seriously working on it until now is because I needed a fair amount of codebase in order to determine which spells can be programmed the most efficiently within the context of the algorithm I've devised for this game.
So, I've reduced a number of spells I had posted earlier here in the thread. Instead of 6 spell levels, there will now be 5. Here is the current (and most likely final) list of spells:
Code: Select all
WIZARD1:
.byte "CHARM MONSTER",0
.byte "DISPEL MAGIC",0
.byte "ENCHANTED WEAPON",0
.byte "MAGIC MISSILE",0
WIZARD2:
.byte "CLOUD KILL",0
.byte "HASTE",0
.byte "LIGHTNING BOLT",0
.byte "SLEEP",0
WIZARD3:
.byte "DEATH SPELL",0
.byte "DISPEL ALL MAGIC",0
.byte "FIREBALL",0
.byte "PHANTASMAL FORCE",0
WIZARD4:
.byte "ENCHANTED ARMY",0
.byte "FINGER OF DEATH",0
.byte "POWER WORD STUN",0
.byte "STONE TO FLESH",0
WIZARD5:
.byte "DIMENSION DOOR",0
.byte "METEOR SWARM",0
.byte "POWER WORD KILL",0
.byte "TIME DELAY",0
PRIEST1:
.byte "BLESS",0
.byte "CURE LIGHT WOUNDS",0
.byte "PROTECTION/EVIL",0
.byte "TURN THE UNDEAD",0
PRIEST2:
.byte "CURE POISON",0
.byte "CURE SERIOUS WOUNDS",0
.byte "INVOCATION",0
.byte "REPULSE THE UNDEAD",0
PRIEST3:
.byte "EXORCISM",0
.byte "PRAYER",0
.byte "REBUKE THE UNDEAD",0
.byte "SPIRITUAL SHIELD",0
PRIEST4:
.byte "CURE ALL POISONS",0
.byte "CURE ALL WOUNDS",0
.byte "EXCOMMUNICATION",0
.byte "EXILE THE UNDEAD",0
PRIEST5:
.byte "HOLY SYMBOL",0
.byte "RESTORATION",0
.byte "RESURRECTION",0
.byte "WORD OF RECALL",0
Each spell has 3 characteristics:
A. Type. There are 9 types of spells:
1=stun (basically taking out a monster without killing it--no XP will be given)
2=kill (killing a living creature, collect XP)
3=damage (inflict hit point damage)
4=combat bonus adjustment (for attack, armor, save and haste)
5=cure (to take a character out of a "non-good" state and bring it to a "good" state. for example, RESURRECTION for all intents and purposes, is a "cure death" spell)
6=teleport (only two of them in the game)
7=turn undead (basically a stun spell for priests to use against the undead monsters -- no XP collected)
8=holy spell (basically a kill spell for priests to be used against demonic creatures--XP will be collected)
9=heal hp (to cure hit points)
B. Area of effect (two values: one for individual and two for all. So a heal spell can cure hp for 1 character or all of them in the party at the same time or a kill spell can attempt to kill just one monster or all of the monsters in a single row)
C. Factor (used to determine the multiplier or a pointer, depending on the spell time).
Information for A+B+C above is stored into 8 bits below:
Code: Select all
.byte 18 ; CHARM MONSTER
.byte 84 ; DISPEL MAGIC
.byte 66 ; ENCHANTED WEAPON
.byte 50 ; MAGIC MISSILE
.byte 34 ; CLOUD KILL
.byte 69 ; HASTE
.byte 57 ; LIGHTNING BOLT
.byte 25 ; SLEEP
.byte 41 ; DEATH SPELL
.byte 92 ; DISPEL ALL MAGIC
.byte 58 ; FIREBALL
.byte 18 ; PHANTASMAL FORCE
.byte 74 ; ENCHANTED ARMY
.byte 34 ; FINGER OF DEATH
.byte 26 ; POWER WORD STUN
.byte 83 ; STONE TO FLESH
.byte 105 ; DIMENSION DOOR
.byte 59 ; METEOR SWARM
.byte 42 ; POWER WORD KILL
.byte 77 ; TIME DELAY
Bits 4-7 store A. Spell Type
Bit 3 stores B. Area of effect (0=one, 1=all)
Bits 0-2 stores C. Multiplier or Pointer