/* Generic Light switch jokes. 6-5-92 Light switch which makes room dark or light. C. Regis Wilson Create a $thing named "generic light switch" and set $switch to equal that object value. Please note there are three verbs in here, separated by comments.... @verb $switch:turn none on this @property $switch.on_msg "turn on the light." @property $switch.oon_msg "turns on the light." @property $switch.off_msg "turn off the light." @property $switch.ooff_msg "turns off the light." */ loc = this.location; if (is_player(loc)) loc = loc.location; endif not_on = prepstr == "on"; if (loc == player.location) if ((loc.owner == player) || (player.wizard)) if ((loc.dark && (prepstr == "on")) || (!loc.dark && (prepstr == "off"))) loc.dark = !loc.dark; this.location:announce(player.name," ",this.("o"+prepstr+"_msg")); player:tell("You ",this.(prepstr+"_msg")); else player:tell("The room is not ",not_on ? "dark" | "lit","."); endif else player:tell("You are not able to turn the lights ",prepstr,"."); endif else player:tell("You may not do that when you are not in the room."); endif /* @verb #74:look_self this none this */ pass(); player:tell("The lights are ",((player.location).dark ? "off." | "on.")); /* @verb #74:"flip flick switch" this none none */ loc = this.location; if (is_player(loc)) loc = loc.location; endif prepstr = loc.dark ? "on" | "off"; if (loc == player.location) if ((loc.owner == player) || (player.wizard)) loc.dark = !loc.dark; this.location:announce(player.name," ",this.("o"+prepstr+"_msg")); player:tell("You ",this.(prepstr+"_msg")); else player:tell("You are not able to turn the lights ",prepstr,"."); endif else player:tell("You may not do that when you are not in the room."); endif