Conversational Combat

Been trying out various options for combat in my game this week, and I was a bit surprised there are so few options. The only combat system I can find at the moment that works is a pretty dodgy one called attack that has a habit of dropping the user out of combat. So I thought I might try to build a simple one that uses menus. Basically, here’s what I want to happen:

The player enters a room with a hostile creature.

The game immediately starts combat and rolls initiative for combat order.

If the monster can attack, it does so.

The player’s turn: The game opens a default menu with unique flavour text and customisable options:

When an option is chosen it shunts you over to the creature’s default response menu. Since this would be a simple d20 system it would basically just continue taking turns. I don’t know how difficult this would be to do, but I really think a system like this should exist. So far I have all the health and equipping rules thanks to Attack, but I am struggling with the system itself. I have been going through every chat and menu system I can find looking for one that might work.

What I want to do is to set up a default menu for player actions, and a series of default responses that I can customise for each creature. Basically:

Attack Mode is a chat node that varies. Every person has an Attack Mode. The Attack Mode of a person is usually Basic Attack Reply.

Unfortunately that doesn’t work past the first sentence. I also can’t work out how to make a creature attack the player the moment it sees them without checking the location of every enemy every turn.

I’ve just created all the attack rolls, so really I just need a way to attack. I think the best way to do it would be to have just one conversation for every combat and move around it it. I think I could do this with rules such as:

Rule for printing text when the enemy is the dire squirrel and the stance is at-attack: Say "The dire squirrel snarls!"

But I’m really not sure how to do this.

Have you looked at “The Reliques of Tolti-Aph” by Graham Nelson? The source code is all available and it has a d20 combat system somewhat similar to your suggestion.

Thanks for putting me on to that, it’s very interesting, but I’m having a hell of a time making it work with modern Inform. I’ve cut it down to what I think are the main components, but it’s kinda daunting as I don’t know what most of it does yet. If anyone can help me to get this to compile that would be awesome:

[rant][code]Test is a room.

Chapter 1 - Fundamentals

Section 1(a) - Substance

A material is a kind of value. The materials are stone, wood, paper, magic-imbued wood, metal, clay, flesh, sustenance and air.[* The idea of anything being made of air caused some controversy when this game was being tested, particularly as it was also the material of bodies of water such as the Icefinger River. In the end, I put a sort-of explanation into the spoof magazine accompanying the game.] A thing has a material. Things are usually stone. People are usually flesh.

Substance relates a thing (called the item) to a material (called the stuff) when the material of the item is the stuff. The verb to be made of implies the substance relation.

[The verb phrase “to be made of” is on the face of it only a shorthand, but our biggest aim in writing the source text is to make it look like normal English prose - we think it will be more understandable, and therefore more likely to work first time, if it reads naturally.]

Section 1(b) - Dice

A die roll is a kind of value. 3d20+9 specifies a die roll[* RPGs are games of chance as well as skill, and the actual rolling of the dice is as much a part of the experience as the randomised outcome. The polyhedral four-, six-, eight-, ten-, twenty- and even hundred-sided dice ubiquitous to RPGs are pleasingly exotic in the hand, but also make possible a wide range of random distributions. W&W uses the traditional notation for such rolls (which evolved as the D&D rules went through successive printings, but became standard around 1980): “3d6+2” means we should roll three six-sided dice, add up the scores showing, then add 2.] with parts dice, sides (without leading zeros), adds (without leading zeros, optional, preamble optional).[* The optional nature of the adds part of a die roll means that “2d4”, for instance, is also a legal form. Again, this is a convention imitating the tables which appear in printed RPG rulebooks. What Inform means by the preamble to the adds part is the plus sign: if this had not been specified to be optional, “2d4+” would be legal.]

To decide which number is roll of (dr - a die roll):
let the total be the adds part of dr;
say "[dr]: ";
repeat with counter running from 1 to the dice part of dr:
let the roll be a random number from 1 to the sides part of dr;
unless the counter is 1, say “,”;
say the roll;
increase the total by the roll;
if the adds part of dr is 0 and the dice part of dr is 1, decide on the total;
if the adds part of dr is not 0, say “+”, adds part of dr;
say “=”, total;
decide on the total.

Test rolling is an action out of world applying to one die roll. Understand “dice [die roll]” as test rolling. Carry out test rolling: say "For your own amusement, you roll "; let the total thrown be the roll of the die roll understood; say “, making [total thrown in words].” [* We added the pointless verb “roll” as a harmless convenience for testing that die rolls work: if the player types “ROLL 3D6+2”, the game might reply “For your own amusement, you roll 3d6+2: 2,5,4+2=13, making thirteen.”]

Section 1© - Percentages

A percentage is a kind of value. 100% specifies a percentage with parts parts per hundred.[* This looks a bit odd, but does make sense. Unusually, this notation involves only one numeric piece - the number before the percentage sign. We give this a name, “parts per hundred”, in order to be able to convert percentages to ordinary numbers and back.]

Section 1(d) - Strength

A person has a number called strength. The strength of a person is usually 14.

Definition: A person is alive if its strength is 1 or more. Definition: A person is killed if their strength is 0 or less.

A person has a number called permanent strength.[* The strength you would have after a square meal and a good night’s sleep.]

[When play begins:
repeat with the patient running through people:
change the permanent strength of the patient to the strength of the patient.[* Specifying both the permanent strength and the (current) strength for everyone in the game would be tiresome. To simplify matters we assume that everyone begins the game in rude health, and that we can therefore deduce the permanent strength from the (current) strength.]]

To restore the health of (patient - a person): now the strength of the patient is the permanent strength of the patient.

Understand “str” as a mistake (“STR is not a command, but a numerical measure of your current strength. It is constantly displayed in the status line bar at the top of the window, and you are (usually) notified of any changes.”).[* A quick way to respond to a mistaken command by the player. Testing showed that some people misunderstood the HELP text’s mention of STR, and that others never noticed the status line.]

Understand “diagnose” as a mistake (“You can check your STR at any time from the status line, the bar at the top of the window. It’s currently [strength of the player].”).[* Some of the Infocom games had a “diagnose” verb, and the play-testers asked for this to be added out of nostalgia.]

Section 1(e) - Experience and levels

A person has a number called level. The level of a person is usually 1.

Table of Level Advancement
level number experience points to progress
1 50
2 100
3 250
4 600
5 0

Every turn:
let the current level be the level of the player;
if the current level is 5, stop;
let the target be the experience points to progress corresponding to a level number of the current level in the Table of Level Advancement;
if the score is greater than the target:
say “You progress to level [current level plus 1]!”;
increase the level of the player by 1.

Carry out requesting the score:
say "You are a level [level of the player] magic-user, with [score] experience point[s]. ";
let the current level be the level of the player;
let the target be the experience points to progress corresponding to a level number of the current level in the Table of Level Advancement;
let the target be the target minus the score;
if the current level is 5, say “It is not possible to progress further.” instead;
if the target <= 0, say “You will soon progress to the next level.” instead;
say “You need [target] [if the score > 0]more [end if]point[s] to progress to the next level.” instead.

[ When play begins, change the right hand status line to “LVL: [level of the player] STR: [strength of the player]”.[* One becomes weaker by performing magic or being wounded, stronger by resting or being healed; one gains experience by living a busy life. These tallies matter a lot, so we make them prominently visible at all times on the status line - the bar at the top of the screen.]]

Section 1(f) - Saving rolls

Calculating saving roll modifiers of something is an activity.[* Saving rolls are dice rolls made when the player tries to do something difficult, or avoid some hazard - hence “saving”. They tend to be influenced by the context of play: whether the player carries some lucky charm, is presently regarded with disfavour by some demigod, and so forth. Each such influence applies a modifier to the roll: -7 for having just broken a mirror, for instance. We need to calculate all of this without knowing what these influences will be - we need to set up a general framework, in fact, and so we take the unusual step of creating an “activity”. These normally handle Inform’s housekeeping tasks, but we’re perfectly free to create new ones, and the W&W rules contain several.]

The to-save roll is a number that varies.

To modify to-save roll by (amount - a number) for (reason - text):
if the amount >= 0, say “, +[amount] for [reason]”;
otherwise say “, [amount] for [reason]”;
increase the to-save roll by the amount.

For calculating saving roll modifiers of the player:
modify to-save roll by the level of the player for “your level”;[* See how useful it is to be a higher-level player? This produces text such as “+3 for your level” at the crucial moment.]
continue the activity.

To decide whether a saving roll of (target - a number) by (savee - a person) to (task - a text) is made:
say “[if savee is the player]You need [otherwise][The savee] needs [end if]to make a saving roll of [target] or better on 1d20 to [task]: “;
let the to-save roll be a random number from 1 to 20;
say the to-save roll;
carry out the calculating saving roll modifiers activity with the savee;
if the to-save roll >= target:
say " - succeeded.”;
decide yes;
say " - failed.”;
decide no.

To decide whether a saving roll of (target - a number) by (savee - a person) to (task - a text) is lost:[* Thus we could write, say, ‘if a saving roll of 15 by the player to “swim the rapids” is lost’…]
if a saving roll of target by the savee to task is made, decide no;
decide yes.

Chapter 2 - Magic

Section 2(a) - The phenomenon of magic

A spell character is a kind of value. The spell characters are offensive, defensive, healing and arcana. A valency is a kind of value. The valencies are targeted and untargeted.

A spell is a kind of value. The spells are defined by the Table of Enchantments.[* This is the first of several tables which mimic the style of typical RPG manuals. That mimicry makes no difference to the game as it is perceived by the eventual player, but it helps us to write the source text. Spells are going to cost a certain number of strength points to cast, and will come in various categories: some apply to some particular item (the “targeted” ones), others do not. Most need the caster to be holding something of a particular material nature: for instance, “the requirement of magic missile” evaluates to “wood”. Note the blank entries given as “–”, and the entirely blank columns at the end, which are used for calculations during play.]

Table of Enchantments
spell nature cost requirement emission targeting duration duration timer usage count
detect trap defensive 1 air “diffuse blue light” untargeted – a number a number
memorise arcana 3 air “a glowing symbol” targeted –
fashion staff arcana 2 wood “woodpulp” untargeted –
know nature arcana 1 air “probing rays” targeted –
make sanctuary arcana 8 clay “rainbow walls” untargeted –
magelight arcana 4 wood “flickering white light” untargeted 25
mend healing 2 flesh “ghostly fingers” targeted –
magic missile offensive 6 wood “a fiery red bolt” targeted –
aerial shield defensive 3 air “green smoke” untargeted 3
silence defensive 4 air “a tiny white puff” untargeted 2
web offensive 4 air “a clingy white thread” targeted –
ward magic defensive 6 metal “orange sparks” untargeted –
exorcise undead defensive 7 metal “purest whiteness” untargeted –
dragon sleep healing 5 flesh “little dancing lights” targeted –
circumvent lock healing 2 metal “tendrils of metallic light” targeted –
inner warmth defensive 4 wood “reddish glowing” untargeted 4
ironbones defensive 4 flesh “red metallic beams” untargeted 6
summon elemental offensive 6 flesh “blood-red mist” untargeted –

Understand “memorize” as memorise.[* For American players who habitually type “-ize” spellings. Note that this is an instruction to Inform that the text “memorize” can refer to the noun “memorise” in anything the player types - it isn’t a specification of a command verb, even though it will later turn out that the name of a spell can indeed be used as a command.]

Section 2(b) - The capacity for magic

Memorisation relates various people to various spells. The verb to know (he knows, they know, he knew, it is known) implies the memorisation relation.

Understand “spells” as listing spells. Listing spells is an action applying to nothing. Carry out listing spells: reel off the spells.[* Like “DIAGNOSE”, this command and its consequent action were added to satisfy the nostalgia of the playtesters.]

After taking inventory: reel off the spells; continue the action.

To reel off the spells:
say “You have the following spells committed to memory:[line break]”;
repeat through the Table of Enchantments in cost column order:[* Each time we need to list the spells known by the player, we are requiring the computer to work out how to look through the table of spells in cost order, which is a little inefficient - but it causes no perceptible delay in play. We don’t list the spells in the right order to start with because we can’t be bothered, and because it would be problematic when we come to add extension rules later on; and we don’t sort the table in cost order at the start of play because we are not allowed to disturb the ordering of a table which defines properties attached to values.]
let this spell be the spell entry;
if the player knows this spell:
say " [this spell] ([nature of this spell]): cost [cost of this spell] strength";
unless the requirement of this spell is air, say “, requires [requirement of this spell]”;
say “[line break]”.

Section 2© - Staffs, strength potions and scrolls

After examining something made of magic-imbued wood, say “Holding [the noun] reduces the strength cost of any spell by 2.”

After printing the name of something made of magic-imbued wood while taking inventory: say " (magic-imbued)".

To decide which number is the strength cost of (incantation - a spell) to (wizard - a person):
let the damage be the cost of the incantation;
if the wizard is carrying something made of magic-imbued wood, decrease the damage by 2;
if the damage is less than zero, let the damage be zero;
decide on the damage.[* This phrase calculates the actual strength cost to a given person of casting a given spell, and as we see this cost is reduced if the person is carrying a “magic staff”-like item.]

A strength potion is a kind of thing. A strength potion has a die roll called additional strength. Instead of examining a strength potion, say “[The noun] is a [additional strength] strength potion.” A strength potion is usually sustenance.

Instead of eating or drinking a strength potion:
remove the noun from play;
say “You swallow [the noun], gaining “;
let the extra be the roll of the additional strength of the noun;
increase the strength of the player by the extra;
if the strength of the player is greater than the permanent strength of the player:
now the strength of the player is the permanent strength of the player;
say " - more than enough to restore you to full strength.”;
stop;
say " strength points.”

A scroll is a kind of thing. A scroll has a spell called the inscribed spell. A scroll is paper. The description of a scroll is “Careful to take only a glance, you see that [the item described] is inscribed with the runes of the [inscribed spell] spell.” After printing the name of a scroll while taking inventory: say " (bearing the [inscribed spell] spell)".[* Scrolls will be the player’s objects of desire, since they carry new spells to be memorised and added to the player’s current repertoire.]

Section 2(d) - The casting action

Affectedness relates various people to various spells. The verb to be affected by implies the affectedness relation.[* We now have two verbs connecting people and spells: we can write statements like “Radagast knows summon elemental”, or “Henry is affected by ironbones”.]

Casting it at is an action applying to one spell and one visible thing. Rule for supplying a missing second noun while casting: now the second noun is the location.[* “Casting it at” is an unusual action because it can take two forms, having a sort of transitive and intransitive version: one casts “detect trap” with no target, but “magic missile” must be aimed at something. Inform permits actions to have syntax which leaves a noun optional, but requires that we supply any missing nouns so that by the time the action is processed nothing is missing. We construe a missing target for a spell as being the current location: thus, “detect trap” is actually a spell cast on the ambient surroundings, which seems reasonable enough. (Inform’s built-in action “listening” does something similar.)]

Understand “cast [spell]” or “[spell]” as casting it at.
Understand “cast [spell] on/at [something]” or “[spell] [something]” as casting it at.

The current spell focus is an object which varies.[* The variable “current spell focus” typifies something which tends to happen in complex sequences of rules: later rules need to refer to something worked out in the course of an earlier rule. That means the sort of “let …” variable will not do, because it is too temporary - it expires when the earlier rule finishes, so will be gone when the later rule is reached. Here we put the value into a permanent variable. This might be problematic if one casting action could be interrupted by another one, but here that never happens.] Before casting, now the current spell focus is the location.

Check casting (this is the can’t cast what you don’t know rule):[* We’re naming these rules so that the author of a W&W scenario could use procedural rules to suspend or alter them as needed.]
if the player does not know the spell understood, say “You do not know the mystery of that enchantment.” instead.

Check casting (this is the can’t cast on the wrong sort of target rule):
if the targeting of the spell understood is targeted:
if the second noun is a room, say “That enchantment must be cast at something.” instead;
otherwise:
unless the second noun is a room, say “That enchantment cannot be cast at anything.” instead.

Check casting (this is the can’t cast without strength rule):
if the strength of the player <= the strength cost of the spell understood to the player, say “You are weak, and have not sufficient strength of mind.” instead.

Check casting (this is the can’t cast at yourself rule):
if the player is the second noun, say “It is a cardinal rule of magic that no mage may cast an enchantment upon himself.” instead.

Check casting (this is the can’t cast without required materials rule):
let the stuff be the requirement of the spell understood;
unless the stuff is air:
if the player is carrying something (called the focus) which is made of the stuff,
now the current spell focus is the focus;
otherwise say “To weave that enchantment, you must have something made of [stuff] in your hands.” instead.

Check casting (this is the can’t magically attack a warded person rule):
if the nature of the spell understood is offensive and the second noun is a person:
let the intended victim be the second noun;
if the intended victim knows ward magic, say “With a contemptuous wave of orange sparks, [the intended victim] cancels your [spell understood] incantation.” instead.[* The can’t magically attack a warded person rule is a little sloppy: it does not sap the magical strength of the victim to cast the spell, which - if sauce for the wizard is sauce for the necromancer - it perhaps should.]

Effect is a rulebook.[*The carry out and report rules for the casting action are going to be surprisingly short - considering the vast range of possible outcomes when a spell is cast - and they do this by using a more powerful mechanism to allow for more flexible reporting than would ordinarily be possible: they create a new rulebook, “Effect”, whose task is to carry out the spell. Effect rules are also expected to set “current spell outcome” to a suitable message about what happens, and (optionally) “current spell event” to a rule which carries out further consequences.]

The current spell outcome is an indexed text which varies. To record outcome (eventual message - text): change the current spell outcome to eventual message.

The current spell event is a rule which varies. To record event (eventual rule - rule): change the current spell event to eventual rule.

This is the no spell event at all rule: stop.

Carry out casting:
record outcome “but then nothing obvious happens”;
record event the no spell event at all rule;
now the strength of the player is the strength of the player minus the strength cost of the spell understood to the player;
increase the usage count of the spell understood by 1;
if the usage count of the spell understood is less than 3[* You gain experience points the first couple of times you cast a spell, but then the novelty wears off.]:
award cost of the spell understood points;
award cost of the spell understood points;
if the cost of the spell understood is at least 5 and the current spell focus is something, remove the current spell focus from play;
consider the effect rulebook.

Report casting:
say "As you intone the words of the [spell understood] spell, ";
if the current spell focus is something:
say "[the current spell focus] ";
unless the player is holding the current spell focus, say "vanishes as it ";
say "releases ";
otherwise:
say "your fingers release “;
say emission of the spell understood;
unless the second noun is a room, say " at [the second noun]”;
say “, [current spell outcome]”;
if the player is affected by the spell understood:
if duration of the spell understood is greater than 0:
say “, which will last for [duration of the spell understood in words] turn[s]”;
change the duration timer of the spell understood to the duration of the spell understood;
increase the duration timer of the spell understood by 1;
say “.”;
consider the current spell event.

Every turn:
repeat through the Table of Enchantments:
let the remaining effect be the duration timer entry;
decrease the remaining effect by 1;
if the remaining effect >= 0, now the duration timer entry is the remaining effect;
if the remaining effect is 0:
now the player is not affected by the spell entry;
say “(The [spell entry] spell wears off.)”.[* For simplicity, and to keep storage requirements from going through the roof, time-limited spells can only be applied to the player.]

Understand “xyzzy” and “plugh” as a mistake (“Nobody believes those old children’s stories about a colossal cave with magic words any more. Magic’s something you spend years and years learning.”).

Section 2(e) - Effect of standard spells in alphabetical order

Effect of casting aerial shield at:
record outcome “and forms an almost invisible saucer-like shield over your head, which moves with you”;
now the player is affected by aerial shield;
rule succeeds.

A thing can be trapped or untrapped. A thing is usually not trapped.

[Instead of drinking a trapped strength potion:
remove the noun from play;
say "You quaff [the noun], but it is poison! And it harms you by “;
let the extra be the roll of the additional strength of the noun;
decrease the strength of the player by the extra;
say " strength points.”;
if the player is killed, end the game saying “You have been poisoned”.]

[Instead of putting a trapped strength potion on a weapon:[* This didn’t occur to the author at all - one of the playtesters tried it, and then the idea seemed irresistable. Poisoning a weapon adds a whole extra die and +2 in adds, so there’s quite a reward for anyone resourceful enough to think of this.]
remove the noun from play;
let the hit power be the hit dice of the second noun;
let N be the dice part of the hit power;
let S be the sides part of the hit power;
let A be the adds part of the hit power;
increase A by 2;
increase N by 1;
change the hit dice of the second noun to the die roll with dice part N sides part S adds part A;
say “Carefully, you apply the poison from [the noun] to [the second noun], using it all up.”]

Understand “poison [something]” as a mistake (“How, exactly?”).

A person can be slumbering or wakeful.

Effect of casting dragon sleep at a wyvern:
if the second noun is wakeful:
record outcome “and quite beguiles the wyvern which, though not properly speaking a dragon, is always flattered by any suggestion that it counts as one in the great scheme of things. Enormous snores soon result”;
award 4 points;
now the second noun is slumbering;
otherwise:
record outcome “but, after all, the wyvern is already asleep”;
rule succeeds.

Instead of doing something to a slumbering wyvern, say “Best let sleeping wyverns lie.”

Effect of casting detect trap at:
if a trapped thing is visible:
record outcome “and it swirls around you for a time before finally settling upon [the list of trapped visible things]. You give a grim smile”;
otherwise:
record outcome “but it radiates away with a sense of calm normality”;
rule succeeds.

Effect of casting fashion staff at:
now the current spell focus is magic-imbued wood;
record outcome “growing scorch-hot in your hands as the wood is transformed into a magical hybrid, imbuing it with strength”;
rule succeeds.

Effect of casting inner warmth at:
record outcome “and surrounds you with a cosy feeling of well-being”;
now the player is affected by inner warmth;
rule succeeds.

Effect of casting ironbones at:
record outcome “and fortifies your whole body”;
now the player is affected by ironbones;
rule succeeds.

Effect of casting know nature at:
if the second noun is a direction, record outcome “never to return”;
otherwise record outcome “which make a curious sort of examination and then trace the sigil of [material of the second noun] in mid-air”;
rule succeeds.

Effect of casting magelight at:
record outcome “which bathe your upper body in radiance”;
now the player is affected by magelight;
now the player is lit;
rule succeeds.

Every turn: unless the player is affected by magelight, now the player is unlit.

Effect of casting magic missile at something:
if the second noun is a person:
record outcome “bursting in a splash of magical fire”;
record event the magic missile strike rule;
otherwise:
if the second noun is portable and the second noun is not scenery:
remove the second noun from play;
record outcome “which vapourises into a whiff of smoke”;
otherwise:
record outcome “which shakes as it absorbs the blow, but withstands it”;
rule succeeds.

This is the magic missile strike rule:
say "A magic missile does 1d6 damage per level of the caster, so: “;
let L be the level of the player;
let the strike power be the die roll with dice part L sides part 6 adds part 0;
let the strike amount be the roll of the strike power;
say " points of damage”;
now the second noun is hostile;
make the second noun take the strike amount points of damage.

Sanctum Sanctorum is a room. “Here in the calm, still centre of the turning world, you find Sanctuary. It is a place to rest, to meditate. Through the hazy rainbow walls, you can vaguely see the [room outside from the Sanctum Sanctorum], but it is as unreal as a dream.” Before going outside from the Sanctum Sanctorum, say “You blink as your eyes adjust to the harshness of reality - the unforgiving vividness of existence.”

The rainbow outlines of your sanctuary are fixed in place. “Before you are the rainbow outlines of your sanctuary, which you alone can see, never mind enter.” Instead of entering the rainbow outlines: move the player to the Sanctum Sanctorum. Understand “sanctum” as the rainbow outlines.

Understand the command “rest” as “sleep”. Understand the command “dream” as “sleep”. Understand the command “meditate” as “sleep”. [Check sleeping (this is the can’t sleep outside of sanctuary rule): if the location is not the Sanctum Sanctorum and the location is not the Temple of Peace, say “This is not a safe enough place to recuperate. Nowhere exposed to attack is ever safe.” instead. Check sleeping: if the strength of the player is the permanent strength of the player, say “You are hale and hearty, with no need of rest.” instead.]

[Carry out sleeping: restore the health of the player. Report sleeping: say “You rest, soaking up the healing goodness of the sanctuary.” Procedural rule: ignore the block sleeping rule.]

[Check saving the game: if the location is not the Sanctum Sanctorum and the location is not the Temple of Peace, say “(The game can only be saved when in an indisputably safe place. This is not that place. You will know it when you find it.)” instead.[* An exceptionally unpopular rule with players, this. But it does make the reward for those who discover “make sanctuary” all the sweeter.]]

Effect of casting make sanctuary at:
if the location is the Sanctum Sanctorum:
record outcome “which - thankfully - dissipate harmlessly. There probably are necromancers in this world who could get away with a stunt like that, but you’re not one of them.”;
rule succeeds;
record outcome “which - sketchily at first, but with growing confidence of purpose - come together into the ghostly rainbow outlines of a sanctuary before you”;
change the outside exit of the Sanctum Sanctorum to the location;
move the rainbow outlines of your sanctuary to the location;
rule succeeds.

Effect of casting memorise at something:
record outcome “which fades and recovers itself, in a curiously unsatisfying way”;
rule succeeds.
Effect of casting memorise at a scroll:
unless the player is carrying the second noun:
record outcome “which, not being in your hands, tantalises more than it reveals”;
rule succeeds;
remove the second noun from play;
now the player knows the inscribed spell of the second noun;
record outcome “which crumbles into dust, filling your mind with thoughts of the [inscribed spell of the second noun] spell”;
rule succeeds.

Effect of casting mend at something:
record outcome “which almost imperceptibly straightens and tidies itself, but with no real effect”;
rule succeeds.

Effect of casting mend at a person:
record outcome “which pats [the second noun] on the head, to no practical benefit”;
rule succeeds.

Definition: A person is undead if exorcise undead is its defensive charm.

This is the exorcise undead removal rule:
repeat with turned one running through the undead people in the location:
remove the turned one from play;
award the permanent strength of the turned one points.

Effect of casting exorcise undead at:
if an undead person is in the location:
record outcome “which, as if a kind of lassoo, loops around [the list of undead people in the location] and drags the unclean down beneath the earth”;
record event the exorcise undead removal rule;
rule succeeds;
record outcome “which throws a kind of lassoo around nothing in particular, then pulls tight until it disappears”;
rule succeeds.

Effect of casting silence at:
record outcome “and a silence settles mufflingly around your feet”;
now the player is affected by silence;
rule succeeds.

Effect of casting summon elemental at:
record outcome “and there is a horrendous tearing sound from the very earth”;
move Zoorl to the location;
now Zoorl is indifferent;
rule succeeds.

Effect of casting web at a hostile monster:
record outcome “and the silken strands drape themselves over [the second noun], impeding all movement”;
now the second noun is affected by web;
rule succeeds.
After printing the name of a person who is affected by web when we are looking, say " (webbed)".

To calculate combat modifiers of a person who is affected by web:
modify to-hit roll by -8 for “trying to fight through web”;
continue the activity.

Effect of casting web at:
record outcome “but the silken strands fall away, half-hearted and half-meant”;
rule succeeds.

Chapter 3 - Combat

Section 3(a) - Monsters are People Too

A person has a spell called defensive charm.

A person has a text called hand-to-hand combat method. The hand-to-hand combat method of a person is usually “with bare hands”. A person has a die roll called unarmed combat hit dice. The unarmed combat hit dice of a person is usually 1d2.

A monster is a kind of person. A monster can be hostile or indifferent. A monster is usually hostile. Definition: A monster is scary if its strength is 50 or more. Definition: A monster is feeble if its strength is 10 or less. Some kinds of monster are defined by the Table of Monstrous Beasts.

Instead of asking a monster about something: say “[The noun] is unreachable on most levels.”

After printing the name of a monster while looking: say " (STR [strength])".

Table of Monstrous Beasts
name strength hand-to-hand combat method unarmed combat hit dice defensive charm
goblin 5 “pummeling its green fists” 1d4 –
gnome 2 “slapping its feeble arms” 1d2 –
centaur 9 “kicking its hooves” 1d6 –
werespider 7 “clicking its mandibles” 1d8+1 –
wyvern 75 “beating its clawed wings” 2d8+5 –
half-orc 9 “burrowing with its claws” 1d6 –
harpy 15 “swooping with its talons” 2d6 aerial shield
giant bat 8 “diving to bite” 2d4 aerial shield
basilisk 4 “staring with cursed eyes” 4d6 –
purple worm 7 “biting with acidic teeth” 2d6+1 –
gargoyle 10 “punching stone fists” 1d8+1 –
cave troll 14 “swinging enormous fists” 3d4 –
cave spectre 12 “throwing curses” 2d4+3 exorcise undead
marsh spectre 18 “throwing curses” 4d4+3 exorcise undead
skeletal warrior 25 “slicing with ghostly blades” 2d6+3 exorcise undead
green hydra 32 “ducking its heads in turn” 3d8+3 aerial shield
frost giant 28 “throwing deadly icicles” 2d8+4 inner warmth
elemental demon 35 “whirling with venom” 4d4+2 –

An elemental demon called Zoorl the Elemental Demon is indifferent.[* Oh, the ennui of the underworld. The practical effect of this line is to create Zoorl and leave him out of play at the start of the game: he is the demon brought into being by the “summon elemental” spell.]

Every turn:
if Zoorl is in a room (called the haunt):
unless the haunt is the location:
remove Zoorl from play;
otherwise:
if Zoorl is indifferent and a hostile monster (called the victim) is in the location,
make Zoorl strike a blow against the victim.

Effect of casting web at a wyvern:[* It turns out to be convenient to have at least one monster which is basically proof against anything the player can throw at it, and that’s the wyvern. In testing, it turned out that “web” gave a lucky player a chance to defeat a wyvern, which was inconvenient for the plot. So…]
record outcome “but the web is pathetically small compared to the great scale of the wyvern, and your efforts seem laughable”;
rule succeeds.

Section 3(b) - Weaponry

A weapon is a kind of thing. A weapon has a die roll called hit dice. Definition: A weapon is savage if its hit dice are 3d6 or more. A weapon has a text called technique. The technique of a weapon is usually “swinging”. Some kinds of weapon are defined by the Table of Weaponry.[* This innocent-looking sentence is doing something rather sophisticated: it makes a new kind for every row of the table.] Weapons are usually metal. A spear is wood. A quarterstaff is wood. A lance is wood.

After printing the name of a weapon while taking inventory: say " ([hit dice] attack)". Instead of examining a weapon, say “[The noun] is a weapon with a [hit dice of the noun] attack.”

A weapon has a number called the to-hit bonus.

Table of Weaponry
name hit dice technique
dagger 1d3 “stabbing”
quarterstaff 1d6 “swinging”
battle axe 1d8 “hewing”
short sword 1d6 “swinging”
broad sword 2d4 “swinging”
spear 1d6 “lunging with”
lance 1d8+1 “lunging with”

Section 3© - Armour

An armour is a kind of thing. An armour is wearable. Some kinds of armour are defined by the Table of Armoured Dress. Armour is usually metal. Leather jerkins are usually flesh.

Table of Armoured Dress
name armour class
leather jerkin 1
ring mail 2
chain mail 3
plate armour 4

Check wearing an armour:
if the player is wearing armour, say “You can only wear one piece of armour at a time.” instead.

After printing the name of armour while taking inventory: say " (damage -[armour class])".

Instead of casting magic missile at armour which is worn by someone (called the victim): try casting magic missile at victim.

Section 3(d) - Combat-readiness

To decide whether combat proceeds:
if a hostile alive monster (called the baddie) is in the location, decide yes;
decide no.

Before reading a command:
if combat proceeds, now the command prompt is "Combat> ";
otherwise now the command prompt is "> ".

After waiting when combat proceeds: stop the action.

Check going (this is the need a saving roll to retreat rule):
if combat proceeds:
if a saving roll of 11 by the player to “disengage from the fight” is made, continue the action;
say “So you are unable to break away.” instead.

Check casting (this is the can’t cast non-combat spells in combat rule):
let the warlike nature be the nature of the spell understood;
if the warlike nature is defensive, let the warlike nature be offensive;
if combat proceeds and the warlike nature is not offensive:
say “The nature of that spell is [nature of the spell understood]: unlike offensive and defensive spells - which are structured for use in combat - [nature of the spell understood] spells need a little peace and calm to be cast.” instead.

A person can be surprised or ready. A person is usually ready.

Instead of attacking a monster:
if the noun is hostile, say “You are already locked in combat.” instead;
now the noun is hostile;
now the noun is surprised;
now the player is ready;
say “You make a surprise attack on [the noun]!” instead.

To mount an attack from (bad guy - a monster):
now the bad guy is hostile;
now the bad guy is ready;
now the player is surprised;
say “[The bad guy] attacks!”

Every turn when a hostile monster is in the location:
if the player is ready, make the player strike a blow against the scariest hostile monster in the location;[* Recall that “scary” was defined in 3(a) above: “scariest” automatically acquires the meaning of “that which is most scary”.]
repeat with the opponent running through hostile monsters in the location:
if the player is killed, stop;
if the opponent is ready:
if Zoorl is in the location, make the opponent strike a blow against Zoorl;
otherwise make the opponent strike a blow against the player;
now the player is ready;
now all hostile monsters are ready.

Section 3(e) - Damage

The damage incurred is a number that varies.

Calculating damage modifiers of something is an activity.

For calculating damage modifiers of a person (called the defender):
if the defender is wearing armour (called the protector) and the damage incurred is greater than 1:
say ": [the protector] absorbs ";
let the absorbency be the armour class of the protector;
if the absorbency >= the damage incurred:
let the absorbency be the damage incurred;
decrease the absorbency by 1;
decrease the damage incurred by the absorbency;
say the absorbency;
continue the activity.

For calculating damage modifiers of a person (called the defender):
if the defender is affected by ironbones and the damage incurred is greater than 1:
say “: the ironbones spell halves the damage”;
change the damage incurred to the damage incurred divided by 2;
continue the activity.

Dead body disposal of something is an activity.[* This is provided for the benefit of anyone using these rules who wants to make something special happen to dead bodies, which otherwise quietly vanish from the field of battle.]

To make (defender - a person) take (hits - a number) points of damage:
let the original hits be the hits;
change the damage incurred to the hits;
carry out the calculating damage modifiers activity with the defender;
let the hits be the damage incurred;
if the hits <= 0:
say " - so no damage is done.";
stop;
if the original hits are not the hits, say “, leaving [hits] to take”;
decrease the strength of the defender by the hits;
if the defender is killed:
say " - a fatal blow!";
if the player is the defender:
end the game saying “You have been killed in combat”;
stop;
carry out the dead body disposal activity with the defender;
if the defender is in the location, remove the defender from play;
award the permanent strength of the defender points;
repeat with the item running through things which are had by the defender:
move the item to the location;
otherwise:
if the player is the defender, say “, reducing your strength to [strength of the player].”;
otherwise say “, wounding [the defender] to a strength of [strength of the defender].”.

Section 3(f) - Striking blows

The to-hit roll is a number that varies.

To modify to-hit roll by (amount - a number) for (reason - text):
if the amount >= 0, say “, +[amount] for [reason]”;
otherwise say “, [amount] for [reason]”;
increase the to-hit roll by the amount.

Calculating combat modifiers of something is an activity.

For calculating combat modifiers of the player:
modify to-hit roll by the level of the player for “your level”;
continue the activity.

To make (attacker - a person) strike a blow against (defender - a person):
if the attacker is the player, say "You attack ";
otherwise say "[The attacker] attacks ";
if the defender is the player, say "you, ";
otherwise say "[the defender], “;
let the damage done be the unarmed combat hit dice of the attacker;
let the instrument be nothing;
if the attacker carries a weapon:
let the instrument be the savagest weapon carried by the attacker;
let the damage done be the hit dice of the instrument;
say “[technique of the instrument] [the instrument]”;
otherwise:
say hand-to-hand combat method of the attacker;
change the to-hit roll to a random number from 1 to 20;
say “, making an attack roll (1d20) of [to-hit roll]”;
carry out the calculating combat modifiers activity with the attacker;
if the instrument is a weapon and the to-hit bonus of the instrument is not 0, modify to-hit roll by the to-hit bonus of the instrument for “wielding a blessed weapon”;
let the hits be 0;
if the to-hit roll <= 2:
say " - critical miss (2 or less): “;
if the instrument is a weapon:
if the attacker is the player:
silently try dropping the instrument;
if the player does not carry the instrument, say “you dropped [the instrument]!”;
otherwise say “[the instrument] shook in your hand!”;
otherwise:
now the instrument is in the location;
say “[the attacker] drops [the instrument]!”;
otherwise:
decrease the strength of the attacker by 1;
if the attacker is the player:
say “you actually injure yourself!”;
if the player is killed, end the game saying “You have fumbled into an inglorious demise”;
otherwise:
say “[the attacker] roars with impotent rage!”;
stop;
if the to-hit roll <= 10:
say " - miss (3 to 10): no damage done!”;
stop;
if the to-hit roll <= 19:
say " - hit (11 to 19), doing [damage done] of damage: “;
let the hits be the roll of the damage done;
if the hits is 1, say " point”;
otherwise say " points”;
otherwise:
say " - critical hit (20 or more), doing [damage done] doubled of damage: ";
let the hits be the roll of the damage done;
let the hits be the hits multiplied by 2;
say “, doubled up to [hits] points”;
let the counter-charm be the defensive charm of the attacker;
if the defender is affected by the counter-charm:
say “, soaked up by the [counter-charm] spell.”;
stop;
make the defender take hits points of damage.

Section 3(g) - Missile weapons, lack of

Instead of throwing a spear at, say “There are no missile weapons in the combat rules for this game, which does seem a pity with a fine spear like that.”

Instead of throwing something at, say “There are no missile weapons in the combat rules for this game, but I trust we could do better than [the noun] even if there were.”

[/code][/rant]

So far I’ve gotten it down to these errors:

Ah, those look like standard 6L02 conversion problems. Let me see what I can do.

The following is the first part of RoTA, updated for the latest version of Inform. I didn’t update any of the scenario itself, but you can still use it as a model for making your own.
[rant=lots of code][code]
Part I - Mechanics of a Simple Role-Playing Game

[The story headline is “A W&W Scenario”.[* W&W is “Woodpulp and Wyverns”, the name for our imaginary RPG, which will be a simplified mixture of ingredients from the various late-1970s rulebooks: besides D&D, one might also mention “Tunnels and Trolls” by Ken St Andre (crazy name, crazy guy).] The story genre is “Fantasy”. Use full-length room descriptions. Use MAX_STATIC_DATA of 150000.]

Understand “help” or “hint” or “hints” or “about” as calling for help. Calling for help is an action out of world applying to nothing. Carry out calling for help: say "(This game is being run according to the rules of a simplified role-playing game which we will call Woodpulp & Wyverns, or W&W. The protagonist is a magic-user, whose main ability is to cast spells. We are not in search of riches but of experience: by collecting experience points, the protagonist may progress upwards in ‘level’: the SCORE command shows this. An INVENTORY (or I) lists the spells known as well as the items carried.

One’s strength, STR, is drained both by casting spells and by being wounded, and - especially early on - it is important to husband this carefully: but the means of restoration can also be found. It will probably take several games to work out the best tactics of play. Tolti-Aph is not a safe place, so expect to be killed every now and again (i.e. with terrifying frequency - E.S.).

W&W play differs from conventional interactive fiction in that there is a great deal of randomised behaviour. Notations like 4d6+2 express the (virtual) dice rolls to be made: this one would involve rolling 4 six-sided dice, then adding 2 to the result. Combat is an especially unpredictable business, but note that one can often run away from a fight which is going badly.

It is possible to get yourself into some insanely hard fights, or to run risks of appalling strength loss, where you might get lucky, but will die nine times out of ten. This is almost always a sign that you’ve missed something. The designer intends that a sufficiently ingenious player of IF can win through with even the worst luck. Still, with life and death hanging on the roll of a die, the UNDO command has been withdrawn. SAVE is allowed, but an important early puzzle is to work out how to do it.

Lastly, this is one of the worked examples whose source text is included in full in the documentation for Inform 7, a system to create interactive fiction. About the first quarter lays out general rules for W&W play, and can be borrowed to write new W&W scenarios.)"

Use scoring.

Chapter 1 - Fundamentals

Section 1(a) - Substance

A material is a kind of value. The materials are stone, wood, paper, magic-imbued wood, metal, clay, flesh, sustenance and air.[* The idea of anything being made of air caused some controversy when this game was being tested, particularly as it was also the material of bodies of water such as the Icefinger River. In the end, I put a sort-of explanation into the spoof magazine accompanying the game.] A thing has a material. Things are usually stone. People are usually flesh.

Substance relates a thing (called the item) to a material (called the stuff) when the material of the item is the stuff. The verb to be made of implies the substance relation.

[The verb phrase “to be made of” is on the face of it only a shorthand, but our biggest aim in writing the source text is to make it look like normal English prose - we think it will be more understandable, and therefore more likely to work first time, if it reads naturally.]

Section 1(b) - Dice

A die roll is a kind of value. 3d20+9 specifies a die roll[* RPGs are games of chance as well as skill, and the actual rolling of the dice is as much a part of the experience as the randomised outcome. The polyhedral four-, six-, eight-, ten-, twenty- and even hundred-sided dice ubiquitous to RPGs are pleasingly exotic in the hand, but also make possible a wide range of random distributions. W&W uses the traditional notation for such rolls (which evolved as the D&D rules went through successive printings, but became standard around 1980): “3d6+2” means we should roll three six-sided dice, add up the scores showing, then add 2.] with parts dice, sides (without leading zeros), adds (without leading zeros, optional, preamble optional).[* The optional nature of the adds part of a die roll means that “2d4”, for instance, is also a legal form. Again, this is a convention imitating the tables which appear in printed RPG rulebooks. What Inform means by the preamble to the adds part is the plus sign: if this had not been specified to be optional, “2d4+” would be legal.]

To decide which number is roll of (dr - a die roll):
let the total be the adds part of dr;
say "[dr]: ";
repeat with counter running from 1 to the dice part of dr:
let the roll be a random number from 1 to the sides part of dr;
unless the counter is 1, say “,”;
say the roll;
increase the total by the roll;
if the adds part of dr is 0 and the dice part of dr is 1, decide on the total;
if the adds part of dr is not 0, say “+”, adds part of dr;
say “=”, total;
decide on the total.

Test rolling is an action out of world applying to one die roll. Understand “dice [die roll]” as test rolling. Carry out test rolling: say "For your own amusement, you roll "; let the total thrown be the roll of the die roll understood; say “, making [total thrown in words].” [* We added the pointless verb “roll” as a harmless convenience for testing that die rolls work: if the player types “ROLL 3D6+2”, the game might reply “For your own amusement, you roll 3d6+2: 2,5,4+2=13, making thirteen.”]

Section 1© - Percentages

A percentage is a kind of value. 100% specifies a percentage with parts parts per hundred.[* This looks a bit odd, but does make sense. Unusually, this notation involves only one numeric piece - the number before the percentage sign. We give this a name, “parts per hundred”, in order to be able to convert percentages to ordinary numbers and back.]

Section 1(d) - Strength

A person has a number called strength. The strength of a person is usually 14.

Definition: A person is alive if its strength is 1 or more. Definition: A person is killed[* There are no natural deaths in Tolti-Aph.] if its strength is 0 or less.

A person has a number called permanent strength.[* The strength you would have after a square meal and a good night’s sleep.]

When play begins:
repeat with the patient running through people:
now the permanent strength of the patient is the strength of the patient.[* Specifying both the permanent strength and the (current) strength for everyone in the game would be tiresome. To simplify matters we assume that everyone begins the game in rude health, and that we can therefore deduce the permanent strength from the (current) strength.]

To restore the health of (patient - a person): now the strength of the patient is the permanent strength of the patient.

Understand “str” as a mistake (“STR is not a command, but a numerical measure of your current strength. It is constantly displayed in the status line bar at the top of the window, and you are (usually) notified of any changes.”).[* A quick way to respond to a mistaken command by the player. Testing showed that some people misunderstood the HELP text’s mention of STR, and that others never noticed the status line.]

Understand “diagnose” as a mistake (“You can check your STR at any time from the status line, the bar at the top of the window. It’s currently [strength of the player].”).[* Some of the Infocom games had a “diagnose” verb, and the play-testers asked for this to be added out of nostalgia.]

Section 1(e) - Experience and levels

A person has a number called level. The level of a person is usually 1.[* RPGs seem to like the idea of numbered levels, with a level 3 magic-user that bit more puissant than a level 2 one. I suppose this may derive from the vague sense of mystery swirling around the “degrees” of masonic lodges, the Benevolent and Protective Order of the Elks, and such.]

Table of Level Advancement
level number experience points to progress
1 50
2 100
3 250
4 600
5 0

Every turn:
let the current level be the level of the player;
if the current level is 5, stop;
let the target be the experience points to progress corresponding to a level number of the current level in the Table of Level Advancement;
if the score is greater than the target:
say “You progress to level [current level plus 1]!”;
increase the level of the player by 1.

The announce the score rule does nothing.[* This is the built-in rule which ordinarily handles SCORE commands. We need to throw it out because we are somewhat subverting the usual conventions by using the score to represent the total accumulated experience points of the player; which means we need to write our own rule to tell the player his current score, as follows.]

Carry out requesting the score:
say "You are a level [level of the player] magic-user, with [score] experience point[s]. ";
let the current level be the level of the player;
let the target be the experience points to progress corresponding to a level number of the current level in the Table of Level Advancement;
let the target be the target minus the score;
if the current level is 5, say “It is not possible to progress further.” instead;
if the target <= 0, say “You will soon progress to the next level.” instead;
say “You need [target] [if the score > 0]more [end if]point[s] to progress to the next level.” instead.

When play begins, now the right hand status line is “LVL: [level of the player] STR: [strength of the player]”.[* One becomes weaker by performing magic or being wounded, stronger by resting or being healed; one gains experience by living a busy life. These tallies matter a lot, so we make them prominently visible at all times on the status line - the bar at the top of the screen.]

Section 1(f) - Saving rolls

Calculating saving roll modifiers of something is an activity.[* Saving rolls are dice rolls made when the player tries to do something difficult, or avoid some hazard - hence “saving”. They tend to be influenced by the context of play: whether the player carries some lucky charm, is presently regarded with disfavour by some demigod, and so forth. Each such influence applies a modifier to the roll: -7 for having just broken a mirror, for instance. We need to calculate all of this without knowing what these influences will be - we need to set up a general framework, in fact, and so we take the unusual step of creating an “activity”. These normally handle Inform’s housekeeping tasks, but we’re perfectly free to create new ones, and the W&W rules contain several.]

The to-save roll is a number that varies.

To modify to-save roll by (amount - a number) for (reason - text):
if the amount >= 0, say “, +[amount] for [reason]”;
otherwise say “, [amount] for [reason]”;
increase the to-save roll by the amount.

For calculating saving roll modifiers of the player:
modify to-save roll by the level of the player for “your level”;[* See how useful it is to be a higher-level player? This produces text such as “+3 for your level” at the crucial moment.]
continue the activity.

To decide whether a saving roll of (target - a number) by (savee - a person) to (task - a text) is made:
say “[if savee is the player]You need [otherwise][The savee] needs [end if]to make a saving roll of [target] or better on 1d20 to [task]: “;
now the to-save roll is a random number from 1 to 20;
say the to-save roll;
carry out the calculating saving roll modifiers activity with the savee;
if the to-save roll >= target:
say " - succeeded.”;
decide yes;
say " - failed.”;
decide no.

To decide whether a saving roll of (target - a number) by (savee - a person) to (task - a text) is lost:[* Thus we could write, say, ‘if a saving roll of 15 by the player to “swim the rapids” is lost’…]
if a saving roll of target by the savee to task is made, decide no;
decide yes.

Chapter 2 - Magic

Section 2(a) - The phenomenon of magic

A spell character is a kind of value. The spell characters are offensive, defensive, healing and arcana. A valency is a kind of value. The valencies are targeted and untargeted.

A spell is a kind of value. The spells are defined by the Table of Enchantments.[* This is the first of several tables which mimic the style of typical RPG manuals. That mimicry makes no difference to the game as it is perceived by the eventual player, but it helps us to write the source text. Spells are going to cost a certain number of strength points to cast, and will come in various categories: some apply to some particular item (the “targeted” ones), others do not. Most need the caster to be holding something of a particular material nature: for instance, “the requirement of magic missile” evaluates to “wood”. Note the blank entries given as “–”, and the entirely blank columns at the end, which are used for calculations during play.]

Table of Enchantments
spell nature cost requirement emission targeting duration duration timer usage count
detect trap defensive 1 air “diffuse blue light” untargeted – a number a number
memorise arcana 3 air “a glowing symbol” targeted –
fashion staff arcana 2 wood “woodpulp” untargeted –
know nature arcana 1 air “probing rays” targeted –
make sanctuary arcana 8 clay “rainbow walls” untargeted –
magelight arcana 4 wood “flickering white light” untargeted 25
mend healing 2 flesh “ghostly fingers” targeted –
magic missile offensive 6 wood “a fiery red bolt” targeted –
aerial shield defensive 3 air “green smoke” untargeted 3
silence defensive 4 air “a tiny white puff” untargeted 2
web offensive 4 air “a clingy white thread” targeted –
ward magic defensive 6 metal “orange sparks” untargeted –
exorcise undead defensive 7 metal “purest whiteness” untargeted –
dragon sleep healing 5 flesh “little dancing lights” targeted –
circumvent lock healing 2 metal “tendrils of metallic light” targeted –
inner warmth defensive 4 wood “reddish glowing” untargeted 4
ironbones defensive 4 flesh “red metallic beams” untargeted 6
summon elemental offensive 6 flesh “blood-red mist” untargeted –

Understand “memorize” as memorise.[* For American players who habitually type “-ize” spellings. Note that this is an instruction to Inform that the text “memorize” can refer to the noun “memorise” in anything the player types - it isn’t a specification of a command verb, even though it will later turn out that the name of a spell can indeed be used as a command.]

Section 2(b) - The capacity for magic

Memorisation relates various people to various spells. The verb to know (he knows, they know, he knew, it is known) implies the memorisation relation.

Understand “spells” as listing spells. Listing spells is an action applying to nothing. Carry out listing spells: reel off the spells.[* Like “DIAGNOSE”, this command and its consequent action were added to satisfy the nostalgia of the playtesters.]

After taking inventory: reel off the spells; continue the action.

To reel off the spells:
say “You have the following spells committed to memory:[line break]”;
repeat through the Table of Enchantments in cost column order:[* Each time we need to list the spells known by the player, we are requiring the computer to work out how to look through the table of spells in cost order, which is a little inefficient - but it causes no perceptible delay in play. We don’t list the spells in the right order to start with because we can’t be bothered, and because it would be problematic when we come to add extension rules later on; and we don’t sort the table in cost order at the start of play because we are not allowed to disturb the ordering of a table which defines properties attached to values.]
let this spell be the spell entry;
if the player knows this spell:
say " [this spell] ([nature of this spell]): cost [cost of this spell] strength";
unless the requirement of this spell is air, say “, requires [requirement of this spell]”;
say “[line break]”.

Section 2© - Staffs, strength potions and scrolls

After examining something made of magic-imbued wood, say “Holding [the noun] reduces the strength cost of any spell by 2.”

After printing the name of something made of magic-imbued wood while taking inventory: say " (magic-imbued)".

To decide which number is the strength cost of (incantation - a spell) to (wizard - a person):
let the damage be the cost of the incantation;
if the wizard is carrying something made of magic-imbued wood, decrease the damage by 2;
if the damage is less than zero, let the damage be zero;
decide on the damage.[* This phrase calculates the actual strength cost to a given person of casting a given spell, and as we see this cost is reduced if the person is carrying a “magic staff”-like item.]

A strength potion is a kind of thing. A strength potion has a die roll called additional strength. Instead of examining a strength potion, say “[The noun] is a [additional strength] strength potion.” A strength potion is usually sustenance.

Instead of eating or drinking a strength potion:
remove the noun from play;
say “You swallow [the noun], gaining “;
let the extra be the roll of the additional strength of the noun;
increase the strength of the player by the extra;
if the strength of the player is greater than the permanent strength of the player:
now the strength of the player is the permanent strength of the player;
say " - more than enough to restore you to full strength.”;
stop;
say " strength points.”

A scroll is a kind of thing. A scroll has a spell called the inscribed spell. A scroll is paper. The description of a scroll is “Careful to take only a glance, you see that [the item described] is inscribed with the runes of the [inscribed spell] spell.” After printing the name of a scroll while taking inventory: say " (bearing the [inscribed spell] spell)".[* Scrolls will be the player’s objects of desire, since they carry new spells to be memorised and added to the player’s current repertoire.]

Section 2(d) - The casting action

Affectedness relates various people to various spells. The verb to be affected by implies the affectedness relation.[* We now have two verbs connecting people and spells: we can write statements like “Radagast knows summon elemental”, or “Henry is affected by ironbones”.]

Casting it at is an action applying to one spell and one visible thing. Rule for supplying a missing second noun while casting: now the second noun is the location.[* “Casting it at” is an unusual action because it can take two forms, having a sort of transitive and intransitive version: one casts “detect trap” with no target, but “magic missile” must be aimed at something. Inform permits actions to have syntax which leaves a noun optional, but requires that we supply any missing nouns so that by the time the action is processed nothing is missing. We construe a missing target for a spell as being the current location: thus, “detect trap” is actually a spell cast on the ambient surroundings, which seems reasonable enough. (Inform’s built-in action “listening” does something similar.)]

Understand “cast [spell]” or “[spell]” as casting it at.
Understand “cast [spell] on/at [something]” or “[spell] [something]” as casting it at.

The current spell focus is an object which varies.[* The variable “current spell focus” typifies something which tends to happen in complex sequences of rules: later rules need to refer to something worked out in the course of an earlier rule. That means the sort of “let …” variable will not do, because it is too temporary - it expires when the earlier rule finishes, so will be gone when the later rule is reached. Here we put the value into a permanent variable. This might be problematic if one casting action could be interrupted by another one, but here that never happens.] Before casting, now the current spell focus is the location.

Check casting (this is the can’t cast what you don’t know rule):[* We’re naming these rules so that the author of a W&W scenario could use procedural rules to suspend or alter them as needed.]
if the player does not know the spell understood, say “You do not know the mystery of that enchantment.” instead.

Check casting (this is the can’t cast on the wrong sort of target rule):
if the targeting of the spell understood is targeted:
if the second noun is a room, say “That enchantment must be cast at something.” instead;
otherwise:
unless the second noun is a room, say “That enchantment cannot be cast at anything.” instead.

Check casting (this is the can’t cast without strength rule):
if the strength of the player <= the strength cost of the spell understood to the player, say “You are weak, and have not sufficient strength of mind.” instead.

Check casting (this is the can’t cast at yourself rule):
if the player is the second noun, say “It is a cardinal rule of magic that no mage may cast an enchantment upon himself.” instead.

Check casting (this is the can’t cast without required materials rule):
let the stuff be the requirement of the spell understood;
unless the stuff is air:
if the player is carrying something (called the focus) which is made of the stuff,
now the current spell focus is the focus;
otherwise say “To weave that enchantment, you must have something made of [stuff] in your hands.” instead.

Check casting (this is the can’t magically attack a warded person rule):
if the nature of the spell understood is offensive and the second noun is a person:
let the intended victim be the second noun;
if the intended victim knows ward magic, say “With a contemptuous wave of orange sparks, [the intended victim] cancels your [spell understood] incantation.” instead.[* The can’t magically attack a warded person rule is a little sloppy: it does not sap the magical strength of the victim to cast the spell, which - if sauce for the wizard is sauce for the necromancer - it perhaps should.]

Effect is a rulebook.[*The carry out and report rules for the casting action are going to be surprisingly short - considering the vast range of possible outcomes when a spell is cast - and they do this by using a more powerful mechanism to allow for more flexible reporting than would ordinarily be possible: they create a new rulebook, “Effect”, whose task is to carry out the spell. Effect rules are also expected to set “current spell outcome” to a suitable message about what happens, and (optionally) “current spell event” to a rule which carries out further consequences.]

The current spell outcome is an indexed text which varies. To record outcome (eventual message - text): now the current spell outcome is eventual message.

The current spell event is a rule which varies. To record event (eventual rule - rule): now the current spell event is eventual rule.

This is the no spell event at all rule: stop.

Carry out casting:
record outcome “but then nothing obvious happens”;
record event the no spell event at all rule;
now the strength of the player is the strength of the player minus the strength cost of the spell understood to the player;
increase the usage count of the spell understood by 1;
if the usage count of the spell understood is less than 3[* You gain experience points the first couple of times you cast a spell, but then the novelty wears off.]:
let N be the cost of the spell understood;
increase the score by two times N;
if the cost of the spell understood is at least 5 and the current spell focus is something, remove the current spell focus from play;
follow the effect rulebook.

Report casting:
say "As you intone the words of the [spell understood] spell, ";
if the current spell focus is something:
say "[the current spell focus] ";
unless the player is holding the current spell focus, say "vanishes as it ";
say "releases ";
otherwise:
say "your fingers release “;
say emission of the spell understood;
unless the second noun is a room, say " at [the second noun]”;
say “, [current spell outcome]”;
if the player is affected by the spell understood:
if duration of the spell understood is greater than 0:
say “, which will last for [duration of the spell understood in words] turn[s]”;
now the duration timer of the spell understood is the duration of the spell understood;
increase the duration timer of the spell understood by 1;
say “.”;
follow the current spell event.

Every turn:
repeat through the Table of Enchantments:
let the remaining effect be the duration timer entry;
decrease the remaining effect by 1;
if the remaining effect >= 0, now the duration timer entry is the remaining effect;
if the remaining effect is 0:
now the player is not affected by the spell entry;
say “(The [spell entry] spell wears off.)”.[* For simplicity, and to keep storage requirements from going through the roof, time-limited spells can only be applied to the player.]

Understand “xyzzy” and “plugh” as a mistake (“Nobody believes those old children’s stories about a colossal cave with magic words any more. Magic’s something you spend years and years learning.”).

Section 2(e) - Effect of standard spells in alphabetical order

Effect of casting aerial shield at:
record outcome “and forms an almost invisible saucer-like shield over your head, which moves with you”;
now the player is affected by aerial shield;
rule succeeds.

A thing can be trapped or untrapped. A thing is usually not trapped.

Instead of drinking a trapped strength potion:
remove the noun from play;
say "You quaff [the noun], but it is poison! And it harms you by “;
let the extra be the roll of the additional strength of the noun;
decrease the strength of the player by the extra;
say " strength points.”;
if the player is killed, end the story saying “You have been poisoned”.

Instead of putting a trapped strength potion on a weapon:[* This didn’t occur to the author at all - one of the playtesters tried it, and then the idea seemed irresistable. Poisoning a weapon adds a whole extra die and +2 in adds, so there’s quite a reward for anyone resourceful enough to think of this.]
remove the noun from play;
let the hit power be the hit dice of the second noun;
let N be the dice part of the hit power;
let S be the sides part of the hit power;
let A be the adds part of the hit power;
increase A by 2;
increase N by 1;
now the hit dice of the second noun is the die roll with dice part N sides part S adds part A;
say “Carefully, you apply the poison from [the noun] to [the second noun], using it all up.”

Understand “poison [something]” as a mistake (“How, exactly?”).

A person can be slumbering or wakeful.

Effect of casting dragon sleep at a wyvern:
if the second noun is wakeful:
record outcome “and quite beguiles the wyvern which, though not properly speaking a dragon, is always flattered by any suggestion that it counts as one in the great scheme of things. Enormous snores soon result”;
increase the score by 4;
now the second noun is slumbering;
otherwise:
record outcome “but, after all, the wyvern is already asleep”;
rule succeeds.

Instead of doing something to a slumbering wyvern, say “Best let sleeping wyverns lie.”

Effect of casting detect trap at:
if a trapped thing is visible:
record outcome “and it swirls around you for a time before finally settling upon [the list of trapped visible things]. You give a grim smile”;
otherwise:
record outcome “but it radiates away with a sense of calm normality”;
rule succeeds.

Effect of casting fashion staff at:
now the current spell focus is magic-imbued wood;
record outcome “growing scorch-hot in your hands as the wood is transformed into a magical hybrid, imbuing it with strength”;
rule succeeds.

Effect of casting inner warmth at:
record outcome “and surrounds you with a cosy feeling of well-being”;
now the player is affected by inner warmth;
rule succeeds.

Effect of casting ironbones at:
record outcome “and fortifies your whole body”;
now the player is affected by ironbones;
rule succeeds.

Effect of casting know nature at:
if the second noun is a direction, record outcome “never to return”;
otherwise record outcome “which make a curious sort of examination and then trace the sigil of [material of the second noun] in mid-air”;
rule succeeds.

Effect of casting magelight at:
record outcome “which bathe your upper body in radiance”;
now the player is affected by magelight;
now the player is lit;
rule succeeds.

Every turn: unless the player is affected by magelight, now the player is unlit.

Effect of casting magic missile at something:
if the second noun is a person:
record outcome “bursting in a splash of magical fire”;
record event the magic missile strike rule;
otherwise:
if the second noun is portable and the second noun is not scenery:
remove the second noun from play;
record outcome “which vapourises into a whiff of smoke”;
otherwise:
record outcome “which shakes as it absorbs the blow, but withstands it”;
rule succeeds.

This is the magic missile strike rule:
say "A magic missile does 1d6 damage per level of the caster, so: “;
let L be the level of the player;
let the strike power be the die roll with dice part L sides part 6 adds part 0;
let the strike amount be the roll of the strike power;
say " points of damage”;
now the second noun is hostile;
make the second noun take the strike amount points of damage.

Sanctum Sanctorum is a room. “Here in the calm, still centre of the turning world, you find Sanctuary. It is a place to rest, to meditate. Through the hazy rainbow walls, you can vaguely see the [room outside from the Sanctum Sanctorum], but it is as unreal as a dream.” Before going outside from the Sanctum Sanctorum, say “You blink as your eyes adjust to the harshness of reality - the unforgiving vividness of existence.”

The rainbow outlines of your sanctuary are fixed in place. “Before you are the rainbow outlines of your sanctuary, which you alone can see, never mind enter.” Instead of entering the rainbow outlines: move the player to the Sanctum Sanctorum. Understand “sanctum” as the rainbow outlines.

Understand the command “rest” as “sleep”. Understand the command “dream” as “sleep”. Understand the command “meditate” as “sleep”. Check sleeping (this is the can’t sleep outside of sanctuary rule): if the location is not the Sanctum Sanctorum[ and the location is not the Temple of Peace], say “This is not a safe enough place to recuperate. Nowhere exposed to attack is ever safe.” instead. Check sleeping: if the strength of the player is the permanent strength of the player, say “You are hale and hearty, with no need of rest.” instead.

Carry out sleeping: restore the health of the player. Report sleeping: say “You rest, soaking up the healing goodness of the sanctuary.” The block sleeping rule is not listed in any rulebook.

Check saving the game: if the location is not the Sanctum Sanctorum[ and the location is not the Temple of Peace], say “(The game can only be saved when in an indisputably safe place. This is not that place. You will know it when you find it.)” instead.[* An exceptionally unpopular rule with players, this. But it does make the reward for those who discover “make sanctuary” all the sweeter.]

Effect of casting make sanctuary at:
if the location is the Sanctum Sanctorum:
record outcome “which - thankfully - dissipate harmlessly. There probably are necromancers in this world who could get away with a stunt like that, but you’re not one of them.”;
rule succeeds;
record outcome “which - sketchily at first, but with growing confidence of purpose - come together into the ghostly rainbow outlines of a sanctuary before you”;
change the outside exit of the Sanctum Sanctorum to the location;
move the rainbow outlines of your sanctuary to the location;
rule succeeds.

Effect of casting memorise at something:
record outcome “which fades and recovers itself, in a curiously unsatisfying way”;
rule succeeds.
Effect of casting memorise at a scroll:
unless the player is carrying the second noun:
record outcome “which, not being in your hands, tantalises more than it reveals”;
rule succeeds;
remove the second noun from play;
now the player knows the inscribed spell of the second noun;
record outcome “which crumbles into dust, filling your mind with thoughts of the [inscribed spell of the second noun] spell”;
rule succeeds.

Effect of casting mend at something:
record outcome “which almost imperceptibly straightens and tidies itself, but with no real effect”;
rule succeeds.

Effect of casting mend at a person:
record outcome “which pats [the second noun] on the head, to no practical benefit”;
rule succeeds.

Definition: A person is undead if exorcise undead is its defensive charm.

This is the exorcise undead removal rule:
repeat with turned one running through the undead people in the location:
remove the turned one from play;
increase the score by the permanent strength of the turned one.

Effect of casting exorcise undead at:
if an undead person is in the location:
record outcome “which, as if a kind of lassoo, loops around [the list of undead people in the location] and drags the unclean down beneath the earth”;
record event the exorcise undead removal rule;
rule succeeds;
record outcome “which throws a kind of lassoo around nothing in particular, then pulls tight until it disappears”;
rule succeeds.

Effect of casting silence at:
record outcome “and a silence settles mufflingly around your feet”;
now the player is affected by silence;
rule succeeds.

Effect of casting summon elemental at:
record outcome “and there is a horrendous tearing sound from the very earth”;
move Zoorl to the location;
now Zoorl is indifferent;
rule succeeds.

Effect of casting web at a hostile monster:
record outcome “and the silken strands drape themselves over [the second noun], impeding all movement”;
now the second noun is affected by web;
rule succeeds.
After printing the name of a person who is affected by web when we are looking, say " (webbed)".
For calculating combat modifiers of a person who is affected by web:
modify to-hit roll by -8 for “trying to fight through web”;
continue the activity.

Effect of casting web at:
record outcome “but the silken strands fall away, half-hearted and half-meant”;
rule succeeds.

Chapter 3 - Combat

Section 3(a) - Monsters are People Too

A person has a spell called defensive charm.

A person has a text called hand-to-hand combat method. The hand-to-hand combat method of a person is usually “with bare hands”. A person has a die roll called unarmed combat hit dice. The unarmed combat hit dice of a person is usually 1d2.

A monster is a kind of person. A monster can be hostile or indifferent. A monster is usually hostile. Definition: A monster is scary if its strength is 50 or more. Definition: A monster is feeble if its strength is 10 or less. Some kinds of monster are defined by the Table of Monstrous Beasts.

Instead of asking a monster about something: say “[The noun] is unreachable on most levels.”

After printing the name of a monster while looking: say " (STR [strength])".

Table of Monstrous Beasts
name strength hand-to-hand combat method unarmed combat hit dice defensive charm
goblin 5 “pummeling its green fists” 1d4 –
gnome 2 “slapping its feeble arms” 1d2 –
centaur 9 “kicking its hooves” 1d6 –
werespider 7 “clicking its mandibles” 1d8+1 –
wyvern 75 “beating its clawed wings” 2d8+5 –
half-orc 9 “burrowing with its claws” 1d6 –
harpy 15 “swooping with its talons” 2d6 aerial shield
giant bat 8 “diving to bite” 2d4 aerial shield
basilisk 4 “staring with cursed eyes” 4d6 –
purple worm 7 “biting with acidic teeth” 2d6+1 –
gargoyle 10 “punching stone fists” 1d8+1 –
cave troll 14 “swinging enormous fists” 3d4 –
cave spectre 12 “throwing curses” 2d4+3 exorcise undead
marsh spectre 18 “throwing curses” 4d4+3 exorcise undead
skeletal warrior 25 “slicing with ghostly blades” 2d6+3 exorcise undead
green hydra 32 “ducking its heads in turn” 3d8+3 aerial shield
frost giant 28 “throwing deadly icicles” 2d8+4 inner warmth
elemental demon 35 “whirling with venom” 4d4+2 –

An elemental demon called Zoorl the Elemental Demon is indifferent.[* Oh, the ennui of the underworld. The practical effect of this line is to create Zoorl and leave him out of play at the start of the game: he is the demon brought into being by the “summon elemental” spell.]

Every turn:
if Zoorl is in a room (called the haunt):
unless the haunt is the location:
remove Zoorl from play;
otherwise:
if Zoorl is indifferent and a hostile monster (called the victim) is in the location,
make Zoorl strike a blow against the victim.

Effect of casting web at a wyvern:[* It turns out to be convenient to have at least one monster which is basically proof against anything the player can throw at it, and that’s the wyvern. In testing, it turned out that “web” gave a lucky player a chance to defeat a wyvern, which was inconvenient for the plot. So…]
record outcome “but the web is pathetically small compared to the great scale of the wyvern, and your efforts seem laughable”;
rule succeeds.

Section 3(b) - Weaponry

A weapon is a kind of thing. A weapon has a die roll called hit dice. Definition: A weapon is savage if its hit dice are 3d6 or more. A weapon has a text called technique. The technique of a weapon is usually “swinging”. Some kinds of weapon are defined by the Table of Weaponry.[* This innocent-looking sentence is doing something rather sophisticated: it makes a new kind for every row of the table.] Weapons are usually metal. A spear is wood. A quarterstaff is wood. A lance is wood.

After printing the name of a weapon while taking inventory: say " ([hit dice] attack)". Instead of examining a weapon, say “[The noun] is a weapon with a [hit dice of the noun] attack.”

A weapon has a number called the to-hit bonus.

Table of Weaponry
name hit dice technique
dagger 1d3 “stabbing”
quarterstaff 1d6 “swinging”
battle axe 1d8 “hewing”
short sword 1d6 “swinging”
broad sword 2d4 “swinging”
spear 1d6 “lunging with”
lance 1d8+1 “lunging with”

Section 3© - Armour

An armour is a kind of thing. An armour is wearable. Some kinds of armour are defined by the Table of Armoured Dress. Armour is usually metal. Leather jerkins are usually flesh.

Table of Armoured Dress
name armour class
leather jerkin 1
ring mail 2
chain mail 3
plate armour 4

Check wearing an armour:
if the player is wearing armour, say “You can only wear one piece of armour at a time.” instead.

After printing the name of armour while taking inventory: say " (damage -[armour class])".

Instead of casting magic missile at armour which is worn by someone (called the victim): try casting magic missile at victim.

Section 3(d) - Combat-readiness

To decide whether combat proceeds:
if a hostile alive monster (called the baddie) is in the location, decide yes;
decide no.

Before reading a command:
if combat proceeds, now the command prompt is "Combat> ";
otherwise now the command prompt is "> ".

After waiting when combat proceeds: stop the action.

Check going (this is the need a saving roll to retreat rule):
if combat proceeds:
if a saving roll of 11 by the player to “disengage from the fight” is made, continue the action;
say “So you are unable to break away.” instead.

Check casting (this is the can’t cast non-combat spells in combat rule):
let the warlike nature be the nature of the spell understood;
if the warlike nature is defensive, let the warlike nature be offensive;
if combat proceeds and the warlike nature is not offensive:
say “The nature of that spell is [nature of the spell understood]: unlike offensive and defensive spells - which are structured for use in combat - [nature of the spell understood] spells need a little peace and calm to be cast.” instead.

A person can be surprised or ready. A person is usually ready.

Instead of attacking a monster:
if the noun is hostile, say “You are already locked in combat.” instead;
now the noun is hostile;
now the noun is surprised;
now the player is ready;
say “You make a surprise attack on [the noun]!” instead.

To mount an attack from (bad guy - a monster):
now the bad guy is hostile;
now the bad guy is ready;
now the player is surprised;
say “[The bad guy] attacks!”

Every turn when a hostile monster is in the location:
if the player is ready, make the player strike a blow against the scariest hostile monster in the location;[* Recall that “scary” was defined in 3(a) above: “scariest” automatically acquires the meaning of “that which is most scary”.]
repeat with the opponent running through hostile monsters in the location:
if the player is killed, stop;
if the opponent is ready:
if Zoorl is in the location, make the opponent strike a blow against Zoorl;
otherwise make the opponent strike a blow against the player;
now the player is ready;
now all hostile monsters are ready.

Section 3(e) - Damage

The damage incurred is a number that varies.

Calculating damage modifiers of something is an activity.

For calculating damage modifiers of a person (called the defender):
if the defender is wearing armour (called the protector) and the damage incurred is greater than 1:
say ": [the protector] absorbs ";
let the absorbency be the armour class of the protector;
if the absorbency >= the damage incurred:
let the absorbency be the damage incurred;
decrease the absorbency by 1;
decrease the damage incurred by the absorbency;
say the absorbency;
continue the activity.

For calculating damage modifiers of a person (called the defender):
if the defender is affected by ironbones and the damage incurred is greater than 1:
say “: the ironbones spell halves the damage”;
now the damage incurred is the damage incurred divided by 2;
continue the activity.

Dead body disposal of something is an activity.[* This is provided for the benefit of anyone using these rules who wants to make something special happen to dead bodies, which otherwise quietly vanish from the field of battle.]

To make (defender - a person) take (hits - a number) points of damage:
let the original hits be the hits;
now the damage incurred is the hits;
carry out the calculating damage modifiers activity with the defender;
let the hits be the damage incurred;
if the hits <= 0:
say " - so no damage is done.";
stop;
if the original hits are not the hits, say “, leaving [hits] to take”;
decrease the strength of the defender by the hits;
if the defender is killed:
say " - a fatal blow!";
if the player is the defender:
end the story saying “You have been killed in combat”;
stop;
carry out the dead body disposal activity with the defender;
if the defender is in the location, remove the defender from play;
increase the score by the permanent strength of the defender;
repeat with the item running through things which are had by the defender:
move the item to the location;
otherwise:
if the player is the defender, say “, reducing your strength to [strength of the player].”;
otherwise say “, wounding [the defender] to a strength of [strength of the defender].”.

Section 3(f) - Striking blows

The to-hit roll is a number that varies.

To modify to-hit roll by (amount - a number) for (reason - text):
if the amount >= 0, say “, +[amount] for [reason]”;
otherwise say “, [amount] for [reason]”;
increase the to-hit roll by the amount.

Calculating combat modifiers of something is an activity.

For calculating combat modifiers of the player:
modify to-hit roll by the level of the player for “your level”;
continue the activity.

To make (attacker - a person) strike a blow against (defender - a person):
if the attacker is the player, say "You attack ";
otherwise say "[The attacker] attacks ";
if the defender is the player, say "you, ";
otherwise say "[the defender], “;
let the damage done be the unarmed combat hit dice of the attacker;
let the instrument be nothing;
if the attacker carries a weapon:
let the instrument be the savagest weapon carried by the attacker;
let the damage done be the hit dice of the instrument;
say “[technique of the instrument] [the instrument]”;
otherwise:
say hand-to-hand combat method of the attacker;
now the to-hit roll is a random number from 1 to 20;
say “, making an attack roll (1d20) of [to-hit roll]”;
carry out the calculating combat modifiers activity with the attacker;
if the instrument is a weapon and the to-hit bonus of the instrument is not 0, modify to-hit roll by the to-hit bonus of the instrument for “wielding a blessed weapon”;
let the hits be 0;
if the to-hit roll <= 2:
say " - critical miss (2 or less): “;
if the instrument is a weapon:
if the attacker is the player:
silently try dropping the instrument;
if the player does not carry the instrument, say “you dropped [the instrument]!”;
otherwise say “[the instrument] shook in your hand!”;
otherwise:
now the instrument is in the location;
say “[the attacker] drops [the instrument]!”;
otherwise:
decrease the strength of the attacker by 1;
if the attacker is the player:
say “you actually injure yourself!”;
if the player is killed, end the story saying “You have fumbled into an inglorious demise”;
otherwise:
say “[the attacker] roars with impotent rage!”;
stop;
if the to-hit roll <= 10:
say " - miss (3 to 10): no damage done!”;
stop;
if the to-hit roll <= 19:
say " - hit (11 to 19), doing [damage done] of damage: “;
let the hits be the roll of the damage done;
if the hits is 1, say " point”;
otherwise say " points”;
otherwise:
say " - critical hit (20 or more), doing [damage done] doubled of damage: ";
let the hits be the roll of the damage done;
let the hits be the hits multiplied by 2;
say “, doubled up to [hits] points”;
let the counter-charm be the defensive charm of the attacker;
if the defender is affected by the counter-charm:
say “, soaked up by the [counter-charm] spell.”;
stop;
make the defender take hits points of damage.

Section 3(g) - Missile weapons, lack of

Instead of throwing a spear at, say “There are no missile weapons in the combat rules for this game, which does seem a pity with a fine spear like that.”

Instead of throwing something at, say “There are no missile weapons in the combat rules for this game, but I trust we could do better than [the noun] even if there were.”
[/code][/rant]

Yeah, these are standard 6L problems–they’re phrases that have been dropped from Inform for one reason or another (Reliques was a demonstration example for the very first version of Inform 7, I think, so some of these are pretty crusty). Daniel already gave you a whole lot of stuff, but here’s the line-by-line fixes if you want to apply them directly to the code you have now.

Wow, this looks old–I don’t remember this phrase from even before the last major round of I7 updates. I’m pretty sure that this is something that increases the score, so you might be able to delete all these lines if you don’t want a score in your game. (In Reliques the score doubles as the experience point count.)

Anyway, if you want it, now you would use this:

increase the score by foo

although now scoring is also off by default so if you’re doing anything with the score you have to add this near the beginning of your source code:

Use scoring.

This becomes

now the duration timer of the spell understood is the duration of the spell understood

Almost every “change… to” from old code is now replaced by “now… is.” (The exceptions are some phrases that have “change” hard-wired into them and that don’t work exactly the way “Now” phrases works; according to the phrasebook in the Index those would be “change (list of values) to have (number) entries/entry,” " change (direction) exit of (room) to (room)," “change (direction) exit of (room) to nothing/nowhere,” and “change the text of the player’s command to (text).”)

Now this is:

follow the effect rulebook

There used to be a subtle difference between “consider” and “follow” (or “abide by”) which had to do with procedural rules, but there aren’t any more procedural rules, so “consider” isn’t needed anymore. (It’s just possible that you might need “abide by” rather than “follow.”)

I haven’t looked into the guts of the Reliques code or your code either, so I don’t know if these are working, but from the error log you gave these look like the fixes you need.

To supplement what Matt said now: there are also a couple procedural rules in RoTA, but they’re very simple ones. You can use “the [name] rule is not listed in any rulebook” or “the [name] rule does nothing” instead.

There is one place where you need to keep “change…”, which is altering the outside exit of the Sanctuary. But other than that all examples of “change…to…” here can be replaced with “now…is…”. If you have a text editor that does regex replacement, “change (.) to (.)([.;])” -> “now \1 is \2\3” is quite useful for this.