Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Question about cast_spell()



> > From: Raphael writes:
> > 
> > So I would like to know when the "temporary object" stuff was added in
> > cast_spell() and if its only purpose is to adjust the caster's level
> > to that of the scroll, rod or wand.  Is the author of that code
> > reading this?
> 
> 	I would love to hear from the authour also about how the 
> 	spellcasting object is supposed to work.

Humm, I had done that.  I remember having good reasons for
needing to do a spellcasting object.  It worked pretty well
at the time but I think coding changes since then have made
it precarious.

The spellcasting object was done long before Brian started
hacking in the skill stuff.

I can't remember all of the reasons but some were:

a) changing the casting level when a wand was being used.
This allowed the finding of wands of various powers as well
as of various amounts of charges.

b) making it possible to NOT award exp to the user of a 
wand.  It didn't seem quite right for a fighter to get all
sorts of mage experience for shooting off a wand, or for
a wizard to go up 10 levels simply because he found
a wand of large fireball with lots of charges.

c) keeping the results of wand creation OWNED by the wand user,
so funky things didn't happen, while still allowing a) and b).
This last was very important for controlling golems, etc.

Rather than write special purpose code in each spell to
detect for a wand being used, and doing the right thing,
I invented the casting object, so that all these things
could be set up at ONE place in the code.

It's possible that the skill system has made a more
graceful implementation of these things possible.

If so, I'd advise ripping the code out and putting new in.

PeterM