Josh64

Untitled

Apr 8th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. if not HasToy.ToySkull then
  2. local roomEntities = Isaac.GetRoomEntities()
  3. local shellGame = Isaac:GetEntityVariantByName("Shell Game Beggar")
  4. for i, entity in pairs(roomEntities) do
  5. if entity.Type == EntityType.ENTITY_SLOT
  6. and entity.Variant == shellGame then
  7. Shell.Target = entity
  8. end
  9. end
  10.  
  11. --If Isaac has not the item Toy Skull, then the game will check if a Shell Game paid out with Skatole
  12.  
  13. elseif Shell.Target.State == BeggarState.PRICE then
  14. local shellEntities = Isaac.FindInRadius(Shell.Target.Position, 50, EntityPartition.PICKUP)
  15. for x, pickup in pairs(shellEntities) do
  16. if pickup.Variant == PickupVariant.PICKUP_COLLECTIBLE
  17. and pickup.Subtype == CollectibleType.COLLECTIBLE_SKATOLE then
  18.  
  19. --if the game finds Skatole, then Skatole will have a chance to be replaced with Toy Skull
  20.  
  21. Grab.Poop = pickup
  22. local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_TOY_SKULL)
  23. local roll = rng:RandomInit(100)
  24. if roll < 50 then
  25. Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_TOY_SKULL, Grab.Poop.Position, Grab.Poop.Velocity, Shell.Target)
  26. Grab.Poop:Remove()
  27. Grab.Poop = nil
  28.  
  29. else
  30. Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_SKATOLE, Grab.Poop.Position, Grab.Poop.Velocity, Shell.Target)
  31. Grab.Poop:Remove()
  32. Grab.Poop = nil
  33. end
  34. end
  35. end
  36. end
  37. Shell.Target = nil
  38.  
  39. end
Advertisement
Add Comment
Please, Sign In to add comment