Skip to content

Commit

Permalink
Add forum upgrade (#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvincent56 authored Apr 4, 2024
1 parent aee5768 commit 973e01a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/building/figure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,11 +1288,23 @@ static void set_senate_graphic(building *b)
map_building_tiles_add(b->id, b->x, b->y, b->size, building_image_get(b), TERRAIN_BUILDING);
}

static void set_forum_graphic(building *b)
{
if (b->state != BUILDING_STATE_IN_USE) {
return;
}
b->upgrade_level = b->desirability > 30;
map_building_tiles_add(b->id, b->x, b->y, b->size, building_image_get(b), TERRAIN_BUILDING);
}

static void spawn_figure_senate_forum(building *b)
{
if (b->type == BUILDING_SENATE) {
set_senate_graphic(b);
}
if (b->type == BUILDING_FORUM) {
set_forum_graphic(b);
}
check_labor_problem(b);
if (has_figure_of_type(b, FIGURE_TAX_COLLECTOR)) {
return;
Expand Down
5 changes: 5 additions & 0 deletions src/building/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ int building_image_get(const building *b)
case BUILDING_ENGINEERS_POST:
return image_group(GROUP_BUILDING_ENGINEERS_POST);
case BUILDING_FORUM:
if (!b->upgrade_level) {
return image_group(GROUP_BUILDING_FORUM);
} else {
return assets_get_image_id("Admin_Logistics", "Upgraded_Forum");
}
return image_group(GROUP_BUILDING_FORUM);
case BUILDING_FOUNTAIN:
if (b->upgrade_level == 3) {
Expand Down

0 comments on commit 973e01a

Please sign in to comment.