Re: [Circle] [Code] Secret Doors help.

From: Daniel Koepke (dkoepke@california.com)
Date: 11/28/96


On Thu, 28 Nov 1996, DJ Pure wrote:

> G'ady all.
> I've tried to add secret doors to my code. Well. it doesn't seem to
> "pickup" that a doors is secret. It displays secret doors as Normal closed
> doors. I don't know how to find what the BITFLAG is set for door.
> 
> I've done this.
> 
> <In structs.h>
> // Exit info: used in room_data.dir_option.exit_info 
> #define EX_ISDOOR		(1 << 0)   // Exit is a door		
> #define EX_CLOSED		(1 << 1)   // The door is closed	
> #define EX_LOCKED		(1 << 2)   // The door is locked	
> #define EX_PICKPROOF	(1 << 3)   // Lock can't be picked	
> #define EX_SECRET		(1 << 4)   // The door is secret and can be opened.

You don't need the following two. It is a bitvector, so the
following two are a waste of bits. EX_SECRET | EX_PICKPROOF
would accomplish the exact same thing.

> #define EX_SECRET_LOCKED (1 << 5)  // The secret door is locked
> #define EX_SECRET_PP    (1 << 6)   // The secret door can't be picked.
> 
> 
> <in act.informative.c>
> void do_auto_exits(struct char_data * ch)
> {
>   int door;
> 
>   *buf = '\0';
> 
>   for (door = 0; door < NUM_OF_DIRS; door++)
>      if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE)
         if (IS_SET(EXIT(ch, door)->exit_info, EX_SECRET))
           continue;
         else if (IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
            sprintf(buf, "%s-%s# ", buf, capdirs[door]);
         else
            sprintf(buf, "%s-%s ", buf, capdirs[door]);
> 
>   sprintf(buf2, "%s[ Exits: %s]%s\r\n", CCCYN(ch, C_NRM),
> 	  *buf ? buf : "None! ", CCNRM(ch, C_NRM));
> 
>   send_to_char(buf2, ch);
> }
> 
> 
> Also, what does this mean ??
>      if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE)
> my guess is this. That the door direction (0=north, etc) is in the room as
> the char AND that the door in the room DOESN'T point to the NOWHERE room.
> Also, (if this is the case) why bother having the check to the NOWHERE
> room?

It checks that there is an exit structure to the door and that the
exit does not lead to NOWHERE, because -1 (which is NOWHERE) can
be set to a room even when an exit is existant, and does have a
purpose in stock Circle. For instance, creating an exit where you
can do: "look east" but you can't move east.


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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