Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Mod:onTearFire(tear)
- local player = Isaac.GetPlayer(0) -- gets the player
- local FireDir = player:GetFireDirection() -- gets the fire direction of said player
- local MoveDir = player:GetMovementDirection() -- gets the player movement direction in the case the animation of the tear has to be adjusted
- local tearData = tear:GetData() -- stores the data of the individual tears
- local sprite = tear:GetSprite() -- requiered to change the sprite of the poop tears + animations
- local tearRNG = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
- local roll = tearRNG:RandomInt(100) -- used to decide which piercing tear animation is playing
- -- Isaac.ConsoleOutput("It works.. kinda!")
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then -- if the player has the Miserere item
- if not (tear.Variant == 4) -- its not Bob Rotten Head
- or not (tear.Variant == 9) then -- its not Chaos Card
- -- check tear variant
- if tear.Variant == TearVariant.HUNGRY -- get all tear variants which have a unique tear sprite for the poop tears
- or tear.Variant == TearVariant.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD
- or tear.Variant == TearVariant.FIRE_MIND
- or tear.Variant == TearVariant.DARK_MATTER then -- variant needs to be confirmed in the TAKE_DAMAGE callback to be able to turn enemies into poop
- -- check the fire direction to set the offset. It is for all variants the same.
- if FireDir == Direction.DOWN then
- player.TearsOffset = Vector(0,5.5) -- change the offset
- elseif FireDir == Direction.RIGHT then
- player.TearsOffset = Vector(10,5.5)
- elseif FireDir == Direction.UP then
- player.TearsOffset = Vector(0,5.5)
- elseif FireDir == Direction.LEFT then
- player.TearsOffset = Vector(-10,5.5)
- end
- -- Poop Tear Subtype
- if tearData.PoopSubType == nil then
- -- Isaac.ConsoleOutput("A new Tear!")
- -- check if the tear can be a variant
- if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
- or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
- or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
- or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
- or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
- -- get rng
- local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
- local roll = rng:RandomInt(100)
- -- will the tear be a variant
- if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
- -- which variants are possible
- local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
- if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
- table.remove(poopVariant, 5)
- end
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
- table.remove(poopVariant, 4)
- end
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
- table.remove(poopVariant, 3)
- end
- if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
- table.remove(poopVariant, 2)
- end
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
- table.remove(poopVariant, 1)
- end
- -- saftey check
- if poopVariant[1] == nil then -- somehow the poop got emptied
- tearData.PoopSubType = 0 -- a normal poop tear
- else -- should happen normaly
- local pickPoop = math.random(#poopVariant)
- if poopVariant[pickPoop] == 1 then
- tearData.PoopSubType = 1 -- Holy Poop
- elseif poopVariant[pickPoop] == 2 then
- tearData.PoopSubType = 2 -- Dank Poop
- elseif poopVariant[pickPoop] == 3 then
- tearData.PoopSubType = 3 -- Golden Poop
- elseif poopVariant[pickPoop] == 4 then
- tearData.PoopSubType = 4 -- Rainbow Poop
- elseif poopVariant[pickPoop] == 5 then
- tearData.PoopSubType = 5 -- Red Poop
- end
- end
- if tearData.PoopSubType == 1 then -- Holy Poop
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if tear.Variant == TearVariant.HUNGRY then
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_holy.png")
- sprite:LoadGraphics()
- elseif (tear.Variant == TearVariant.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD) then
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_holy.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.FIRE_MIND then
- sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_holy.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.DARK_MATTER then
- sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_holy.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 2 then -- Dank
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if tear.Variant == TearVariant.HUNGRY then
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_dank.png")
- sprite:LoadGraphics()
- elseif (tear.Variant == TearVariant.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD) then
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_dank.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.FIRE_MIND then
- sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_dank.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.DARK_MATTER then
- sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_dank.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 3 then -- Golden
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if tear.Variant == TearVariant.HUNGRY then
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_golden.png")
- sprite:LoadGraphics()
- elseif (tear.Variant == TearVariant.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD) then
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_golden.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.FIRE_MIND then
- sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_golden.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.DARK_MATTER then
- sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_golden.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 4 then -- Rainbow
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if tear.Variant == TearVariant.HUNGRY then
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_rainbow.png")
- sprite:LoadGraphics()
- elseif (tear.Variant == TearVariant.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD) then
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_rainbow.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.FIRE_MIND then
- sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_rainbow.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.DARK_MATTER then
- sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_rainbow.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 5 then -- Red
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if tear.Variant == TearVariant.HUNGRY then
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_red.png")
- sprite:LoadGraphics()
- elseif (tear.Variant == TearVariant.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD) then
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_red.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.FIRE_MIND then
- sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_red.png")
- sprite:LoadGraphics()
- elseif tear.Variant == TearVariant.DARK_MATTER then
- sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_red.png")
- sprite:LoadGraphics()
- end
- end
- end
- else
- -- else is it just a normal poop tear
- tearData.PoopSubType = 0
- end
- else
- -- else is it just a normal poop tear
- tearData.PoopSubType = 0
- end
- end
- -- adjust stuff for tearData.PoopSubType == 0
- if tearData.PoopSubType == 0 then
- if tearData.HasCostume == nil then
- if tear.Variant == TearVariant.HUNGRY then
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_petrified.png")
- sprite:LoadGraphics()
- else
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear.png")
- sprite:LoadGraphics()
- end
- elseif (tear.Variant == TearVariant.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD) then
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_petrified.png")
- sprite:LoadGraphics()
- else
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear.png")
- sprite:LoadGraphics()
- end
- elseif tear.Variant == TearVariant.FIRE_MIND then
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_petrified.png")
- sprite:LoadGraphics()
- else
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear.png")
- sprite:LoadGraphics()
- end
- elseif tear.Variant == TearVariant.DARK_MATTER then
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_petrified.png")
- sprite:LoadGraphics()
- else
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear.png")
- sprite:LoadGraphics()
- end
- end
- end
- end
- -- set stats
- if (tearData.PoopSubType == 0 -- normal
- or tearData.PoopSubType == 1 -- holy
- or tearData.PoopSubType == 2 -- dank
- or tearData.PoopSubType == 3 -- golden
- or tearData.PoopSubType == 4 -- red
- or tearData.PoopSubType == 5) -- rainbow
- and tearData.SetStats == nil then -- didn't set dmg yet
- tearData.SetStats = true
- -- set damage
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
- pooptear.STONE_BONUS = 1
- tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
- -- Isaac.ConsoleOutput("Soy DMG")
- else
- pooptear.STONE_BONUS = 1.5
- tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
- -- Isaac.ConsoleOutput("Normal DMG")
- end
- else
- tear.CollisionDamage = tear.CollisionDamage
- end
- end
- elseif tear.Variant ~= TearVariant.POOPTEAR
- and tearData.IsNotAPoopTear == nil then -- if it is not TearVariant.PoopTear, then change the variant
- tear:ChangeVariant(TearVariant.POOPTEAR)
- tearData.IsNotAPoopTear = false
- -- adjustments for the tear animation and tear offset
- if tearData.Animation == nil then
- tearData.Animation = true
- if tear.TearFlags == tear.TearFlags | TearFlags.TEAR_PIERCING then -- for piercing tears
- -- change the offset
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the difference in th offset
- or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the difference in th offset
- if FireDir == Direction.DOWN then
- player.TearsOffset = Vector(0,5.5)
- elseif FireDir == Direction.RIGHT then
- player.TearsOffset = Vector(10,5.5)
- elseif FireDir == Direction.UP then
- player.TearsOffset = Vector(0,5.5)
- elseif FireDir == Direction.LEFT then
- player.TearsOffset = Vector(-10,5.5)
- end
- end
- -- get the animation + some variaty
- if roll > 50 then
- tear:GetSprite():Play("PiercingTear1", true)
- else
- tear:GetSprite():Play("PiercingTear2", true)
- end
- else -- is not a piercing tear
- if player:HasCollectible(CollectibleType.COLLECTIBLE_CHOCOLATE_MILK) -- because of the charged shot
- or player:HasCollectible(CollectibleType.COLLECTIBLE_MONSTROS_LUNG) -- because of the charged shot
- or player:HasCollectible(CollectibleType.COLLECTIBLE_MARKED) -- sprite disappears otherwise
- or player:HasCollectible(CollectibleType.COLLECTIBLE_HAEMOLACRIA) -- sprite disappears otherwise
- or player:HasCollectible(CollectibleType.COLLECTIBLE_MYSTERIOUS_LIQUID) -- ''
- or player:HasCollectible(CollectibleType.COLLECTIBLE_LUDOVICO_TECHNIQUE) -- ''
- or player:HasCollectible(CollectibleType.COLLECTIBLE_LOKIS_HORNS) -- same sprite in all directions
- or player:HasCollectible(CollectibleType.COLLECTIBLE_MOMS_EYE) then -- same problem as with Loki's Horns
- -- change the offset
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the difference in th offset
- or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the difference in th offset
- if FireDir == Direction.DOWN then
- player.TearsOffset = Vector(0,5.5)
- elseif FireDir == Direction.RIGHT then
- player.TearsOffset = Vector(10,5.5)
- elseif FireDir == Direction.UP then
- player.TearsOffset = Vector(0,5.5)
- elseif FireDir == Direction.LEFT then
- player.TearsOffset = Vector(-10,5.5)
- end
- end
- -- change tear animation
- tear:GetSprite():Play("ChargedTear", true)
- else
- -- change the offset
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the difference in th offset
- or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the difference in th offset
- if FireDir == Direction.DOWN then
- player.TearsOffset = Vector(0,5.5)
- elseif FireDir == Direction.RIGHT then
- player.TearsOffset = Vector(10,5.5)
- elseif FireDir == Direction.UP then
- player.TearsOffset = Vector(0,5.5)
- elseif FireDir == Direction.LEFT then
- player.TearsOffset = Vector(-10,5.5)
- end
- end
- -- get the tear animation based on the player fire direction
- if FireDir == Direction.DOWN then
- tear:GetSprite():Play("ShootDown", true) -- change tear animation to the right direction
- elseif FireDir == Direction.RIGHT then
- tear:GetSprite():Play("ShootRight", true) -- change tear animation to the right direction
- elseif FireDir == Direction.UP then
- tear:GetSprite():Play("ShootUp", true) -- change tear animation to the right direction
- elseif FireDir == Direction.LEFT then
- tear:GetSprite():Play("ShootLeft", true) -- change tear animation to the right direction
- else -- no fire direction
- tear:GetSprite():Play("ChargedTear", true) -- change tear animation to the right direction
- end
- end
- end
- end
- -- Poop Tear Subtype
- if tearData.PoopSubType == nil then
- -- Isaac.ConsoleOutput("A new Tear!")
- -- check if the tear can be a variant
- if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
- or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
- or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
- or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
- or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
- -- get rng
- local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
- local roll = rng:RandomInt(100)
- -- will the tear be a variant
- if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
- -- which variants are possible
- local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
- if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
- table.remove(poopVariant, 5)
- end
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
- table.remove(poopVariant, 4)
- end
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
- table.remove(poopVariant, 3)
- end
- if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
- table.remove(poopVariant, 2)
- end
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
- table.remove(poopVariant, 1)
- end
- -- saftey check
- if poopVariant[1] == nil then -- somehow the poop got emptied
- tearData.PoopSubType = 0 -- a normal poop tear
- else -- should happen normaly
- local pickPoop = math.random(#poopVariant)
- if poopVariant[pickPoop] == 1 then
- tearData.PoopSubType = 1 -- Holy Poop
- elseif poopVariant[pickPoop] == 2 then
- tearData.PoopSubType = 2 -- Dank Poop
- elseif poopVariant[pickPoop] == 3 then
- tearData.PoopSubType = 3 -- Golden Poop
- elseif poopVariant[pickPoop] == 4 then
- tearData.PoopSubType = 4 -- Rainbow Poop
- elseif poopVariant[pickPoop] == 5 then
- tearData.PoopSubType = 5 -- Red Poop
- end
- end
- if tearData.PoopSubType == 1 then -- Holy Poop
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
- or sprite:IsPlaying("PiercingTear2") then
- -- Midas Touch gets priority
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_holy.png")
- sprite:LoadGraphics()
- -- after that comes petrified poop
- elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_holy.png")
- sprite:LoadGraphics()
- else -- normal piercing tears
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_holy.png")
- sprite:LoadGraphics()
- end
- elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
- sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_holy.png")
- sprite:LoadGraphics()
- else
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_holy.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 2 then -- Dank
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
- or sprite:IsPlaying("PiercingTear2") then
- -- Midas Touch gets priority
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_dank.png")
- sprite:LoadGraphics()
- -- after that comes petrified poop
- elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_dank.png")
- sprite:LoadGraphics()
- else -- normal piercing tears
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_dank.png")
- sprite:LoadGraphics()
- end
- elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
- sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_dank.png")
- sprite:LoadGraphics()
- else
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_dank.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 3 then -- Golden
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
- or sprite:IsPlaying("PiercingTear2") then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_golden.png")
- sprite:LoadGraphics()
- elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
- sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_golden.png")
- sprite:LoadGraphics()
- else
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_golden.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 4 then -- Rainbow
- if tearData.HasCostume == nil then
- if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
- or sprite:IsPlaying("PiercingTear2") then
- -- Midas Touch gets priority
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_rainbow.png")
- sprite:LoadGraphics()
- -- after that comes petrified poop
- elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_rainbow.png")
- sprite:LoadGraphics()
- else -- normal piercing tears
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_rainbow.png")
- sprite:LoadGraphics()
- end
- elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
- sprite:ReplaceSpritesheet(2, "gfx/effects/charged_poop_tear_rainbow.png")
- sprite:LoadGraphics()
- else
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_rainbow.png")
- sprite:LoadGraphics()
- end
- end
- elseif tearData.PoopSubType == 5 then -- Red
- if tearData.HasCostume == nil then
- if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
- or sprite:IsPlaying("PiercingTear2") then
- -- Midas Touch gets priority
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_red.png")
- sprite:LoadGraphics()
- elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_red.png")
- sprite:LoadGraphics()
- else -- normal piercing tears
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_red.png")
- sprite:LoadGraphics()
- end
- elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
- sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_red.png")
- sprite:LoadGraphics()
- else
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_red.png")
- sprite:LoadGraphics()
- end
- end
- end
- else
- -- else is it just a normal poop tear
- tearData.PoopSubType = 0
- end
- else
- -- else is it just a normal poop tear
- tearData.PoopSubType = 0
- end
- end
- -- adjust stuff for tearData.PoopSubType == 0
- if tearData.PoopSubType == 0 then
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- if (sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
- or sprite:IsPlaying("PiercingTear2")) then
- -- Midas Touch gets priority
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
- -- Isaac.ConsoleOutput("Normal DMG")
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_normal.png")
- sprite:LoadGraphics()
- elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_normal.png")
- sprite:LoadGraphics()
- end
- elseif (player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP)) then
- if sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
- sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_petrified.png")
- sprite:LoadGraphics()
- else
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_petrified.png")
- sprite:LoadGraphics()
- end
- end
- end
- end
- -- set stats
- if (tearData.PoopSubType == 0 -- normal
- or tearData.PoopSubType == 1 -- holy
- or tearData.PoopSubType == 2 -- dank
- or tearData.PoopSubType == 3 -- golden
- or tearData.PoopSubType == 4 -- red
- or tearData.PoopSubType == 5) -- rainbow
- and tearData.SetStats == nil then -- didn't set stats yet
- tearData.SetStats = true
- -- set damage
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
- pooptear.STONE_BONUS = 1
- tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
- -- Isaac.ConsoleOutput("Soy DMG")
- else
- pooptear.STONE_BONUS = 1.5
- tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
- -- Isaac.ConsoleOutput("Normal DMG")
- end
- else
- tear.CollisionDamage = tear.CollisionDamage
- end
- -- set tear size
- tear.SpriteScale = Vector((tear.Size / 7.9),(tear.Size / 7.9))
- tear:Update()
- tear:SetSize(tear.Size * pooptear.SCALE, Vector(pooptear.SCALE, pooptear.SCALE), 8)
- end
- -- else
- end
- end
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, Mod.onTearFire)
Advertisement
Add Comment
Please, Sign In to add comment