Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Advent.inf

2. Rules for treasures, which will be scattered all over the game (lines 55-77)

0055  Class   Treasure
0056    with  after [;
0057            Take:
0058              if (location == Inside_Building)
0059                  score = score - self.depositpoints;
0060              score = score + 5;
0061              if (noun hasnt treasure_found) {
0062                  give noun treasure_found;
0063                  treasures_found++;
0064                  score = score + 2;
0065              }
0066              "Taken!";
0067            Insert:
0068              score = score - 5;  ! (in case put inside the wicker cage)
0069            Drop:
0070              score = score - 5;
0071              if (location == Inside_Building) {
0072                  score = score + self.depositpoints;
0073                  "Safely deposited.";
0074              }
0075          ],
0076          depositpoints 10;
0077   


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.