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 web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.