Skip to content
18 changes: 17 additions & 1 deletion src/building/building.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,22 @@ int building_is_venus_temple(building_type type)
return (type == BUILDING_SMALL_TEMPLE_VENUS || type == BUILDING_LARGE_TEMPLE_VENUS);
}

int building_is_temple(building_type type)
{
return building_is_ceres_temple(type) || building_is_neptune_temple(type) ||
building_is_mercury_temple(type) || building_is_mars_temple(type) ||
building_is_venus_temple(type) ||
type == BUILDING_GRAND_TEMPLE_CERES || type == BUILDING_GRAND_TEMPLE_NEPTUNE || type == BUILDING_PANTHEON ||
type == BUILDING_GRAND_TEMPLE_MERCURY || type == BUILDING_GRAND_TEMPLE_MARS ||
type == BUILDING_GRAND_TEMPLE_VENUS || type == BUILDING_GRAND_TEMPLE_VENUS_REWORKED ||
type == BUILDING_GRAND_TEMPLE_CERES_REWORKED || type == BUILDING_GRAND_TEMPLE_NEPTUNE_REWORKED ||
type == BUILDING_GRAND_TEMPLE_MERCURY_REWORKED || type == BUILDING_GRAND_TEMPLE_MARS_REWORKED ||
type == BUILDING_PANTHEON_REWORKED ||
type == BUILDING_ORACLE || type == BUILDING_LARARIUM || type == BUILDING_NYMPHAEUM ||
type == BUILDING_SHRINE_CERES || type == BUILDING_SHRINE_NEPTUNE || type == BUILDING_SHRINE_MERCURY ||
type == BUILDING_SHRINE_MARS || type == BUILDING_SHRINE_VENUS;
}

// All buildings capable of collecting and storing goods as a market
int building_has_supplier_inventory(building_type type)
{
Expand Down Expand Up @@ -921,7 +937,7 @@ int building_get_levy(const building *b)


// Pantheon base bonus
if (building_monument_working(BUILDING_PANTHEON) &&
if ((building_monument_working(BUILDING_PANTHEON) || building_monument_working(BUILDING_PANTHEON_REWORKED)) &&
((b->type >= BUILDING_SMALL_TEMPLE_CERES && b->type <= BUILDING_LARGE_TEMPLE_VENUS) ||
(b->type >= BUILDING_GRAND_TEMPLE_CERES && b->type <= BUILDING_GRAND_TEMPLE_VENUS) ||
b->type == BUILDING_ORACLE || b->type == BUILDING_NYMPHAEUM || b->type == BUILDING_SMALL_MAUSOLEUM ||
Expand Down
2 changes: 2 additions & 0 deletions src/building/building.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ int building_is_mars_temple(building_type type);

int building_is_venus_temple(building_type type);

int building_is_temple(building_type type);

int building_has_supplier_inventory(building_type type);

int building_is_house_group(house_groups group, building_type type);
Expand Down
3 changes: 0 additions & 3 deletions src/building/construction.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,6 @@ static int should_mark_for_construction(building_type type)
return 0;
} else if (building_monument_get_id(type)) {
return 0;
} else if (building_monument_is_grand_temple(type) &&
building_monument_count_grand_temples() >= config_get(CONFIG_GP_CH_MAX_GRAND_TEMPLES)) {
return 0;
} else if (type == BUILDING_AQUEDUCT) {
return 0;
}
Expand Down
13 changes: 7 additions & 6 deletions src/building/construction_building.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,16 @@ static void add_to_map(int type, building *b, int size, int orientation, int wat
case BUILDING_GRAND_TEMPLE_MERCURY:
case BUILDING_GRAND_TEMPLE_MARS:
case BUILDING_GRAND_TEMPLE_VENUS:
case BUILDING_GRAND_TEMPLE_VENUS_REWORKED:
case BUILDING_GRAND_TEMPLE_CERES_REWORKED:
case BUILDING_GRAND_TEMPLE_NEPTUNE_REWORKED:
case BUILDING_GRAND_TEMPLE_MERCURY_REWORKED:
case BUILDING_GRAND_TEMPLE_MARS_REWORKED:
case BUILDING_PANTHEON:
case BUILDING_PANTHEON_REWORKED:
map_tiles_update_area_roads(b->x, b->y, 9);
building_monument_set_phase(b, MONUMENT_START);
if (type == BUILDING_GRAND_TEMPLE_MARS) {
if (type == BUILDING_GRAND_TEMPLE_MARS || type == BUILDING_GRAND_TEMPLE_MARS_REWORKED) {
b->accepted_goods[RESOURCE_WEAPONS] = 1;
b->accepted_goods[RESOURCE_NONE] = 1;
}
Expand Down Expand Up @@ -574,11 +580,6 @@ int building_construction_place_building(building_type type, int x, int y, int e
return 0;
}

if (building_monument_is_grand_temple(type) &&
building_monument_count_grand_temples() >= config_get(CONFIG_GP_CH_MAX_GRAND_TEMPLES)) {
city_warning_show(WARNING_MAX_GRAND_TEMPLES, NEW_WARNING_SLOT);
return 0;
}
if (type == BUILDING_COLOSSEUM) {
if (building_count_total(BUILDING_COLOSSEUM)) {
city_warning_show(WARNING_ONE_BUILDING_OF_TYPE, NEW_WARNING_SLOT);
Expand Down
4 changes: 3 additions & 1 deletion src/building/count.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ static const building_type building_set_large_temples[] = {

static const building_type building_set_grand_temples[] = {
BUILDING_GRAND_TEMPLE_CERES, BUILDING_GRAND_TEMPLE_NEPTUNE, BUILDING_GRAND_TEMPLE_MERCURY, BUILDING_GRAND_TEMPLE_MARS,
BUILDING_GRAND_TEMPLE_VENUS, BUILDING_PANTHEON
BUILDING_GRAND_TEMPLE_VENUS, BUILDING_PANTHEON,
BUILDING_GRAND_TEMPLE_CERES_REWORKED, BUILDING_GRAND_TEMPLE_NEPTUNE_REWORKED, BUILDING_GRAND_TEMPLE_MERCURY_REWORKED,
BUILDING_GRAND_TEMPLE_MARS_REWORKED, BUILDING_GRAND_TEMPLE_VENUS_REWORKED, BUILDING_PANTHEON_REWORKED
};

#define BUILDING_SET_SIZE_GRAND_TEMPLES (sizeof(building_set_grand_temples) / sizeof(building_type))
Expand Down
36 changes: 34 additions & 2 deletions src/building/figure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,11 +1336,26 @@ static void spawn_figure_senate_forum(building *b)
set_forum_graphic(b);
}
check_labor_problem(b);

map_point road;
int has_road = map_has_road_access(b->x, b->y, b->size, &road);

// Module 1: Senate sends a roaming Pantheon priest (tracked in figure_id2)
if (b->type == BUILDING_SENATE && has_road &&
building_monument_gt_module_is_active(PANTHEON_MODULE_3_SENATE)) {
if (!b->figure_id2 || figure_get(b->figure_id2)->state == FIGURE_STATE_DEAD) {
figure *priest = figure_create(FIGURE_PRIEST, road.x, road.y, DIR_0_TOP);
priest->action_state = FIGURE_ACTION_125_ROAMING;
priest->building_id = b->id;
b->figure_id2 = priest->id;
figure_movement_init_roaming(priest);
}
}

if (has_figure_of_type(b, FIGURE_TAX_COLLECTOR)) {
return;
}
map_point road;
if (map_has_road_access(b->x, b->y, b->size, &road)) {
if (has_road) {
spawn_labor_seeker(b, road.x, road.y, 50);
int pct_workers = worker_percentage(b);
int spawn_delay;
Expand Down Expand Up @@ -1612,6 +1627,17 @@ static void spawn_figure_barracks(building *b)
spawn_delay += city_data.mess_hall.food_stress_cumulative - 20;
}

// Mars Reworked Module 2: barracks trains 12% faster per food type at supply post
if (building_monument_gt_module_is_active(MARS_MODULE_4_BARRACKS_VICTORY)) {
int reduction = 12 * city_data.mess_hall.food_types;
if (reduction > 0) {
spawn_delay = calc_adjust_with_percentage(spawn_delay, 100 - reduction);
if (spawn_delay < 1) {
spawn_delay = 1;
}
}
}

b->figure_spawn_delay++;
if (b->figure_spawn_delay > spawn_delay) {
b->figure_spawn_delay = 0;
Expand Down Expand Up @@ -2131,7 +2157,13 @@ void building_figure_generate(void)
case BUILDING_GRAND_TEMPLE_NEPTUNE:
case BUILDING_GRAND_TEMPLE_MERCURY:
case BUILDING_GRAND_TEMPLE_VENUS:
case BUILDING_GRAND_TEMPLE_VENUS_REWORKED:
case BUILDING_GRAND_TEMPLE_CERES_REWORKED:
case BUILDING_GRAND_TEMPLE_NEPTUNE_REWORKED:
case BUILDING_GRAND_TEMPLE_MERCURY_REWORKED:
case BUILDING_GRAND_TEMPLE_MARS_REWORKED:
case BUILDING_PANTHEON:
case BUILDING_PANTHEON_REWORKED:
spawn_figure_temple(b);
break;
case BUILDING_LIGHTHOUSE:
Expand Down
28 changes: 24 additions & 4 deletions src/building/house_evolution.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "building/monument.h"
#include "building/properties.h"
#include "city/houses.h"
#include "city/ratings.h"
#include "city/resource.h"
#include "core/calc.h"
#include "core/config.h"
Expand Down Expand Up @@ -194,7 +195,8 @@ static int has_required_goods_and_services(building *house, int for_upgrade, int
static int check_requirements(building *house, house_demands *demands)
{
int bonus = 0;
if (building_monument_pantheon_module_is_active(PANTHEON_MODULE_2_HOUSING_EVOLUTION) && house->house_pantheon_access) {
if ((building_monument_pantheon_module_is_active(PANTHEON_MODULE_2_HOUSING_EVOLUTION) ||
building_monument_working(BUILDING_PANTHEON_REWORKED)) && house->house_pantheon_access) {
bonus++;
}
int status = check_evolve_desirability(house, bonus);
Expand Down Expand Up @@ -506,7 +508,8 @@ static int evolve_large_palace(building *house, house_demands *demands)

static int evolve_luxury_palace(building *house, house_demands *demands)
{
int bonus = (int) (building_monument_pantheon_module_is_active(PANTHEON_MODULE_2_HOUSING_EVOLUTION) && house->house_pantheon_access);
int bonus = (int) ((building_monument_pantheon_module_is_active(PANTHEON_MODULE_2_HOUSING_EVOLUTION) ||
building_monument_working(BUILDING_PANTHEON_REWORKED)) && house->house_pantheon_access);
int status = check_evolve_desirability(house, bonus);
if (!has_required_goods_and_services(house, 0, bonus, demands)) {
status = DEVOLVE;
Expand Down Expand Up @@ -542,13 +545,29 @@ static void consume_resources(building *b)
consumption_reduction[RESOURCE_WINE] += 20;
consumption_reduction[RESOURCE_OIL] += 20;
}
// mars module 2 - all goods reduced by 10%
// mars module 2 - all goods reduced by 10%
if (b->data.house.temple_mars && building_monument_gt_module_is_active(MARS_MODULE_2_ALL_GOODS)) {
consumption_reduction[RESOURCE_WINE] += 10;
consumption_reduction[RESOURCE_OIL] += 10;
consumption_reduction[RESOURCE_POTTERY] += 10;
consumption_reduction[RESOURCE_FURNITURE] += 10;
}
// Mercury Reworked base bonus - all goods reduced by (house happiness / 10)%
if (b->data.house.temple_mercury && building_monument_working(BUILDING_GRAND_TEMPLE_MERCURY_REWORKED)) {
int sentiment_reduction = b->sentiment.house_happiness / 10; // 0-10% based on house happiness
consumption_reduction[RESOURCE_WINE] += sentiment_reduction;
consumption_reduction[RESOURCE_OIL] += sentiment_reduction;
consumption_reduction[RESOURCE_POTTERY] += sentiment_reduction;
consumption_reduction[RESOURCE_FURNITURE] += sentiment_reduction;
}
// Mercury Reworked module 4 bonus - all goods reduced by (city prosperity / 10)%
if (b->data.house.temple_mercury && building_monument_gt_module_is_active(MERCURY_MODULE_4_PROSPERITY)) {
int prosperity_reduction = city_rating_prosperity() / 10;
consumption_reduction[RESOURCE_WINE] += prosperity_reduction;
consumption_reduction[RESOURCE_OIL] += prosperity_reduction;
consumption_reduction[RESOURCE_POTTERY] += prosperity_reduction;
consumption_reduction[RESOURCE_FURNITURE] += prosperity_reduction;
}

for (resource_type r = RESOURCE_MIN_NON_FOOD; r < RESOURCE_MAX_NON_FOOD; r++) {
if (!resource_is_inventory(r)) {
Expand Down Expand Up @@ -609,7 +628,8 @@ void building_house_process_evolve_and_consume_goods(void)
void building_house_determine_evolve_text(building *house, int worst_desirability_building)
{
int level = house->subtype.house_level;
if (building_monument_pantheon_module_is_active(PANTHEON_MODULE_2_HOUSING_EVOLUTION) && house->house_pantheon_access) {
if ((building_monument_pantheon_module_is_active(PANTHEON_MODULE_2_HOUSING_EVOLUTION) ||
building_monument_working(BUILDING_PANTHEON_REWORKED)) && house->house_pantheon_access) {
level--;
}
level = calc_bound(level, HOUSE_MIN, HOUSE_MAX);
Expand Down
10 changes: 10 additions & 0 deletions src/building/house_population.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ int house_population_get_capacity(building *house)
house->data.house.temple_neptune) {
max_pop += (max_pop + 1) / 20;
}
// Pantheon Reworked Module 2: Luxury Palaces +10% capacity
if (building_monument_gt_module_is_active(PANTHEON_MODULE_4_LUXURY_PALACE) &&
house->type == BUILDING_HOUSE_LUXURY_PALACE) {
max_pop += max_pop / 10;
}
// Mars Reworked base: +5% capacity for houses with Mars temple access
if (building_monument_working(BUILDING_GRAND_TEMPLE_MARS_REWORKED) &&
house->data.house.temple_mars) {
max_pop += (max_pop + 1) / 20;
}
return max_pop;
}

Expand Down
20 changes: 20 additions & 0 deletions src/building/house_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ void house_service_decay_houses_covered(void)
void house_service_calculate_culture_aggregates(void)
{
int venus_module2 = building_monument_gt_module_is_active(VENUS_MODULE_2_DESIRABILITY_ENTERTAINMENT);
int venus_module4 = building_monument_gt_module_is_active(VENUS_MODULE_4_THEATER_TAVERN);
venus_m4_variant venus_m4_type = venus_module4 ? building_monument_venus_m4_variant() : VENUS_M4_THEATER_TAVERN;
int completed_colosseum = building_monument_working(BUILDING_COLOSSEUM);
int completed_hippodrome = building_monument_working(BUILDING_HIPPODROME);

Expand Down Expand Up @@ -138,6 +140,24 @@ void house_service_calculate_culture_aggregates(void)
b->data.house.entertainment += 10;
}

// Venus Module 4 Bonus (variant depends on scenario)
if (venus_module4) {
switch (venus_m4_type) {
case VENUS_M4_THEATER_TAVERN:
if (b->data.house.theater) { b->data.house.entertainment += 5; }
if (b->house_tavern_wine_access) { b->data.house.entertainment += 5; }
break;
case VENUS_M4_THEATER_BATHHOUSE:
if (b->data.house.theater) { b->data.house.entertainment += 5; }
if (b->data.house.bathhouse) { b->data.house.entertainment += 5; }
break;
case VENUS_M4_BATHHOUSE_TAVERN:
if (b->data.house.bathhouse) { b->data.house.entertainment += 5; }
if (b->house_tavern_wine_access) { b->data.house.entertainment += 5; }
break;
}
}

// Education
b->data.house.education = 0;
if (b->data.house.school || b->data.house.library) {
Expand Down
27 changes: 27 additions & 0 deletions src/building/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ int building_image_get(const building *b)
case BUILDING_NATIVE_CROPS:
return image_group(GROUP_BUILDING_FARM_CROPS);
case BUILDING_GRAND_TEMPLE_CERES:
case BUILDING_GRAND_TEMPLE_CERES_REWORKED:
switch (b->monument.phase) {
case MONUMENT_START:
return assets_get_image_id("Monuments", "Ceres Complex Const 01");
Expand Down Expand Up @@ -623,7 +624,30 @@ int building_image_get(const building *b)
return assets_get_image_id("Monuments", "Neptune Complex On");
}
}
case BUILDING_GRAND_TEMPLE_NEPTUNE_REWORKED:
switch (b->monument.phase) {
case MONUMENT_START:
return assets_get_image_id("Monuments", "Neptune Complex Const 01");
case 2:
return assets_get_image_id("Monuments", "Neptune Complex Const 02");
case 3:
return assets_get_image_id("Monuments", "Neptune Complex Const 03");
case 4:
return assets_get_image_id("Monuments", "Neptune Complex Const 04");
case 5:
return assets_get_image_id("Monuments", "Neptune Complex Const 05");
default:
switch (b->monument.upgrades) {
case 1:
return assets_get_image_id("Monuments", "Neptune Complex Module2");
case 2:
return assets_get_image_id("Monuments", "Neptune Complex Module");
default:
return assets_get_image_id("Monuments", "Neptune Complex On");
}
}
case BUILDING_GRAND_TEMPLE_MERCURY:
case BUILDING_GRAND_TEMPLE_MERCURY_REWORKED:
switch (b->monument.phase) {
case MONUMENT_START:
return assets_get_image_id("Monuments", "Mercury Complex Const 01");
Expand All @@ -646,6 +670,7 @@ int building_image_get(const building *b)
}
}
case BUILDING_GRAND_TEMPLE_MARS:
case BUILDING_GRAND_TEMPLE_MARS_REWORKED:
switch (b->monument.phase) {
case MONUMENT_START:
return assets_get_image_id("Monuments", "Mars Complex Const 01");
Expand All @@ -668,6 +693,7 @@ int building_image_get(const building *b)
}
}
case BUILDING_GRAND_TEMPLE_VENUS:
case BUILDING_GRAND_TEMPLE_VENUS_REWORKED:
switch (b->monument.phase) {
case MONUMENT_START:
return assets_get_image_id("Monuments", "Venus Complex Const 01");
Expand All @@ -690,6 +716,7 @@ int building_image_get(const building *b)
}
}
case BUILDING_PANTHEON:
case BUILDING_PANTHEON_REWORKED:
switch (b->monument.phase) {
case MONUMENT_START:
return assets_get_image_id("Monuments", "Pantheon Const 01");
Expand Down
16 changes: 14 additions & 2 deletions src/building/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "city/buildings.h"
#include "core/config.h"
#include "empire/city.h"
#include "game/cheats.h"
#include "game/tutorial.h"
#include "scenario/allowed_building.h"
#include "scenario/property.h"
Expand Down Expand Up @@ -50,8 +51,10 @@ static const building_type MENU_BUILDING_TYPE[BUILD_MENU_MAX][BUILD_MENU_ITEM_MA
BUILDING_PALM_TREE, BUILDING_DATE_TREE, 0},
{BUILDING_MENU_PATHS, BUILDING_GARDEN_PATH, BUILDING_PINE_PATH , BUILDING_FIR_PATH, BUILDING_OAK_PATH, BUILDING_ELM_PATH,
BUILDING_FIG_PATH, BUILDING_PLUM_PATH, BUILDING_PALM_PATH, BUILDING_DATE_PATH, 0},
{BUILDING_PANTHEON, BUILDING_GRAND_TEMPLE_CERES, BUILDING_GRAND_TEMPLE_NEPTUNE, BUILDING_GRAND_TEMPLE_MERCURY,
BUILDING_GRAND_TEMPLE_MARS, BUILDING_GRAND_TEMPLE_VENUS, 0},
{BUILDING_PANTHEON, BUILDING_PANTHEON_REWORKED, BUILDING_GRAND_TEMPLE_CERES, BUILDING_GRAND_TEMPLE_CERES_REWORKED,
BUILDING_GRAND_TEMPLE_NEPTUNE, BUILDING_GRAND_TEMPLE_NEPTUNE_REWORKED, BUILDING_GRAND_TEMPLE_MERCURY,
BUILDING_GRAND_TEMPLE_MERCURY_REWORKED, BUILDING_GRAND_TEMPLE_MARS, BUILDING_GRAND_TEMPLE_MARS_REWORKED,
BUILDING_GRAND_TEMPLE_VENUS, BUILDING_GRAND_TEMPLE_VENUS_REWORKED, 0},
{BUILDING_SMALL_STATUE, BUILDING_GODDESS_STATUE, BUILDING_SENATOR_STATUE, BUILDING_GLADIATOR_STATUE, BUILDING_DECORATIVE_COLUMN,
BUILDING_MEDIUM_STATUE, BUILDING_LEGION_STATUE, BUILDING_OBELISK, BUILDING_LARGE_STATUE, BUILDING_HORSE_STATUE, 0},
{BUILDING_GOVERNORS_HOUSE, BUILDING_GOVERNORS_VILLA, BUILDING_GOVERNORS_PALACE, 0},
Expand Down Expand Up @@ -136,6 +139,15 @@ static int can_get_required_resource(building_type type)

static int is_building_type_allowed(building_type type)
{
// All 6 old grand temples require a cheat to be active
if (type == BUILDING_PANTHEON ||
type == BUILDING_GRAND_TEMPLE_CERES ||
type == BUILDING_GRAND_TEMPLE_NEPTUNE ||
type == BUILDING_GRAND_TEMPLE_MERCURY ||
type == BUILDING_GRAND_TEMPLE_MARS ||
type == BUILDING_GRAND_TEMPLE_VENUS) {
return game_cheat_legacy_gts_enabled() && scenario_allowed_building(type) && can_get_required_resource(type);
}
return scenario_allowed_building(type) && can_get_required_resource(type);
}

Expand Down
Loading
Loading