-- name: Moveset \\#ff5400\\64 \\#00ff00\\Land \\#dcdcdc\\v1.1 -- incompatible: moveset -- description:A moveset based on the "Super Mario 64 Land" Romhack which is excellent and features over 131 stars, It also contains 2 commands and a popup message. The pop-up message made by \\#55a400\\Blither\\#8a1915\\Dev\\#dcdcdc\\, It is currently on version 1.1, One thing I want to say is that a large part of the code was done by ManIsCat2, Big credit to that person. Thank You For Download My Mod. The moveset includes: \n\n\\#fff305\\Spin Jump [X Button] \n\\#ff05ff\\Ground Pound Jump [A + Z + A] \n\\#00ff00\\Air Dive [Z + B] \n\\#0008f2\\Wall Slide \n\\#0785f2\\No Fall Damage. \n\n\\#dcdcdc\\The developer is:\n\\#ff5400\\MrCho\\#00ff00\\quin7 \\#dcdcdc\\(Main Creator)\n\\#b91c37\\River64\\#ff9000\\Espanol\\#545454\\! \\#dcdcdc\\(Tester) --------------------- --- Functions -- --------------------- local allocate_mario_action, atan2s, sins, coss, mario_set_forward_vel, set_mario_action, play_mario_sound, play_sound, set_mario_animation, set_anim_to_frame, check_fall_damage_or_get_stuck, common_air_action_step, perform_air_step, mario_drop_held_object = allocate_mario_action, atan2s, sins, coss, mario_set_forward_vel, set_mario_action, play_mario_sound, play_sound, set_mario_animation, set_anim_to_frame, check_fall_damage_or_get_stuck, common_air_action_step, perform_air_step, mario_drop_held_object local math_floor = math.floor --------------------- --- Actions ------ --------------------- ACT_FAKE_FREEFALL = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION) ACT_GROUND_POUND_JUMP = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION) ACT_SPIN_JUMP = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR | 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) local ACT_CUSTOM_AIR_HIT_WALL = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_AIR) -------------------- -- Sparkles ---- --------------------- local spinSparklesMode = 1 -- 0 = Disabled, 1 = Enabled local modeNames = { [0] = "\\#ff0000\\Disabled", [1] = "\\#00d2ff\\Enabled" } ----------------------- ---- Extra ---------- ----------------------- local ANGLE_QUEUE_SIZE = 9 local SPIN_TIMER_SUCCESSFUL_INPUT = 4 local SPINACTIONS = { [ACT_JUMP] = true, [ACT_DOUBLE_JUMP] = true, [ACT_TRIPLE_JUMP] = true, [ACT_LONG_JUMP] = true, [ACT_SIDE_FLIP] = true, [ACT_GROUND_POUND_JUMP] = true, [ACT_FORWARD_ROLLOUT] = true, [ACT_BACKWARD_ROLLOUT] = true, [ACT_WALL_KICK_AIR] = true, [ACT_BACKFLIP] = true, [ACT_FREEFALL] = true } local gMarioStateExtras = {} local function get_extra(m) if not m or m.playerIndex == nil then return nil end local idx = m.playerIndex if not gMarioStateExtras[idx] then gMarioStateExtras[idx] = { angleDeltaQueue = {}, rotAngle = 0, boostTimer = 0, stickLastAngle = 0, spinDirection = 0, spinBufferTimer = 0, spinInput = 0, lastIntendedMag = 0, lastPos = { x = 0, y = 0, z = 0 }, fakeSavedAction = 0, fakeSavedPrevAction = 0, fakeSavedActionTimer = 0, fakeWroteAction = 0, fakeSaved = false, savedWallSlideHeight = 0, savedWallSlide = false, animFrame = 0, spinRiseTimer = 0, groundPoundCooldown = 0, didSpin = false } for j = 0, (ANGLE_QUEUE_SIZE - 1) do gMarioStateExtras[idx].angleDeltaQueue[j] = 0 end end return gMarioStateExtras[idx] end local function limit_angle(a) return (a + 0x8000) % 0x10000 - 0x8000 end ------------------------ -- Fall Removal -- ------------------------ function no_fall_damage(m) if not m or m.playerIndex == nil then return end if gGlobalSyncTable.movesetEnabled == false then return end m.peakHeight = m.pos.y end function responsive_ground_pound_turn(m) if not m or m.playerIndex == nil then return end if gGlobalSyncTable.movesetEnabled == false then return end if m.playerIndex ~= 0 then return end if m.prevAction == ACT_GROUND_POUND_LAND and m.action ~= ACT_GROUND_POUND_JUMP and (m.action & ACT_FLAG_AIR) == 0 then m.faceAngle.y = m.intendedYaw end end ------------------------------ -- Spin Jump ----------- ------------------------------ local function mario_update_spin_input(m) local e = get_extra(m) if not e or (m.action & ACT_FLAG_AIR) == 0 then return end local rawAngle = atan2s(-m.controller.stickY, m.controller.stickX) e.spinInput = 0 if e.lastIntendedMag > 0.5 and m.intendedMag > 0.5 then local angleOverFrames = 0 local thisFrameDelta = 0 local newDirection = e.spinDirection local signedOverflow = 0 if rawAngle < e.stickLastAngle then if e.stickLastAngle - rawAngle > 0x8000 then signedOverflow = 1 end if signedOverflow ~= 0 then newDirection = 1 else newDirection = -1 end elseif rawAngle > e.stickLastAngle then if rawAngle - e.stickLastAngle > 0x8000 then signedOverflow = 1 end if signedOverflow ~= 0 then newDirection = -1 else newDirection = 1 end end if e.spinDirection ~= newDirection then for i = 0, (ANGLE_QUEUE_SIZE - 1) do e.angleDeltaQueue[i] = 0 end e.spinDirection = newDirection else for i = (ANGLE_QUEUE_SIZE - 1), 1, -1 do e.angleDeltaQueue[i] = e.angleDeltaQueue[i - 1] angleOverFrames = angleOverFrames + e.angleDeltaQueue[i] end end if e.spinDirection < 0 then if signedOverflow ~= 0 then thisFrameDelta = math_floor((1.0 * e.stickLastAngle + 0x10000) - rawAngle) else thisFrameDelta = e.stickLastAngle - rawAngle end elseif e.spinDirection > 0 then if signedOverflow ~= 0 then thisFrameDelta = math_floor(1.0 * rawAngle + 0x10000 - e.stickLastAngle) else thisFrameDelta = rawAngle - e.stickLastAngle end end e.angleDeltaQueue[0] = thisFrameDelta angleOverFrames = angleOverFrames + thisFrameDelta if angleOverFrames >= 0xA000 then e.spinBufferTimer = SPIN_TIMER_SUCCESSFUL_INPUT end if e.spinBufferTimer > 0 then e.spinInput = 1 e.spinBufferTimer = e.spinBufferTimer - 1 end else e.spinDirection = 0 e.spinBufferTimer = 0 end e.stickLastAngle = rawAngle e.lastIntendedMag = m.intendedMag end local function act_fake_freefall(m) common_air_action_step(m, ACT_FREEFALL, MARIO_ANIM_GENERAL_FALL, AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG) end local function act_spin_jump(m) local e = get_extra(m) if not e then return false end if m.actionTimer == 0 then if e.spinDirection < 0 then m.actionState = 1 end end if spinSparklesMode == 1 and m.playerIndex == 0 then m.particleFlags = m.particleFlags | PARTICLE_SPARKLES end local spinDirFactor = 1 if m.actionState == 1 then spinDirFactor = -1 end if m.playerIndex == 0 then if e.spinRiseTimer % 10 == 0 and e.spinRiseTimer ~= 30 then if m.marioObj and m.marioObj.header and m.marioObj.header.gfx then play_sound(SOUND_ACTION_TWIRL, m.marioObj.header.gfx.cameraToObject) end end end common_air_action_step(m, ACT_DOUBLE_JUMP_LAND, MARIO_ANIM_TWIRL, AIR_STEP_CHECK_HANG) if m.action == ACT_SPIN_JUMP then e.spinRiseTimer = e.spinRiseTimer + 1 if e.spinRiseTimer <= 30 then m.vel.y = 10 if m.forwardVel > 15 then m.forwardVel = 15 end else set_mario_action(m, ACT_FAKE_FREEFALL, 0) e.spinRiseTimer = 0 end else e.spinRiseTimer = 0 end e.rotAngle = e.rotAngle + 0x2867 if (e.rotAngle > 0x1000) then e.rotAngle = e.rotAngle - 0x1000 end m.marioBodyState.handState = MARIO_HAND_OPEN m.marioObj.header.gfx.angle.y = limit_angle(m.marioObj.header.gfx.angle.y + (e.rotAngle * spinDirFactor)) m.actionTimer = m.actionTimer + 1 return false end local function act_spin_jump_gravity(m) if (m.flags & MARIO_WING_CAP) ~= 0 and m.vel.y < 0.0 and (m.input & INPUT_A_DOWN) ~= 0 then m.marioBodyState.wingFlutter = 1 m.vel.y = m.vel.y - 0.7 if m.vel.y < -37.5 then m.vel.y = m.vel.y + 1.4 if m.vel.y > -37.5 then m.vel.y = -37.5 end end else if m.vel.y > 0 then m.vel.y = m.vel.y - 4 else m.vel.y = m.vel.y - 1.4 end if m.vel.y < -75.0 then m.vel.y = -75.0 end end return 0 end --------------------------- -- Wall Slide --------- --------------------------- function act_wall_slide(m) local e = get_extra(m) if not e then return 0 end e.savedWallSlideHeight = m.pos.y e.savedWallSlide = true if m.actionTimer == 0 then e.animFrame = 0 end if (m.input & INPUT_A_PRESSED) ~= 0 then m.vel.y = 52.0 return set_mario_action(m, ACT_WALL_KICK_AIR, 0) end mario_set_forward_vel(m, -1) m.particleFlags = m.particleFlags | PARTICLE_DUST if m.marioObj and m.marioObj.header and m.marioObj.header.gfx then play_sound(SOUND_MOVING_TERRAIN_SLIDE + m.terrainSoundAddend, m.marioObj.header.gfx.cameraToObject) end set_mario_animation(m, MARIO_ANIM_START_WALLKICK) if perform_air_step(m, 0) == AIR_STEP_LANDED then mario_set_forward_vel(m, 0.0) if check_fall_damage_or_get_stuck(m, ACT_HARD_BACKWARD_GROUND_KB) == 0 then return set_mario_action(m, ACT_FREEFALL_LAND, 0) end end m.actionTimer = m.actionTimer + 1 if not m.wall and m.actionTimer > 2 then mario_set_forward_vel(m, 0.0) return set_mario_action(m, ACT_FREEFALL, 0) end return 0 end local function act_wall_slide_gravity(m) m.vel.y = m.vel.y - 2 if m.vel.y < -15 then m.vel.y = -15 end end local function act_air_hit_wall(m) if m.heldObj ~= nil then mario_drop_held_object(m) end m.actionTimer = m.actionTimer + 1 if m.actionTimer <= 1 and (m.input & INPUT_A_PRESSED) ~= 0 then m.vel.y = 52.0 m.faceAngle.y = limit_angle(m.faceAngle.y + 0x8000) return set_mario_action(m, ACT_WALL_KICK_AIR, 0) elseif m.forwardVel >= 38.0 then if m.vel.y > 0.0 then m.vel.y = 0.0 end if CAT == nil or gPlayerSyncTable[m.playerIndex].activePowerup ~= CAT then m.faceAngle.y = limit_angle(m.faceAngle.y + 0x8000) m.particleFlags = m.particleFlags | PARTICLE_VERTICAL_STAR return set_mario_action(m, ACT_WALL_SLIDE, 0) else return set_mario_action(m, ACT_CAT_CLIMB, 0) end else m.faceAngle.y = limit_angle(m.faceAngle.y + 0x8000) return set_mario_action(m, ACT_WALL_SLIDE, 0) end return set_mario_animation(m, MARIO_ANIM_START_WALLKICK) end local convert_actions = { [ACT_AIR_HIT_WALL] = ACT_CUSTOM_AIR_HIT_WALL } local function before_set_mario_action(m, action) if gGlobalSyncTable.movesetEnabled == false then return action end return convert_actions[action] ~= nil and convert_actions[action] or action end local function act_ground_pound_jump(m) play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, CHAR_SOUND_YAHOO) if (m.controller.buttonPressed & Z_TRIG) ~= 0 then return set_mario_action(m, ACT_GROUND_POUND, 0) end if (m.input & INPUT_B_PRESSED) ~= 0 then mario_set_forward_vel(m, math.max(m.forwardVel, 20.0)) return set_mario_action(m, ACT_DIVE, 0) end common_air_action_step(m, ACT_TRIPLE_JUMP_LAND, MARIO_ANIM_TRIPLE_JUMP, 0) m.actionTimer = m.actionTimer + 1 return 0 end local function mario_on_set_action(m) local e = get_extra(m) if not e or gGlobalSyncTable.movesetEnabled == false then return end if (m.action & ACT_FLAG_MOVING) ~= 0 then e.savedWallSlide = false end if (m.action & ACT_FLAG_AIR) == 0 or m.pos.y <= m.floorHeight then e.didSpin = false end if m.action == ACT_GROUND_POUND_JUMP then m.vel.y = 65.0 elseif m.action == ACT_WALL_SLIDE then m.vel.y = 0.0 elseif m.action == ACT_GROUND_POUND and m.prevAction == ACT_SIDE_FLIP then m.marioObj.header.gfx.angle.y = limit_angle(m.marioObj.header.gfx.angle.y - 0x8000) elseif m.action == ACT_LEDGE_GRAB then e.rotAngle = m.forwardVel end end local function before_mario_update(m) local e = get_extra(m) if not e or gGlobalSyncTable.movesetEnabled == false then return end if e.fakeSaved == true then if m.action == e.fakeWroteAction and m.prevAction == e.fakeSavedPrevAction and m.actionTimer == e.fakeSavedActionTimer then m.action = e.fakeSavedAction end e.fakeSaved = false end end local function mario_update(m) local e = get_extra(m) if not e then return end if gGlobalSyncTable.movesetEnabled == false then if m.action == ACT_SPIN_JUMP or m.action == ACT_WALL_SLIDE or m.action == ACT_GROUND_POUND_JUMP then set_mario_action(m, ACT_FREEFALL, 0) end return end mario_update_spin_input(m) if e.groundPoundCooldown > 0 then e.groundPoundCooldown = e.groundPoundCooldown - 1 end -- Air Dive if m.action == ACT_GROUND_POUND and (m.input & INPUT_B_PRESSED) ~= 0 then mario_set_forward_vel(m, 25.0) m.vel.y = 37.5 set_mario_action(m, ACT_DIVE, 0) if m.marioObj and m.marioObj.header and m.marioObj.header.gfx then play_sound(SOUND_GENERAL_SWISH_WATER, m.marioObj.header.gfx.cameraToObject) end end -- Spin Jump if (SPINACTIONS[m.action] or m.action == ACT_FLUTTER or m.action == ACT_FLY) and ((m.controller.buttonPressed & X_BUTTON) ~= 0) then if not e.didSpin and (m.input & INPUT_ABOVE_SLIDE) == 0 then set_mario_action(m, ACT_SPIN_JUMP, 1) m.vel.y = 77.7 m.faceAngle.y = m.intendedYaw e.spinInput = 0 e.didSpin = true end end -- Ground Pound Jump if m.action == ACT_GROUND_POUND_LAND and (m.input & INPUT_A_PRESSED) ~= 0 then if e.groundPoundCooldown <= 0 then set_mario_action(m, ACT_GROUND_POUND_JUMP, 0) m.vel.y = 77.7 e.groundPoundCooldown = 0 end end if m.pos then e.lastPos.x = m.pos.x e.lastPos.y = m.pos.y e.lastPos.z = m.pos.z end end ------------------------------------ -- Commands & HUD ------ ------------------------------------ if gGlobalSyncTable.movesetEnabled == nil then gGlobalSyncTable.movesetEnabled = true end local function moveset_command(msg) djui_chat_message_create("\\#00d2f2\\Español:") djui_chat_message_create("X= Spin Jump, Z + B en el aire= Air Dive, A + Z + A= \nGround Pound Jump | No Daño De Caida y Wall Slide") djui_chat_message_create("\\#00d2f2\\English:") djui_chat_message_create("X= Spin Jump, Z + B in mid-air= Air Dive, A + Z + A= Ground Pound Jump | No Fall Damage And Wall Slide") return true end -- Command Sparkles hook_chat_command("sparkles", "[0: OFF | 1: ON] - Toggle Sparkles In Spin", function(msg) local arg = tonumber(msg) if arg and (arg == 0 or arg == 1) then spinSparklesMode = arg else spinSparklesMode = (spinSparklesMode + 1) % 2 end if gMarioStates[0] and gMarioStates[0].marioObj and gMarioStates[0].marioObj.header and gMarioStates[0].marioObj.header.gfx then play_sound(SOUND_MENU_CHANGE_SELECT, gMarioStates[0].marioObj.header.gfx.cameraToObject) end djui_chat_message_create("Sparkles: " .. modeNames[spinSparklesMode]) return true end) hook_event(HOOK_ON_HUD_RENDER, function() if not is_game_paused() then return end djui_hud_set_resolution(RESOLUTION_DJUI) local screenWidth = djui_hud_get_screen_width() local screenHeight = djui_hud_get_screen_height() local text = "Sparkles [ /sparkles ]: " .. modeNames[spinSparklesMode] local textScale = 0.85 local width = 600 local height = 48 local x = (screenWidth / 2) - (width / 2) local y = screenHeight - 75 djui_hud_set_color(0, 0, 0, 180) djui_hud_render_rect(x, y, width, height) local textWidth = djui_hud_measure_text(text) * textScale local textX = x + (width / 2) - (textWidth / 2) djui_hud_set_color(255, 255, 255, 255) djui_hud_print_text(text, textX, y + 8, textScale) end) ----- POP-UP -------- local shownOnce = false hook_event(HOOK_ON_PLAYER_CONNECTED, function(p) if shownOnce then return end shownOnce = true djui_popup_create( "\n Moveset Creator: \\#ff5400\\MrCho\\#00ff00\\quin7 \n\n\\#dcdcdc\\If you want to know more about the moveset, write: \n/moveset", 6 ) end) --------------- -- Hooks -- --------------- hook_event(HOOK_BEFORE_MARIO_UPDATE, before_mario_update) hook_event(HOOK_MARIO_UPDATE, mario_update) hook_event(HOOK_MARIO_UPDATE, no_fall_damage) hook_event(HOOK_MARIO_UPDATE, responsive_ground_pound_turn) hook_event(HOOK_ON_SET_MARIO_ACTION, mario_on_set_action) hook_event(HOOK_BEFORE_SET_MARIO_ACTION, before_set_mario_action) hook_mario_action(ACT_FAKE_FREEFALL, { every_frame = act_fake_freefall }) hook_mario_action(ACT_SPIN_JUMP, { every_frame = act_spin_jump, gravity = act_spin_jump_gravity }) hook_mario_action(ACT_GROUND_POUND_JUMP, { every_frame = act_ground_pound_jump }) hook_mario_action(ACT_WALL_SLIDE, { every_frame = act_wall_slide, gravity = act_wall_slide_gravity }) hook_mario_action(ACT_CUSTOM_AIR_HIT_WALL, { every_frame = act_air_hit_wall }) hook_chat_command("moveset", "- Moveset Info", moveset_command)