marievpyre
Member
I made this block of code to make my own Thok that doesn't use CA_THOK, but I can't seem to figure out how to keep it from activating inside the Quicksand and the Mace Swings in Castle Eggman. I already prevented the code from activating during player.powers[pw_carry] earlier in the code, so it isn't linked to that for the Mace Swings.
Lua:
if (player.mo.skin == "sonic")
if (player.pflags & PF_JUMPED and ((player.pflags & PF_STARTJUMP and not (player.cmd.buttons & BT_JUMP)) or not (player.pflags & PF_STARTJUMP)) and not (player.pflags & PF_THOKKED) and not (player.pflags & PF_SHIELDABILITY) and player.cmd.buttons & BT_JUMP and not (player.plusbuttons & BT_JUMP))
if (player.mo.state != S_PLAY_JUMP)
player.mo.state = S_PLAY_JUMP
end
if (player.cmd.forwardmove or player.cmd.sidemove)
P_InstaThrust(player.mo, player.mo.angle, player.actionspd)
end
S_StartSound(player.mo, sfx_thok)
P_SpawnThokMobj(player)
if (player.cmd.buttons & BT_SPIN)
player.pflags = $|PF_SPINNING|PF_THOKKED
player.pflags = $ & ~(PF_STARTJUMP)
P_SetObjectMomZ(player.mo, -(player.actionspd/5), false)
else
P_SetObjectMomZ(player.mo, player.actionspd/5, false)
player.pflags = $|PF_SPINNING|PF_THOKKED|PF_STARTJUMP
end
end
end