when checking if outdoor enemies are alive, count types
This commit is contained in:
@@ -4661,7 +4661,10 @@ bool hit_end_c_button() {
|
|||||||
bool end_ok = true;
|
bool end_ok = true;
|
||||||
|
|
||||||
if(which_combat_type == 0) {
|
if(which_combat_type == 0) {
|
||||||
end_ok = out_monst_all_dead();
|
auto out_monst_remaining = out_monst_alive();
|
||||||
|
if(!out_monst_remaining.empty()){
|
||||||
|
end_ok = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for(cPlayer& pc : univ.party) {
|
for(cPlayer& pc : univ.party) {
|
||||||
if(pc.status[eStatus::FORCECAGE] > 0) {
|
if(pc.status[eStatus::FORCECAGE] > 0) {
|
||||||
@@ -4675,14 +4678,23 @@ bool hit_end_c_button() {
|
|||||||
return end_ok;
|
return end_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool out_monst_all_dead() {
|
std::map<std::string,short> out_monst_alive() {
|
||||||
for(short i = 0; i < univ.town.monst.size(); i++)
|
std::map<std::string,short> monst_alive;
|
||||||
if(univ.town.monst[i].is_alive() && !univ.town.monst[i].is_friendly()) {
|
for(short i = 0; i < univ.town.monst.size(); i++){
|
||||||
|
cCreature& m = univ.town.monst[i];
|
||||||
|
if(m.is_alive() && !m.is_friendly()) {
|
||||||
|
if(monst_alive.find(m.m_name) != monst_alive.end()){
|
||||||
|
// Would += work in this context?
|
||||||
|
monst_alive[m.m_name] = monst_alive[m.m_name] + 1;
|
||||||
|
}else{
|
||||||
|
monst_alive[m.m_name] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
//print_nums(5555,i,univ.town.monst[i].number);
|
//print_nums(5555,i,univ.town.monst[i].number);
|
||||||
//print_nums(5555,univ.town.monst[i].m_loc.x,univ.town.monst[i].m_loc.y);
|
//print_nums(5555,univ.town.monst[i].m_loc.x,univ.town.monst[i].m_loc.y);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
}
|
||||||
|
return monst_alive;
|
||||||
}
|
}
|
||||||
|
|
||||||
void end_combat() {
|
void end_combat() {
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#ifndef BOE_GAME_COMBAT_H
|
#ifndef BOE_GAME_COMBAT_H
|
||||||
#define BOE_GAME_COMBAT_H
|
#define BOE_GAME_COMBAT_H
|
||||||
|
|
||||||
|
#include <map>
|
||||||
#include "location.hpp"
|
#include "location.hpp"
|
||||||
#include "scenario/monster.hpp"
|
#include "scenario/monster.hpp"
|
||||||
#include "scenario/outdoors.hpp"
|
#include "scenario/outdoors.hpp"
|
||||||
@@ -49,7 +50,7 @@ void do_poison();
|
|||||||
void handle_disease();
|
void handle_disease();
|
||||||
void handle_acid();
|
void handle_acid();
|
||||||
bool hit_end_c_button();
|
bool hit_end_c_button();
|
||||||
bool out_monst_all_dead();
|
std::map<std::string,short> out_monst_alive();
|
||||||
void end_combat();
|
void end_combat();
|
||||||
bool combat_cast_mage_spell();
|
bool combat_cast_mage_spell();
|
||||||
bool combat_cast_priest_spell();
|
bool combat_cast_priest_spell();
|
||||||
|
Reference in New Issue
Block a user