Object pirate with daemon [ obj booty_nearby; if (random(100) > 2 || location == thedark or In_Secret_Canyon || location has light || location has nodwarf) return; if (dwarf in location) "^A bearded pirate appears, catches sight of the dwarf and runs away."; objectloop (obj ofclass Treasure && obj in player or location) booty_nearby = true; if (booty_nearby == false) { if (self.has_been_spotted) return; self.has_been_spotted = true; if (self.has_stolen_something) StopDaemon(self); "^There are faint rustling noises from the darkness behind you. As you turn toward them, you spot a bearded pirate. He is carrying a large chest. ^^ ~Shiver me timbers!~ he cries, ~I've been spotted! I'd best hie meself off to the maze to hide me chest!~ ^^ With that, he vanishes into the gloom."; } if (self.has_stolen_something) return; self.has_stolen_something = true; if (self.has_been_spotted) StopDaemon(self); objectloop (obj ofclass Treasure && obj in player or location) { if (obj in player) score = score - 5; move obj to Dead_End_13; } "^Out from the shadows behind you pounces a bearded pirate! ~Har, har,~ he chortles. ~I'll just take all this booty and hide it away with me chest deep in the maze!~ He snatches your treasure and vanishes into the gloom."; ], has_stolen_something false, has_been_spotted false;