Pockets and inventory

Maybe something like

Use the serial comma.
The player is wearing the jacket.
The pocket is an open container. The pocket is part of the jacket.
There is lint in the pocket. There is a receipt in the pocket. There is a pen in the pocket.

Rule for printing inventory details of the jacket:
  say " (the pocket ";
  if the first thing held by the pocket is nothing begin;
    say "is empty";
  else;
    say "contains ";
    list the contents of the pocket, as a sentence, giving brief inventory information, tersely, not listing concealed items;
  end if;
  say ")";

test me with "i / get receipt / i / get pen / i / get lint / i".

which produces:


 
>test me
(Testing.)
 
>[1] i
You are carrying:
  a jacket (the pocket contains lint, a receipt, and a pen)
 
>[2] get receipt
Taken.
 
>[3] i
You are carrying:
  a receipt
  a jacket (the pocket contains lint and a pen)
 
>[4] get pen
Taken.
 
>[5] i
You are carrying:
  a pen
  a receipt
  a jacket (the pocket contains lint)
 
>[6] get lint
Taken.
 
>[7] i
You are carrying:
  lint
  a pen
  a receipt
  a jacket (the pocket is empty)
2 Likes