Josh64

Code owned by Akward

Apr 17th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.29 KB | None | 0 0
  1. local Rock = RegisterMod("Rock", 1)
  2. local game = Game()
  3. local forgotten = false
  4. local soul = false
  5. local costume = false
  6. local ChangeTear = 0
  7. local timer = 0
  8. local RockSplosion = nil
  9. local bloodRock = nil
  10. bombtimer = 0
  11. bombtimercheck = 0
  12. epictimer = 0
  13. epictimercheck = 0
  14. Rock.ROCK = Isaac.GetItemIdByName("Silicosis")
  15. Rock.COSTUME_ROCK = Isaac.GetCostumeIdByPath("gfx/characters/silicosis_costume.anm2")
  16. Rock.FORGOTTENROCK = Isaac.GetCostumeIdByPath("gfx/characters/forgottenrock_costume.anm2")
  17. Rock.SOULROCK = Isaac.GetCostumeIdByPath("gfx/characters/soulrock_costume.anm2")
  18.  
  19. function Rock:onCache(player, cacheFlag)
  20. if player:HasCollectible(Rock.ROCK) then
  21. if forgotten == false then
  22. if player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN then
  23. player:TryRemoveNullCostume(Rock.SOULROCK)
  24. player:AddNullCostume(Rock.FORGOTTENROCK)
  25. forgotten = true
  26. soul = false
  27. costume = true
  28. end
  29. end
  30. if soul == false then
  31. if player:GetPlayerType() == PlayerType.PLAYER_THESOUL then
  32. player:TryRemoveNullCostume(Rock.FORGOTTENROCK)
  33. player:AddNullCostume(Rock.SOULROCK)
  34. forgotten = false
  35. soul = true
  36. costume = true
  37. end
  38. end
  39. if costume == false then
  40. if player:GetPlayerType() == PlayerType.PLAYER_THESOUL == false and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  41. player:AddNullCostume(Rock.COSTUME_ROCK)
  42. costume = true
  43. end
  44. end
  45. end
  46. if cacheFlag == CacheFlag.CACHE_FIREDELAY then
  47. if player:HasCollectible(Rock.ROCK) and player:HasCollectible(531) == false and player:HasCollectible(118) == false and player:HasCollectible(2) == false
  48. and player:HasCollectible(153) == false and player:HasCollectible(149) == false and player:HasCollectible(229) == false and player:HasCollectible(52) == false
  49. and player:HasCollectible(169) == false and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  50. player.MaxFireDelay = math.floor(player.MaxFireDelay * 3.5 + 5)
  51. else
  52. if player:HasCollectible(Rock.ROCK) and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  53. player.MaxFireDelay = math.floor(player.MaxFireDelay * 1.2 + 25)
  54. end
  55. end
  56. if player:HasCollectible(114) and player:HasCollectible(Rock.ROCK) and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  57. player.MaxFireDelay = math.floor(player.MaxFireDelay * 0.7)
  58. end
  59. if player:HasCollectible(330) and player:HasCollectible(Rock.ROCK) and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  60. player.MaxFireDelay = math.floor(player.MaxFireDelay * 0.8)
  61. end
  62. end
  63. if cacheFlag == CacheFlag.CACHE_DAMAGE and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  64. if player:HasCollectible(Rock.ROCK) then
  65. if ChangeTear == 0 then
  66. ChangeTear = game:GetFrameCount()
  67. end
  68. if player:HasCollectible(330) then
  69. player.Damage = player.Damage * 1.25
  70. else
  71. player.Damage = player.Damage * 2.2 - 0.5
  72. if player.Damage <= 1.2 then
  73. player.Damage = 1.2
  74. end
  75. end
  76. if player.Damage == 3.50 then
  77. player.Damage = 3.5001
  78. end
  79. end
  80. end
  81. if cacheFlag == CacheFlag.CACHE_TEARCOLOR then
  82. if player:HasCollectible(Rock.ROCK) and player:HasCollectible(3) == false and player:HasCollectible(531) == false then
  83. player.TearColor = Color(0.5, 0.5, 0.5, 1, 0, 0, 0)
  84. player.LaserColor = Color(0, 1, 1, 1, 80, 80, 80)
  85. end
  86. end
  87. if cacheFlag == CacheFlag.CACHE_RANGE and player:HasCollectible(Rock.ROCK) then
  88. if player:HasCollectible(531) == false and player:HasCollectible(149) == false
  89. and player:HasCollectible(229) == false and player:HasCollectible(540) == false then
  90. player.TearFallingSpeed = player.TearFallingSpeed + 8
  91. player.TearFallingAcceleration = player.TearFallingAcceleration + 0.20
  92. player.TearHeight = player.TearHeight + 5
  93. if player:HasCollectible(224) then
  94. player.TearHeight = player.TearHeight - 7.5
  95. end
  96. if player:HasCollectible(440) then
  97. player.TearHeight = player.TearHeight - 15
  98. end
  99. if player:HasCollectible(531) then
  100. player.TearFallingSpeed = player.TearFallingSpeed + 20
  101. player.TearFallingAcceleration = player.TearFallingAcceleration - 0.50
  102. end
  103. end
  104. if player:HasCollectible(229) then
  105. player.TearFallingSpeed = player.TearFallingSpeed - 6.5
  106. end
  107. end
  108. if cacheFlag == CacheFlag.CACHE_SHOTSPEED and player:HasCollectible(Rock.ROCK) then
  109. player.ShotSpeed = player.ShotSpeed - 0.20
  110. end
  111. if cacheFlag == CacheFlag.CACHE_TEARFLAG and player:HasCollectible(52) == false then
  112. if player:HasCollectible(Rock.ROCK) then
  113. player.TearFlags = player.TearFlags | TearFlags.TEAR_PIERCING
  114. end
  115. end
  116. end
  117.  
  118. Rock:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Rock.onCache)
  119.  
  120. function Rock:Spawner(player, cacheFlag)
  121. if player:HasCollectible(Rock.ROCK) then
  122. for _, entity in pairs(Isaac.GetRoomEntities()) do
  123. if entity.Type == EntityType.ENTITY_LASER and entity.SubType == 2 and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  124. if entity.FrameCount % 7 == 0 and entity.FrameCount >= 14 then
  125. Xrock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, entity.Position, Vector(0,0), player):ToEffect()
  126. Xrock:SetTimeout(3)
  127. Xrock:SetRadii(5.0, 5.0)
  128. end
  129. end
  130. if entity.Type == EntityType.ENTITY_EFFECT and entity.Variant == EffectVariant.BRIMSTONE_BALL then
  131. if entity:IsDead() == false and entity.FrameCount % 4 == 0 and entity.FrameCount >= 8 then
  132. local RockX = math.random(math.floor(-entity:ToEffect().SpriteScale.X * 15), math.floor(entity:ToEffect().SpriteScale.X * 30))
  133. local RockY = math.random(math.floor(-entity:ToEffect().SpriteScale.X * 15), math.floor(entity:ToEffect().SpriteScale.X * 30))
  134. bloodRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, entity.Position + Vector(RockX, RockY), Vector(0,0), player):ToEffect()
  135. bloodRock:SetTimeout(3)
  136. bloodRock:SetRadii(5.0, 5.0)
  137. end
  138. end
  139. if entity.Type == EntityType.ENTITY_TEAR and entity.Variant ~= TearVariant.CHAOS_CARD and entity.Variant ~= TearVariant.BOBS_HEAD and game:GetFrameCount() - entity.FrameCount >= ChangeTear then
  140. local Target = entity:ToTear()
  141. local MaxRad = math.floor(Target.CollisionDamage * 1.65)
  142. local MinRad = math.floor(Target.CollisionDamage * 0.75)
  143. if MaxRad >= 100 then
  144. MaxRad = 100
  145. end
  146. if MinRad >= 50 then
  147. MinRad = 50
  148. end
  149. if Target.SpawnerType == EntityType.ENTITY_PLAYER or Target.SpawnerVariant == FamiliarVariant.INCUBUS or Target.SpawnerVariant == FamiliarVariant.FATES_REWARD then
  150. if Target.FrameCount == 1 then
  151. Target.Height = Target.Height + math.random(-3,3)
  152. if player:HasCollectible(224) then
  153. Target.Height = Target.Height - 5
  154. end
  155. if player:HasCollectible(440) then
  156. Target.Height = Target.Height - 8
  157. end
  158. if Target.Variant == TearVariant.HUNGRY then
  159. Target.Velocity = Target.Velocity * 1.5
  160. end
  161. if Target.Variant ~= TearVariant.STONE and Target.Variant ~= TearVariant.BALLOON and Target.Variant ~= TearVariant.BALLOON_BRIMSTONE
  162. and Target.Variant ~= TearVariant.BALLOON_BOMB and Target.Variant ~= TearVariant.HUNGRY and Target.Variant ~= TearVariant.SCHYTHE
  163. and Target.Variant ~= TearVariant.FIRE_MIND and Target.Variant ~= TearVariant.MYSTERIOUS and Target.Variant ~= TearVariant.DARK_MATTER
  164. and Target.Variant ~= TearVariant.EGG and Target.Variant ~= TearVariant.BLACK_TOOTH and Target.Variant ~= TearVariant.NEEDLE
  165. and Target.Variant ~= TearVariant.TOOTH then
  166. local tearsprite = Target:GetSprite()
  167. tearsprite:Load("gfx/animations/effects/smoothrock.anm2", true)
  168. local sprite_size = math.floor(Target.CollisionDamage / 6 + 1 + Target.Scale / 1.4) -- 123467 (Damage progression in .anm2 file)
  169. if sprite_size > 7 then
  170. sprite_size = 7
  171. end
  172. if sprite_size == 5 then
  173. sprite_size = 4
  174. end
  175. if player:HasCollectible(329) then
  176. sprite_size = 6
  177. end
  178. tearsprite:Play("Rock"..sprite_size.."Roll")
  179. tearsprite:LoadGraphics()
  180. end
  181. if Target.Variant == TearVariant.FIRE_MIND or Target.Variant == TearVariant.MYSTERIOUS or Target.Variant == TearVariant.DARK_MATTER then
  182. Target.Scale = Target.Scale * 1.25
  183. end
  184. end
  185. if Target.Velocity.X >= 0.15 or Target.Velocity.X <= -0.15 or Target.Velocity.Y >= 0.15 or Target.Velocity.Y <= -0.15 or player:HasCollectible(329) then
  186. if (Target.Height >= -5 or Target:CollidesWithGrid()) then
  187. if player:HasCollectible(531) == false
  188. and player:HasCollectible(229) == false
  189. and player:HasCollectible(2) == false
  190. and player:HasCollectible(153) == false
  191. and player:HasCollectible(224) == false
  192. and player:HasCollectible(169) == false
  193. and player:HasCollectible(533) == false
  194. and player:HasCollectible(104) == false
  195. and player:HasCollectible(531) == false
  196. and player:HasCollectible(453) == false
  197. and player:HasCollectible(532) == false
  198. and player:HasCollectible(358) == false
  199. and player:HasCollectible(330) == false
  200. and player:HasCollectible(329) == false
  201. and player:HasCollectible(540) == false then
  202. reload = game:GetFrameCount()
  203. if reload >= timer + 2 then
  204. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  205. RockSplosion:SetTimeout(3)
  206. RockSplosion:SetRadii(40.0 + MaxRad, 40.0 + MaxRad)
  207. timer = game:GetFrameCount()
  208. Target:Die()
  209. end
  210. end
  211. if (Target.Height >= -5 or Target:CollidesWithGrid()) then
  212. if player:HasCollectible(330) == false and player:HasCollectible(229) == false and player:HasCollectible(532) == false
  213. or player:HasCollectible(330) and player:HasCollectible(540) and math.random(3) == 1 and player:HasCollectible(229) == false
  214. or player:HasCollectible(229) and player:HasCollectible(540) and math.random(16) == 1 and player:HasCollectible(330) == false
  215. or player:HasCollectible(229) and player:HasCollectible(540) and player:HasCollectible(330) and math.random(20) == 1 then
  216. if player:HasCollectible(2)
  217. or player:HasCollectible(531)
  218. or player:HasCollectible(153)
  219. or player:HasCollectible(224)
  220. or player:HasCollectible(104)
  221. or player:HasCollectible(453)
  222. or player:HasCollectible(358)
  223. or player:HasCollectible(329)
  224. or player:HasCollectible(540) and Target.Position:Distance(player.Position) >= 75 then
  225. reload = game:GetFrameCount()
  226. if player:HasCollectible(329) then
  227. if Target.Position:Distance(player.Position) >= 100 then
  228. if player:HasCollectible(169) and reload >= timer + 2 then
  229. if player:HasCollectible(315) then
  230. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  231. RockSplosion:SetTimeout(5)
  232. RockSplosion:SetRadii(50.0 + MaxRad, 20.0 + MinRad)
  233. timer = game:GetFrameCount()
  234. Target:Die()
  235. else
  236. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  237. RockSplosion:SetTimeout(5)
  238. RockSplosion:SetRadii(20.0 + MinRad, 60.0 + MaxRad)
  239. timer = game:GetFrameCount()
  240. Target:Die()
  241. end
  242. elseif reload >= timer + 2 then
  243. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  244. RockSplosion:SetTimeout(1)
  245. RockSplosion:SetRadii(25.0 + MaxRad, 25.0 + MaxRad)
  246. timer = game:GetFrameCount()
  247. Target:Die()
  248. end
  249. end
  250. elseif player:HasCollectible(169) and reload >= timer + 2 then
  251. if player:HasCollectible(315) then
  252. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  253. RockSplosion:SetTimeout(5)
  254. RockSplosion:SetRadii(50.0 + MaxRad, 20.0 + MinRad)
  255. timer = game:GetFrameCount()
  256. Target:Die()
  257. else
  258. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  259. RockSplosion:SetTimeout(5)
  260. RockSplosion:SetRadii(20.0 + MinRad, 50.0 + MaxRad)
  261. timer = game:GetFrameCount()
  262. Target:Die()
  263. end
  264. elseif reload >= timer + 2 then
  265. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  266. RockSplosion:SetTimeout(1)
  267. RockSplosion:SetRadii(25.0 + MaxRad, 25.0 + MaxRad)
  268. timer = game:GetFrameCount()
  269. Target:Die()
  270. end
  271. end
  272. end
  273. end
  274. if (Target.Height >= -5 or Target:CollidesWithGrid()) then
  275. if player:HasCollectible(169) and player:HasCollectible(330) == false and player:HasCollectible(229) == false and player:HasCollectible(540) == false then
  276. reload = game:GetFrameCount()
  277. if reload >= timer + 2 then
  278. if player:HasCollectible(315) then
  279. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  280. RockSplosion:SetTimeout(5)
  281. RockSplosion:SetRadii(70.0 + MaxRad, 30.0 + MinRad)
  282. timer = game:GetFrameCount()
  283. game:ShakeScreen(10)
  284. Target:Die()
  285. else
  286. RockSplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 0, Target.Position, Vector(0,0), player):ToEffect()
  287. RockSplosion:SetTimeout(5)
  288. RockSplosion:SetRadii(30.0 + MinRad, 70.0 + MaxRad)
  289. timer = game:GetFrameCount()
  290. game:ShakeScreen(10)
  291. Target:Die()
  292. end
  293. end
  294. end
  295. end
  296. if Target.Height >= -7 and player:HasCollectible(540) then
  297. Target.Velocity = Target.Velocity + Vector(math.random(-1, 1), math.random(-1, 1))
  298. Target.Height = Target.Height - math.random(0, 4)
  299. end
  300. end
  301. local soyBonus = math.floor(Target.CollisionDamage * 15)
  302. if soyBonus >= 40 then
  303. soyBonus = 40
  304. end
  305. if Target.Variant == TearVariant.HUNGRY then
  306. if Target.FrameCount % 10 == 0 and Target.FrameCount > 6 and player:HasCollectible(229) == false and player:HasCollectible(330) == false then
  307. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  308. trailRock:SetRadii(5.0, 5.0)
  309. trailRock:SetTimeout(3)
  310. end
  311. else
  312. if Target.FrameCount % 6 == 0 and Target.FrameCount > 6 and player:HasCollectible(229) == false and player:HasCollectible(330) == false then
  313. if player:HasCollectible(329) then
  314. if Target.Position:Distance(player.Position) >= 100 and Target.FrameCount % 12 == 0 then
  315. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  316. trailRock:SetRadii(5.0, 5.0)
  317. trailRock:SetTimeout(3)
  318. end
  319. elseif player:HasCollectible(540) == false then
  320. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  321. trailRock:SetRadii(5.0, 5.0)-- Soy milk excluded, montros lung excluded, flat stone excluded, Ludo and Normal not excluded
  322. trailRock:SetTimeout(3)
  323. end
  324. end
  325. end
  326. if Target.FrameCount % 5 == 0 and Target.FrameCount >= 5 and player:HasCollectible(229) == false and player:HasCollectible(330) and player:HasCollectible(329) then
  327. if player:HasCollectible(329) then
  328. if Target.Position:Distance(player.Position) >= 100 and Target.FrameCount % 10 == 0 then
  329. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  330. trailRock:SetRadii(5.0, 5.0)
  331. trailRock:SetTimeout(3)
  332. end
  333. else
  334. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  335. trailRock:SetRadii(5.0, 5.0) -- Lung excluded, Soy milk required, ludo required
  336. trailRock:SetTimeout(3)
  337. end
  338. end
  339. if Target.Variant == TearVariant.HUNGRY then
  340. if Target.FrameCount % 10 == 0 and Target.FrameCount > 6 and player:HasCollectible(229) and math.random(60 - soyBonus) <= 10 then
  341. if player:HasCollectible(330) == false and player:HasCollectible(329) == false then
  342. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  343. trailRock:SetRadii(5.0, 5.0) -- lung required, soy milk excluded, ludo excluded
  344. trailRock:SetTimeout(3)
  345. end
  346. end
  347. else
  348. if Target.FrameCount % 6 == 0 and Target.FrameCount > 6 and player:HasCollectible(229) and math.random(80 - soyBonus) <= 10 and player:HasCollectible(540) == false then
  349. if player:HasCollectible(330) == false and player:HasCollectible(329) == false then
  350. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  351. trailRock:SetRadii(5.0, 5.0) -- lung required, soy milk excluded, ludo excluded, flat stone excluded
  352. trailRock:SetTimeout(3)
  353. end
  354. end
  355. end
  356. if Target.Variant == TearVariant.HUNGRY then
  357. if Target.FrameCount % 12 == 0 and Target.FrameCount > 6 and player:HasCollectible(229) and math.random(60 - soyBonus) <= 10 then
  358. if player:HasCollectible(330) or player:HasCollectible(329) then
  359. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  360. trailRock:SetRadii(5.0, 5.0)
  361. trailRock:SetTimeout(3)
  362. end
  363. end
  364. else
  365. if Target.FrameCount % 6 == 0 and Target.FrameCount > 6 and player:HasCollectible(229) and math.random(60 - soyBonus) <= 10 then
  366. if player:HasCollectible(330) or player:HasCollectible(329) then
  367. if player:HasCollectible(329) then
  368. if Target.Position:Distance(player.Position) >= 100 then
  369. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  370. trailRock:SetRadii(5.0, 5.0)
  371. trailRock:SetTimeout(3)
  372. end
  373. else
  374. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  375. trailRock:SetRadii(5.0, 5.0) -- lung required, soy milk OR ludo required
  376. trailRock:SetTimeout(3)
  377. end
  378. end
  379. end
  380. end
  381. if Target.FrameCount % 10 == 0 and Target.FrameCount > 6 and player:HasCollectible(330) and math.random(50 - soyBonus) <= 10 and player:HasCollectible(329) == false and player:HasCollectible(229) == false then
  382. if player:HasCollectible(540) == false or player:HasCollectible(540) and player:HasCollectible(532) then
  383. trailRock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Target.Position, Vector(0,0), player):ToEffect()
  384. trailRock:SetRadii(5.0, 5.0)
  385. trailRock:SetTimeout(3)
  386. end
  387. end
  388. end
  389. end
  390. end
  391. if entity.Type == EntityType.ENTITY_KNIFE then -- mom's knife synergy - Knives should only exist if player has mom's knife
  392. local Knife = entity:ToKnife() -- new variable for knife position
  393. if Knife.FrameCount % 4 == 0 and Knife:GetKnifeDistance() >= 75 then
  394. KnifeShock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Knife.Position, Vector(0,0), player):ToEffect()
  395. KnifeShock:SetRadii(5.0, 5.0)
  396. KnifeShock:SetTimeout(3)
  397. end
  398. end
  399. bombtimercheck = game:GetFrameCount()
  400. if entity.Type == EntityType.ENTITY_BOMBDROP and entity:GetSprite():IsPlaying("Explode") and entity.Variant ~= BombVariant.BOMB_TROLL
  401. and entity.Variant ~= BombVariant.BOMB_SUPERTROLL and bombtimercheck >= bombtimer then
  402. Bomber = entity:ToBomb()
  403. if Bomber.IsFetus then
  404. if player:HasCollectible(315) and Bomber.Variant == BombVariant.BOMB_MR_MEGA then
  405. Bombsplode = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Bomber.Position, Vector(0,0), player):ToEffect()
  406. Bombsplode:SetRadii(60, 30)
  407. Bombsplode:SetTimeout(5)
  408. bombtimer = game:GetFrameCount() + 5
  409. game:ShakeScreen(10)
  410. else
  411. if Bomber.Variant == BombVariant.BOMB_MR_MEGA then
  412. Bombsplode = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Bomber.Position, Vector(0,0), player):ToEffect()
  413. Bombsplode:SetRadii(30, 60)
  414. Bombsplode:SetTimeout(5)
  415. bombtimer = game:GetFrameCount() + 5
  416. game:ShakeScreen(10)
  417. else
  418. Bombsplode = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Bomber.Position, Vector(0,0), player):ToEffect()
  419. Bombsplode:SetRadii(35, 35)
  420. Bombsplode:SetTimeout(3)
  421. bombtimer = game:GetFrameCount() + 5
  422. end
  423. end
  424. end
  425. end
  426. epictimercheck = game:GetFrameCount()
  427. if entity.Type == EntityType.ENTITY_EFFECT and entity.Variant == EffectVariant.ROCKET
  428. and epictimercheck >= epictimer and entity.FrameCount >= 10
  429. and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN == false then
  430. if player:HasCollectible(106) or player:HasCollectible(169) then
  431. if player:HasCollectible(315) then
  432. Epicsplode = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, entity.Position, Vector(0,0), player):ToEffect()
  433. Epicsplode:SetRadii(60, 30)
  434. Epicsplode:SetTimeout(5)
  435. epictimer = game:GetFrameCount() + 10
  436. game:ShakeScreen(15)
  437. else
  438. Epicsplode = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, entity.Position, Vector(0,0), player):ToEffect()
  439. Epicsplode:SetRadii(30, 60)
  440. Epicsplode:SetTimeout(5)
  441. epictimer = game:GetFrameCount() + 10
  442. game:ShakeScreen(15)
  443. end
  444. else
  445. Epicsplode = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, entity.Position, Vector(0,0), player):ToEffect()
  446. Epicsplode:SetRadii(45, 45)
  447. Epicsplode:SetTimeout(3)
  448. epictimer = game:GetFrameCount() + 10
  449. end
  450. end
  451. if entity.Type == EntityType.ENTITY_EFFECT and entity.Variant == EffectVariant.TARGET
  452. and player:GetPlayerType() == PlayerType.PLAYER_THEFORGOTTEN and entity.FrameCount % 4 == 0
  453. and entity.FrameCount <= 50 and entity.FrameCount >= 10 then
  454. Epicsplode = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, entity.Position, Vector(0,0), player):ToEffect()
  455. Epicsplode:SetRadii(5, 5)
  456. Epicsplode:SetTimeout(3)
  457. end
  458. end
  459. end
  460. if player:HasCollectible(Rock.ROCK) == false and costume == true then
  461. forgotten = false
  462. soul = false
  463. costume = false
  464. ChangeTear = 0
  465. player:TryRemoveNullCostume(Rock.COSTUME_ROCK)
  466. player:TryRemoveNullCostume(Rock.SOULROCK)
  467. player:TryRemoveNullCostume(Rock.FORGOTTENROCK)
  468. bombtimer = 0
  469. bombtimercheck = 0
  470. epictimer = 0
  471. epictimercheck = 0
  472. reload = 0
  473. timer = 0
  474. end
  475. player:AddCacheFlags(CacheFlag.CACHE_DAMAGE)
  476. player:AddCacheFlags(CacheFlag.CACHE_FIREDELAY)
  477. player:AddCacheFlags(CacheFlag.CACHE_RANGE)
  478. player:EvaluateItems()
  479. end
  480. Rock:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Rock.Spawner)
  481.  
  482. function Rock:Laser(entity, amt, flag, source, countdown)
  483. local player = game:GetPlayer(0)
  484. Cross = entity
  485. if player:HasCollectible(Rock.ROCK)then
  486. if Cross:IsVulnerableEnemy() then
  487. if amt == player.Damage then
  488. if flag == DamageFlag.DAMAGE_LASER then
  489. local BrimRad = math.floor(player.Damage * 1.65)
  490. if BrimRad >= 40 then
  491. BrimRad = 40
  492. end
  493. if (Cross.HitPoints - amt) <= 0 and math.random(4) == 1 then
  494. BrimShock = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.SHOCKWAVE, 1, Cross.Position, Vector(0,0), player):ToEffect()
  495. BrimShock:SetRadii(50.0, 50.0 + BrimRad)
  496. BrimShock:SetTimeout(3)
  497. end
  498. end
  499. end
  500. if amt == 10 then
  501. if Cross:CanShutDoors() == false then
  502. return false
  503. end
  504. end
  505. end
  506. end
  507. end
  508.  
  509. Rock:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, Rock.Laser)
  510.  
  511.  
  512. function Rock:Bomb(entity)
  513. local player = game:GetPlayer(0)
  514. if entity.FrameCount == 1 then
  515. if player:HasCollectible(Rock.ROCK) then
  516. if entity.Type == EntityType.ENTITY_BOMBDROP and entity.Variant ~= BombVariant.BOMB_TROLL
  517. and entity.Variant ~= BombVariant.BOMB_SUPERTROLL and entity.SpawnerType == EntityType.ENTITY_PLAYER then
  518. timeBomb = entity:ToBomb()
  519. if timeBomb.IsFetus then
  520. timeBomb:SetExplosionCountdown(40 + math.random(-3, 3))
  521. end
  522. end
  523. end
  524. end
  525. end
  526. Rock:AddCallback(ModCallbacks.MC_POST_BOMB_UPDATE, Rock.Bomb)
Advertisement
Add Comment
Please, Sign In to add comment