Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iBonusPerTurn = 1
- function raiseCityStateInfluence( player )
- local pPlayer = Players[player]
- local influence = 0
- if pPlayer:IsEverAlive() and pPlayer:IsAlive() then
- print("Turn started for ",pPlayer:GetCivilizationShortDescription())
- if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_ALTEA"] then
- iTeam=pPlayer:GetTeam()
- pTeam=Teams[iTeam]
- atPeace=true
- for iOtherTeam, pOtherTeam in pairs(Teams) do
- if pTeam:IsAtWar(iOtherTeam) and iOtherTeam~=63 then
- atPeace=false end --Exclude 63 because that is Barbarians!
- end
- if (not atPeace) then
- print("--Archanea is at war. Influence will not be raised.")
- end
- if atPeace then
- print("--raising influence with protected city-states")
- for iLoop = GameDefines.MAX_MAJOR_CIVS, GameDefines.MAX_CIV_PLAYERS-1, 1 do
- pMinorCiv=Players[iLoop]
- if pMinorCiv:IsEverAlive() and pMinorCiv:IsAlive() then
- if pPlayer:IsProtectingMinor(iLoop) then
- influence=pMinorCiv:GetMinorCivFriendshipWithMajor(pPlayer)
- if influence < 65 then
- print("--",pMinorCiv:GetCivilizationShortDescription())
- pMinorCiv:ChangeMinorCivFriendshipWithMajor(player,iBonusPerTurn)
- end
- end
- end
- end
- end
- end
- end
- end
- GameEvents.PlayerDoTurn.Add(raiseCityStateInfluence)
Add Comment
Please, Sign In to add comment