diff --git a/mods/character-movesets.lua b/mods/character-movesets.lua index ed11e8d5..b7d1ea20 100644 --- a/mods/character-movesets.lua +++ b/mods/character-movesets.lua @@ -36,8 +36,8 @@ end -- luigi -- ----------- -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) +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) function act_spin_pound(m) local e = gStateExtras[m.playerIndex] @@ -139,8 +139,6 @@ 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 @@ -193,8 +191,6 @@ 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 @@ -220,8 +216,6 @@ 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 @@ -231,18 +225,14 @@ function luigi_update(m) -- air scuttle e.scuttle = 0 - 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) + 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 -- 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 - 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_mario_animation(m, MARIO_ANIM_RUNNING_UNUSED) set_anim_to_frame(m, e.animFrame) e.animFrame = e.animFrame + 13 if e.animFrame >= m.marioObj.header.gfx.animInfo.curAnim.loopEnd then @@ -370,7 +360,7 @@ gEventTable[CT_TOAD] = { -- waluigi -- ------------- -ACT_WALL_SLIDE = allocate_mario_action(ACT_FLAG_AIR | ACT_FLAG_MOVING | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION) +ACT_WALL_SLIDE = allocate_mario_action(ACT_GROUP_AIRBORNE | 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 @@ -491,12 +481,11 @@ gEventTable[CT_WALUIGI] = { ----------- -- wario -- ----------- -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) + +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) function act_corkscrew_conk(m) local e = gStateExtras[m.playerIndex] @@ -544,7 +533,7 @@ function act_wario_dash(m) -- make sound if m.actionTimer == 0 then m.actionState = m.actionArg - play_character_sound(m, CHAR_SOUND_WAH2) + play_character_sound(m, CHAR_SOUND_YAHOO) end -- walk once dash is up @@ -573,8 +562,6 @@ 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 @@ -622,8 +609,6 @@ 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 @@ -634,7 +619,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_SO_LONGA_BOWSER, MARIO_MARIO_SOUND_PLAYED) + play_character_sound_if_no_flag(m, CHAR_SOUND_WAH2, 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 @@ -788,59 +773,6 @@ 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 @@ -951,11 +883,6 @@ 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 @@ -995,7 +922,6 @@ 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 @@ -1075,18 +1001,6 @@ 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 -- ----------- @@ -1095,12 +1009,10 @@ 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, 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) +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 }) diff --git a/mods/extended-moveset.lua b/mods/extended-moveset.lua index 357f12d0..2cd8644d 100644 --- a/mods/extended-moveset.lua +++ b/mods/extended-moveset.lua @@ -1001,9 +1001,7 @@ function act_dive_slide(m) if (m.input & INPUT_B_PRESSED) ~= 0 then -- dive hop m.vel.y = 21.0 - set_mario_action(m, ACT_DIVE, 1) - set_mario_animation(m, MARIO_ANIM_DIVE) - set_anim_to_frame(m, 15) + return set_mario_action(m, ACT_DIVE, 1) end end