Hello all! I’m a bit of a newbie to inform 7 and I would like to know how to set up a wall which disappears after it has been hit with a hammer five times. I’ve had a lot of trouble with this and its an important part of the game. Below is the code:
Attacking it with is an action applying to two things and requiring light. Understand “attack
[something] with [something]” and “hit [something] with [something]” as attacking it with.
[smithy]
The Smithy is a room. “The soot of the forge still hangs about the place. Beside the forge is an anvil with a hammer on it. The south wall is old and crumbly.” The smithy is southeast of the city square.
The wall is scenery in the smithy. The wall can be broken or unbroken. The wall is unbroken.
Check examining wall:
if wall is unbroken:
say “A wall with a sturdy door stands here. The door is locked, and looks impassible, but the wall looks a little crumbled.”;
now the printed name of the wall is “crumbly stone wall”;
if wall is broken:
say “The remains of the stone wall lies here.”;
now the printed name of the wall is “pile of rubble”.
Check going south:
if player is in the smithy:
if wall is unbroken:
say “The intermolecular bonds of the crumbly stone wall stops you from passing through matter. You bump your nose, feeling quite foolish.” instead;
if wall is broken:
continue the action;
if player is not holding second noun:
say “You strike the wall with your hand, bruising your knuckles. That must feel silly.”;
continue the action.
The wall has a number called crumble. The crumble is 1. The things can be hit with the hammer.
The hammer is an object. The hammer is on the anvil. The bulk of the hammer is 15. Things can be hit with the hammer.
Check attacking the wall with:
if second noun is the hammer:
if crumble is 1:
say “There is a resounding crack. Some dust falls down and a couple small stones come loose.”;
now the crumble is 2;
if crumble is 2:
say “A few small cracks run across the wall.”;
now the crumble is 3;
if crumble is 3:
say “The wall seems to teeter slightly.”;
now the crumble is 4;
if crumble is 4:
say “The wall shakes for a moment, and then falls apart. Rocks of all sizes fall to the ground, and the wall completely collapses, revealing the room behind the door!”;
now the crumble is 5;
now the wall is broken;
if crumble is 5:
say “You’ve already knocked the wall down; must you add insult to injury?”;
otherwise:
say “You strike the wall, but to no avail.”.
The anvil is an object. The anvil is in the smithy.
Check taking anvil:
say “You’ve discovered a ruined city, and now you want to lug an anvil around all day? I mean really now, that’s weird.”
The anvil is a supporter.
[The Backroom]
The backroom is a room. The printed name is “The Backroom”. The broken stone wall is scenery in the backroom. The description is “The remains of the stone wall lies here.”
The sword is an object. The sword is in the backroom. The description is “Though now showing flecks of rust, it is still a masterpiece.” The damage-value of the sword is 34. The backroom is south of the smithy.
This seems to me like a bit of a complicated problem, but maybe it’s not. Feedback would be greatly appreciated.
Thanks,
–Kadric