Apologies if I’m asking about something that has been thoroughly covered elsewhere. For what I’m trying to achieve with money, the examples I’ve found are either too simple (there is one coin which can be traded for one item) or too complex (dollars and cents, making change, etc.). The one example I’ve found that gets close to my needs doesn’t work for me for some reason (I’ll get to this at the bottom).
I want my game to have a currency called “shiny rocks” which can be given, received, found lying around, dropped, and retrieved after having been dropped. There are no denominations or change. Just trading rocks.
I’ve already made a game where the player trades an item as a bribe, but there was only one of that item in the game world. I’m not sure how to implement multiples of an item that can be found or traded in quantities.
I want to be able to leave shiny rocks lying around in different places for the player to pick up. “Oh, look! I found another shiny rock on the ground!”
I want the player to be able to receive a sum of shiny rocks as payment for a job, or to pay a sum of shiny rocks in exchange for goods/services/information. “Give me 500 shiny rocks and I’ll tell you a secret!”
I want a total of shiny rocks to show up in the player’s inventory.
This is the closest example I’ve found to what I’m trying to accomplish, but I’m not sure it covers all my bases, and anyway I gets some PROBLEMS when I try to test it.
[MONEY]
cash is a number that varies. cash is 0.
shiny rocks is a thing. The printed name is "[if cash is 1]a[otherwise]some[end if] shiny rock[if cash is greater than 1]s[end if]".
The description of shiny rocks is "Small rocks, polished to a shine. You have [cash in words] of them."
Understand "rocks" or "stones" or "money" or "cash" as shiny rocks.
When play begins:
if cash is greater than 0:
now the player holds shiny rocks.
Every turn when cash is greater than 0:
now the player holds shiny rocks.
Every turn when cash <= 0:
remove shiny rocks from play.
moneypile is a number that varies.
Some discarded rocks is a thing. The description is "You see [moneypile in words] shiny rock[if moneypile is greater than 1]s[end if] here."
Understand "rock" or "stone" or "money" or "cash" or "shiny rocks" as discarded rocks.
Instead of dropping shiny rocks:
say "You drop your shiny rocks.";
change moneypile to 0 + cash;
change cash to 0;
move discarded rocks to the location.
Instead of taking discarded rocks:
say "You take the shiny rocks.";
remove discarded rocks from play;
increase cash by moneypile;
if shiny rocks is off-stage:
now player carries shiny rocks.
Yields:
Problem. You wrote 'change moneypile to 0 + cash' : but this is a phrase which I don't recognise, possibly because it is one you meant to define but never got round to, or because the wording is wrong (see the Phrasebook section of the Index to check). Alternatively, it may be that the text immediately previous to this was a definition whose ending, normally a full stop, is missing?
--------------------------------------------------------------------------------
Problem. You wrote 'change cash to 0' : again, this is a phrase which I don't recognise.
Can anyone steer me in the right direction?