Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. --// Tests binary fields battles between a player and neutral.
  2. --// Consistently sends units to feed field battle to see which side gets fed units
  3. Tests.TestFieldBattles_PlayerAndNeutral = {
  4. onGameStarted = function ()
  5. print("Running 'onGameStarted' for TestFieldBattles_PlayerAndNeutral")
  6.  
  7. local territoriesWithCapitals = mTerritories.GetTerritoriesWithCapitals();
  8.  
  9. for _, territory in pairs(territoriesWithCapitals) do
  10. mSpawning.AddForcesToTerritory(10000, territory)
  11.  
  12. local t0 = territory
  13. local t1
  14.  
  15. local adjTerritories = mTerritories.GetAdjacent(territory)
  16. for _, adjTerritory in pairs(adjTerritories) do
  17. mSpawning.AddForcesToTerritory(10000, adjTerritory)
  18. t1 = adjTerritory
  19.  
  20. break
  21. end
  22.  
  23. -- This loop makes t0 attack t1 and vice-versa every few seconds
  24. spawn(function ()
  25. while (GV.GameActive.Value == true) do
  26.  
  27. mSpawning.MoveForces(20, t0, t1)
  28.  
  29. wait(1)
  30.  
  31. mSpawning.MoveForces(20, t1, t0)
  32.  
  33. wait(2)
  34. end
  35. end)
  36. end
  37. end
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement