magic system coding

Posted by Xinphinity on Wed 19 Oct 2005 04:46 PM — 2 posts, 11,928 views.

USA #0
I'm bumbling my way through changes to the magic system.

First thing I did was remove the local function from magic.c say_spell. So now you see nothing (player, room, victim) when the casting is performed.

But here is what I want.

Firstly, I want to be able to have different messages for different classes of magic. If its cast by a mage, I want to have a message that is like 'you incant an arcane phrase and begin preparing the (spell name) spell', if by a cleric more like 'you quietly prepare a prayer to your god to provide you the (spell name) spell'.

I will determine the messaging on my own that is just an example. Now, if that wasn't tricky enough, I also want this to be spell level percent based, meaning, if they are casting it when they have 20% skill the message might be 'you nervously stammer an arcane phrase' whereas at 100% it would be 'you effortlessly incant'.

You get the point. Ok, next thing, and again I'm looking for advice on how and where to insert this - I'd gladly accept someones offer to provide this but that isnt my expectation.

I'd like to insert a 'preparation time' for the spells based again, on level. The caster can 'try' to cast it as soon as they have prepared it, but, until they reach full preparedness, the have a chance of failure based again on knowledge of the spell, level, and maybe even intelligence, etc.

Could someone evaluate what I am trying to do here and give me some feedback?

Thanks!
USA #1
The first part shouldn't be too hard. Just make your own say_spell function, do an ifcheck for the different classes of mages, then a case switch for the percent.

As for the time, you mean like using cast, and then there's a time before the spell is cast? You'll have to use timers (IE, add_timer) for that, or if you just want a delay/waitstate on the player, that's a bit easier.