Character Movesets and Extended Moveset changes. (#156)

* CHanges

* Changes and extensions t' Wario and Luigi's movesets (mostly Wario's)

- Wario's shoulder bash now hits more stuff.
- You can now control Wario's bash angle.
- Introducin' Wario's Piledriver. Press Z while holdin' an object in the air to use it.
- Wario's ground pound now has a squish effect when you land on the ground.
- Changed up some Wario voice clips.
- Luigi can now also scuttle when he's holdin' an object.

* Made the dive hop more visually accurate

* Changes and extensions t' Wario and Luigi's movesets (mostly Wario's)


- Wario's shoulder bash now hits more stuff.
- You can now control Wario's bash angle.
- Introducin' Wario's Piledriver. Press Z while holdin' an object in the air to use it.
- Wario's ground pound now has a squish effect when you land on the ground.
- Changed up some Wario voice clips.
- Luigi can now also scuttle when he's holdin' an object.
This commit is contained in:
stvene3004 2022-08-26 07:24:15 +07:00 committed by GitHub
parent 7bb49322f0
commit ee74afc804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 110 additions and 20 deletions

View File

@ -36,8 +36,8 @@ end
-- luigi --
-----------
ACT_SPIN_POUND_LAND = allocate_mario_action(ACT_GROUP_STATIONARY | ACT_FLAG_STATIONARY | ACT_FLAG_ATTACKING)
ACT_SPIN_POUND = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | ACT_FLAG_ATTACKING)
ACT_SPIN_POUND_LAND = allocate_mario_action(ACT_FLAG_STATIONARY | ACT_FLAG_ATTACKING)
ACT_SPIN_POUND = allocate_mario_action(ACT_FLAG_AIR | ACT_FLAG_ATTACKING)
function act_spin_pound(m)
local e = gStateExtras[m.playerIndex]
@ -139,6 +139,8 @@ function luigi_before_phys_step(m)
local floorClass = mario_get_floor_class(m)
local hScale = 1.0
local vScale = 1.0
if gPlayerSyncTable[0].modelId ~= nil then return end
-- faster swimming
if (m.action & ACT_FLAG_SWIMMING) ~= 0 then
@ -191,6 +193,8 @@ end
function luigi_on_set_action(m)
local e = gStateExtras[m.playerIndex]
if gPlayerSyncTable[0].modelId ~= nil then return end
-- extra height to the backflip
if m.action == ACT_BACKFLIP then
@ -216,6 +220,8 @@ end
function luigi_update(m)
local e = gStateExtras[m.playerIndex]
if gPlayerSyncTable[0].modelId ~= nil then return end
-- increase player damage
if (m.hurtCounter > e.lastHurtCounter) then
@ -225,14 +231,18 @@ function luigi_update(m)
-- air scuttle
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 or m.action == ACT_HOLD_JUMP) and ((m.controller.buttonDown & A_BUTTON) ~= 0 and m.vel.y < -5)
if shouldScuttle then
-- prevent wing flutter from glitching out while scuttling
if m.marioBodyState.wingFlutter == 1 then
m.vel.y = m.vel.y + 1
else
m.vel.y = m.vel.y + 3
set_mario_animation(m, MARIO_ANIM_RUNNING_UNUSED)
if m.action == ACT_HOLD_JUMP then
set_mario_animation(m, MARIO_ANIM_RUN_WITH_LIGHT_OBJ)
else
set_mario_animation(m, MARIO_ANIM_RUNNING_UNUSED)
end
set_anim_to_frame(m, e.animFrame)
e.animFrame = e.animFrame + 13
if e.animFrame >= m.marioObj.header.gfx.animInfo.curAnim.loopEnd then
@ -360,7 +370,7 @@ gEventTable[CT_TOAD] = {
-- waluigi --
-------------
ACT_WALL_SLIDE = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | ACT_FLAG_MOVING | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION)
ACT_WALL_SLIDE = allocate_mario_action(ACT_FLAG_AIR | ACT_FLAG_MOVING | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION)
function act_wall_slide(m)
if (m.input & INPUT_A_PRESSED) ~= 0 then
@ -481,11 +491,12 @@ gEventTable[CT_WALUIGI] = {
-----------
-- wario --
-----------
ACT_WARIO_DASH = allocate_mario_action(ACT_GROUP_MOVING | ACT_FLAG_MOVING | ACT_FLAG_ATTACKING)
ACT_WARIO_AIR_DASH = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | ACT_FLAG_ATTACKING)
ACT_CORKSCREW_CONK = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | ACT_FLAG_ATTACKING | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION)
ACT_WARIO_SPINNING_OBJ = allocate_mario_action(ACT_GROUP_OBJECT | ACT_FLAG_STATIONARY)
ACT_WARIO_DASH = allocate_mario_action(ACT_FLAG_MOVING | ACT_FLAG_ATTACKING)
ACT_WARIO_AIR_DASH = allocate_mario_action(ACT_FLAG_AIR | ACT_FLAG_ATTACKING)
ACT_WARIO_HOLD_JUMP = allocate_mario_action(ACT_FLAG_AIR | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION)
ACT_CORKSCREW_CONK = allocate_mario_action(ACT_FLAG_AIR | ACT_FLAG_ATTACKING | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION)
ACT_PILEDRIVER = allocate_mario_action(ACT_FLAG_AIR | ACT_FLAG_ATTACKING | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION)
ACT_WARIO_SPINNING_OBJ = allocate_mario_action(ACT_FLAG_STATIONARY)
function act_corkscrew_conk(m)
local e = gStateExtras[m.playerIndex]
@ -533,7 +544,7 @@ function act_wario_dash(m)
-- make sound
if m.actionTimer == 0 then
m.actionState = m.actionArg
play_character_sound(m, CHAR_SOUND_YAHOO)
play_character_sound(m, CHAR_SOUND_WAH2)
end
-- walk once dash is up
@ -562,6 +573,8 @@ function act_wario_dash(m)
if (m.input & INPUT_Z_PRESSED) ~= 0 then
return set_mario_action(m, ACT_SLIDE_KICK, 0)
end
m.faceAngle.y = m.intendedYaw - approach_s32(convert_s16(m.intendedYaw - m.faceAngle.y), 0, 0x400, 0x400)
m.actionTimer = m.actionTimer + 1
return 0
@ -609,6 +622,8 @@ function act_wario_air_dash(m)
if (m.input & INPUT_Z_PRESSED) ~= 0 then
return set_mario_action(m, ACT_SLIDE_KICK, 0)
end
m.faceAngle.y = m.intendedYaw - approach_s32(convert_s16(m.intendedYaw - m.faceAngle.y), 0, 0x400, 0x400)
m.actionTimer = m.actionTimer + 1
return 0
@ -619,7 +634,7 @@ function act_wario_spinning_obj(m)
-- throw object
if m.playerIndex == 0 and (m.input & INPUT_B_PRESSED) ~= 0 then
play_character_sound_if_no_flag(m, CHAR_SOUND_WAH2, MARIO_MARIO_SOUND_PLAYED)
play_character_sound_if_no_flag(m, CHAR_SOUND_SO_LONGA_BOWSER, MARIO_MARIO_SOUND_PLAYED)
play_sound_if_no_flag(m, SOUND_ACTION_THROW, MARIO_ACTION_SOUND_PLAYED)
return set_mario_action(m, ACT_RELEASING_BOWSER, 0)
end
@ -773,6 +788,59 @@ function wario_update_spin_input(m)
e.lastIntendedMag = m.intendedMag
end
function act_wario_hold_jump(m)
if (m.marioObj.oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) ~= 0 then
return drop_and_set_mario_action(m, ACT_FREEFALL, 0)
end
if (m.input & INPUT_B_PRESSED) ~= 0 and (m.heldObj ~= nil and (m.heldObj.oInteractionSubtype & INT_SUBTYPE_HOLDABLE_NPC) ~= nil) then
return set_mario_action(m, ACT_AIR_THROW, 0)
end
if (m.input & INPUT_Z_PRESSED) ~= 0 then
return set_mario_action(m, ACT_PILEDRIVER, 0)
end
play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0)
common_air_action_step(m, ACT_HOLD_JUMP_LAND, MARIO_ANIM_JUMP_WITH_LIGHT_OBJ,
AIR_STEP_CHECK_LEDGE_GRAB)
return false
end
function act_piledriver(m)
local e = gStateExtras[m.playerIndex]
if m.actionTimer == 0 then
play_sound(SOUND_ACTION_SPIN, m.marioObj.header.gfx.cameraToObject)
play_character_sound(m, CHAR_SOUND_SO_LONGA_BOWSER)
end
set_mario_animation(m, MARIO_ANIM_HOLDING_BOWSER)
local stepResult = perform_air_step(m, 0)
if stepResult == AIR_STEP_LANDED then
if should_get_stuck_in_ground(m) ~= 0 then
queue_rumble_data_mario(m, 5, 80)
play_sound(SOUND_MARIO_OOOF2, m.marioObj.header.gfx.cameraToObject)
m.particleFlags = m.particleFlags | PARTICLE_MIST_CIRCLE
set_mario_action(m, ACT_BUTT_STUCK_IN_GROUND, 0)
else
play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_HEAVY_LANDING)
if check_fall_damage(m, ACT_HARD_BACKWARD_GROUND_KB) == 0 then
m.particleFlags = m.particleFlags | PARTICLE_MIST_CIRCLE | PARTICLE_HORIZONTAL_STAR
-- set facing direction
-- not part of original Extended Moveset
local yawDiff = m.faceAngle.y - m.intendedYaw
e.rotAngle = e.rotAngle + yawDiff
m.faceAngle.y = m.intendedYaw
return set_mario_action(m, ACT_RELEASING_BOWSER, 0)
end
end
end
m.vel.y = -32
mario_set_forward_vel(m, 0)
m.faceAngle.y = m.faceAngle.y + 0x3000
m.actionTimer = m.actionTimer + 1
return 0
end
function wario_before_phys_step(m)
local hScale = 1.0
@ -883,6 +951,11 @@ function wario_on_set_action(m)
m.pos.y = m.pos.y + 10
end
end
if m.action == ACT_HOLD_JUMP then
return set_mario_action(m, ACT_WARIO_HOLD_JUMP, 0)
end
e.lastAction = action
end
@ -922,6 +995,7 @@ function wario_update(m)
-- shake camera
if m.action == ACT_GROUND_POUND_LAND then
set_camera_shake_from_point(SHAKE_POS_MEDIUM, m.pos.x, m.pos.y, m.pos.z)
m.squishTimer = 5
end
-- faster ground pound
@ -1001,6 +1075,18 @@ function mario_update(m)
gEventTable[m.character.type].update(m)
end
function convert_s16(num)
local min = -32768
local max = 32767
while (num < min) do
num = max + (num - min)
end
while (num > max) do
num = min + (num - max)
end
return num
end
-----------
-- hooks --
-----------
@ -1009,10 +1095,12 @@ hook_event(HOOK_MARIO_UPDATE, mario_update)
hook_event(HOOK_ON_SET_MARIO_ACTION, mario_on_set_action)
hook_event(HOOK_BEFORE_PHYS_STEP, mario_before_phys_step)
hook_mario_action(ACT_WALL_SLIDE, { every_frame = act_wall_slide })
hook_mario_action(ACT_SPIN_POUND, { every_frame = act_spin_pound }, INT_GROUND_POUND_OR_TWIRL)
hook_mario_action(ACT_SPIN_POUND_LAND, { every_frame = act_spin_pound_land }, INT_GROUND_POUND_OR_TWIRL)
hook_mario_action(ACT_WARIO_DASH, { every_frame = act_wario_dash }, INT_PUNCH)
hook_mario_action(ACT_WARIO_AIR_DASH, { every_frame = act_wario_air_dash }, INT_PUNCH)
hook_mario_action(ACT_CORKSCREW_CONK, { every_frame = act_corkscrew_conk }, INT_FAST_ATTACK_OR_SHELL)
hook_mario_action(ACT_WARIO_SPINNING_OBJ, { every_frame = act_wario_spinning_obj })
hook_mario_action(ACT_WALL_SLIDE, act_wall_slide)
hook_mario_action(ACT_SPIN_POUND, act_spin_pound, INT_GROUND_POUND_OR_TWIRL)
hook_mario_action(ACT_SPIN_POUND_LAND, act_spin_pound_land, INT_GROUND_POUND_OR_TWIRL)
hook_mario_action(ACT_WARIO_DASH, act_wario_dash, INT_KICK)
hook_mario_action(ACT_WARIO_AIR_DASH, act_wario_air_dash, INT_KICK)
hook_mario_action(ACT_CORKSCREW_CONK, act_corkscrew_conk, INT_FAST_ATTACK_OR_SHELL)
hook_mario_action(ACT_WARIO_SPINNING_OBJ, act_wario_spinning_obj)
hook_mario_action(ACT_PILEDRIVER, act_piledriver)
hook_mario_action(ACT_WARIO_HOLD_JUMP, act_wario_hold_jump)

View File

@ -1002,7 +1002,9 @@ function act_dive_slide(m)
if (m.input & INPUT_B_PRESSED) ~= 0 then
-- dive hop
m.vel.y = 21.0
return set_mario_action(m, ACT_DIVE, 1)
set_mario_action(m, ACT_DIVE, 1)
set_mario_animation(m, MARIO_ANIM_DIVE)
set_anim_to_frame(m, 15)
end
end