Josh64

Miserere (OnTearFire)

Nov 1st, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.23 KB | None | 0 0
  1. function Mod:onTearFire(tear)
  2.  
  3. local player = Isaac.GetPlayer(0) -- gets the player
  4. local FireDir = player:GetFireDirection() -- gets the fire direction of said player
  5. local MoveDir = player:GetMovementDirection() -- gets the player movement direction in the case the animation of the tear has to be adjusted
  6. local tearData = tear:GetData() -- stores the data of the individual tears
  7. local sprite = tear:GetSprite() -- requiered to change the sprite of the poop tears + animations
  8. local tearRNG = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  9. local roll = tearRNG:RandomInt(100) -- used to decide which piercing tear animation is playing
  10.  
  11. -- Isaac.ConsoleOutput("It works.. kinda!")
  12.  
  13. if player:HasCollectible(CollectibleType.COLLECTIBLE_MISERERE) then -- if the player has the Miserere item
  14. if not (tear.Variant == 4) -- its not Bob Rotten Head
  15. or not (tear.Variant == 9) then -- its not Chaos Card
  16. -- check tear variant
  17.  
  18. if tear.Variant == TearVariant.HUNGRY -- get all tear variants which have a unique tear sprite for the poop tears
  19. or tear.Variant == TearVariant.PUPULA
  20. or tear.Variant == TearVariant.PUPULA_BLOOD
  21. or tear.Variant == TearVariant.FIRE_MIND
  22. or tear.Variant == TearVariant.DARK_MATTER then -- variant needs to be confirmed in the TAKE_DAMAGE callback to be able to turn enemies into poop
  23.  
  24. -- check the fire direction to set the offset. It is for all variants the same.
  25. if FireDir == Direction.DOWN then
  26. player.TearsOffset = Vector(0,5.5) -- change the offset
  27. elseif FireDir == Direction.RIGHT then
  28. player.TearsOffset = Vector(10,5.5)
  29. elseif FireDir == Direction.UP then
  30. player.TearsOffset = Vector(0,5.5)
  31. elseif FireDir == Direction.LEFT then
  32. player.TearsOffset = Vector(-10,5.5)
  33. end
  34. -- Poop Tear Subtype
  35. if tearData.PoopSubType == nil then
  36. -- Isaac.ConsoleOutput("A new Tear!")
  37. -- check if the tear can be a variant
  38. if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  39. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
  40. or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
  41. or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
  42. or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  43. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
  44. or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
  45. -- get rng
  46. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  47. local roll = rng:RandomInt(100)
  48. -- will the tear be a variant
  49. if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
  50. -- which variants are possible
  51. local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
  52. if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  53. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
  54. table.remove(poopVariant, 5)
  55. end
  56. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
  57. table.remove(poopVariant, 4)
  58. end
  59. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
  60. table.remove(poopVariant, 3)
  61. end
  62. if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  63. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
  64. table.remove(poopVariant, 2)
  65. end
  66. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
  67. table.remove(poopVariant, 1)
  68. end
  69.  
  70. -- saftey check
  71. if poopVariant[1] == nil then -- somehow the poop got emptied
  72. tearData.PoopSubType = 0 -- a normal poop tear
  73. else -- should happen normaly
  74.  
  75. local pickPoop = math.random(#poopVariant)
  76. if poopVariant[pickPoop] == 1 then
  77. tearData.PoopSubType = 1 -- Holy Poop
  78. elseif poopVariant[pickPoop] == 2 then
  79. tearData.PoopSubType = 2 -- Dank Poop
  80. elseif poopVariant[pickPoop] == 3 then
  81. tearData.PoopSubType = 3 -- Golden Poop
  82. elseif poopVariant[pickPoop] == 4 then
  83. tearData.PoopSubType = 4 -- Rainbow Poop
  84. elseif poopVariant[pickPoop] == 5 then
  85. tearData.PoopSubType = 5 -- Red Poop
  86. end
  87. end
  88. if tearData.PoopSubType == 1 then -- Holy Poop
  89. if tearData.HasCostume == nil then
  90. tearData.HasCostume = true
  91. if tear.Variant == TearVariant.HUNGRY then
  92. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_holy.png")
  93. sprite:LoadGraphics()
  94. elseif (tear.Variant == TearVariant.PUPULA
  95. or tear.Variant == TearVariant.PUPULA_BLOOD) then
  96. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_holy.png")
  97. sprite:LoadGraphics()
  98. elseif tear.Variant == TearVariant.FIRE_MIND then
  99. sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_holy.png")
  100. sprite:LoadGraphics()
  101. elseif tear.Variant == TearVariant.DARK_MATTER then
  102. sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_holy.png")
  103. sprite:LoadGraphics()
  104. end
  105. end
  106.  
  107. elseif tearData.PoopSubType == 2 then -- Dank
  108. if tearData.HasCostume == nil then
  109. tearData.HasCostume = true
  110. if tear.Variant == TearVariant.HUNGRY then
  111. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_dank.png")
  112. sprite:LoadGraphics()
  113. elseif (tear.Variant == TearVariant.PUPULA
  114. or tear.Variant == TearVariant.PUPULA_BLOOD) then
  115. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_dank.png")
  116. sprite:LoadGraphics()
  117. elseif tear.Variant == TearVariant.FIRE_MIND then
  118. sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_dank.png")
  119. sprite:LoadGraphics()
  120. elseif tear.Variant == TearVariant.DARK_MATTER then
  121. sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_dank.png")
  122. sprite:LoadGraphics()
  123. end
  124. end
  125.  
  126. elseif tearData.PoopSubType == 3 then -- Golden
  127. if tearData.HasCostume == nil then
  128. tearData.HasCostume = true
  129. if tear.Variant == TearVariant.HUNGRY then
  130. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_golden.png")
  131. sprite:LoadGraphics()
  132. elseif (tear.Variant == TearVariant.PUPULA
  133. or tear.Variant == TearVariant.PUPULA_BLOOD) then
  134. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_golden.png")
  135. sprite:LoadGraphics()
  136. elseif tear.Variant == TearVariant.FIRE_MIND then
  137. sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_golden.png")
  138. sprite:LoadGraphics()
  139. elseif tear.Variant == TearVariant.DARK_MATTER then
  140. sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_golden.png")
  141. sprite:LoadGraphics()
  142. end
  143. end
  144.  
  145. elseif tearData.PoopSubType == 4 then -- Rainbow
  146. if tearData.HasCostume == nil then
  147. tearData.HasCostume = true
  148. if tear.Variant == TearVariant.HUNGRY then
  149. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_rainbow.png")
  150. sprite:LoadGraphics()
  151. elseif (tear.Variant == TearVariant.PUPULA
  152. or tear.Variant == TearVariant.PUPULA_BLOOD) then
  153. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_rainbow.png")
  154. sprite:LoadGraphics()
  155. elseif tear.Variant == TearVariant.FIRE_MIND then
  156. sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_rainbow.png")
  157. sprite:LoadGraphics()
  158. elseif tear.Variant == TearVariant.DARK_MATTER then
  159. sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_rainbow.png")
  160. sprite:LoadGraphics()
  161. end
  162. end
  163.  
  164. elseif tearData.PoopSubType == 5 then -- Red
  165. if tearData.HasCostume == nil then
  166. tearData.HasCostume = true
  167. if tear.Variant == TearVariant.HUNGRY then
  168. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_red.png")
  169. sprite:LoadGraphics()
  170. elseif (tear.Variant == TearVariant.PUPULA
  171. or tear.Variant == TearVariant.PUPULA_BLOOD) then
  172. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_red.png")
  173. sprite:LoadGraphics()
  174. elseif tear.Variant == TearVariant.FIRE_MIND then
  175. sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_red.png")
  176. sprite:LoadGraphics()
  177. elseif tear.Variant == TearVariant.DARK_MATTER then
  178. sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_red.png")
  179. sprite:LoadGraphics()
  180. end
  181. end
  182. end
  183. else
  184. -- else is it just a normal poop tear
  185. tearData.PoopSubType = 0
  186. end
  187. else
  188. -- else is it just a normal poop tear
  189. tearData.PoopSubType = 0
  190. end
  191. end
  192. -- adjust stuff for tearData.PoopSubType == 0
  193. if tearData.PoopSubType == 0 then
  194. if tearData.HasCostume == nil then
  195. if tear.Variant == TearVariant.HUNGRY then
  196. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  197. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  198. tearData.HasCostume = true
  199. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear_petrified.png")
  200. sprite:LoadGraphics()
  201. else
  202. tearData.HasCostume = true
  203. sprite:ReplaceSpritesheet(0, "gfx/effects/hungry_poop_tear.png")
  204. sprite:LoadGraphics()
  205. end
  206. elseif (tear.Variant == TearVariant.PUPULA
  207. or tear.Variant == TearVariant.PUPULA_BLOOD) then
  208. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  209. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  210. tearData.HasCostume = true
  211. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear_petrified.png")
  212. sprite:LoadGraphics()
  213. else
  214. tearData.HasCostume = true
  215. sprite:ReplaceSpritesheet(0, "gfx/effects/pupula_poop_tear.png")
  216. sprite:LoadGraphics()
  217. end
  218. elseif tear.Variant == TearVariant.FIRE_MIND then
  219. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  220. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  221. tearData.HasCostume = true
  222. sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear_petrified.png")
  223. sprite:LoadGraphics()
  224. else
  225. tearData.HasCostume = true
  226. sprite:ReplaceSpritesheet(0, "gfx/effects/fire_poop_tear.png")
  227. sprite:LoadGraphics()
  228. end
  229. elseif tear.Variant == TearVariant.DARK_MATTER then
  230. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  231. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  232. tearData.HasCostume = true
  233. sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear_petrified.png")
  234. sprite:LoadGraphics()
  235. else
  236. tearData.HasCostume = true
  237. sprite:ReplaceSpritesheet(0, "gfx/effects/dark_poop_tear.png")
  238. sprite:LoadGraphics()
  239. end
  240. end
  241. end
  242. end
  243. -- set stats
  244. if (tearData.PoopSubType == 0 -- normal
  245. or tearData.PoopSubType == 1 -- holy
  246. or tearData.PoopSubType == 2 -- dank
  247. or tearData.PoopSubType == 3 -- golden
  248. or tearData.PoopSubType == 4 -- red
  249. or tearData.PoopSubType == 5) -- rainbow
  250. and tearData.SetStats == nil then -- didn't set dmg yet
  251. tearData.SetStats = true
  252. -- set damage
  253. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  254. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  255. if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
  256. pooptear.STONE_BONUS = 1
  257. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  258. -- Isaac.ConsoleOutput("Soy DMG")
  259. else
  260. pooptear.STONE_BONUS = 1.5
  261. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  262. -- Isaac.ConsoleOutput("Normal DMG")
  263. end
  264. else
  265. tear.CollisionDamage = tear.CollisionDamage
  266. end
  267. end
  268. elseif tear.Variant ~= TearVariant.POOPTEAR
  269. and tearData.IsNotAPoopTear == nil then -- if it is not TearVariant.PoopTear, then change the variant
  270.  
  271. tear:ChangeVariant(TearVariant.POOPTEAR)
  272. tearData.IsNotAPoopTear = false
  273.  
  274. -- adjustments for the tear animation and tear offset
  275. if tearData.Animation == nil then
  276. tearData.Animation = true
  277. if tear.TearFlags == tear.TearFlags | TearFlags.TEAR_PIERCING then -- for piercing tears
  278.  
  279. -- change the offset
  280. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the difference in th offset
  281. or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the difference in th offset
  282. if FireDir == Direction.DOWN then
  283. player.TearsOffset = Vector(0,5.5)
  284. elseif FireDir == Direction.RIGHT then
  285. player.TearsOffset = Vector(10,5.5)
  286. elseif FireDir == Direction.UP then
  287. player.TearsOffset = Vector(0,5.5)
  288. elseif FireDir == Direction.LEFT then
  289. player.TearsOffset = Vector(-10,5.5)
  290. end
  291. end
  292.  
  293. -- get the animation + some variaty
  294. if roll > 50 then
  295. tear:GetSprite():Play("PiercingTear1", true)
  296. else
  297. tear:GetSprite():Play("PiercingTear2", true)
  298. end
  299.  
  300. else -- is not a piercing tear
  301. if player:HasCollectible(CollectibleType.COLLECTIBLE_CHOCOLATE_MILK) -- because of the charged shot
  302. or player:HasCollectible(CollectibleType.COLLECTIBLE_MONSTROS_LUNG) -- because of the charged shot
  303. or player:HasCollectible(CollectibleType.COLLECTIBLE_MARKED) -- sprite disappears otherwise
  304. or player:HasCollectible(CollectibleType.COLLECTIBLE_HAEMOLACRIA) -- sprite disappears otherwise
  305. or player:HasCollectible(CollectibleType.COLLECTIBLE_MYSTERIOUS_LIQUID) -- ''
  306. or player:HasCollectible(CollectibleType.COLLECTIBLE_LUDOVICO_TECHNIQUE) -- ''
  307. or player:HasCollectible(CollectibleType.COLLECTIBLE_LOKIS_HORNS) -- same sprite in all directions
  308. or player:HasCollectible(CollectibleType.COLLECTIBLE_MOMS_EYE) then -- same problem as with Loki's Horns
  309.  
  310. -- change the offset
  311. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the difference in th offset
  312. or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the difference in th offset
  313. if FireDir == Direction.DOWN then
  314. player.TearsOffset = Vector(0,5.5)
  315. elseif FireDir == Direction.RIGHT then
  316. player.TearsOffset = Vector(10,5.5)
  317. elseif FireDir == Direction.UP then
  318. player.TearsOffset = Vector(0,5.5)
  319. elseif FireDir == Direction.LEFT then
  320. player.TearsOffset = Vector(-10,5.5)
  321. end
  322. end
  323.  
  324. -- change tear animation
  325. tear:GetSprite():Play("ChargedTear", true)
  326. else
  327.  
  328. -- change the offset
  329. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) -- because of the difference in th offset
  330. or player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY_2)) then -- because of the difference in th offset
  331. if FireDir == Direction.DOWN then
  332. player.TearsOffset = Vector(0,5.5)
  333. elseif FireDir == Direction.RIGHT then
  334. player.TearsOffset = Vector(10,5.5)
  335. elseif FireDir == Direction.UP then
  336. player.TearsOffset = Vector(0,5.5)
  337. elseif FireDir == Direction.LEFT then
  338. player.TearsOffset = Vector(-10,5.5)
  339. end
  340. end
  341. -- get the tear animation based on the player fire direction
  342. if FireDir == Direction.DOWN then
  343. tear:GetSprite():Play("ShootDown", true) -- change tear animation to the right direction
  344. elseif FireDir == Direction.RIGHT then
  345. tear:GetSprite():Play("ShootRight", true) -- change tear animation to the right direction
  346. elseif FireDir == Direction.UP then
  347. tear:GetSprite():Play("ShootUp", true) -- change tear animation to the right direction
  348. elseif FireDir == Direction.LEFT then
  349. tear:GetSprite():Play("ShootLeft", true) -- change tear animation to the right direction
  350. else -- no fire direction
  351. tear:GetSprite():Play("ChargedTear", true) -- change tear animation to the right direction
  352. end
  353. end
  354. end
  355. end
  356.  
  357. -- Poop Tear Subtype
  358. if tearData.PoopSubType == nil then
  359. -- Isaac.ConsoleOutput("A new Tear!")
  360. -- check if the tear can be a variant
  361. if player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  362. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)
  363. or player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)
  364. or player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)
  365. or player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  366. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)
  367. or player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND) then
  368. -- get rng
  369. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_MISERERE)
  370. local roll = rng:RandomInt(100)
  371. -- will the tear be a variant
  372. if roll <= ((100 - pooptear.BASE_CHANCE) * player.Luck / pooptear.MAX_LUCK) + pooptear.BASE_CHANCE then
  373. -- which variants are possible
  374. local poopVariant = {1, 2, 3, 4, 5} -- 1=holy, 2=dank, 3=golden, 4=rainbow, 5=red
  375. if not (player:HasTrinket(TrinketType.TRINKET_PINKY_EYE)
  376. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PINKY_EYE)) then
  377. table.remove(poopVariant, 5)
  378. end
  379. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_BOZO)) then
  380. table.remove(poopVariant, 4)
  381. end
  382. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH)) then
  383. table.remove(poopVariant, 3)
  384. end
  385. if not (player:HasTrinket(TrinketType.TRINKET_MECONIUM)
  386. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_MECONIUM)) then
  387. table.remove(poopVariant, 2)
  388. end
  389. if not (player:HasCollectible(CollectibleType.COLLECTIBLE_HALLOWED_GROUND)) then
  390. table.remove(poopVariant, 1)
  391. end
  392.  
  393. -- saftey check
  394. if poopVariant[1] == nil then -- somehow the poop got emptied
  395. tearData.PoopSubType = 0 -- a normal poop tear
  396. else -- should happen normaly
  397.  
  398. local pickPoop = math.random(#poopVariant)
  399. if poopVariant[pickPoop] == 1 then
  400. tearData.PoopSubType = 1 -- Holy Poop
  401. elseif poopVariant[pickPoop] == 2 then
  402. tearData.PoopSubType = 2 -- Dank Poop
  403. elseif poopVariant[pickPoop] == 3 then
  404. tearData.PoopSubType = 3 -- Golden Poop
  405. elseif poopVariant[pickPoop] == 4 then
  406. tearData.PoopSubType = 4 -- Rainbow Poop
  407. elseif poopVariant[pickPoop] == 5 then
  408. tearData.PoopSubType = 5 -- Red Poop
  409. end
  410. end
  411. if tearData.PoopSubType == 1 then -- Holy Poop
  412. if tearData.HasCostume == nil then
  413. tearData.HasCostume = true
  414. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  415. or sprite:IsPlaying("PiercingTear2") then
  416. -- Midas Touch gets priority
  417. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  418. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_holy.png")
  419. sprite:LoadGraphics()
  420. -- after that comes petrified poop
  421. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  422. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  423. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_holy.png")
  424. sprite:LoadGraphics()
  425. else -- normal piercing tears
  426. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_holy.png")
  427. sprite:LoadGraphics()
  428. end
  429. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  430. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_holy.png")
  431. sprite:LoadGraphics()
  432. else
  433. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_holy.png")
  434. sprite:LoadGraphics()
  435. end
  436. end
  437.  
  438. elseif tearData.PoopSubType == 2 then -- Dank
  439. if tearData.HasCostume == nil then
  440. tearData.HasCostume = true
  441. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  442. or sprite:IsPlaying("PiercingTear2") then
  443. -- Midas Touch gets priority
  444. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  445. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_dank.png")
  446. sprite:LoadGraphics()
  447. -- after that comes petrified poop
  448. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  449. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  450. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_dank.png")
  451. sprite:LoadGraphics()
  452. else -- normal piercing tears
  453. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_dank.png")
  454. sprite:LoadGraphics()
  455. end
  456. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  457. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_dank.png")
  458. sprite:LoadGraphics()
  459. else
  460. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_dank.png")
  461. sprite:LoadGraphics()
  462. end
  463. end
  464.  
  465. elseif tearData.PoopSubType == 3 then -- Golden
  466. if tearData.HasCostume == nil then
  467. tearData.HasCostume = true
  468. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  469. or sprite:IsPlaying("PiercingTear2") then
  470. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_golden.png")
  471. sprite:LoadGraphics()
  472. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  473. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_golden.png")
  474. sprite:LoadGraphics()
  475. else
  476. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_golden.png")
  477. sprite:LoadGraphics()
  478. end
  479. end
  480.  
  481. elseif tearData.PoopSubType == 4 then -- Rainbow
  482. if tearData.HasCostume == nil then
  483. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  484. or sprite:IsPlaying("PiercingTear2") then
  485. -- Midas Touch gets priority
  486. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  487. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_rainbow.png")
  488. sprite:LoadGraphics()
  489. -- after that comes petrified poop
  490. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  491. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  492. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_rainbow.png")
  493. sprite:LoadGraphics()
  494. else -- normal piercing tears
  495. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_rainbow.png")
  496. sprite:LoadGraphics()
  497. end
  498. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  499. sprite:ReplaceSpritesheet(2, "gfx/effects/charged_poop_tear_rainbow.png")
  500. sprite:LoadGraphics()
  501. else
  502. tearData.HasCostume = true
  503. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_rainbow.png")
  504. sprite:LoadGraphics()
  505.  
  506. end
  507. end
  508.  
  509. elseif tearData.PoopSubType == 5 then -- Red
  510. if tearData.HasCostume == nil then
  511. if sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  512. or sprite:IsPlaying("PiercingTear2") then
  513. -- Midas Touch gets priority
  514. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  515. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_red.png")
  516. sprite:LoadGraphics()
  517. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  518. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  519. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_red.png")
  520. sprite:LoadGraphics()
  521. else -- normal piercing tears
  522. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_red.png")
  523. sprite:LoadGraphics()
  524. end
  525. elseif sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  526. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_red.png")
  527. sprite:LoadGraphics()
  528. else
  529. tearData.HasCostume = true
  530. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_red.png")
  531. sprite:LoadGraphics()
  532. end
  533. end
  534. end
  535. else
  536. -- else is it just a normal poop tear
  537. tearData.PoopSubType = 0
  538. end
  539. else
  540. -- else is it just a normal poop tear
  541. tearData.PoopSubType = 0
  542. end
  543. end
  544. -- adjust stuff for tearData.PoopSubType == 0
  545. if tearData.PoopSubType == 0 then
  546. if tearData.HasCostume == nil then
  547. tearData.HasCostume = true
  548. if (sprite:IsPlaying("PiercingTear1") -- plays one of the two piercing tears animations
  549. or sprite:IsPlaying("PiercingTear2")) then
  550. -- Midas Touch gets priority
  551. if player:HasCollectible(CollectibleType.COLLECTIBLE_MIDAS_TOUCH) then
  552. -- Isaac.ConsoleOutput("Normal DMG")
  553. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_golden_normal.png")
  554. sprite:LoadGraphics()
  555. elseif player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  556. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  557. sprite:ReplaceSpritesheet(1, "gfx/effects/poop_tear_piercing_petrified_normal.png")
  558. sprite:LoadGraphics()
  559. end
  560. elseif (player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  561. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP)) then
  562. if sprite:IsPlaying("ChargedTear") then -- plays the charged tear animation
  563. sprite:ReplaceSpritesheet(2, "gfx/effects/normal_poop_tear_petrified.png")
  564. sprite:LoadGraphics()
  565. else
  566. sprite:ReplaceSpritesheet(0, "gfx/effects/poop_tear_petrified.png")
  567. sprite:LoadGraphics()
  568. end
  569. end
  570. end
  571. end
  572. -- set stats
  573. if (tearData.PoopSubType == 0 -- normal
  574. or tearData.PoopSubType == 1 -- holy
  575. or tearData.PoopSubType == 2 -- dank
  576. or tearData.PoopSubType == 3 -- golden
  577. or tearData.PoopSubType == 4 -- red
  578. or tearData.PoopSubType == 5) -- rainbow
  579. and tearData.SetStats == nil then -- didn't set stats yet
  580. tearData.SetStats = true
  581. -- set damage
  582. if player:HasTrinket(TrinketType.TRINKET_PETRIFIED_POOP)
  583. or player:GetEffects():HasTrinketEffect(TrinketType.TRINKET_PETRIFIED_POOP) then
  584. if player:HasCollectible(CollectibleType.COLLECTIBLE_SOY_MILK) then
  585. pooptear.STONE_BONUS = 1
  586. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  587. -- Isaac.ConsoleOutput("Soy DMG")
  588. else
  589. pooptear.STONE_BONUS = 1.5
  590. tear.CollisionDamage = tear.CollisionDamage + pooptear.STONE_BONUS
  591. -- Isaac.ConsoleOutput("Normal DMG")
  592. end
  593. else
  594. tear.CollisionDamage = tear.CollisionDamage
  595. end
  596. -- set tear size
  597. tear.SpriteScale = Vector((tear.Size / 7.9),(tear.Size / 7.9))
  598. tear:Update()
  599. tear:SetSize(tear.Size * pooptear.SCALE, Vector(pooptear.SCALE, pooptear.SCALE), 8)
  600. end
  601. -- else
  602. end
  603. end
  604. end
  605. end
  606. Mod:AddCallback(ModCallbacks.MC_POST_FIRE_TEAR, Mod.onTearFire)
Advertisement
Add Comment
Please, Sign In to add comment