Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overlay 'crime': show all armed citizens. overlay 'enemy': show all a… #1193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions src/widget/city_overlay_risks.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ static int show_building_none(const building *b)
return 0;
}

static int show_building_enemy(const building *b)
{
return b->type == BUILDING_PREFECTURE
|| b->type == BUILDING_WATCHTOWER || b->type == BUILDING_TOWER
|| b->type == BUILDING_FORT || b->type == BUILDING_FORT_GROUND
|| b->type == BUILDING_GATEHOUSE || b->type == BUILDING_PALISADE_GATE || b->type == BUILDING_PALISADE
|| b->type == BUILDING_WALL; // The wall is not displayed! Why?
}

static int show_figure_fire(const figure *f)
{
return f->type == FIGURE_PREFECT;
Expand All @@ -113,9 +122,9 @@ static int show_figure_damage(const figure *f)

static int show_figure_crime(const figure *f)
{
return f->type == FIGURE_PREFECT ||
f->type == FIGURE_CRIMINAL || f->type == FIGURE_RIOTER || f->type == FIGURE_PROTESTER
|| f->type == FIGURE_CRIMINAL_LOOTER || f->type == FIGURE_CRIMINAL_ROBBER;
const figure_properties *props = figure_properties_for_type(f->type);
return props->category == FIGURE_CATEGORY_ARMED || props->category == FIGURE_CATEGORY_CRIMINAL
|| f->type == FIGURE_ARROW || f->type == FIGURE_JAVELIN || f->type == FIGURE_BOLT;
}

static int show_figure_problems(const figure *f)
Expand All @@ -139,7 +148,12 @@ static int show_figure_native(const figure *f)
static int show_figure_enemy(const figure *f)
{
const figure_properties *props = figure_properties_for_type(f->type);
return props->category == FIGURE_CATEGORY_HOSTILE || props->category == FIGURE_CATEGORY_NATIVE || props->category == FIGURE_CATEGORY_AGGRESSIVE_ANIMAL;
return props->category == FIGURE_CATEGORY_HOSTILE || props->category == FIGURE_CATEGORY_NATIVE
|| props->category == FIGURE_CATEGORY_AGGRESSIVE_ANIMAL
|| props->category == FIGURE_CATEGORY_ARMED
|| f->type == FIGURE_BALLISTA
|| f->type == FIGURE_ARROW || f->type == FIGURE_JAVELIN || f->type == FIGURE_BOLT
|| f->type == FIGURE_CATAPULT_MISSILE;
}

static int get_column_height_fire(const building *b)
Expand Down Expand Up @@ -458,7 +472,8 @@ const city_overlay *city_overlay_for_enemy(void)
static city_overlay overlay = {
OVERLAY_ENEMY,
COLUMN_COLOR_RED,
show_building_none,
//show_building_none,
show_building_enemy,
show_figure_enemy,
get_column_height_none,
0,
Expand Down
Loading