From 981a771616d32c997775b0b6afee67fd059525e3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 11 Jun 2021 04:53:34 +0300 Subject: [PATCH 48/48] Rulesave: Save comment about incite_cost settings See osdn #42508 Signed-off-by: Marko Lindqvist --- data/ruledit/comments-3.2.txt | 8 ++++++++ tools/ruleutil/comments.c | 12 ++++++++++++ tools/ruleutil/comments.h | 1 + tools/ruleutil/rulesave.c | 1 + 4 files changed, 22 insertions(+) diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index ed86423418..0ef2910ea0 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1246,6 +1246,14 @@ wv_small_wonders = "\ ; \"Embassy\" - Information is sent when team has an embassy with Wonder owner\ " +incite_cost = "\ +; city_incite_cost = total_factor * (city_size) * (base_incite_cost\n\ +; + (units_cost) * unit_factor\n\ +; + (improvements_cost) * improvement_factor)\n\ +; / ((distance to capital) * 100)\n\ +; See city_incite_cost() for more details\n\ +" + tired_attack = "\ ; If tired_attack is set to TRUE, units that attack with less than a single\n\ ; move point (per move_fragments in terrain.ruleset) will have their attack\n\ diff --git a/tools/ruleutil/comments.c b/tools/ruleutil/comments.c index e4d2df41c2..4223c0087c 100644 --- a/tools/ruleutil/comments.c +++ b/tools/ruleutil/comments.c @@ -57,6 +57,7 @@ static struct { char *civstyle_gameloss_style; char *civstyle_gold_upkeep_style; char *wonder_visibility_small_wonders; + char *incite_cost; char *combat_rules_tired_attack; char *combat_rules_only_killing_veteran; char *combat_rules_nuke_pop_loss; @@ -143,6 +144,8 @@ bool comments_load(void) "entrydoc.gold_upkeep_style"); comment_load(comments_storage.wonder_visibility_small_wonders, comment_file, "entrydoc.wv_small_wonders"); + comment_load(comments_storage.incite_cost, comment_file, + "entrydoc.incite_cost"); comment_load(comments_storage.combat_rules_tired_attack, comment_file, "entrydoc.tired_attack"); comment_load(comments_storage.combat_rules_only_killing_veteran, comment_file, @@ -450,6 +453,15 @@ void comment_wonder_visibility_small_wonders(struct section_file *sfile) "wonder_visibility"); } +/**********************************************************************//** + Write incite_cost settings header. +**************************************************************************/ +void comment_incite_cost(struct section_file *sfile) +{ + comment_entry_write(sfile, comments_storage.incite_cost, + "incite_cost"); +} + /**********************************************************************//** Write combat_rules tired_attack settings header. **************************************************************************/ diff --git a/tools/ruleutil/comments.h b/tools/ruleutil/comments.h index 658b190896..9128ac733c 100644 --- a/tools/ruleutil/comments.h +++ b/tools/ruleutil/comments.h @@ -60,6 +60,7 @@ void comment_civstyle_ransom_gold(struct section_file *sfile); void comment_civstyle_gameloss_style(struct section_file *sfile); void comment_civstyle_gold_upkeep_style(struct section_file *sfile); void comment_wonder_visibility_small_wonders(struct section_file *sfile); +void comment_incite_cost(struct section_file *sfile); void comment_combat_rules_tired_attack(struct section_file *sfile); void comment_combat_rules_only_killing_veteran(struct section_file *sfile); void comment_combat_rules_nuke_pop_loss(struct section_file *sfile); diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index f51b1e49e9..caf1250c69 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1251,6 +1251,7 @@ static bool save_game_ruleset(const char *filename, const char *name) save_default_int(sfile, game.info.illness_pollution_factor, RS_DEFAULT_ILLNESS_POLLUTION_PCT, "illness.illness_pollution_factor", NULL); + comment_incite_cost(sfile); save_default_int(sfile, game.server.base_incite_cost, RS_DEFAULT_INCITE_BASE_COST, "incite_cost.base_incite_cost", NULL); -- 2.30.2