Hi everybody,
I copied and pasted the Lanista 2 combat system with a few edits:
[code]An enemy is a kind of person.
A person has a number called maximum hit points. A person has a number called current hit points.
The maximum hit points of the player is 120.
When play begins:
repeat with victim running through people:
now the current hit points of the victim is the maximum hit points of the victim.
Definition: a person is dead if his current hit points are less than 0.
Diagnosing is an action applying to one visible thing. Understand “diagnose [something]” as diagnosing.
Check diagnosing:
if the noun is not a person, say “You can only diagnose people.” instead.
Carry out diagnosing:
say “[if the noun is the player]You have[otherwise][The noun] has[end if] [current hit points of the noun] out of a possible [maximum hit points of the noun] hit points remaining.”
A weapon is a kind of thing. A weapon has a number called the maximum damage. The maximum damage of a weapon is usually 25.
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 preferably held] with [something]” 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”.
The attacking it with action has a number called the damage inflicted.
Setting action variables for attacking something with something:
if the second noun is a weapon:
let the maximum attack be the maximum damage of the second noun;
now the damage inflicted is a random number between 1 and the maximum attack.
Check an actor attacking something with something (this is the can’t attack with something that isn’t a weapon rule):
if the second noun is not a weapon:
if the actor is the player, say “[The second noun] is not a weapon.”;
stop the action.
Check an actor attacking something with something (this is the can’t attack a non-person rule):
if the noun is not a person:
if the actor is the player, say “You can’t kill the [The noun], because [The noun] has no life to lose.”;
stop the action.
Carry out an actor attacking something with something (this is the standard attacking it with a weapon rule):
decrease the current hit points of the noun by the damage inflicted;
if the noun is dead, remove the noun from play.
Report attacking a dead person with something (this is the death-report priority rule):
say “You attack with [the second noun], killing [the noun]!” instead.
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 someone attacking the player with something when the player is dead (this is the player’s-death priority rule):
say “[The actor] attacks you with [the second noun], killing you.”;
end the game in death;
stop the action
Report someone attacking the player with something (this is the standard report someone attacking the player with rule):
say “[The actor] attacks you with [the second noun], causing [damage inflicted] point[s] of damage!” instead.
Report someone attacking something with something (this is the standard report attacking it with rule):
say “[The actor] attacks [the noun] with [the second noun], causing [damage inflicted] point[s] of damage!” instead.
Every turn (this is the enemy-attack rule):
if an enemy is not dead, try the enemy attacking the player with a random weapon which is carried by the enemy.[/code]
However, I get this error:
[code]This is the report produced by Inform 7 (build 6G60) on its most recent run through:
Problem. You wrote ‘if an enemy is not dead, try the enemy attacking the player with a random weapon which is carried by the enemy’ , but ‘enemy attacking the player with a random weapon which is carried by the enemy’ is too vague to describe a specific action.
It has to be an exact instruction about what is being done, and to what. For instance, ‘taking the box’ is fine, but ‘dropping or taking something openable’ is not.
See the manual: 7.4 > Try and try silently
I was trying to match one of these phrases:
-
try (enemy attacking the player with a random weapon which is carried by the enemy - an action)
-
try (enemy attacking the player with a random weapon which is carried by the enemy - stored action)
This was what I found out:
enemy attacking the player with a random weapon which is carried by the enemy = a condition
[/code]
I don’t get it. How could it be more specific?
P.S. Sorry for the humoungous amount of code I posted, I just don’t know exactly where the problem is in the code.