-- Initialize the Ultra state addHook("PlayerSpawn", function(player) player.ultraburstactive = false end) addHook("PlayerThink", function(player) -- Target only Archie Sonic in Super Form if player.mo and player.mo.valid and player.mo.skin == "sonic" and player.powers[pw_super] then -- --- TOGGLE ULTRA BURST (Custom Button 3) --- if (player.cmd.buttons & BT_CUSTOM3) and not (player.prevcustom3) then player.ultraburstactive = not player.ultraburstactive -- Activation Sound/Flash if player.ultraburstactive then S_StartSound(player.mo, sfx_cybdth) P_FlashPal(player, PAL_WHITE, 5) end end player.prevcustom3 = (player.cmd.buttons & BT_CUSTOM3) -- --- PERMANENT BURST LOGIC --- if player.ultraburstactive then -- 1. Animation: Keep him in the 'Victory Pose' or 'Dash' while active -- This uses the high-energy frames from your sheet player.panim = PA_ABILITY -- 2. Visual Explosion Loop: Sparkles fly out every 2 frames if leveltime % 2 == 0 then for i = 0, 8 do local angle = i * (ANGLE_180 / 4) + (leveltime * ANG10) local blast = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z + (player.mo.height/2), MT_IVSP) blast.colorized = true blast.color = SKINCOLOR_YELLOW blast.scale = FRACUNIT * 3 blast.flags = $|MF_MISSILE|MF_BRIGHT|MF_NOGRAVITY -- Send them outward blast.momx = P_ReturnDirX(angle, 40*FRACUNIT) blast.momy = P_ReturnDirY(angle, 40*FRACUNIT) blast.fuse = 15 end end -- 3. Permanent Screen Clear: Kill any Badnik that gets close (600 radius) searchBlockmap("objects", function(sonic, enemy) if enemy and enemy.valid and (enemy.flags & MF_ENEMY) then if P_AproxDistance(sonic.x - enemy.x, sonic.y - enemy.y) < 600*FRACUNIT then P_KillMobj(enemy, sonic, sonic) S_StartSound(enemy, sfx_pop) end end end, player.mo) -- 4. THE CROWN: Swirls above his head permanently if leveltime % 3 == 0 then local crown = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z + player.mo.height, MT_IVSP) crown.colorized = true crown.color = SKINCOLOR_YELLOW crown.flags = $|MF_NOGRAVITY|MF_BRIGHT crown.fuse = 10 local angle = (leveltime * ANG10) P_SetOrigin(crown, player.mo.x + P_ReturnDirX(angle, 20*FRACUNIT), player.mo.y + P_ReturnDirY(angle, 20*FRACUNIT), player.mo.z + player.mo.height + (12 * FRACUNIT) ) end end end end)