Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local AncientMod = RegisterMod("Ancient Manuscripts", 1)
- local game = Game()
- local Ancient_Anim = Isaac.GetCostumeIdByPath("gfx/characters/monuscript.anm2")
- local MIN_FIRE_DELAY = 3
- CollectibleType.COLLECTIBLE_ANCIENT_ITEM = Isaac.GetItemIdByName("Ancient Manuscripts")
- local AncientStats = {
- AnStatDm = 2,
- AnStatFr = 2,
- AnStatSh = 0.3,
- AnStatSp = 0.4
- }
- --
- --main function
- function AncientMod:cacheUpdate(player, cacheFlag)
- player = Isaac.GetPlayer(0)
- --costume
- if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
- if HasAncient ~= true then
- player:AddNullCostume(Ancient_Anim)
- HasAncient = true
- end
- elseif HasAncient == true and player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) == false then
- player:TryRemoveNullCostume(Ancient_Anim)
- HasAncient = false
- end
- if cacheFlag == CacheFlag.CACHE_DAMAGE then
- if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
- player.Damage = player.Damage + AncientStats.AnStatDm
- end
- end
- if cacheFlag == CacheFlag.CACHE_DAMAGE then
- if player.MaxFireDelay > MIN_FIRE_DELAY then
- local TearBonus = math.min(AncientStats.AnStatFr * player:GetCollectibleNum(CollectibleType.COLLECTIBLE_ANCIENT_ITEM), player.MaxFireDelay - MIN_FIRE_DELAY)
- player.MaxFireDelay = player.MaxFireDelay - TearBonus
- end
- end
- if cacheFlag == CacheFlag.CACHE_SHOTSPEED then
- if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
- player.ShotSpeed = player.ShotSpeed + AncientStats.AnStatSh
- end
- end
- if cacheFlag == CacheFlag.CACHE_SPEED then
- if player:HasCollectible(CollectibleType.COLLECTIBLE_ANCIENT_ITEM) then
- player.MoveSpeed = player.MoveSpeed + AncientStats.AnStatSp
- end
- end
- end
- AncientMod:AddCallback( ModCallbacks.MC_EVALUATE_CACHE, AncientMod.cacheUpdate)
Advertisement
Add Comment
Please, Sign In to add comment