def AIAttitudeAdjustment(iPlayer, iRequiredReligion, intAdjustment, bDeclareWar):
# Orion's Inquisition Mod
# Increases anger for Civs who share the religion purged.
# Friendly: 10 or above; Pleased: 3 to 9; Cautious: -2 to 2; Annoyed: -9 to -3; Furious: -10 and below
# AI Civs who share the religion purged, will declare war if Holy City or Religious Shrine is destroyed
eCivicTypeReligion = gc.getInfoTypeForString('CIVICOPTION_RELIGION')
eCivicTheocracy = gc.getInfoTypeForString('CIVIC_THEOCRACY')
CvRunTheocracyDeclaredWarMsg = False
for AIiPlayer in range(gc.getMAX_PLAYERS()):
if AIiPlayer != iPlayer:
AIpPlayer = gc.getPlayer(AIiPlayer)
if not AIpPlayer.isNone() and not AIpPlayer.isBarbarian() and not AIpPlayer.isHuman( ) and AIpPlayer.isAlive():
if AIpPlayer.getStateReligion( ) == iRequiredReligion:
PyPlayer(AIiPlayer).AI_changeAttitude( iPlayer, intAdjustment )
if bDeclareWar == 1:
# Does the AI Civ have the Theocracy Civic ***********
if AIpPlayer.getCivics(eCivicTypeReligion) == eCivicTheocracy:
AIpPlayerTeam = gc.getTeam(AIpPlayer.getTeam())
if (not AIpPlayerTeam.isAtWar(iPlayer)):
# -3 Attitude adjustments means a Holy City and/or a Shrine is being destroyed.
if intAdjustment == -3:
# Declare total war
AIpPlayerTeam.declareWar(iPlayer, false, WarPlanTypes.WARPLAN_TOTAL)
CvRunTheocracyDeclaredWarMsg = True
elif intAdjustment == -7:
# Declare Limited war
AIpPlayerTeam.declareWar(iPlayer, false, WarPlanTypes.WARPLAN_LIMITED)
if CvRunTheocracyDeclaredWarMsg:
# iPlayer is the Civ who destroyed the Holy City
# iRequiredReligion is the state religion of the Holy City
CyMessageControl().sendModNetMessage(200, iPlayer, iRequiredReligion, -1, -1)
return