Josh64

DarkBum

Aug 31st, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1.  
  2. local Mod = RegisterMod("betterkeybum", 1)
  3. local game = Game()
  4.  
  5. function Mod:onInit(player)
  6. local player = Isaac.GetPlayer(0)
  7. if game:GetFrameCount() == 1 then
  8. -- spawn in if you want to
  9. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_TRINKET, TrinketType.TRINKET_PAPER_CLIP, Vector(150, 250), Vector(0,0), player)
  10. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_TRINKET, TrinketType.TRINKET_STORE_KEY, Vector(200, 250), Vector(0,0), player)
  11. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_SKELETON_KEY, Vector(350, 250), Vector(0,0), player)
  12. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_LATCH_KEY, Vector(400, 250), Vector(0,0), player)
  13. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_MOMS_KEY, Vector(250, 250), Vector(0,0), player)
  14. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_DADS_KEY, Vector(300, 250), Vector(0,0), player)
  15. Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_DARK_BUM, Vector(275, 175), Vector(0,0), player)
  16. -- if Game():GetPlayer == Isaac
  17. -- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_TRINKET, TrinketType.TRINKET_PAPER_CLIP, Vector(150, 250), Vector(0,0), player)
  18. -- end
  19. end
  20. end
  21. Mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, Mod.onInit)
  22.  
  23.  
  24. function Mod:onPickup(DaBum)
  25. local player = Isaac.GetPlayer(0) -- get the player
  26. local entities = Isaac.GetRoomEntities() -- all entities in the room
  27. if player:HasCollectible(CollectibleType.COLLECTIBLE_DARK_BUM) then
  28. for _, entity in pairs(entities) do
  29. if entity.Type == EntityType.ENTITY_FAMILIAR
  30. and entity.Variant == FamiliarVariant.DARK_BUM then
  31. if entity:GetSprite():IsPlaying("Spawn") then
  32. if entity:GetSprite():GetFrame() == 1 then
  33. for j = 1, #entities do
  34. local entitis = entities[j]
  35. if entitis.Type == EntityType.ENTITY_PICKUP
  36. and entitis.Variant == PickupVariant.PICKUP_HEART
  37. and entitis.SubType == HeartSubType.HEART_SOUL then
  38. -- if entitis:GetFrame() == 1
  39. if entitis.SpawnerType == EntityType.ENTITY_FAMILIAR
  40. and entitis.SpawnerVariant == FamiliarVariant.DARK_BUM then
  41. entitis:ToFamiliar():Morph(EntityType.ENTITY_FAMILIAR, FamiliarVariant.BLUE_SPIDER, 0, true)
  42. end
  43. end
  44. end
  45. end
  46. end
  47. end
  48. end
  49. end
  50. end
  51. Mod:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, Mod.onPickup, FamiliarVariant.DARK_BUM)
Advertisement
Add Comment
Please, Sign In to add comment