Skip to content

Commit

Permalink
fix evolve texts
Browse files Browse the repository at this point in the history
  • Loading branch information
dvincent56 committed Feb 10, 2024
1 parent 22b21f3 commit 622be8d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
25 changes: 15 additions & 10 deletions src/building/house_evolution.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,20 +619,20 @@ void building_house_determine_evolve_text(building *house, int worst_desirabilit
if (!house->has_well_access) {
house->data.house.evolve_text_id = 1;
return;
} else {
house->data.house.evolve_text_id = 67;
} else if (!house->has_latrines_access) {
house->data.house.evolve_text_id = 67;
return;
}
}

if (water == 2 && !house->has_water_access) {
if (!house->has_well_access && !house->has_latrines_access) {
house->data.house.evolve_text_id = 2;
return;
} else if (house->has_well_access && !house->has_latrines_access) {
if (!house->has_latrines_access) {
house->data.house.evolve_text_id = 67;
return;
}
} else if (level >= HOUSE_LARGE_CASA) {
house->data.house.evolve_text_id = 2;
return;
}
}

// entertainment
Expand Down Expand Up @@ -775,9 +775,14 @@ void building_house_determine_evolve_text(building *house, int worst_desirabilit
model = model_get_house(++level);
// water
water = model->water;
if (water == 1 && !house->has_water_access && !house->has_well_access) {
house->data.house.evolve_text_id = 31;
return;
if (water == 1 && !house->has_water_access) {
if (!house->has_well_access) {
house->data.house.evolve_text_id = 31;
return;
} else if (!house->has_latrines_access) {
house->data.house.evolve_text_id = 67;
return;
}
}

if (water == 2 && !house->has_water_access) {
Expand Down
7 changes: 6 additions & 1 deletion src/widget/city_building_ghost.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ void city_building_ghost_draw_fountain_range(int x, int y, int grid_offset)
image_draw(image_group(GROUP_TERRAIN_FLAT_TILE), x, y, COLOR_MASK_BLUE, data.scale);
}

void city_building_ghost_draw_latrines_range(int x, int y, int grid_offset)
{
image_draw(image_group(GROUP_TERRAIN_FLAT_TILE), x, y, COLOR_MASK_DARK_GREEN & ALPHA_FONT_SEMI_TRANSPARENT, data.scale);
}

static void image_draw_warehouse(int image_id, int x, int y, color_t color)
{
int image_id_space = image_group(GROUP_BUILDING_WAREHOUSE_STORAGE_EMPTY);
Expand Down Expand Up @@ -752,7 +757,7 @@ static void draw_latrines(const map_tile *tile, int x, int y)
break;
}

city_view_foreach_tile_in_range(tile->grid_offset, 1, map_water_supply_latrines_radius(), city_building_ghost_draw_well_range);
city_view_foreach_tile_in_range(tile->grid_offset, 1, map_water_supply_latrines_radius(), city_building_ghost_draw_latrines_range);

draw_building(image_id, x, y, color_mask);
draw_building_tiles(x, y, 1, &blocked);
Expand Down
1 change: 1 addition & 0 deletions src/widget/city_building_ghost.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

void city_building_ghost_draw_well_range(int x, int y, int grid_offset);
void city_building_ghost_draw_fountain_range(int x, int y, int grid_offset);
void city_building_ghost_draw_latrines_range(int x, int y, int grid_offset);
int city_building_ghost_mark_deleting(const map_tile *tile);
void city_building_ghost_draw(const map_tile *tile);

Expand Down

0 comments on commit 622be8d

Please sign in to comment.