Allow towns to not die no matter how many monsters are killed
This commit is contained in:
@@ -110,7 +110,7 @@ public:
|
||||
std::vector<cTimer> party_event_timers;
|
||||
std::set<int> spec_items;
|
||||
std::set<int> help_received;
|
||||
short m_killed[200]; // monsters killed per town, I think
|
||||
long m_killed[200]; // monsters killed per town
|
||||
long long total_m_killed, total_dam_done, total_xp_gained, total_dam_taken;
|
||||
std::string scen_name;
|
||||
private:
|
||||
|
||||
@@ -179,6 +179,11 @@ bool cTown::cWandering::isNull(){
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cTown::is_cleaned_out(long m_killed) {
|
||||
if(max_num_monst < 0) return false;
|
||||
return m_killed >= max_num_monst;
|
||||
}
|
||||
|
||||
void cTown::set_up_lights() {
|
||||
using namespace std::placeholders;
|
||||
short rad;
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
rectangle in_town_rect;
|
||||
std::vector<cItem> preset_items;
|
||||
std::vector<cTownperson> creatures;
|
||||
short max_num_monst;
|
||||
long max_num_monst;
|
||||
std::vector<cField> preset_fields;
|
||||
short spec_on_entry,spec_on_entry_if_dead;
|
||||
short spec_on_hostile;
|
||||
@@ -104,6 +104,7 @@ public:
|
||||
void init_start();
|
||||
void set_up_lights();
|
||||
short light_obscurity(short x,short y); // Obscurity function used for calculating lighting
|
||||
bool is_cleaned_out(long m_killed);
|
||||
|
||||
explicit cTown(cScenario& scenario);
|
||||
void append(legacy::town_record_type& old);
|
||||
|
||||
Reference in New Issue
Block a user