if not EDR_BanList rawset(_G, "EDR_BanList", {}) end local enemybanlist = { MT_GOOMBA, MT_BLUEGOOMBA } for _,enemy in ipairs(enemybanlist) do table.insert(EDR_BanList, enemy) 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) if ultimatemode return end 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 and enemy.type != MT_DETON EDR_DropRing(enemy) end return false end) addHook("MobjThinker", function(mine) if mine.state == S_BIGMINE_BLAST3 and not SearchInTable(EDR_BanList, mine.type) EDR_DropRing(mine) end return false end, MT_BIGMINE) addHook("MobjThinker", function(deton) if deton.state == S_XPLD1 and not SearchInTable(EDR_BanList, deton.type) and not deton.alrexploded EDR_DropRing(deton) deton.alrexploded = true end return false end, MT_DETON)