Feature #1351 » 0067-Turn-Upkeep_Factor-to-Upkeep_Pct.patch
ai/default/daieffects.c | ||
---|---|---|
/* Currently not supported for building AI - wait for modpack users */
|
||
case EFT_CITY_UNHAPPY_SIZE:
|
||
case EFT_UNHAPPY_FACTOR:
|
||
case EFT_UPKEEP_FACTOR:
|
||
case EFT_UPKEEP_PCT:
|
||
case EFT_UNIT_UPKEEP_FREE_PER_CITY:
|
||
case EFT_CIVIL_WAR_CHANCE:
|
||
case EFT_EMPIRE_SIZE_BASE:
|
client/helpdata.c | ||
---|---|---|
* is sufficient reason to list it in that gov's help.
|
||
* Guard accesses to these with 'playerwide' or 'world_value_valid'. */
|
||
int world_value = -999, net_value = -999;
|
||
if (world_value_valid) {
|
||
/* Get government-independent world value of effect if the extra
|
||
* requirements were simple enough. */
|
||
... | ... | |
* output types. Generate lists for that. */
|
||
bool harvested_only = TRUE; /* Consider only output types from fields */
|
||
if (peffect->type == EFT_UPKEEP_FACTOR
|
||
if (peffect->type == EFT_UPKEEP_PCT
|
||
|| peffect->type == EFT_UNIT_UPKEEP_FREE_PER_CITY
|
||
|| peffect->type == EFT_OUTPUT_BONUS
|
||
|| peffect->type == EFT_OUTPUT_BONUS_2) {
|
||
... | ... | |
BULLET, peffect->value);
|
||
}
|
||
break;
|
||
case EFT_UPKEEP_FACTOR:
|
||
case EFT_UPKEEP_PCT:
|
||
if (world_value_valid && !unittype) {
|
||
if (net_value == 0) {
|
||
if (output_type != O_LAST) {
|
||
... | ... | |
}
|
||
} else if (net_value != world_value) {
|
||
double ratio = (double)net_value / world_value;
|
||
if (output_type != O_LAST) {
|
||
cat_snprintf(buf, bufsz,
|
||
/* TRANS: %s is the output type, like 'shield'
|
common/unittype.c | ||
---|---|---|
.tile = ptile,
|
||
.city = pcity
|
||
},
|
||
NULL, EFT_UPKEEP_FACTOR);
|
||
NULL, EFT_UPKEEP_PCT) / 100;
|
||
return val;
|
||
}
|
data/alien/effects.ruleset | ||
---|---|---|
value = 5
|
||
[effect_base_unit_upkeep_not_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", FALSE
|
||
}
|
||
[effect_base_unit_upkeep_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Gold", "Local"
|
data/civ1/effects.ruleset | ||
---|---|---|
value = 100
|
||
[effect_base_unit_upkeep_not_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", FALSE
|
||
}
|
||
[effect_base_unit_upkeep_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Gold", "Local"
|
||
... | ... | |
}
|
||
[effect_republic_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Republic", "Player"
|
||
... | ... | |
}
|
||
[effect_democracy_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Democracy", "Player"
|
data/civ2/effects.ruleset | ||
---|---|---|
}
|
||
[effect_base_unit_upkeep_not_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", FALSE
|
||
}
|
||
[effect_base_unit_upkeep_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Gold", "Local"
|
||
... | ... | |
}
|
||
[effect_communism_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Communism", "Player"
|
||
... | ... | |
}
|
||
[effect_fundamentalism_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Fundamentalism", "Player"
|
||
... | ... | |
}
|
||
[effect_republic_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Republic", "Player"
|
||
... | ... | |
}
|
||
[effect_democracy_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Democracy", "Player"
|
data/civ2civ3/effects.ruleset | ||
---|---|---|
; "Away" "Novice" "Easy" "Normal" "Hard" "Cheating" "Experimental"
|
||
[effect_ai_cheat_food]
|
||
type = "Upkeep_Factor"
|
||
value = -1
|
||
type = "Upkeep_Pct"
|
||
value = -100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"AI", "Cheating", "Player"
|
||
... | ... | |
}
|
||
[effect_base_unit_upkeep_gold_1]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", TRUE
|
||
... | ... | |
; Additive with previous => x2 for Fundamentalism, Federation, Democracy
|
||
[effect_base_unit_upkeep_gold_2]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", TRUE
|
||
... | ... | |
}
|
||
[effect_base_unit_upkeep_shield]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Shield", "Local", TRUE
|
||
... | ... | |
}
|
||
[effect_base_unit_upkeep_food]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Food", "Local"
|
data/classic/effects.ruleset | ||
---|---|---|
}
|
||
[effect_base_unit_upkeep_not_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", FALSE
|
||
}
|
||
[effect_base_unit_upkeep_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Gold", "Local"
|
||
... | ... | |
}
|
||
[effect_republic_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Republic", "Player"
|
||
... | ... | |
}
|
||
[effect_democracy_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Democracy", "Player"
|
data/goldkeep/effects.ruleset | ||
---|---|---|
}
|
||
[effect_base_unit_upkeep_not_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", FALSE
|
||
}
|
||
[effect_base_unit_upkeep_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Gold", "Local"
|
||
... | ... | |
}
|
||
[effect_republic_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
reqs =
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Republic", "Player"
|
||
"OutputType", "Food", "Local"
|
||
}
|
||
[effect_democracy_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
reqs =
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Democracy", "Player"
|
||
"OutputType", "Food", "Local"
|
data/granularity/effects.ruleset | ||
---|---|---|
}
|
||
[effect_base_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
[effect_empire_size_base]
|
||
type = "Empire_Size_Base"
|
data/multiplayer/effects.ruleset | ||
---|---|---|
}
|
||
[effect_base_unit_upkeep_not_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", FALSE
|
||
}
|
||
[effect_base_unit_upkeep_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Gold", "Local"
|
||
... | ... | |
}
|
||
[effect_republic_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Republic", "Player"
|
||
... | ... | |
}
|
||
[effect_democracy_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Democracy", "Player"
|
||
... | ... | |
}
|
||
[effect_fundamentalism_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 2
|
||
type = "Upkeep_Pct"
|
||
value = 200
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Fundamentalism", "Player"
|
data/sandbox/effects.ruleset | ||
---|---|---|
; "Away" "Novice" "Easy" "Normal" "Hard" "Cheating" "Experimental"
|
||
[effect_ai_cheat_food]
|
||
type = "Upkeep_Factor"
|
||
value = -1
|
||
type = "Upkeep_Pct"
|
||
value = -100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"AI", "Cheating", "Player"
|
||
... | ... | |
}
|
||
[effect_base_unit_upkeep_gold_1]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", TRUE
|
||
... | ... | |
; Additive with previous => x2 for Fundamentalism, Federation, Democracy
|
||
[effect_base_unit_upkeep_gold_2]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", TRUE
|
||
... | ... | |
}
|
||
[effect_base_unit_upkeep_shield]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Shield", "Local", TRUE
|
||
... | ... | |
}
|
||
[effect_base_unit_upkeep_food]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Food", "Local"
|
data/stub/effects.ruleset | ||
---|---|---|
value = 5
|
||
[effect_base_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
[effect_empire_size_base]
|
||
type = "Empire_Size_Base"
|
data/webperimental/effects.ruleset | ||
---|---|---|
}
|
||
[effect_base_unit_upkeep_not_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range", "present"
|
||
"OutputType", "Gold", "Local", FALSE
|
||
}
|
||
[effect_base_unit_upkeep_gold]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"OutputType", "Gold", "Local"
|
||
... | ... | |
}
|
||
[effect_republic_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
reqs =
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Republic", "Player"
|
||
"OutputType", "Food", "Local"
|
||
}
|
||
[effect_democracy_unit_upkeep]
|
||
type = "Upkeep_Factor"
|
||
value = 1
|
||
reqs =
|
||
type = "Upkeep_Pct"
|
||
value = 100
|
||
reqs =
|
||
{ "type", "name", "range"
|
||
"Gov", "Democracy", "Player"
|
||
"OutputType", "Food", "Local"
|
doc/README.effects | ||
---|---|---|
Upgrade_Unit
|
||
Upgrade amount obsolete units per turn.
|
||
Upkeep_Factor
|
||
Multiply unit upkeep by amount.
|
||
Upkeep_Pct
|
||
Unit upkeep is amount percents.
|
||
Upkeep_Free
|
||
Improvements with amount or less upkeep cost become free to upkeep (others
|
gen_headers/enums/effects_enums.def | ||
---|---|---|
/* Multiply unhappy upkeep by this effect */
|
||
UNHAPPY_FACTOR "Unhappy_Factor"
|
||
/* Multiply upkeep by this effect */
|
||
UPKEEP_FACTOR "Upkeep_Factor"
|
||
UPKEEP_PCT "Upkeep_Pct"
|
||
/* This many units are free from upkeep */
|
||
UNIT_UPKEEP_FREE_PER_CITY "Unit_Upkeep_Free_Per_City"
|
||
OUTPUT_WASTE "Output_Waste"
|
server/ruleset/rscompat.c | ||
---|---|---|
struct rscompat_info *info = (struct rscompat_info *)data;
|
||
if (info->version < RSFORMAT_3_4) {
|
||
if (!game.server.deprecated.homeless_gold_upkeep) {
|
||
if (peffect->type == EFT_UPKEEP_FACTOR) {
|
||
if (peffect->type == EFT_UPKEEP_PCT) {
|
||
/* From old Upkeep_Factor to new Upkeep_Pct */
|
||
peffect->value *= 100;
|
||
if (!game.server.deprecated.homeless_gold_upkeep) {
|
||
bool gold_included = TRUE;
|
||
bool only_gold = FALSE;
|
||
... | ... | |
if (gold_included) {
|
||
if (!only_gold) {
|
||
struct effect *copy = effect_copy(peffect, EFT_UPKEEP_FACTOR);
|
||
struct effect *copy = effect_copy(peffect, EFT_UPKEEP_PCT);
|
||
/* Split to gold-only and not-gold effects.
|
||
* Make sure the gold-only is the one we currently handle
|
||
... | ... | |
/* All tech user flags are taken. */
|
||
return MAX_NUM_USER_TECH_FLAGS;
|
||
}
|
||
/**********************************************************************//**
|
||
Convert 3.3 effect name to a 3.4 one.
|
||
**************************************************************************/
|
||
const char *rscompat_effect_name_3_4(const char *old_name)
|
||
{
|
||
if (!fc_strcasecmp("Upkeep_Factor", old_name)) {
|
||
return "Upkeep_Pct";
|
||
}
|
||
return old_name;
|
||
}
|
server/ruleset/rscompat.h | ||
---|---|---|
const char *rfor);
|
||
/* Functions specific to 3.3 -> 3.4 transition */
|
||
const char *rscompat_effect_name_3_4(const char *old_name);
|
||
#ifdef __cplusplus
|
||
}
|
server/ruleset/ruleload.c | ||
---|---|---|
break;
|
||
}
|
||
if (compat->compat_mode && compat->version < RSFORMAT_3_4) {
|
||
type = rscompat_effect_name_3_4(type);
|
||
}
|
||
eff = effect_type_by_name(type, fc_strcasecmp);
|
||
if (!effect_type_is_valid(eff)) {
|
||
ruleset_error(NULL, LOG_ERROR,
|
- « Previous
- 1
- 2
- Next »