Advertisement
Guest User

Untitled

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