Re: [CODE]New Consider Command

From: Del (caminturn@earthlink.net)
Date: 11/21/99


(note: your using GET_HIT which may not be 100% at a con, try GET_MAX_HIT)

I was thinking of doing the code something like --
It has not been tested cause I am missing a few things..
but the idea is there..

  /* find damage for ch using same code as game */
    chdam = str_app[STRENGTH_APPLY_INDEX(ch)].todam;
    chdam += GET_DAMROLL(ch);
    if (wielded) {
     chdam += dice(GET_OBJ_VAL(wielded, 1), GET_OBJ_VAL(wielded, 2));
    } else {
     chdam += number(0, 2);     /* Max 2 bare hand damage for players */
     }

    /* find damage for vict */
    victdam = str_app[STRENGTH_APPLY_INDEX(victim)].todam;
    victdam += GET_DAMROLL(victim);

/* How do you change this to be victim??
   if (wielded) {
     victdam += dice(GET_OBJ_VAL(wielded, 1), GET_OBJ_VAL(wielded, 2));
    } else {
   if (IS_NPC(victim)) {
     victdam += dice(ch->mob_specials.damnodice,
ch->mob_specials.damsizedice);
     }
*/

  chvar = (GET_MAX_HIT(vict) / chdam )
               /* dont forget to multily by # of attacks */
  /* for percent chance to hit - not counting thaco */
  chvar = ( chvar / ((GET_HITROLL(ch)*20)/100))

  victvar = (GET_MAX_HIT(vict) / chdam )
               /* dont forget to multily by # of attacks */
  /* for percent chance to hit - not counting thaco */
  victvar = ( victvar / ((GET_HITROLL(ch)*20)/100))

/* at this point it should be number of rounds it should be to kill */

  if (chvar > victvar)
   /* do all the easy messages */

   if (chvar < victvar)
   /* do all the hard messages */

-----Original Message-----

Ok.. here is my version of the consider command..
There is probably a better way to do this, but it works.
If you use it please give me credit somewhere.

To use this you have to remove your current do_consider.

------- START OF CODE ----------

ACMD(do_consider)
{
  struct char_data *victim;
  int diff, var1, var2;

  one_argument(argument, buf);

  if (!(victim = get_char_room_vis(ch, buf))) {
    send_to_char("Consider killing who?\r\n", ch);
    return;
  }
  if (victim == ch) {
    send_to_char("Easy!  Very easy indeed!\r\n", ch);
    return;
  }
  if (!IS_NPC(victim)) {
    send_to_char("Would you like to borrow a cross and a shovel?\r\n", ch);
    return;
  }

  diff = (GET_LEVEL(victim) - GET_LEVEL(ch));

  if (diff <= -15)
    send_to_char("VICTIM'S LEVEL          : Pathetic.\r\n", ch);
  else if (diff <= -10)
    send_to_char("VICTIM'S LEVEL          : Much Lower.\r\n", ch);
  else if (diff <= -5)
    send_to_char("VICTIM'S LEVEL          : Lower.\r\n", ch);
  else if (diff <= -2)
    send_to_char("VICTIM'S LEVEL          : A Little Lower.\r\n", ch);
  else if (diff <= -1)
    send_to_char("VICTIM'S LEVEL          : About Equal.\r\n", ch);
  else if (diff == 0)
    send_to_char("VICTIM'S LEVEL          : About Equal.\r\n", ch);
  else if (diff <= 1)
    send_to_char("VICTIM'S LEVEL          : About Equal.\r\n", ch);
  else if (diff <= 4)
    send_to_char("VICTIM'S LEVEL          : A Little Greater.\r\n", ch);
  else if (diff <= 9)
    send_to_char("VICTIM'S LEVEL          : Greater.\r\n", ch);
  else if (diff <= 14)
    send_to_char("VICTIM'S LEVEL          : Much Greater.\r\n", ch);
  else if (diff >= 15)
    send_to_char("VICTIM'S LEVEL          : Vastly Superior.\r\n", ch);

  var1  = abs(GET_HIT(ch) - GET_HIT(victim)) * 100 / GET_HIT(ch);
  var2 = abs(GET_HIT(ch) - GET_HIT(victim)) * 100 / GET_HIT(ch);

 if(GET_HIT(ch) <  GET_HIT(victim))
 diff = var1;
 else
 diff = var1 - (var1 * 2);

<snip>


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



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