ForbodingAngel

Untitled

Jun 13th, 2015
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function widget:Initialize()
  2. myPlayerID = GetMyPlayerID()
  3. combatFilter = {}
  4. builderFilter = {}
  5. buildingFilter = {}
  6. mobileFilter = {}
  7.  
  8. for udid, udef in pairs(UnitDefs) do
  9. local mobile = (udef.canMove and udef.speed > 0.000001)
  10. local builder = (udef.canReclaim and udef.reclaimSpeed > 0) or
  11. (udef.isBuilder and udef.buildSpeed > 0) or
  12. (udef.canResurrect and udef.resurrectSpeed > 0) or
  13. (udef.canRepair and udef.repairSpeed > 0)
  14. local building = (mobile == false)
  15. local nonCombatTransport = (udef.transportCapacity > 0)
  16. local combat = (builder == false) and (nonCombatTransport == false) and (mobile == true) and (#udef.weapons > 0)
  17.  
  18. combatFilter[udid] = combat
  19. builderFilter[udid] = builder
  20. buildingFilter[udid] = building
  21. mobileFilter[udid] = mobile
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment