took zocs away from level 0 units
This commit is contained in:
parent
a1214b626d
commit
af495ff5e5
5 changed files with 16 additions and 2 deletions
|
@ -316,7 +316,7 @@ bool enemy_zoc(const gamemap& map, const gamestatus& status,
|
|||
status.get_time_of_day().lawful_bonus,
|
||||
teams,current_team);
|
||||
if(it != units.end() && it->second.side() != side &&
|
||||
current_team.is_enemy(it->second.side()) && !it->second.stone()) {
|
||||
current_team.is_enemy(it->second.side()) && it->second.emits_zoc()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ double shortest_path_calculator::cost(const gamemap::location& loc, double so_fa
|
|||
adj[i],map_,
|
||||
status_.get_time_of_day().lawful_bonus,teams_,team_);
|
||||
|
||||
if(u != units_.end() && team_.is_enemy(u->second.side()) && !team_.fogged(adj[i].x,adj[i].y) && u->second.stone() == false) {
|
||||
if(u != units_.end() && team_.is_enemy(u->second.side()) && !team_.fogged(adj[i].x,adj[i].y) && u->second.emits_zoc()) {
|
||||
return 100000.0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -466,6 +466,11 @@ bool unit::incapacitated() const
|
|||
return stone();
|
||||
}
|
||||
|
||||
bool unit::emits_zoc() const
|
||||
{
|
||||
return type().has_zoc() && stone() == false;
|
||||
}
|
||||
|
||||
bool unit::matches_filter(const config& cfg) const
|
||||
{
|
||||
const std::string& description = cfg["description"];
|
||||
|
|
|
@ -89,6 +89,8 @@ public:
|
|||
|
||||
bool incapacitated() const;
|
||||
|
||||
bool emits_zoc() const;
|
||||
|
||||
bool matches_filter(const config& cfg) const;
|
||||
|
||||
void set_flag(const std::string& flag);
|
||||
|
|
|
@ -961,6 +961,11 @@ bool unit_type::can_advance() const
|
|||
return can_advance_;
|
||||
}
|
||||
|
||||
bool unit_type::has_zoc() const
|
||||
{
|
||||
return level() > 0;
|
||||
}
|
||||
|
||||
bool unit_type::has_ability(const std::string& ability) const
|
||||
{
|
||||
return std::find(abilities_.begin(),abilities_.end(),ability) != abilities_.end();
|
||||
|
|
|
@ -231,6 +231,8 @@ public:
|
|||
bool not_living() const;
|
||||
bool can_advance() const;
|
||||
|
||||
bool has_zoc() const;
|
||||
|
||||
bool has_ability(const std::string& ability) const;
|
||||
|
||||
const std::vector<config*>& possible_traits() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue