diff --git a/BattleMod/Lua/2-MobjStateInfo/2-Specials/Info_ActBomb.lua b/BattleMod/Lua/2-MobjStateInfo/2-Specials/Info_ActSlide.lua similarity index 83% rename from BattleMod/Lua/2-MobjStateInfo/2-Specials/Info_ActBomb.lua rename to BattleMod/Lua/2-MobjStateInfo/2-Specials/Info_ActSlide.lua index be3c30d4..7cf6c78f 100644 --- a/BattleMod/Lua/2-MobjStateInfo/2-Specials/Info_ActBomb.lua +++ b/BattleMod/Lua/2-MobjStateInfo/2-Specials/Info_ActSlide.lua @@ -3,11 +3,20 @@ freeslot( 's_fangchar_lob1', 's_fangchar_lob2', 's_fangchar_lob3', + 's_fang_slide', 'spr_cbom', 's_colorbomb1', 's_colorbomb2' ) +states[S_FANG_SLIDE] = { + sprite = SPR_PLAY, + frame = SPR2_FLY_, + tics = -1, + nextstate = S_PLAY_STND, + action = function(mo) mo.player.panim = PA_ROLL end +} + //Fang lob animation states[S_FANGCHAR_LOB1] = { sprite = SPR_FLOB, @@ -60,4 +69,4 @@ states[S_FBOMB_EXPL2] = { frame = 1|FF_FULLBRIGHT, tics = 2, nextstate = S_FBOMB_EXPL3 -} +} \ No newline at end of file diff --git a/BattleMod/Lua/3-Functions/3-Player/Lib_ActionControl.lua b/BattleMod/Lua/3-Functions/3-Player/Lib_ActionControl.lua index 125e6f8a..f40c6972 100644 --- a/BattleMod/Lua/3-Functions/3-Player/Lib_ActionControl.lua +++ b/BattleMod/Lua/3-Functions/3-Player/Lib_ActionControl.lua @@ -4,7 +4,10 @@ local S = B.SkinVars local spendringwarning = false -B.MasterActionScript = function(player,doaction) +B.MasterActionScript = function(player,doaction,type) + -- 0 = PlayerThink + -- 1 = ThinkFrame + --Set action state player.actionallowed = B.CanDoAction(player) player.actioncooldown = max($,player.tossdelay-TICRATE) @@ -34,27 +37,34 @@ B.MasterActionScript = function(player,doaction) local t = player.skinvars --Reset action values for this frame - player.actiontext = nil - player.action2text = nil - player.actionrings = 0 - player.action2rings = 0 - player.actiontextflags = nil - player.action2textflags = nil - player.actionsuper = false - --Set exhaustmeter hud (if enabled) - if player.exhaustmeter ~= FRACUNIT then --- player.action2text = player.exhaustmeter*100/FRACUNIT.."%" - if player.exhaustmeter > FRACUNIT/3 or (player.exhaustmeter > 0 and leveltime&4) then - player.action2textflags = 0 - elseif player.exhaustmeter > 0 then - player.action2textflags = 2 - else - player.action2textflags = 3 + if type == 1 then + player.actiontext = nil + player.action2text = nil + player.actionrings = 0 + player.action2rings = 0 + player.actiontextflags = nil + player.action2textflags = nil + player.actionsuper = false + --Set exhaustmeter hud (if enabled) + if player.exhaustmeter ~= FRACUNIT then + -- player.action2text = player.exhaustmeter*100/FRACUNIT.."%" + if player.exhaustmeter > FRACUNIT/3 or (player.exhaustmeter > 0 and leveltime&4) then + player.action2textflags = 0 + elseif player.exhaustmeter > 0 then + player.action2textflags = 2 + else + player.action2textflags = 3 + end end end --Perform action script - if S[t].special ~= nil then - S[t].special(mo,doaction) + local special = S[t].special + if type == 0 then + special = S[t].special_playerthink + end + + if special ~= nil then + special(mo,doaction) --For custom characters if player.spendrings == 1 then if not(spendringwarning) then diff --git a/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerControl.lua b/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerControl.lua index 20d0ba3f..b568af0c 100644 --- a/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerControl.lua +++ b/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerControl.lua @@ -132,8 +132,11 @@ end B.ResetPlayerProperties = function(player,jumped,thokked) local mo = player.mo + local skin = (mo and mo.valid) and S[mo.skin] or S[-1] + if not(mo) then return end - if mo.eflags&MFE_SPRUNG then + if mo.eflags&MFE_SPRUNG + and not (player.actionsuper == true and skin.special == B.Action.Slide and player.actionstate == 2) then -- HYPER SPECIFIC USECASE player.actionstate = 0 player.actiontime = 0 player.mo.tics = 0 diff --git a/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerFrame.lua b/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerFrame.lua index a1854980..567f1ddd 100644 --- a/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerFrame.lua +++ b/BattleMod/Lua/3-Functions/3-Player/Lib_PlayerFrame.lua @@ -177,8 +177,7 @@ B.PlayerThinkFrame = function(player) B.PlayerMovementControl(player) --Perform Actions - local doaction = B.ButtonCheck(player,player.battleconfig_special) - B.MasterActionScript(player,doaction) + B.MasterActionScript(player,B.ButtonCheck(player,player.battleconfig_special),1) --Air dodge, Stun Break, Guard local doguard = B.ButtonCheck(player,player.battleconfig_guard) diff --git a/BattleMod/Lua/3-Functions/3-Player/Lib_Popgun.lua b/BattleMod/Lua/3-Functions/3-Player/Lib_Popgun.lua index 01037645..dc1ed241 100644 --- a/BattleMod/Lua/3-Functions/3-Player/Lib_Popgun.lua +++ b/BattleMod/Lua/3-Functions/3-Player/Lib_Popgun.lua @@ -1,6 +1,7 @@ //Original scripts by TehRealSalt, modified by CobaltBW local B = CBW_Battle +local S = B.SkinVars local refiretime = 18 @@ -92,34 +93,55 @@ end local function newGunslinger(player) local mo = player.mo + local skin = S[mo.skin] or S[-1] local onground = P_IsObjectOnGround(mo) local canstand = true + + local sliding = skin.special == B.Action.Slide + and player.actionstate == 2 //State: ready to gunsling if not ((player.pflags & (PF_SLIDING|PF_BOUNCING|PF_THOKKED)) or (player.exiting) or (P_PlayerInPain(player))) and not (player.weapondelay) and not (player.panim == PA_ABILITY2) - and (player.pflags&PF_JUMPED or onground) + and (player.pflags&PF_JUMPED or onground or sliding) then -- Same code as vanilla, but without the clause for speed. -- You naturally lose your speed via friction. -- v10 EDIT: Now Fang automatically looks towards lockons + -- v10 EDIT 2: i gave fang autoaim if he holds lol + + local lockon = nil + + if player.gunheld >= 12 then + lockon = B.NewGunLook(player) - local lockon = B.NewGunLook(player) - if (lockon and lockon.valid) - player.drawangle = R_PointToAngle2(mo.x, mo.y, lockon.x, lockon.y) - P_SpawnLockOn(player, lockon, mobjinfo[MT_LOCKON].spawnstate) + if (lockon and lockon.valid) then + player.drawangle = R_PointToAngle2(mo.x, mo.y, lockon.x, lockon.y) + P_SpawnLockOn(player, lockon, mobjinfo[MT_LOCKON].spawnstate) + end + end + + if player.cmd.buttons & BT_SPIN then + player.gunheld = $ + 1 + else + player.gunheld = 0 end //Trigger firing action - if (player.cmd.buttons & BT_SPIN) --- and not (player.gunheld) - and not(player.buttonhistory&BT_SPIN) + if not (player.cmd.buttons & BT_SPIN) + and (player.buttonhistory&BT_SPIN) local bullet = nil + if sliding then + player.actionstate = 0 + player.actiontime = 0 + player.pflags = $ & ~PF_SPINNING + end + mo.state = S_PLAY_FIRE player.panim = PA_ABILITY2 player.weapondelay = refiretime - mo.momx = $ * 2/3 - mo.momy = $ * 2/3 + mo.momx = $ * 3/4 + mo.momy = $ * 3/4 S_StartSoundAtVolume(mo,sfx_s1c4,150) if player == consoleplayer @@ -134,7 +156,6 @@ local function newGunslinger(player) player.revitem, mo.x, mo.y, zpos(mo, player.revitem) ) - else bullet = P_SpawnPointMissile( mo, @@ -144,14 +165,23 @@ local function newGunslinger(player) player.revitem, mo.x, mo.y, zpos(mo, player.revitem) ) + end + + if (bullet and bullet.valid) + -- bullet.flags = $1 & ~MF_NOGRAVITY + local speed = max(45 * mo.scale, FixedHypot(mo.momx - player.cmomx, mo.momy - player.cmomy) * 3 / 4) + local angle = R_PointToAngle2(0, 0, bullet.momx, bullet.momy) + local aiming = R_PointToAngle2(0, 0, FixedHypot(bullet.momx, bullet.momy), bullet.momz) - if (bullet and bullet.valid) - bullet.flags = $1 & ~MF_NOGRAVITY - bullet.momx = $1 / 2 - bullet.momy = $1 / 2 + bullet.momx = P_ReturnThrustX(nil, angle, FixedMul(speed, cos(aiming))) + bullet.momy = P_ReturnThrustY(nil, angle, FixedMul(speed, cos(aiming))) + if (lockon and lockon.valid) then + bullet.momz = FixedMul(speed, sin(aiming)) + else + bullet.momz = 0 end end --- player.gunheld = true + player.drawangle = mo.angle //Air function if not(P_IsObjectOnGround(mo)) @@ -167,6 +197,8 @@ local function newGunslinger(player) P_Thrust(mo,mo.angle+ANGLE_180,mo.scale*3) end end + else + player.gunheld = 0 end //Running and gunning local spd = FixedHypot(player.rmomx,player.rmomy) @@ -216,8 +248,8 @@ local function newGunslinger(player) if P_IsObjectOnGround(mo) and player.airgun == true player.airgun = false if (player.weapondelay) then - mo.state = S_PLAY_FIRE_FINISH - mo.tics = player.weapondelay + player.weapondelay = 0 + mo.state = S_PLAY_STND end end end @@ -225,6 +257,7 @@ end B.CustomGunslinger = function(player) if not(player.mo) return end if not(B.GetSkinVarsFlags(player)&SKINVARS_GUNSLINGER) return end + //Disallow native CA2_GUNSLINGER functionality if player.charability2 == CA2_GUNSLINGER player.charability2 = CA2_NONE @@ -235,20 +268,20 @@ B.CustomGunslinger = function(player) player.airgun = false return end + local skin = S[player.mo.skin] or S[-1] + local sliding = skin.special == B.Action.Slide + and player.actionstate == 2 + //Unable to use gun during certain states if player.powers[pw_nocontrol] or player.powers[pw_carry] - or player.actionstate - or player.pflags&PF_SPINNING + or (player.actionstate and not sliding) + or (player.pflags&PF_SPINNING and not sliding) player.airgun = false return end //Get inputs if (player.gunheld == nil) - player.gunheld = false - end - - if not (player.cmd.buttons & BT_SPIN) - player.gunheld = false + player.gunheld = 0 end //Do Gunslinger diff --git a/BattleMod/Lua/3-Functions/3-Player/Special Moves/Lib_ActCombatRoll.lua b/BattleMod/Lua/3-Functions/3-Player/Special Moves/Lib_ActCombatRoll.lua deleted file mode 100644 index 69c484e8..00000000 --- a/BattleMod/Lua/3-Functions/3-Player/Special Moves/Lib_ActCombatRoll.lua +++ /dev/null @@ -1,173 +0,0 @@ -local B = CBW_Battle -local cooldown = TICRATE * 3 -local cooldown2 = TICRATE * 5 -local xythrust = 38 -local zthrust = 9 -local dropspeed = 20 - -B.Action.CombatRoll = function(mo,doaction) - local player = mo.player - - //Conditions - local bouncing = player.pflags&PF_BOUNCING - local activate = player.actiontime == 0 and doaction == 1 - local thrust_trigger = activate and not(bouncing) - local springdrop_trigger = activate and bouncing - local drop_state = player.actionstate == 1 and bouncing - and P_MobjFlip(mo)*mo.momz < 0 - local thrust_state = player.actiontime and mo.state == S_PLAY_ROLL - and not(P_IsObjectOnGround(mo)) and player.actiontime < 18 - - //Properties - player.actiontext = "Combat Roll" - player.actionrings = 5 - if player.pflags&PF_BOUNCING - player.actiontext = "Spring Drop" - player.actionrings = 10 - end - - //Perform Thrust - if thrust_trigger - //Apply cost, cooldown, state - B.PayRings(player) - player.actionstate = 2 - player.actiontime = 1 - B.ApplyCooldown(player,cooldown) - player.drawangle = mo.angle - //Apply momentum - B.ZLaunch(mo,zthrust*FRACUNIT,false) - P_InstaThrust(mo,mo.angle,xythrust*mo.scale) - //Apply midair state - player.pflags = ($|PF_JUMPED) &~ (PF_NOJUMPDAMAGE|PF_THOKKED) - mo.state = S_PLAY_ROLL - player.airgun = false - //Do effects - S_StartSound(mo,sfx_zoom) - for n = 0,3 - local dust = P_SpawnMobjFromMobj(mo,0,0,0,MT_SPINDUST) - local angle = (180+P_RandomRange(-60,60))*ANG1+mo.angle - local speed = mo.scale*P_RandomRange(5,10) - P_InstaThrust(dust,angle,speed) - end - player.noshieldactive = -1 - return - end - - //Perform spring drop - if springdrop_trigger - //Apply cost, cooldown, state - B.PayRings(player) - player.actionstate = 1 - player.actiontime = 1 - //Apply momentum - mo.momx = $/2 - mo.momy = $/2 - B.ZLaunch(mo,-dropspeed*FRACUNIT,false) - //Effects - S_StartSound(mo,sfx_zoom) - P_SpawnParaloop(mo.x,mo.y,mo.z,mo.scale*128,16,MT_DUST,ANGLE_90,nil,true) - return - end - - if thrust_state - player.drawangle = mo.angle - end - - //Drop bombs - if player.actionstate == 1 - and bouncing - and (mo.eflags & MFE_JUSTHITFLOOR) - B.ApplyCooldown(player,cooldown2) - player.nobombjump = true - for n = 0, 4 - local bomb = B.throwbomb(mo) - if bomb and bomb.valid then - P_InstaThrust(bomb,ANGLE_45+mo.angle+(ANGLE_90*n),mo.scale*4) - P_SetObjectMomZ(bomb, mo.scale*8*P_MobjFlip(mo)) - bomb.flags = $ &~ (MF_GRENADEBOUNCE) - bomb.bombtype = 0 - end - end - player.actiontime = 0 - player.actionstate = 0 - end - - //Reset state - if not(drop_state or thrust_state or (mo.eflags & MFE_SPRUNG)) - player.actiontime = 0 - player.actionstate = 0 - else //Afterimage - player.actiontime = $+1 - if player.actiontime%8 - P_SpawnGhostMobj(mo) - end - end -end - -local function fanghop(player) - local mo = player.mo - B.ZLaunch(mo, 7 * mo.scale, false) - mo.state = S_PLAY_JUMP - mo.momx = $ * -2/3 - mo.momy = $ * -2/3 - player.actionstate = 0 - player.actiontime = 0 - player.pflags = ($ | (PF_JUMPED | PF_STARTJUMP | PF_NOJUMPDAMAGE)) & ~PF_THOKKED - player.powers[pw_nocontrol] = 16 -end - -local function iscombatroll(player) - if not (player and player.valid and player.playerstate == PST_LIVE) - or not player.mo - or not (player.actiontime and player.mo.state == S_PLAY_ROLL) - or not player.mo.health - return false - end - return true -end - -B.Fang_PreCollide = function(n1,n2,plr,mo,atk,def,weight,hurt,pain,ground,angle,thrust,thrust2,collisiontype) - if iscombatroll(plr[n1]) - plr[n1].fangmarker = true - end -end - -B.Fang_PostCollide = function(n1,n2,plr,mo,atk,def,weight,hurt,pain,ground,angle,thrust,thrust2,collisiontype) - if plr[n1] and plr[n1].fangmarker - plr[n1].fangmarker = nil - end -end - -B.Fang_Collide = function(n1,n2,plr,mo,atk,def,weight,hurt,pain,ground,angle,thrust,thrust2,collisiontype) - if not (plr[n1] and plr[n1].fangmarker) - return false - end - if (hurt != 1 and n1 == 1) or (hurt != -1 and n1 == 2) - if not (plr[n2] and plr[n2].fangmarker) - fanghop(plr[n1]) - end - if plr[n2] - B.DoPlayerTumble(plr[n2], 24, angle[n1], mo[n1].scale*3, true, true) - end - P_InstaThrust(mo[n2], angle[n2], mo[n1].scale * 5) - B.ZLaunch(mo[n2], 7 * mo[n2].scale, false) - return true - end -end - -B.Action.CombatRoll_Priority = function(player) - local mo = player.mo - if not (mo and mo.valid) return end - - local bouncing = player.pflags&PF_BOUNCING - local drop_state = player.actionstate == 1 and bouncing - and P_MobjFlip(mo)*mo.momz < 0 - local thrust_state = player.actiontime and mo.state == S_PLAY_ROLL - and not(P_IsObjectOnGround(mo)) and player.actiontime < 20 - - if player.actionstate == 1 - B.SetPriority(player,0,1,"fang_springdrop",2,3,"spring drop") - elseif player.actionstate == 2 - B.SetPriority(player,1,1,nil,1,1,"combat roll") - end -end \ No newline at end of file diff --git a/BattleMod/Lua/3-Functions/3-Player/Special Moves/Lib_ActSlide.lua b/BattleMod/Lua/3-Functions/3-Player/Special Moves/Lib_ActSlide.lua new file mode 100644 index 00000000..df0eca26 --- /dev/null +++ b/BattleMod/Lua/3-Functions/3-Player/Special Moves/Lib_ActSlide.lua @@ -0,0 +1,249 @@ +local B = CBW_Battle +local S = B.SkinVars +local cooldown = TICRATE * 2 +local cooldown2 = TICRATE * 5 +local duration = 3 * TICRATE +local xythrust = 20 +local zthrust = 9 +local dropspeed = 20 +local nojumpwindow = 10 + +B.Action.Slide = function(mo,doaction) + local player = mo.player + + //Conditions + local grounded = P_IsObjectOnGround(mo) or mo.eflags & MFE_JUSTHITFLOOR + local bouncing = player.pflags&PF_BOUNCING + local activate = player.actiontime == 0 and doaction == 1 + local slide_trigger = activate and not(bouncing) + local springdrop_trigger = activate and bouncing + local drop_state = player.actionstate == 1 and bouncing + and P_MobjFlip(mo)*mo.momz < 0 + local sliding = player.actionstate == 2 + and player.actiontime + + //Properties + player.actiontext = "Slide" + player.actionrings = 5 + if player.pflags&PF_BOUNCING + player.actiontext = "Spring Drop" + player.actionrings = 10 + end + + //Perform Thrust + if slide_trigger + -- thrust player forward + local speed = max(xythrust * mo.scale, FixedHypot(mo.momx - player.cmomx, mo.momy - player.cmomy) * 5 / 4) + + B.PayRings(player) + B.ApplyCooldown(player, cooldown2) + + P_InstaThrust(mo, mo.angle, speed) + player.slidebouncex = mo.momx + player.slidebouncey = mo.momy + player.slidebouncez = abs(mo.momz) + player.pflags = ($|PF_SPINNING) & ~(PF_THOKKED|PF_JUMPED|PF_BOUNCING) + player.actionstate = 2 + player.actiontime = duration + player.lockjumpframe = nojumpwindow + mo.state = S_FANG_SLIDE + end + + //Perform spring drop + if springdrop_trigger + //Apply cost, cooldown, state + B.PayRings(player) + player.actionstate = 1 + player.actiontime = 1 + //Apply momentum + mo.momx = $/2 + mo.momy = $/2 + B.ZLaunch(mo,-dropspeed*FRACUNIT,false) + //Effects + S_StartSound(mo,sfx_zoom) + P_SpawnParaloop(mo.x,mo.y,mo.z,mo.scale*128,16,MT_DUST,ANGLE_90,nil,true) + return + end + + //Drop bombs + if player.actionstate == 1 + and bouncing + and (mo.eflags & MFE_JUSTHITFLOOR) + B.ApplyCooldown(player,cooldown2) + player.nobombjump = true + for n = 0, 4 + local bomb = B.throwbomb(mo) + if bomb and bomb.valid then + P_InstaThrust(bomb,ANGLE_45+mo.angle+(ANGLE_90*n),mo.scale*4) + P_SetObjectMomZ(bomb, mo.scale*8*P_MobjFlip(mo)) + bomb.flags = $ &~ (MF_GRENADEBOUNCE) + bomb.bombtype = 0 + end + end + player.actiontime = 0 + player.actionstate = 0 + elseif player.actionstate == 1 + and (not bouncing + or mo.eflags & MFE_SPRUNG) then + player.actiontime = 0 + player.actionstate = 0 + end + + if sliding then + player.actionsuper = true + + if grounded then + player.actiontime = $-1 + else + player.lockjumpframe = max(2, $) + end + + if leveltime%8 then + P_SpawnGhostMobj(mo) + end + + if player.pflags & PF_JUMPED then + player.actionstate = 0 + player.actiontime = 0 + player.actionsuper = false + return + end + + player.pflags = ($|PF_SPINNING) & ~(PF_THOKKED|PF_JUMPED|PF_BOUNCING) + + if mo.eflags & MFE_JUSTHITFLOOR or mo.eflags & MFE_SPRUNG then + mo.state = S_FANG_SLIDE + end + if mo.eflags & MFE_JUSTHITFLOOR then + if player.slidebouncez >= 10 * mo.scale then + P_SetObjectMomZ(mo, player.slidebouncez/2) + end + mo.momx = player.slidebouncex + mo.momy = player.slidebouncey + end + + -- custom friction + local fric = FU - FU / 100 + mo.momx = FixedMul($, fric) + mo.momy = FixedMul($, fric) + + player.slidebouncex = mo.momx + player.slidebouncey = mo.momy + player.slidebouncez = abs(mo.momz) + + if player.actiontime == 0 + or FixedHypot(mo.momx - player.cmomx, mo.momy - player.cmomy) < 4 * mo.scale + or player.powers[pw_carry] then + mo.state = S_PLAY_STND + mo.momx = $/2 + mo.momy = $/2 + player.pflags = $ & ~PF_SPINNING + player.actionstate = 0 + player.actionsuper = false + end + end + + if not player.actionstate then + -- for some reason this is being set to 9 upon spawn. why is it doing that + player.actiontime = 0 + player.actionsuper = false + end +end + +local function fanghop(player) + local mo = player.mo + B.ZLaunch(mo, 7 * mo.scale, false) + mo.state = S_PLAY_JUMP + mo.momx = $ * -2/3 + mo.momy = $ * -2/3 + player.actionstate = 0 + player.actiontime = 0 + player.pflags = ($ | (PF_JUMPED | PF_STARTJUMP | PF_NOJUMPDAMAGE)) & ~PF_THOKKED + player.powers[pw_nocontrol] = 16 +end + +local function isSlide(player) + if not (player and player.valid and player.playerstate == PST_LIVE) + or not player.mo + or not player.mo.health + or player.actionstate ~= 2 then + return false + end + return true +end + +B.Fang_PreCollide = function(n1,n2,plr,mo,atk,def,weight,hurt,pain,ground,angle,thrust,thrust2,collisiontype) + if isSlide(plr[n1]) then + plr[n1].fangmarker = true + end +end + +B.Fang_PostCollide = function(n1,n2,plr,mo,atk,def,weight,hurt,pain,ground,angle,thrust,thrust2,collisiontype) + if plr[n1] and plr[n1].fangmarker then + plr[n1].fangmarker = nil + end +end + +B.Fang_Collide = function(n1,n2,plr,mo,atk,def,weight,hurt,pain,ground,angle,thrust,thrust2,collisiontype) + if not (plr[n1] and plr[n1].fangmarker) then + return false + end + + if (hurt != 1 and n1 == 1) or (hurt != -1 and n1 == 2) then + if P_IsObjectOnGround(mo[n1]) then + mo[n1].momx = $/3 + mo[n1].momy = $/3 + else + P_InstaThrust(mo[n1], angle[n2], -15 * mo[n1].scale) + P_SetObjectMomZ(mo[n1], 13 * mo[n1].scale) + mo[n1].angle = angle[n2] + plr[n1].drawangle = angle[n2] + plr[n1].actionstate = 0 + plr[n1].actiontime = 0 + plr[n1].pflags = ($|PF_JUMPED|PF_STARTJUMP) & ~PF_SPINNING + plr[n1].mo.state = S_PLAY_FALL + plr[n1].lockjumpframe = 0 + end + + if plr[n2] then + B.DoPlayerTumble(plr[n2], 50, angle[n1], mo[n1].scale*3, true, true) + end + + P_InstaThrust(mo[n2], angle[n2], -mo[n1].scale * 5) + B.ZLaunch(mo[n2], 13 * mo[n2].scale, false) + return true + end +end + +B.Action.Slide_Priority = function(player) + local mo = player.mo + if not (mo and mo.valid) return end + + local bouncing = player.pflags&PF_BOUNCING + local drop_state = player.actionstate == 1 and bouncing + and P_MobjFlip(mo)*mo.momz < 0 + local sliding = player.actionstate == 2 + and player.actiontime + + if player.actionstate == 1 then + B.SetPriority(player,0,1,"fang_springdrop",2,3,"spring drop") + elseif player.actionstate == 2 then + B.SetPriority(player,0,1,nil,0,1,"fang slide") + end +end + +B.Fang_SlideJump = function(player) + local mo = player.mo + if not (mo and mo.valid) then return end + + local skin = S[mo.skin] + + if skin.special ~= B.Action.Slide then return end + if player.actionstate ~= 2 then return end + if not P_IsObjectOnGround(mo) then return end + + P_DoJump(player) + player.mo.state = S_PLAY_ROLL + player.pflags = $ & ~PF_NOJUMPDAMAGE + return true +end \ No newline at end of file diff --git a/BattleMod/Lua/3-Functions/6-Definitions/Def_SkinVars.lua b/BattleMod/Lua/3-Functions/6-Definitions/Def_SkinVars.lua index c0def3be..6af87315 100644 --- a/BattleMod/Lua/3-Functions/6-Definitions/Def_SkinVars.lua +++ b/BattleMod/Lua/3-Functions/6-Definitions/Def_SkinVars.lua @@ -7,6 +7,8 @@ S[-1] = { weight = 100, shields = 1, special = nil, + special_playerthink = nil, + special_thinkframe = nil, -- guard_enabled = true, //Deprecated guard_frame = 2, func_guard_trigger = G.Parry, @@ -79,9 +81,9 @@ S["amy"] = { S["fang"] = { flags = SKINVARS_GUARD|SKINVARS_NOSPINSHIELD|SKINVARS_GUNSLINGER, weight = 100, - special = Act.CombatRoll, + special = Act.Slide, guard_frame = 1, - func_priority_ext = Act.CombatRoll_Priority, + func_priority_ext = Act.Slide_Priority, func_precollide = B.Fang_PreCollide, func_collide = B.Fang_Collide, func_postcollide = B.Fang_PostCollide, diff --git a/BattleMod/Lua/4-Hooks/Exec_Player.lua b/BattleMod/Lua/4-Hooks/Exec_Player.lua index 4037e891..187425b9 100644 --- a/BattleMod/Lua/4-Hooks/Exec_Player.lua +++ b/BattleMod/Lua/4-Hooks/Exec_Player.lua @@ -125,6 +125,7 @@ addHook("JumpSpecial",function(player) if (player.powers[pw_carry]) or player.battlespawning then return end if B.TwinSpinJump(player) then return true end if B.RingSparkCheck(player) then return true end + if B.Fang_SlideJump(player) then return true end end) addHook("SpinSpecial",function(player) @@ -147,6 +148,10 @@ addHook("PlayerThink", function(player) B.GlideSound(player) B.AutoSpectator(player) B.DiminishingMomentum(player) + + --Perform Actions + B.MasterActionScript(player,B.ButtonCheck(player,player.battleconfig_special),0) + -- Spring checks (Should this be dropped in `Exec_Springs.lua`?) if player.mo and player.mo.valid then player.suicide_watch = true // is this joke too dark? diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A1.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A1.lmp new file mode 100644 index 00000000..ff1bb5d9 Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A1.lmp differ diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A2.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A2.lmp new file mode 100644 index 00000000..06cb5e8a Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A2.lmp differ diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A3.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A3.lmp new file mode 100644 index 00000000..63d09447 Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A3.lmp differ diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A4.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A4.lmp new file mode 100644 index 00000000..59429249 Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A4.lmp differ diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A5.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A5.lmp new file mode 100644 index 00000000..14d35d0d Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A5.lmp differ diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A6.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A6.lmp new file mode 100644 index 00000000..1834fa2a Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A6.lmp differ diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A7.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A7.lmp new file mode 100644 index 00000000..66b9e4cd Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A7.lmp differ diff --git a/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A8.lmp b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A8.lmp new file mode 100644 index 00000000..bbc310eb Binary files /dev/null and b/BattleMod/zSkins/5_Fang/2_Sprites/FLY_A8.lmp differ