Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not HasToy.ToySkull then
- local roomEntities = Isaac.GetRoomEntities()
- local shellGame = Isaac:GetEntityVariantByName("Shell Game Beggar")
- for i, entity in pairs(roomEntities) do
- if entity.Type == EntityType.ENTITY_SLOT
- and entity.Variant == shellGame then
- Shell.Target = entity
- end
- end
- --If Isaac has not the item Toy Skull, then the game will check if a Shell Game paid out with Skatole
- elseif Shell.Target.State == BeggarState.PRICE then
- local shellEntities = Isaac.FindInRadius(Shell.Target.Position, 50, EntityPartition.PICKUP)
- for x, pickup in pairs(shellEntities) do
- if pickup.Variant == PickupVariant.PICKUP_COLLECTIBLE
- and pickup.Subtype == CollectibleType.COLLECTIBLE_SKATOLE then
- --if the game finds Skatole, then Skatole will have a chance to be replaced with Toy Skull
- Grab.Poop = pickup
- local rng = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_TOY_SKULL)
- local roll = rng:RandomInit(100)
- if roll < 50 then
- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_TOY_SKULL, Grab.Poop.Position, Grab.Poop.Velocity, Shell.Target)
- Grab.Poop:Remove()
- Grab.Poop = nil
- else
- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, CollectibleType.COLLECTIBLE_SKATOLE, Grab.Poop.Position, Grab.Poop.Velocity, Shell.Target)
- Grab.Poop:Remove()
- Grab.Poop = nil
- end
- end
- end
- end
- Shell.Target = nil
- end
Advertisement
Add Comment
Please, Sign In to add comment