Five Gods Exiled — 183 of 191

Carolyn VanEseltine

Release 1

Part 2 - Monster Attacks

A monster can be engaged or unengaged. A monster is usually unengaged.

To check monster engagement:

repeat with temporary monster running through active engaged monsters:

if the location of the temporary monster is not the location of the player:

now the temporary monster is unengaged;

say "([The temporary monster] is no longer engaged with the player.)";

repeat with temporary monster running through monsters in the location:

now the current monster is the temporary monster;

if the espeed of the temporary monster is greater than the espeed of the player:

if the current monster is aware of the player:

say the quick attack text of the temporary monster;

now the temporary monster is engaged.

To carry out monster attacks:

repeat with temporary monster running through active engaged monsters:

now the current monster is the temporary monster;

[ say "([The temporary monster] is engaged and present in the room.)";]

say the attack text of the temporary monster;

if the shadow self is in the location:

let K be 1;

while ((K * (eattack of the temporary monster - edefense of the player)) < chealth of the player) and ((K * (eattack of the player - edefense of the temporary monster)) < chealth of the temporary monster):

now K is (K + 1);

[ say "The multiplication K here is [K].";]

say "Your shadow steps forward to intervene. Assessing the situation, you perceive that";

if (eattack of the temporary monster - edefense of the player) * K >= chealth of the player:

say " your shadow will be destroyed";

otherwise if (eattack of the temporary monster - edefense of the player) * K >= (chealth of the player) / 2:

say " your shadow will be gravely injured";

otherwise if (eattack of the temporary monster - edefense of the player) * K is 1:

say " your shadow will be slightly injured";

otherwise if (eattack of the temporary monster - edefense of the player) * K > 0:

say " your shadow will be injured";

otherwise if (eattack of the temporary monster - edefense of the player) * K <= 0:

say " there is no risk to your shadow";

say " in fighting the monster, and ";

if (eattack of the player - edefense of the temporary monster) * K >= chealth of the temporary monster:

say " the monster will be killed";

otherwise if (eattack of the player - edefense of the temporary monster) * K > (chealth of the temporary monster) / 2:

say " the monster will be gravely injured";

otherwise if (eattack of the player - edefense of the temporary monster) * K is 1:

say " the monster will be slightly injured";

otherwise if (eattack of the player - edefense of the temporary monster) * K > 0:

say " the monster will be injured";

otherwise if (eattack of the player - edefense of the temporary monster) * K <= 0:

say " there is no risk to the monster";

say " if you permit the shadow to defend you. Allowing the monster to reach you is ";

if emattack of the temporary monster >= cattunement of the player:

say "a prospect terrifying enough to shake your sanity. ";

otherwise if emattack of the temporary monster >= (cattunement of the player) / 2:

say "an extremely frightening prospect. ";

otherwise if emattack of the temporary monster > 0:

say "a scary but survivable prospect. ";

otherwise if emattack of the temporary monster <= 0:

say "actually a prospect that doesn't bother you all that much. ";

say "[paragraph break]Allow the shadow to defend you? (y/n)> ";

if player consents:

say "[line break]Your shadow steps in to protect you. [The temporary monster] attacks. Your eyes tear and your stomach twists as you try to watch, and you can't properly follow what happens next....[paragraph break]";

[ say "(Monster attack [eattack of the temporary monster] - player defense [edefense of the player] results in [eattack of the temporary monster - edefense of the player] damage to health. Repeating [K] times.)";]

if eattack of the temporary monster > edefense of the player:

now the chealth of the player is the chealth of the player - ((eattack of the temporary monster - edefense of the player) * K);

[ say "Player now at [chealth of the player] health out of a maximum of [rhealth of the player].";]

now the chealth of the temporary monster is the chealth of the temporary monster - ((eattack of the player - edefense of the temporary monster) * K);

[ say "[Temporary monster] now at [chealth of the temporary monster] health out of a maximum of [rhealth of the temporary monster].";]

otherwise:

say "[line break]Your shadow stands back at your wish. [The temporary monster] surges into you, and its unavoidable wrongness batters at the walls of your consciousness.";

[ say "(Monster attack [emattack of the temporary monster] results in [emattack of the temporary monster] damage to attunement. ";]

now the cattunement of the player is the cattunement of the player - (eattack of the temporary monster - edefense of the player);

[ say "Player now at [cattunement of the player] attunement out of a maximum of [rattunement of the player]. ";]

now the chealth of the temporary monster is the chealth of the temporary monster - (eattack of the player - edefense of the temporary monster);

[ say "[Temporary monster] now at [chealth of the temporary monster] health out of a maximum of [rhealth of the temporary monster].)";]

otherwise:

say "Without your shadow self, you have no protection as [the temporary monster] attacks. The [temporary monster] surges into you, and its unavoidable wrongness batters at the walls of your consciousness. Your mind blots out what happens next....";

now the cattunement of the player is the cattunement of the player - (eattack of the temporary monster - edefense of the player);

[ say "Player now at [cattunement of the player] attunement out of a maximum of [rattunement of the player]. ";]

now the chealth of the temporary monster is the chealth of the temporary monster - (eattack of the player - edefense of the temporary monster);

[ say "[Temporary monster] now at [chealth of the temporary monster] health out of a maximum of [rhealth of the temporary monster].)";]

if the chealth of the temporary monster is the rhealth of the temporary monster:

say "[The temporary monster] withdraws, completely uninjured so far as you can tell.";

otherwise if the chealth of the temporary monster > 0:

say "[The temporary monster] withdraws, hurt but alive.";

repeat with temporary monster running through monsters in the Blight:

now the current monster is the temporary monster;

if the chealth of the current monster <= 0:

if the current monster is in the location:

say "[the death text of the current monster][line break]";

move the temporary monster to Z1.

[ if the cattunement of the player <= 0:

say "You have lost your attunement to the blighted world. The universe flickers wildly around you - one moment the Exile, the next moment the Blight, back and forth until the two combine. Your mind rings with the triumphant fury of the gods. You twist in on yourself, trying to protect against madness, but there is no escape....";

end the story saying "Everything is lost.";

repeat with temporary monster running through monsters in the Blight:

now the current monster is the temporary monster;

if the chealth of the current monster <= 0:

if the current monster is in the location:

say "[the death text of the current monster][line break]";

move the temporary monster to Z1;

if the chealth of the player <= 0 and the shadow self is in the location:

now the current person is the shadow self;

say "Fatally wounded, your shadow self crumples to the ground. Waves of stomach-twisting light course over [zher] form, forcing you to look away. When you master yourself and look back, [zhe] is gone.";

move the shadow self to Z1.]

An every turn rule (this is the survival verification rule):

if the cattunement of the player <= 0:

say "You have lost your attunement to the blighted world. The universe flickers wildly around you - one moment the Exile, the next moment the Blight, back and forth until the two combine. Your mind rings with the triumphant fury of the gods. You twist in on yourself, trying to protect against madness, but there is no escape....";

end the story saying "Everything is lost.";

if the chealth of the player <= 0 and the shadow self is in the location:

now the current person is the shadow self;

say "Fatally wounded, your shadow self crumples to the ground. Waves of stomach-twisting light course over [zher] form, forcing you to look away. When you master yourself and look back, [zhe] is gone.";

move the shadow self to Z1.