Josh64

Untitled

Jan 6th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. local AncientMod = RegisterMod("Ancient Manuscripts", 1)
  2. local game = Game()
  3. local Ancient_Anim = Isaac.GetCostumeIdByPath("gfx/characters/monuscript.anm2")
  4. local MIN_FIRE_DELAY = 3
  5. CollectibleType.COLLECTIBLE_ANCIENT_ITEM = Isaac.GetItemIdByName("Ancient Manuscripts")
  6.  
  7. local AncientStats = {
  8. AnStatDm = 2,
  9. AnStatFr = 2,
  10. AnStatSh = 0.3,
  11. AnStatSp = 0.4
  12. }
  13. --
  14. --main function
  15. function AncientMod:cacheUpdate(player, cacheFlag)
  16. player = Isaac.GetPlayer(0)
  17.  
  18. --costume
  19. if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
  20. if HasAncient ~= true then
  21. player:AddNullCostume(Ancient_Anim)
  22. HasAncient = true
  23. end
  24. elseif HasAncient == true and player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) == false then
  25. player:TryRemoveNullCostume(Ancient_Anim)
  26. HasAncient = false
  27. end
  28. if cacheFlag == CacheFlag.CACHE_DAMAGE then
  29. if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
  30. player.Damage = player.Damage + AncientStats.AnStatDm
  31. end
  32. end
  33. if cacheFlag == CacheFlag.CACHE_DAMAGE then
  34. if player.MaxFireDelay > MIN_FIRE_DELAY then
  35. local TearBonus = math.min(AncientStats.AnStatFr * player:GetCollectibleNum(CollectibleType.COLLECTIBLE_ANCIENT_ITEM), player.MaxFireDelay - MIN_FIRE_DELAY)
  36. player.MaxFireDelay = player.MaxFireDelay - TearBonus
  37. end
  38. end
  39. if cacheFlag == CacheFlag.CACHE_SHOTSPEED then
  40. if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
  41. player.ShotSpeed = player.ShotSpeed + AncientStats.AnStatSh
  42. end
  43. end
  44. if cacheFlag == CacheFlag.CACHE_SPEED then
  45. if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
  46. player.MoveSpeed = player.MoveSpeed + AncientStats.AnStatSp
  47. end
  48. end
  49. end
  50. AncientMod:AddCallback( ModCallbacks.MC_EVALUATE_CACHE, AncientMod.cacheUpdate)
Advertisement
Add Comment
Please, Sign In to add comment