alignment fix

From: Iceblade (iceblade@STARWEB.NET)
Date: 07/27/98


this works now :)

/* When ch kills victim */
/* new alignment algorithm to permit slower changes, taerin 7/27/98 */
void change_alignment(struct char_data * ch, struct char_data * victim)
{
  bool  lose_align = FALSE;
  int   diff_align = 0;

  diff_align = GET_ALIGNMENT(victim) - GET_ALIGNMENT(ch);

  /* if you kill a 'better' person, you shall become more evil */
  if (diff_align >= 0)
    lose_align = TRUE;
  else
    diff_align = -diff_align;

  /* you will always change by at least 1 alignment point */
  diff_align = MAX(1, (diff_align >> 9));

  /* chrs are bound by the -999 and 999 limits, making it possible
     to kill mobs which are more extreme than the chr and allowing
     align swings */
  if (lose_align == TRUE)
    GET_ALIGNMENT(ch) = MAX(-999, GET_ALIGNMENT(ch) - diff_align);
  else
    GET_ALIGNMENT(ch) = MIN(999, GET_ALIGNMENT(ch) + diff_align);
}


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