previous postings of do_flee

From: Michael K. Lee (mklee@Sun2.IS.csupomona.edu)
Date: 09/24/95


>From old postings, we know that patch 8 doesn't subtract
exp from fleeing.  So, I took out the if(FIGHTING(ch))
since the player is not in that state after do_simple_move,
if I am not mistaken.  Does anyone have a suggestion for
the loss equations?  The loss equations are based on 
FIGHTING state, and if the player is not in the FIGHTING state
after do_simple_move,it is not calculating the loss exp.


thanks for your help


and here it is...

ACMD(do_flee)
{
  int i, attempt, loss;
  if (!FIGHTING(ch)) {
        act("$n panics but nobody knows why!", TRUE, ch, 0,0, TO_ROOM);
        send_to_char("Easy! Easy! Don't panic, nobody is fighting you.\r\n",
                ch);
        return;
        }

  for (i = 0; i < 6; i++) {
    attempt = number(0, NUM_OF_DIRS - 1);       /* Select a random 
direction */
    if (CAN_GO(ch, attempt) &&
        !IS_SET(ROOM_FLAGS(EXIT(ch, attempt)->to_room), ROOM_DEATH)) {
      act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM);
      if (do_simple_move(ch, attempt, TRUE)) {
        send_to_char("You flee head over heels.\r\n", ch);
/*      if (FIGHTING(ch)) { */

          if (!IS_NPC(ch)) {

/* it don't like it here because of the (FIGHTING) state */

            loss = GET_MAX_HIT(FIGHTING(ch)) - GET_HIT(FIGHTING(ch));
            loss *= GET_LEVEL(FIGHTING(ch));
            gain_exp(ch, -loss);
            sprintf(buf, "You just lost %d points from fleeing.\r\n", loss);
            send_to_char(buf, ch);
          }
/*        if (FIGHTING(FIGHTING(ch)) == ch)
            stop_fighting(FIGHTING(ch));
          stop_fighting(ch);
        } */
      } else {
        act("$n tries to flee, but can't!", TRUE, ch, 0, 0, TO_ROOM);
      }
      return;
    }
  }
  send_to_char("PANIC!  You couldn't escape!\r\n", ch);
}



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