Guest User

Untitled

a guest
May 10th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. iBonusPerTurn = 1
  2.  
  3. function raiseCityStateInfluence( player )
  4. local pPlayer = Players[player]
  5. local influence = 0
  6. if pPlayer:IsEverAlive() and pPlayer:IsAlive() then
  7. print("Turn started for ",pPlayer:GetCivilizationShortDescription())
  8. if pPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_ALTEA"] then
  9. iTeam=pPlayer:GetTeam()
  10. pTeam=Teams[iTeam]
  11. atPeace=true
  12. for iOtherTeam, pOtherTeam in pairs(Teams) do
  13. if pTeam:IsAtWar(iOtherTeam) and iOtherTeam~=63 then
  14. atPeace=false end --Exclude 63 because that is Barbarians!
  15. end
  16. if (not atPeace) then
  17. print("--Archanea is at war. Influence will not be raised.")
  18. end
  19. if atPeace then
  20. print("--raising influence with protected city-states")
  21. for iLoop = GameDefines.MAX_MAJOR_CIVS, GameDefines.MAX_CIV_PLAYERS-1, 1 do
  22. pMinorCiv=Players[iLoop]
  23. if pMinorCiv:IsEverAlive() and pMinorCiv:IsAlive() then
  24. if pPlayer:IsProtectingMinor(iLoop) then
  25. influence=pMinorCiv:GetMinorCivFriendshipWithMajor(pPlayer)
  26. if influence < 65 then
  27. print("--",pMinorCiv:GetCivilizationShortDescription())
  28. pMinorCiv:ChangeMinorCivFriendshipWithMajor(player,iBonusPerTurn)
  29. end
  30. end
  31. end
  32. end
  33. end
  34. end
  35. end
  36. end
  37.  
  38. GameEvents.PlayerDoTurn.Add(raiseCityStateInfluence)
Add Comment
Please, Sign In to add comment