ExploxionMach.z64
Forgotten characters lover
I was tring to make the Power Spin ability but i am having some issues.
1. In the line 49 i was tring to make the dust particles to go behind the player but i dont know how to do it.
2. In between the lines 76 and 80 it was supossed to male dust particles apper but does not appear nothing
1. In the line 49 i was tring to make the dust particles to go behind the player but i dont know how to do it.
2. In between the lines 76 and 80 it was supossed to male dust particles apper but does not appear nothing
The Code:
addHook("AbilitySpecial", function(player)
if player.mo.skin == "sonic"
and not (player.pflags & PF_THOKKED)
player.ps = true
player.mo.state = S_PLAY_SPINDASH
player.pflags = $|PF_THOKKED
player.pflags = $&~PF_SPINNING
S_StartSound(player.mo, sfx_spndsh)
end
end)
addHook("PlayerThink", function(player)
if (player.playerstate == PST_DEAD or P_CheckDeathPitCollide(player.mo, true))
or (player.powers[pw_justsprung] or player.mo.eflags & MFE_SPRUNG)
or player.mo.state == S_PLAY_SPRING
or player.mo.state == S_PLAY_FALL
or player.mo.state == S_PLAY_RIDE
player.ps = false
end
end)
addHook("PlayerThink", function(player)
if player.mo.skin == "sonic"
and player.mo.state == S_PLAY_SPINDASH
and player.pflags & PF_THOKKED
and not (player.pflags & PF_JUMPDOWN)
P_InstaThrust(player.mo, player.mo.angle, player.speed + 6*FRACUNIT)
P_SetObjectMomZ(player.mo, 9*FRACUNIT)
player.mo.state = S_PLAY_SPRING
player.pflags = $&~PF_JUMPED
S_StartSound(player.mo, sfx_zoom)
end
if player.mo.skin == "sonic"
and player.ps == true
and (P_IsObjectOnGround(player.mo) or (player.mo.eflags & MFE_JUSTHITFLOOR))
player.ps = false
P_InstaThrust(player.mo, player.mo.angle, 42*FRACUNIT)
P_SetObjectMomZ(player.mo, 6*FRACUNIT)
player.mo.state = S_PLAY_JUMP
player.pflags = $|PF_JUMPED
player.pflags = $&~PF_THOKKED
S_StartSound(player.mo,sfx_zoom)
for i = 1, 8
local object = P_SpawnMobjFromMobj(player.mo, 0,0,0, MT_DUST)
object.target = player.mo
object.fuse = TICRATE
object.scale = player.mo.scale
object.destscale = player.mo.scale
P_InstaThrust(object, i*ANGLE_22h, 16*FRACUNIT)
object.momz = 0
end
end
if player.mo.skin == "sonic"
and player.mo.state == S_PLAY_SPINDASH
and player.pflags & PF_THOKKED
and player.mo.eflags & MFE_TOUCHWATER
and player.speed >= 8*FRACUNIT
player.ps = false
P_InstaThrust(player.mo, player.mo.angle, player.speed)
P_SetObjectMomZ(player.mo, 6*FRACUNIT)
player.mo.state = S_PLAY_JUMP
player.pflags = $&~PF_THOKKED
S_StartSound(player.mo, sfx_splish)
P_SpawnMobjFromMobj(player.mo, 0, 0, 0, MT_SPLISH)
end
end)
-- Wall ability thing, idk
-- Run Dust created by Kirb, i used to make the dust particles effect
addHook("MobjMoveBlocked", function(mo)
if mo.state == S_PLAY_SPINDASH
and mo.player.pflags & PF_THOKKED
P_SpawnThokMobj(mo)
P_SetObjectMomZ(mo, -4*FRACUNIT)
P_SpawnSkidDust(mo, 13*FRACUNIT, sfx_none)
local pabloo = P_SpawnMobjFromMobj(mo.player, P_RandomRange(-10, 10) * FRACUNIT, P_RandomRange(-10, 10) * FRACUNIT, 0, MT_DUST)
pabloo.momx = P_RandomRange(-4, 4)*FRACUNIT
pabloo.momy = P_RandomRange(-4, 4)*FRACUNIT
pabloo.momz = P_RandomRange(0, 4)*FRACUNIT
pabloo.destscale = 4*FRACUNIT
end
end)
-- All the double jump effects is below
-- Spring Rotate created by ThatOneCartridgeGuy, I used to make the sprite rotation when you use the double jump
-- Super Sparkles created by TheLastKitchenGun, I used to make the sparkcles that appers when you double jump
addHook("PlayerSpawn", function(player)
if player.sprung == nil
player.sprung = false
end
end)
addHook("PlayerThink", function(player)
if player and player.mo and player.valid and player.mo.valid
and player.mo.state == S_PLAY_SPRING
and player.pflags & PF_THOKKED
and not P_IsObjectOnGround(player.mo) and not player.bot then
player.sprung = true
end
if player.mo and player.valid and player.mo.valid and not P_IsObjectOnGround(player.mo)
and player.sprung == true and player.mo.momz <= 0 then
player.mo.rollangle = 0
player.sprung = false
player.rerollangle = 0
end
end)
addHook("PlayerThink", function(p)
if p.rerollangle == nil
p.rerollangle = 0
end
if p.mo and p.mo.valid and p.sprung
and p.playerstate == PST_LIVE
and not P_IsObjectOnGround(p.mo)
p.mo.rollangle = p.rerollangle
p.rerollangle = $+ANGLE_45
end
end)