Re: Multiple Coins Types

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 05/30/98


On Sat, 30 May 1998, Chuck Carson wrote:

->when a player goes into a shop and buys something, do you start from
->the copper and work into higher coin types, thus keeping the players
->coins as close to the same as possible or recalculate his coin total
->filling gold first and the on down.

Calculate the amount of copper for the item and for the player.
Subtract, and then take away gold, silver, or copper depending upon
if they have enough and the amount of money spent justifies it.

->For example, Bob goins into a shop with 5050 copper pieces (100 copper
->= 10 silver = 1 gold) and buys an item that costs 50 copper. Do you
->reflect his new coin amounts as 50 gold, 0 silver, 0 copper or leave
->it as 5000 copper?

If Bob walked into the shop with 50 gold and 50 copper, and spent 50
copper, he should walk out with 50 gold.  If Bob walked into the shop
with 500 silver, and 50 copper he should walk out with 500 silver.  If
Bob walked into the shop with 5050 copper, he should walk out with
5000 copper.  If Bob walked into the shop with 5000 copper (and no
other coins) and tried to do, "buy sword 1g," he would be scoffed at;
he doesn't have one gold coin.  If he just typed, "buy sword," then
the game should automatically determine how to spend his money --
probably putting more weight on getting rid of coinage that he has a
lot of (e.g., if he has 5000 copper and 2 gold, spend the copper,
since it's causing the most encumberance; if he has 1000 copper and
2000 silver, spend the silver, since there's more of them).

In other words: the spending of money should not cause its automatic
conversion.  If you have 50 gold and 50 copper (worth 5050 coppers),
you want to subtract the cost from the pool and then split the cost
into gold/silver/copper and subtract the appropriate numbers of gold,
silver, and copper coins.  Any other way is kind of silly (you have 2
gold and 9 silver, someone gives you a single silver coin, and you
suddenly have 3 gold rather than 2 gold and 10 silver?).

->Maybe I am looking at this whole thing from the wrong angle. Another
->thought I had is to not really have 3 coin types, but have one pool
->of copper and make it seem like the player has three coin types.

This won't work -- if you are going to keep with the idea I presented
above (which I think you want to) you're pretty much required to keep
tabs of each coin type seperately.  But just passing a generic coin
value through a function to "tokenize" it is the easiest way to
represent coinage -- unfortunately, it doesn't work when you don't
want automatic conversion.

-dak


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST