various: consolidate game state into a GameState struct

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9d8998707c02e64cf177a6eeb51e399e6a6a6964
This commit is contained in:
raf 2026-04-03 14:00:38 +03:00
commit 786fce3814
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
13 changed files with 105 additions and 102 deletions

View file

@ -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;