nskins / goby

Command-line role-playing game framework
MIT License
122 stars 56 forks source link

Monsters drop treasures #58

Closed nskins closed 7 years ago

nskins commented 7 years ago

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.