Tutorial 7: The Tome of the Brightest Flame
Our next tome is going to be an item that makes the player more or less invulnerable… but will kill her after 30 turns.
[code]Section - Tome of the Brightest Flame
The Tome of the Brightest Flame is a tome.
Tome of the Brightest Flame is paper.
Tome of the Brightest Flame is magical.
Brightest-flame-counter is a number that varies. Brightest-flame-counter is 0.
Instead of reading the tome of the brightest flame:
say “You have chosen fame over a long life. Achieve it while you may!”;
now hit protection of the player is 50;
now brightest-flame-counter is 31.[/code]
The only new thing here is the “hit protection” variable. It is defined in the section on the scroll of protection (in Kerkerkruip Items). Whenever you are hit by an attack, if your hit protection is greater than 0, you’ll take no damage at all and the hit protection decreases by 1. The scroll of protection grants an average hit protection of 1.4… and obviously, 50 is ridiculous.
But there are other sources of damage, like the fragmentation grenade and the squeezing tentacle. To counteract those, we’ll use a physical damage reduction rule. These rules should add a certain number to the global variable called ‘pdr’, with each point added to pdr counting as one point of negated damage.
A physical damage reduction rule (this is the brightest flame damage reduction rule):
if the test subject is the player and brightest-flame-counter is not 0:
increase the pdr by 100.
Now for the code that will kill (and warn) the player:
Every turn when brightest-flame-counter is not 0:
if main actor is the player:
decrease brightest-flame-counter by 1;
if brightest-flame-counter is 30 or brightest-flame-counter is 20 or brightest-flame-counter is 10 or brightest-flame-counter is 5 or brightest-flame-counter is 1:
say "You will [bold type]die[roman type] in [brightest-flame-counter] turn[unless brightest-flame-counter is 1]s[end if]!";
if brightest-flame-counter is 0:
end the story saying "Your moment of fame has come and gone.".
That’s it! No, wait… we would like to have a special victory message here, because the player is still fated to die if she manages to kill Malygris. For such special occassions, we have the victory message rules:
Victory message rule (this is the brightest flame message rule):
if brightest-flame-counter is not 0:
end the story saying "You have destroyed your foe, and will be able to enjoy your victory for another [brightest-flame-counter] turns!";
rule succeeds.
That’s it. Reading this tome will send the player on a race to find and kill Malygris within 30 turns – which, being almost totally immune to any form of damage, shouldn’t be too hard.