Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Advent.inf

28. Two brushes with piracy (lines 3153-3188)

3153  Object  pirate
3154    with  daemon [ obj booty_nearby;
3155              if (random(100) > 2 || location == thedark or In_Secret_Canyon ||
3156                  location has light || location has nodwarf) return;
3157              if (dwarf in location)
3158                  "^A bearded pirate appears, catches sight of the dwarf and runs away.";
3159              objectloop (obj ofclass Treasure && obj in player or location)
3160                  booty_nearby = true;
3161              if (booty_nearby == false) {
3162                  if (self.has_been_spotted) return;
3163                  self.has_been_spotted = true;
3164                  if (self.has_stolen_something) StopDaemon(self);
3165                  "^There are faint rustling noises from the darkness behind you.
3166                   As you turn toward them, you spot a bearded pirate.
3167                   He is carrying a large chest.
3168                   ^^
3169                   ~Shiver me timbers!~ he cries, ~I've been spotted!
3170                   I'd best hie meself off to the maze to hide me chest!~
3171                   ^^
3172                   With that, he vanishes into the gloom.";
3173              }
3174              if (self.has_stolen_something) return;
3175              self.has_stolen_something = true;
3176              if (self.has_been_spotted) StopDaemon(self);
3177              objectloop (obj ofclass Treasure && obj in player or location) {
3178                  if (obj in player) score = score - 5;
3179                  move obj to Dead_End_13;
3180              }
3181              "^Out from the shadows behind you pounces a bearded pirate!
3182               ~Har, har,~ he chortles. ~I'll just take all this booty and hide it away
3183               with me chest deep in the maze!~
3184               He snatches your treasure and vanishes into the gloom.";
3185          ],
3186          has_stolen_something false,
3187          has_been_spotted false;
3188   


Last updated 23 June 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.