various: consolidate game state into a GameState struct
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9d8998707c02e64cf177a6eeb51e399e6a6a6964
This commit is contained in:
parent
d3798cc99f
commit
786fce3814
13 changed files with 105 additions and 102 deletions
|
|
@ -40,15 +40,15 @@ void item_spawn(Item items[], int *count, Map *map, int floor) {
|
|||
if (type_roll < 50) {
|
||||
// 50% chance for potion
|
||||
item.type = ITEM_POTION;
|
||||
item.power = 5 + rng_int(0, floor * 2); // healing: 5 + 0-2*floor
|
||||
item.power = 5 + rng_int(0, floor * 2); // healing: 5 + 0-2*floor
|
||||
} else if (type_roll < 80) {
|
||||
// 30% chance for weapon
|
||||
item.type = ITEM_WEAPON;
|
||||
item.power = 1 + rng_int(0, floor); // attack bonus: 1 + 0-floor
|
||||
item.power = 1 + rng_int(0, floor); // attack bonus: 1 + 0-floor
|
||||
} else {
|
||||
// 20% chance for armor
|
||||
item.type = ITEM_ARMOR;
|
||||
item.power = 1 + rng_int(0, floor / 2); // defense bonus
|
||||
item.power = 1 + rng_int(0, floor / 2); // defense bonus
|
||||
}
|
||||
|
||||
items[i] = item;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue