Merge pull request #3 from MaximumADHD/stylua-ignore

Stylua ignore
This commit is contained in:
Max 2022-12-06 03:31:46 -06:00 committed by GitHub
commit c29ee6ba83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 120 additions and 111 deletions

View file

@ -27,13 +27,19 @@ function Validators.SetParticle(player: Player, name: string, set: boolean?)
end
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
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
return true

View file

@ -305,8 +305,8 @@ local function updateFlying(m: Mario)
end
local function commonAirActionStep(m: Mario, landAction: number, anim: Animation, stepArg: number): number
local stepResult
do
-- stylua: ignore
local stepResult do
updateAirWithoutTurn(m)
stepResult = m:PerformAirStep(stepArg)
end
@ -397,8 +397,8 @@ local function commonAirKnockbackStep(
anim: Animation,
speed: number
)
local stepResult
do
-- stylua: ignore
local stepResult do
m:SetForwardVel(speed)
stepResult = m:PerformAirStep()
end

View file

@ -883,8 +883,9 @@ DEF_ACTION(Action.WALKING, function(m: Mario)
return m:SetAction(Action.CROUCH_SLIDE)
end
local step
do
-- stylua: ignore
local step do
m.ActionState = 0
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)
end
commonLandingAction(
m,
if m.LongJumpIsSlow then Animations.CROUCH_FROM_FAST_LONGJUMP else Animations.CROUCH_FROM_SLOW_LONGJUMP
)
-- stylua: ignore
commonLandingAction(m, if m.LongJumpIsSlow
then Animations.CROUCH_FROM_FAST_LONGJUMP
else Animations.CROUCH_FROM_SLOW_LONGJUMP)
return false
end)

View file

@ -596,10 +596,13 @@ DEF_ACTION(Action.LONG_JUMP_LAND_STOP, function(m: Mario)
if checkCommonLandingCancels(m, Action.JUMP) then
return true
end
landingStep(
m,
if m.LongJumpIsSlow then Animations.CROUCH_FROM_FAST_LONGJUMP else Animations.CROUCH_FROM_SLOW_LONGJUMP,
-- stylua: ignore
landingStep(m,
if m.LongJumpIsSlow
then Animations.CROUCH_FROM_FAST_LONGJUMP
else Animations.CROUCH_FROM_SLOW_LONGJUMP,
Action.CROUCHING
)

View file

@ -237,25 +237,37 @@ end
function Mario.PlayLandingSound(m: Mario, sound: Instance?)
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)
end
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)
end
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)
end
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)
end
@ -266,7 +278,10 @@ function Mario.PlayMarioSound(m: Mario, actionSound: Instance, marioSound: Insta
end
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)
else

View file

@ -57,10 +57,11 @@ end
function Util.ToRotation(v: Vector3int16): CFrame
local angle = Util.ToEulerAngles(v)
local matrix = CFrame.fromAxisAngle(Vector3.yAxis, angle.Y)
* CFrame.fromAxisAngle(Vector3.xAxis, -angle.X)
* CFrame.fromAxisAngle(Vector3.zAxis, -angle.Z)
-- stylua: ignore
local matrix = CFrame.fromAxisAngle(Vector3.yAxis, angle.Y)
* CFrame.fromAxisAngle(Vector3.xAxis, -angle.X)
* CFrame.fromAxisAngle(Vector3.zAxis, -angle.Z)
return matrix
end

View file

@ -53,8 +53,11 @@ local function processAction(id: string, state: Enum.UserInputState)
if state == Enum.UserInputState.Begin then
local isDebug = not script.Util:GetAttribute("Debug")
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
local action = rootPart:FindFirstChild("Action")
@ -84,8 +87,11 @@ end
local function updateCollisions()
for i, player in Players:GetPlayers() do
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
local parts = rootPart:GetConnectedParts(true)
@ -146,8 +152,11 @@ assert(lazyNetwork:IsA("RemoteEvent"), "bad lazyNetwork!")
function Commands.PlaySound(player: Player, name: string)
local sound: Sound? = Sounds[name]
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
local oldSound: Instance? = rootPart:FindFirstChild(name)
@ -168,13 +177,19 @@ end
function Commands.SetParticle(player: Player, name: string, set: boolean)
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
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
local particle = inst :: ParticleEmitter
@ -191,8 +206,11 @@ end
function Commands.SetAngle(player: Player, angle: Vector3int16)
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
local props = { C1 = Util.ToRotation(-angle) + waist.C1.Position }
@ -296,8 +314,11 @@ local function update()
local now = os.clock()
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 frames = math.floor((now - lastUpdate) * (STEP_RATE * simSpeed))
@ -383,15 +404,24 @@ local function update()
cf = cf:Lerp(goalCF, interp)
alignCF.CFrame = cf.Rotation
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
local actionId = mario.Action()
local anim = if activeTrack then activeTrack.Animation else nil
local animName = if anim then anim.Name else nil
-- stylua: ignore
local anim = if activeTrack
then activeTrack.Animation
else nil
-- stylua: ignore
local animName = if anim
then anim.Name
else nil
local debugText = "Action: "
.. Enums.GetName(Action, actionId)

View file

@ -11,71 +11,24 @@ local bxor = bit32.bxor
local rrotate = bit32.rrotate
local rshift = bit32.rshift
-- stylua: ignore
local primes = {
0x428a2f98,
0x71374491,
0xb5c0fbcf,
0xe9b5dba5,
0x3956c25b,
0x59f111f1,
0x923f82a4,
0xab1c5ed5,
0xd807aa98,
0x12835b01,
0x243185be,
0x550c7dc3,
0x72be5d74,
0x80deb1fe,
0x9bdc06a7,
0xc19bf174,
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,
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
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