fixed: enemies may spawn on top of dragons

added prompting to picking up gold
This commit is contained in:
2024-07-15 19:47:07 -04:00
parent 9e0c6bc723
commit 70e80c1474
5 changed files with 41 additions and 11 deletions

View File

@ -86,7 +86,7 @@ long_result enemy_base::get_hit(character *ch, const int tATK,
return {miss, "PC tried to hit " + abbrev + " but missed. "};
}
void enemy_base::dies(level *lvl, character *pc) {
int enemy_base::dies(level *lvl) {
auto &elist = lvl->get_elist();
for (size_t i = 0; i < elist.size(); ++i)
@ -96,17 +96,19 @@ void enemy_base::dies(level *lvl, character *pc) {
}
if (race == race::rdragon) {
return;
return 0;
} else if (race == race::rmerchant) {
lvl->add_gold({GOLD_MERCHANT, pos});
return 0;
} else if (race == race::rhuman) {
lvl->add_gold({GOLD_NORMAL, pos});
auto plist = lvl->get_available_around_all(pos);
lvl->add_gold({GOLD_NORMAL,
rng->get_rand_in_vector(plist)});
return 0;
}
((player_base *)pc)->add_gold(rand_gold_drop(rng));
return rand_gold_drop(rng);
}
enemy_base *get_enemy_at(const position &pos, const enemy_list &elist) {