Magic! Shazam Again
Spent a little time on CnC last night, working on getting the magic system going.
First issue was you couldnt equip the spellbook, so I moved books and scrolls out of the miscellaneous item enumeration and created a itm_BookOrScroll enumeration, and added its flag to the wield item routine.
The thinking is, you need to have the scroll or spellbook readied in one of your hands to cast from it.
There are two quick keys for casting a spell, currently its ‘C’ for cast spell which applies to a targetted monster, or directly in front of you if nothing is targetted, and secondly ‘X’ for casting the spell on yourself.
Casting will be a one or two step process, the ‘V’ key (I’m keeping things close together but you can redefine al the key assignments), will be ‘Select Spell’. If you havnt a spell selected, when you cast you will be give a list of spells in whatever is readied in your hands and you pick and it casts. Using V/Select Spell, you can bind a spell to the casting and each time you cast it will use that spell. Its usefull to tie something like a fireball spell to it so you can go on the attack without using too many keystrokes.
Im debating of using the number keys to quick bind up to 10 spells so you just press the number rather than C to cast… Not too sure of that yet so we will see how the current system plays.
Once this code is down, I can re-use a lot of it for missile weapons, so I should get those as mostly a bonus, since it relies on the same targetting code, and the ‘A’ttack key is already implemented, I just need to add a check to see if the weapon your holding is a melee or ranged weapon. (But what to do if one is holding a dagger and a sling?.. mayhap if there is a monster directly in front of you I pick the dagger else I pick the sling...... must think about that one).
Noticed my auto-pickup code wasnt working last night too.
Filed Under : Computers • Development • Cracks and Crevices •
Comments are closed There are no comments on this entry.