Josh64

trinket costume test

Dec 19th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. local Mod = RegisterMod("CustomTrinketCostumes", 1)
  2. local game = Game()
  3.  
  4. local costume = false
  5.  
  6. Mod.COSTUME_BROWN_CAP = Isaac.GetCostumeIdByPath("gfx/characters/miserere_brown_cap.anm2") -- costume
  7.  
  8. function Mod:onCostumeUpdate(player)
  9.  
  10. if player:HasTrinket(75)
  11. and not (player:GetTrinket(0) == 75)
  12. and not (player:GetTrinket(1) == 75)
  13. and costume == false then
  14.  
  15. player:AddNullCostume(Mod.COSTUME_BROWN_CAP) -- add costume
  16. costume = true
  17. else
  18. if not player:HasTrinket(75)
  19. and costume == true then
  20. Isaac.ConsoleOutput("Arrrgh")
  21. player:TryRemoveNullCostume(Mod.COSTUME_BROWN_CAP) -- remove costume
  22. costume = false
  23. end
  24. end
  25. end
  26. Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.onCostumeUpdate)
Advertisement
Add Comment
Please, Sign In to add comment