Skip to content

Commit

Permalink
v0.86:
Browse files Browse the repository at this point in the history
* Human civs get a 5% bonus vs. barbarians on Monarch, Emperor and Immortal (now the same as on Prince). (change 313)
* The "Show ... Moves" options no longer show when a unit moves through a visible tile but starts and ends the turn in invisible tiles. (v0.85 had started to show such moves, but couldn't "catch" the moving unit, showing only the empty traversed tile, which was confusing.)
* Minor bug fixed in change 004r. Messages about revealed resources had sometimes been giving away the names of unrevealed cities.
* Can no longer spread religions and corporations during disorder. (change 099d)
* Impact of religion on revolt probability reduced. (change 099c)
* When a master asks its capitulated vassal to stop trading with a rival, that embargo no longer cancels trades between the master and the rival, and the rival doesn't stop talking to the master. This an exception to change 130f. The only negative consequence for the master is the "you negotiated a trade embargo" diplo penalty - as in BtS. Unlike in BtS, capitulated vassals agree to such embargoes without compensation.
* Capitulated vassals again (as in v0.84) share their master's attitude toward rivals, but are at best Cautious. Always Cautious regardless of master attitude (v0.85) meant that vassals would often have Open Borders with their master's worst enemies - bad idea. (change 130v)
* AI raze evaluation adjusted; AI had been too willing to raze when in financial trouble. (change 116)
* Impact of rank-based diplo reduced in the early game: No "You're getting ahead of us" penalty when the difference in score is less than 25 points. (change 130c)
It's still too fickle; should really be based on score entirely and not on rank.
* UWAI no longer plans war while there is a peace treaty resulting from received tribute. Once the peace treaty ends, the AI remains reluctant to plan war for (on average) 10 turns. More specifically, the (human) civ that payed tribute is treated as if the AI attitude was Pleased. These changes should make a DoW shortly after receiving tribute unlikely. (change 130o)
* Fixed a bug in UWAI that had caused success from past wars to be ignored. Should now work and (to an extent) discourage repeated unsuccessful wars against the same target.
* Reduced AI tendency to dogpile on humans that appear to be on the ropes, and reduced AI tendency for dogpile wars a bit overall.
* Reduced the time that arrogant demands are remembered from 80 to 30. Should've been 30 since v0.80, and that's what the manual said too. (change 130r/130o)
* AI now charges at least as much for starting a war as for stopping trade. In the previous (UWAI) versions, war was sometimes cheaper than an embargo.
Embargo now a bit cheaper if Pleased or Friendly with the civ that asks for it.
(change 130f/104o)
* Increased the lower bound for the trade value that the AI assigns to starting a war at the request of another civ. In the previous versions, the AI was sometimes willing to start wars for very little compensation when already in a war and losing badly.
* Trade value for starting a war now also based on the utility of war against the sponsor. This is to account for the peace treaty between the hired civ and the sponsor (change 146).
* The AI can no longer be hired for war against a target that is farther away than a current war enemy, unless the new enemy is already at war with the human player. This should reduce the number of messages generated by the "War Trades" alert (change 210a).
* Two related changes: In BtS peace negotiations, it's principally possible to hire the AI for war or to propose an embargo. However, the AI practically always refuses on account of attitude, which makes it pointless to show these items on the trade screen. So, I'm removing war trades from the trade screen when negotiating peace, but I'm keeping the embargoes, and the AI agrees to them regardless of attitude. Attitude still factors into the trade value that the AI assigns to an embargo. (changes 100 and 130f)
* Disabled change dlph.10 (civ forced to abandon its state religion when no longer controlling a city with that religion). Actually, it never even worked because I had forgotten to merge a line from DarkLunaPhantom's mod.
  • Loading branch information
f1rpo committed Jul 9, 2017
1 parent c01c07e commit 4c92031
Show file tree
Hide file tree
Showing 27 changed files with 343 additions and 153 deletions.
Binary file modified Assets/CvGameCoreDLL.dll
Binary file not shown.
104 changes: 52 additions & 52 deletions Assets/xml/Civilizations/CIV4LeaderHeadInfos.xml

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions Assets/xml/GameInfo/CIV4HandicapInfo.xml
Expand Up @@ -576,7 +576,8 @@
<iBarbarianCityCreationTurnsElapsed>30</iBarbarianCityCreationTurnsElapsed>
<iBarbarianCityCreationProb>7</iBarbarianCityCreationProb>
<iAnimalBonus>-20</iAnimalBonus>
<iBarbarianBonus>0</iBarbarianBonus>
<!-- advc.313: was 0 -->
<iBarbarianBonus>-5</iBarbarianBonus>
<iAIAnimalBonus>-40</iAIAnimalBonus>
<iAIBarbarianBonus>-25</iAIBarbarianBonus>
<iStartingDefenseUnits>0</iStartingDefenseUnits>
Expand Down Expand Up @@ -691,7 +692,8 @@
<iBarbarianCityCreationTurnsElapsed>25</iBarbarianCityCreationTurnsElapsed>
<iBarbarianCityCreationProb>7</iBarbarianCityCreationProb>
<iAnimalBonus>-10</iAnimalBonus>
<iBarbarianBonus>0</iBarbarianBonus>
<!-- advc.313: was 0 -->
<iBarbarianBonus>-5</iBarbarianBonus>
<iAIAnimalBonus>-40</iAIAnimalBonus>
<iAIBarbarianBonus>-25</iAIBarbarianBonus>
<iStartingDefenseUnits>0</iStartingDefenseUnits>
Expand Down Expand Up @@ -810,7 +812,8 @@
<iBarbarianCityCreationTurnsElapsed>20</iBarbarianCityCreationTurnsElapsed>
<iBarbarianCityCreationProb>8</iBarbarianCityCreationProb>
<iAnimalBonus>-5</iAnimalBonus>
<iBarbarianBonus>0</iBarbarianBonus>
<!-- advc.313: was 0 -->
<iBarbarianBonus>-5</iBarbarianBonus>
<iAIAnimalBonus>-40</iAIAnimalBonus>
<iAIBarbarianBonus>-25</iAIBarbarianBonus>
<iStartingDefenseUnits>0</iStartingDefenseUnits>
Expand Down
2 changes: 1 addition & 1 deletion Assets/xml/GameInfo/CIV4Hints.xml
Expand Up @@ -525,7 +525,7 @@
<Description>TXT_KEY_KMOD_HINT_15</Description>
</HintInfo>
<!-- These have been replaced or updated; should receive higher
probability too -->
probability too. -->
<HintInfo>
<Description>TXT_KEY_HINT_INTERFACE_1</Description>
</HintInfo>
Expand Down
32 changes: 26 additions & 6 deletions Assets/xml/GlobalDefines_advc.xml
Expand Up @@ -86,16 +86,36 @@
<iDefineIntVal>300</iDefineIntVal>
</Define>

<!-- [advc.101]
Not a new parameter. Value increased to 200
(recommended) in an effort to restore the original BtS revolt
probabilities without undoing K-Mod's overhaul of the culture system.
This essentially doubles the strength of foreign culture.
Original value (in GlobalDefines.xml): 100. -->
<!-- These three are from the original GlobalDefines.
[advc.101] Value increased to 200 (recommended) in an effort to
restore the original BtS revolt probabilities without undoing K-Mod's
overhaul of the culture system. This essentially doubles the strength
of foreign culture. Original value: 100. -->
<Define>
<DefineName>REVOLT_TOTAL_CULTURE_MODIFIER</DefineName>
<iDefineIntVal>200</iDefineIntVal>
</Define>
<!-- [advc.099c] Was 100, meaning that foreign culture strength is doubled
if the foreign state religion is in the city. Now also applies when the
owner of the foreign culture is eliminated and there is a "suppressed"
religion in the city, i.e. a religion that differs from the city owner's
state religion (no suppression if no state religion).
Recommended: 50 b/c doubling is a bit much. -->
<Define>
<DefineName>REVOLT_OFFENSE_STATE_RELIGION_MODIFIER</DefineName>
<iDefineIntVal>50</iDefineIntVal>
</Define>
<!-- Applies when the city owner's state religion is present in the city,
and applies half if the owner has no state religion. Was combined
multiplicatively with the OFFENSE_MODIFIER above in such a way
that the modifiers canceled out when both applied. Now combined
additively, meaning that they still cancel out b/c I've reduced the
OFFENSE_MODIFIER. The DEFENSE_MODIFIER remains -50. -->
<Define>
<DefineName>REVOLT_DEFENSE_STATE_RELIGION_MODIFIER</DefineName>
<iDefineIntVal>-50</iDefineIntVal>
</Define>

<!-- [advc.102]
If set to 0, the moves of friendly civs' workers are not shown to the
Expand Down
6 changes: 4 additions & 2 deletions Assets/xml/Text/CIV4DiplomacyText.xml
Expand Up @@ -3650,11 +3650,13 @@
<Italian>Mi spiace, ma sei troppo insistente.</Italian>
<Spanish>Lo sentimos, pero nos presion&#225;is demasiado.</Spanish>
</TEXT>
<!-- [advc.004g] The German translation of answer 1 was stating that the
demand is NOT accepted. -->
<TEXT>
<Tag>AI_DIPLO_ACCEPT_DEMAND_1</Tag>
<English>We accede to your unreasonable demands.</English>
<French>Nous acc&#233;dons &#224; vos requ&#234;tes exag&#233;r&#233;es.</French>
<German>Wir lassen uns nicht auf Eure unversch&#228;mten Forderungen ein!</German>
<German>Unversch&#228;mtheit! Aber wir geben nach.</German>
<Italian>Accettiamo le tue insensate richieste.</Italian>
<Spanish>No podemos acceder a vuestras exigencias tan poco razonables.</Spanish>
</TEXT>
Expand Down Expand Up @@ -3684,7 +3686,7 @@
</TEXT>
<TEXT>
<Tag>AI_DIPLO_ACCEPT_DEMAND_5</Tag>
<English>Sure: kick a civilisation when it's down. I accept your terms.</English>
<English>Sure: kick a civilization when it's down. I accept your terms.</English>
<French>Vous pi&#233;tinez une civilisation qui est d&#233;j&#224; &#224; terre ? Soit, j'accepte vos conditions.</French>
<German>Sicher, tretet ruhig noch nach, wenn der andere am Boden liegt! Ich akzeptiere Eure Bedingungen!</German>
<Italian>Sono d'accordo, infierire su una civilt&#224; in ginocchio. Accetto le vostre condizioni.</Italian>
Expand Down
8 changes: 4 additions & 4 deletions Assets/xml/Text/CIV4GameText_advc.xml
Expand Up @@ -1464,11 +1464,11 @@
Civ4lerts Options.xml -->
<TEXT>
<Tag>TXT_KEY_BUG_OPT_CIV4LERTS__WARTRADE_HOVER</Tag>
<English>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war on your request.</English>
<French>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war on your request.</French>
<English>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war at your request.</English>
<French>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war at your request.</French>
<German>Mitteilung, wenn ein KI-Gegner bereit (oder nicht mehr bereit) ist, einem anderen Gegner auf Ihren Wunsch den Krieg zu erklären.</German>
<Italian>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war on your request.</Italian>
<Spanish>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war on your request.</Spanish>
<Italian>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war at your request.</Italian>
<Spanish>Displays an alert whenever an AI leader becomes (or stops being) willing to start a war at your request.</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_CIV4LERTS_TRADE_WAR</Tag>
Expand Down
5 changes: 3 additions & 2 deletions CvGameCoreDLL/AdvCiv4lerts.cpp
Expand Up @@ -81,8 +81,9 @@ void WarTradeAlert::check() {
msg(gDLL->getText("TXT_KEY_CIV4LERTS_TRADE_WAR",
warTeam.getName().GetCString(),
victim.getName().GetCString()));
// Obviously can't hire warTeam if it has already declared war
else if(!warTeam.isAtWar(victim.getID()))
/* Obviously can't hire warTeam if it has already declared war
or if victim has been eliminated. */
else if(victim.isAlive() && !warTeam.isAtWar(victim.getID()))
msg(gDLL->getText("TXT_KEY_CIV4LERTS_NO_LONGER_TRADE_WAR",
warTeam.getName().GetCString(),
victim.getName().GetCString()));
Expand Down
11 changes: 7 additions & 4 deletions CvGameCoreDLL/CvCity.cpp
Expand Up @@ -5302,17 +5302,20 @@ int CvCity::cultureStrength(PlayerTypes ePlayer) const
} // <advc.003>
ReligionTypes ownerReligion = owner.getStateReligion();
if(ownerReligion != NO_RELIGION && isHasReligion(ownerReligion)) { // </advc.003>
/* <advc.101> Replacing the code below. Division by 50 so that it
cancels out the OFFENSE modifier (no functional change). */
grievanceModifier += GC.getDefineINT("REVOLT_DEFENSE_STATE_RELIGION_MODIFIER") / 50.0;
/* <advc.099c> Replacing the code below. The OFFENSE modifier
was originally set to 100 in XML and DEFENSE to -50, and they were
cancelling out when both applied (multiplication by 100+100 and then
by 100-50). I'm changing the values in XML so that they cancel out
when added up. */
grievanceModifier += GC.getDefineINT("REVOLT_DEFENSE_STATE_RELIGION_MODIFIER") / 100.0;
//iStrength *= std::max(0, (GC.getDefineINT("REVOLT_DEFENSE_STATE_RELIGION_MODIFIER") + 100));
//iStrength /= 100;
} /* No state religion is still better than some oppressive state religion that
the city doesn't share. */
if(ownerReligion == NO_RELIGION) {
grievanceModifier += GC.getDefineINT("REVOLT_DEFENSE_STATE_RELIGION_MODIFIER")
/ 100.0;
} // <advc.101>
} // <advc.099c>
if(getHurryAngerTimer() > 0)
grievanceModifier += 0.5;
// <advc.099c>
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL/CvCityAI.cpp
Expand Up @@ -12096,7 +12096,7 @@ int CvCityAI::AI_playerCloseness(PlayerTypes eIndex, int iMaxDistance)
return m_aiPlayerCloseness[eIndex];
}

// K-Mod
// K-Mod // advc.003 (comment): unused function
int CvCityAI::AI_highestTeamCloseness(TeamTypes eTeam)
{
int iCloseness = -1;
Expand Down
7 changes: 4 additions & 3 deletions CvGameCoreDLL/CvDeal.cpp
Expand Up @@ -934,11 +934,12 @@ bool CvDeal::startTrade(TradeData trade, PlayerTypes eFromPlayer, PlayerTypes eT

case TRADE_EMBARGO:
GET_PLAYER(eFromPlayer).stopTradingWithTeam((TeamTypes)trade.m_iData);
/* advc.130f: The instigator needs to stop too. (If an AI suggested
/* <advc.130f> The instigator needs to stop too. (If an AI suggested
the embargo to a human, that's not handled here but by
CvPlayer::handleDiploEvent.) */
GET_PLAYER(eToPlayer).stopTradingWithTeam((TeamTypes)trade.m_iData, false);

if(!TEAMREF(eFromPlayer).isCapitulated() || !TEAMREF(eFromPlayer).isVassal(TEAMID(eToPlayer)))
GET_PLAYER(eToPlayer).stopTradingWithTeam((TeamTypes)trade.m_iData, false);
// </advc,130f>
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
Expand Down
7 changes: 5 additions & 2 deletions CvGameCoreDLL/CvMap.cpp
Expand Up @@ -770,7 +770,8 @@ CvPlot* CvMap::syncRandPlot(int iFlags, int iArea, int iMinUnitDistance, int iTi
}


CvCity* CvMap::findCity(int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, bool bSameArea, bool bCoastalOnly, TeamTypes eTeamAtWarWith, DirectionTypes eDirection, CvCity* pSkipCity)
CvCity* CvMap::findCity(int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, bool bSameArea, bool bCoastalOnly, TeamTypes eTeamAtWarWith, DirectionTypes eDirection, CvCity* pSkipCity,
TeamTypes observer) // advc.004r
{
PROFILE_FUNC();

Expand All @@ -795,7 +796,9 @@ CvCity* CvMap::findCity(int iX, int iY, PlayerTypes eOwner, TeamTypes eTeam, boo
if ((eTeam == NO_TEAM) || (GET_PLAYER((PlayerTypes)iI).getTeam() == eTeam))
{
for (pLoopCity = GET_PLAYER((PlayerTypes)iI).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER((PlayerTypes)iI).nextCity(&iLoop))
{
{ // <advc.004r>
if(observer != NO_TEAM && !pLoopCity->isRevealed(observer))
continue; // </advc.004r>
if (!bSameArea || (pLoopCity->area() == plotINLINE(iX, iY)->area()) || (bCoastalOnly && (pLoopCity->waterArea() == plotINLINE(iX, iY)->area())))
{
if (!bCoastalOnly || pLoopCity->isCoastal())
Expand Down
3 changes: 2 additions & 1 deletion CvGameCoreDLL/CvMap.h
Expand Up @@ -119,7 +119,8 @@ class CvMap
// advc.304:
int* legalCount = NULL);

DllExport CvCity* findCity(int iX, int iY, PlayerTypes eOwner = NO_PLAYER, TeamTypes eTeam = NO_TEAM, bool bSameArea = true, bool bCoastalOnly = false, TeamTypes eTeamAtWarWith = NO_TEAM, DirectionTypes eDirection = NO_DIRECTION, CvCity* pSkipCity = NULL); // Exposed to Python
DllExport CvCity* findCity(int iX, int iY, PlayerTypes eOwner = NO_PLAYER, TeamTypes eTeam = NO_TEAM, bool bSameArea = true, bool bCoastalOnly = false, TeamTypes eTeamAtWarWith = NO_TEAM, DirectionTypes eDirection = NO_DIRECTION, CvCity* pSkipCity = NULL,
TeamTypes observer = NO_TEAM); // advc.004r // Exposed to Python
DllExport CvSelectionGroup* findSelectionGroup(int iX, int iY, PlayerTypes eOwner = NO_PLAYER, bool bReadyToSelect = false, bool bWorkers = false); // Exposed to Python

CvArea* findBiggestArea(bool bWater); // Exposed to Python
Expand Down
24 changes: 18 additions & 6 deletions CvGameCoreDLL/CvPlayer.cpp
Expand Up @@ -3561,7 +3561,7 @@ void CvPlayer::doTurn()
}

verifyCivics();

//verifyStateReligion(); // dlph.10: disabled for now
updateTradeRoutes();

updateWarWearinessPercentAnger();
Expand Down Expand Up @@ -4627,6 +4627,11 @@ void CvPlayer::handleDiploEvent(DiploEventTypes eDiploEvent, PlayerTypes ePlayer
case DIPLOEVENT_ACCEPT_DEMAND:
// advc.130j:
GET_PLAYER(getID()).AI_rememberEvent(ePlayer, MEMORY_ACCEPT_DEMAND);
/* advc.130o, advc.104: So that the AI can tell if a demand was
_recently_ accepted. Don't call AI_rememberEvent b/c I want only
a "half" memory (for 10 turns instead of 20). */
GET_PLAYER(ePlayer).AI_changeMemoryCount(getID(),
MEMORY_MADE_DEMAND_RECENT, 1);
/* advc.003 (comment): This event (and its counterpart REJECTED_DEMAND)
is only triggered when a human accepts an AI demand. When a human
demands sth., DIPLOEVENT_MADE_DEMAND triggers (and that one doesn't
Expand Down Expand Up @@ -4736,8 +4741,9 @@ void CvPlayer::handleDiploEvent(DiploEventTypes eDiploEvent, PlayerTypes ePlayer
// advc.130j:
GET_PLAYER(getID()).AI_rememberEvent(ePlayer, MEMORY_ACCEPTED_STOP_TRADING);
GET_PLAYER(ePlayer).stopTradingWithTeam((TeamTypes)iData1);
// advc.130f: We also stop trading
stopTradingWithTeam((TeamTypes)iData1, false);
// <advc.130f> We also stop trading (unless ePlayer is our capitulated vassal)
if(!TEAMREF(ePlayer).isCapitulated() || !TEAMREF(ePlayer).isVassal(getTeam()))
stopTradingWithTeam((TeamTypes)iData1, false); // </advc.130f>
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
Expand Down Expand Up @@ -5072,7 +5078,9 @@ bool CvPlayer::canTradeItem(PlayerTypes eWhoTo, TradeData item, bool bTestDenial
{
if (GET_TEAM(getTeam()).canDeclareWar((TeamTypes)(item.m_iData)))
{
return true;
//return true;
// advc.100: Replacing the line above
return !GET_TEAM(getTeam()).isAtWar(TEAMID(eWhoTo));
}
}
}
Expand All @@ -5087,8 +5095,12 @@ bool CvPlayer::canTradeItem(PlayerTypes eWhoTo, TradeData item, bool bTestDenial
if (GET_TEAM(getTeam()).isHasMet(embargoTarget) && TEAMREF(eWhoTo).isHasMet(embargoTarget))
{
if (canStopTradingWithTeam(embargoTarget)
// advc.130f:
&& !GET_PLAYER(eWhoTo).isTradingWithTeam(embargoTarget, true)
// <advc.130f>
&& (!GET_PLAYER(eWhoTo).isTradingWithTeam(
embargoTarget, true) ||
(GET_TEAM(getTeam()).isCapitulated() &&
GET_TEAM(getTeam()).isVassal(TEAMID(eWhoTo))))
// </advc.130f>
)
{
return true;
Expand Down

0 comments on commit 4c92031

Please sign in to comment.