Volume 2 - Fighting
To attack by (mo - a monster):
let damage be 0;
repeat with n running from 1 to dice of mo:
increase damage by a random number from 1 to 6;
increase damage by mod of mo;
if damage < 1:
now damage is 0;
if damage > 0 and a random chance of (rate of the mo - protection) in 100 succeeds:
say "The [mo] attacks you and deals [damage] points of damage.";
decrease hit points by damage;
else:
say "The [mo] attacks you, but misses.".
Instead of attacking a monster:
let damage be 0;
repeat with n running from 1 to dice of equiped weapon:
increase damage by a random number from 1 to 6;
increase damage by mod of equiped weapon;
if damage < 1:
now damage is 0;
if damage > 0 and a random chance of rate of the equiped weapon in 100 succeeds:
say "You attack the [noun] and inflict [damage] points of damage.";
decrease hp of the noun by damage;
if the the hp of the noun < 1:
let g be 0;
repeat with n running from 1 to loot of noun:
increase g by a random number from 1 to 6;
say "[line break]Your last strike killed the [noun]. It leaves behind [g] gold coins, which you immediately deposit in your rucksack.";
increase gold by g;
if loot2 of the noun is a thing:
say "[line break]The [noun] also dropped a [loot2 of the noun].";
now loot2 of the noun is in the location;
now the noun is nowhere;
if the vampire is nowhere:
say "[line break]You managed to kill the vampire.[line break]You have captured [gold] gold coins. Reward enough. Go home now.";
end the story finally;
else:
say "You attack the [noun], but you miss.".
Every turn when a monster is in the location:
let lom be the list of monsters in the location;
let mo be entry 1 of lom;
attack by mo;
if hit points < 0:
say "[line break]You managed to loot [gold] gold coins.[line break]Trying to get more, you were killed by the [mo].";
end the story.