Re: [NEWBIE] Regen Rooms

From: John Evans (evansj@texas.net)
Date: 02/22/97


On Sat, 22 Feb 1997, Shapeshifter wrote:

>         Right now we are using the Oasis building program and I was
> trying to figure out what some of the room flags are. Things like the
> one that is [ HRSCH ] or the [ * ] room flags. I was thinking if these
> did not do anything special there might be a way to set it so that rooms
> marked with the [ * ] flag regenerated players at a higher/faster rate.

First note...
	The flags HRCRSH, *, and OLC are added to rooms when the mud needs
them, and are removed when they are no longer needed. The HCRSH is for
House Crashes, but I'm not sure about the others. It would be best to
avoid playing with those flags in any form.

>         I was thinking 3 times as much per tick. If anyone has any ideas
> about this please let me know. Thank you for your time and patience in
> reading this.

Here is what I did:

In structs.h ----
Search for:
#define ROOM_OLC                (1 << 14)

Find the last ROOM_XXXX flag and add:

#define ROOM_GOOD_REGEN		(1 << 15)  /* Good Regen Room */

NOTE: The "15" needs to be one number higher than the one above it. This
means that if the last one listed is number 17, the one you add needs to
be number 18.

In olc.h ----
Search For:
#define NUM_ROOM_FLAGS		14

Change it to:
#define NUM_ROOM_FLAGS		15

In constants.c ----
Search for:
/* ROOM_x */
const char *room_bits[] = {
  "DARK",

Goto the bottom of that list, and before:
"\n"

add in:
"GOOD_REGEN"

Those are the basic steps for adding new room flags. Now you have to write
the code for doing something with those flags. In this case, the flags are
only checked every tick, so....

In limits.c ----
Search for:;
int mana_gain(struct char_data * ch)

At the bottom of this function is:
return (gain);

BEFORE that line do something like:
  if (IS_SET(ROOM_FLAGS(ch->in_room), ROOM_GOOD_REGEN))
    gain += gain * 2;

You will need to do the same thing in hit_gain() and in move_gain() as
well. All three of those functions are basically the same, so you should
be able to handle it from there.

Most of this was written in the mailer because I completly yanked the
stock regen code and wrote my own from scratch. Not saying that the stock
one was bad. It just wasn't what I wanted. I coded one that takes into
account race, class, age, conditions, and affected bys as well as the room
flags: ROOM_GOOD_REGEN, ROOM_BAD_REGEN, and ROOM_TINY_REGEN.

Good luck!

John Evans

mailto:evansj@texas.net
http://www.texas.net/~evansj   [RPGs, SCA, MUDs and Search Engines]
slanted.elfwerks.com:2020      [Slanted Reality]

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



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