Advertisement
Guest User

Untitled

a guest
Dec 8th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. --characters.lua
  2. --v1.1.0
  3. --Created by Horikawa Otane, 2015
  4.  
  5. local horikawaTools = loadSharedAPI("horikawaTools")
  6.  
  7. local characters = {}
  8.  
  9. local playerCharacters = {}
  10. playerCharacters[1] = "mario"
  11. playerCharacters[2] = "luigi"
  12. playerCharacters[3] = "peach"
  13. playerCharacters[4] = "toad"
  14. playerCharacters[5] = "link"
  15.  
  16. local intIds = {}
  17. intIds["mario"] = 1
  18. intIds["luigi"] = 2
  19. intIds["peach"] = 3
  20. intIds["toad"] = 4
  21. intIds["link"] = 5
  22.  
  23. local playerCharacters = {"mario", "luigi", "peach", "toad", "link"}
  24.  
  25.  
  26. local function resetCharacter(characterId, powerupId)
  27.     local i, j
  28.     loadHitboxes(characterId, powerupId, Misc.resolveFile("character_defaults\\" .. playerCharacters[characterId] .. "-" .. tostring(powerupId) .. ".ini"))
  29. end
  30.  
  31. local function loadAllHitBoxes()
  32.     for _, butts in pairs(playerCharacters) do
  33.         for i = 1, 7, 1 do
  34.             local theIniFile = Misc.resolveFile(butts .. "-" .. i .. ".ini")
  35.             if  theIniFile ~= nil then
  36.                 loadHitboxes(intIds[butts], i, theIniFile)
  37.             else
  38.                 resetCharacter(intIds[butts], i)
  39.             end
  40.         end
  41.     end
  42. end
  43.  
  44. function characters.onInitAPI()
  45.     loadAllHitBoxes()
  46. end
  47.  
  48. return characters
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement