Building: RoomGroups
Room groups are a bunch of rooms associated for various purpose. They are represented as a
room (or a seperate standalone object) with some special properties:
- array of roomgroup.room.X
IDs of all the rooms that can be acccessed within this group without any possibility of obstruction. The RoomGroup itself can be included as a room in the list. Each of these rooms must have a roomgroup property that points back to this object. - array of roomgroup.door.X
ID of the door between this group and another RoomGroup
A RoomGroupDoor
is a door or other door-like object that might block certain effects from spreading to an adjacent RoomGroup- flag.RoomGroupDoor
- roomgroup
ID of the RoomGroup it is part of. To get the RoomGroup at the other side of the door, get this property from its 'other' door. Any applicable lib called on the RoomGoup also gets called on this, and the lib will know how to decide if it should flow into the next room group - Various Flags on it can decide what effects it will block when closed, e.g:
Watertight, Airtight, Soundproof and probably others
note - probably want to add a trap here too, so you can do custom magic instead - There will be some magic so that changing the door's state can cause some effects present on one side to propogate to the other
Certain libs and traps called on a room or roomgroupdoor, that are part of a roomgroup, will:
- Automaticaly be called on all subrooms
- Spread to linked RoomGroups providing its RoomGroupDoor doesnt prevent it
Example of RoomGroups in action
room1 is a RoomGroup 'containing' room2 and room3 room4 is a RoomGroup 'containing' room5 and room6 room1 is linked to room4 by a RoomGroupDoor: door1 depressurise(room1) will: - Notice that room1 has a roomgroup property, and get the roomgroup's subrooms: - Perform depressurisation stuff on on rooms 1, 2 and 3 - notice the roomgroup is linked to another roomgroup and check the state and flags on the roomgroupdoor: - If door1 is open then depressurise(group2) - If door1 is closed or locked but does not have flag.Airtight then it will call depressurise(group2) etc.
Suggested libs that would use this
- pressurise() as now, but spread [Done]
- depressurise() as now but spread [Done]
- flood() fill rooms with water
- drain() drain rooms of water
- yell could use this and flag.Soundproof to decide how far to be heard?