Mob condition during combat

From: Curtiss Cicco (
Date: 08/21/95

    Not recently but in the past I have seen posts regarding the display
ing automatically of a mobs condition during combat. The first method of
accomplishing this is to fit it into the players prompt, sure it adds a
little more flavor to the players prompt, but this method has been known
to crash muds. An example of this is when I added it to my sources and
ran it, it would run fine when it would display for mortals, but when a
god would outright kill a mob it appeared to work fine too, but the first
command entered after combat would crash the mud. I had three options,
first, make it to where gods couldn't kill at all, second, fix the broken
code, third, try the second method, I decided to try the second method
before I would make my final decision on which plan I would use. After
trying the second method, I found it to run smoother then the first and
wouldn't crash the mud, so I chose to stay with the second method. Here's
all that was needed to accomplish the second method:

   in fight.c add a prototype of diag_char_to_char() in the external
   procedures section. Then on the last line before the closing brace
   of dam_message() add diag_char_to_char(vict, ch);. Then in the func
   skill_message on the line before } return 1; add another call to
   diag_char_to_char() just like the first one. If you wonder why I
   had to add another call to the same function, just read the comments
   inside of damage(). After going back and checking the damage() func
   it has occurred to me that the two calls to diag_char_to_char might
   be better suited inside this function instead of the two other funcs.
   Both ways are correct but the second way in terms of code structure
   is less spaghetti like.

  From this the diag_char_to_char function could be expanded upon to make
it more complex as to display different messages with respect to being
called in combat or by do_diagnose from a non-combatant.


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