Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ABMix = RegisterMod("ABMix", 1)
- ABMix.COLLECTIBLE_ADDICTED = Isaac.GetItemIdByName("Addicted")
- function ABMix:onUpdate()
- local test = true;
- if Game():GetFrameCount() == 1 then
- ABMix.HasAddicted = false
- if test == true then
- Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, ABMix.COLLECTIBLE_ADDICTED, Vector(320,300), Vector(0,0), nil)
- end
- end
- end
- ABMix:AddCallback(ModCallbacks.MC_POST_UPDATE,ABMix.onUpdate)
- function ABMix:entityTakeDamage(entity, dmgAmount, dmgFlag, dmgSource, dmgFrames)
- local player = entity:ToPlayer()
- if player:HasCollectible(ABMix.COLLECTIBLE_ADDICTED) then
- local addictedpill = 6
- if addictedpill == math.random(6) then
- local randompill = math.random(PillEffect.NUM_PILL_EFFECTS - 1)
- player:UsePill(randompill, PillColor.PILL_NULL)
- end
- end
- end
- ABMix:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, ABMix.entityTakeDamage, EntityType.ENTITY_PLAYER);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement