freeslot("S_PLAY_LCROUCH","S_PLAY_SCROUCH") states[S_PLAY_LCROUCH] = { sprite = SPR_PLAY, frame = A|SPR2_LAND, var1 = 0, var2 = 0, tics = 2, nextstate = S_PLAY_LCROUCH } states[S_PLAY_SCROUCH] = { sprite = SPR_PLAY, frame = A|SPR2_ROLL, var1 = 0, var2 = 0, tics = 2, nextstate = S_PLAY_SCROUCH } local function cic_crouchsprite(player, arg) if (arg == "landing") or (arg == "land") then CONS_Printf(player, "\x8CNow the player will use the landing sprite when crouching.") player.crouchsprite = 0 elseif (arg == "rolling") or (arg == "roll") then player.crouchsprite = 1 CONS_Printf(player, "\x8CNow the player will use the rolling sprite when crouching.") elseif (arg == nil) or (arg == help) print("\x84This command sets what sprite the player will use when crouching.") print("\x8CSome characters like knuckles maybe have a landing sprite (the same sprite that knuckles show landing after canceling glide), so you maybe will want to change the sprite if you're playing with custom characters.") end end local function cic_rolljumplock(player, arg) if (arg == "on") or (arg == "true") then CONS_Printf(player, "\x8CRoll jump lock is now activated.") player.rolljumplock = true elseif (arg == "off") or (arg == "false") then player.rolljumplock = false CONS_Printf(player, "\x8CRoll jump lock is now desactivated.") elseif (arg == nil) or (arg == help) print("\x84This command sets how you will control your jump right after spinning.") print("on/true: \x8CYou will control the same as vannila. (Sonic 1, 2 & 3, SRB2)") print("off/false: \x8CYou will control like a normal jump. (Sonic Mania)") end end local function cic_airwallbust(player, arg) if (arg == "on") or (arg == "true") then CONS_Printf(player, "\x8CNow you can destroy breakable walls spinning mid-air.") player.airwallbust = true elseif (arg == "off") or (arg == "false") then player.airwallbust = false CONS_Printf(player, "\x8CNow you can't destroy breakable walls spinning mid-air.") elseif (arg == nil) or (arg == help) print("\x84This command sets if you can or can't destroy breakable walls spinning mid-air.") print("on/true: \x8CYou will destroy breakable walls spinning mid-air. (SRB2)") print("off/false: \x8CYou will not destroy breakable walls spinning mid-air. (Sonic 1, 2, 3 & Mania)") end end local function cic_waterskipping(player, arg) if (arg == "on") or (arg == "true") then CONS_Printf(player, "\x8CNow you can do water skipping when spinning on any water surface.") player.waterskipping = true elseif (arg == "off") or (arg == "false") then player.waterskipping = false CONS_Printf(player, "\x8CNow you can't do water skipping when spinning on any water surface.") elseif (arg == nil) or (arg == help) print("\x84This command sets if you can or can't skip on water when spinning.") print("on/true: \x8CYou will destroy breakable walls spinning mid-air. (SRB2)") print("off/false: \x8CYou will not destroy breakable walls spinning mid-air. (Sonic 1, 2, 3 & Mania)") end end addHook("PlayerThink", function(player) if player.crouchsprite == nil or player.rolljumplock == nil or player.airwallbust == nil or player.waterskipping == nil player.crouchsprite = 0 player.rolljumplock = false player.airwallbust = false player.waterskipping = false end if player.airspinning == true and P_IsObjectOnGround(player.mo) or player.airspinning == nil player.airspinning = false end end) rawset(_G,"CA2_CROUCH",22) addHook("PlayerThink", function(player) if player.valid and player.mo.valid and player.charability2 == CA2_CROUCH and player.speed == 0*FRACUNIT and P_IsObjectOnGround(player.mo) and player.pflags & PF_SPINDOWN and not (player.mo.state == S_PLAY_PAIN or player.mo.state == S_PLAY_GASP or player.mo.state == S_PLAY_GLIDE or player.mo.state == S_PLAY_GLIDE_LANDING) player.pflags = $|PF_STASIS player.height = skins[player.mo.skin].spinheight if player.crouchsprite == 0 player.mo.state = S_PLAY_LCROUCH elseif player.crouchsprite == 1 player.mo.state = S_PLAY_SCROUCH end end if player.charability2 == CA2_CROUCH and player.speed >= 4*FRACUNIT and P_IsObjectOnGround(player.mo) and player.pflags & PF_SPINDOWN and not (player.pflags & PF_SPINNING or player.pflags & PF_FINISHED or player.mo.state == S_PLAY_PAIN or player.mo.state == S_PLAY_GASP or player.mo.state == S_PLAY_GLIDE or player.mo.state == S_PLAY_GLIDE_LANDING) player.pflags = $|PF_SPINNING player.mo.state = S_PLAY_ROLL S_StartSound(player.mo, sfx_spin) end end) addHook("PlayerThink", function(player) if player.valid and player.mo.valid and (player.mo.state == S_PLAY_LCROUCH or player.mo.state == S_PLAY_SCROUCH) and not (player.pflags & PF_SPINDOWN) player.pflags = $ & ~PF_STASIS player.mo.state = S_PLAY_STND player.height = skins[player.mo.skin].height end if player.height == skins[player.mo.skin].spinheight and player.charability2 == CA2_CROUCH and not (player.mo.state == S_PLAY_LCROUCH or player.mo.state == S_PLAY_SCROUCH or player.mo.state == S_PLAY_GLIDE or player.mo.state == S_PLAY_GLIDE_LANDING or player.pflags & PF_SPINNING) player.height = skins[player.mo.skin].height end end) addHook("JumpSpecial", function(player) if player.valid and player.mo.valid and (player.mo.state == S_PLAY_LCROUCH or player.mo.state == S_PLAY_SCROUCH) and P_IsObjectOnGround(player.mo) and not (player.pflags & PF_JUMPDOWN) player.pflags = $|PF_SPINNING|PF_STARTDASH|PF_SPINDOWN|PF_JUMPDOWN player.charability2 = CA2_SPINDASH player.mo.state = S_PLAY_SPINDASH player.pflags = $ & ~PF_STASIS S_StartSound(player.mo, sfx_spndsh) end end) addHook("PlayerThink", function(player) if player.charability2 == CA2_SPINDASH and not (player.pflags & PF_STARTDASH) player.charability2 = CA2_CROUCH end if player.pflags & PF_SPINNING and player.pflags & PF_JUMPED and player.mo.state == S_PLAY_JUMP and player.rolljumplock == false player.pflags = $ & ~PF_SPINNING end if player.pflags & PF_SPINNING and player.mo.state == S_PLAY_ROLL and not (P_IsObjectOnGround(player.mo)) and not (player.pflags & PF_JUMPED or player.pflags & PF_STARTDASH) player.pflags = ($|PF_JUMPED|PF_THOKKED) & ~(PF_SPINNING) player.airspinning = true end if player.airspinning == true and player.airwallbust == true and player.speed >= 6*FRACUNIT and not (player.charflags & SF_CANBUSTWALLS) player.powers[pw_strong] = $ | (STR_ANIM | STR_WALL) else player.powers[pw_strong] = 0 end if player.airspinning == true and player.waterskipping == true and player.mo.eflags & MFE_TOUCHWATER player.pflags = ($|PF_SPINNING) & ~(PF_JUMPED) end end) COM_AddCommand("cic_crouchsprite", cic_crouchsprite, COM_LOCAL) COM_AddCommand("cic_rolljumplock", cic_rolljumplock, COM_LOCAL) COM_AddCommand("cic_airwallbust", cic_airwallbust, COM_LOCAL) COM_AddCommand("cic_waterskipping", cic_waterskipping, COM_LOCAL)