Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Mod = RegisterMod("Miserere", 1);
- local game = Game()
- local pooptear = {
- BASE_CHANCE = 10, -- chance for every poop tear to turn into a sub variant (if the player has one of the items)
- MAX_LUCK = 10, -- max luck requiered to turn every poop tear into a sub variant
- STONE_BONUS = 1.5, -- damage bonus given by the Petrified Poop trinket
- SCALE = 1, -- Scales the tear (?)
- TURN_CHANCE = 7, -- chance used for normal poop tears to turn enemies into a normal poop (7)
- TURN_CHANCE_HOLY = 5, -- chance used for holy poop tears to turn enemies into a holy poop (5)
- TURN_CHANCE_DANK = 7, -- chance used for dank poop tears to turn enemies into a dank poop (7)
- TURN_CHANCE_GOLDEN = 3, -- chance used for golden poop tears to turn enemies into a golden poop (3)
- TURN_CHANCE_RAINBOW = 3, -- chances used for rainbow poop tears to turn enemies into a rainbow poop (3)
- TURN_CHANCE_RED = 5, -- chance used for red poop tears to turn enemies into a red poop (5)
- BLUE_FLY_CHANCE = 10, -- chance used to determine if a Blue Fly should be spawned
- EXPLOSION_CHANCE = 10, -- chance used to determine if a poop explosion should be spawned
- HueWidth = 5 -- for the rainbow poop tear splash color
- }
- local Dir = {
- [Direction.UP] = Vector(0,-1),
- [Direction.DOWN] = Vector(0,1),
- [Direction.LEFT] = Vector(-1,0),
- [Direction.RIGHT] = Vector(1,0)
- }
- local hasCostume = false -- keeps track if the player has the costume
- local tearCount = 0 -- is set to 0 or 1 to keep track if the player is firing a tear from the right or left
- epictimer = 0 -- variable 2
- epictimercheck = 0 -- variable 1
- CollectibleType.COLLECTIBLE_MISERERE = Isaac.GetItemIdByName("Miserere") -- item
- Mod.COSTUME_MISERERE = Isaac.GetCostumeIdByPath("gfx/characters/miserere.anm2") -- costume
- TearVariant.POOPTEAR = Isaac.GetEntityVariantByName("POOPTEAR") -- tear variant
- EffectVariant.POOP_EXPLOSION2 = Isaac.GetEntityVariantByName("Poop Explosion2") -- poop explosion variant
- function hsv2rgb(h, s, v, a) -- rainbow poop explosion color
- while h > 1 do
- h = h -1
- end
- if (s <= 0) then
- return Color(v, v, v, a, 0, 0, 0)
- end
- local H = h * 6
- local I = math.floor(H)
- local F = H - I
- local P = v * (1.0 - s)
- local Q = v * (1.0 - (s * F))
- local T = v * (1.0 - (s * (1.0 - F)))
- if I == 0 then
- return Color(v, T, P, a, 0, 0, 0)
- elseif I == 1 then
- return Color(Q, v, P, a, 0, 0, 0)
- elseif I == 2 then
- return Color(P, v, T, a, 0, 0, 0)
- elseif I == 3 then
- return Color(P, Q, v, a, 0, 0, 0)
- elseif I == 4 then
- return Color(T, P, v, a, 0, 0, 0)
- else
- return Color(v, P, Q, a, 0, 0, 0)
- end
- end
- function LilLarvaSyn(entity, rolltwo) -- for the Lil' Larva synergy. Used in the MC_TAKE_DAMAGE callback
- local player = Isaac.GetPlayer(0)
- if player:HasTrinket(TrinketType.TRINKET_LIL_LARVA)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_LIL_LARVA) then
- if rolltwo <= pooptear.BLUE_FLY_CHANCE then -- should a blue fly be spawned
- if player:HasTrinket(TrinketType.TRINKET_FISH_TAIL)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_FISH_TAIL) then -- does the player have the Fish Tail trinket
- -- with Fish Tail spawn more blue flies
- local numBlueFly = 2 -- spawns 2 blue spiders
- for a = 1, numBlueFly do
- -- spawn a blue fly
- player:AddBlueFlies(1, player.Position, nil)
- end
- else
- -- spawn a blue fly
- player:AddBlueFlies(1, player.Position, nil)
- end
- end
- end
- end
- function BrownCapSyn(entity, rolltwo) -- for the Brown Cap synergy. Used in the MC_TAKE_DAMAGE callback
- local player = Isaac.GetPlayer(0)
- if player:HasTrinket(TrinketType.TRINKET_BROWN_CAP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_BROWN_CAP) then -- if the player has the Brown Cap trinket
- if rolltwo <= pooptear.EXPLOSION_CHANCE then -- check if a explosion should be spawned
- -- spawn an explosion
- local explosionDamage = 30
- local entityPosition = entity.Position
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MR_MEGA) then -- Mr. Mega synergy
- explosionDamage = 60
- end
- Isaac.Explode(entityPosition, player, explosionDamage)
- end
- end
- end
- function Mod:onTearSprite(tear, offset)
- local player = Isaac.GetPlayer(0)
- -- Isaac.ConsoleOutput("It works.. kinda!")
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then -- if the player has the Miserere item
- -- check for Lump of Coal and Proptosis
- if player:HasCollectible(CollectibleType.COLLECTIBLE_LUMP_OF_COAL)
- or player:HasCollectible(CollectibleType.COLLECTIBLE_PROPTOSIS) then
- -- Isaac.ConsoleOutput("It works..")
- -- set the sprite size of the tear
- tear.SpriteScale = Vector((tear.Size / 7.9),(tear.Size / 7.9))
- -- tear:Update()
- -- end
- end
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_TEAR_RENDER, Mod.onTearSprite)
- 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
- -- change tear variant
- if tear.Variant == TearVariant.HUNGRY then
- -- check the fire direction to set the offset
- 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
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_holy.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 2 then -- Dank
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_dank.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 3 then -- Golden
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_golden.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 4 then -- Rainbow
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_rainbow.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 5 then -- Red
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_red.png")
- sprite:LoadGraphics()
- 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 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
- 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.PUPULA
- or tear.Variant == TearVariant.PUPULA_BLOOD then
- -- check the fire direction to set the offset
- 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
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_holy.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 2 then -- Dank
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_dank.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 3 then -- Golden
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_golden.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 4 then -- Rainbow
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_rainbow.png")
- sprite:LoadGraphics()
- end
- elseif tearData.PoopSubType == 5 then -- Red
- if tearData.HasCostume == nil then
- tearData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_red.png")
- sprite:LoadGraphics()
- 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 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
- 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 then -- TearVariant.PoopTear
- -- and tear.SpawnerType == EntityType.ENTITY_PLAYER then
- tear:ChangeVariant(TearVariant.POOPTEAR)
- -- Isaac.ConsoleOutput("Poop Tear!")
- -- 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 charged shot
- or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the charged shot
- 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 charged shot
- or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the charged shot
- 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 charged shot
- or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the charged shot
- 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
- 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/normal_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
- end
- end
- end
- end
- -- Mod:AddCallback(ModCallbacks.MC_POST_TEAR_INIT, Mod.onTearFire)
- Mod:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, Mod.onTearFire)
- function Mod:onLaserFire(laser)
- local player = Isaac.GetPlayer(0) -- gets the player
- local FireDir = player:GetFireDirection() -- gets the fire direction of said player
- local laserData = laser:GetData() -- stores the data of the individual lasers
- local sprite = laser:GetSprite() -- requiered to change the sprite of the poop lasers
- -- Isaac.ConsoleOutput("It works.. kinda!")
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then -- if the player has the Miserere item
- if not (laser.Variant == 2) -- its not LudoTech, Tech X, Tech2, Tech, Jacobs Ladder, Zero
- or not (laser.Variant == 9) then -- its not TechBrim; thanks to Pum from the discord who figured it out
- -- change laser variant
- -- if laser.SpawnerType == EntityType.ENTITY_PLAYER then
- -- Make Poop Laser Subtype
- if laserData.PoopSubType == nil then
- -- Isaac.ConsoleOutput("A new Tear!")
- -- check if the laser could 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 laser 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
- laserData.PoopSubType = 0 -- a normal poop tear
- else -- should happen normaly
- local pickPoop = math.random(#poopVariant)
- if poopVariant[pickPoop] == 1 then
- laserData.PoopSubType = 1 -- Holy Poop
- elseif poopVariant[pickPoop] == 2 then
- laserData.PoopSubType = 2 -- Dank Poop
- elseif poopVariant[pickPoop] == 3 then
- laserData.PoopSubType = 3 -- Golden Poop
- elseif poopVariant[pickPoop] == 4 then
- laserData.PoopSubType = 4 -- Rainbow Poop
- elseif poopVariant[pickPoop] == 5 then
- laserData.PoopSubType = 5 -- Red Poop
- end
- end
- if laserData.PoopSubType == 1 then -- Holy Poop
- if laserData.HasCostume == nil then
- laserData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_holy.png")
- sprite:LoadGraphics()
- end
- elseif laserData.PoopSubType == 2 then -- Dank
- if laserData.HasCostume == nil then
- laserData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_dank.png")
- sprite:LoadGraphics()
- end
- elseif laserData.PoopSubType == 3 then -- Golden
- if laserData.HasCostume == nil then
- laserData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_golden.png")
- sprite:LoadGraphics()
- end
- elseif laserData.PoopSubType == 4 then -- Rainbow
- if laserData.HasCostume == nil then
- laserData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_rainbow.png")
- sprite:LoadGraphics()
- end
- elseif laserData.PoopSubType == 5 then -- Red
- if laserData.HasCostume == nil then
- laserData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_red.png")
- sprite:LoadGraphics()
- end
- end
- else
- -- else is it just a normal poop tear
- laserData.PoopSubType = 0
- end
- else
- -- else is it just a normal poop tear
- laserData.PoopSubType = 0
- end
- end
- -- adjust stuff for tearData.PoopSubType == 0
- if laserData.PoopSubType == 0 then
- if laserData.HasCostume == nil then
- -- if laser.TearFlags == TearFlags.TEAR_PIERCING then
- -- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- -- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- -- laserData.HasCostume = true
- -- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_petrified_piercing.png")
- -- sprite:LoadGraphics()
- -- else
- -- end
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- laserData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_petrified.png")
- sprite:LoadGraphics()
- sprite:RemoveOverlay()
- else
- laserData.HasCostume = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_normal.png")
- -- laser:RemoveOverlay()
- sprite:LoadGraphics()
- end
- end
- end
- -- set stats
- if (laserData.PoopSubType == 0 -- normal
- or laserData.PoopSubType == 1 -- holy
- or laserData.PoopSubType == 2 -- dank
- or laserData.PoopSubType == 3 -- golden
- or laserData.PoopSubType == 4 -- red
- or laserData.PoopSubType == 5) -- rainbow
- and laserData.SetStats == nil then -- didn't set dmg yet
- laserData.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
- laser.CollisionDamage = laser.CollisionDamage + pooptear.STONE_BONUS
- -- Isaac.ConsoleOutput("Soy DMG")
- else
- pooptear.STONE_BONUS = 1.5
- laser.CollisionDamage = laser.CollisionDamage + pooptear.STONE_BONUS
- -- Isaac.ConsoleOutput("Normal DMG")
- end
- else
- laser.CollisionDamage = laser.CollisionDamage
- end
- end
- -- end
- end
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_LASER_INIT, Mod.onLaserFire)
- -- on post peffect update
- function Mod:onUpdate(player)
- pooptear.Hue = (game:GetFrameCount() % pooptear.HueWidth) / pooptear.HueWidth -- rainbow poop tear stuff
- if game:GetFrameCount() == 1 then
- -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_MISERERE, Vector(250, 250), Vector(0,0), nil)
- end
- -- costume stuff
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE)
- and hasCostume == false then
- player:AddNullCostume(Mod.COSTUME_MISERERE)
- hasCostume = true
- end
- if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE))
- and hasCostume == true then
- player:TryRemoveNullCostume(Mod.COSTUME_MISERERE)
- hasCostume = false
- end
- -- tear stuff
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then
- -- costume stuff
- if hasCostume == false then
- player:AddNullCostume(Mod.COSTUME_MISERERE)
- hasCostume = true
- end
- for _, entity in pairs(Isaac.GetRoomEntities()) do -- go through every entity in the room
- local sprite = entity:GetSprite()
- if entity.Type == EntityType.ENTITY_TEAR -- its a tear!
- and entity.SpawnerType == EntityType.ENTITY_PLAYER then
- local tearData = entity:GetData()
- local tear = entity:ToTear()
- if tearData.PoopSubType == 0 then
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy()
- and not (entities:IsBoss()) then
- local enemy = entities
- if (enemy.Position:Distance(tear.Position) < 30) then
- if enemy:GetData().HolyPoop == true then
- -- remove any previous entityData
- enemy:GetData().HolyPoop = false
- -- set new entityData
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().DankPoop == true then
- -- remove any previous entityData
- enemy:GetData().DankPoop = false
- -- set new entityData
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- -- remove any previous entityData
- enemy:GetData().GoldenPoop = false
- -- set new entityData
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().RedPoop == true then
- -- remove any previous entityData
- enemy:GetData().RedPoop = false
- -- set new entityData
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- -- remove any previous entityData
- enemy:GetData().RainbowPoop = false
- -- set new entityData
- enemy:GetData().NormalPoop = true
- else
- -- set entityData
- enemy:GetData().NormalPoop = true
- end
- end
- end
- end
- -- if it collides with a grid
- if (tear.Height >= -5 or tear:CollidesWithGrid()) then
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- -- spawn some rock particles (may need custom ones
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.ROCK_PARTICLE, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:Update()
- else
- -- spawn a poop explosion
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:Update()
- end
- end
- elseif tearData.PoopSubType == 1 then -- Holy
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy() then
- -- and not (entities:IsBoss()) then
- local enemy = entities
- if (enemy.Position:Distance(tear.Position) < 30) then
- -- remove any previous entityData
- -- enemy:GetData().NormalPoop = false
- -- enemy:GetData().DankPoop = false
- -- enemy:GetData().GoldenPoop = false
- -- enemy:GetData().RainbowPoop = false
- -- enemy:GetData().RedPoop = false
- -- set new entityData
- -- enemy:GetData().HolyPoop = true
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().HolyPoop = true
- else
- -- set entityData
- enemy:GetData().HolyPoop = true
- end
- end
- end
- end
- -- if it collides with a grid
- if (tear.Height >= -5 or tear:CollidesWithGrid()) then
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.1 ,0.1 ,0.1 ,1 ,208 ,243 ,243), 99, 99, false, false) -- set bright color
- poopSplash:Update()
- end
- elseif tearData.PoopSubType == 2 then -- Dank
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy() then
- -- and not (entities:IsBoss()) then
- local enemy = entities
- if (enemy.Position:Distance(tear.Position) < 30) then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().DankPoop = true
- else
- -- set entityData
- enemy:GetData().DankPoop = true
- end
- end
- end
- end
- -- if it collides with a grid
- if (tear.Height >= -5 or tear:CollidesWithGrid()) then
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,36 ,32 ,31), 99, 99, false, false) -- set dark color
- poopSplash:Update()
- end
- elseif tearData.PoopSubType == 3 then -- Golden
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy() then
- -- and not (entities:IsBoss()) then
- local enemy = entities
- if (enemy.Position:Distance(tear.Position) < 30) then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().GoldenPoop = true
- else
- -- set entityData
- enemy:GetData().GoldenPoop = true
- end
- end
- end
- end
- -- if it collides with a grid
- if (tear.Height >= -5 or tear:CollidesWithGrid()) then
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,232 ,190 ,64), 99, 99, false, false) -- set golden color
- poopSplash:Update()
- end
- elseif tearData.PoopSubType == 4 then -- Rainbow
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy() then
- -- and not (entities:IsBoss()) then
- local enemy = entities
- if (enemy.Position:Distance(tear.Position) < 30) then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().RainbowPoop = true
- else
- -- set entityData
- enemy:GetData().RainbowPoop = true
- end
- end
- end
- end
- -- if it collides with a grid
- if (tear.Height >= -5 or tear:CollidesWithGrid()) then
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(hsv2rgb(pooptear.Hue,1,1,1), 0, 0, false, false) -- set rainbow color
- poopSplash:Update()
- end
- elseif tearData.PoopSubType == 5 then -- Red
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy() then
- -- and not (entities:IsBoss()) then
- local enemy = entities
- if (enemy.Position:Distance(tear.Position) < 30) then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().RedPoop = true
- else
- -- set entityData
- enemy:GetData().RedPoop = true
- end
- end
- end
- end
- -- if it collides with a grid
- if (tear.Height >= -5 or tear:CollidesWithGrid()) then
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,90 ,18 ,28), 99, 99, false, false) -- set red color
- poopSplash:Update()
- end
- end
- elseif entity.Type == EntityType.ENTITY_LASER -- its a laser!
- and entity.SpawnerType == EntityType.ENTITY_PLAYER then
- if entity.Variant == 1 then -- it is a Brimstone, LudoBrim, BrimX laser
- local laserData = entity:GetData()
- local laser = entity:ToLaser()
- if laserData.PoopSubType == 0 then
- -- color the laser
- -- laser:SetColor(hsv2rgb(pooptear.Hue,1,1,1), 0, 0, false, false) -- set rainbow color
- -- laser.Color = Color(1,1,1,1,-138,83,64)
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy()
- and not (entities:IsBoss()) then
- -- Isaac.ConsoleOutput("Still Looking")
- local enemy = entities
- -- laser detection code
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = enemy.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- -- Isaac.ConsoleOutput("Step forward")
- if enemy:GetData().HolyPoop == true then
- -- remove any previous entityData
- enemy:GetData().HolyPoop = false
- -- set new entityData
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().NormalPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().NormalPoop = true
- else
- -- set entityData
- enemy:GetData().NormalPoop = true
- -- Isaac.ConsoleOutput("Brimstone Poop!")
- end
- end
- end
- end
- -- check for laser impact
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities.Type == EntityType.ENTITY_EFFECT
- and entities.Variant == EffectVariant.LASER_IMPACT then
- -- Isaac.ConsoleOutput("Still")
- local impact = entities:ToEffect()
- local sprite = impact:GetSprite()
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = impact.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if impact:GetData().SpriteChange == nil then
- impact:GetData().SpriteChange = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact.png")
- -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
- sprite:LoadGraphics()
- -- sprite:Update()
- -- Isaac.ConsoleOutput("Laser Impact!")
- end
- end
- end
- end
- elseif laserData.PoopSubType == 1 then -- Holy
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy()
- and not (entities:IsBoss()) then
- -- Isaac.ConsoleOutput("Still Looking")
- local enemy = entities
- -- laser detection code
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = enemy.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().HolyPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().HolyPoop = true
- else
- -- set entityData
- enemy:GetData().HolyPoop = true
- end
- end
- end
- end
- -- check for laser impact
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities.Type == EntityType.ENTITY_EFFECT
- and entities.Variant == EffectVariant.LASER_IMPACT then
- -- Isaac.ConsoleOutput("Still")
- local impact = entities:ToEffect()
- local sprite = impact:GetSprite()
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = impact.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if impact:GetData().SpriteChange == nil then
- impact:GetData().SpriteChange = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_holy.png")
- -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
- sprite:LoadGraphics()
- -- sprite:Update()
- -- Isaac.ConsoleOutput("Laser Impact!")
- end
- end
- end
- end
- elseif laserData.PoopSubType == 2 then -- Dank
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy()
- and not (entities:IsBoss()) then
- -- Isaac.ConsoleOutput("Still Looking")
- local enemy = entities
- -- laser detection code
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = enemy.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().DankPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().DankPoop = true
- else
- -- set entityData
- enemy:GetData().DankPoop = true
- end
- end
- end
- end
- -- check for laser impact
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities.Type == EntityType.ENTITY_EFFECT
- and entities.Variant == EffectVariant.LASER_IMPACT then
- -- Isaac.ConsoleOutput("Still")
- local impact = entities:ToEffect()
- local sprite = impact:GetSprite()
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = impact.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if impact:GetData().SpriteChange == nil then
- impact:GetData().SpriteChange = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_dank.png")
- -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
- sprite:LoadGraphics()
- -- sprite:Update()
- -- Isaac.ConsoleOutput("Laser Impact!")
- end
- end
- end
- end
- elseif laserData.PoopSubType == 3 then -- Golden
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy()
- and not (entities:IsBoss()) then
- -- Isaac.ConsoleOutput("Still Looking")
- local enemy = entities
- -- laser detection code
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = enemy.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().GoldenPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().GoldenPoop = true
- else
- -- set entityData
- enemy:GetData().GoldenPoop = true
- end
- end
- end
- end
- -- check for laser impact
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities.Type == EntityType.ENTITY_EFFECT
- and entities.Variant == EffectVariant.LASER_IMPACT then
- -- Isaac.ConsoleOutput("Still")
- local impact = entities:ToEffect()
- local sprite = impact:GetSprite()
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = impact.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if impact:GetData().SpriteChange == nil then
- impact:GetData().SpriteChange = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_golden.png")
- -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
- sprite:LoadGraphics()
- -- sprite:Update()
- -- Isaac.ConsoleOutput("Laser Impact!")
- end
- end
- end
- end
- elseif laserData.PoopSubType == 4 then -- Rainbow
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy()
- and not (entities:IsBoss()) then
- -- Isaac.ConsoleOutput("Still Looking")
- local enemy = entities
- -- laser detection code
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = enemy.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().RainbowPoop = true
- elseif enemy:GetData().RedPoop == true then
- enemy:GetData().RedPoop = false
- enemy:GetData().RainbowPoop = true
- else
- -- set entityData
- enemy:GetData().RainbowPoop = true
- end
- end
- end
- end -- check for laser impact
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities.Type == EntityType.ENTITY_EFFECT
- and entities.Variant == EffectVariant.LASER_IMPACT then
- -- Isaac.ConsoleOutput("Still")
- local impact = entities:ToEffect()
- local sprite = impact:GetSprite()
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = impact.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if impact:GetData().SpriteChange == nil then
- impact:GetData().SpriteChange = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_blank.png")
- -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
- sprite:LoadGraphics()
- -- sprite:Update()
- -- Isaac.ConsoleOutput("Laser Impact!")
- end
- end
- end
- end
- elseif laserData.PoopSubType == 5 then -- Red
- -- check if the tear collids with an enemy
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities:IsActiveEnemy()
- and not (entities:IsBoss()) then
- -- Isaac.ConsoleOutput("Still Looking")
- local enemy = entities
- -- laser detection code
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = enemy.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if enemy:GetData().NormalPoop == true then
- enemy:GetData().NormalPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().HolyPoop == true then
- enemy:GetData().HolyPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().DankPoop == true then
- enemy:GetData().DankPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().GoldenPoop == true then
- enemy:GetData().GoldenPoop = false
- enemy:GetData().RedPoop = true
- elseif enemy:GetData().RainbowPoop == true then
- enemy:GetData().RainbowPoop = false
- enemy:GetData().RedPoop = true
- else
- -- set entityData
- enemy:GetData().RedPoop = true
- -- Isaac.ConsoleOutput("Red Pooooop!")
- end
- end
- end
- end
- -- check for laser impact
- for _, entities in pairs(Isaac.GetRoomEntities()) do
- if entities.Type == EntityType.ENTITY_EFFECT
- and entities.Variant == EffectVariant.LASER_IMPACT then
- -- Isaac.ConsoleOutput("Still")
- local impact = entities:ToEffect()
- local sprite = impact:GetSprite()
- local p1 = laser.Position + Vector(0,-25)
- local p2 = laser:GetEndPoint()
- local p3 = impact.Position + Vector(0,-15)
- local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
- local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
- local vP1_P2_norm = vP1_P2:Normalized()
- local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
- local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
- local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
- if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
- if impact:GetData().SpriteChange == nil then
- impact:GetData().SpriteChange = true
- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_red.png")
- -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
- sprite:LoadGraphics()
- -- sprite:Update()
- -- Isaac.ConsoleOutput("Laser Impact!")
- end
- end
- end
- end
- end
- end
- -- elseif entity.Type == EntityType.ENTITY_LASER_IMPACT -- its a laser impact!
- -- and entity.SpawnerType == EntityType.ENTITY_PLAYER then
- -- local spawner = entity.SpawnerType
- -- if spawner:GetData().PoopSubType == 0 then
- --end
- end
- end
- end
- end
- Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.onUpdate)
- function Mod:onCache(player, cacheFlag)
- if cacheFlag == CacheFlag.CACHE_TEARCOLOR then
- if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then
- -- player.TearColor = Color(0.5, 0.5, 0.5, 1, 0, 0, 0)
- -- player.LaserColor = Color(1,1,1,1,255,255,255)
- end
- end
- if cacheFlag == CacheFlag.CACHE_SHOTSPEED and player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then
- player.ShotSpeed = player.ShotSpeed - 0.20
- end
- end
- Mod:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Mod.onCache)
- function Mod:onDamage(entity, amt, flag, source, countdown)
- -- local tearData = source:GetData()
- local player = Isaac.GetPlayer(0)
- local onBlacklist = false -- keeps track if an enemy should be turned to stone or not
- -- get rng
- local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
- local roll = rng:RandomInt(100) -- used for turning enemies into poop
- local rolltwo = rng:RandomInt(100) -- used for spawning blue flies and poop explosions
- if source.Type == EntityType.ENTITY_TEAR
- and (source.Variant == TearVariant.POOPTEAR
- or source.Variant == TearVariant.HUNGRY
- or source.Variant == TearVariant.PUPULA
- or source.Variant == TearVariant.PUPULA_BLOOD) then
- if entity:IsActiveEnemy()
- and not (entity:IsBoss()) then
- -- set up a blacklist for the enemies which shouldn't be turned into poop
- if entity.Type == EntityType.ENTITY_STONEHEAD -- normal grimace
- or entity.Type == EntityType.ENTITY_STONE_EYE -- stone eyes
- or entity.Type == EntityType.ENTITY_CONSTANT_STONE_SHOOTER -- constant shooting grimace
- or entity.Type == EntityType.ENTITY_BRIMSTONE_HEAD -- brimstone grimace
- or entity.Type == EntityType.ENTITY_STONEY -- walking grimace
- or entity.Type == EntityType.ENTITY_POKY -- pokies and slides
- or entity.Type == EntityType.ENTITY_WALL_HUGGER -- wall huggers
- or entity.Type == EntityType.ENTITY_DEATHS_HEAD -- deaths head (invisible)
- or entity.Type == EntityType.ENTITY_MASK -- the mask enemy without its heart
- or entity.Type == EntityType.ENTITY_GRUB -- Larry Jr. replacement
- or entity.Type == EntityType.ENTITY_ETERNALFLY -- Eternal fly which flies around corn poop
- or entity.Type == EntityType.ENTITY_DIP -- poop enemy
- or entity.Type == EntityType.ENTITY_SQUIRT -- stronger poop enemy
- or entity.Type == EntityType.ENTITY_DINGA -- ultimate poop enemy
- or entity.Type == EntityType.ENTITY_CORN_MINE then -- already poop
- -- set the enemy on the blacklist
- onBlacklist = true
- -- Isaac.ConsoleOutput("onBlacklist!")
- else
- -- take the enemy from the blacklist
- onBlacklist = false
- end
- if entity:GetData().NormalPoop == true then
- if roll <= pooptear.TURN_CHANCE -- chance to turn the enemy into normal poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- -- Isaac.ConsoleOutput("Don't make poop!")
- entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop
- entity:Remove()
- -- turn the enemy into poop
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 0, entity.Position, true)
- else
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- -- spawn some rock particles (may need custom ones
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.ROCK_PARTICLE, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:Update()
- else
- -- spawn a poop explosion
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:Update()
- end
- entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().HolyPoop == true then
- if roll <= pooptear.TURN_CHANCE_HOLY -- chance to turn the enemy into holy poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Holy Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 6, entity.Position, true)
- else
- -- spawn a holy poop splash
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.1 ,0.1 ,0.1 ,1 ,208 ,243 ,243), 99, 99, false, false) -- set bright color
- poopSplash:Update()
- entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().DankPoop == true then
- if roll <= pooptear.TURN_CHANCE_DANK -- chance to turn the enemy into dank poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Dank Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 5, entity.Position, true)
- else
- -- spawn a dank poop splash
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,36 ,32 ,31), 99, 99, false, false) -- set dark color
- poopSplash:Update()
- entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().GoldenPoop == true then
- if roll <= pooptear.TURN_CHANCE_GOLDEN -- chance to turn the enemy into golden poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Golden Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 3, entity.Position, true)
- else
- -- spawn a golden poop splash
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,232 ,190 ,64), 99, 99, false, false) -- set golden color
- poopSplash:Update()
- entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().RainbowPoop == true then
- if roll <= pooptear.TURN_CHANCE_RAINBOW -- chance to turn the enemy into rainbow poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Rainbow Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 4, entity.Position, true)
- else
- -- spawn a rainbow poop splash
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(hsv2rgb(pooptear.Hue,1,1,1), 0, 0, false, false) -- set rainbow color
- poopSplash:Update()
- entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().RedPoop == true then
- if roll <= pooptear.TURN_CHANCE_RED -- chance to turn the enemy into red poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Red Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 1, entity.Position, true)
- else
- entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop too
- -- spawn a red poop splash
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,90 ,18 ,28), 99, 99, false, false) -- set red color
- poopSplash:Update()
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- end
- elseif entity:IsBoss() then
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- end
- if source.Type == EntityType.ENTITY_PLAYER
- and flag & DamageFlag.DAMAGE_LASER == DamageFlag.DAMAGE_LASER then
- --and source.Variant == 1 then -- the laser is a Brimstone, LudoBrim or BrimX laser
- Isaac.ConsoleOutput("Damage Source")
- if entity:IsActiveEnemy()
- and not (entity:IsBoss()) then
- -- set up a blacklist for the enemies which shouldn't be turned into poop
- if entity.Type == EntityType.ENTITY_STONEHEAD -- normal grimace
- or entity.Type == EntityType.ENTITY_STONE_EYE -- stone eyes
- or entity.Type == EntityType.ENTITY_CONSTANT_STONE_SHOOTER -- constant shooting grimace
- or entity.Type == EntityType.ENTITY_BRIMSTONE_HEAD -- brimstone grimace
- or entity.Type == EntityType.ENTITY_STONEY -- walking grimace
- or entity.Type == EntityType.ENTITY_POKY -- pokies and slides
- or entity.Type == EntityType.ENTITY_WALL_HUGGER -- wall huggers
- or entity.Type == EntityType.ENTITY_DEATHS_HEAD -- deaths head (invisible)
- or entity.Type == EntityType.ENTITY_MASK -- the mask enemy without its heart
- or entity.Type == EntityType.ENTITY_GRUB -- Larry Jr. replacement
- or entity.Type == EntityType.ENTITY_ETERNALFLY -- Eternal fly which flies around corn poop
- or entity.Type == EntityType.ENTITY_DIP -- poop enemy
- or entity.Type == EntityType.ENTITY_SQUIRT -- stronger poop enemy
- or entity.Type == EntityType.ENTITY_DINGA -- ultimate poop enemy
- or entity.Type == EntityType.ENTITY_CORN_MINE then -- already poop
- -- set the enemy on the blacklist
- onBlacklist = true
- Isaac.ConsoleOutput("Laser Blacklist!")
- else
- -- take the enemy from the blacklist
- onBlacklist = false
- end
- if entity:GetData().NormalPoop == true then
- Isaac.ConsoleOutput("Make poop?")
- if roll <= pooptear.TURN_CHANCE -- chance to turn the enemy into normal poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- Isaac.ConsoleOutput("Make poop!")
- entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop
- entity:Remove()
- -- turn the enemy into poop
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 0, entity.Position, true)
- else
- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
- -- spawn some rock particles (may need custom ones
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.ROCK_PARTICLE, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:Update()
- else
- -- spawn a poop explosion
- poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION, 1, entity.Position, Vector(0,0), player):ToEffect()
- poopSplash.SpriteScale = Vector(0.6,0.6)
- poopSplash:Update()
- end
- entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().HolyPoop == true then
- if roll <= pooptear.TURN_CHANCE_HOLY -- chance to turn the enemy into holy poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Holy Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 6, entity.Position, true)
- else
- -- reset entity data
- entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().DankPoop == true then
- if roll <= pooptear.TURN_CHANCE_DANK -- chance to turn the enemy into dank poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Dank Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 5, entity.Position, true)
- else
- -- reset entity data
- entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().GoldenPoop == true then
- if roll <= pooptear.TURN_CHANCE_GOLDEN -- chance to turn the enemy into golden poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Golden Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 3, entity.Position, true)
- else
- -- reset entity data
- entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().RainbowPoop == true then
- if roll <= pooptear.TURN_CHANCE_RAINBOW -- chance to turn the enemy into rainbow poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Rainbow Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 4, entity.Position, true)
- else
- -- reset entity data
- entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- elseif entity:GetData().RedPoop == true then
- if roll <= pooptear.TURN_CHANCE_RED -- chance to turn the enemy into red poop
- and onBlacklist == false then -- and the enemy can be turned into poop
- entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop
- entity:Remove()
- -- Isaac.ConsoleOutput("Red Poop!")
- Isaac.GridSpawn(GridEntityType.GRID_POOP, 1, entity.Position, true)
- else
- entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop too
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- end
- elseif entity:IsBoss() then
- -- Lil' Larva synergy / spawns blue flies
- LilLarvaSyn(entity, rolltwo)
- -- Brown Cap synergy / spawns explosions
- BrownCapSyn(entity, rolltwo)
- end
- end
- end
- Mod:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, Mod.onDamage)
Advertisement
Add Comment
Please, Sign In to add comment