here is the ENTIRE code for my system
[code]A thing is either exchangeable or unexchangeable. A thing is either usually unexchangeable.
Everything has a number called price. The price of a thing is usually 0.
To say (N - number) in capitalised words:
let result be an indexed text;
now result is “[N in words]”;
say result in sentence case.
Plant count is a number that varies. Plant count is usually zero.
Planting is an action applying to one visible thing. Understand “Plant [things]” as planting.
Check planting:
unless the noun is a tomato seed, say “You can only plant a tomato seed.” instead.
Carry out planting:
move the noun to storage;
now a random tomato sapling in storage is in nursery;
increment plant count;
the tomato sprouts in five turns from now.
Report planting:
say “[The noun] has been planted successfully.”.
At the time when the tomato sprouts:
say “Wow! [plant count in capitalised words] of your tomato saplings [if plant count is greater than one]have[otherwise]has[end if] grown into [if plant count is less than two]a [end if]ripe, juicy, tomato fruit[s]! Go to the nursery to harvest your crop!”;
while plant count is greater than zero begin;
move a random tomato fruit in storage to the nursery;
move a random tomato sapling in the nursery to storage;
decrement plant count;
end while.
a tomato sapling is a kind of thing.
39 tomato saplings are in storage.
nursery is east of land.
“Welcome to your nursery! To get started planting your tomatoes, first, pick up your free seeds. Next say PLANT ‘number’ TOMATOES. Tomatoes take 20 minutes (20 turns) to grow, while you wait, you can check out some of our other wonderful attractions! When your’e done, you can go to the shop to the east, exchange your tomatoes for points and purchess some souveniers! Happy planting!”
Shop is east of Nursery.
“Welcome to ‘THE LAND’ store! If you have any tomato fruits you can exchange them for points! If you’d like to exchange your fruits for points, say, EXCHANGE ‘number’ TOMATO FRUITS. If you’d like to buy something, say BUY item.”
Check tomato exchange:
if the noun is unexchangeable, say “You can’t exchange [the noun]!” instead.
Carry out tomato exchange:
increase the score by the price of the noun;
move the noun to storage;
say “You have [score] points.”.
tomato exchange is an action applying to one visible thing.
Understand “exchange [things]” as tomato exchange.
A tomato fruit is a kind of thing.
A tomato fruit is exchangeable.
The price of a tomato fruit is 5.
a tomato seed is a kind of thing.
25 tomato seeds are in storage.
3 tomato seeds are in nursery.
a room can be suitable for planting. a room is usually not suitable for planting.
check planting (this is the can’t plant outside the nursery rule):
if the location of the player is not suitable for planting:
say “There’s no suitable soil in which to plant anything here.”;
stop the action;
the nursery is suitable for planting.
check planting (this is the can’t plant non-seeds rule):
if the noun is not a tomato seed:
say “You can’t plant that.”;
stop the action;
purchasing is an action applying to one visible thing.
Understand “Buy [things]” as Purchasing.
carry out purchasing:
decrease the score by the price of the noun;
now the player has the noun;
say “You have [score] points.”.
storage is a room.
[/code]