nskins / goby

Command-line role-playing game framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monsters drop treasures

nskins opened this issue · comments

After defeating a monster in battle, there should be a chance of receiving a treasure (Item).

Monsters should be endowed with some data structure that holds all possible treasure drops. In addition, each treasure should have some probability of actually being dropped. The first step is to randomly decide whether or not the user should obtain an Item. If not, proceed as before. If so, then sample the distribution of possible drops to determine the actual reward. Show some output about it and add it to the Player's inventory.