Inform - Resources - Examples

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing Balances.inf

5. The player's spell book, and three initial spells (to go with gnusto): (lines 596-673)

0596  SpellBook players_book "spell book"
0597    with name "spell" "book" "my" "spellbook",
0598         description "My Spell Book^";
0599   
0600  Spell frotz_spell
0601    with name "frotz",
0602         purpose "cause an object to give off light",
0603         magic
0604         [;  if (second==0) "There is a brief, blinding flash of light.";
0605             if (second has animate)
0606                 "The spell, not designed for living creatures, goes sour.";
0607             if (second in compass)
0608                 "The spell dissipates vaguely.";
0609             give second light;
0610             print_ret
0611              "There is an almost blinding flash of light as ", (the) second,
0612              " begins to glow!  It slowly fades to a less painful level, but ",
0613              (the) second, " is now quite usable as a light source.";
0614         ],
0615         unmagic
0616         [;  if (second==0) "There is a brief moment of deep darkness.";
0617             if (second has animate)
0618                 "The spell, not designed for living creatures, goes sour.";
0619             if (second in compass)
0620                 "The spell dissipates vaguely.";
0621             if (second hasnt light)
0622                 print_ret (The) second, " isn't producing light as it is.";
0623             give second ~light;
0624             print_ret "A pool of darkness coagulates around ", (the) second,
0625                   " but slowly fades back to normality.  Still, ",
0626                   (the) second, " is no longer any kind of light source.";
0627         ];
0628   
0629  Spell rezrov_spell
0630    with name "rezrov",
0631         purpose "open even locked or enchanted objects",
0632         magic
0633         [;  if (second==0) "The world is open already.";
0634             if (second has animate)
0635                 "It might be a boon to surgeons if it worked, but it doesn't.";
0636             if (second has open || second hasnt openable)
0637                 "It doesn't need opening.";
0638             if (second hasnt locked)
0639             {   give second open;
0640                 print_ret (The) second, " opens obediently. 
0641                 Like swatting a fly with a sledge hammer, if you ask me.";
0642             }
0643             give second open ~locked;
0644             print "Silently, ", (the) second, " swings open. ";
0645             if (second has container) <<Search second>>; new_line; rtrue;
0646         ],
0647         unmagic
0648         [;  if (second==0) "The world is closed already.";
0649             if (second has animate)
0650                 "Happily, that is unnecessary.";
0651             if (second has locked || second hasnt lockable)
0652                 "It doesn't need locking.";
0653             give second ~open locked;
0654             "Silently, ", (the) second, " swings shut and locks.";
0655         ];
0656   
0657  Spell yomin_spell
0658    with name "yomin",
0659         purpose "mind probe",
0660         magic
0661         [;  if (second==0 || second hasnt animate)
0662                 "That must be either vegetable or mineral.";
0663             if (second==player) "You give yourself a mild headache.";
0664             print_ret "You look into the rather ordinary thoughts of ",
0665                       (the) second, ".";
0666         ],
0667         unmagic
0668         [;  if (second==0 || second hasnt animate)
0669                 "That must be either vegetable or mineral.";
0670             if (second==player) "You give yourself a mild headache.";
0671             print_ret (The) second, " is rather shocked, for some reason.";
0672         ];
0673   


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.