Complete reference for room behavior flags
This document provides comprehensive information about all room flags (ROOM_*) used in LuminariMUD. Room flags control various mechanics, restrictions, and behaviors of rooms throughout the game world.
Room flags are bitflags defined in src/structs.h (lines 225-271) and are checked throughout the codebase using the ROOM_FLAGGED() macro. There are currently 42 room flags (indices 0-41) that control everything from movement restrictions to magical effects.
Usage Pattern:
if (ROOM_FLAGGED(room_rnum, ROOM_FLAGNAME)) {
// Flag is set, apply restrictions/effects
}
Effect: Limits the number of characters that can be in the room simultaneously.
CONFIG_TUNNEL_SIZECode References: movement.c:545, 551 | desc_engine.c:683
Effect: Forces characters to move through the room one at a time in combat situations.
Code References: movement.c:306, 914 | fight.c:216, 7895, 12269, 13997 | 20+ additional checks
Effect: Characters must be flying to remain in the room; non-flying characters fall.
Code References: movement_falling.c:47, 72 | craft.c:664, 700
Effect: Requires a skill check to enter the room.
Code References: movement.c:570 | craft.c:666, 702
Effect: Prevents flying creatures from entering the room.
Code References: movement.c:501
Effect: Limits room to 2 occupants maximum.
Code References: movement.c:1249 | act.wizard.c:268, 347 | spells.c:299
Effect: Only staff (LVL_STAFF+) can enter this room.
Code References: movement.c:563
Effect: Completely prevents all magic from functioning in the room.
Code References: spell_parser.c:540, 547, 3046 | fight.c:8518, 8522, 8639 | magic.c:12643
Effect: Prevents teleportation into or out of the room.
Code References: spells.c:314, 2199-2398 | act.other.c:808, 896, 11637
Effect: Prevents summoning spells from targeting this room.
Code References: spells.c:2912-2913
Effect: Prevents recall/return spells from working.
Code References: spells.c:2200-2399 (8 matches)
Effect: Prevents all forms of combat and aggressive actions.
Code References: fight.c:1509, 5370, 12251, 12259 | spells.c:698, 756, 881, 916, 1319, 1810, 2569, 2598 | grapple.c:218 | domain_powers.c:76, 818, 903, 988, 1073, 1156
Effect: Kills characters or deals severe damage when entering/remaining in room.
Code References: act.informative.c:1263, 1475 | movement.c:1256 | mob_act.c:400 | spells.c:302
Effect: Blocks sound-based abilities and prevents communication.
Code References: act.comm.c:465, 473, 810, 984 | bardic_performance.c:264 | spell_parser.c:1770 | act.social.c:275
Effect: Marks room as indoors for various game mechanics.
Code References: utils.c:823, 911 | movement.c:1372 | vessels_rooms.c:40-96, 190-191, 606
Effect: Doubles natural regeneration rates for HP, mana, and movement.
Code References: limits.c:595 | spell_prep.c:3778
Effect: Prevents natural healing and regeneration.
Code References: limits.c:622
Effect: Forces the room to be dark regardless of other conditions.
Code References: utils.c:3594, 3656, 3697 | act.informative.c:1282-1383 | magic.c:12654, 12658 | mud_event.c:169
Effect: Creates magical darkness that penetrates normal light sources.
Code References: utils.c:3596, 3643, 3697 | act.informative.c:1205, 1211, 1296, 8463
Effect: Creates magical light that prevents the room from being dark.
Code References: utils.c:3626
Effect: Creates fog that obscures vision and limits visibility.
Code References: act.informative.c:1199, 1259, 1447, 1550, 1572, 8458, 8617, 8977 | spells.c:515, 519 | utils.c:917, 3699
Effect: Prevents tracking abilities from working through this room.
Code References: movement_tracks.c:256 | graph.c:59 | mob_act.c:383
Effect: Marks room as part of a player house.
Code References: house.c:296, 444, 626, 663, 665, 714, 849, 904 | handler.c:2212-2213, 2247-2248
Effect: Marks room as a house atrium (entry point).
Code References: house.c:446, 628, 657, 678, 682 | movement.c:520 | hsedit.c:168, 206, 224, 230
Effect: Marks room as part of the overworld/wilderness map system.
Code References: act.informative.c:8554 | asciimap.c:729 | routing.c:290 | act.wizard.c:10211
Effect: Marks room as part of a vehicle or vessel.
Code References: vessels_rooms.c:40-103, 188-189 | vessels_src.c:282, 301, 368, 384, 505-506
Effect: Marks room as a resource harvesting location.
Code References: crafting_new.c:531
Effect: Marks room as a player-run shop.
Effect: Marks room as a road or path.
Effect: Marks that items in this house room should be saved.
Code References: house.c:296, 714 | handler.c:2213, 2248 | hsedit.c:211
Effect: Marks room as being edited in the Online Level Creator (OLC).
Code References: act.wizard.c:5581, 5587
Effect: Temporary flag used by pathfinding algorithms.
Code References: graph.c:59 | act.wizard.c:5581
Effect: Indicates room description should be generated dynamically.
Effect: Prevents NPCs from entering this room.
Code References: mob_act.c:399
Effect: Marks room as extremely small.
Effect: Marks room as very small.
Effect: Marks room as having an airy, open quality.
Effect: Forces a random trap to always generate in this room.
Code References: traps_new.c:547, 575-576 | db.c:5431
Effect: Marks room as eligible for random treasure chest spawning.
Effect: Indicates the room contains a trap.
Effect: Marks room as occupied or reserved.
Effect: Marks room as a valid docking location for vessels.
| Index | Flag Name | Primary Purpose | Category |
|---|---|---|---|
| 0 | ROOM_DARK | Forces darkness | Vision |
| 1 | ROOM_DEATH | Death trap | Hazard |
| 2 | ROOM_NOMOB | NPC restriction | Movement |
| 3 | ROOM_INDOORS | Indoor room | Environment |
| 4 | ROOM_PEACEFUL | No combat | Combat |
| 5 | ROOM_SOUNDPROOF | Blocks sound | Perception |
| 6 | ROOM_NOTRACK | Blocks tracking | Perception |
| 7 | ROOM_NOMAGIC | No magic | Magic |
| 8 | ROOM_TUNNEL | Occupancy limit | Movement |
| 9 | ROOM_PRIVATE | 2 person limit | Movement |
| 10 | ROOM_STAFFROOM | Staff only | Access |
| 11 | ROOM_HOUSE | Player house | Special |
| 12 | ROOM_HOUSE_CRASH | House save flag | System |
| 13 | ROOM_ATRIUM | House entrance | Special |
| 14 | ROOM_OLC | Being edited | System |
| 15 | ROOM_BFS_MARK | Pathfinding temp | System |
| 16 | ROOM_WORLDMAP | Wilderness map | Special |
| 17 | ROOM_REGEN | Double regen | Environment |
| 18 | ROOM_FLY_NEEDED | Must fly | Movement |
| 19 | ROOM_NORECALL | No recall | Magic |
| 20 | ROOM_SINGLEFILE | One at a time | Movement |
| 21 | ROOM_NOTELEPORT | No teleport | Magic |
| 22 | ROOM_MAGICDARK | Magical darkness | Vision |
| 23 | ROOM_MAGICLIGHT | Magical light | Vision |
| 24 | ROOM_NOSUMMON | No summoning | Magic |
| 25 | ROOM_NOHEAL | No healing | Environment |
| 26 | ROOM_NOFLY | Flying blocked | Movement |
| 27 | ROOM_FOG | Fog obscurement | Vision |
| 28 | ROOM_AIRY | Airy atmosphere | Environment |
| 29 | ROOM_OCCUPIED | Occupied status | Special |
| 30 | ROOM_SIZE_TINY | Tiny size | Size |
| 31 | ROOM_SIZE_DIMINUTIVE | Diminutive size | Size |
| 32 | ROOM_CLIMB_NEEDED | Requires climbing | Movement |
| 33 | ROOM_HASTRAP | Contains trap | Zone Feature |
| 34 | ROOM_GENDESC | Generated desc | System |
| 35 | ROOM_PLAYER_SHOP | Player shop | Special |
| 36 | ROOM_RANDOM_TRAP | Random trap spawn | Zone Feature |
| 37 | ROOM_RANDOM_CHEST | Random chest spawn | Zone Feature |
| 38 | ROOM_HARVEST_NODE | Harvest location | Special |
| 39 | ROOM_ROAD | Road/path | Environment |
| 40 | ROOM_VEHICLE | Vehicle room | Special |
| 41 | ROOM_DOCKABLE | Docking location | Special |
Many flags can be combined for compound effects:
ROOM_DARK + ROOM_MAGICDARK = absolute darknessROOM_PEACEFUL + ROOM_NOMAGIC = complete safe zoneROOM_INDOORS + ROOM_REGEN = safe indoor rest areaROOM_PEACEFUL + ROOM_INDOORSROOM_DEATH + ROOM_NOTELEPORT + ROOM_NORECALLROOM_PRIVATE + ROOM_SOUNDPROOFROOM_DARK + ROOM_NORECALL + ROOM_NOTELEPORTROOM_BFS_MARK (system temporary flag)ROOM_HOUSE_CRASH (auto-set by house system)ROOM_OLC (OLC system flag)// Standard check
if (ROOM_FLAGGED(room_rnum, ROOM_PEACEFUL)) {
// Peaceful room logic
}
// Multiple flags
if (ROOM_FLAGGED(room, ROOM_DARK) && ROOM_FLAGGED(room, ROOM_MAGICDARK)) {
// Absolute darkness
}
// Set flag
SET_BIT_AR(ROOM_FLAGS(room), ROOM_DARK);
// Remove flag
REMOVE_BIT_AR(ROOM_FLAGS(room), ROOM_DARK);
// Check if set
if (IS_SET_AR(ROOM_FLAGS(room), ROOM_DARK)) {
// Flag is set
}
Safe Zones: Typically use ROOM_PEACEFUL to prevent combat. Consider adding ROOM_NORECALL for dungeons where escape should be limited.
Darkness: Use ROOM_DARK for natural darkness, ROOM_MAGICDARK for magical darkness that resists light sources.
Movement Restrictions:
ROOM_TUNNEL limits total occupantsROOM_SINGLEFILE limits combat positioningROOM_PRIVATE limits to 2 peopleMagic Control:
ROOM_NOMAGIC = complete magic shutdownROOM_NOTELEPORT = prevents teleportation onlyROOM_NOSUMMON = prevents summoning onlyROOM_NORECALL = prevents recall onlyPrimary Files:
src/structs.h (lines 225-271) - Flag definitionssrc/movement.c - Movement restriction checkssrc/spell_parser.c - Magic restriction checkssrc/fight.c - Combat restriction checkssrc/utils.c - Light and vision calculationssrc/act.informative.c - Room description handlingsrc/house.c - House system integrationsrc/vessels_rooms.c - Vehicle system integrationROOM_DARK + ROOM_MAGICDARK)ROOM_DOCKABLE, ROOM_OCCUPIED, ROOM_AIRY, etc.)BFS_MARK, OLC, HOUSE_CRASH) should generally not be manually set by builders