Re: [CODE] Damage Messages

From: John Evans (evansj@HI-LINE.NET)
Date: 12/06/97


On Sat, 6 Dec 1997, MUDaholic wrote:

> I was wanting to change around the damage messages, because right now it's
> based on the damage you do, but I wanted it to be how much percent of their
> max hp you do...like if the mob has 10 max hit, and you do 100 damage, it
> would be UNGODLY amounts of damage, and yet if the mob had 30k max hit, and
> you did 9999 damage, it would only be a extremely hard, or a massacre, or
> whatever.  I looked through the damage_messages in fight.c, but I didn't
> really see how the amount of damage you did was incorporated...could anyone
> please help me out? If you've done it, some code would be nice, but just
> pointers would be great too.
>
>

Right now the damage messages are based off of literal damage, not
relative damage. You seem to have already figured that out. If I
understand your query right, you want to have the message "increase" as
the percentage of HPs removed increases.

Instead of checking for literal damage like so:

  if (dam == 0)         msgnum = 0;
  else if (dam <= 2)    msgnum = 1;
  .....
  else                  msgnum = 8;


You would want to check for percentage damage like so:

percent = (dam / GET_MAX_HIT(victim)) * 100;

  if (percent == 0)        msgnum = 0;
  else if (percent <= 10)  msgnum = 1;
  .....
  else                     msgnum = 8;

That should do what you are looking for.

John Evans <evansj@hi-line.net>

May the source be with you.


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