1
0

_buy_single_item 538 B

123456789101112131415
  1. # $buy_single_item
  2. !! This buys an item and sets the value of the underlying variable to the specific value
  3. !! For example, buying a plasma tv sets tv = 2
  4. !! ARGS 0 is the value to set the variable to
  5. !! ARGS 1 is the item description
  6. !! ARGS 2 is the price
  7. !! ARGS 3 is the variable name for the item
  8. !! ARGS 4 is the location to go back to
  9. dynamic "set <<$ARGS[3]>> = <<ARGS[0]>>"
  10. set money -= ARGS[2]
  11. gt $ARGS[4], '<font color="green">You bought a <b><<$ARGS[1]>></b>.</font>'
  12. --- $buy_single_item ---------------------------------