if not EDR_BanList rawset(_G, "EDR_BanList", { MT_GOOMBA, MT_BLUEGOOMBA }) end local function SearchInTable(t, searchfor) for _,item in ipairs(t) do if item == searchfor return true else continue end end return false end local function EDR_DropRing(mobj) local spawnedring = P_SpawnMobj(mobj.x, mobj.y, mobj.z, MT_FLINGRING) spawnedring.dropbyenemy = true spawnedring.flags = $|MF_NOCLIPTHING spawnedring.target = mobj spawnedring.nocliptimer = 35 spawnedring.fuse = 280 P_SetObjectMomZ(spawnedring, 12*FRACUNIT) end addHook("MobjThinker", function(ring) if not (ring and ring.valid) or not ring.dropbyenemy return end if ring.nocliptimer > 0 ring.nocliptimer = $-1 end if ring.nocliptimer == 0 and ring.flags & MF_NOCLIPTHING ring.flags = $ & ~MF_NOCLIPTHING end if ring.momz == 0 and not P_IsObjectOnGround(ring) and not ring.zmomchanged ring.momz = -1*FRACUNIT ring.zmomchanged = true end end, MT_FLINGRING) addHook("MobjDeath", function(enemy) if enemy.flags & MF_ENEMY and not SearchInTable(EDR_BanList, enemy.type) and enemy.type != MT_BIGMINE EDR_DropRing(enemy) end return false end) addHook("MobjThinker", function(mine) if mine.state == 1017 and not SearchInTable(EDR_BanList, mine.type) EDR_DropRing(mine) end return false end, MT_BIGMINE)