Coin Handling Proposal

From PCGen Wiki
Jump to: navigation, search

PCGen currently handles available funds and coins separately. The user has to manually purchase coins if she wishes to have those reflected on the character sheet. Those coins have to be sold again if the player wants to spend the money.

This proposal outlines a method by which PCGen would automatically create coins to reflect any available funds and manage the coins in a useful manner.

Use cases

UC1. Add a certain amount of wealth to a character.

  1. Enter total amount as a decimal e.g. 23.31
  2. Split amount into coins e.g. 4pp 3gp 3sp 1cp
  3. Add to coins held in current coin location e.g. Not Carried

UC2. Purchase item of equipment

  1. Purchase item e.g. Lantern (Bullseye) for 12gp
  2. Read coins in coin container e.g Not Carried, 4pp 3gp 3sp 1cp
  3. Calculate minimum number of coins to remove e.g. 2pp 2gp
  4. Remove from coins in coin container e.g. 2pp 1gp 3sp 1cp
  5. If the money spent is more than is contained in the coin container, all coins in the coin container will be spent and then remainder will be deducted from next set of coins (return to step b). Location selected Not carried, then carried, then equipped, then in a location. Containers in a location will be utilized in equipped order.

UC3. Change default location for coins

  1. Select item in equipping tab e.g. belt pouch
  2. Right click and select “Make default coin container” option.
  3. Existing coins will stay in old location, but new coin manipulation will take place in the new location.

UC4. Redistribute coins in equipment set

  1. Purchase or sell coins as required. Purchase items rules would apply e.g. purchase 10gp would remove 1pp and add 10gp to the default location

UC5. Move coins to another location

  1. Use standard move item rules for moving part of the total coins to a new location e.g. Not Carried to Belt Pouch

UC6. Have more than one equipment set

  1. Each equipment set would have a default location.
  2. On purchase all sets would be updated as per UC2
  3. On creation of a new equip set all coins would be moved to the default coin container (Not carried)

Backing Rules

  • Coins are items of equipment specified by the type of Coin
  • A new tag will be required: ABB for equipment e.g. ABB:pp
  • The default coin container is “Not Carried”. This can be changed globally to “Carried” or “Equipped” through preferences.
  • The current coin container for an equipset can be changed by a right click on the item and selecting the “Make default coin container” option
  • The current coin container for a set will be labeled with [Coin container] in the equipping tree.
  • If the current coin container is unequipped, the default coin container will receive any coins held in that container

Methods Required

  • BigDecimal getTotalFunds()
  • spendFunds(BigDecimal gold)
  • addFunds(BigDecimal gold)
  • setCurrentCoinLoc(EquipSet set, EquipNode node)