Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. function AssignStartingPlots:BalanceAndAssign()
  2.  
  3. local iNumStarts = table.maxn(self.startingPlots);
  4. for region_number = 1, iNumStarts do
  5. self:NormalizeStartLocation(region_number)
  6. end
  7.  
  8. local playerList = {};
  9. for loop = 1, self.iNumCivs do
  10. local player_ID = self.player_ID_list[loop];
  11. table.insert(playerList, player_ID);
  12. end
  13. local playerListShuffled = GetShuffledCopyOfTable(playerList)
  14. for region_number, player_ID in ipairs(playerListShuffled) do
  15. local x = self.startingPlots[region_number][1];
  16. local y = self.startingPlots[region_number][2];
  17. local start_plot = Map.GetPlot(x, y)
  18. local player = Players[player_ID]
  19. player:SetStartingPlot(start_plot)
  20. end
  21.  
  22. if self.bTeamGame == true then
  23. self:NormalizeTeamLocations()
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement