Re: [SPELL] Thoughts on Mirror Image

From: Doppleganger Software (doppsoft@TZC.COM)
Date: 12/28/97


>[Mirror Images thoughts]


Well, I have the spell implemented on my MUD, under a different name, and
I actually have it so that more than 3 images are possible.  I used one
of the saved values in the char data (like where you put race info, and
where the practice settings are stored) and then have a macro
GET_IMAGES() that gets the value.  Then in the damage routine, I just
have it so that it checks to see if they hit the real one or an image.
If it's the real one, it does damage normall, if it's an image, it just
subtracts 1 from the GET_IMAGES.  I do the same thing for stoneskin.

However, your way will work if you only plan to have max 3 images.
Although for me, I don't like to waste a single affect flag....with 96+
of them, I can't afford to waste them.  What you would need is a function
in your damage routine that checks for the spell, and then alters the
affect.  Here's a quick hack, I can't guarantee that it will work however.

You will need to have a define of
  struct affected_type *af;
  int images = 0;
at the top of damage()

if (is_affected_by_spell(victim, SPELL_MIRROR_IMAGE)) {
  for(af = victim->affects; af; af = af->next) {
    if (af->spellnum == SPELL_MIRROR_IMAGE) {
       if (af->bitvector == AFF_MIRROR3)
         images = 4;
       if (af->bitvector == AFF_MIRROR2)
         images = 3;
       if (af->bitvector == AFF_MIRROR1)
         images = 2;
       if (number(1, images) == 1) {
         REMOVE_BIT(AFF_FLAGS(victim), af->bitvector);
         if (af->bitvector == AFF_MIRROR3)
           af->bitvector = AFF_MIRROR2;
         if (af->bitvector == AFF_MIRROR2)
           af->bitvector = AFF_MIRROR1;
         if (af->bitvector == AFF_MIRROR1)
           affect_from_char(af, victim);
         affect_total(victim);
         act("$n hits one of your images and it vanishes!", FALSE, ch, 0,
victim, TO_VICT);
         act("$n hits one of the images of $N and it vanishes!", FALSE,
ch, 0, victim, TO_NOTVICT);
         act("You hit one of the images of $Nand it vanishes!", FALSE,
ch, 0, victim, TO_CHAR);
         return;
       }
     }
   }

Please note, this is a quick hack, and I don't offhand remember the names
of all parts of the affected_type structure (in specific, I don't
remember if spellnum is the right one) so you will have to figure out
what it is, and make it work.  However, my personal opinion is that this
is the clumsier way.  Your choice.  However, don't expect me to post the
other way...you gotta figure that one out from my description :P


     +------------------------------------------------------------+
     | 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/08/00 PST