I’ve been using Inform Attack to handle all the combat in my project, but I run into a problem when I don’t want combat to start right away. This can happen for two reasons in my project - you’re stealthy and can’t be seen, or the monster is asleep and doesn’t know you’re there.
I tried messing with the hate rules and the ‘starting the combat round’ rules, but didn’t get very far, so I finally set ‘stealthy’ and ‘asleep’ to be factions and turned off the rule that prevent you from attacking factions you don’t hate.
The only problem was that I still couldn’t attack any factions I didn’t hate. I tracked the problem down to the ‘standard active attacking first phase’ rule only letting me attack if we were already in combat, and I modified it so I should also be able to attack outside of combat.
This worked, except it seems to break the rounds - if you’re attacking, you will always be attacking, and if you’re unlucky enough to be reacting, you will always be reacting. The only time it works properly is if you (or the monster) misses.
I’m not sure what to do to fix this so it works properly and still lets me attack.
[spoiler][code]
Include Inform Attack by Victor Gijsbers.
Asleep is a faction. Stealthy is a faction.
When play begins, now the player is stealthy.
A person has a number called a stealth bonus. The stealth bonus is usually 0.
The stealth bonus of the player is 5.
The rock is a weapon. The player carries the rock.
The do not attack neutral people rule is not listed in any rulebook.
The standard active attacking first phase rule is not listed in any rulebook.
Carry out an actor attacking when the fight consequences variable is false (this is the modified active attacking first phase rule):
if the combat state of the actor is at-Act:
now the global attacker is the actor;
now the global attacker weapon is a random readied weapon enclosed by the global attacker;
consider the attack move flavour rulebook;
choose a blank row in the Table of Stored Combat actions;
now the Combat Speed entry is 10;
now the Combat Action entry is the action of the actor attacking the noun;
now the combat state of the noun is at-React;
now the provoker of the noun is the actor;
now the provocation of the noun is the attacking action;
Otherwise:
consider the hate rules;
if rule failed:
now the combat state of the actor is at-Act;
now the global attacker is the actor;
now the global attacker weapon is a random readied weapon enclosed by the global attacker;
consider the attack move flavour rulebook;
choose a blank row in the Table of Stored Combat actions;
now the Combat Speed entry is 10;
now the Combat Action entry is the action of the actor attacking the noun;
now the combat state of the noun is at-React;
now the provoker of the noun is the actor;
now the provocation of the noun is the attacking action.
An attack modifiers rule (this is the stealth increases accuracy rule):
if the global attacker is stealthy:
increase the to-hit modifier by the stealth bonus of the global attacker;
if the numbers boolean is true:
say " + “, stealth bonus of the global attacker, " (sneak attack)[run paragraph on]”.
A damage modifiers rule (this is the sneak attack gives bonus damage rule):
if the global attacker is stealthy:
increase the damage modifier by the stealth bonus of the global attacker;
if the numbers boolean is true:
say " + “, stealth bonus of the global attacker, " (sneak attack)[run paragraph on]”.
An aftereffects rule (this is the combat breaks stealth rule):
if the player is stealthy:
now player is friendly.
The defence of a person is usually 0.
Erdeth’s Lair is a room. “Great piles of heaping treasure fill the cave, mounds of coins and baubles, tastefully scattered gems, carefully arranged heaps of armor and weapons. Oddly, most of the items here don’t seem to be very high quality.” Erdeth’s Lair is northeast from Clawed tunnel.
Erdeth is a man in Erdeth’s Lair. The description of Erdeth is “The great red dragon Erdeth, grown too large to escape his lair and having eaten everything he can reach, now spends most of his time hibernating and waiting for food to come to him. At the moment he appears to be sound asleep, fortunately.” Before printing the name of Erdeth when looking, say "the great dragon ". Understand “great dragon” or “dragon” as Erdeth.
Erdeth is asleep.
After printing the name of Erdeth when looking:
If Erdeth is asleep:
say " sleeping";
If Erdeth is hostile:
If Erdeth is killed:
do nothing;
Otherwise:
say " eyeing his surroundings hungrily".
Instead of examining a natural weapon enclosed by Erdeth (this is the Erdeth’s description of a natural weapon rule):
say “Sharp claws, buffeting wings, a spiked tail, and FAR too many teeth.”.
Every turn while Erdeth is asleep:
If the location of the player is the location of Erdeth:
say “[one of]Erdeth’s tail twitches briefly, then falls still.[or]Erdeth sighs in his sleep.[or]Erdeth’s wings twitch open briefly, then fall still.[or]Erdeth snorts and breathes a few rings of smoke.[at random]”;
If the health of Erdeth is less than the permanent health of Erdeth:
now Erdeth is hostile.
After waiting in Erdeth’s Lair, now Erdeth is hostile.
[/code][/spoiler]