Advertisement
Guest User

Untitled

a guest
Apr 15th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. function GetVietnameseGreatPeopleRate(city)
  2.     local greatPeopleRate = 0
  3.     if city:IsHasBuilding(GameInfoTypes["BUILDING_WALLS"]) then
  4.         greatPeopleRate = greatPeopleRate + 10
  5.     end
  6.    
  7.     if city:IsHasBuilding(GameInfoTypes["BUILDING_CASTLE"]) then
  8.         greatPeopleRate = greatPeopleRate + 10
  9.     end
  10.    
  11.     if city:IsHasBuilding(GameInfoTypes["BUILDING_ARSENAL"]) then
  12.         greatPeopleRate = greatPeopleRate + 10
  13.     end
  14.    
  15.     if city:IsHasBuilding(GameInfoTypes["BUILDING_MILITARY_BASE"]) then
  16.         greatPeopleRate = greatPeopleRate + 10
  17.     end
  18.    
  19.     return greatPeopleRate
  20. end
  21.  
  22. function VietnameseGreatArtists(playerID)
  23.     local player = Players[playerID]
  24.     if player:IsAlive() and player:GetCivilizationType() == GameInfoTypes["CIVILIZATION_VIETNAM"] then
  25.         for city in player:Cities() do
  26.             local greatPeopleRate = GetVietnameseGreatPeopleRate(city) * 100
  27.             if greatPeopleRate > 0 then
  28.                 city:ChangeSpecialistGreatPersonProgressTimes100(GameInfoTypes["SPECIALIST_ARTIST"], greatPeopleRate)
  29.                 city:ChangeSpecialistGreatPersonProgressTimes100(GameInfoTypes["SPECIALIST_MUSICIAN"], greatPeopleRate)
  30.                 city:ChangeSpecialistGreatPersonProgressTimes100(GameInfoTypes["SPECIALIST_WRITIER"], greatPeopleRate)
  31.             end
  32.         end
  33.     end
  34. end
  35. GameEvents.PlayerDoTurn.Add(VietnameseGreatArtists)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement