-- name: DS Physics v1.1.0 -- 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 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 -- Prevent Luigi from using wing cap flying if (m.flags & MARIO_WING_CAP) ~= 0 then m.flags = m.flags & ~MARIO_WING_CAP end -- Luigi's NORMAL single jump (very slight increase) if m.action == ACT_JUMP then if m.vel.y > 0 then m.vel.y = m.vel.y * 1.02 -- Only 2% boost for normal jump height end end -- Luigi's double jump (slight boost) if m.action == ACT_DOUBLE_JUMP then if m.vel.y > 0 then m.vel.y = m.vel.y * 0.95 -- Slightly reduced from base end end -- Luigi's Flutter Kick (SM64DS signature move) if (m.action == ACT_JUMP or m.action == ACT_DOUBLE_JUMP or m.action == ACT_TRIPLE_JUMP) then if (m.input & INPUT_A_DOWN) ~= 0 and m.vel.y > 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 (check if NOT airborne) if m.forwardVel > 0 and (m.action & ACT_FLAG_AIR) == 0 then m.forwardVel = m.forwardVel * 0.985 end -- Luigi's Faster Swimming (slight boost, not too fast) if (m.action & ACT_FLAG_SWIMMING) ~= 0 then m.vel.x = m.vel.x * 1.05 -- 5% faster horizontal swimming m.vel.z = m.vel.z * 1.05 if m.action ~= ACT_WATER_PLUNGE then m.vel.y = m.vel.y * 1.05 -- 5% faster vertical swimming end end -- ==================== WARIO (CT_WARIO) ==================== elseif m.character.type == CT_WARIO then -- 1. GROUND POUND SHATTER - Faster fall if m.action == ACT_GROUND_POUND then if m.actionState == 1 then -- Falling phase if m.vel.y > -80.0 then m.vel.y = -80.0 -- Much faster than default -50.0 end end end -- 2. HEAVY INVINCIBILITY - Reduce knockback if m.knockbackTimer > 0 then m.vel.x = m.vel.x * 0.5 m.vel.z = m.vel.z * 0.5 end -- 3. GIANT SWING GRAB - Double throw velocity if m.action == ACT_THROWING or m.action == ACT_HEAVY_THROW then if m.actionTimer == 6 then -- Just before throw at frame 7 m.forwardVel = m.forwardVel * 2.0 end end -- Existing Wario physics if m.forwardVel > 36.0 then m.forwardVel = 36.0 end 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 if m.action == ACT_DIVE then m.forwardVel = m.forwardVel * 1.05 end -- ==================== MARIO (CT_MARIO) ==================== elseif m.character.type == CT_MARIO then -- Mario's DS Physics: Fastest running speed if (m.action & ACT_FLAG_AIR) == 0 then -- FASTEST BASE RUNNING SPEED if m.forwardVel > 0 then m.forwardVel = m.forwardVel * 1.05 -- 5% speed boost end -- Cap at higher speed than other characters (42 vs Wario's 36) if m.forwardVel > 42.0 then m.forwardVel = 42.0 end -- RUNNING START - Acceleration boost when holding run button if (m.controller.buttonDown & B_BUTTON) ~= 0 and m.forwardVel < 10 then m.forwardVel = m.forwardVel + 1.5 end end end end) -- Hook to handle Wario's wooden post one-shot hook_event(HOOK_MARIO_UPDATE, function(m) if m.character.type == CT_WARIO then -- Check if Wario just landed from ground pound if m.action == ACT_GROUND_POUND_LAND and m.actionTimer == 0 then -- Check if standing on a wooden post if m.floor and m.floor.oWoodenPostOffsetY ~= nil then m.floor.oWoodenPostOffsetY = -190.0 -- Fully pounded m.floor.oWoodenPostSpeedY = 0 m.floor.oWoodenPostMarioPounding = false end end end end) -- Hook to enhance Wario's attack power against bullies and breakable objects hook_event(HOOK_ON_ATTACK_OBJECT, function(m, o, interaction) if m.character.type == CT_WARIO then -- Check if Wario is attacking a bully if o.oInteractType & INTERACT_BULLY then -- Wario's heavy punch sends bullies flying much further o.oForwardVel = o.oForwardVel * 2.0 o.oMoveAngleYaw = m.faceAngle.y end -- Check if Wario is ground pounding a breakable object (logs, boxes) if interaction == INT_GROUND_POUND and (o.oInteractType & INTERACT_BREAKABLE) then -- Wario's ground pound instantly destroys breakable objects o.oInteractStatus = o.oInteractStatus | INT_STATUS_ATTACKED_MARIO o.health = 0 -- Force object to break immediately end end end) -- Chat command for Wario jump height hook_chat_command("jumpw", "Set Wario's jump height (0.0 to 1.02)", function(msg) local value = tonumber(msg) if value then if value < 0 then value = 0 end if value > 1.02 then value = 1.02 end warioJumpMultiplier = value djui_chat_message_create("Wario jump multiplier set to " .. value) return true end djui_chat_message_create("Usage: /jumpw (0.0 to 1.02)") return false end) -- 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)