Josh64

miserere (beta)

Sep 18th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.78 KB | None | 0 0
  1. local Mod = RegisterMod("Miserere", 1);
  2. local game = Game()
  3.  
  4. local pooptear = {
  5. BASE_CHANCE = 10, -- chance for every poop tear to turn into a sub variant (if the player has one of the items)
  6. MAX_LUCK = 10, -- max luck requiered to turn every poop tear into a sub variant
  7. STONE_BONUS = 1.5, -- damage bonus given by the Petrified Poop trinket
  8. SCALE = 1, -- Scales the tear (?)
  9. TURN_CHANCE = 7, -- chance used for normal poop tears to turn enemies into a normal poop (7)
  10. TURN_CHANCE_HOLY = 5, -- chance used for holy poop tears to turn enemies into a holy poop (5)
  11. TURN_CHANCE_DANK = 7, -- chance used for dank poop tears to turn enemies into a dank poop (7)
  12. TURN_CHANCE_GOLDEN = 3, -- chance used for golden poop tears to turn enemies into a golden poop (3)
  13. TURN_CHANCE_RAINBOW = 3, -- chances used for rainbow poop tears to turn enemies into a rainbow poop (3)
  14. TURN_CHANCE_RED = 5, -- chance used for red poop tears to turn enemies into a red poop (5)
  15. BLUE_FLY_CHANCE = 10, -- chance used to determine if a Blue Fly should be spawned
  16. EXPLOSION_CHANCE = 10, -- chance used to determine if a poop explosion should be spawned
  17. HueWidth = 5 -- for the rainbow poop tear splash color
  18. }
  19. local Dir = {
  20. [Direction.UP] = Vector(0,-1),
  21. [Direction.DOWN] = Vector(0,1),
  22. [Direction.LEFT] = Vector(-1,0),
  23. [Direction.RIGHT] = Vector(1,0)
  24. }
  25.  
  26. local hasCostume = false -- keeps track if the player has the costume
  27. local tearCount = 0 -- is set to 0 or 1 to keep track if the player is firing a tear from the right or left
  28. epictimer = 0 -- variable 2
  29. epictimercheck = 0 -- variable 1
  30.  
  31.  
  32. CollectibleType.COLLECTIBLE_MISERERE = Isaac.GetItemIdByName("Miserere") -- item
  33. Mod.COSTUME_MISERERE = Isaac.GetCostumeIdByPath("gfx/characters/miserere.anm2") -- costume
  34. TearVariant.POOPTEAR = Isaac.GetEntityVariantByName("POOPTEAR") -- tear variant
  35. EffectVariant.POOP_EXPLOSION2 = Isaac.GetEntityVariantByName("Poop Explosion2") -- poop explosion variant
  36.  
  37. function hsv2rgb(h, s, v, a) -- rainbow poop explosion color
  38.  
  39. while h > 1 do
  40. h = h -1
  41. end
  42.  
  43. if (s <= 0) then
  44. return Color(v, v, v, a, 0, 0, 0)
  45. end
  46. local H = h * 6
  47. local I = math.floor(H)
  48. local F = H - I
  49. local P = v * (1.0 - s)
  50. local Q = v * (1.0 - (s * F))
  51. local T = v * (1.0 - (s * (1.0 - F)))
  52.  
  53. if I == 0 then
  54. return Color(v, T, P, a, 0, 0, 0)
  55. elseif I == 1 then
  56. return Color(Q, v, P, a, 0, 0, 0)
  57. elseif I == 2 then
  58. return Color(P, v, T, a, 0, 0, 0)
  59. elseif I == 3 then
  60. return Color(P, Q, v, a, 0, 0, 0)
  61. elseif I == 4 then
  62. return Color(T, P, v, a, 0, 0, 0)
  63. else
  64. return Color(v, P, Q, a, 0, 0, 0)
  65. end
  66. end
  67.  
  68. function LilLarvaSyn(entity, rolltwo) -- for the Lil' Larva synergy. Used in the MC_TAKE_DAMAGE callback
  69.  
  70. local player = Isaac.GetPlayer(0)
  71.  
  72. if player:HasTrinket(TrinketType.TRINKET_LIL_LARVA)
  73. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_LIL_LARVA) then
  74. if rolltwo <= pooptear.BLUE_FLY_CHANCE then -- should a blue fly be spawned
  75. if player:HasTrinket(TrinketType.TRINKET_FISH_TAIL)
  76. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_FISH_TAIL) then -- does the player have the Fish Tail trinket
  77. -- with Fish Tail spawn more blue flies
  78. local numBlueFly = 2 -- spawns 2 blue spiders
  79. for a = 1, numBlueFly do
  80. -- spawn a blue fly
  81. player:AddBlueFlies(1, player.Position, nil)
  82. end
  83. else
  84. -- spawn a blue fly
  85. player:AddBlueFlies(1, player.Position, nil)
  86. end
  87. end
  88. end
  89. end
  90.  
  91. function BrownCapSyn(entity, rolltwo) -- for the Brown Cap synergy. Used in the MC_TAKE_DAMAGE callback
  92.  
  93. local player = Isaac.GetPlayer(0)
  94.  
  95. if player:HasTrinket(TrinketType.TRINKET_BROWN_CAP)
  96. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_BROWN_CAP) then -- if the player has the Brown Cap trinket
  97. if rolltwo <= pooptear.EXPLOSION_CHANCE then -- check if a explosion should be spawned
  98. -- spawn an explosion
  99. local explosionDamage = 30
  100. local entityPosition = entity.Position
  101. if player:HasCollectible(CollectibleType.COLLECTIBLE_MR_MEGA) then -- Mr. Mega synergy
  102. explosionDamage = 60
  103. end
  104. Isaac.Explode(entityPosition, player, explosionDamage)
  105. end
  106. end
  107. end
  108.  
  109. function Mod:onTearSprite(tear, offset)
  110.  
  111. local player = Isaac.GetPlayer(0)
  112. -- Isaac.ConsoleOutput("It works.. kinda!")
  113.  
  114. if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then -- if the player has the Miserere item
  115. -- check for Lump of Coal and Proptosis
  116. if player:HasCollectible(CollectibleType.COLLECTIBLE_LUMP_OF_COAL)
  117. or player:HasCollectible(CollectibleType.COLLECTIBLE_PROPTOSIS) then
  118. -- Isaac.ConsoleOutput("It works..")
  119. -- set the sprite size of the tear
  120. tear.SpriteScale = Vector((tear.Size / 7.9),(tear.Size / 7.9))
  121. -- tear:Update()
  122. -- end
  123. end
  124. end
  125. end
  126. Mod:AddCallback(ModCallbacks.MC_POST_TEAR_RENDER, Mod.onTearSprite)
  127.  
  128. function Mod:onTearFire(tear)
  129.  
  130. local player = Isaac.GetPlayer(0) -- gets the player
  131. local FireDir = player:GetFireDirection() -- gets the fire direction of said player
  132. local MoveDir = player:GetMovementDirection() -- gets the player movement direction in the case the animation of the tear has to be adjusted
  133. local tearData = tear:GetData() -- stores the data of the individual tears
  134. local sprite = tear:GetSprite() -- requiered to change the sprite of the poop tears + animations
  135. local tearRNG = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  136. local roll = tearRNG:RandomInt(100) -- used to decide which piercing tear animation is playing
  137.  
  138. -- Isaac.ConsoleOutput("It works.. kinda!")
  139.  
  140. if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then -- if the player has the Miserere item
  141. if not (tear.Variant == 4) -- its not Bob Rotten Head
  142. or not (tear.Variant == 9) then -- its not Chaos Card
  143. -- change tear variant
  144.  
  145.  
  146. if tear.Variant == TearVariant.HUNGRY then
  147.  
  148. -- check the fire direction to set the offset
  149. if FireDir == Direction.DOWN then
  150. player.TearsOffset = Vector(0,5.5) -- change the offset
  151. elseif FireDir == Direction.RIGHT then
  152. player.TearsOffset = Vector(10,5.5)
  153. elseif FireDir == Direction.UP then
  154. player.TearsOffset = Vector(0,5.5)
  155. elseif FireDir == Direction.LEFT then
  156. player.TearsOffset = Vector(-10,5.5)
  157. end
  158. -- Poop Tear Subtype
  159. if tearData.PoopSubType == nil then
  160. -- Isaac.ConsoleOutput("A new Tear!")
  161. -- check if the tear can be a variant
  162. if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  163. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
  164. or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
  165. or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
  166. or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  167. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
  168. or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
  169. -- get rng
  170. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  171. local roll = rng:RandomInt(100)
  172. -- will the tear be a variant
  173. if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
  174. -- which variants are possible
  175. local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
  176. if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  177. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
  178. table.remove(poopVariant, 5)
  179. end
  180. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
  181. table.remove(poopVariant, 4)
  182. end
  183. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
  184. table.remove(poopVariant, 3)
  185. end
  186. if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  187. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
  188. table.remove(poopVariant, 2)
  189. end
  190. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
  191. table.remove(poopVariant, 1)
  192. end
  193.  
  194. -- saftey check
  195. if poopVariant[1] == nil then -- somehow the poop got emptied
  196. tearData.PoopSubType = 0 -- a normal poop tear
  197. else -- should happen normaly
  198.  
  199. local pickPoop = math.random(#poopVariant)
  200. if poopVariant[pickPoop] == 1 then
  201. tearData.PoopSubType = 1 -- Holy Poop
  202. elseif poopVariant[pickPoop] == 2 then
  203. tearData.PoopSubType = 2 -- Dank Poop
  204. elseif poopVariant[pickPoop] == 3 then
  205. tearData.PoopSubType = 3 -- Golden Poop
  206. elseif poopVariant[pickPoop] == 4 then
  207. tearData.PoopSubType = 4 -- Rainbow Poop
  208. elseif poopVariant[pickPoop] == 5 then
  209. tearData.PoopSubType = 5 -- Red Poop
  210. end
  211. end
  212. if tearData.PoopSubType == 1 then -- Holy Poop
  213. if tearData.HasCostume == nil then
  214. tearData.HasCostume = true
  215. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_holy.png")
  216. sprite:LoadGraphics()
  217. end
  218.  
  219. elseif tearData.PoopSubType == 2 then -- Dank
  220. if tearData.HasCostume == nil then
  221. tearData.HasCostume = true
  222. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_dank.png")
  223. sprite:LoadGraphics()
  224. end
  225.  
  226. elseif tearData.PoopSubType == 3 then -- Golden
  227. if tearData.HasCostume == nil then
  228. tearData.HasCostume = true
  229. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_golden.png")
  230. sprite:LoadGraphics()
  231. end
  232.  
  233. elseif tearData.PoopSubType == 4 then -- Rainbow
  234. if tearData.HasCostume == nil then
  235. tearData.HasCostume = true
  236. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_rainbow.png")
  237. sprite:LoadGraphics()
  238. end
  239.  
  240. elseif tearData.PoopSubType == 5 then -- Red
  241. if tearData.HasCostume == nil then
  242. tearData.HasCostume = true
  243. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_red.png")
  244. sprite:LoadGraphics()
  245. end
  246. end
  247. else
  248. -- else is it just a normal poop tear
  249. tearData.PoopSubType = 0
  250. end
  251. else
  252. -- else is it just a normal poop tear
  253. tearData.PoopSubType = 0
  254. end
  255. end
  256. -- adjust stuff for tearData.PoopSubType == 0
  257. if tearData.PoopSubType == 0 then
  258. if tearData.HasCostume == nil then
  259. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  260. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  261. tearData.HasCostume = true
  262. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_petrified.png")
  263. sprite:LoadGraphics()
  264. else
  265. tearData.HasCostume = true
  266. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear.png")
  267. sprite:LoadGraphics()
  268. end
  269. end
  270. end
  271. -- set stats
  272. if (tearData.PoopSubType == 0 -- normal
  273. or tearData.PoopSubType == 1 -- holy
  274. or tearData.PoopSubType == 2 -- dank
  275. or tearData.PoopSubType == 3 -- golden
  276. or tearData.PoopSubType == 4 -- red
  277. or tearData.PoopSubType == 5) -- rainbow
  278. and tearData.SetStats == nil then -- didn't set dmg yet
  279. tearData.SetStats = true
  280. -- set damage
  281. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  282. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  283. if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
  284. pooptear.STONE_BONUS = 1
  285. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  286. -- Isaac.ConsoleOutput("Soy DMG")
  287. else
  288. pooptear.STONE_BONUS = 1.5
  289. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  290. -- Isaac.ConsoleOutput("Normal DMG")
  291. end
  292. else
  293. tear.CollisionDamage = tear.CollisionDamage
  294. end
  295. end
  296.  
  297.  
  298.  
  299. elseif tear.Variant == TearVariant.PUPULA
  300. or tear.Variant == TearVariant.PUPULA_BLOOD then
  301.  
  302. -- check the fire direction to set the offset
  303. if FireDir == Direction.DOWN then
  304. player.TearsOffset = Vector(0,5.5) -- change the offset
  305. elseif FireDir == Direction.RIGHT then
  306. player.TearsOffset = Vector(10,5.5)
  307. elseif FireDir == Direction.UP then
  308. player.TearsOffset = Vector(0,5.5)
  309. elseif FireDir == Direction.LEFT then
  310. player.TearsOffset = Vector(-10,5.5)
  311. end
  312. -- Poop Tear Subtype
  313. if tearData.PoopSubType == nil then
  314. -- Isaac.ConsoleOutput("A new Tear!")
  315. -- check if the tear can be a variant
  316. if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  317. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
  318. or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
  319. or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
  320. or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  321. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
  322. or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
  323. -- get rng
  324. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  325. local roll = rng:RandomInt(100)
  326. -- will the tear be a variant
  327. if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
  328. -- which variants are possible
  329. local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
  330. if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  331. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
  332. table.remove(poopVariant, 5)
  333. end
  334. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
  335. table.remove(poopVariant, 4)
  336. end
  337. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
  338. table.remove(poopVariant, 3)
  339. end
  340. if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  341. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
  342. table.remove(poopVariant, 2)
  343. end
  344. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
  345. table.remove(poopVariant, 1)
  346. end
  347.  
  348. -- saftey check
  349. if poopVariant[1] == nil then -- somehow the poop got emptied
  350. tearData.PoopSubType = 0 -- a normal poop tear
  351. else -- should happen normaly
  352.  
  353. local pickPoop = math.random(#poopVariant)
  354. if poopVariant[pickPoop] == 1 then
  355. tearData.PoopSubType = 1 -- Holy Poop
  356. elseif poopVariant[pickPoop] == 2 then
  357. tearData.PoopSubType = 2 -- Dank Poop
  358. elseif poopVariant[pickPoop] == 3 then
  359. tearData.PoopSubType = 3 -- Golden Poop
  360. elseif poopVariant[pickPoop] == 4 then
  361. tearData.PoopSubType = 4 -- Rainbow Poop
  362. elseif poopVariant[pickPoop] == 5 then
  363. tearData.PoopSubType = 5 -- Red Poop
  364. end
  365. end
  366. if tearData.PoopSubType == 1 then -- Holy Poop
  367. if tearData.HasCostume == nil then
  368. tearData.HasCostume = true
  369. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_holy.png")
  370. sprite:LoadGraphics()
  371. end
  372.  
  373. elseif tearData.PoopSubType == 2 then -- Dank
  374. if tearData.HasCostume == nil then
  375. tearData.HasCostume = true
  376. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_dank.png")
  377. sprite:LoadGraphics()
  378. end
  379.  
  380. elseif tearData.PoopSubType == 3 then -- Golden
  381. if tearData.HasCostume == nil then
  382. tearData.HasCostume = true
  383. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_golden.png")
  384. sprite:LoadGraphics()
  385. end
  386.  
  387. elseif tearData.PoopSubType == 4 then -- Rainbow
  388. if tearData.HasCostume == nil then
  389. tearData.HasCostume = true
  390. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_rainbow.png")
  391. sprite:LoadGraphics()
  392. end
  393.  
  394. elseif tearData.PoopSubType == 5 then -- Red
  395. if tearData.HasCostume == nil then
  396. tearData.HasCostume = true
  397. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_red.png")
  398. sprite:LoadGraphics()
  399. end
  400. end
  401. else
  402. -- else is it just a normal poop tear
  403. tearData.PoopSubType = 0
  404. end
  405. else
  406. -- else is it just a normal poop tear
  407. tearData.PoopSubType = 0
  408. end
  409. end
  410. -- adjust stuff for tearData.PoopSubType == 0
  411. if tearData.PoopSubType == 0 then
  412. if tearData.HasCostume == nil then
  413. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  414. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  415. tearData.HasCostume = true
  416. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_petrified.png")
  417. sprite:LoadGraphics()
  418. else
  419. tearData.HasCostume = true
  420. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear.png")
  421. sprite:LoadGraphics()
  422. end
  423. end
  424. end
  425. -- set stats
  426. if (tearData.PoopSubType == 0 -- normal
  427. or tearData.PoopSubType == 1 -- holy
  428. or tearData.PoopSubType == 2 -- dank
  429. or tearData.PoopSubType == 3 -- golden
  430. or tearData.PoopSubType == 4 -- red
  431. or tearData.PoopSubType == 5) -- rainbow
  432. and tearData.SetStats == nil then -- didn't set dmg yet
  433. tearData.SetStats = true
  434. -- set damage
  435. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  436. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  437. if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
  438. pooptear.STONE_BONUS = 1
  439. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  440. -- Isaac.ConsoleOutput("Soy DMG")
  441. else
  442. pooptear.STONE_BONUS = 1.5
  443. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  444. -- Isaac.ConsoleOutput("Normal DMG")
  445. end
  446. else
  447. tear.CollisionDamage = tear.CollisionDamage
  448. end
  449. end
  450.  
  451.  
  452.  
  453. elseif tear.Variant ~= TearVariant.POOPTEAR then -- TearVariant.PoopTear
  454. -- and tear.SpawnerType == EntityType.ENTITY_PLAYER then
  455. tear:ChangeVariant(TearVariant.POOPTEAR)
  456. -- Isaac.ConsoleOutput("Poop Tear!")
  457. -- adjustments for the tear animation and tear offset
  458. if tearData.Animation == nil then
  459. tearData.Animation = true
  460. if tear.TearFlags == tear.TearFlags | TearFlags.TEAR_PIERCING then -- for piercing tears
  461.  
  462. -- change the offset
  463. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the charged shot
  464. or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the charged shot
  465. if FireDir == Direction.DOWN then
  466. player.TearsOffset = Vector(0,5.5)
  467. elseif FireDir == Direction.RIGHT then
  468. player.TearsOffset = Vector(10,5.5)
  469. elseif FireDir == Direction.UP then
  470. player.TearsOffset = Vector(0,5.5)
  471. elseif FireDir == Direction.LEFT then
  472. player.TearsOffset = Vector(-10,5.5)
  473. end
  474. end
  475.  
  476. -- get the animation + some variaty
  477. if roll > 50 then
  478. tear:GetSprite():Play("PiercingTear1", true)
  479. else
  480. tear:GetSprite():Play("PiercingTear2", true)
  481. end
  482.  
  483. else -- is not a piercing tear
  484. if player:HasCollectible(CollectibleType.COLLECTIBLE_CHOCOLATE_MILK) -- because of the charged shot
  485. or player:HasCollectible(CollectibleType.COLLECTIBLE_MONSTROS_LUNG) -- because of the charged shot
  486. or player:HasCollectible(CollectibleType.COLLECTIBLE_MARKED) -- sprite disappears otherwise
  487. or player:HasCollectible(CollectibleType.COLLECTIBLE_HAEMOLACRIA) -- sprite disappears otherwise
  488. or player:HasCollectible(CollectibleType.COLLECTIBLE_MYSTERIOUS_LIQUID) -- ''
  489. or player:HasCollectible(CollectibleType.COLLECTIBLE_LUDOVICO_TECHNIQUE) -- ''
  490. or player:HasCollectible(CollectibleType.COLLECTIBLE_LOKIS_HORNS) -- same sprite in all directions
  491. or player:HasCollectible(CollectibleType.COLLECTIBLE_MOMS_EYE) then -- same problem as with Loki's Horns
  492.  
  493. -- change the offset
  494. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the charged shot
  495. or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the charged shot
  496. if FireDir == Direction.DOWN then
  497. player.TearsOffset = Vector(0,5.5)
  498. elseif FireDir == Direction.RIGHT then
  499. player.TearsOffset = Vector(10,5.5)
  500. elseif FireDir == Direction.UP then
  501. player.TearsOffset = Vector(0,5.5)
  502. elseif FireDir == Direction.LEFT then
  503. player.TearsOffset = Vector(-10,5.5)
  504. end
  505. end
  506.  
  507. -- change tear animation
  508. tear:GetSprite():Play("ChargedTear", true)
  509. else
  510.  
  511. -- change the offset
  512. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the charged shot
  513. or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the charged shot
  514. if FireDir == Direction.DOWN then
  515. player.TearsOffset = Vector(0,5.5)
  516. elseif FireDir == Direction.RIGHT then
  517. player.TearsOffset = Vector(10,5.5)
  518. elseif FireDir == Direction.UP then
  519. player.TearsOffset = Vector(0,5.5)
  520. elseif FireDir == Direction.LEFT then
  521. player.TearsOffset = Vector(-10,5.5)
  522. end
  523. end
  524. -- get the tear animation based on the player fire direction
  525. if FireDir == Direction.DOWN then
  526. tear:GetSprite():Play("ShootDown", true) -- change tear animation to the right direction
  527. elseif FireDir == Direction.RIGHT then
  528. tear:GetSprite():Play("ShootRight", true) -- change tear animation to the right direction
  529. elseif FireDir == Direction.UP then
  530. tear:GetSprite():Play("ShootUp", true) -- change tear animation to the right direction
  531. elseif FireDir == Direction.LEFT then
  532. tear:GetSprite():Play("ShootLeft", true) -- change tear animation to the right direction
  533. end
  534. end
  535. end
  536. end
  537. -- Poop Tear Subtype
  538. if tearData.PoopSubType == nil then
  539. -- Isaac.ConsoleOutput("A new Tear!")
  540. -- check if the tear can be a variant
  541. if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  542. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
  543. or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
  544. or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
  545. or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  546. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
  547. or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
  548. -- get rng
  549. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  550. local roll = rng:RandomInt(100)
  551. -- will the tear be a variant
  552. if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
  553. -- which variants are possible
  554. local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
  555. if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  556. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
  557. table.remove(poopVariant, 5)
  558. end
  559. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
  560. table.remove(poopVariant, 4)
  561. end
  562. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
  563. table.remove(poopVariant, 3)
  564. end
  565. if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  566. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
  567. table.remove(poopVariant, 2)
  568. end
  569. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
  570. table.remove(poopVariant, 1)
  571. end
  572.  
  573. -- saftey check
  574. if poopVariant[1] == nil then -- somehow the poop got emptied
  575. tearData.PoopSubType = 0 -- a normal poop tear
  576. else -- should happen normaly
  577.  
  578. local pickPoop = math.random(#poopVariant)
  579. if poopVariant[pickPoop] == 1 then
  580. tearData.PoopSubType = 1 -- Holy Poop
  581. elseif poopVariant[pickPoop] == 2 then
  582. tearData.PoopSubType = 2 -- Dank Poop
  583. elseif poopVariant[pickPoop] == 3 then
  584. tearData.PoopSubType = 3 -- Golden Poop
  585. elseif poopVariant[pickPoop] == 4 then
  586. tearData.PoopSubType = 4 -- Rainbow Poop
  587. elseif poopVariant[pickPoop] == 5 then
  588. tearData.PoopSubType = 5 -- Red Poop
  589. end
  590. end
  591. if tearData.PoopSubType == 1 then -- Holy Poop
  592. if tearData.HasCostume == nil then
  593. tearData.HasCostume = true
  594. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  595. or sprite:IsPlaying("PiercingTear2") then
  596. -- Midas Touch gets priority
  597. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  598. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_holy.png")
  599. sprite:LoadGraphics()
  600. -- after that comes petrified poop
  601. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  602. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  603. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_holy.png")
  604. sprite:LoadGraphics()
  605. else -- normal piercing tears
  606. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_holy.png")
  607. sprite:LoadGraphics()
  608. end
  609. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  610. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_holy.png")
  611. sprite:LoadGraphics()
  612. else
  613. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_holy.png")
  614. sprite:LoadGraphics()
  615. end
  616. end
  617.  
  618. elseif tearData.PoopSubType == 2 then -- Dank
  619. if tearData.HasCostume == nil then
  620. tearData.HasCostume = true
  621. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  622. or sprite:IsPlaying("PiercingTear2") then
  623. -- Midas Touch gets priority
  624. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  625. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_dank.png")
  626. sprite:LoadGraphics()
  627. -- after that comes petrified poop
  628. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  629. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  630. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_dank.png")
  631. sprite:LoadGraphics()
  632. else -- normal piercing tears
  633. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_dank.png")
  634. sprite:LoadGraphics()
  635. end
  636. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  637. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_dank.png")
  638. sprite:LoadGraphics()
  639. else
  640. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_dank.png")
  641. sprite:LoadGraphics()
  642. end
  643. end
  644.  
  645. elseif tearData.PoopSubType == 3 then -- Golden
  646. if tearData.HasCostume == nil then
  647. tearData.HasCostume = true
  648. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  649. or sprite:IsPlaying("PiercingTear2") then
  650. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_golden.png")
  651. sprite:LoadGraphics()
  652. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  653. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_golden.png")
  654. sprite:LoadGraphics()
  655. else
  656. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_golden.png")
  657. sprite:LoadGraphics()
  658. end
  659. end
  660.  
  661. elseif tearData.PoopSubType == 4 then -- Rainbow
  662. if tearData.HasCostume == nil then
  663. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  664. or sprite:IsPlaying("PiercingTear2") then
  665. -- Midas Touch gets priority
  666. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  667. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_rainbow.png")
  668. sprite:LoadGraphics()
  669. -- after that comes petrified poop
  670. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  671. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  672. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_rainbow.png")
  673. sprite:LoadGraphics()
  674. else -- normal piercing tears
  675. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_rainbow.png")
  676. sprite:LoadGraphics()
  677. end
  678. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  679. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_rainbow.png")
  680. sprite:LoadGraphics()
  681. else
  682. tearData.HasCostume = true
  683. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_rainbow.png")
  684. sprite:LoadGraphics()
  685. end
  686. end
  687.  
  688. elseif tearData.PoopSubType == 5 then -- Red
  689. if tearData.HasCostume == nil then
  690. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  691. or sprite:IsPlaying("PiercingTear2") then
  692. -- Midas Touch gets priority
  693. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  694. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_red.png")
  695. sprite:LoadGraphics()
  696. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  697. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  698. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_red.png")
  699. sprite:LoadGraphics()
  700. else -- normal piercing tears
  701. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_red.png")
  702. sprite:LoadGraphics()
  703. end
  704. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  705. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_red.png")
  706. sprite:LoadGraphics()
  707. else
  708. tearData.HasCostume = true
  709. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_red.png")
  710. sprite:LoadGraphics()
  711. end
  712. end
  713. end
  714. else
  715. -- else is it just a normal poop tear
  716. tearData.PoopSubType = 0
  717. end
  718. else
  719. -- else is it just a normal poop tear
  720. tearData.PoopSubType = 0
  721. end
  722. end
  723. -- adjust stuff for tearData.PoopSubType == 0
  724. if tearData.PoopSubType == 0 then
  725. if tearData.HasCostume == nil then
  726. tearData.HasCostume = true
  727. if (sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  728. or sprite:IsPlaying("PiercingTear2")) then
  729. -- Midas Touch gets priority
  730. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  731. -- Isaac.ConsoleOutput("Normal DMG")
  732. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_normal.png")
  733. sprite:LoadGraphics()
  734. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  735. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  736. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_normal.png")
  737. sprite:LoadGraphics()
  738. end
  739. elseif (player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  740. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP)) then
  741. if sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  742. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_petrified.png")
  743. sprite:LoadGraphics()
  744. else
  745. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_petrified.png")
  746. sprite:LoadGraphics()
  747. end
  748. end
  749. end
  750. end
  751. -- set stats
  752. if (tearData.PoopSubType == 0 -- normal
  753. or tearData.PoopSubType == 1 -- holy
  754. or tearData.PoopSubType == 2 -- dank
  755. or tearData.PoopSubType == 3 -- golden
  756. or tearData.PoopSubType == 4 -- red
  757. or tearData.PoopSubType == 5) -- rainbow
  758. and tearData.SetStats == nil then -- didn't set stats yet
  759. tearData.SetStats = true
  760. -- set damage
  761. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  762. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  763. if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
  764. pooptear.STONE_BONUS = 1
  765. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  766. -- Isaac.ConsoleOutput("Soy DMG")
  767. else
  768. pooptear.STONE_BONUS = 1.5
  769. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  770. -- Isaac.ConsoleOutput("Normal DMG")
  771. end
  772. else
  773. tear.CollisionDamage = tear.CollisionDamage
  774. end
  775. -- set tear size
  776. tear.SpriteScale = Vector((tear.Size / 7.9),(tear.Size / 7.9))
  777. tear:Update()
  778. tear:SetSize(tear.Size * pooptear.SCALE, Vector(pooptear.SCALE, pooptear.SCALE), 8)
  779. end
  780. end
  781. end
  782. end
  783. end
  784. -- Mod:AddCallback(ModCallbacks.MC_POST_TEAR_INIT, Mod.onTearFire)
  785. Mod:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, Mod.onTearFire)
  786.  
  787. function Mod:onLaserFire(laser)
  788.  
  789. local player = Isaac.GetPlayer(0) -- gets the player
  790. local FireDir = player:GetFireDirection() -- gets the fire direction of said player
  791. local laserData = laser:GetData() -- stores the data of the individual lasers
  792. local sprite = laser:GetSprite() -- requiered to change the sprite of the poop lasers
  793.  
  794. -- Isaac.ConsoleOutput("It works.. kinda!")
  795.  
  796. if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then -- if the player has the Miserere item
  797. if not (laser.Variant == 2) -- its not LudoTech, Tech X, Tech2, Tech, Jacobs Ladder, Zero
  798. or not (laser.Variant == 9) then -- its not TechBrim; thanks to Pum from the discord who figured it out
  799. -- change laser variant
  800. -- if laser.SpawnerType == EntityType.ENTITY_PLAYER then
  801. -- Make Poop Laser Subtype
  802. if laserData.PoopSubType == nil then
  803. -- Isaac.ConsoleOutput("A new Tear!")
  804. -- check if the laser could be a variant
  805. if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  806. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
  807. or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
  808. or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
  809. or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  810. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
  811. or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
  812. -- get rng
  813. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  814. local roll = rng:RandomInt(100)
  815. -- will the laser be a variant
  816. if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
  817. -- which variants are possible
  818. local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
  819. if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  820. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
  821. table.remove(poopVariant, 5)
  822. end
  823. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
  824. table.remove(poopVariant, 4)
  825. end
  826. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
  827. table.remove(poopVariant, 3)
  828. end
  829. if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  830. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
  831. table.remove(poopVariant, 2)
  832. end
  833. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
  834. table.remove(poopVariant, 1)
  835. end
  836.  
  837. -- saftey check
  838. if poopVariant[1] == nil then -- somehow the poop got emptied
  839. laserData.PoopSubType = 0 -- a normal poop tear
  840. else -- should happen normaly
  841.  
  842. local pickPoop = math.random(#poopVariant)
  843. if poopVariant[pickPoop] == 1 then
  844. laserData.PoopSubType = 1 -- Holy Poop
  845. elseif poopVariant[pickPoop] == 2 then
  846. laserData.PoopSubType = 2 -- Dank Poop
  847. elseif poopVariant[pickPoop] == 3 then
  848. laserData.PoopSubType = 3 -- Golden Poop
  849. elseif poopVariant[pickPoop] == 4 then
  850. laserData.PoopSubType = 4 -- Rainbow Poop
  851. elseif poopVariant[pickPoop] == 5 then
  852. laserData.PoopSubType = 5 -- Red Poop
  853. end
  854. end
  855. if laserData.PoopSubType == 1 then -- Holy Poop
  856. if laserData.HasCostume == nil then
  857. laserData.HasCostume = true
  858. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_holy.png")
  859. sprite:LoadGraphics()
  860. end
  861.  
  862. elseif laserData.PoopSubType == 2 then -- Dank
  863. if laserData.HasCostume == nil then
  864. laserData.HasCostume = true
  865. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_dank.png")
  866. sprite:LoadGraphics()
  867. end
  868.  
  869. elseif laserData.PoopSubType == 3 then -- Golden
  870. if laserData.HasCostume == nil then
  871. laserData.HasCostume = true
  872. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_golden.png")
  873. sprite:LoadGraphics()
  874. end
  875.  
  876. elseif laserData.PoopSubType == 4 then -- Rainbow
  877. if laserData.HasCostume == nil then
  878. laserData.HasCostume = true
  879. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_rainbow.png")
  880. sprite:LoadGraphics()
  881. end
  882.  
  883. elseif laserData.PoopSubType == 5 then -- Red
  884. if laserData.HasCostume == nil then
  885. laserData.HasCostume = true
  886. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_red.png")
  887. sprite:LoadGraphics()
  888. end
  889. end
  890. else
  891. -- else is it just a normal poop tear
  892. laserData.PoopSubType = 0
  893. end
  894. else
  895. -- else is it just a normal poop tear
  896. laserData.PoopSubType = 0
  897. end
  898. end
  899. -- adjust stuff for tearData.PoopSubType == 0
  900. if laserData.PoopSubType == 0 then
  901. if laserData.HasCostume == nil then
  902. -- if laser.TearFlags == TearFlags.TEAR_PIERCING then
  903. -- if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  904. -- or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  905. -- laserData.HasCostume = true
  906. -- sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_petrified_piercing.png")
  907. -- sprite:LoadGraphics()
  908. -- else
  909.  
  910. -- end
  911.  
  912.  
  913. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  914. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  915. laserData.HasCostume = true
  916. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_petrified.png")
  917. sprite:LoadGraphics()
  918. sprite:RemoveOverlay()
  919. else
  920. laserData.HasCostume = true
  921. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_laser_normal.png")
  922. -- laser:RemoveOverlay()
  923. sprite:LoadGraphics()
  924.  
  925. end
  926. end
  927. end
  928. -- set stats
  929. if (laserData.PoopSubType == 0 -- normal
  930. or laserData.PoopSubType == 1 -- holy
  931. or laserData.PoopSubType == 2 -- dank
  932. or laserData.PoopSubType == 3 -- golden
  933. or laserData.PoopSubType == 4 -- red
  934. or laserData.PoopSubType == 5) -- rainbow
  935. and laserData.SetStats == nil then -- didn't set dmg yet
  936. laserData.SetStats = true
  937. -- set damage
  938. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  939. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  940. if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
  941. pooptear.STONE_BONUS = 1
  942. laser.CollisionDamage = laser.CollisionDamage + pooptear.STONE_BONUS
  943. -- Isaac.ConsoleOutput("Soy DMG")
  944. else
  945. pooptear.STONE_BONUS = 1.5
  946. laser.CollisionDamage = laser.CollisionDamage + pooptear.STONE_BONUS
  947. -- Isaac.ConsoleOutput("Normal DMG")
  948. end
  949. else
  950. laser.CollisionDamage = laser.CollisionDamage
  951. end
  952. end
  953. -- end
  954. end
  955. end
  956. end
  957. Mod:AddCallback(ModCallbacks.MC_POST_LASER_INIT, Mod.onLaserFire)
  958.  
  959. -- on post peffect update
  960. function Mod:onUpdate(player)
  961.  
  962. pooptear.Hue = (game:GetFrameCount() % pooptear.HueWidth) / pooptear.HueWidth -- rainbow poop tear stuff
  963.  
  964. if game:GetFrameCount() == 1 then
  965. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_MISERERE, Vector(250, 250), Vector(0,0), nil)
  966. end
  967.  
  968. -- costume stuff
  969. if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE)
  970. and hasCostume == false then
  971. player:AddNullCostume(Mod.COSTUME_MISERERE)
  972. hasCostume = true
  973. end
  974. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE))
  975. and hasCostume == true then
  976. player:TryRemoveNullCostume(Mod.COSTUME_MISERERE)
  977. hasCostume = false
  978. end
  979.  
  980. -- tear stuff
  981. if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then
  982.  
  983. -- costume stuff
  984. if hasCostume == false then
  985. player:AddNullCostume(Mod.COSTUME_MISERERE)
  986. hasCostume = true
  987. end
  988. for _, entity in pairs(Isaac.GetRoomEntities()) do -- go through every entity in the room
  989. local sprite = entity:GetSprite()
  990. if entity.Type == EntityType.ENTITY_TEAR -- its a tear!
  991. and entity.SpawnerType == EntityType.ENTITY_PLAYER then
  992.  
  993. local tearData = entity:GetData()
  994. local tear = entity:ToTear()
  995.  
  996. if tearData.PoopSubType == 0 then
  997. -- check if the tear collids with an enemy
  998. for _, entities in pairs(Isaac.GetRoomEntities()) do
  999. if entities:IsActiveEnemy()
  1000. and not (entities:IsBoss()) then
  1001. local enemy = entities
  1002. if (enemy.Position:Distance(tear.Position) < 30) then
  1003. if enemy:GetData().HolyPoop == true then
  1004. -- remove any previous entityData
  1005. enemy:GetData().HolyPoop = false
  1006. -- set new entityData
  1007. enemy:GetData().NormalPoop = true
  1008.  
  1009. elseif enemy:GetData().DankPoop == true then
  1010. -- remove any previous entityData
  1011. enemy:GetData().DankPoop = false
  1012. -- set new entityData
  1013. enemy:GetData().NormalPoop = true
  1014.  
  1015. elseif enemy:GetData().GoldenPoop == true then
  1016. -- remove any previous entityData
  1017. enemy:GetData().GoldenPoop = false
  1018. -- set new entityData
  1019. enemy:GetData().NormalPoop = true
  1020.  
  1021. elseif enemy:GetData().RedPoop == true then
  1022. -- remove any previous entityData
  1023. enemy:GetData().RedPoop = false
  1024. -- set new entityData
  1025. enemy:GetData().NormalPoop = true
  1026.  
  1027. elseif enemy:GetData().RainbowPoop == true then
  1028. -- remove any previous entityData
  1029. enemy:GetData().RainbowPoop = false
  1030. -- set new entityData
  1031. enemy:GetData().NormalPoop = true
  1032. else
  1033. -- set entityData
  1034. enemy:GetData().NormalPoop = true
  1035. end
  1036. end
  1037. end
  1038. end
  1039. -- if it collides with a grid
  1040. if (tear.Height >= -5 or tear:CollidesWithGrid()) then
  1041. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  1042. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  1043. -- spawn some rock particles (may need custom ones
  1044. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.ROCK_PARTICLE, 1, entity.Position, Vector(0,0), player):ToEffect()
  1045. poopSplash.SpriteScale = Vector(0.6,0.6)
  1046. poopSplash:Update()
  1047. else
  1048. -- spawn a poop explosion
  1049. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION, 1, entity.Position, Vector(0,0), player):ToEffect()
  1050. poopSplash.SpriteScale = Vector(0.6,0.6)
  1051. poopSplash:Update()
  1052. end
  1053. end
  1054.  
  1055. elseif tearData.PoopSubType == 1 then -- Holy
  1056. -- check if the tear collids with an enemy
  1057. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1058. if entities:IsActiveEnemy() then
  1059. -- and not (entities:IsBoss()) then
  1060. local enemy = entities
  1061. if (enemy.Position:Distance(tear.Position) < 30) then
  1062. -- remove any previous entityData
  1063. -- enemy:GetData().NormalPoop = false
  1064. -- enemy:GetData().DankPoop = false
  1065. -- enemy:GetData().GoldenPoop = false
  1066. -- enemy:GetData().RainbowPoop = false
  1067. -- enemy:GetData().RedPoop = false
  1068. -- set new entityData
  1069. -- enemy:GetData().HolyPoop = true
  1070.  
  1071. if enemy:GetData().NormalPoop == true then
  1072. enemy:GetData().NormalPoop = false
  1073. enemy:GetData().HolyPoop = true
  1074.  
  1075. elseif enemy:GetData().DankPoop == true then
  1076. enemy:GetData().DankPoop = false
  1077. enemy:GetData().HolyPoop = true
  1078.  
  1079. elseif enemy:GetData().GoldenPoop == true then
  1080. enemy:GetData().GoldenPoop = false
  1081. enemy:GetData().HolyPoop = true
  1082.  
  1083. elseif enemy:GetData().RedPoop == true then
  1084. enemy:GetData().RedPoop = false
  1085. enemy:GetData().HolyPoop = true
  1086.  
  1087. elseif enemy:GetData().RainbowPoop == true then
  1088. enemy:GetData().RainbowPoop = false
  1089. enemy:GetData().HolyPoop = true
  1090. else
  1091. -- set entityData
  1092. enemy:GetData().HolyPoop = true
  1093. end
  1094. end
  1095. end
  1096. end
  1097. -- if it collides with a grid
  1098. if (tear.Height >= -5 or tear:CollidesWithGrid()) then
  1099. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1100. poopSplash.SpriteScale = Vector(0.6,0.6)
  1101. poopSplash:SetColor(Color(0.1 ,0.1 ,0.1 ,1 ,208 ,243 ,243), 99, 99, false, false) -- set bright color
  1102. poopSplash:Update()
  1103. end
  1104. elseif tearData.PoopSubType == 2 then -- Dank
  1105. -- check if the tear collids with an enemy
  1106. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1107. if entities:IsActiveEnemy() then
  1108. -- and not (entities:IsBoss()) then
  1109. local enemy = entities
  1110. if (enemy.Position:Distance(tear.Position) < 30) then
  1111. if enemy:GetData().NormalPoop == true then
  1112. enemy:GetData().NormalPoop = false
  1113. enemy:GetData().DankPoop = true
  1114.  
  1115. elseif enemy:GetData().HolyPoop == true then
  1116. enemy:GetData().HolyPoop = false
  1117. enemy:GetData().DankPoop = true
  1118.  
  1119. elseif enemy:GetData().GoldenPoop == true then
  1120. enemy:GetData().GoldenPoop = false
  1121. enemy:GetData().DankPoop = true
  1122.  
  1123. elseif enemy:GetData().RedPoop == true then
  1124. enemy:GetData().RedPoop = false
  1125. enemy:GetData().DankPoop = true
  1126.  
  1127. elseif enemy:GetData().RainbowPoop == true then
  1128. enemy:GetData().RainbowPoop = false
  1129. enemy:GetData().DankPoop = true
  1130. else
  1131. -- set entityData
  1132. enemy:GetData().DankPoop = true
  1133. end
  1134. end
  1135. end
  1136. end
  1137. -- if it collides with a grid
  1138. if (tear.Height >= -5 or tear:CollidesWithGrid()) then
  1139. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1140. poopSplash.SpriteScale = Vector(0.6,0.6)
  1141. poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,36 ,32 ,31), 99, 99, false, false) -- set dark color
  1142. poopSplash:Update()
  1143. end
  1144. elseif tearData.PoopSubType == 3 then -- Golden
  1145. -- check if the tear collids with an enemy
  1146. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1147. if entities:IsActiveEnemy() then
  1148. -- and not (entities:IsBoss()) then
  1149. local enemy = entities
  1150. if (enemy.Position:Distance(tear.Position) < 30) then
  1151. if enemy:GetData().NormalPoop == true then
  1152. enemy:GetData().NormalPoop = false
  1153. enemy:GetData().GoldenPoop = true
  1154.  
  1155. elseif enemy:GetData().HolyPoop == true then
  1156. enemy:GetData().HolyPoop = false
  1157. enemy:GetData().GoldenPoop = true
  1158.  
  1159. elseif enemy:GetData().DankPoop == true then
  1160. enemy:GetData().DankPoop = false
  1161. enemy:GetData().GoldenPoop = true
  1162.  
  1163. elseif enemy:GetData().RedPoop == true then
  1164. enemy:GetData().RedPoop = false
  1165. enemy:GetData().GoldenPoop = true
  1166.  
  1167. elseif enemy:GetData().RainbowPoop == true then
  1168. enemy:GetData().RainbowPoop = false
  1169. enemy:GetData().GoldenPoop = true
  1170. else
  1171. -- set entityData
  1172. enemy:GetData().GoldenPoop = true
  1173. end
  1174. end
  1175. end
  1176. end
  1177. -- if it collides with a grid
  1178. if (tear.Height >= -5 or tear:CollidesWithGrid()) then
  1179. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1180. poopSplash.SpriteScale = Vector(0.6,0.6)
  1181. poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,232 ,190 ,64), 99, 99, false, false) -- set golden color
  1182. poopSplash:Update()
  1183. end
  1184. elseif tearData.PoopSubType == 4 then -- Rainbow
  1185. -- check if the tear collids with an enemy
  1186. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1187. if entities:IsActiveEnemy() then
  1188. -- and not (entities:IsBoss()) then
  1189. local enemy = entities
  1190. if (enemy.Position:Distance(tear.Position) < 30) then
  1191.  
  1192. if enemy:GetData().NormalPoop == true then
  1193. enemy:GetData().NormalPoop = false
  1194. enemy:GetData().RainbowPoop = true
  1195.  
  1196. elseif enemy:GetData().HolyPoop == true then
  1197. enemy:GetData().HolyPoop = false
  1198. enemy:GetData().RainbowPoop = true
  1199.  
  1200. elseif enemy:GetData().DankPoop == true then
  1201. enemy:GetData().DankPoop = false
  1202. enemy:GetData().RainbowPoop = true
  1203.  
  1204. elseif enemy:GetData().GoldenPoop == true then
  1205. enemy:GetData().GoldenPoop = false
  1206. enemy:GetData().RainbowPoop = true
  1207.  
  1208. elseif enemy:GetData().RedPoop == true then
  1209. enemy:GetData().RedPoop = false
  1210. enemy:GetData().RainbowPoop = true
  1211. else
  1212. -- set entityData
  1213. enemy:GetData().RainbowPoop = true
  1214. end
  1215. end
  1216. end
  1217. end
  1218. -- if it collides with a grid
  1219. if (tear.Height >= -5 or tear:CollidesWithGrid()) then
  1220. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1221. poopSplash.SpriteScale = Vector(0.6,0.6)
  1222. poopSplash:SetColor(hsv2rgb(pooptear.Hue,1,1,1), 0, 0, false, false) -- set rainbow color
  1223. poopSplash:Update()
  1224. end
  1225. elseif tearData.PoopSubType == 5 then -- Red
  1226. -- check if the tear collids with an enemy
  1227. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1228. if entities:IsActiveEnemy() then
  1229. -- and not (entities:IsBoss()) then
  1230. local enemy = entities
  1231. if (enemy.Position:Distance(tear.Position) < 30) then
  1232. if enemy:GetData().NormalPoop == true then
  1233. enemy:GetData().NormalPoop = false
  1234. enemy:GetData().RedPoop = true
  1235.  
  1236. elseif enemy:GetData().HolyPoop == true then
  1237. enemy:GetData().HolyPoop = false
  1238. enemy:GetData().RedPoop = true
  1239.  
  1240. elseif enemy:GetData().DankPoop == true then
  1241. enemy:GetData().DankPoop = false
  1242. enemy:GetData().RedPoop = true
  1243.  
  1244. elseif enemy:GetData().GoldenPoop == true then
  1245. enemy:GetData().GoldenPoop = false
  1246. enemy:GetData().RedPoop = true
  1247.  
  1248. elseif enemy:GetData().RainbowPoop == true then
  1249. enemy:GetData().RainbowPoop = false
  1250. enemy:GetData().RedPoop = true
  1251. else
  1252. -- set entityData
  1253. enemy:GetData().RedPoop = true
  1254. end
  1255. end
  1256. end
  1257. end
  1258. -- if it collides with a grid
  1259. if (tear.Height >= -5 or tear:CollidesWithGrid()) then
  1260. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1261. poopSplash.SpriteScale = Vector(0.6,0.6)
  1262. poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,90 ,18 ,28), 99, 99, false, false) -- set red color
  1263. poopSplash:Update()
  1264. end
  1265. end
  1266. elseif entity.Type == EntityType.ENTITY_LASER -- its a laser!
  1267. and entity.SpawnerType == EntityType.ENTITY_PLAYER then
  1268. if entity.Variant == 1 then -- it is a Brimstone, LudoBrim, BrimX laser
  1269.  
  1270. local laserData = entity:GetData()
  1271. local laser = entity:ToLaser()
  1272.  
  1273. if laserData.PoopSubType == 0 then
  1274. -- color the laser
  1275. -- laser:SetColor(hsv2rgb(pooptear.Hue,1,1,1), 0, 0, false, false) -- set rainbow color
  1276. -- laser.Color = Color(1,1,1,1,-138,83,64)
  1277. -- check if the tear collids with an enemy
  1278. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1279. if entities:IsActiveEnemy()
  1280. and not (entities:IsBoss()) then
  1281. -- Isaac.ConsoleOutput("Still Looking")
  1282. local enemy = entities
  1283.  
  1284. -- laser detection code
  1285. local p1 = laser.Position + Vector(0,-25)
  1286. local p2 = laser:GetEndPoint()
  1287. local p3 = enemy.Position + Vector(0,-15)
  1288.  
  1289. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1290. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1291. local vP1_P2_norm = vP1_P2:Normalized()
  1292. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1293. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1294. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1295.  
  1296. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1297.  
  1298. -- Isaac.ConsoleOutput("Step forward")
  1299. if enemy:GetData().HolyPoop == true then
  1300. -- remove any previous entityData
  1301. enemy:GetData().HolyPoop = false
  1302. -- set new entityData
  1303. enemy:GetData().NormalPoop = true
  1304.  
  1305. elseif enemy:GetData().DankPoop == true then
  1306. enemy:GetData().DankPoop = false
  1307. enemy:GetData().NormalPoop = true
  1308.  
  1309. elseif enemy:GetData().GoldenPoop == true then
  1310. enemy:GetData().GoldenPoop = false
  1311. enemy:GetData().NormalPoop = true
  1312.  
  1313. elseif enemy:GetData().RedPoop == true then
  1314. enemy:GetData().RedPoop = false
  1315. enemy:GetData().NormalPoop = true
  1316.  
  1317. elseif enemy:GetData().RainbowPoop == true then
  1318. enemy:GetData().RainbowPoop = false
  1319. enemy:GetData().NormalPoop = true
  1320. else
  1321. -- set entityData
  1322. enemy:GetData().NormalPoop = true
  1323. -- Isaac.ConsoleOutput("Brimstone Poop!")
  1324. end
  1325. end
  1326. end
  1327. end
  1328. -- check for laser impact
  1329. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1330. if entities.Type == EntityType.ENTITY_EFFECT
  1331. and entities.Variant == EffectVariant.LASER_IMPACT then
  1332. -- Isaac.ConsoleOutput("Still")
  1333. local impact = entities:ToEffect()
  1334. local sprite = impact:GetSprite()
  1335.  
  1336. local p1 = laser.Position + Vector(0,-25)
  1337. local p2 = laser:GetEndPoint()
  1338. local p3 = impact.Position + Vector(0,-15)
  1339.  
  1340. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1341. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1342. local vP1_P2_norm = vP1_P2:Normalized()
  1343. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1344. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1345. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1346.  
  1347. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1348. if impact:GetData().SpriteChange == nil then
  1349. impact:GetData().SpriteChange = true
  1350.  
  1351. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact.png")
  1352.  
  1353. -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
  1354. sprite:LoadGraphics()
  1355. -- sprite:Update()
  1356. -- Isaac.ConsoleOutput("Laser Impact!")
  1357. end
  1358. end
  1359. end
  1360. end
  1361. elseif laserData.PoopSubType == 1 then -- Holy
  1362. -- check if the tear collids with an enemy
  1363. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1364. if entities:IsActiveEnemy()
  1365. and not (entities:IsBoss()) then
  1366. -- Isaac.ConsoleOutput("Still Looking")
  1367. local enemy = entities
  1368.  
  1369. -- laser detection code
  1370. local p1 = laser.Position + Vector(0,-25)
  1371. local p2 = laser:GetEndPoint()
  1372. local p3 = enemy.Position + Vector(0,-15)
  1373.  
  1374. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1375. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1376. local vP1_P2_norm = vP1_P2:Normalized()
  1377. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1378. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1379. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1380.  
  1381. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1382.  
  1383. if enemy:GetData().NormalPoop == true then
  1384. enemy:GetData().NormalPoop = false
  1385. enemy:GetData().HolyPoop = true
  1386.  
  1387. elseif enemy:GetData().DankPoop == true then
  1388. enemy:GetData().DankPoop = false
  1389. enemy:GetData().HolyPoop = true
  1390.  
  1391. elseif enemy:GetData().GoldenPoop == true then
  1392. enemy:GetData().GoldenPoop = false
  1393. enemy:GetData().HolyPoop = true
  1394.  
  1395. elseif enemy:GetData().RedPoop == true then
  1396. enemy:GetData().RedPoop = false
  1397. enemy:GetData().HolyPoop = true
  1398.  
  1399. elseif enemy:GetData().RainbowPoop == true then
  1400. enemy:GetData().RainbowPoop = false
  1401. enemy:GetData().HolyPoop = true
  1402. else
  1403. -- set entityData
  1404. enemy:GetData().HolyPoop = true
  1405. end
  1406. end
  1407. end
  1408. end
  1409. -- check for laser impact
  1410. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1411. if entities.Type == EntityType.ENTITY_EFFECT
  1412. and entities.Variant == EffectVariant.LASER_IMPACT then
  1413. -- Isaac.ConsoleOutput("Still")
  1414. local impact = entities:ToEffect()
  1415. local sprite = impact:GetSprite()
  1416.  
  1417. local p1 = laser.Position + Vector(0,-25)
  1418. local p2 = laser:GetEndPoint()
  1419. local p3 = impact.Position + Vector(0,-15)
  1420.  
  1421. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1422. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1423. local vP1_P2_norm = vP1_P2:Normalized()
  1424. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1425. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1426. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1427.  
  1428. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1429. if impact:GetData().SpriteChange == nil then
  1430. impact:GetData().SpriteChange = true
  1431.  
  1432. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_holy.png")
  1433.  
  1434. -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
  1435. sprite:LoadGraphics()
  1436. -- sprite:Update()
  1437. -- Isaac.ConsoleOutput("Laser Impact!")
  1438. end
  1439. end
  1440. end
  1441. end
  1442. elseif laserData.PoopSubType == 2 then -- Dank
  1443. -- check if the tear collids with an enemy
  1444. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1445. if entities:IsActiveEnemy()
  1446. and not (entities:IsBoss()) then
  1447. -- Isaac.ConsoleOutput("Still Looking")
  1448. local enemy = entities
  1449.  
  1450. -- laser detection code
  1451. local p1 = laser.Position + Vector(0,-25)
  1452. local p2 = laser:GetEndPoint()
  1453. local p3 = enemy.Position + Vector(0,-15)
  1454.  
  1455. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1456. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1457. local vP1_P2_norm = vP1_P2:Normalized()
  1458. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1459. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1460. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1461.  
  1462. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1463.  
  1464. if enemy:GetData().NormalPoop == true then
  1465. enemy:GetData().NormalPoop = false
  1466. enemy:GetData().DankPoop = true
  1467.  
  1468. elseif enemy:GetData().HolyPoop == true then
  1469. enemy:GetData().HolyPoop = false
  1470. enemy:GetData().DankPoop = true
  1471.  
  1472. elseif enemy:GetData().GoldenPoop == true then
  1473. enemy:GetData().GoldenPoop = false
  1474. enemy:GetData().DankPoop = true
  1475.  
  1476. elseif enemy:GetData().RedPoop == true then
  1477. enemy:GetData().RedPoop = false
  1478. enemy:GetData().DankPoop = true
  1479.  
  1480. elseif enemy:GetData().RainbowPoop == true then
  1481. enemy:GetData().RainbowPoop = false
  1482. enemy:GetData().DankPoop = true
  1483. else
  1484. -- set entityData
  1485. enemy:GetData().DankPoop = true
  1486. end
  1487. end
  1488. end
  1489. end
  1490. -- check for laser impact
  1491. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1492. if entities.Type == EntityType.ENTITY_EFFECT
  1493. and entities.Variant == EffectVariant.LASER_IMPACT then
  1494. -- Isaac.ConsoleOutput("Still")
  1495. local impact = entities:ToEffect()
  1496. local sprite = impact:GetSprite()
  1497.  
  1498. local p1 = laser.Position + Vector(0,-25)
  1499. local p2 = laser:GetEndPoint()
  1500. local p3 = impact.Position + Vector(0,-15)
  1501.  
  1502. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1503. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1504. local vP1_P2_norm = vP1_P2:Normalized()
  1505. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1506. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1507. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1508.  
  1509. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1510. if impact:GetData().SpriteChange == nil then
  1511. impact:GetData().SpriteChange = true
  1512.  
  1513. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_dank.png")
  1514.  
  1515. -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
  1516. sprite:LoadGraphics()
  1517. -- sprite:Update()
  1518. -- Isaac.ConsoleOutput("Laser Impact!")
  1519. end
  1520. end
  1521. end
  1522. end
  1523. elseif laserData.PoopSubType == 3 then -- Golden
  1524. -- check if the tear collids with an enemy
  1525. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1526. if entities:IsActiveEnemy()
  1527. and not (entities:IsBoss()) then
  1528. -- Isaac.ConsoleOutput("Still Looking")
  1529. local enemy = entities
  1530.  
  1531. -- laser detection code
  1532. local p1 = laser.Position + Vector(0,-25)
  1533. local p2 = laser:GetEndPoint()
  1534. local p3 = enemy.Position + Vector(0,-15)
  1535.  
  1536. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1537. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1538. local vP1_P2_norm = vP1_P2:Normalized()
  1539. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1540. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1541. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1542.  
  1543. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1544.  
  1545. if enemy:GetData().NormalPoop == true then
  1546. enemy:GetData().NormalPoop = false
  1547. enemy:GetData().GoldenPoop = true
  1548.  
  1549. elseif enemy:GetData().HolyPoop == true then
  1550. enemy:GetData().HolyPoop = false
  1551. enemy:GetData().GoldenPoop = true
  1552.  
  1553. elseif enemy:GetData().DankPoop == true then
  1554. enemy:GetData().DankPoop = false
  1555. enemy:GetData().GoldenPoop = true
  1556.  
  1557. elseif enemy:GetData().RedPoop == true then
  1558. enemy:GetData().RedPoop = false
  1559. enemy:GetData().GoldenPoop = true
  1560.  
  1561. elseif enemy:GetData().RainbowPoop == true then
  1562. enemy:GetData().RainbowPoop = false
  1563. enemy:GetData().GoldenPoop = true
  1564. else
  1565. -- set entityData
  1566. enemy:GetData().GoldenPoop = true
  1567. end
  1568. end
  1569. end
  1570. end
  1571. -- check for laser impact
  1572. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1573. if entities.Type == EntityType.ENTITY_EFFECT
  1574. and entities.Variant == EffectVariant.LASER_IMPACT then
  1575. -- Isaac.ConsoleOutput("Still")
  1576. local impact = entities:ToEffect()
  1577. local sprite = impact:GetSprite()
  1578.  
  1579. local p1 = laser.Position + Vector(0,-25)
  1580. local p2 = laser:GetEndPoint()
  1581. local p3 = impact.Position + Vector(0,-15)
  1582.  
  1583. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1584. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1585. local vP1_P2_norm = vP1_P2:Normalized()
  1586. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1587. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1588. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1589.  
  1590. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1591. if impact:GetData().SpriteChange == nil then
  1592. impact:GetData().SpriteChange = true
  1593.  
  1594. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_golden.png")
  1595.  
  1596. -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
  1597. sprite:LoadGraphics()
  1598. -- sprite:Update()
  1599. -- Isaac.ConsoleOutput("Laser Impact!")
  1600. end
  1601. end
  1602. end
  1603. end
  1604. elseif laserData.PoopSubType == 4 then -- Rainbow
  1605. -- check if the tear collids with an enemy
  1606. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1607. if entities:IsActiveEnemy()
  1608. and not (entities:IsBoss()) then
  1609. -- Isaac.ConsoleOutput("Still Looking")
  1610. local enemy = entities
  1611.  
  1612. -- laser detection code
  1613. local p1 = laser.Position + Vector(0,-25)
  1614. local p2 = laser:GetEndPoint()
  1615. local p3 = enemy.Position + Vector(0,-15)
  1616.  
  1617. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1618. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1619. local vP1_P2_norm = vP1_P2:Normalized()
  1620. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1621. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1622. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1623.  
  1624. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1625.  
  1626. if enemy:GetData().NormalPoop == true then
  1627. enemy:GetData().NormalPoop = false
  1628. enemy:GetData().RainbowPoop = true
  1629.  
  1630. elseif enemy:GetData().HolyPoop == true then
  1631. enemy:GetData().HolyPoop = false
  1632. enemy:GetData().RainbowPoop = true
  1633.  
  1634. elseif enemy:GetData().DankPoop == true then
  1635. enemy:GetData().DankPoop = false
  1636. enemy:GetData().RainbowPoop = true
  1637.  
  1638. elseif enemy:GetData().GoldenPoop == true then
  1639. enemy:GetData().GoldenPoop = false
  1640. enemy:GetData().RainbowPoop = true
  1641.  
  1642. elseif enemy:GetData().RedPoop == true then
  1643. enemy:GetData().RedPoop = false
  1644. enemy:GetData().RainbowPoop = true
  1645. else
  1646. -- set entityData
  1647. enemy:GetData().RainbowPoop = true
  1648. end
  1649. end
  1650. end
  1651. end -- check for laser impact
  1652. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1653. if entities.Type == EntityType.ENTITY_EFFECT
  1654. and entities.Variant == EffectVariant.LASER_IMPACT then
  1655. -- Isaac.ConsoleOutput("Still")
  1656. local impact = entities:ToEffect()
  1657. local sprite = impact:GetSprite()
  1658.  
  1659. local p1 = laser.Position + Vector(0,-25)
  1660. local p2 = laser:GetEndPoint()
  1661. local p3 = impact.Position + Vector(0,-15)
  1662.  
  1663. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1664. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1665. local vP1_P2_norm = vP1_P2:Normalized()
  1666. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1667. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1668. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1669.  
  1670. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1671. if impact:GetData().SpriteChange == nil then
  1672. impact:GetData().SpriteChange = true
  1673.  
  1674. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_blank.png")
  1675.  
  1676. -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
  1677. sprite:LoadGraphics()
  1678. -- sprite:Update()
  1679. -- Isaac.ConsoleOutput("Laser Impact!")
  1680. end
  1681. end
  1682. end
  1683. end
  1684. elseif laserData.PoopSubType == 5 then -- Red
  1685. -- check if the tear collids with an enemy
  1686. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1687. if entities:IsActiveEnemy()
  1688. and not (entities:IsBoss()) then
  1689. -- Isaac.ConsoleOutput("Still Looking")
  1690. local enemy = entities
  1691.  
  1692. -- laser detection code
  1693. local p1 = laser.Position + Vector(0,-25)
  1694. local p2 = laser:GetEndPoint()
  1695. local p3 = enemy.Position + Vector(0,-15)
  1696.  
  1697. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1698. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1699. local vP1_P2_norm = vP1_P2:Normalized()
  1700. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1701. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1702. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1703.  
  1704. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1705.  
  1706. if enemy:GetData().NormalPoop == true then
  1707. enemy:GetData().NormalPoop = false
  1708. enemy:GetData().RedPoop = true
  1709.  
  1710. elseif enemy:GetData().HolyPoop == true then
  1711. enemy:GetData().HolyPoop = false
  1712. enemy:GetData().RedPoop = true
  1713.  
  1714. elseif enemy:GetData().DankPoop == true then
  1715. enemy:GetData().DankPoop = false
  1716. enemy:GetData().RedPoop = true
  1717.  
  1718. elseif enemy:GetData().GoldenPoop == true then
  1719. enemy:GetData().GoldenPoop = false
  1720. enemy:GetData().RedPoop = true
  1721.  
  1722. elseif enemy:GetData().RainbowPoop == true then
  1723. enemy:GetData().RainbowPoop = false
  1724. enemy:GetData().RedPoop = true
  1725. else
  1726. -- set entityData
  1727. enemy:GetData().RedPoop = true
  1728. -- Isaac.ConsoleOutput("Red Pooooop!")
  1729. end
  1730. end
  1731. end
  1732. end
  1733. -- check for laser impact
  1734. for _, entities in pairs(Isaac.GetRoomEntities()) do
  1735. if entities.Type == EntityType.ENTITY_EFFECT
  1736. and entities.Variant == EffectVariant.LASER_IMPACT then
  1737. -- Isaac.ConsoleOutput("Still")
  1738. local impact = entities:ToEffect()
  1739. local sprite = impact:GetSprite()
  1740.  
  1741. local p1 = laser.Position + Vector(0,-25)
  1742. local p2 = laser:GetEndPoint()
  1743. local p3 = impact.Position + Vector(0,-15)
  1744.  
  1745. local vP1_P3 = Vector(p3.X - p1.X, p3.Y - p1.Y)
  1746. local vP1_P2 = Vector(p2.X - p1.X, p2.Y - p1.Y)
  1747. local vP1_P2_norm = vP1_P2:Normalized()
  1748. local vP1_P2_leftnorm = Vector(-vP1_P2_norm.Y, vP1_P2_norm.X)
  1749. local projectedOnNormal = vP1_P3:Dot(vP1_P2_leftnorm:Normalized())
  1750. local projectedOnP1P2 = vP1_P3:Dot(vP1_P2_norm:Normalized())
  1751.  
  1752. if math.abs(projectedOnNormal) < 20 and vP1_P2:Dot(vP1_P3) > 0 then
  1753. if impact:GetData().SpriteChange == nil then
  1754. impact:GetData().SpriteChange = true
  1755.  
  1756. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_vomit_impact_red.png")
  1757.  
  1758. -- sprite:Load("gfx/1000.050_brimstoneimpact.anm2", true)
  1759. sprite:LoadGraphics()
  1760. -- sprite:Update()
  1761. -- Isaac.ConsoleOutput("Laser Impact!")
  1762. end
  1763. end
  1764. end
  1765. end
  1766. end
  1767. end
  1768. -- elseif entity.Type == EntityType.ENTITY_LASER_IMPACT -- its a laser impact!
  1769. -- and entity.SpawnerType == EntityType.ENTITY_PLAYER then
  1770. -- local spawner = entity.SpawnerType
  1771. -- if spawner:GetData().PoopSubType == 0 then
  1772.  
  1773. --end
  1774. end
  1775. end
  1776. end
  1777. end
  1778. Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.onUpdate)
  1779.  
  1780. function Mod:onCache(player, cacheFlag)
  1781. if cacheFlag == CacheFlag.CACHE_TEARCOLOR then
  1782. if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then
  1783. -- player.TearColor = Color(0.5, 0.5, 0.5, 1, 0, 0, 0)
  1784. -- player.LaserColor = Color(1,1,1,1,255,255,255)
  1785. end
  1786. end
  1787. if cacheFlag == CacheFlag.CACHE_SHOTSPEED and player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then
  1788. player.ShotSpeed = player.ShotSpeed - 0.20
  1789. end
  1790. end
  1791.  
  1792. Mod:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Mod.onCache)
  1793.  
  1794. function Mod:onDamage(entity, amt, flag, source, countdown)
  1795.  
  1796. -- local tearData = source:GetData()
  1797. local player = Isaac.GetPlayer(0)
  1798. local onBlacklist = false -- keeps track if an enemy should be turned to stone or not
  1799. -- get rng
  1800. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  1801. local roll = rng:RandomInt(100) -- used for turning enemies into poop
  1802. local rolltwo = rng:RandomInt(100) -- used for spawning blue flies and poop explosions
  1803.  
  1804. if source.Type == EntityType.ENTITY_TEAR
  1805. and (source.Variant == TearVariant.POOPTEAR
  1806. or source.Variant == TearVariant.HUNGRY
  1807. or source.Variant == TearVariant.PUPULA
  1808. or source.Variant == TearVariant.PUPULA_BLOOD) then
  1809.  
  1810. if entity:IsActiveEnemy()
  1811. and not (entity:IsBoss()) then
  1812.  
  1813. -- set up a blacklist for the enemies which shouldn't be turned into poop
  1814. if entity.Type == EntityType.ENTITY_STONEHEAD -- normal grimace
  1815. or entity.Type == EntityType.ENTITY_STONE_EYE -- stone eyes
  1816. or entity.Type == EntityType.ENTITY_CONSTANT_STONE_SHOOTER -- constant shooting grimace
  1817. or entity.Type == EntityType.ENTITY_BRIMSTONE_HEAD -- brimstone grimace
  1818. or entity.Type == EntityType.ENTITY_STONEY -- walking grimace
  1819. or entity.Type == EntityType.ENTITY_POKY -- pokies and slides
  1820. or entity.Type == EntityType.ENTITY_WALL_HUGGER -- wall huggers
  1821. or entity.Type == EntityType.ENTITY_DEATHS_HEAD -- deaths head (invisible)
  1822. or entity.Type == EntityType.ENTITY_MASK -- the mask enemy without its heart
  1823. or entity.Type == EntityType.ENTITY_GRUB -- Larry Jr. replacement
  1824. or entity.Type == EntityType.ENTITY_ETERNALFLY -- Eternal fly which flies around corn poop
  1825. or entity.Type == EntityType.ENTITY_DIP -- poop enemy
  1826. or entity.Type == EntityType.ENTITY_SQUIRT -- stronger poop enemy
  1827. or entity.Type == EntityType.ENTITY_DINGA -- ultimate poop enemy
  1828. or entity.Type == EntityType.ENTITY_CORN_MINE then -- already poop
  1829. -- set the enemy on the blacklist
  1830. onBlacklist = true
  1831. -- Isaac.ConsoleOutput("onBlacklist!")
  1832. else
  1833. -- take the enemy from the blacklist
  1834. onBlacklist = false
  1835. end
  1836.  
  1837. if entity:GetData().NormalPoop == true then
  1838. if roll <= pooptear.TURN_CHANCE -- chance to turn the enemy into normal poop
  1839. and onBlacklist == false then -- and the enemy can be turned into poop
  1840.  
  1841. -- Isaac.ConsoleOutput("Don't make poop!")
  1842.  
  1843. entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop
  1844. entity:Remove()
  1845. -- turn the enemy into poop
  1846. Isaac.GridSpawn(GridEntityType.GRID_POOP, 0, entity.Position, true)
  1847.  
  1848. else
  1849. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  1850. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  1851. -- spawn some rock particles (may need custom ones
  1852. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.ROCK_PARTICLE, 1, entity.Position, Vector(0,0), player):ToEffect()
  1853. poopSplash.SpriteScale = Vector(0.6,0.6)
  1854. poopSplash:Update()
  1855. else
  1856. -- spawn a poop explosion
  1857. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION, 1, entity.Position, Vector(0,0), player):ToEffect()
  1858. poopSplash.SpriteScale = Vector(0.6,0.6)
  1859. poopSplash:Update()
  1860. end
  1861. entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop too
  1862.  
  1863. -- Lil' Larva synergy / spawns blue flies
  1864. LilLarvaSyn(entity, rolltwo)
  1865.  
  1866. -- Brown Cap synergy / spawns explosions
  1867. BrownCapSyn(entity, rolltwo)
  1868. end
  1869.  
  1870. elseif entity:GetData().HolyPoop == true then
  1871. if roll <= pooptear.TURN_CHANCE_HOLY -- chance to turn the enemy into holy poop
  1872. and onBlacklist == false then -- and the enemy can be turned into poop
  1873.  
  1874. entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop
  1875. entity:Remove()
  1876. -- Isaac.ConsoleOutput("Holy Poop!")
  1877. Isaac.GridSpawn(GridEntityType.GRID_POOP, 6, entity.Position, true)
  1878. else
  1879. -- spawn a holy poop splash
  1880. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1881. poopSplash.SpriteScale = Vector(0.6,0.6)
  1882. poopSplash:SetColor(Color(0.1 ,0.1 ,0.1 ,1 ,208 ,243 ,243), 99, 99, false, false) -- set bright color
  1883. poopSplash:Update()
  1884. entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop too
  1885.  
  1886. -- Lil' Larva synergy / spawns blue flies
  1887. LilLarvaSyn(entity, rolltwo)
  1888.  
  1889. -- Brown Cap synergy / spawns explosions
  1890. BrownCapSyn(entity, rolltwo)
  1891. end
  1892.  
  1893. elseif entity:GetData().DankPoop == true then
  1894. if roll <= pooptear.TURN_CHANCE_DANK -- chance to turn the enemy into dank poop
  1895. and onBlacklist == false then -- and the enemy can be turned into poop
  1896.  
  1897. entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop
  1898. entity:Remove()
  1899. -- Isaac.ConsoleOutput("Dank Poop!")
  1900. Isaac.GridSpawn(GridEntityType.GRID_POOP, 5, entity.Position, true)
  1901. else
  1902. -- spawn a dank poop splash
  1903. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1904. poopSplash.SpriteScale = Vector(0.6,0.6)
  1905. poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,36 ,32 ,31), 99, 99, false, false) -- set dark color
  1906. poopSplash:Update()
  1907. entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop too
  1908.  
  1909. -- Lil' Larva synergy / spawns blue flies
  1910. LilLarvaSyn(entity, rolltwo)
  1911.  
  1912. -- Brown Cap synergy / spawns explosions
  1913. BrownCapSyn(entity, rolltwo)
  1914. end
  1915.  
  1916. elseif entity:GetData().GoldenPoop == true then
  1917. if roll <= pooptear.TURN_CHANCE_GOLDEN -- chance to turn the enemy into golden poop
  1918. and onBlacklist == false then -- and the enemy can be turned into poop
  1919.  
  1920. entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop
  1921. entity:Remove()
  1922. -- Isaac.ConsoleOutput("Golden Poop!")
  1923. Isaac.GridSpawn(GridEntityType.GRID_POOP, 3, entity.Position, true)
  1924. else
  1925. -- spawn a golden poop splash
  1926. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1927. poopSplash.SpriteScale = Vector(0.6,0.6)
  1928. poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,232 ,190 ,64), 99, 99, false, false) -- set golden color
  1929. poopSplash:Update()
  1930. entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop too
  1931.  
  1932. -- Lil' Larva synergy / spawns blue flies
  1933. LilLarvaSyn(entity, rolltwo)
  1934.  
  1935. -- Brown Cap synergy / spawns explosions
  1936. BrownCapSyn(entity, rolltwo)
  1937. end
  1938.  
  1939. elseif entity:GetData().RainbowPoop == true then
  1940. if roll <= pooptear.TURN_CHANCE_RAINBOW -- chance to turn the enemy into rainbow poop
  1941. and onBlacklist == false then -- and the enemy can be turned into poop
  1942.  
  1943. entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop
  1944. entity:Remove()
  1945. -- Isaac.ConsoleOutput("Rainbow Poop!")
  1946. Isaac.GridSpawn(GridEntityType.GRID_POOP, 4, entity.Position, true)
  1947. else
  1948. -- spawn a rainbow poop splash
  1949. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1950. poopSplash.SpriteScale = Vector(0.6,0.6)
  1951. poopSplash:SetColor(hsv2rgb(pooptear.Hue,1,1,1), 0, 0, false, false) -- set rainbow color
  1952. poopSplash:Update()
  1953. entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop too
  1954.  
  1955. -- Lil' Larva synergy / spawns blue flies
  1956. LilLarvaSyn(entity, rolltwo)
  1957.  
  1958. -- Brown Cap synergy / spawns explosions
  1959. BrownCapSyn(entity, rolltwo)
  1960. end
  1961.  
  1962. elseif entity:GetData().RedPoop == true then
  1963. if roll <= pooptear.TURN_CHANCE_RED -- chance to turn the enemy into red poop
  1964. and onBlacklist == false then -- and the enemy can be turned into poop
  1965.  
  1966. entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop
  1967. entity:Remove()
  1968. -- Isaac.ConsoleOutput("Red Poop!")
  1969. Isaac.GridSpawn(GridEntityType.GRID_POOP, 1, entity.Position, true)
  1970. else
  1971. entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop too
  1972. -- spawn a red poop splash
  1973. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION2, 1, entity.Position, Vector(0,0), player):ToEffect()
  1974. poopSplash.SpriteScale = Vector(0.6,0.6)
  1975. poopSplash:SetColor(Color(0.01 ,0.01 ,0.01 ,1 ,90 ,18 ,28), 99, 99, false, false) -- set red color
  1976. poopSplash:Update()
  1977.  
  1978. -- Lil' Larva synergy / spawns blue flies
  1979. LilLarvaSyn(entity, rolltwo)
  1980.  
  1981. -- Brown Cap synergy / spawns explosions
  1982. BrownCapSyn(entity, rolltwo)
  1983. end
  1984. end
  1985. elseif entity:IsBoss() then
  1986. -- Lil' Larva synergy / spawns blue flies
  1987. LilLarvaSyn(entity, rolltwo)
  1988.  
  1989. -- Brown Cap synergy / spawns explosions
  1990. BrownCapSyn(entity, rolltwo)
  1991. end
  1992. end
  1993. if source.Type == EntityType.ENTITY_PLAYER
  1994. and flag & DamageFlag.DAMAGE_LASER == DamageFlag.DAMAGE_LASER then
  1995. --and source.Variant == 1 then -- the laser is a Brimstone, LudoBrim or BrimX laser
  1996. Isaac.ConsoleOutput("Damage Source")
  1997. if entity:IsActiveEnemy()
  1998. and not (entity:IsBoss()) then
  1999.  
  2000. -- set up a blacklist for the enemies which shouldn't be turned into poop
  2001. if entity.Type == EntityType.ENTITY_STONEHEAD -- normal grimace
  2002. or entity.Type == EntityType.ENTITY_STONE_EYE -- stone eyes
  2003. or entity.Type == EntityType.ENTITY_CONSTANT_STONE_SHOOTER -- constant shooting grimace
  2004. or entity.Type == EntityType.ENTITY_BRIMSTONE_HEAD -- brimstone grimace
  2005. or entity.Type == EntityType.ENTITY_STONEY -- walking grimace
  2006. or entity.Type == EntityType.ENTITY_POKY -- pokies and slides
  2007. or entity.Type == EntityType.ENTITY_WALL_HUGGER -- wall huggers
  2008. or entity.Type == EntityType.ENTITY_DEATHS_HEAD -- deaths head (invisible)
  2009. or entity.Type == EntityType.ENTITY_MASK -- the mask enemy without its heart
  2010. or entity.Type == EntityType.ENTITY_GRUB -- Larry Jr. replacement
  2011. or entity.Type == EntityType.ENTITY_ETERNALFLY -- Eternal fly which flies around corn poop
  2012. or entity.Type == EntityType.ENTITY_DIP -- poop enemy
  2013. or entity.Type == EntityType.ENTITY_SQUIRT -- stronger poop enemy
  2014. or entity.Type == EntityType.ENTITY_DINGA -- ultimate poop enemy
  2015. or entity.Type == EntityType.ENTITY_CORN_MINE then -- already poop
  2016. -- set the enemy on the blacklist
  2017. onBlacklist = true
  2018. Isaac.ConsoleOutput("Laser Blacklist!")
  2019. else
  2020. -- take the enemy from the blacklist
  2021. onBlacklist = false
  2022. end
  2023.  
  2024. if entity:GetData().NormalPoop == true then
  2025. Isaac.ConsoleOutput("Make poop?")
  2026. if roll <= pooptear.TURN_CHANCE -- chance to turn the enemy into normal poop
  2027. and onBlacklist == false then -- and the enemy can be turned into poop
  2028.  
  2029. Isaac.ConsoleOutput("Make poop!")
  2030.  
  2031. entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop
  2032. entity:Remove()
  2033. -- turn the enemy into poop
  2034. Isaac.GridSpawn(GridEntityType.GRID_POOP, 0, entity.Position, true)
  2035.  
  2036. else
  2037. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  2038. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  2039. -- spawn some rock particles (may need custom ones
  2040. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.ROCK_PARTICLE, 1, entity.Position, Vector(0,0), player):ToEffect()
  2041. poopSplash.SpriteScale = Vector(0.6,0.6)
  2042. poopSplash:Update()
  2043. else
  2044. -- spawn a poop explosion
  2045. poopSplash = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.POOP_EXPLOSION, 1, entity.Position, Vector(0,0), player):ToEffect()
  2046. poopSplash.SpriteScale = Vector(0.6,0.6)
  2047. poopSplash:Update()
  2048. end
  2049. entity:GetData().NormalPoop = false -- stops all enemies of this type to be turned into normal poop too
  2050.  
  2051. -- Lil' Larva synergy / spawns blue flies
  2052. LilLarvaSyn(entity, rolltwo)
  2053.  
  2054. -- Brown Cap synergy / spawns explosions
  2055. BrownCapSyn(entity, rolltwo)
  2056. end
  2057. elseif entity:GetData().HolyPoop == true then
  2058. if roll <= pooptear.TURN_CHANCE_HOLY -- chance to turn the enemy into holy poop
  2059. and onBlacklist == false then -- and the enemy can be turned into poop
  2060.  
  2061. entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop
  2062. entity:Remove()
  2063. -- Isaac.ConsoleOutput("Holy Poop!")
  2064. Isaac.GridSpawn(GridEntityType.GRID_POOP, 6, entity.Position, true)
  2065. else
  2066. -- reset entity data
  2067. entity:GetData().HolyPoop = false -- stops all enemies of this type to be turned into holy poop too
  2068.  
  2069. -- Lil' Larva synergy / spawns blue flies
  2070. LilLarvaSyn(entity, rolltwo)
  2071.  
  2072. -- Brown Cap synergy / spawns explosions
  2073. BrownCapSyn(entity, rolltwo)
  2074. end
  2075.  
  2076. elseif entity:GetData().DankPoop == true then
  2077. if roll <= pooptear.TURN_CHANCE_DANK -- chance to turn the enemy into dank poop
  2078. and onBlacklist == false then -- and the enemy can be turned into poop
  2079.  
  2080. entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop
  2081. entity:Remove()
  2082. -- Isaac.ConsoleOutput("Dank Poop!")
  2083. Isaac.GridSpawn(GridEntityType.GRID_POOP, 5, entity.Position, true)
  2084. else
  2085. -- reset entity data
  2086. entity:GetData().DankPoop = false -- stops all enemies of this type to be turned into dank poop too
  2087.  
  2088. -- Lil' Larva synergy / spawns blue flies
  2089. LilLarvaSyn(entity, rolltwo)
  2090.  
  2091. -- Brown Cap synergy / spawns explosions
  2092. BrownCapSyn(entity, rolltwo)
  2093. end
  2094.  
  2095. elseif entity:GetData().GoldenPoop == true then
  2096. if roll <= pooptear.TURN_CHANCE_GOLDEN -- chance to turn the enemy into golden poop
  2097. and onBlacklist == false then -- and the enemy can be turned into poop
  2098.  
  2099. entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop
  2100. entity:Remove()
  2101. -- Isaac.ConsoleOutput("Golden Poop!")
  2102. Isaac.GridSpawn(GridEntityType.GRID_POOP, 3, entity.Position, true)
  2103. else
  2104. -- reset entity data
  2105. entity:GetData().GoldenPoop = false -- stops all enemies of this type to be turned into golden poop too
  2106.  
  2107. -- Lil' Larva synergy / spawns blue flies
  2108. LilLarvaSyn(entity, rolltwo)
  2109.  
  2110. -- Brown Cap synergy / spawns explosions
  2111. BrownCapSyn(entity, rolltwo)
  2112. end
  2113.  
  2114. elseif entity:GetData().RainbowPoop == true then
  2115. if roll <= pooptear.TURN_CHANCE_RAINBOW -- chance to turn the enemy into rainbow poop
  2116. and onBlacklist == false then -- and the enemy can be turned into poop
  2117.  
  2118. entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop
  2119. entity:Remove()
  2120. -- Isaac.ConsoleOutput("Rainbow Poop!")
  2121. Isaac.GridSpawn(GridEntityType.GRID_POOP, 4, entity.Position, true)
  2122. else
  2123. -- reset entity data
  2124. entity:GetData().RainbowPoop = false -- stops all enemies of this type to be turned into rainbow poop too
  2125.  
  2126. -- Lil' Larva synergy / spawns blue flies
  2127. LilLarvaSyn(entity, rolltwo)
  2128.  
  2129. -- Brown Cap synergy / spawns explosions
  2130. BrownCapSyn(entity, rolltwo)
  2131. end
  2132.  
  2133. elseif entity:GetData().RedPoop == true then
  2134. if roll <= pooptear.TURN_CHANCE_RED -- chance to turn the enemy into red poop
  2135. and onBlacklist == false then -- and the enemy can be turned into poop
  2136.  
  2137. entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop
  2138. entity:Remove()
  2139. -- Isaac.ConsoleOutput("Red Poop!")
  2140. Isaac.GridSpawn(GridEntityType.GRID_POOP, 1, entity.Position, true)
  2141. else
  2142. entity:GetData().RedPoop = false -- stops all enemies of this type to be turned into red poop too
  2143.  
  2144. -- Lil' Larva synergy / spawns blue flies
  2145. LilLarvaSyn(entity, rolltwo)
  2146.  
  2147. -- Brown Cap synergy / spawns explosions
  2148. BrownCapSyn(entity, rolltwo)
  2149. end
  2150. end
  2151. elseif entity:IsBoss() then
  2152. -- Lil' Larva synergy / spawns blue flies
  2153. LilLarvaSyn(entity, rolltwo)
  2154.  
  2155. -- Brown Cap synergy / spawns explosions
  2156. BrownCapSyn(entity, rolltwo)
  2157. end
  2158. end
  2159. end
  2160. Mod:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, Mod.onDamage)
Advertisement
Add Comment
Please, Sign In to add comment