Re: Prompt, & do_flee.

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 11/26/01


On Mon, 26 Nov 2001, David Cole wrote:

> Still having some problems with the battle prompt, I've tried to do what
> someone told me, with the FIGHTING(d->character) but no working.

I think I misunderstood who you wanted to print.  Did you want to print
the person tanking _for_ you?  In that case, it's:

  if (FIGHTING(d->character) && FIGHTING(FIGHTING(d->character))) {
    sprintf(prompt + strlen(prompt), " T: %s ",
            PERS(FIGHTING(FIGHTING(d->character)), d->character));
  }

The tank variable is pointed towards (deep breath) the person that the
person you're fighting is fighting.  So let's say that you are in a group
and you're fighting the dracolich, who is fighting your group leader.  You
are d->character:

  d->character == You (Cole)
  FIGHTING(d->character) == dracolich
  FIGHTING(FIGHTING(d->character)) == Group leader

I think this is what you wanted.

PERS is a macro that prints either the name or the "someone" depending
upon whether the target is visible.  As with before, you don't need two
separate if clauses for color/not.  Not only are you not using colors in
either string, but there's an established way to add colors to strings for
those who want them.  E.g., to colorize the above sprintf()...

  sprintf(prompt + strlen(prompt), " T: %s%s%s ",
          CCRED(d->character, C_CMP),
          PERS(FIGHTING(FIGHTING(d->character)), d->character),
          CCNRM(d->character, C_CMP));

If d->character has a color level less than complete, no colors will be
sent.

> I tried adding a dirs[dir] and changing the send_to_char to a [...]

attempt is the direction that is moved in, not dir.

-dak

--
   +---------------------------------------------------------------+
   | 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 : 12/06/01 PST