> cat /wizhelp/wizcoding5
> _
======================================================================== Wizard Coding 5: Special Effects ======================================================================== Add interactive features to your rooms. CUSTOM COMMANDS IN ROOMS: ```python def load(): room = Room(name="yourname_shrine") def pray_command(player, params): """pray - Pray at the shrine""" player.message("You kneel and pray...") player.current_hp = player.max_hp player.message("You are healed!") room.custom_commands = {"pray": pray_command} return room ``` RANDOM ROOM DROPS: ```python from lib.special_rooms import RandomRoom def load(): return RandomRoom( name="yourname_vault", description="Treasures glitter everywhere!", drop_chances={ 'coins': 60, 'weapon': 20, 'healing': 20 }, base_coin_range=(100, 500) ) ``` SEARCH ROOMS: ```python from lib.search_room import SearchRoom def load(): return SearchRoom( name="yourname_library", description="Old books line the shelves.", search_items=[ ('heal_100', None), ('coins_250', None) ] ) ``` ROOM EVENTS: ```python def load(): room = Room(name="yourname_trap") def on_enter(player): """Triggered when player enters""" if random.random() < 0.5: player.message("A dart shoots out!") player.take_damage(50) room.on_enter = on_enter return room ``` TESTING TIPS: - Use goto repeatedly - Try all commands - Test with low HP - Verify reset timers ========================================================================
> _