-- name: DS Physics v1.1.2 -- description: DS Physics: This adds some DS moves to, Mario, Luigi and Wario Like DS so Combine with the SM64DS Modpack if you want! Made By \\#ffd700\\SuperStar! -- Global variables for mod settings local warioJumpMultiplier = 0.82 -- Default Wario jump height (18% reduction) local marioWallKickOnly = true -- Default: only Mario can wall kick -- Helper function to check if the player is using a custom character mod local function is_using_custom_character(m) return m.character.type >= CT_MAX end -- Hook to prevent Luigi and Wario from wall kicking (intercepts action change) hook_event(HOOK_BEFORE_SET_MARIO_ACTION, function(m, incomingAction, actionArg) if marioWallKickOnly and incomingAction == ACT_WALL_KICK_AIR then -- Only block Luigi and Wario, not Toad or Waluigi if m.character.type == CT_LUIGI or m.character.type == CT_WARIO then return 1 -- Cancel the action change end end end) -- Hook for physics modifications (swimming speed for Luigi only) hook_event(HOOK_BEFORE_PHYS_STEP, function(m) -- Luigi's faster swimming (2.0 multiplier like faster-swimming mod) if m.character.type == CT_LUIGI then if (m.action & ACT_FLAG_SWIMMING) ~= 0 and m.action ~= ACT_WATER_PLUNGE then m.vel.x = m.vel.x * 2.0 m.vel.y = m.vel.y * 2.0 m.vel.z = m.vel.z * 2.0 end end end) -- Hook into Mario's update loop to modify physics in real-time hook_event(HOOK_MARIO_UPDATE, function(m) -- 1. Ignore Toad (CT_TOAD), Waluigi (CT_WALUIGI), and any custom character models if m.character.type == CT_TOAD or m.character.type == CT_WALUIGI or is_using_custom_character(m) then return end -- 2. APPLY PHYSICS OVERHAULS BY CHARACTER -- ==================== LUIGI (CT_LUIGI) ==================== if m.character.type == CT_LUIGI then -- Luigi's slightly higher single jump (1.02 multiplier) if m.action == ACT_JUMP then if m.vel.y > 0 then m.vel.y = m.vel.y * 1.02 end end -- Luigi's flutter kick - hold jump button for extra height if (m.action == ACT_JUMP or m.action == ACT_DOUBLE_JUMP) and m.vel.y > 0 then if (m.input & INPUT_A_DOWN) ~= 0 then m.vel.y = m.vel.y + 0.5 if m.vel.y > 60.0 then m.vel.y = 60.0 end end end -- Luigi's slippery traction (reduced friction) if (m.action & ACT_FLAG_MOVING) ~= 0 and (m.action & ACT_FLAG_AIR) == 0 then m.forwardVel = m.forwardVel * 1.01 end -- Prevent Luigi from using wing cap flying if m.flags & MARIO_WING_CAP then m.flags = m.flags & ~MARIO_WING_CAP end -- ==================== WARIO (CT_WARIO) ==================== elseif m.character.type == CT_WARIO then -- Wario's lower jump height (using the multiplier variable) if m.action == ACT_JUMP or m.action == ACT_DOUBLE_JUMP or m.action == ACT_TRIPLE_JUMP then if m.vel.y > 0 then m.vel.y = m.vel.y * warioJumpMultiplier end end -- Wario's slower running speed cap if m.forwardVel > 36.0 then m.forwardVel = 36.0 end -- Wario's stronger dive if m.action == ACT_DIVE then m.forwardVel = m.forwardVel * 1.05 end -- Wario's faster ground pound fall if m.action == ACT_GROUND_POUND then m.vel.y = -80.0 end -- Wario's knockback resistance if m.knockbackTimer > 0 then m.vel.x = m.vel.x * 0.5 m.vel.z = m.vel.z * 0.5 end -- Wario's stronger throw velocity if m.action == ACT_THROWING and m.actionTimer == 6 then m.forwardVel = m.forwardVel * 2.0 end -- Wario's wooden post one-shot if m.action == ACT_GROUND_POUND_LAND and m.actionTimer == 0 then if m.marioObj and m.marioObj.platform then local platform = m.marioObj.platform if platform.oWoodenPostOffsetY ~= nil then platform.oWoodenPostOffsetY = -190.0 platform.oWoodenPostSpeedY = 0 platform.oWoodenPostMarioPounding = false end end end -- ==================== MARIO (CT_MARIO) ==================== elseif m.character.type == CT_MARIO then -- Mario's faster running speed if (m.action & ACT_FLAG_MOVING) ~= 0 and (m.action & ACT_FLAG_AIR) == 0 then if m.forwardVel > 0 and m.forwardVel < 42.0 then m.forwardVel = m.forwardVel * 1.05 end end -- Mario's running start (hold B button) if (m.action & ACT_FLAG_MOVING) ~= 0 and (m.action & ACT_FLAG_AIR) == 0 then if m.forwardVel < 10 and (m.controller.buttonDown & B_BUTTON) ~= 0 then m.forwardVel = m.forwardVel + 1.5 end end end end) -- Chat command for Wario jump height local function on_jumpw_command(msg) local value = tonumber(msg) if value == nil then djui_chat_message_create("Usage: /jumpw (0.0 to 1.02)") return false end if value < 0.0 then value = 0.0 end if value > 1.02 then value = 1.02 end warioJumpMultiplier = value djui_chat_message_create("Wario jump multiplier set to " .. tostring(value)) return true end hook_chat_command("jumpw", "Set Wario jump height (0.0 to 1.02)", on_jumpw_command) -- Mod menu toggle for Mario wall kick exclusivity hook_mod_menu_checkbox("Mario Only Wall Kick", true, function(index, value) marioWallKickOnly = value if value then djui_chat_message_create("Only Mario can wall kick") else djui_chat_message_create("All characters can wall kick") end end)