Re: Spell Targets

From: Angus Mezick (angus@EDGIL.CCMAIL.COMPUSERVE.COM)
Date: 04/23/98


that works great for TAR_ROOM_CHAR and TAR_DOOR_CHAR, but what about
TAR_ROOM_WORLD and TAR_ROOM_MOB.  hmm... i think i have come up something rather
flexible.  Just pass this struct around filling in the required places, and
letting the TAR_* take care of which member is valid.  I am really trying to
avoid manual spells, because I see a lot of these spells coming in.


struct spell_target {
  struct char_data *tch;
  struct obj_data *tobj;
  struct room_direction_data *tdir;
  struct room_data *troom;
  struct someothertarget_data *tother; /* just an example */
};

and then we just set the targets we need and use the TAR_* flags to determine
which flags are needed.

--Angus

______________________________ Forward Header _____________________________
Subject: Re:  Spell Targets
Author:  INTERNET:CIRCLE@POST.QUEENSU.CA at CSERVE
Date:    4/23/98 4:52 PM

On Thu, 23 Apr 1998, Angus Mezick wrote:

> Well, we all know that spells can be targeted at char's and obj's.  but what >
about rooms and doors?  I am trying to make a knock spell, but i am also trying
> to avoid passing the direction pointer around.  what i am leaning towards is
> either adding the tdoor and troom along side the tch and tobj, or just go
ahead
> and put all four of them in to a tstruct and work it from there.  Has anyone
> done this and have suggestions?  We have delayed spells that do a countdown
> between cast_spell and call_magic.

I coded them as manual spells and used George's idea for spell
arguements. If you'll hit his page of patches, you'll find on there for
spell arguements. When I played with the idea, he had it listed under
"experimental", but should have moved it from there since there.

It worked quite well.

I also did the same thing for the ones that target the room, the few
spells that give the room affects, assume that the target is the room.
There is a "room affects" snippet out there somewhere. I think it's on
Alex's list of snippets. Works pretty well too.

John Evans <evansj@hi-line.net>  --  http://www.hi-line.net/~evansj/

Any sufficiently advanced technology is indistinguishable from magic.
  -- Arthur C. Clarke


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST