-- name: \\#FFFFAA\\SuperSlide -- incompatible: moveset -- description: Makes Mario's slide kicks more EPIC! You can now... \n\n -Slide on ground and in air \n -Gain speed by going downhill while sliding \n -Combo moves out of a slide \n -Slide on WALLS \n \nMade by \\#8888DD\\SkyCaster\\#FFFF66\\09 local ACT_SLIDE_GROUND = allocate_mario_action(ACT_FLAG_MOVING | ACT_FLAG_ATTACKING | ACT_FLAG_AIR | ACT_GROUP_AIRBORNE) local function s16(num) num = math.floor(num) & 0xFFFF if num >= 32768 then return num - 65536 end return num end local last_speed = {} local last_y_pos = {} local last_skip = {} local slide_momentum_cap = 90 local function ground_slide(m) set_mario_animation(m, MARIO_ANIM_SLIDE_KICK) if m.forwardVel > slide_momentum_cap then m.forwardVel = slide_momentum_cap end m.vel.x = sins(m.faceAngle.y) * m.forwardVel m.vel.z = coss(m.faceAngle.y) * m.forwardVel if m.pos.y <= m.waterLevel then if m.forwardVel > 45 then m.pos.y = m.waterLevel + 1 m.vel.y = 17 m.forwardVel = m.forwardVel - 20 m.particleFlags = m.particleFlags | PARTICLE_WATER_SPLASH play_sound(SOUND_ACTION_QUICKSAND_STEP, gGlobalSoundSource) end end if collision_find_floor(m.pos.x, m.pos.y, m.pos.z).type == SURFACE_BURNING and m.pos.y < m.floorHeight + 1 then if m.forwardVel > 45 or last_skip[m.playerIndex] == true then if last_skip[m.playerIndex] == false then m.forwardVel = m.forwardVel - 20 end last_skip[m.playerIndex] = false m.pos.y = m.floorHeight + 5 m.vel.y = 17 m.particleFlags = m.particleFlags | PARTICLE_HORIZONTAL_STAR play_sound(SOUND_ACTION_QUICKSAND_STEP, gGlobalSoundSource) else m.health = m.health + 0 m.hurtCounter = m.hurtCounter + 0 return set_mario_action(m, ACT_FREEFALL, 0) end end if m.pos.y > m.floorHeight + 2 then local last_forward_vel = m.forwardVel m.vel.x = m.vel.x + sins(m.intendedYaw) * m.intendedMag * 0.1 m.vel.z = m.vel.z + coss(m.intendedYaw) * m.intendedMag * 0.1 local face_vector = {x = sins(m.faceAngle.y), y = 0, z = coss(m.faceAngle.y)} local input_vector = {x = sins(m.intendedYaw), y = 0, z = coss(m.intendedYaw)} local dot = vec3f_dot(face_vector, input_vector) if dot > -0.8 then m.faceAngle.y = m.intendedYaw - approach_s32(s16(m.intendedYaw - m.faceAngle.y), 0, 0x080, 0x080) end m.forwardVel = math.sqrt(m.vel.x * m.vel.x + m.vel.z * m.vel.z) local curr_forward_vel = m.forwardVel if m.forwardVel > 45 and m.forwardVel > last_forward_vel then m.forwardVel = last_forward_vel m.vel.x = m.vel.x * last_forward_vel / curr_forward_vel m.vel.z = m.vel.z * last_forward_vel / curr_forward_vel end local sto_x = m.vel.x local sto_z = m.vel.z local stepResult = perform_air_step(m, 0) if m.wall then local dot = vec3f_dot(vec3f_normalize(m.vel), m.wall.normal) if m.forwardVel < 5 then set_mario_action(m, ACT_FREEFALL, 0) return end if dot > -0.8 then m.particleFlags = m.particleFlags | PARTICLE_DUST if get_global_timer() % 2 == 0 then play_sound(SOUND_MOVING_TERRAIN_SLIDE, gGlobalSoundSource) end local cross = (sins(m.faceAngle.y) * m.wall.normal.z) - (coss(m.faceAngle.y) * m.wall.normal.x) local face_dir = math.atan2(m.wall.normal.x, m.wall.normal.z) face_dir = math.floor(face_dir * 10430.378) if cross > 0 then face_dir = face_dir + 0x4800 else face_dir = face_dir - 0x4800 end m.faceAngle.y = face_dir if (m.controller.buttonPressed & A_BUTTON) ~= 0 then local face_dir = math.atan2(m.wall.normal.x, m.wall.normal.z) face_dir = math.floor(face_dir * 10430.378) if cross > 0 then face_dir = face_dir + 0x1C00 else face_dir = face_dir - 0x1C00 end m.faceAngle.y = face_dir set_mario_action(m, ACT_WALL_KICK_AIR, 0) play_sound(SOUND_ACTION_HIT, gGlobalSoundSource) m.forwardVel = m.forwardVel + 10 m.particleFlags = m.particleFlags | PARTICLE_VERTICAL_STAR m.vel.y = 55 return end if (m.controller.buttonPressed & B_BUTTON) ~= 0 then set_mario_action(m, ACT_FREEFALL, 0) return end end else m.vel.y = m.vel.y + 2 if (m.controller.buttonPressed & A_BUTTON) ~= 0 then set_mario_action(m, ACT_JUMP_KICK, 0) m.vel.y = 20 return end end else m.particleFlags = m.particleFlags | PARTICLE_DUST if get_global_timer() % 2 == 0 then play_sound(SOUND_MOVING_TERRAIN_SLIDE, gGlobalSoundSource) end m.vel.y = 0 m.vel.x = m.vel.x + m.floor.normal.x * 5 m.vel.z = m.vel.z + m.floor.normal.z * 5 perform_ground_step(m) local face_vector = {x = sins(m.faceAngle.y), y = 0, z = coss(m.faceAngle.y)} local input_vector = {x = sins(m.intendedYaw), y = 0, z = coss(m.intendedYaw)} local dot = vec3f_dot(face_vector, input_vector) if dot < 0 and m.intendedMag > 8 then local last_vel = m.forwardVel m.forwardVel = m.forwardVel + dot * m.intendedMag / 64 m.vel.x = m.vel.x * math.pow((m.forwardVel / last_vel), 2) m.vel.z = m.vel.z * math.pow((m.forwardVel / last_vel), 2) end if dot > -0.9 then m.faceAngle.y = m.intendedYaw - approach_s32(s16(m.intendedYaw - m.faceAngle.y), 0, 0x240, 0x240) end if (m.controller.buttonPressed & B_BUTTON) ~= 0 then set_mario_action(m, ACT_FORWARD_ROLLOUT, 0) return end if (m.controller.buttonPressed & A_BUTTON) ~= 0 then local last_vel = m.forwardVel set_mario_action(m, ACT_DOUBLE_JUMP, 0) m.forwardVel = last_vel return end m.forwardVel = math.sqrt(m.vel.x * m.vel.x + m.vel.z * m.vel.z) if m.forwardVel < 4 then set_mario_action(m, ACT_SLIDE_KICK_SLIDE_STOP, 0) return end end if m.wall ~= nil then local dot = vec3f_dot(vec3f_normalize(m.vel), m.wall.normal) if dot < -0.8 then set_mario_action(m, ACT_BACKWARD_AIR_KB, 0) m.particleFlags = m.particleFlags | PARTICLE_VERTICAL_STAR end end return false end local function mario_update(m) if m.playerIndex ~= 0 then return end if not last_y_pos[m.playerIndex] then djui_chat_message_create("Slide Expanded aims to make the slide kick more fun :) You can now... \n\n -Slide on ground and in air \n -Gain speed by going downhill while sliding \n -Combo moves out of a slide \n -Slide on WALLS \n \nEnjoy :D") last_y_pos[m.playerIndex] = m.pos.y last_skip[m.playerIndex] = false end if m.action == ACT_GROUND_POUND then if (m.controller.buttonPressed & B_BUTTON) ~= 0 then set_mario_action(m, ACT_SLIDE_GROUND, 0) last_skip[m.playerIndex] = true play_character_sound(m, CHAR_SOUND_HOOHOO) m.forwardVel = last_speed[m.playerIndex] if m.forwardVel < 15 then m.forwardVel = 15 end m.vel.y = 10 end else last_speed[m.playerIndex] = m.forwardVel end if m.action == ACT_SLIDE_KICK then m.action = ACT_SLIDE_GROUND last_skip[m.playerIndex] = true m.forwardVel = m.forwardVel + 10 end end hook_mario_action(ACT_SLIDE_GROUND, ground_slide) hook_event(HOOK_MARIO_UPDATE, mario_update) if network_is_server() then hook_mod_menu_slider("Speed Cap", 90, 30, 300, function(index, value) slide_momentum_cap = math.floor(value) end) end hook_chat_command("superslide", "Explains SuperSlide", function (msg) djui_chat_message_create("SuperSlide aims to make the slide kick more fun :) You can now... \n\n -Slide on ground and in air \n -Gain speed by going downhill while sliding \n -Combo moves out of a slide \n -Slide on WALLS \n \nEnjoy -SkyCaster09") return true end)