[CODE]Your opinion on new spell method

From: Cyberlord (cyberlord@cyber-wizard.com)
Date: 12/07/01

A friend and I are coding a new method to handle spells that allows us to
store the spell in a list and be recalled when it is time for it to fire
again. The spell list as far as I know works fine. Spells are added and
taken off the list with no know problems.

My problem is keeping track of my targets.

My example is the spell 'chain lightning' that is cast one round and hits
it's target, then goes to sleep for 2 rounds and hits the next target...
etc... until the spell wears off or runs out of targets.

I also need to keep track of who has been hit already so they don't get hit

Here is what I am planning, but would like some of your inputs before I code

Initially the spell is cast on a named target. Then that target gets stored
in the target list as someone that has been hit already.

Then every time the spell re-fires, it gets the current list of mobs/players
in the room. Then cycles thru that list comparing the mob/player to the
stored list of mobs/players and if not in that list hit them with the spell
and add them to the list of hit targets.

This seemed the most feesable way to accomplish this (to me), but I am
worried about mobs/players dying and still being stored in the hit targets
list. Will the mud crash if comparing one good target to one that is not
there? I know it will if I try to write to the dead char but will a
comparison crash it? I'd really hate to have to check each target of each
spell every time someone died. *cring*

Anyway, let me know what you think.



   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |

This archive was generated by hypermail 2b30 : 06/24/03 PDT