From a5bbb12a5c9988207d287e0812f19a74857a477d Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 3 May 2024 17:18:18 +0300 Subject: [PATCH 37/62] Unhardcode Output_Penalty_Tile celebration handling Celebration no longer prevents Output_Penalty_Tile from taking an effect in a hardcoded manner. It's implemented in the ruleset instead. Requested by ddeanbrown See osdn #45236 Signed-off-by: Marko Lindqvist --- common/city.c | 2 +- data/civ1/effects.ruleset | 10 ++++--- data/civ2/effects.ruleset | 10 ++++--- data/civ2civ3/effects.ruleset | 45 ++++++++++++++++-------------- data/classic/effects.ruleset | 10 ++++--- data/goldkeep/effects.ruleset | 10 ++++--- data/multiplayer/effects.ruleset | 10 ++++--- data/sandbox/effects.ruleset | 45 ++++++++++++++++-------------- data/webperimental/effects.ruleset | 10 ++++--- doc/README.effects | 3 +- 10 files changed, 86 insertions(+), 69 deletions(-) diff --git a/common/city.c b/common/city.c index e246dc411a..40b6174611 100644 --- a/common/city.c +++ b/common/city.c @@ -1346,7 +1346,7 @@ int city_tile_output(const struct city *pcity, const struct tile *ptile, * get_tile_output_bonus(pcity, ptile, output, EFT_OUTPUT_PER_TILE)) / 100; - if (!is_celebrating && penalty_limit > 0 && prod > penalty_limit) { + if (penalty_limit > 0 && prod > penalty_limit) { if (prod <= game.info.granularity) { prod = 0; } else { diff --git a/data/civ1/effects.ruleset b/data/civ1/effects.ruleset index 9b507aa286..d077d151b0 100644 --- a/data/civ1/effects.ruleset +++ b/data/civ1/effects.ruleset @@ -57,16 +57,18 @@ value = 4 type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Anarchy", "Player" + { "type", "name", "range", "present" + "Gov", "Anarchy", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_1] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Despotism", "Player" + { "type", "name", "range", "present" + "Gov", "Despotism", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_2] diff --git a/data/civ2/effects.ruleset b/data/civ2/effects.ruleset index e5081f9b95..531b2f3652 100644 --- a/data/civ2/effects.ruleset +++ b/data/civ2/effects.ruleset @@ -100,16 +100,18 @@ value = 4 type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Anarchy", "Player" + { "type", "name", "range", "present" + "Gov", "Anarchy", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_1] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Despotism", "Player" + { "type", "name", "range", "present" + "Gov", "Despotism", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_2] diff --git a/data/civ2civ3/effects.ruleset b/data/civ2civ3/effects.ruleset index a076f41afb..c6363893d6 100644 --- a/data/civ2civ3/effects.ruleset +++ b/data/civ2civ3/effects.ruleset @@ -1459,39 +1459,42 @@ reqs = type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range", "present", "quiet" - "Gov", "Anarchy", "Player", TRUE, TRUE - "Building", "Pyramids", "Player", FALSE, FALSE - "Tech", "Railroad", "Player", FALSE, FALSE - "OutputType", "Gold", "Local", FALSE, TRUE - "OutputType", "Luxury", "Local", FALSE, TRUE - "OutputType", "Science", "Local", FALSE, TRUE + { "type", "name", "range", "present", "quiet" + "Gov", "Anarchy", "Player", TRUE, TRUE + "Building", "Pyramids", "Player", FALSE, FALSE + "Tech", "Railroad", "Player", FALSE, FALSE + "OutputType", "Gold", "Local", FALSE, TRUE + "OutputType", "Luxury", "Local", FALSE, TRUE + "OutputType", "Science", "Local", FALSE, TRUE + "CityStatus", "Celebration", "City", FALSE, FALSE } [effect_gov_tile_penalty_tribal] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range", "present", "quiet" - "Gov", "Tribal", "Player", TRUE, TRUE - "Building", "Pyramids", "Player", FALSE, FALSE - "Tech", "Railroad", "Player", FALSE, FALSE - "OutputType", "Gold", "Local", FALSE, TRUE - "OutputType", "Luxury", "Local", FALSE, TRUE - "OutputType", "Science", "Local", FALSE, TRUE + { "type", "name", "range", "present", "quiet" + "Gov", "Tribal", "Player", TRUE, TRUE + "Building", "Pyramids", "Player", FALSE, FALSE + "Tech", "Railroad", "Player", FALSE, FALSE + "OutputType", "Gold", "Local", FALSE, TRUE + "OutputType", "Luxury", "Local", FALSE, TRUE + "OutputType", "Science", "Local", FALSE, TRUE + "CityStatus", "Celebration", "City", FALSE, FALSE } [effect_gov_tile_penalty_despotism] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range", "present", "quiet" - "Gov", "Despotism", "Player", TRUE, TRUE - "Building", "Pyramids", "Player", FALSE, FALSE - "Tech", "Railroad", "Player", FALSE, FALSE - "OutputType", "Gold", "Local", FALSE, TRUE - "OutputType", "Luxury", "Local", FALSE, TRUE - "OutputType", "Science", "Local", FALSE, TRUE + { "type", "name", "range", "present", "quiet" + "Gov", "Despotism", "Player", TRUE, TRUE + "Building", "Pyramids", "Player", FALSE, FALSE + "Tech", "Railroad", "Player", FALSE, FALSE + "OutputType", "Gold", "Local", FALSE, TRUE + "OutputType", "Luxury", "Local", FALSE, TRUE + "OutputType", "Science", "Local", FALSE, TRUE + "CityStatus", "Celebration", "City", FALSE, FALSE } [effect_gov_tile_bonus_republic] diff --git a/data/classic/effects.ruleset b/data/classic/effects.ruleset index b044aaaa4a..63837c597a 100644 --- a/data/classic/effects.ruleset +++ b/data/classic/effects.ruleset @@ -683,16 +683,18 @@ reqs = type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Anarchy", "Player" + { "type", "name", "range", "present" + "Gov", "Anarchy", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_1] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Despotism", "Player" + { "type", "name", "range", "present" + "Gov", "Despotism", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_2] diff --git a/data/goldkeep/effects.ruleset b/data/goldkeep/effects.ruleset index aa3182797d..aed07e90b8 100644 --- a/data/goldkeep/effects.ruleset +++ b/data/goldkeep/effects.ruleset @@ -770,16 +770,18 @@ reqs = type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Anarchy", "Player" + { "type", "name", "range", "present" + "Gov", "Anarchy", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_1] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Despotism", "Player" + { "type", "name", "range", "present" + "Gov", "Despotism", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_2] diff --git a/data/multiplayer/effects.ruleset b/data/multiplayer/effects.ruleset index 08d9d011a6..ceb6819e80 100644 --- a/data/multiplayer/effects.ruleset +++ b/data/multiplayer/effects.ruleset @@ -679,16 +679,18 @@ reqs = type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Anarchy", "Player" + { "type", "name", "range", "present" + "Gov", "Anarchy", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_1] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Despotism", "Player" + { "type", "name", "range", "present" + "Gov", "Despotism", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_2] diff --git a/data/sandbox/effects.ruleset b/data/sandbox/effects.ruleset index c469a62030..16fe45dabd 100644 --- a/data/sandbox/effects.ruleset +++ b/data/sandbox/effects.ruleset @@ -1642,39 +1642,42 @@ reqs = type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range", "present", "quiet" - "Gov", "Anarchy", "Player", TRUE, TRUE - "Building", "Pyramids", "Player", FALSE, FALSE - "Tech", "Railroad", "Player", FALSE, FALSE - "OutputType", "Gold", "Local", FALSE, TRUE - "OutputType", "Luxury", "Local", FALSE, TRUE - "OutputType", "Science", "Local", FALSE, TRUE + { "type", "name", "range", "present", "quiet" + "Gov", "Anarchy", "Player", TRUE, TRUE + "Building", "Pyramids", "Player", FALSE, FALSE + "Tech", "Railroad", "Player", FALSE, FALSE + "OutputType", "Gold", "Local", FALSE, TRUE + "OutputType", "Luxury", "Local", FALSE, TRUE + "OutputType", "Science", "Local", FALSE, TRUE + "CityStatus", "Celebration", "City", FALSE, FALSE } [effect_gov_tile_penalty_tribal] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range", "present", "quiet" - "Gov", "Tribal", "Player", TRUE, TRUE - "Building", "Pyramids", "Player", FALSE, FALSE - "Tech", "Railroad", "Player", FALSE, FALSE - "OutputType", "Gold", "Local", FALSE, TRUE - "OutputType", "Luxury", "Local", FALSE, TRUE - "OutputType", "Science", "Local", FALSE, TRUE + { "type", "name", "range", "present", "quiet" + "Gov", "Tribal", "Player", TRUE, TRUE + "Building", "Pyramids", "Player", FALSE, FALSE + "Tech", "Railroad", "Player", FALSE, FALSE + "OutputType", "Gold", "Local", FALSE, TRUE + "OutputType", "Luxury", "Local", FALSE, TRUE + "OutputType", "Science", "Local", FALSE, TRUE + "CityStatus", "Celebration", "City", FALSE, FALSE } [effect_gov_tile_penalty_despotism] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range", "present", "quiet" - "Gov", "Despotism", "Player", TRUE, TRUE - "Building", "Pyramids", "Player", FALSE, FALSE - "Tech", "Railroad", "Player", FALSE, FALSE - "OutputType", "Gold", "Local", FALSE, TRUE - "OutputType", "Luxury", "Local", FALSE, TRUE - "OutputType", "Science", "Local", FALSE, TRUE + { "type", "name", "range", "present", "quiet" + "Gov", "Despotism", "Player", TRUE, TRUE + "Building", "Pyramids", "Player", FALSE, FALSE + "Tech", "Railroad", "Player", FALSE, FALSE + "OutputType", "Gold", "Local", FALSE, TRUE + "OutputType", "Luxury", "Local", FALSE, TRUE + "OutputType", "Science", "Local", FALSE, TRUE + "CityStatus", "Celebration", "City", FALSE, FALSE } [effect_gov_tile_bonus_republic] diff --git a/data/webperimental/effects.ruleset b/data/webperimental/effects.ruleset index 57728d13ae..e9f056e8ff 100644 --- a/data/webperimental/effects.ruleset +++ b/data/webperimental/effects.ruleset @@ -693,16 +693,18 @@ reqs = type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Anarchy", "Player" + { "type", "name", "range", "present" + "Gov", "Anarchy", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_1] type = "Output_Penalty_Tile" value = 2 reqs = - { "type", "name", "range" - "Gov", "Despotism", "Player" + { "type", "name", "range", "present" + "Gov", "Despotism", "Player", TRUE + "CityStatus", "Celebration", "City", FALSE } [effect_gov_tile_bonus_2] diff --git a/doc/README.effects b/doc/README.effects index 529f5cb770..9492819589 100644 --- a/doc/README.effects +++ b/doc/README.effects @@ -563,8 +563,7 @@ Output_Inc_Tile_Celebrate Output_Penalty_Tile When a tile yields more output than amount, it gets a penalty of - -1 x output_granularity (from game.ruleset), unless the city working - it is celebrating. + -1 x output_granularity (from game.ruleset). Output_Per_Tile Increase tile output by amount percent. -- 2.43.0