added item base class for gold and potions

This commit is contained in:
2024-07-18 12:54:41 -04:00
parent 8704fdb7aa
commit dfea74ed42
9 changed files with 51 additions and 65 deletions

View File

@ -90,13 +90,12 @@ int enemy_base::dies(level *lvl) {
if (race == race::rdragon) {
return 0;
} else if (race == race::rmerchant) {
lvl->add_gold({GOLD_MERCHANT, pos});
lvl->add_gold(gold{pos, GOLD_MERCHANT});
return 0;
} else if (race == race::rhuman) {
lvl->add_gold({GOLD_NORMAL, pos});
lvl->add_gold(gold{pos, GOLD_NORMAL});
auto plist = lvl->get_available_around_all(pos);
lvl->add_gold({GOLD_NORMAL,
rng->get_rand_in_vector(plist)});
lvl->add_gold(gold{rng->get_rand_in_vector(plist), GOLD_NORMAL});
return 0;
}