Re: [Circle] prompt

From: Alvoria MUD (mudguy@conan.ids.net)
Date: 11/18/96


On Tue, 19 Nov 1996, Yasuo Yamamoto wrote:
> I put the following code to make_prompt in comm.c:
> 
>  if (FIGHTING(d->character))
>  {
>   i2 = 100 * GET_HIT(FIGHTING(FIGHTING(d->character)))
>            / GET_MAX_HIT(FIGHTING(FIGHTING(d->character)));
>   ... (etc... )
> 	With this code if you are tanking the mob, you'll see
> 	the buf:<condition> in your prompt. I'm wondering how
> 	to display buf:<condition> only to those who assist
> 	the thank. Any ideas?

You can try examining all the people in the room that are fighting, and
look for a char who is fighting the target, and is being fought by the
target. Then look at the char itself to see if it is fighting the same
target. I believe it would look like the below... (you will need to define
i in the beginning of the function as struct char_data*, and found as an
int ).

found=FALSE;
/* for each person in the same room as the char... */
for(i=world[d->character->in_room].people ; i && !found ; i=i->next_in_room )
  {
    /* if this person is not the char and is fighting */
    if((i!=d->character)&&FIGHTING(i))
      {
        /* and if the char being fought by this person is also fighting
           the person itself... */
        if(FIGHTING(i)==FIGHTING(FIGHTING(i)))
          {
            /* and the person and the player receiving the prompt are both
               fighting the same target... */
            if(FIGHTING(i)==FIGHTING(d->character))
              {
                /* then we have a winner... and set i to the target shared
                   by the char and tank. */
                found = TRUE;
                i=FIGHTING(i)
              }
          }
      }
  }

Then from here you can do the prompt thing using i as the char who's
condition has to be displayed.

Alvoria MUD -- Where things aren't quite the same...
  Address   -- telnet://conan.ids.net:4000/
  Homepage  -- http://users.ids.net/~mudguy/
  (under construction, perhaps not even updated for months to come)

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



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