Basic money (no denominations or change) that can be found, earned, traded?

This is actually pretty tricky. I7 doesn’t like to deal with massive quantities of identical objects, letting you create no more than 100 in one assertion to remind you of that. But once they’re not identical, you no longer get a lot of benefits the parser normally gives you for free in terms of specifying number.

This is a study toward an approach I think might work, but it’s massively incomplete and would need to be extended to cover every case of the places where one can gain or lose items. The strategy is that there are 100 identical simoleons (a kind of thing whose printed name says shiny rocks) but any given object can only ever hold zero or one simoleons. The simoleon has a quantity property, and adding additional just increments that. Reducing it to zero recycles the simoleon by marking it unused and sending it to nowhere. And then there are some kludgy hacks to drop and take let you specify numbers of shiny rocks with them.

lab is a room.

simoleon is a kind of thing.
a simoleon has a number called the quantity.
the quantity of a simoleon is usually 0.
A simoleon can be used or unused.
A simoleon is usually unused.
A simoleon is usually proper-named.
There are 100 unused simoleons.
Understand "shiny/rock/rocks" as a simoleon.

for printing the name of a simoleon (called cash):
  say "[quantity of cash] shiny rock[if quantity of cash > 1]s[end if]"

To bestow (n - a number) nugget/nuggets on/upon (o - an object):
  let stash be a random unused simoleon;
  if o holds a simoleon (called cash-held), now stash is the cash-held;
  if stash is not nothing begin;
    if stash is unused, now stash is used;
    now the quantity of stash is the quantity of stash + n;
    if o is a room, move stash to o;
    if o is a person, now o carries stash;
    if o is a container, now o contains stash;
    if o is a supporter, now o supports stash;
    else do nothing;
  else;
      say "** Out of nuggets.";
  end if;

To diminish (nugget - a simoleon) by (n - a number):
if the quantity of nugget >= n begin;
      now the quantity of nugget is the quantity of nugget - n;
      if the quantity of nugget is 0 begin;
        now nugget is unused;
        now nugget is nowhere;
      end if;
   else;
     say "** Nugget only has [quantity of nugget] simoleons, needs [n].";
   end if;

To withdraw (n - a number) nugget/nuggets from (o - an object):
  if o holds a simoleon (called cash-held), diminish cash-held by n;
  else say "** [o] has no nuggets, needs [n].";

[ earning and spending are just debugging actions to create and destroy money ]
earning is an action applying to one number.
understand "earn [number]" as earning.
carry out earning: bestow the number understood nuggets upon the player;

spending is an action applying to one number.
understand "spend [number]" as spending.
carry out spending: withdraw the number understood nuggets from the player;

rock-dropping is an action applying to one number and one carried thing.
Understand "drop [number] [simoleon]" as rock-dropping.
check an actor rock-dropping:
  let n be the number understood;
  if the actor holds a simoleon (called cash) begin;
    if the quantity of cash < n begin;
      if the action is not silent and the actor is the player begin;
         say "[We] [don't] have that much.";
      else;
         say "[Actor] [can't] do that.";
      end if;
    else;
      withdraw n nuggets from the actor;
      bestow n nuggets on the holder of the actor;
    end if;
   else;
    say "[We] [don't] have any.";
   end if;

rocks-taken is initially 0.
rock-taking is an action applying to one number and one thing.
Understand "take [number] [simoleon]" as rock-taking.
before an actor rock-taking: now rocks-taken is the number understood; 
instead try the actor taking the second noun;

Last check an actor taking simoleon (called stash):
let n be the number understood;
if n > the quantity of stash, instead say "[There] [regarding stash][aren't] that many.".

Carry out an actor taking simoleon (called stash):
  bestow rocks-taken nuggets on the actor;
2 Likes