1. potions being walked over
2. spawning on stairs
3. enemies walking under players
4. merchants not being aggresive
5. potions losing effect when sending pass signal (cleared by player::start_turn())’
This commit is contained in:
2024-07-15 14:41:32 -04:00
parent e561d3bbf4
commit 295b808e14
8 changed files with 72 additions and 18 deletions

View File

@ -111,18 +111,31 @@ long_result player_base::interpret_command(level *lvl, game_command cmd) {
return {result::terminate, ""};
} else if (cmd >= move_north && cmd <= move_southwest) {
auto res = move(lvl, pos + MOVE[cmd - move_north]);
if (res.res == result::moved)
start_turn();
gold g = get_gold_at(pos, lvl->get_glist());
gold_cnt += g.amount;
return res;
} else if (cmd >= apply_north && cmd <= apply_southwest) {
return apply(get_potion_at(pos + MOVE[cmd - apply_north],
lvl->get_plist()));
auto res = apply(get_potion_at(pos + MOVE[cmd - apply_north],
lvl->get_plist()));
if (res.res == result::applied)
start_turn();
return res;
} else if (cmd == apply_panic) {
return {result::fine,
"PC tried to use in some non-existent direction. "};
} else if (cmd >= attack_north && cmd <= attack_southwest) {
enemy_base *tmp = get_enemy_at(pos + MOVE[cmd - attack_north],
lvl->get_elist());
if (tmp != nullptr)
start_turn();
auto res = attack((character *)tmp);
if (tmp != nullptr && tmp->is_dead())
@ -131,14 +144,18 @@ long_result player_base::interpret_command(level *lvl, game_command cmd) {
return res;
} else if (cmd == up_stairs) {
if (lvl->get_up_stairs() == pos &&
enabled_features & FEATURE_REVISIT)
enabled_features & FEATURE_REVISIT) {
start_turn();
return {go_up, "PC went up the stairs. "};
}
return {result::fine,
"PC tried to fly through the ceiling. "};
} else if (cmd == down_stairs) {
if (lvl->get_down_stairs() == pos)
if (lvl->get_down_stairs() == pos) {
start_turn();
return {go_down, "PC went down the stairs. "};
}
return {result::fine,
"PC tried to dig through the floor. "};