Pull in Draco's character moveset changes

This commit is contained in:
MysterD 2022-02-23 18:13:29 -08:00
parent 5e3384bdb0
commit 1a742bfb9a
2 changed files with 133 additions and 44 deletions

86
cm.patch Normal file
View File

@ -0,0 +1,86 @@
diff --git a/mods/character-movesets.lua b/mods/character-movesets.lua
index 7f23a014..d9e87a15 100644
--- a/mods/character-movesets.lua
+++ b/mods/character-movesets.lua
@@ -512,11 +512,13 @@ end
function act_wario_dash(m)
local e = gStateExtras[m.playerIndex]
- -- when hitting wall, stay dashing for an extra frame
+ -- when hitting wall, knock Wario backwards and thrust him upwards
if m.actionArg == 99 then
m.actionTimer = m.actionTimer + 1
if m.actionTimer > 2 then
- return set_mario_action(m, ACT_WALKING, 0)
+ mario_set_forward_vel(m, -30)
+ m.vel.y = 40
+ return set_mario_action(m, ACT_FREEFALL, 0)
end
return 0
end
@@ -537,8 +539,8 @@ function act_wario_dash(m)
set_anim_to_frame(m, 25)
-- set dash speed
- local speed = 80
- if m.actionTimer > 8 then
+ local speed = 60
+ if m.actionTimer > 20 then
speed = speed - (m.actionTimer - 8) * 7
end
mario_set_forward_vel(m, speed)
@@ -561,6 +563,18 @@ end
function act_wario_air_dash(m)
local e = gStateExtras[m.playerIndex]
+ -- when hitting wall, knock Wario backwards and thrust him upwards
+ if m.actionArg == 99 then
+ m.actionTimer = m.actionTimer + 1
+ if m.actionTimer > 2 then
+ m.particleFlags = m.particleFlags | PARTICLE_VERTICAL_STAR
+ mario_set_forward_vel(m, -30)
+ m.vel.y = 40
+ return set_mario_action(m, ACT_FREEFALL, 0)
+ end
+ return 0
+ end
+
-- walk once dash is up
if m.actionTimer > 15 then
return set_mario_action(m, ACT_JUMP_LAND, 0)
@@ -571,8 +585,8 @@ function act_wario_air_dash(m)
set_anim_to_frame(m, 25)
-- set dash speed
- local speed = 100
- if m.actionTimer > 8 then
+ local speed = 60
+ if m.actionTimer > 20 then
speed = speed - (m.actionTimer - 8) * 11
end
mario_set_forward_vel(m, speed)
@@ -602,7 +616,7 @@ function act_wario_spinning_obj(m)
return set_mario_action(m, ACT_RELEASING_BOWSER, 0)
end
- -- set animation
+ -- set animation
if m.playerIndex == 0 and m.angleVel.y == 0 then
m.actionTimer = m.actionTimer + 1
if m.actionTimer > 120 then
@@ -819,6 +833,15 @@ function wario_on_set_action(m)
m.vel.z = 0
end
+ -- when hitting a wall which dashing, have one more single frame of dash
+ if m.action == ACT_AIR_HIT_WALL and m.prevAction == ACT_WARIO_AIR_DASH then
+ set_mario_action(m, ACT_WARIO_AIR_DASH, 99)
+ mario_set_forward_vel(m, 1)
+ m.vel.x = 0
+ m.vel.y = 0
+ m.vel.z = 0
+ end
+
-- more height on triple jump
if m.action == ACT_TRIPLE_JUMP or m.action == ACT_SPECIAL_TRIPLE_JUMP then
m.vel.y = m.vel.y * 1.15

View File

@ -8,7 +8,7 @@ SPIN_TIMER_SUCCESSFUL_INPUT = 4
gEventTable = {} gEventTable = {}
gStateExtras = {} gStateExtras = {}
for i=0,(MAX_PLAYERS-1) do for i = 0, (MAX_PLAYERS - 1) do
gStateExtras[i] = {} gStateExtras[i] = {}
local m = gMarioStates[i] local m = gMarioStates[i]
local e = gStateExtras[i] local e = gStateExtras[i]
@ -17,7 +17,7 @@ for i=0,(MAX_PLAYERS-1) do
e.prevPos.y = 0 e.prevPos.y = 0
e.prevPos.z = 0 e.prevPos.z = 0
e.angleDeltaQueue = {} e.angleDeltaQueue = {}
for j=0,(ANGLE_QUEUE_SIZE-1) do e.angleDeltaQueue[j] = 0 end for j = 0, (ANGLE_QUEUE_SIZE - 1) do e.angleDeltaQueue[j] = 0 end
e.lastAction = m.action e.lastAction = m.action
e.animFrame = 0 e.animFrame = 0
e.scuttle = 0 e.scuttle = 0
@ -135,6 +135,7 @@ end
function luigi_before_phys_step(m) function luigi_before_phys_step(m)
local e = gStateExtras[m.playerIndex] local e = gStateExtras[m.playerIndex]
local floorClass = mario_get_floor_class(m)
local hScale = 1.0 local hScale = 1.0
local vScale = 1.0 local vScale = 1.0
@ -150,7 +151,7 @@ function luigi_before_phys_step(m)
-- slower holding item -- slower holding item
if m.heldObj ~= nil then if m.heldObj ~= nil then
m.vel.y = m.vel.y - 2.0 m.vel.y = m.vel.y - 1.0
hScale = hScale * 0.9 hScale = hScale * 0.9
if (m.action & ACT_FLAG_AIR) ~= 0 then if (m.action & ACT_FLAG_AIR) ~= 0 then
hScale = hScale * 0.9 hScale = hScale * 0.9
@ -158,7 +159,6 @@ function luigi_before_phys_step(m)
end end
-- acceleration -- acceleration
local floorClass = mario_get_floor_class(m)
if (m.action == ACT_WALKING) then if (m.action == ACT_WALKING) then
if (floorClass == 19 or floorClass == 20) then if (floorClass == 19 or floorClass == 20) then
hScale = -(m.forwardVel / 64) + 1.5 hScale = -(m.forwardVel / 64) + 1.5
@ -197,7 +197,7 @@ function luigi_on_set_action(m)
-- nerf wall kicks -- nerf wall kicks
elseif m.action == ACT_WALL_KICK_AIR and m.prevAction ~= ACT_HOLDING_POLE and m.prevAction ~= ACT_CLIMBING_POLE then elseif m.action == ACT_WALL_KICK_AIR and m.prevAction ~= ACT_HOLDING_POLE and m.prevAction ~= ACT_CLIMBING_POLE then
if m.vel.y > 40 then m.vel.y = 40 end if m.vel.y > 56 then m.vel.y = 56 end
return return
-- turn dive into kick when holding jump -- turn dive into kick when holding jump
@ -216,12 +216,18 @@ end
function luigi_update(m) function luigi_update(m)
local e = gStateExtras[m.playerIndex] local e = gStateExtras[m.playerIndex]
-- increase player damage
if (m.hurtCounter > e.lastHurtCounter) then
m.hurtCounter = m.hurtCounter + 4
end
e.lastHurtCounter = m.hurtCounter
-- air scuttle -- air scuttle
e.scuttle = 0 e.scuttle = 0
local shouldScuttle = (m.action == ACT_JUMP or m.action == ACT_DOUBLE_JUMP) and ((m.controller.buttonDown & A_BUTTON) ~= 0 and m.vel.y < -5) local shouldScuttle = (m.action == ACT_JUMP or m.action == ACT_DOUBLE_JUMP) and ((m.controller.buttonDown & A_BUTTON) ~= 0 and m.vel.y < -5)
if shouldScuttle then if shouldScuttle then
-- prevent wing flutter from glitching out while scuttling -- prevent wing flutter from glitching out while scuttling
if (m.flags & MARIO_WING_CAP) ~= 0 then if m.marioBodyState.wingFlutter == 1 then
m.vel.y = m.vel.y + 1 m.vel.y = m.vel.y + 1
else else
m.vel.y = m.vel.y + 3 m.vel.y = m.vel.y + 3
@ -704,12 +710,12 @@ function wario_update_spin_input(m)
end end
if e.spinDirection ~= newDirection then if e.spinDirection ~= newDirection then
for i=0,(ANGLE_QUEUE_SIZE-1) do for i = 0, (ANGLE_QUEUE_SIZE - 1) do
e.angleDeltaQueue[i] = 0 e.angleDeltaQueue[i] = 0
end end
e.spinDirection = newDirection e.spinDirection = newDirection
else else
for i=(ANGLE_QUEUE_SIZE-1),1,-1 do for i = (ANGLE_QUEUE_SIZE - 1), 1, -1 do
e.angleDeltaQueue[i] = e.angleDeltaQueue[i-1] e.angleDeltaQueue[i] = e.angleDeltaQueue[i-1]
angleOverFrames = angleOverFrames + e.angleDeltaQueue[i] angleOverFrames = angleOverFrames + e.angleDeltaQueue[i]
end end
@ -723,7 +729,7 @@ function wario_update_spin_input(m)
end end
elseif e.spinDirection > 0 then elseif e.spinDirection > 0 then
if signedOverflow ~= 0 then if signedOverflow ~= 0 then
thisFrameDelta = math.floor(1.0*rawAngle + 0x10000 - e.stickLastAngle) thisFrameDelta = math.floor(1.0 * rawAngle + 0x10000 - e.stickLastAngle)
else else
thisFrameDelta = rawAngle - e.stickLastAngle thisFrameDelta = rawAngle - e.stickLastAngle
end end
@ -755,13 +761,15 @@ function wario_before_phys_step(m)
local hScale = 1.0 local hScale = 1.0
-- slower on ground -- slower on ground
if (m.action & ACT_FLAG_MOVING) ~= 0 then if m.action == ACT_WALKING then
hScale = hScale * 0.9 hScale = hScale * 0.9
end end
-- make wario sink -- make wario sink
if (m.action & ACT_FLAG_SWIMMING) ~= 0 then if (m.action & ACT_FLAG_SWIMMING) ~= 0 then
if m.action ~= ACT_WATER_PLUNGE then if m.action ~= ACT_BACKWARD_WATER_KB and
m.action ~= ACT_FORWARD_WATER_KB and
m.action ~= ACT_WATER_PLUNGE then
m.vel.y = m.vel.y - 3 m.vel.y = m.vel.y - 3
end end
end end
@ -800,7 +808,7 @@ function wario_on_set_action(m)
m.vel.x = 0 m.vel.x = 0
m.vel.y = 70.0 m.vel.y = 70.0
m.vel.z = 0 m.vel.z = 0
elseif (m.action == ACT_SLIDE_KICK) then elseif m.action == ACT_SLIDE_KICK then
mario_set_forward_vel(m, 70) mario_set_forward_vel(m, 70)
m.vel.x = 0 m.vel.x = 0
m.vel.y = 30.0 m.vel.y = 30.0
@ -825,15 +833,15 @@ function wario_on_set_action(m)
end end
-- less height on other jumps -- less height on other jumps
if m.action == ACT_JUMP or m.action == ACT_DOUBLE_JUMP or m.action == ACT_STEEP_JUMP or m.action == ACT_RIDING_SHELL_JUMP or m.action == ACT_BACKFLIP or m.action == ACT_LONG_JUMP then if m.action == ACT_JUMP or
m.vel.y = m.vel.y * 0.9 m.action == ACT_DOUBLE_JUMP or
m.action == ACT_STEEP_JUMP or
m.action == ACT_RIDING_SHELL_JUMP or
m.action == ACT_BACKFLIP or
m.action == ACT_LONG_JUMP or
m.action == ACT_SIDE_FLIP then
-- prevent from getting stuck on platform m.vel.y = m.vel.y * 0.9
if m.marioObj.platform ~= nil then
m.pos.y = m.pos.y + 10
end
elseif m.action == ACT_SIDE_FLIP then
m.vel.y = m.vel.y * 1.1
-- prevent from getting stuck on platform -- prevent from getting stuck on platform
if m.marioObj.platform ~= nil then if m.marioObj.platform ~= nil then
@ -886,15 +894,11 @@ function wario_update(m)
m.vel.y = m.vel.y * 1.3 m.vel.y = m.vel.y * 1.3
end end
-- more gravity -- decrease player damage
if (m.action & ACT_FLAG_AIR) ~= 0 then if m.hurtCounter > e.lastHurtCounter and m.action ~= ACT_LAVA_BOOST then
m.vel.y = m.vel.y - 1.15 m.hurtCounter = math.max(3, m.hurtCounter - 4)
end
-- takes less damage
if m.action ~= ACT_LAVA_BOOST then
m.hurtCounter = m.hurtCounter * 0.5
end end
e.lastHurtCounter = m.hurtCounter
m.vel.x = m.vel.x * hScale m.vel.x = m.vel.x * hScale
m.vel.z = m.vel.z * hScale m.vel.z = m.vel.z * hScale
@ -919,7 +923,11 @@ function mario_before_phys_step(m)
return return
end end
if gEventTable[m.character.type] == nil or gEventTable[m.character.type].before_phys_step == nil then if gEventTable[m.character.type] == nil then
return
end
if gEventTable[m.character.type].before_phys_step == nil then
return return
end end
@ -931,31 +939,27 @@ function mario_on_set_action(m)
return return
end end
if gEventTable[m.character.type] == nil or gEventTable[m.character.type].on_set_action == nil then if gEventTable[m.character.type] == nil then
return
end
if gEventTable[m.character.type].on_set_action == nil then
return return
end end
gEventTable[m.character.type].on_set_action(m) gEventTable[m.character.type].on_set_action(m)
end end
function mario_before_update(m)
if m.action == ACT_BUBBLED then
return
end
if gEventTable[m.character.type] == nil or gEventTable[m.character.type].before_update == nil then
return
end
gEventTable[m.character.type].before_update(m)
end
function mario_update(m) function mario_update(m)
if m.action == ACT_BUBBLED then if m.action == ACT_BUBBLED then
return return
end end
if gEventTable[m.character.type] == nil or gEventTable[m.character.type].update == nil then if gEventTable[m.character.type] == nil then
return
end
if gEventTable[m.character.type].update == nil then
return return
end end
@ -966,7 +970,6 @@ end
-- hooks -- -- hooks --
----------- -----------
hook_event(HOOK_BEFORE_MARIO_UPDATE, mario_before_update)
hook_event(HOOK_MARIO_UPDATE, mario_update) hook_event(HOOK_MARIO_UPDATE, mario_update)
hook_event(HOOK_ON_SET_MARIO_ACTION, mario_on_set_action) hook_event(HOOK_ON_SET_MARIO_ACTION, mario_on_set_action)
hook_event(HOOK_BEFORE_PHYS_STEP, mario_before_phys_step) hook_event(HOOK_BEFORE_PHYS_STEP, mario_before_phys_step)