p.s. I got bored and fixed the whole thing, creating a mini-game that actually works.
Here it is in full.
[rant][code]
“Sandbox” by Merlin Fisher
Arena is a room. “Various persons, beasts, and things are fighting all around you. The roar of the crowd fails to drown out the screams, grunts, and clashes of metal.” [obviously if this were a real location, the crowd would be examinable scenery.]
Chapter 1 - Hit Points, Alive and Dead status
A person can be alive or dead. A person is usually alive. [setting this should allow I7 to understand what “dead person” means.]
A person has a number called maximum hit points. The maximum hit points of the player is 30.
The maximum hit points of a person is usually 20. [note: unless this is specified, I7 will default to 0.]
A person has a number called current hit points. The current hit points of the player is 30.
The current hit points of a person is usually 20. [ditto]
Every turn:
repeat with potential-corpse running through the people in the Arena:
if the current hit points of the potential-corpse is less than 1:
now the potential-corpse is dead;
say “[The potential-corpse] succumbs to [their] wounds. [Their] body is quickly carted off by the Arena attendants.”;
if the potential-corpse is not the player:
remove the potential-corpse from play;
otherwise:
end the story saying “You have died”.
When play begins:
now the left hand status line is “Health: [current hit points of player] / [maximum hit points of player]”.
[adding the latter tells the player what his max is, which is customary in RPGs, although if you prefer you may leave that a mystery of course. It's especially helpful to know your max if the player is able to increase or decrease his max, for instance if he gains 'levels' or is affected by poison, fatigue, temporary strengthening spells, etc.]
After examining someone (called the examinee):
if the examinee is alive:
say “[The examinee] appears to currently have [current hit points of the examinee] out of [maximum hit points of the examinee] hit points. [run paragraph on]”;
if the examinee is combative:
say “[They] appears combative.”;
otherwise:
say “[They] appears peaceful.” [combative/peaceful will be discussed below.]
Section 1 - Weapons
A weapon is a kind of thing. [not specifying this will leave I7 confused when you start talking about weapons.]
A sword is a weapon. It is carried by the player. The maximum damage of the sword is 8.
A club is a weapon. It is carried by the player. The maximum damage of the club is 6.
A chocolate kettle is a thing. It is carried by the player. [this is to test whether attacking with non-weapons does anything.]
Test weapon with “attack bear with sword / attack bear with kettle / x bear”.
Chapter 1 - Attacking With, a new verb
Section 1 - Defining Attack With
Understand the commands “attack” and “punch” and “destroy” and “kill” and “murder” and “hit” and “thump” and “break” and “smash” and “torture” and “wreck” as something new.
Attacking it with is an action applying to one visible thing and one carried thing. Understand “attack [someone] with [something preferably held]” as attacking it with.
Understand the commands “punch” and “destroy” and “kill” and “murder” and “hit” and “thump” and “break” and “smash” and “torture” and “wreck” as “attack”.
Section 2 - Causing Damage
The attacking it with action has a number called the damage inflicted.
Every weapon has a number called maximum damage. The maximum damage of a weapon is usually 5.
Maximum attack is a number that varies.
Setting action variables for attacking something (called the target) with something (called the instrument):
if the instrument is a weapon:
let the maximum attack be the maximum damage of the instrument;
now the damage inflicted is a random number between 1 and the maximum attack.
Section 3 - Standard Messages
Check an actor attacking something (called the target) with something (called the instrument) (this is the can’t attack with something that isn’t a weapon rule):
if the instrument is not a weapon:
say “[The second noun] does not qualify as a weapon.”;
stop the action.
Check an actor attacking something (called the target) with something (called the instrument) (this is the can’t attack a non-person rule):
if the target is not a person:
if the actor is the player, say “[The noun] has no life to lose.”;
stop the action.
Check an actor attacking something (called the target) with something (called the instrument) (this is the can’t attack oneself rule):
if the actor is the target:
say “[The actor] refuses to attack [themselves].”;
stop the action.
Section 4 - Destroying People
[careful; if the game ever requires the player to attack a door, chest, or other inanimate object, this routine will foil the attempt.]
Carry out an actor attacking something (called the target) with something (called the instrument) (this is the standard attacking it with a weapon rule):
decrease the current hit points of the target by the damage inflicted.
Report attacking someone with something (this is the normal attacking report rule):
say “You attack [the noun] with [the second noun], causing [damage inflicted] point[s] of damage!” instead.
[Report attacking a dead person (called the target) with something (called the instrument) (this is the death-report priority rule):
say “You attack with [the instrument], killing [the target]!” instead. ]
[I've blocked this out because I can't tell when it would be useful. You must be using the "dead" flag differently than I have here.]
[Report someone (called the enemy) attacking the player with something (called the instrument) when the player is dead (this is the player’s-death priority rule):
say “[The enemy] attacks you with [the instrument], finishing you off!”;
end the story;
stop the action.]
[ditto.]
Report someone attacking something (called the target) with something (called the instrument) (this is the standard report attacking it with rule):
say “[The actor] attacks [the target] with [the instrument], causing [damage inflicted] point[s] of damage!” instead.
Section 5 - Combat
A person can be combative or peaceful. A person is usually peaceful.
Every turn (this is the combative-persons-attack rule):
repeat with potential-enemy running through the people in the Arena:
if the potential-enemy is combative:
try the potential-enemy attacking the player with a random weapon which is carried by the potential-enemy.
Section 6 - Taunting
[this section lets us turn combativeness on and off.]
Taunting is an action applying to one visible thing. Understand “taunt [someone]” or “insult [someone]” as taunting. [optionally you can allow taunting of inanimate objects, but using ‘someone’ means Inform will only allow it on people.]
Carry out taunting something (called the audience):
if the audience is combative:
say “[The audience] is already angry.”;
stop the action;
otherwise:
say “[The audience] is enraged by your taunts! It is now ready to kill you.”;
now the audience is combative.
[note: this currently only works if the player taunts things. If you order your minion to taunt something, nothing will happen. More code is necessary if you want other people to taunt.]
Pacifying is an action applying to one visible thing. Understand “pacify [someone]” as pacifying. [optionally, you could kill the ‘block saying sorry’ rule and allow apologies to pacify.]
Carry out pacifying something (called the audience):
if the audience is combative:
if a random chance of 3 in 5 succeeds:
say “[The audience] mellows out, and decides to show mercy.”;
now the audience is peaceful;
otherwise:
say “[The audience] is not swayed by your pleas for mercy. [They] continues to press the attack!”;
otherwise:
say “[The audience] [are not] interested in killing you. There is no need to pacify [them].”
Test taunt with “x henchman / taunt henchman / x henchman / pacify henchman / pacify henchman / x henchman”.
Chapter 0 - Not for release - Combat Test victims
Section 1 - Punching bag
The teddy bear is a neuter person in Arena. “A life-size teddy bear rests against the wall, waiting for someone to beat the stuffing out of it.” [the bear is alive but will not fight back.] The maximum hit points of the teddy bear is 10. The current hit points of the bear is 10.
Test bear with “attack bear with club / g / g / x bear / retreat / attack bear”.
Section 2 - Furniture
The wooden column is an enterable supporter in Arena. “A short column with steps leading up to it, marked ‘WINNER,’ is in the center of the arena.” [this is here to test what happens when the player attacks inanimate objects. It can also test his ability to attack things while he is standing on something.]
Test column with “attack column with club / get on column / attack column / attack bear / retreat / x column”.
Section 3 - Unbeatable enemy
The scarlet dragon is a female person in Arena. Understand “red” as the scarlet dragon. “Stalking here and there, occasionally commenting on the battles, is a magnificent scarlet dragon.” [the dragon is a test subject that is guaranteed to beat the player.] The maximum hit points of the dragon is 100. The current hit points of the dragon is 100.
The fiery breath is a weapon. It is carried by the dragon. [more likely we’d want to make the weapon part of the dragon, but let’s skip that for now.] The maximum damage of the fiery breath is 20.
Test dragon with “dragon, attack me / attack dragon with club / x dragon / retreat / x dragon / attack dragon / g / g / g”.
Section 4 - Minion
The obedient henchman is a male person in Arena. Understand “minion” or “friend” or “Kenny” as the obedient henchman. “Your obedient henchman is here, awaiting your orders.” [this is to see if the attack rules work for OTHER people.] The maximum hit points of the henchman is 20. The current hit points of the henchman is 20.
The mace is a weapon. It is carried by the obedient henchman. The maximum damage of the mace is 5.
The cotton candy is a thing. It is carried by the obedient henchman.
Persuasion rule for asking the obedient henchman to try doing something:
persuasion succeeds.
Test minion with “x minion / minion, kill bear with mace / x bear / minion, kill minion with mace / minion, kill minion with cotton candy / minion, kill bear with cotton candy / minion, kill me with cotton candy / x minion / minion, kill me with mace / minion, kill dragon with mace / g / g / g”.
[/code][/rant]