-- name: DS Physics v1.0.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! -- 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 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. PREVENT NON-MARIO CHARACTERS FROM WALL KICKING if m.character.type ~= CT_MARIO and m.action == ACT_WALL_KICK_AIR then set_mario_action(m, ACT_FREEFALL, 0) end -- 3. 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 -- ==================== 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.forwardVel = m.forwardVel * 0.5 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 -- 4. ONE-SHOT WOODEN POSTS - Drive posts all the way down instantly 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 -- Check if this is a wooden post by checking for the offset field if platform.oWoodenPostOffsetY ~= nil then platform.oWoodenPostOffsetY = -190.0 -- Drive all the way down platform.oWoodenPostSpeedY = 0 -- Stop the movement platform.oWoodenPostMarioPounding = false -- Stop the pounding state end 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 * 0.82 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 and running start if (m.action & ACT_FLAG_AIR) == 0 then -- 1. RUNNING START - Check controller directly for held button if (m.controller.buttonDown & B_BUTTON) ~= 0 then -- When holding run button and at low speed, give acceleration boost if m.forwardVel >= 0 and m.forwardVel < 10 then m.forwardVel = m.forwardVel + 1.5 -- Acceleration boost from stop end end -- 2. 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 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)