The Reliques of Tolti-Aph

An interactive fiction by Graham Nelson (2005) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
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.[1] 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"



Note

[1]. This innocent-looking sentence is doing something rather sophisticated: it makes a new kind for every row of the table.