Project

General

Profile

Feature #972 ยป 0043-Rename-Martial_Law_Each-as-Martial_Law_By_Unit.patch

Marko Lindqvist, 10/16/2024 04:56 AM

View differences:

ai/default/daieffects.c
case EFT_EMPIRE_SIZE_BASE:
case EFT_EMPIRE_SIZE_STEP:
case EFT_MAX_RATES:
case EFT_MARTIAL_LAW_EACH:
case EFT_MARTIAL_LAW_BY_UNIT:
case EFT_MARTIAL_LAW_MAX:
case EFT_RAPTURE_GROW:
case EFT_REVOLUTION_UNHAPPINESS:
ai/default/daimilitary.c
if (martial_need
&& unit_list_size(pcity->tile->units) < get_city_bonus(pcity, EFT_MARTIAL_LAW_MAX)) {
martial_value = dai_content_effect_value(pplayer, pcity,
get_city_bonus(pcity, EFT_MARTIAL_LAW_EACH),
get_city_bonus(pcity, EFT_MARTIAL_LAW_BY_UNIT),
1, FEELING_FINAL);
}
ai/default/daiunit.c
bool emergency = FALSE;
int count = 0;
int mart_max = get_city_bonus(pcity, EFT_MARTIAL_LAW_MAX);
int mart_each = get_city_bonus(pcity, EFT_MARTIAL_LAW_EACH);
int mart_each = get_city_bonus(pcity, EFT_MARTIAL_LAW_BY_UNIT);
int martless_unhappy = pcity->feel[CITIZEN_UNHAPPY][FEELING_NATIONALITY]
+ pcity->feel[CITIZEN_ANGRY][FEELING_NATIONALITY];
int entertainers = 0;
client/helpdata.c
}
}
break;
case EFT_MARTIAL_LAW_EACH:
case EFT_MARTIAL_LAW_BY_UNIT:
if (playerwide) {
cat_snprintf(buf, bufsz,
PL_("%s Your units may impose martial law."
client/text.c
astr_clear(&str);
if (mlmax > 0) {
int mleach = get_city_bonus(pcity, EFT_MARTIAL_LAW_EACH);
int mleach = get_city_bonus(pcity, EFT_MARTIAL_LAW_BY_UNIT);
if (mlmax == 100) {
astr_add_line(&str, "%s", _("Unlimited martial law in effect."));
} else {
common/city.c
.unit = punit,
.unittype = unit_type_get(punit)
},
NULL, EFT_MARTIAL_LAW_EACH);
NULL, EFT_MARTIAL_LAW_BY_UNIT);
if (current > 0) {
if (sel_count < max_mart_units) {
best_units[sel_count++] = current;
data/alien/effects.ruleset
}
[effect_martial_law]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
{ "type", "name", "range"
"Building", "Secret Police", "City"
}
data/civ1/effects.ruleset
value = 10
[effect_martial_law_each_0]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
}
[effect_martial_law_each_1]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Despotism", "Player"
{ "type", "name", "range"
"Gov", "Despotism", "Player"
}
[effect_martial_law_each_2]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
}
[effect_martial_law_each_3]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Communism", "Player"
{ "type", "name", "range"
"Gov", "Communism", "Player"
}
[effect_martial_law_max_0]
data/civ2/effects.ruleset
}
[effect_martial_law_each_0]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
}
[effect_martial_law_each_1]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Despotism", "Player"
{ "type", "name", "range"
"Gov", "Despotism", "Player"
}
[effect_martial_law_each_2]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
}
[effect_martial_law_each_3]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 2
reqs =
{ "type", "name", "range"
"Gov", "Communism", "Player"
{ "type", "name", "range"
"Gov", "Communism", "Player"
}
[effect_martial_law_max_0]
data/civ2civ3/effects.ruleset
}
[effect_martial_law_each_anarchy]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Anarchy", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Anarchy", "Player", TRUE
}
[effect_martial_law_each_despotism]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Despotism", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Despotism", "Player", TRUE
}
[effect_martial_law_each_monarchy]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Monarchy", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Monarchy", "Player", TRUE
}
[effect_martial_law_each_communism]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 2
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Communism", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Communism", "Player", TRUE
}
[effect_martial_law_max]
data/classic/effects.ruleset
}
[effect_martial_law_each_0]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
}
[effect_martial_law_each_1]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Despotism", "Player"
{ "type", "name", "range"
"Gov", "Despotism", "Player"
}
[effect_martial_law_each_2]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
}
[effect_martial_law_each_3]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 2
reqs =
{ "type", "name", "range"
"Gov", "Communism", "Player"
{ "type", "name", "range"
"Gov", "Communism", "Player"
}
[effect_martial_law_max_0]
data/goldkeep/effects.ruleset
}
[effect_martial_law_each_0]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
}
[effect_martial_law_each_1]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Despotism", "Player"
{ "type", "name", "range"
"Gov", "Despotism", "Player"
}
[effect_martial_law_each_2]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
}
[effect_martial_law_each_3]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 2
reqs =
{ "type", "name", "range"
"Gov", "Communism", "Player"
{ "type", "name", "range"
"Gov", "Communism", "Player"
}
[effect_martial_law_max_0]
data/multiplayer/effects.ruleset
}
[effect_martial_law_each_0]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
}
[effect_martial_law_each_1]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Despotism", "Player"
{ "type", "name", "range"
"Gov", "Despotism", "Player"
}
[effect_martial_law_each_2]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
}
[effect_martial_law_each_3]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 2
reqs =
{ "type", "name", "range"
"Gov", "Communism", "Player"
{ "type", "name", "range"
"Gov", "Communism", "Player"
}
[effect_martial_law_max_0]
data/sandbox/effects.ruleset
}
[effect_martial_law_each_anarchy]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Anarchy", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Anarchy", "Player", TRUE
}
[effect_martial_law_each_despotism]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Despotism", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Despotism", "Player", TRUE
}
[effect_martial_law_each_monarchy]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Monarchy", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Monarchy", "Player", TRUE
}
[effect_martial_law_each_communism]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 2
reqs =
{ "type", "name", "range", "quiet"
"Gov", "Communism", "Player", TRUE
{ "type", "name", "range", "quiet"
"Gov", "Communism", "Player", TRUE
}
[effect_martial_law_max]
data/webperimental/effects.ruleset
}
[effect_martial_law_each_0]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
{ "type", "name", "range"
"Gov", "Anarchy", "Player"
}
[effect_martial_law_each_1]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Despotism", "Player"
{ "type", "name", "range"
"Gov", "Despotism", "Player"
}
[effect_martial_law_each_2]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 1
reqs =
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
{ "type", "name", "range"
"Gov", "Monarchy", "Player"
}
[effect_martial_law_each_3]
type = "Martial_Law_Each"
type = "Martial_Law_By_Unit"
value = 2
reqs =
{ "type", "name", "range"
"Gov", "Communism", "Player"
{ "type", "name", "range"
"Gov", "Communism", "Player"
}
[effect_martial_law_max_0]
doc/README.effects
Requirements evaluated against tile or city not supported.
Default value: 100%
Martial_Law_Each
Martial_Law_By_Unit
The amount of citizens pacified by each military unit giving martial law.
Martial_Law_Max
The maximum amount of units that will give martial law in city.
The maximum amount of units that will give martial law in the city.
Max_Rates
The maximum setting for each tax rate is amount.
gen_headers/enums/effects_enums.def
EMPIRE_SIZE_BASE "Empire_Size_Base"
EMPIRE_SIZE_STEP "Empire_Size_Step"
MAX_RATES "Max_Rates"
MARTIAL_LAW_EACH "Martial_Law_Each"
MARTIAL_LAW_BY_UNIT "Martial_Law_By_Unit"
MARTIAL_LAW_MAX "Martial_Law_Max"
RAPTURE_GROW "Rapture_Grow"
REVOLUTION_UNHAPPINESS "Revolution_Unhappiness"
server/ruleset/rscompat.c
return old_name;
}
/**********************************************************************//**
Convert 3.2 effect name to a 3.3 one.
**************************************************************************/
const char *rscompat_effect_name_3_3(const char *old_name)
{
if (!fc_strcasecmp("Martial_Law_Each", old_name)) {
return "Martial_Law_By_Unit";
}
return old_name;
}
/**********************************************************************//**
Tell 3.2 blocked_by name matching 3.3 one
**************************************************************************/
server/ruleset/rscompat.h
/* Functions specific to 3.2 -> 3.3 transition */
const char *rscompat_utype_flag_name_3_3(const char *old_name);
const char *rscompat_universal_name_3_3(const char *old_name);
const char *rscompat_effect_name_3_3(const char *old_name);
const char *blocked_by_old_name_3_3(const char *new_name);
const char *ui_name_old_name_3_3(const char *new_name);
server/ruleset/ruleload.c
break;
}
if (compat->compat_mode && compat->version < RSFORMAT_3_3) {
type = rscompat_effect_name_3_3(type);
}
eff = effect_type_by_name(type, fc_strcasecmp);
if (!effect_type_is_valid(eff)) {
ruleset_error(NULL, LOG_ERROR,
    (1-1/1)