Project

General

Profile

Feature #353 ยป 0046-Add-Culture_Pct-effect-type.patch

Marko Lindqvist, 03/24/2024 07:40 PM

View differences:

ai/default/daieffects.c
/* ...and history effect to accumulate those points for 50 turns. */
v += amount * 5;
break;
case EFT_CULTURE_PCT:
/* Assume that this multiplies accumulation of 5 history points / turn */
v += amount * 5 * 5 / 100;
break;
case EFT_TECH_COST_FACTOR:
v -= amount * 50;
break;
common/culture.c
****************************************************************************/
int city_culture(const struct city *pcity)
{
return pcity->history + get_city_bonus(pcity, EFT_PERFORMANCE);
return pcity->history
+ get_city_bonus(pcity, EFT_PERFORMANCE)
* (100 + get_city_bonus(pcity, EFT_CULTURE_PCT)) / 100;
}
/************************************************************************//**
......
int city_history_gain(const struct city *pcity)
{
return get_city_bonus(pcity, EFT_HISTORY)
* (100 + get_city_bonus(pcity, EFT_CULTURE_PCT)) / 100
+ pcity->history * game.info.history_interest_pml / 1000;
}
......
****************************************************************************/
int player_culture(const struct player *plr)
{
int culture = plr->history + get_player_bonus(plr, EFT_NATION_PERFORMANCE);
int culture = plr->history
+ get_player_bonus(plr, EFT_NATION_PERFORMANCE)
* (100 + get_player_bonus(plr, EFT_CULTURE_PCT)) / 100;
city_list_iterate(plr->cities, pcity) {
culture += city_culture(pcity);
......
int nation_history_gain(const struct player *pplayer)
{
return get_player_bonus(pplayer, EFT_NATION_HISTORY)
* (100 + get_player_bonus(pplayer, EFT_CULTURE_PCT)) / 100
+ pplayer->history * game.info.history_interest_pml / 1000;
}
doc/README.effects
Percent chance that a player conquering a city learns a tech from the
former owner.
Culture_Pct
Percent change to culture, both to current performance and to
the accumulating history.
Defend_Bonus
Increases defensive bonuses of units. Any unit requirements on this effect
will be applied to the _attacking_ unit type. Requirements about
gen_headers/enums/effects_enums.def
SURPLUS_WASTE_PCT_BY_REL_DISTANCE "Surplus_Waste_Pct_By_Rel_Distance"
TECH_LEAKAGE "Tech_Leakage"
IMPR_UPKEEP_REDUCTION "Impr_Upkeep_Reduction"
CULTURE_PCT "Culture_Pct"
USER_EFFECT_1 "User_Effect_1"
USER_EFFECT_2 "User_Effect_2"
USER_EFFECT_3 "User_Effect_3"
    (1-1/1)