IsaacPang/MarketRoyale

Player Goals

Closed this issue · 1 comments

Player goal management

Players are initiated with a predetermined goal:

type: dict
structure: { product_name: lower_limit }

Keeping track of the goal

This must be done in tandem with player inventory management (#4).
Goal is achieved when the inventory of the goal product reaches the limit required.
This means that a minimum bound check is required within the inventory check prior to selling, so that the player does not sell and lose the goal.
BONUS:
IF:

  1. The player finds a market that sells high
  2. The player has information on nearby markets that can turn a profit on inventory, despite already achieving the goal
  3. The player SHOULD sell all inventory to purchase at lower price. The risk is market information only contains price and product name, so the goal may not be achieved.

There are a few options here

  1. The goal is simply tracked as a container with a minimum counter requirement.
  2. The player is conceptualised as a state machine, and enters the "achieved" state when the goal is achieved. (this is preferable)

BONUS STATE

Achieving the goal

The player should "know" when the goal is achieved, and move onto a state where the player just becomes a businessman, maximising gold until the end of the turn.

goal achieved state implemented and used for advanced optimisations, refer #28