I’m having a rough time creating a mechanism for getting drunk. What am i doing wrong here? drinking a beer increments “drinks”, which is a value of DrinksDrunk. The idea is that when the player has had 6 drinks, a scene begins (he goes to the hospital). I would like the number of drinks to trigger other events as well (such as ‘falling off your bike’), but i’m getting a runtime error:
[i]>drink beer
mmm beer.
*** Run-time problem P59: You can’t implicitly repeat through the values of this kind: a problem arising from a description which started out here - “Passing out begins when The number of drinks is greater than 3”.[/i]
here’s the code in question:
Sodapop is a kind of thing.
beer is a kind of thing.
10 beers are in the Stairwell.
Understand “drink [something]” as drinking.
DrinksDrunk is a kind of thing. It has a number called drinks. The drinks of a DrinksDrunk is usually 0.
Things have a number called point value. The point value of a thing is usually 0.
Beer has a point value 1.
Sodapop has a point value 0.
Instead of drinking:
now the noun is nowhere;
if the point value of the noun is 0, say “[printed name] means nothing to you” instead;
if the point value of the noun is 1, say “mmm beer.” instead;
increment drinks;
Passing out is a scene.
Passing out begins when
The number of drinks is greater than 3.
when passing out begins:
say “Yay! You are super winner!”;
move player to Hospital.