Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Balances.inf

18. That's all of the object definitions: just a little code and grammar left (lines 1816-1866)

1816  [ Initialise;
1817   
1818    location = Hut;
1819    move burin to player;
1820    move players_coin to player;
1821    move players_book to player;
1822   
1823    thedark.description =
1824        "It is pitch black.  You are likely to be eaten by a grue.";
1825    ! (In fact you are stone-cold certain not to be, but never mind.)
1826   
1827    players_book.learn_spell(gnusto_spell);
1828    players_book.learn_spell(frotz_spell);
1829    players_book.learn_spell(yomin_spell);
1830    players_book.learn_spell(rezrov_spell);
1831   
1832    helistars_book.learn_spell(frotz_spell);
1833    helistars_book.learn_spell(lleps_spell);
1834    helistars_book.learn_spell(mortin_spell);
1835   
1836    give gnusto_spell known_about;
1837   
1838   "^^^^^[Welcome to a short story called ~Balances~, one of the example
1839         games for the Inform design system. Some people may recognise the
1840         setting, but others might like to type ~how do spells work~ -
1841         the game responds to a few such questions.]
1842       ^^You feel a little confused as to how you got here.  Something
1843         to do with Helistar!  That's right, and how the world is so far
1844         off balance nowadays, after the Great Change.^^";
1845  ];
1846   
1847  [ PrintRank;
1848    print ", earning you the rank of ";
1849    if (score >= 50)  "Scientist.";
1850    if (score >= 40)  "Spellbreaker.";
1851    if (score >= 30)  "Sorcerer.";
1852    if (score >= 20)  "Enchanter.";
1853    if (score >= 10)  "novice Enchanter.";
1854    "lost dreamer.";
1855  ];
1856   
1857  [ DiagnoseSub;
1858    switch(memory.capacity)
1859    {   5: "You feel fine, and your memory is unimpaired.";
1860        4: "You feel shaky after your brush with death, but your mental
1861            faculties seem sound.";
1862        3: "For someone who has died twice, you're in reasonable shape.";
1863    }
1864    "How many times have you died now?  Your memory isn't what it was.";
1865  ];
1866   


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.