--Borrowed code from XMomentum, the Hyper Dash lua done by me, Sir Thoksalot. This script is Reusable so do whatever the hell you want with it addHook("PlayerThink", function(player) local function hasHyperForm(player) if (player.mo and player.mo.valid) if (player.mo.skin == "sonic") then return true end return false end end --Only Sonic can become Hyper Sonic if hasHyperForm(player) --You need to collect 100 rings to go Hyper if player.rings >= 100 and not player.powers[pw_super] player.canturnhyper = true end if player.rings < 100 and not player.powers[pw_super] player.canturnhyper = false end if not (player.powers[pw_super] and player.canturnhyper == true) player.ishyper = false else player.ishyper = true end --This is the cost of being OP, a double ring drain, you're welcome :) if (leveltime % 35 == 18) and (player.powers[pw_super] >= 2) and (player.ishyper == true) P_GivePlayerRings(player, -1) end if (player.ishyper == true) --ooh rainbow local function getHyperColor(player) if (player.mo.skin == "sonic") if player.mo.state != S_PLAY_SUPER_TRANS1 and player.mo.state != S_PLAY_SUPER_TRANS2 and player.mo.state != SUPER_TRANS3 player.mo.color = (SKINCOLOR_SUPERSILVER1 + 5*((leveltime >> 1) % 7)) end end end getHyperColor(player) --Hyper Sonic: "Breathing? What's that?" if (player.mo.eflags & MFE_UNDERWATER) player.powers[pw_underwater] = 0 end if P_InSpaceSector(player.mo) player.powers[pw_spacetime] = 0 end if (player.speed > 3*FRACUNIT or player.mo.momz > 3*FRACUNIT or player.mo.momz < -1*FRACUNIT) then local ghost = P_SpawnGhostMobj(player.mo) ghost.fuse = 3 ghost.rollangle = player.mo.rollangle end end end end) addHook("AbilitySpecial", function(player) --My attempt to port S3&K's Hyper Sonic dash to SRB2 local function DoHyperDash(player) S_StartSound(player.mo, sfx_s3kb6) P_Earthquake(player.mo, player.mo, 256*FRACUNIT) P_StartQuake(89*FRACUNIT, 1) P_RadiusAttack(player.mo, player.mo, 1214*FRACUNIT) P_FlashPal(player, PAL_WHITE, 4) player.pflags = $ | PF_THOKKED if (player.cmd.forwardmove) --and not ((player.cmd.buttons & BT_SPIN) and (player.cmd.forwardmove)) P_InstaThrust(player.mo, player.mo.angle, 75*FRACUNIT) player.dashforward = true --Forward Dash elseif ((player.cmd.forwardmove) and (player.cmd.sidemove)) P_InstaThrust(player.mo, player.drawangle, 65*FRACUNIT) player.dashangled = true --Diagonal Dash elseif (player.cmd.sidemove) and not((player.cmd.forwardmove) and (player.cmd.sidemove)) P_InstaThrust(player.mo, player.drawangle, 65*FRACUNIT) player.dashside = true --Sideways Dash elseif P_GetPlayerControlDirection(player) == 0 and not (player.cmd.buttons & BT_SPIN) P_SetObjectMomZ(player.mo, 25*FRACUNIT, false) player.speed = 1 --Momentum cut lul player.dashup = true --Upward Dash elseif (player.cmd.buttons & BT_SPIN) and not ((player.cmd.buttons & BT_SPIN) and (player.cmd.forwardmove)) --and player.charability == CA_THOK P_SetObjectMomZ(player.mo, -25*FRACUNIT, false) player.speed = 1 --Momentum cut lul player.dashdown = true --Downward Dash end end if (player.mo and player.mo.valid) and player.mo.skin == "sonic" and not (player.pflags & PF_THOKKED) and (player.ishyper == true) and G_PlatformGametype() then DoHyperDash(player) local function ReturnThok(player) if player.mo and player.mo.valid if (player.dashdown and player.dashdown == true) player.charability = CA_NONE elseif not player.dashdown == true player.charability = skins[player.mo.skin].ability end end end ReturnThok(player) elseif (player.ishyper != true) or player.dashdown != true -- or (player.deletethok == false) or (player.dashtype != player.dashdown) player.charability = skins[player.mo.skin].ability end end)