Blood Left Behind [by Rasdan]
Snippet Posted Wednesday, August 12th @ 11:24:35 PM, by George Greer in the Rooms dept.
Added Jul 6, 1998. Click the link below to read it or download it.

From: Rasdan <rasdan@PEAK.ORG>
Subject: Blood left behind

Want to add blood left behind from kills to rooms? Try this:

In structs.h, room structure: add this:
byte blood;

In utils.h, add: #define RM_BLOOD(rm)   ((int)world[rm].blood)

In wherever you want, add:

void update_blood(void)
{
  int i;
  extern int top_of_world;

  for (i = 0; i < top_of_world; i++)
    if (RM_BLOOD(i) > 0)
      RM_BLOOD(i) -= 1;
}

In fight.c add this (above the damage function):
void increase_blood(int rm)
{
  RM_BLOOD(rm) = MIN(RM_BLOOD(rm) + 1, 10);
}

In die(), before anything else, add:

increase_blood(victim->in_room);

In act.informative.c:

Top of do_look:

char *blood_messages[] = {
  "Should never see this.",
  "There's a little blood here.",
  "You're standing in some blood.",
  "The blood in this room is flowing.",
  "There's so much blood here it's intoxicating!",
  "How much more blood can there be in any one room?",
  "Such carnage. The God of Death is feastin' tonight!",
  "You are splashing around in the blood of the slain!",
  "Even the walls are revolted by the death and destruction!",
  "The Gods should show some mercy and cleanse this horrid room!",
  "So much blood has been shed here, you are drowning in it!",
  "\n"
};

IMMEDIATELY below the room description sending add:

if (RM_BLOOD(ch->in_room) > 0)
  act(blood_messages[RM_BLOOD(ch->in_room)], FALSE, ch, 0, 0, TO_CHAR);

--
And that's it. :)

Adding spells that require a certain amount of blood in the room should be
no problem if you use this :)

If you use this, just drop me an email letting me know, and maybe (if you
are so inclined) a message in the credits of your mud.

Rasdan


<< Beep Command [by Lord Kyu] | Reply | View as text | Flattened | Board code -- Replies [by tigeba] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.