How does one decrease war weariness for a team?
This will be shorter then the last one. We look at CvTeam and there into doWarWeariness, which is called during the turn roll:
We iterate across all teams and check if we have war weariness towards that team. If there is war weariness we first call changeWarWeariness with 100 * WW_DECAY_RATE (-1). Or in short the war weariness toward every single team decreases by 100 every turn.
Next we check:
- If that team is not alive or
- if we are not at war with that team or
- if the game option "Always war" is active or
- if the game option "Permanent war or peace" is active
if any of those is true, we set the war weariness to
current war weariness * WW_DECAY_PEACE_PERCENT (99 for BtS, 90 for CtH and RtR) / 100.
And that's it. Let's take some examples
Example a)
War Weariness towards A = 280
War against A
Total War Weariness = 280
War Weariness towards A next turn = 280 - 100 = 180
Total War Weariness next turn 180
Example b)
War Weariness towards A = 280
War Weariness towards B = 400
War Weariness towards C = 2800
War against A
Total War Weariness = 3480
War Weariness towards A next turn = 280 - 100 = 180
War Weariness towards B next turn = (400 - 100) * 99 / 100 = 297
War Weariness towards C next turn = (2800 - 100) * 99 / 100 = 2673
Total war weariness next turn 3150
War Weariness towards A next turn for CtH and RtR = 280 - 100 = 180
War Weariness towards B next turn for CtH and RtR = (400 - 100) * 90 / 100 = 270
War Weariness towards C next turn for CtH and RtR = (2800 - 100) * 90 / 100 = 2430
Total war weariness next turn for CtH and RtR 2880
Summary
Every turn the war weariness towards each player decreases by 100. Afterward if the player is dead, you are at peace or game options "Always war" or "Permanent war and peace" are active your war weariness towards that player is set to:
current war weariness * 99 for BtS or 90 for CtH and RtR / 100.
This will be shorter then the last one. We look at CvTeam and there into doWarWeariness, which is called during the turn roll:
Code:
void CvTeam::doWarWeariness()
{
int iI;
for (iI = 0; iI < MAX_TEAMS; iI++)
{
if (getWarWeariness((TeamTypes)iI) > 0)
{
changeWarWeariness(((TeamTypes)iI), 100 * GC.getDefineINT("WW_DECAY_RATE"));
if (!(GET_TEAM((TeamTypes)iI).isAlive()) || !isAtWar((TeamTypes)iI) || GC.getGameINLINE().isOption(GAMEOPTION_ALWAYS_WAR) || GC.getGameINLINE().isOption(GAMEOPTION_NO_CHANGING_WAR_PEACE))
{
setWarWeariness(((TeamTypes)iI), ((getWarWeariness((TeamTypes)iI) * GC.getDefineINT("WW_DECAY_PEACE_PERCENT")) / 100));
}
}
}
}
We iterate across all teams and check if we have war weariness towards that team. If there is war weariness we first call changeWarWeariness with 100 * WW_DECAY_RATE (-1). Or in short the war weariness toward every single team decreases by 100 every turn.
Next we check:
- If that team is not alive or
- if we are not at war with that team or
- if the game option "Always war" is active or
- if the game option "Permanent war or peace" is active
if any of those is true, we set the war weariness to
current war weariness * WW_DECAY_PEACE_PERCENT (99 for BtS, 90 for CtH and RtR) / 100.
And that's it. Let's take some examples
Example a)
War Weariness towards A = 280
War against A
Total War Weariness = 280
War Weariness towards A next turn = 280 - 100 = 180
Total War Weariness next turn 180
Example b)
War Weariness towards A = 280
War Weariness towards B = 400
War Weariness towards C = 2800
War against A
Total War Weariness = 3480
War Weariness towards A next turn = 280 - 100 = 180
War Weariness towards B next turn = (400 - 100) * 99 / 100 = 297
War Weariness towards C next turn = (2800 - 100) * 99 / 100 = 2673
Total war weariness next turn 3150
War Weariness towards A next turn for CtH and RtR = 280 - 100 = 180
War Weariness towards B next turn for CtH and RtR = (400 - 100) * 90 / 100 = 270
War Weariness towards C next turn for CtH and RtR = (2800 - 100) * 90 / 100 = 2430
Total war weariness next turn for CtH and RtR 2880
Summary
Every turn the war weariness towards each player decreases by 100. Afterward if the player is dead, you are at peace or game options "Always war" or "Permanent war and peace" are active your war weariness towards that player is set to:
current war weariness * 99 for BtS or 90 for CtH and RtR / 100.
Mods: RtR CtH
Pitboss: PB39, PB40, PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer
Buy me a coffee
Pitboss: PB39, PB40, PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer
Buy me a coffee