Need help making C1 Ability [Closed]

SonicSpades

The Scarlet King of Spades.
I'm making a C1 ability similar to the stomp. And I need help making a different version of it when the Whirlwind Shield is on. Ideally if C1 is pressed in midair with a Whirlwind shield on, I want my character to slam down for a short time and then, when they hit the ground, they go into spring frame for a higher Whirlwind jump. Note: my character has noshieldabilities on.

Current code:
Lua:
addHook("PlayerThink", function(player) 
if player.mo.skin == "sonic" and player.powers[pw_shield] ~= SH_WHIRLWIND then             
     if (player.mo.state == S_PLAY_JUMP)            
     and (player.cmd.buttons & BT_CUSTOM1)         
player.mo.momz = -30*FRACUNIT         
player.mo.momx = $ /4         
player.mo.momy = $ /4         
S_StartSound(player.mo, sfx_s3k49) 
end 
end

 if player.mo.skin == "sonic" 
and player.powers[pw_shield] == SH_WHIRLWIND then     
if (player.mo.state == S_PLAY_STND)     
and (player.cmd.buttons & BT_CUSTOM1)         
player.mo.momz = 25*FRACUNIT             
player.mo.state = S_PLAY_JUMP         
S_StartSound(player.mo, sfx_s3k97)     
if (player.mo.state == S_PLAY_JUMP)     
and not (player.cmd.buttons & BT_CUSTOM1)         
player.mo.momz = -150*FRACUNIT             
player.mo.state = S_PLAY_FALL         
S_StartSound(player.mo, sfx_s3k9e)    
end   
end 
end 
end)
 
Last edited:
You would like to reduce Speed instead of player.mo.momx and player.mo.momy since Speed is mostly horizontal Speed

The way I would do it is by using the JumpSpinSpecial hook (and then see)

Prob not much help but I hope it served of something
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top