commit
c29ee6ba83
8 changed files with 120 additions and 111 deletions
|
@ -28,12 +28,18 @@ function Validators.SetParticle(player: Player, name: string, set: boolean?)
|
||||||
|
|
||||||
local character = player.Character
|
local character = player.Character
|
||||||
|
|
||||||
local rootPart = if character then character.PrimaryPart else nil
|
-- stylua: ignore
|
||||||
|
local rootPart = if character
|
||||||
|
then character.PrimaryPart
|
||||||
|
else nil
|
||||||
|
|
||||||
if rootPart then
|
if rootPart then
|
||||||
local particles = rootPart:FindFirstChild("Particles")
|
local particles = rootPart:FindFirstChild("Particles")
|
||||||
|
|
||||||
local particle = if particles then particles:FindFirstChild(name) else nil
|
-- stylua: ignore
|
||||||
|
local particle = if particles
|
||||||
|
then particles:FindFirstChild(name)
|
||||||
|
else nil
|
||||||
|
|
||||||
if particle then
|
if particle then
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -305,8 +305,8 @@ local function updateFlying(m: Mario)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function commonAirActionStep(m: Mario, landAction: number, anim: Animation, stepArg: number): number
|
local function commonAirActionStep(m: Mario, landAction: number, anim: Animation, stepArg: number): number
|
||||||
local stepResult
|
-- stylua: ignore
|
||||||
do
|
local stepResult do
|
||||||
updateAirWithoutTurn(m)
|
updateAirWithoutTurn(m)
|
||||||
stepResult = m:PerformAirStep(stepArg)
|
stepResult = m:PerformAirStep(stepArg)
|
||||||
end
|
end
|
||||||
|
@ -397,8 +397,8 @@ local function commonAirKnockbackStep(
|
||||||
anim: Animation,
|
anim: Animation,
|
||||||
speed: number
|
speed: number
|
||||||
)
|
)
|
||||||
local stepResult
|
-- stylua: ignore
|
||||||
do
|
local stepResult do
|
||||||
m:SetForwardVel(speed)
|
m:SetForwardVel(speed)
|
||||||
stepResult = m:PerformAirStep()
|
stepResult = m:PerformAirStep()
|
||||||
end
|
end
|
||||||
|
|
|
@ -883,8 +883,9 @@ DEF_ACTION(Action.WALKING, function(m: Mario)
|
||||||
return m:SetAction(Action.CROUCH_SLIDE)
|
return m:SetAction(Action.CROUCH_SLIDE)
|
||||||
end
|
end
|
||||||
|
|
||||||
local step
|
|
||||||
do
|
-- stylua: ignore
|
||||||
|
local step do
|
||||||
m.ActionState = 0
|
m.ActionState = 0
|
||||||
startPos = m.Position
|
startPos = m.Position
|
||||||
|
|
||||||
|
@ -1415,10 +1416,10 @@ DEF_ACTION(Action.LONG_JUMP_LAND, function(m: Mario)
|
||||||
m:PlaySoundIfNoFlag(Sounds.MARIO_UH, MarioFlags.MARIO_SOUND_PLAYED)
|
m:PlaySoundIfNoFlag(Sounds.MARIO_UH, MarioFlags.MARIO_SOUND_PLAYED)
|
||||||
end
|
end
|
||||||
|
|
||||||
commonLandingAction(
|
-- stylua: ignore
|
||||||
m,
|
commonLandingAction(m, if m.LongJumpIsSlow
|
||||||
if m.LongJumpIsSlow then Animations.CROUCH_FROM_FAST_LONGJUMP else Animations.CROUCH_FROM_SLOW_LONGJUMP
|
then Animations.CROUCH_FROM_FAST_LONGJUMP
|
||||||
)
|
else Animations.CROUCH_FROM_SLOW_LONGJUMP)
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -597,9 +597,12 @@ DEF_ACTION(Action.LONG_JUMP_LAND_STOP, function(m: Mario)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
landingStep(
|
-- stylua: ignore
|
||||||
m,
|
landingStep(m,
|
||||||
if m.LongJumpIsSlow then Animations.CROUCH_FROM_FAST_LONGJUMP else Animations.CROUCH_FROM_SLOW_LONGJUMP,
|
if m.LongJumpIsSlow
|
||||||
|
then Animations.CROUCH_FROM_FAST_LONGJUMP
|
||||||
|
else Animations.CROUCH_FROM_SLOW_LONGJUMP,
|
||||||
|
|
||||||
Action.CROUCHING
|
Action.CROUCHING
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -237,25 +237,37 @@ end
|
||||||
function Mario.PlayLandingSound(m: Mario, sound: Instance?)
|
function Mario.PlayLandingSound(m: Mario, sound: Instance?)
|
||||||
local sound = sound or Sounds.ACTION_TERRAIN_LANDING
|
local sound = sound or Sounds.ACTION_TERRAIN_LANDING
|
||||||
|
|
||||||
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP) then Sounds.ACTION_METAL_LANDING else sound
|
-- stylua: ignore
|
||||||
|
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP)
|
||||||
|
then Sounds.ACTION_METAL_LANDING
|
||||||
|
else sound
|
||||||
|
|
||||||
m:PlaySoundAndSpawnParticles(landSound, 1)
|
m:PlaySoundAndSpawnParticles(landSound, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Mario.PlayLandingSoundOnce(m: Mario, sound: Instance?)
|
function Mario.PlayLandingSoundOnce(m: Mario, sound: Instance?)
|
||||||
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP) then Sounds.ACTION_METAL_LANDING else sound
|
-- stylua: ignore
|
||||||
|
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP)
|
||||||
|
then Sounds.ACTION_METAL_LANDING
|
||||||
|
else sound
|
||||||
|
|
||||||
m:PlayActionSound(landSound, 1)
|
m:PlayActionSound(landSound, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Mario.PlayHeavyLandingSound(m: Mario, sound: Instance?)
|
function Mario.PlayHeavyLandingSound(m: Mario, sound: Instance?)
|
||||||
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP) then Sounds.ACTION_METAL_HEAVY_LANDING else sound
|
-- stylua: ignore
|
||||||
|
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP)
|
||||||
|
then Sounds.ACTION_METAL_HEAVY_LANDING
|
||||||
|
else sound
|
||||||
|
|
||||||
m:PlaySoundAndSpawnParticles(landSound, 1)
|
m:PlaySoundAndSpawnParticles(landSound, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Mario.PlayHeavyLandingSoundOnce(m: Mario, sound: Instance?)
|
function Mario.PlayHeavyLandingSoundOnce(m: Mario, sound: Instance?)
|
||||||
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP) then Sounds.ACTION_METAL_HEAVY_LANDING else sound
|
-- stylua: ignore
|
||||||
|
local landSound = if m.Flags:Has(MarioFlags.METAL_CAP)
|
||||||
|
then Sounds.ACTION_METAL_HEAVY_LANDING
|
||||||
|
else sound
|
||||||
|
|
||||||
m:PlayActionSound(landSound, 1)
|
m:PlayActionSound(landSound, 1)
|
||||||
end
|
end
|
||||||
|
@ -266,7 +278,10 @@ function Mario.PlayMarioSound(m: Mario, actionSound: Instance, marioSound: Insta
|
||||||
end
|
end
|
||||||
|
|
||||||
if actionSound == Sounds.ACTION_TERRAIN_JUMP then
|
if actionSound == Sounds.ACTION_TERRAIN_JUMP then
|
||||||
local sound = if m.Flags:Has(MarioFlags.METAL_CAP) then Sounds.ACTION_METAL_JUMP else actionSound
|
-- stylua: ignore
|
||||||
|
local sound = if m.Flags:Has(MarioFlags.METAL_CAP)
|
||||||
|
then Sounds.ACTION_METAL_JUMP
|
||||||
|
else actionSound
|
||||||
|
|
||||||
m:PlayActionSound(sound)
|
m:PlayActionSound(sound)
|
||||||
else
|
else
|
||||||
|
|
|
@ -58,9 +58,10 @@ end
|
||||||
function Util.ToRotation(v: Vector3int16): CFrame
|
function Util.ToRotation(v: Vector3int16): CFrame
|
||||||
local angle = Util.ToEulerAngles(v)
|
local angle = Util.ToEulerAngles(v)
|
||||||
|
|
||||||
local matrix = CFrame.fromAxisAngle(Vector3.yAxis, angle.Y)
|
-- stylua: ignore
|
||||||
* CFrame.fromAxisAngle(Vector3.xAxis, -angle.X)
|
local matrix = CFrame.fromAxisAngle(Vector3.yAxis, angle.Y)
|
||||||
* CFrame.fromAxisAngle(Vector3.zAxis, -angle.Z)
|
* CFrame.fromAxisAngle(Vector3.xAxis, -angle.X)
|
||||||
|
* CFrame.fromAxisAngle(Vector3.zAxis, -angle.Z)
|
||||||
|
|
||||||
return matrix
|
return matrix
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,7 +54,10 @@ local function processAction(id: string, state: Enum.UserInputState)
|
||||||
local isDebug = not script.Util:GetAttribute("Debug")
|
local isDebug = not script.Util:GetAttribute("Debug")
|
||||||
local character = player.Character
|
local character = player.Character
|
||||||
|
|
||||||
local rootPart = if character then character.PrimaryPart else nil
|
-- stylua: ignore
|
||||||
|
local rootPart = if character
|
||||||
|
then character.PrimaryPart
|
||||||
|
else nil
|
||||||
|
|
||||||
if rootPart then
|
if rootPart then
|
||||||
local action = rootPart:FindFirstChild("Action")
|
local action = rootPart:FindFirstChild("Action")
|
||||||
|
@ -85,7 +88,10 @@ local function updateCollisions()
|
||||||
for i, player in Players:GetPlayers() do
|
for i, player in Players:GetPlayers() do
|
||||||
assert(player:IsA("Player"))
|
assert(player:IsA("Player"))
|
||||||
|
|
||||||
local rootPart = if player.Character then player.Character.PrimaryPart else nil
|
-- stylua: ignore
|
||||||
|
local rootPart = if player.Character
|
||||||
|
then player.Character.PrimaryPart
|
||||||
|
else nil
|
||||||
|
|
||||||
if rootPart then
|
if rootPart then
|
||||||
local parts = rootPart:GetConnectedParts(true)
|
local parts = rootPart:GetConnectedParts(true)
|
||||||
|
@ -147,7 +153,10 @@ function Commands.PlaySound(player: Player, name: string)
|
||||||
local sound: Sound? = Sounds[name]
|
local sound: Sound? = Sounds[name]
|
||||||
local character = player.Character
|
local character = player.Character
|
||||||
|
|
||||||
local rootPart = if character then character.PrimaryPart else nil
|
-- stylua: ignore
|
||||||
|
local rootPart = if character
|
||||||
|
then character.PrimaryPart
|
||||||
|
else nil
|
||||||
|
|
||||||
if rootPart and sound then
|
if rootPart and sound then
|
||||||
local oldSound: Instance? = rootPart:FindFirstChild(name)
|
local oldSound: Instance? = rootPart:FindFirstChild(name)
|
||||||
|
@ -169,12 +178,18 @@ end
|
||||||
function Commands.SetParticle(player: Player, name: string, set: boolean)
|
function Commands.SetParticle(player: Player, name: string, set: boolean)
|
||||||
local character = player.Character
|
local character = player.Character
|
||||||
|
|
||||||
local rootPart = if character then character.PrimaryPart else nil
|
-- stylua: ignore
|
||||||
|
local rootPart = if character
|
||||||
|
then character.PrimaryPart
|
||||||
|
else nil
|
||||||
|
|
||||||
if rootPart then
|
if rootPart then
|
||||||
local particles = rootPart:FindFirstChild("Particles")
|
local particles = rootPart:FindFirstChild("Particles")
|
||||||
|
|
||||||
local inst = if particles then particles:FindFirstChild(name) else nil
|
-- stylua: ignore
|
||||||
|
local inst = if particles
|
||||||
|
then particles:FindFirstChild(name)
|
||||||
|
else nil
|
||||||
|
|
||||||
if inst and PARTICLE_CLASSES[inst.ClassName] then
|
if inst and PARTICLE_CLASSES[inst.ClassName] then
|
||||||
local particle = inst :: ParticleEmitter
|
local particle = inst :: ParticleEmitter
|
||||||
|
@ -192,7 +207,10 @@ end
|
||||||
function Commands.SetAngle(player: Player, angle: Vector3int16)
|
function Commands.SetAngle(player: Player, angle: Vector3int16)
|
||||||
local character = player.Character
|
local character = player.Character
|
||||||
|
|
||||||
local waist = if character then character:FindFirstChild("Waist", true) else nil
|
-- stylua: ignore
|
||||||
|
local waist = if character
|
||||||
|
then character:FindFirstChild("Waist", true)
|
||||||
|
else nil
|
||||||
|
|
||||||
if waist and waist:IsA("Motor6D") then
|
if waist and waist:IsA("Motor6D") then
|
||||||
local props = { C1 = Util.ToRotation(-angle) + waist.C1.Position }
|
local props = { C1 = Util.ToRotation(-angle) + waist.C1.Position }
|
||||||
|
@ -297,7 +315,10 @@ local function update()
|
||||||
local now = os.clock()
|
local now = os.clock()
|
||||||
local gfxRot = CFrame.identity
|
local gfxRot = CFrame.identity
|
||||||
|
|
||||||
local humanoid = if character then character:FindFirstChildOfClass("Humanoid") else nil
|
-- stylua: ignore
|
||||||
|
local humanoid = if character
|
||||||
|
then character:FindFirstChildOfClass("Humanoid")
|
||||||
|
else nil
|
||||||
|
|
||||||
local simSpeed = tonumber(script:GetAttribute("TimeScale") or nil) or 1
|
local simSpeed = tonumber(script:GetAttribute("TimeScale") or nil) or 1
|
||||||
local frames = math.floor((now - lastUpdate) * (STEP_RATE * simSpeed))
|
local frames = math.floor((now - lastUpdate) * (STEP_RATE * simSpeed))
|
||||||
|
@ -384,14 +405,23 @@ local function update()
|
||||||
alignCF.CFrame = cf.Rotation
|
alignCF.CFrame = cf.Rotation
|
||||||
end
|
end
|
||||||
|
|
||||||
local debugLabel = if action then action:FindFirstChildOfClass("TextLabel") else nil
|
-- stylua: ignore
|
||||||
|
local debugLabel = if action
|
||||||
|
then action:FindFirstChildOfClass("TextLabel")
|
||||||
|
else nil
|
||||||
|
|
||||||
if debugLabel then
|
if debugLabel then
|
||||||
local actionId = mario.Action()
|
local actionId = mario.Action()
|
||||||
|
|
||||||
local anim = if activeTrack then activeTrack.Animation else nil
|
-- stylua: ignore
|
||||||
|
local anim = if activeTrack
|
||||||
|
then activeTrack.Animation
|
||||||
|
else nil
|
||||||
|
|
||||||
local animName = if anim then anim.Name else nil
|
-- stylua: ignore
|
||||||
|
local animName = if anim
|
||||||
|
then anim.Name
|
||||||
|
else nil
|
||||||
|
|
||||||
local debugText = "Action: "
|
local debugText = "Action: "
|
||||||
.. Enums.GetName(Action, actionId)
|
.. Enums.GetName(Action, actionId)
|
||||||
|
|
|
@ -11,71 +11,24 @@ local bxor = bit32.bxor
|
||||||
local rrotate = bit32.rrotate
|
local rrotate = bit32.rrotate
|
||||||
local rshift = bit32.rshift
|
local rshift = bit32.rshift
|
||||||
|
|
||||||
|
-- stylua: ignore
|
||||||
local primes = {
|
local primes = {
|
||||||
0x428a2f98,
|
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
||||||
0x71374491,
|
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
||||||
0xb5c0fbcf,
|
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
||||||
0xe9b5dba5,
|
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
||||||
0x3956c25b,
|
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
|
||||||
0x59f111f1,
|
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
||||||
0x923f82a4,
|
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
|
||||||
0xab1c5ed5,
|
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
||||||
0xd807aa98,
|
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
||||||
0x12835b01,
|
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
||||||
0x243185be,
|
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
|
||||||
0x550c7dc3,
|
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
||||||
0x72be5d74,
|
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
|
||||||
0x80deb1fe,
|
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
||||||
0x9bdc06a7,
|
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
|
||||||
0xc19bf174,
|
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
||||||
0xe49b69c1,
|
|
||||||
0xefbe4786,
|
|
||||||
0x0fc19dc6,
|
|
||||||
0x240ca1cc,
|
|
||||||
0x2de92c6f,
|
|
||||||
0x4a7484aa,
|
|
||||||
0x5cb0a9dc,
|
|
||||||
0x76f988da,
|
|
||||||
0x983e5152,
|
|
||||||
0xa831c66d,
|
|
||||||
0xb00327c8,
|
|
||||||
0xbf597fc7,
|
|
||||||
0xc6e00bf3,
|
|
||||||
0xd5a79147,
|
|
||||||
0x06ca6351,
|
|
||||||
0x14292967,
|
|
||||||
0x27b70a85,
|
|
||||||
0x2e1b2138,
|
|
||||||
0x4d2c6dfc,
|
|
||||||
0x53380d13,
|
|
||||||
0x650a7354,
|
|
||||||
0x766a0abb,
|
|
||||||
0x81c2c92e,
|
|
||||||
0x92722c85,
|
|
||||||
0xa2bfe8a1,
|
|
||||||
0xa81a664b,
|
|
||||||
0xc24b8b70,
|
|
||||||
0xc76c51a3,
|
|
||||||
0xd192e819,
|
|
||||||
0xd6990624,
|
|
||||||
0xf40e3585,
|
|
||||||
0x106aa070,
|
|
||||||
0x19a4c116,
|
|
||||||
0x1e376c08,
|
|
||||||
0x2748774c,
|
|
||||||
0x34b0bcb5,
|
|
||||||
0x391c0cb3,
|
|
||||||
0x4ed8aa4a,
|
|
||||||
0x5b9cca4f,
|
|
||||||
0x682e6ff3,
|
|
||||||
0x748f82ee,
|
|
||||||
0x78a5636f,
|
|
||||||
0x84c87814,
|
|
||||||
0x8cc70208,
|
|
||||||
0x90befffa,
|
|
||||||
0xa4506ceb,
|
|
||||||
0xbef9a3f7,
|
|
||||||
0xc67178f2,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local function toHex(str: string): string
|
local function toHex(str: string): string
|
||||||
|
|
Loading…
Reference in a new issue