-- name: \\#ff0303\\New 64 Movesets 1.1 -- incompatible: moveset -- description: The New Super Mario Bros Wii moveset now on Super Mario 64! Made by: Pepitosxd Spin, double jump and ground pound shake by: Dremy_Bowser Wall Slide by: Atrael2 local movesetvariable = true gStateExtras = {} for i = 0, (MAX_PLAYERS - 1) do gStateExtras[i] = {} local m = gMarioStates[i] local e = gStateExtras[i] e.forca = 0 e.timer = 0 end -- spin, ground pound shake and double jump by Dremy_Bowser (Thx a lot Dremy_Bowser!) ACT_FUNNY_JUMP_CANCEL = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION | ACT_FLAG_CONTROL_JUMP_HEIGHT) function mario_on_set_action(m) local e = gStateExtras[m.playerIndex] if m.action == ACT_FUNNY_JUMP_CANCEL then m.vel.y = 60 end e.lastAction = action end hook_event(HOOK_ON_SET_MARIO_ACTION, mario_on_set_action) function act_funny_jump_cancel(m) local e = gStateExtras[m.playerIndex] if m.actionTimer == 0 then m.particleFlags = m.particleFlags | PARTICLE_MIST_CIRCLE e.animFrame = 68 e.rotAngle = m.faceAngle.y e.animArg = math.floor(math.random(1, 2)) end local stepResult = common_air_action_step(m, ACT_DOUBLE_JUMP_LAND, MARIO_ANIM_TWIRL, AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG) m.particleFlags = m.particleFlags | PARTICLE_SPARKLES m.faceAngle.y = m.intendedYaw if (m.input & INPUT_Z_PRESSED) ~= 0 then return set_mario_action(m, ACT_GROUND_POUND, 0) end if (m.input & INPUT_NONZERO_ANALOG) ~= 0 then mario_set_forward_vel(m, math.abs(m.forwardVel)) end 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_FEET_STUCK_IN_GROUND, 0) else play_sound(SOUND_ACTION_TERRAIN_LANDING, m.marioObj.header.gfx.cameraToObject) set_mario_action(m, ACT_DOUBLE_JUMP_LAND, 0) end end e.rotAngle = e.rotAngle + 0x2000 m.marioObj.header.gfx.angle.y = e.rotAngle m.actionTimer = m.actionTimer + 1 return 0 end hook_mario_action(ACT_FUNNY_JUMP_CANCEL, { every_frame = act_funny_jump_cancel }) function mario_update(m) local e = gStateExtras[m.playerIndex] if m.action == ACT_FUNNY_JUMP_CANCEL then play_character_sound(m, CHAR_SOUND_TWIRL_BOUNCE) end end hook_event(HOOK_ON_SET_MARIO_ACTION, mario_update) function mario_update(m) if m.action == ACT_PICKING_UP or m.action == ACT_PICKING_UP_BOWSER or m.action == ACT_THROWING or m.action == ACT_HOLDING_BOWSER or m.action == ACT_RELEASING_BOWSER or m.action == ACT_HOLD_HEAVY_IDLE or m.action == ACT_HOLD_HEAVY_WALKING or m.action == ACT_HOLD_IDLE or m.action == ACT_HOLD_JUMP then return end -- double jump local shouldDoubleJump = (m.action == ACT_TRIPLE_JUMP or m.action == ACT_WALL_KICK or m.action == ACT_DOUBLE_JUMP or m.action == ACT_JUMP or m.action == ACT_SIDE_FLIP or m.action == ACT_FREEFALL or m.action == ACT_SPIN_POUND or m.action == ACT_DIVE or m.action == ACT_TWIRLING) if not movesetvariable then return end if shouldDoubleJump and m.actionTimer > 0 and (m.controller.buttonPressed & A_BUTTON) ~= 0 then return set_mario_action(m, ACT_FUNNY_JUMP_CANCEL, 0) end if shouldDoubleJump then m.actionTimer = m.actionTimer + 1 end end hook_event(HOOK_MARIO_UPDATE, mario_update) -- spin local can_press_x = 0 function x_pressed(m) if m.action == ACT_STAR_DANCE_EXIT or m.action == ACT_STAR_DANCE_NO_EXIT or m.action == ACT_STAR_DANCE_WATER or m.action == ACT_FALL_AFTER_STAR_GRAB or m.action == ACT_READING_NPC_DIALOG or m.action == ACT_READING_AUTOMATIC_DIALOG or m.action == ACT_DISAPPEARED or m.action == ACT_SPAWN_SPIN_AIRBONE or m.action == ACT_SPAWN_SPIN_LANDING or m.action == ACT_SPAWN_NO_SPIN_AIRBORNE or m.action == ACT_SPAWN_NO_SPIN_LANDING or m.action == ACT_EXIT_LAND_SAVE_DIALOG or m.action == ACT_FALLING_EXIT_AIRBONE or m.action == ACT_IN_CANNON or m.action == ACT_GRABBED or m.action == ACT_PULLING_DOOR or m.action == ACT_PUSHING_DOOR or m.action == ACT_WARP_DOOR_SPAWN or m.action == ACT_ENTERING_STAR_DOOR or m.action == ACT_UNLOCKING_STAR_DOOR or m.action == ACT_UNLOCKING_KEY_DOOR or m.action == ACT_BACKWARD_AIR_KB or m.action == ACT_BACKWARD_AIR_KB or m.action == ACT_FORWARD_AIR_KB or m.action == ACT_FORWARD_GROUND_KB or m.action == ACT_DEATH_EXIT or m.action == ACT_DEATH_EXIT_LAND or m.action == ACT_DEATH_ON_BACK or m.action == ACT_DEATH_ON_STOMACH or m.action == ACT_FALLING_DEATH_EXIT or m.action == ACT_QUICKSAND_DEATH or m.action == ACT_SPECIAL_DEATH_EXIT then return end if m.health < 0x100 or m.hurtCounter ~= 0 then return end if (m.action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED then return end if m.playerIndex ~= 0 then return end if not movesetvariable then return end if m.controller.buttonPressed & X_BUTTON ~= 0 then if x_press_counter > 0 then set_jumping_action(m, ACT_FUNNY_JUMP_CANCEL, 0) x_press_counter = x_press_counter - 1 end end if (m.action & ACT_FLAG_AIR) == 0 then x_press_counter = 2 end end hook_event(HOOK_MARIO_UPDATE, x_pressed) -- ground pound shake function mario_update(m) if not movesetvariable then return end if m.action == ACT_GROUND_POUND_LAND then set_camera_shake_from_hit(SHAKE_MED_DAMAGE) end end hook_event(HOOK_MARIO_UPDATE, mario_update) -- disable long jump function before_set_mario_action(m, action) if not movesetvariable then return end if action == ACT_LONG_JUMP then return 1 end end hook_event(HOOK_BEFORE_SET_MARIO_ACTION, before_set_mario_action) -- disable backflip function before_set_mario_action(m, action) if not movesetvariable then return end if action == ACT_BACKFLIP then return 1 end end hook_event(HOOK_BEFORE_SET_MARIO_ACTION, before_set_mario_action) -- wall slide (Thx a lot Atrael2!) gStateExtras = {} for i=0,(MAX_PLAYERS-1) do gStateExtras[i] = {} local m = gMarioStates[i] local e = gStateExtras[i] e.personalTimer = 0 end ACT_MARIO_WALL_SLIDE = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR) 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 function act_mario_wall_slide(m) local stepResult = perform_air_step(m, 0) local e = gStateExtras[m.playerIndex] mario_set_forward_vel(m, -1.0) m.vel.y = m.vel.y + 2 set_anim_to_frame(m, 1) if m.actionTimer == 0 then e.animFrame = 2 end if m.wall == nil and m.actionTimer > 2 then mario_set_forward_vel(m, 0.0) set_mario_action(m, ACT_FREEFALL, 0) end if m.vel.y > 0 then m.particleFlags = m.particleFlags | PARTICLE_SPARKLES end if m.vel.y < -39 then m.vel.y = -40 end if stepResult == AIR_STEP_LANDED then set_mario_action(m, ACT_FREEFALL_LAND, 0) end if m.vel.y < 0 then play_sound(SOUND_MOVING_TERRAIN_SLIDE + m.terrainSoundAddend, m.marioObj.header.gfx.cameraToObject) m.particleFlags = m.particleFlags | PARTICLE_DUST end if (m.controller.buttonPressed & A_BUTTON) ~= 0 then set_mario_action(m, ACT_WALL_KICK_AIR, 0) end set_mario_animation(m, CHAR_ANIM_START_WALLKICK) if e.animFrame >= m.marioObj.header.gfx.animInfo.curAnim.loopEnd then e.animFrame = m.marioObj.header.gfx.animInfo.curAnim.loopEnd end e.animFrame = e.animFrame + 1 m.actionTimer = m.actionTimer + 1 return end function wall_slide(m) local jumpies = { [ACT_JUMP] = ACT_JUMP, [ACT_DOUBLE_JUMP] = ACT_DOUBLE_JUMP, [ACT_TRIPLE_JUMP] = ACT_TRIPLE_JUMP, [ACT_SPECIAL_TRIPLE_JUMP] = ACT_SPECIAL_TRIPLE_JUMP, [ACT_SIDE_FLIP] = ACT_SIDE_FLIP, [ACT_FREEFALL] = ACT_FREEFALL, } local jumpiesaction = jumpies[m.action] if m.wall and movesetvariable == true and jumpiesaction and m.vel.y < 0 and (m.input & (INPUT_NONZERO_ANALOG)) ~= 0 then m.vel.x = 0 m.vel.z = 0 set_mario_action(m, ACT_SOFT_BONK, 0) end if m.prevAction == ACT_MARIO_WALL_SLIDE and m.action == ACT_WALL_KICK_AIR then m.faceAngle.y = m.intendedYaw - approach_s32(convert_s16(m.intendedYaw - m.faceAngle.y), 0, 0x500, 0x500) end if movesetvariable == true then if m.action == ACT_SOFT_BONK or m.action == ACT_AIR_HIT_WALL then m.vel.x = 0 m.vel.z = 0 m.faceAngle.y = m.faceAngle.y + 0x8000 set_mario_action(m, ACT_MARIO_WALL_SLIDE, 0) end end end hook_mario_action(ACT_MARIO_WALL_SLIDE, act_mario_wall_slide) hook_event(HOOK_MARIO_UPDATE, wall_slide) --- @param msg string --this is the function for enabling or disabling some moveset, local function movesettoggle_command(msg) local m = string.lower(msg) --making the msg string be lowercase if m == 'on' then movesetvariable = true djui_chat_message_create('New 64 moveset is \\#00C7FF\\on\\#ffffff\\!') return true elseif m == 'off' then movesetvariable = false djui_chat_message_create('New 64 moveset is \\#A02200\\off\\#ffffff\\!') return true end return false end hook_chat_command('new64', "[on|off] turn New 64 moveset \\#00C7FF\\on \\#ffffff\\or \\#A02200\\off \\#ffffff\\. ", movesettoggle_command)