Re: [Circle] wall of fog

From: The Arrow (pt94jpi@student.hk-r.se)
Date: 08/06/96


On Tue, 6 Aug 1996 goamkows@kirk.geog.sc.edu wrote:

> well, i've got a working wall of fog spell, but i doubt if it is any
> efficient ;)  basically, when a player moves into a room or does look,
> it checks all the objects in the room for a "fog" object.  if it finds
> one, it obscures their vision:
> 
> 	for (j = world[ch->in_room].contents; j; j = next_thing) {
> 	  next_thing = j->next;
> 	  if (GET_OBJ_VNUM(j) == 32) {
> 		send_to_char("A cloud of fog obscures your vision", ch);
> 		return;
> 	  }
> 	}
> 
> but, to have to go through all the objects in a room, every time any
> player moves into any room, seems like a grossly inefficient way to do
> this.  anybody have any suggestions on a better way to go about this?

Some time ago I played around with room affections. It is like character 
affections but on rooms instead. Add a new field "long room_affections;"
(or whatever you like) in your room structure, and
"#define RAFF_FOG   (1 << 0)" in structs.h.
Then set the flag in the room when casting the spell, and check for 
it when a player enters the room.

/ Joachim 

---------------------------------------------------------------------
  The Arrow              Moses@PTMUD   sargasso.fukt.hk-r.se 4000

  Joachim Pileborg       Email: pt94jpi@student.hk-r.se
  Svarvarevägen 5
  37230 Ronneby          http://www.rby.hk-r.se/~pt94jpi/pt94jpi.html
  SWEDEN
---------------------------------------------------------------------

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