{"TotalCount":35,"Files":[{"Ident":"facepunch.jumper","Path":"FunStuff/SoundEmitter.cs","FileName":"SoundEmitter.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\n\r\npublic sealed class SoundEmitter : Component\r\n{\r\n\t[Property] public string SoundString { get; set; }\r\n\r\n\tprotected override void OnStart()\r\n\t{\r\n\t\tbase.OnStart();\r\n\r\n\t\tSound.Play( SoundString, Transform.Position );\r\n\t}\r\n\tprotected override void OnUpdate()\r\n\t{\r\n\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"GamePlay/MapOverrider.cs","FileName":"MapOverrider.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\nusing Sandbox.Citizen;\r\n\r\npublic sealed class MapOverrider : Component\r\n{\r\n\t[Property] GameObject FrogPrefab { get; set; }\r\n\tprotected override void OnEnabled()\r\n\t{\r\n\t\tbase.OnEnabled();\r\n\t\t/*\r\n\t\t{\r\n\t\t\tvar obj = Scene.GetAllComponents\u003CSkinnedModelRenderer\u003E();\r\n\r\n\t\t\tforeach ( var item in obj )\r\n\t\t\t{\r\n\t\t\t\tif ( item.Model.ResourceName == \u0022frog_test_subject_01a\u0022 )\r\n\t\t\t\t\titem.Set( \u0022sit\u0022, 1 );\r\n\t\t\t\t\titem.Set( \u0022sit_pose\u0022, Random.Shared.Float( 3 ) );\r\n\t\t\t\t\titem.Set( \u0022scale_height\u0022, Random.Shared.Float( 0.75f, 1.5f ) );\r\n\t\t\t\t\tvar ran = Random.Shared.Int( 0, 1 );\r\n\t\t\t\t\titem.MaterialGroup = ran == 1 ? \u0022default\u0022 : \u0022Orange\u0022;\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t\t{\r\n\t\t\tvar npc = Scene.GetAllObjects( true ).Where( x =\u003E x.Name == \u0022js_npc_text\u0022 ).ToList();\r\n\r\n\t\t\tforeach ( var item in npc )\r\n\t\t\t{\r\n\t\t\t\titem.DestroyImmediate();\r\n\t\t\t\tLog.Info( \u0022Destroyed\u0022 );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected override void OnUpdate()\r\n\t{\r\n\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"UI/JumperChat.razor","FileName":"JumperChat.razor","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"@using Sandbox;\r\n@using Sandbox.UI;\r\n@inherits PanelComponent\r\n@implements Component.INetworkListener\r\n\r\n\u003Croot\u003E\r\n\r\n\t\u003Cdiv class=\u0022output\u0022\u003E\r\n\t\t@foreach (var entry in Entries)\r\n\t\t{\r\n            \u003Cdiv class=\u0022chat_entry\u0022\u003E\r\n\t\t\t\t\u003Cdiv class=\u0022author\u0022\u003E@entry.author\u003C/div\u003E\r\n\t\t\t\t\u003Cdiv class=\u0022message\u0022\u003E@entry.message\u003C/div\u003E\r\n\t\t\t\u003C/div\u003E\r\n\t\t}\r\n\t\u003C/div\u003E\r\n\r\n\t\u003Cdiv class=\u0022input\u0022\u003E\r\n\t\t\u003CTextEntry @ref=\u0022InputBox\u0022 onsubmit=\u0022@ChatFinished\u0022\u003E\u003C/TextEntry\u003E\r\n\t\u003C/div\u003E\r\n\t\r\n\u003C/root\u003E\r\n\r\n@code\r\n{\r\n    TextEntry InputBox;\r\n\r\n    public record Entry( ulong steamid, string author, string message, RealTimeSince timeSinceAdded );\r\n    List\u003CEntry\u003E Entries = new();\r\n\r\n    protected override void OnUpdate()\r\n    {\r\n        if (InputBox is null)\r\n            return;\r\n\r\n        Panel.AcceptsFocus = false;\r\n\r\n        if ( Input.Pressed( \u0022chat\u0022 ) )\r\n        {\r\n            InputBox.Focus();\r\n        }\r\n\r\n\r\n        if ( Entries.RemoveAll( x =\u003E x.timeSinceAdded \u003E 20.0f ) \u003E 0 )\r\n        {\r\n            StateHasChanged();\r\n        }\r\n\r\n        SetClass( \u0022open\u0022, InputBox.HasFocus );\r\n    }\r\n\r\n    void ChatFinished()\r\n    {\r\n        var text = InputBox.Text;\r\n        InputBox.Text = \u0022\u0022;\r\n\r\n        if (string.IsNullOrWhiteSpace(text))\r\n            return;\r\n\r\n        AddText( text );\r\n    }\r\n\r\n    [Broadcast]\r\n    public void AddText( string message )\r\n    {\r\n        message = message.Truncate( 300 );\r\n\r\n        if (string.IsNullOrWhiteSpace(message))\r\n            return;\r\n\r\n        var author = Rpc.Caller.DisplayName;\r\n        var steamid = Rpc.Caller.SteamId;\r\n\r\n\t\tLog.Info($\u0022{author}: {message}\u0022);\r\n\r\n        Entries.Add(new Entry(steamid, author, message, 0.0f));\r\n\t\tStateHasChanged();\r\n\t}\r\n\r\n    [Broadcast] // todo: only from host/owner\r\n    public void AddSystemText(string message)\r\n    {\r\n        message = message.Truncate(300);\r\n\r\n        if (string.IsNullOrWhiteSpace(message))\r\n            return;\r\n\r\n        Entries.Add(new Entry(0, \u0022\u2139\uFE0F\u0022, message, 0.0f));\r\n        StateHasChanged();\r\n    }\r\n\r\n\tvoid Component.INetworkListener.OnConnected( Connection channel )\r\n\t{\r\n\t\tif ( IsProxy ) return;\r\n\r\n\t\tAddSystemText( $\u0022{channel.DisplayName} has joined the game\u0022 );\r\n\t}\r\n\r\n\tvoid Component.INetworkListener.OnDisconnected( Connection channel )\r\n\t{\r\n\t\tif ( IsProxy ) return;\r\n\r\n\t\tAddSystemText( $\u0022{channel.DisplayName} has left the game\u0022 );\r\n\t}\r\n}"},{"Ident":"facepunch.jumper","Path":"UI/JumperHeightBar.razor","FileName":"JumperHeightBar.razor","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"@using Sandbox;\r\n@using Sandbox.UI;\r\n@inherits PanelComponent\r\n@if (Network.OwnerConnection is Connection owner \u0026\u0026 owner == Connection.Local)\r\n{\r\n    \u003Croot class=@(IsOpen ? \u0022open\u0022 : \u0022closed\u0022)\u003E\r\n        \u003Cdiv class=\u0022bar\u0022\u003E\r\n\r\n            \u003Clabel class=\u0022heightbar\u0022\u003E\u003C/label\u003E\r\n            \u003Clabel class=\u0022flag\u0022\u003E\u003C/label\u003E\r\n\r\n            \u003Cdiv class=\u0022heightbarpos\u0022 style=\u0022height:@(CalculateProgress(Height) * 100)%;\u0022\u003E\r\n                \u003Clabel class=\u0022heighttext\u0022 text=\u0022\u003C @(Height)\u0022 /\u003E\r\n            \u003C/div\u003E\r\n\r\n            \u003Cdiv class=\u0022maxheightbarpos\u0022 style=\u0022height:@(CalculateProgress(MaxHeight) * 100)%;\u0022\u003E\r\n                \u003Clabel class=\u0022maxheighttext\u0022 text=\u0022@(MaxHeight)\u003E\u0022 /\u003E\r\n            \u003C/div\u003E\r\n\r\n            @foreach (var player in Scene.GetAllComponents\u003CJumperPlayerStuff\u003E())\r\n            {\r\n                if (owner == player.Network.OwnerConnection) continue;\r\n                \u003Cdiv class=\u0022maxheightotherbarpos\u0022 style=\u0022border-top: 4px solid @player.rndColor; height:@(CalculateProgress(player.Height) * 100)%;\u0022\u003E\r\n                    \u003Cimg class=\u0022maxheightothertext\u0022 style=\u0022 box-shadow: 3px 3px @player.rndColor; background-image: url( avatar:@player.Network.OwnerConnection.SteamId )\u0022\u003E\r\n                \u003C/div\u003E\r\n            }\r\n        \u003C/div\u003E\r\n    \u003C/root\u003E\r\n}\r\n\r\n@code\r\n{\r\n    float TotalHeight { get; set; }\r\n    float Height { get; set; }\r\n    float MaxHeight { get; set; }\r\n    bool IsOpen { get; set; }\r\n\r\n    // Find first player stats class that isn\u0027t owned by a proxy (is ours)\r\n    JumperPlayerStuff PlayerStats =\u003E GameObject.Components.Get\u003CJumperPlayerStuff\u003E(FindMode.InParent);\r\n    JumperDistanceRuler Ruler { get; set; }\r\n\r\n    public Color32 rndColor = Color.Random;\r\n    public string hexColor;\r\n\r\n    protected override void OnUpdate()\r\n    {\r\n        base.OnUpdate();\r\n\r\n        if (IsProxy) return;\r\n\r\n        Height = PlayerStats.Height;\r\n        MaxHeight = PlayerStats.MaxHeight;\r\n\r\n        TotalHeight = Scene.GetAllComponents\u003CJumperDistanceRuler\u003E().FirstOrDefault().Distance;\r\n    }\r\n\r\n    private float CalculateProgress(float height)\r\n    {\r\n        return height.LerpInverse(0, Scene.GetAllComponents\u003CJumperDistanceRuler\u003E().FirstOrDefault().Distance);\r\n    }\r\n    protected override int BuildHash()\r\n    {\r\n        IsOpen ^= Input.Pressed(\u0022slot1\u0022);\r\n\r\n        return HashCode.Combine(Time.Delta);\r\n    }\r\n}"},{"Ident":"facepunch.jumper","Path":"UI/JumperNPCTalker.razor","FileName":"JumperNPCTalker.razor","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"@using Sandbox;\r\n@using Sandbox.UI;\r\n@inherits PanelComponent\r\n\r\n\u003Croot class=@(Visible ? \u0022visible\u0022 : \u0022\u0022)\u003E\r\n    \u003Clabel class=\u0022message\u0022\u003E@OutputText\u003C/label\u003E\r\n    \u003Clabel class=\u0022name\u0022\u003E@NPCName\u003C/label\u003E\r\n    \u003Clabel class=\u0022background\u0022\u003E\u003C/label\u003E\r\n\u003C/root\u003E\r\n\r\n@code {\r\n    public string Message { get; set; } = \u0022\u0022;\r\n\r\n    private bool Visible =\u003E TimeSinceDisplayed \u003C 4;\r\n    private RealTimeSince TimeSinceDisplayed = 999;\r\n\r\n    public string OutputText { get; set; }\r\n    public float Delay { get; set; } = .1f;\r\n    public string NPCName { get; set; } = \u0022Ben\u0022;\r\n    public string Voice { get; set; } = \u0022beep1\u0022;\r\n\r\n    protected override void OnEnabled()\r\n    {\r\n        base.OnEnabled();\r\n        TimeSinceDisplayed = 999;\r\n    }\r\n\r\n    public static bool IsTalking()\r\n    {\r\n        return true;\r\n    }\r\n\r\n    private async Task RevealTextAsync(string message)\r\n    {\r\n        Random rand = new Random();\r\n        foreach (char c in message)\r\n        {\r\n            IsTalking();\r\n            OutputText \u002B= c;\r\n            TimeSinceDisplayed = 0f;\r\n            await Task.DelaySeconds((float)GetRandomNumber(0.05f, 0.2f));\r\n            var snd = Sound.Play(Voice);\r\n            snd.Pitch = (float)GetRandomNumber(0.9f, 1.1f);\r\n            snd.Volume = 0.25f;\r\n        }\r\n    }\r\n\r\n    static Random random = new Random();\r\n    public double GetRandomNumber(double minimum, double maximum)\r\n    {\r\n        return random.NextDouble() * (maximum - minimum) \u002B minimum;\r\n    }\r\n\r\n    public void DisplayMessage(string message)\r\n    {\r\n        Message = message;\r\n        OutputText = null;\r\n    }\r\n\r\n    protected override void OnUpdate()\r\n    {\r\n        base.OnUpdate();\r\n        if (OutputText == Message)\r\n        {\r\n            return;\r\n        }\r\n\r\n        if (OutputText == null)\r\n        {\r\n            RevealTextAsync(Message);\r\n        }\r\n        Message = OutputText;\r\n    }\r\n\r\n    protected override int BuildHash()\r\n    {\r\n        return HashCode.Combine(OutputText, Visible ? 1 : 0);\r\n    }\r\n\r\n}"},{"Ident":"facepunch.jumper","Path":"Player/DropObjectOnFootstep.cs","FileName":"DropObjectOnFootstep.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\nusing Sandbox.Diagnostics;\r\nusing Sandbox.Services;\r\nusing System;\r\nusing System.Threading;\r\n\r\npublic sealed class DropObjectOnFootstep : Component\r\n{\r\n\t[Property] GameObject Prefab { get; set; }\r\n\t[Property] SkinnedModelRenderer Source { get; set; }\r\n\r\n\tprotected override void OnEnabled()\r\n\t{\r\n\t\tif ( Source is null )\r\n\t\t\treturn;\r\n\r\n\t\tSource.OnFootstepEvent \u002B= OnEvent;\r\n\t}\r\n\r\n\tprotected override void OnDisabled()\r\n\t{\r\n\t\tif ( Source is null )\r\n\t\t\treturn;\r\n\r\n\t\tSource.OnFootstepEvent -= OnEvent;\r\n\t}\r\n\r\n\tprivate void OnEvent( SceneModel.FootstepEvent e )\r\n\t{\r\n\t\tvar tr = Scene.Trace\r\n\t\t\t.Ray( e.Transform.Position \u002B Vector3.Up * 20, e.Transform.Position \u002B Vector3.Up * -20 )\r\n\t\t\t.Run();\r\n\r\n\t\tif ( !tr.Hit )\r\n\t\t\treturn;\r\n\r\n\t\tvar angles = e.Transform.Rotation.Angles();\r\n\t\tangles.pitch = 0;\r\n\t\tangles.roll = 0;\r\n\r\n\t\t//SceneUtility.Instantiate( Prefab, new Transform( tr.HitPosition, angles.ToRotation() ) );\r\n\r\n\t\tvar sound = e.FootId == 0 ? tr.Surface.Sounds.FootLeft : tr.Surface.Sounds.FootRight;\r\n\r\n\t\tif ( sound != null )\r\n\t\t\tSound.Play( sound, WorldPosition );\r\n\t}\r\n\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"UI/JumperEndUI.razor","FileName":"JumperEndUI.razor","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"@using Sandbox;\r\n@using Sandbox.UI;\r\n@inherits PanelComponent\r\n@if (Network.OwnerConnection is Connection owner \u0026\u0026 owner == Connection.Local)\r\n{\r\n    \u003Croot class=\u0022@(Open ? \u0022open\u0022 : \u0022closed\u0022)\u0022\u003E\r\n        \u003Cimage class=\u0022dance\u0022 src=\u0022@imageSequence\u0022 \u003C/image\u003E\r\n        \u003Clabel class=\u0022header\u0022\u003ECongratulations!\u003C/label\u003E\r\n        \u003Clabel class=\u0022header\u0022 style=\u0022top: 37%; font-size:24px;\u0022\u003EYou made it to the top!\u003C/label\u003E\r\n        \u003Cbutton onclick=\u0022@Restart\u0022\u003ERestart\u003C/button\u003E\r\n        \u003Cbutton onclick=\u0022@GoToTop\u0022\u003EGo to top\u003C/button\u003E\r\n        \u003Clabel class=\u0022header\u0022 style=\u0022top: 60%; font-size:24px;\u0022\u003ECompletions @Completions\u003C/label\u003E\r\n    \u003C/root\u003E\r\n}\r\n@code\r\n{\r\n    public bool Open { get; set; }\r\n    private int? Completions =\u003E GameObject.Components.Get\u003CJumperPlayerStuff\u003E(FindMode.EverythingInAncestors)?.Completions;\r\n    private string imageSequence { get; set; }\r\n    private TimeSince sinceLastFrame { get; set; }\r\n    private int frame { get; set; }\r\n    private float maxframe { get; set; } = 6f;\r\n    private float frameLength { get; set; } = .1f;\r\n\r\n    protected override void OnFixedUpdate()\r\n    {\r\n        base.OnFixedUpdate();\r\n        Animate();\r\n    }\r\n\r\n    public void Animate()\r\n    {\r\n        if (!Open) return;\r\n        if (sinceLastFrame \u003E frameLength)\r\n        {\r\n            if (frame == maxframe)\r\n            {\r\n                sinceLastFrame = 1;\r\n                frame = 0;\r\n            }\r\n            else\r\n            {\r\n                frame\u002B\u002B;\r\n                sinceLastFrame = 0;\r\n            }\r\n        }\r\n\r\n        imageSequence = \u0022ui/ending/danduw_\u0022 \u002B (int)frame \u002B \u0022.png\u0022;\r\n    }\r\n\r\n    private void Restart()\r\n    {\r\n        var spawnpoint = Scene.Components.GetAll\u003CJumperSpawnPoint\u003E().FirstOrDefault();\r\n        if (spawnpoint != null)\r\n        {\r\n            GameObject.Parent.Transform.Position = spawnpoint.Transform.Position;\r\n            var player = GameObject.Parent.Components.Get\u003CJumperPlayerStuff\u003E();\r\n            player.Completions\u002B\u002B;\r\n            player.Restart();\r\n            Open = false;\r\n        }\r\n    }\r\n\r\n    private void GoToTop()\r\n    {\r\n        var toppos = Scene.Components.GetAll\u003CJumperFinishLine\u003E().FirstOrDefault();\r\n        if (toppos != null)\r\n        {\r\n            GameObject.Parent.Transform.Position = toppos.TopPosition.Transform.Position;\r\n\t\t\tLog.Info(toppos);\r\n            Open = false;\r\n        }\r\n    }\r\n\r\n\t/// \u003Csummary\u003E\r\n    /// the hash determines if the system should be rebuilt. If it changes, it will be rebuilt\r\n    /// \u003C/summary\u003E\r\n    protected override int BuildHash() =\u003E System.HashCode.Combine(Open, imageSequence);\r\n}"},{"Ident":"facepunch.jumper","Path":"GamePlay/MapPlayerSpawns.cs","FileName":"MapPlayerSpawns.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\nusing System;\r\nusing System.Linq;\r\n\r\npublic sealed class MapPlayerSpawns : Component\r\n{\r\n\tprotected override void OnEnabled()\r\n\t{\r\n\t\tbase.OnEnabled();\r\n\r\n\t\tif ( Components.TryGet\u003CMapInstance\u003E( out var mapInstance ) )\r\n\t\t{\r\n\t\t\tmapInstance.OnMapLoaded \u002B= RespawnPlayers;\r\n\r\n\t\t\t// already loaded\r\n\t\t\tif ( mapInstance.IsLoaded )\r\n\t\t\t{\r\n\t\t\t\tRespawnPlayers();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected override void OnDisabled()\r\n\t{\r\n\t\tif ( Components.TryGet\u003CMapInstance\u003E( out var mapInstance ) )\r\n\t\t{\r\n\t\t\tmapInstance.OnMapLoaded -= RespawnPlayers;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tvoid RespawnPlayers()\r\n\t{\r\n\t\tvar spawnPoints = Scene.GetAllComponents\u003CSpawnPoint\u003E().ToArray();\r\n\r\n\t\tforeach ( var player in Scene.GetAllComponents\u003CPlayerController\u003E().ToArray() )\r\n\t\t{\r\n\t\t\tif ( player.IsProxy )\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar randomSpawnPoint = Random.Shared.FromArray( spawnPoints );\r\n\t\t\tif ( randomSpawnPoint is null ) continue;\r\n\r\n\t\t\tplayer.WorldPosition = randomSpawnPoint.WorldPosition;\r\n\r\n\t\t\tif ( player.Components.TryGet\u003CPlayerController\u003E( out var pc ) )\r\n\t\t\t{\r\n\t\t\t\tpc.EyeAngles = randomSpawnPoint.WorldRotation.Angles();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"Player/JumperPlayerStuff.cs","FileName":"JumperPlayerStuff.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\n\r\npublic sealed class JumperPlayerStuff : Component, Component.INetworkListener\r\n{\r\n\t[Sync] public float Height { get; set; } \r\n\t[Sync] public float MaxHeight { get; set; }\r\n\tpublic int TotalJumps { get; set; }\r\n\tpublic int TotalFalls { get; set; }\r\n\tpublic float TimePlayed { get; set; }\r\n\tpublic int Completions { get; set; }\r\n\tpublic bool ReachedEnd { get; set; }\r\n\tpublic float BestHeight { get; set; }\r\n\tpublic string rndColor { get; set; } = \u0022#eb4034\u0022;\r\n\r\n\tpublic Vector3 Position { get; set; }\r\n\tpublic Angles Angles { get; set; }\r\n\r\n\tJumperDistanceRuler DistanceRuler { get; set; }\r\n\t[Property] JumperProgress Progress { get; set; }\r\n\r\n\tprotected override void OnEnabled()\r\n\t{\r\n\t\tbase.OnEnabled();\r\n\r\n\t\trndColor = $\u0022{Color.Random.Hex}\u0022;\r\n\t\tDistanceRuler = Scene.GetAllComponents\u003CJumperDistanceRuler\u003E().FirstOrDefault();\r\n\r\n\t\t/*\r\n\t\tPlayerAvatar = GameObject.Network.OwnerConnection.SteamId.ToString();\r\n\t\tSteamId = GameObject.Network.OwnerConnection.SteamId;\r\n\t\t*/\r\n\t}\r\n\r\n\tprotected override void OnAwake()\r\n\t{\r\n\t\tbase.OnAwake();\r\n\r\n\t}\r\n\r\n\tpublic void SaveStats()\r\n\t{\r\n\t\tif ( IsProxy ) return;\r\n\r\n\t\tif ( Progress == null || Progress.Current == null )\r\n\t\t{\r\n\t\t\tLog.Warning( \u0022No progress found on JumperPlayerStuff\u0022 );\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tProgress.Current.BestHeight = MaxHeight;\r\n\t\tProgress.Current.TotalJumps = TotalJumps;\r\n\t\tProgress.Current.TotalFalls = TotalFalls;\r\n\t\tProgress.Current.NumberCompletions = Completions;\r\n\t\tProgress.Current.TimePlayed = TimePlayed;\r\n\t\tProgress.Current.Position = GameObject.WorldPosition;\r\n\t\tvar plycontroller = GameObject.Components.Get\u003CPlayerController\u003E(FindMode.EnabledInSelf);\r\n\t\tProgress.Current.Angles = plycontroller.Body.WorldRotation.Angles();\r\n\t\tProgress.Save();\r\n\t}\r\n\r\n\tpublic void Restart()\r\n\t{\r\n\t\tTotalJumps = 0;\r\n\t\tTotalFalls = 0;\r\n\t\tTimePlayed = 0;\r\n\t\tReachedEnd = false;\r\n\t\tMaxHeight = 0;\r\n\t\tProgress.Current.BestHeight = 0;\r\n\t\tProgress.Current.TotalJumps = 0;\r\n\t\tProgress.Current.TotalFalls = 0;\r\n\t\tProgress.Current.TimePlayed = 0;\r\n\t\tProgress.Current.Position = GameObject.WorldPosition;\r\n\t\tProgress.Current.Angles = GameObject.WorldRotation.Angles();\r\n\t\tProgress.Save();\r\n\t}\r\n\r\n\tprotected override void OnFixedUpdate()\r\n\t{\r\n\t\tHeight = MathX.CeilToInt( WorldPosition.z - DistanceRuler.StartObject.WorldPosition.z );\r\n\r\n\t\tMaxHeight = Math.Max( Height, MaxHeight );\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"Player/JumperWalkCustom.cs","FileName":"JumperWalkCustom.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox.Movement;\r\n\r\n/// \u003Csummary\u003E\r\n/// The character is walking\r\n/// \u003C/summary\u003E\r\n[Icon( \u0022transfer_within_a_station\u0022 ), Group( \u0022Movement\u0022 ), Title( \u0022MoveMode - Walk (Custom)\u0022 )]\r\npublic partial class MoveModeWalk : MoveMode\r\n{\r\n\t[Property] public int Priority { get; set; } = 0;\r\n\r\n\t[Property] public float GroundAngle { get; set; } = 45.572996f; // acos( 0.7 ) in degrees\r\n\t[Property] public float StepUpHeight { get; set; } = 18.0f;\r\n\t[Property] public float StepDownHeight { get; set; } = 18.0f;\r\n\r\n\t[RequireComponent]\r\n\tpublic PlayerInput PlayerInput { get; set; }\r\n\r\n\t/// \u003Csummary\u003EAllow input-driven acceleration while airborne. Off by default, jumps are committed in this game.\u003C/summary\u003E\r\n\t[Property, Group( \u0022Air Movement\u0022 )] public bool EnableAirStrafing { get; set; } = false;\r\n\r\n\t[Property, Group( \u0022Air Movement\u0022 )] public float AirAcceleration { get; set; } = 10.0f;\r\n\r\n\t/// \u003Csummary\u003EWish-direction speed cap; turning can still build total speed.\u003C/summary\u003E\r\n\t[Property, Group( \u0022Air Movement\u0022 )] public float AirSpeedCap { get; set; } = 30.0f;\r\n\r\n\t[Property, Group( \u0022Ground Movement\u0022 )] public float GroundAcceleration { get; set; } = 10;\r\n\r\n\t/// \u003Csummary\u003EGround friction, scaled by BrakePower.\u003C/summary\u003E\r\n\t[Property, Group( \u0022Ground Movement\u0022 )] public float Friction { get; set; } = 4;\r\n\r\n\t/// \u003Csummary\u003EMinimum speed used to calculate ground friction.\u003C/summary\u003E\r\n\t[Property, Group( \u0022Ground Movement\u0022 )] public float StopSpeed { get; set; } = 100;\r\n\r\n\t/// \u003Csummary\u003EPer-axis velocity limit, not a total speed cap.\u003C/summary\u003E\r\n\t[Property] public float MaxVelocity { get; set; } = 3500;\r\n\r\n\tpublic override bool AllowGrounding =\u003E true;\r\n\tpublic override bool AllowFalling =\u003E true;\r\n\r\n\tpublic override int Score( PlayerController controller ) =\u003E Priority;\r\n\r\n\t// Ported from engine Walk.cs. MovementMath is internal to the engine, so the\r\n\t// Quake-style friction/accelerate helpers are reimplemented below.\r\n\tpublic override void AddVelocity()\r\n\t{\r\n\t\tController.WishVelocity = Controller.WishVelocity.WithZ( 0 );\r\n\t\tvar body = Controller.Body;\r\n\t\tvar wish = Controller.WishVelocity;\r\n\t\tvar wishSpeed = wish.Length;\r\n\t\tvar direction = wishSpeed \u003E 0 ? wish / wishSpeed : Vector3.Zero;\r\n\r\n\t\tif ( !Controller.IsOnGround )\r\n\t\t{\r\n\t\t\tif ( EnableAirStrafing )\r\n\t\t\t\tbody.Velocity = Accelerate( body.Velocity, direction, MathF.Min( wishSpeed, MathF.Max( AirSpeedCap, 0 ) ),\r\n\t\t\t\t\tMathF.Max( AirAcceleration, 0 ) * wishSpeed );\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar groundVelocity = Controller.GroundVelocity;\r\n\t\tvar velocity = (body.Velocity - groundVelocity).WithZ( 0 );\r\n\r\n\t\tvelocity = ApplyFriction( velocity, MathF.Max( Friction * Controller.BrakePower, 0 ) * MathF.Max( Controller.GroundFriction, 0 ) );\r\n\t\tvelocity = Accelerate( velocity, direction, wishSpeed, MathF.Max( GroundAcceleration, 0 ) * wishSpeed );\r\n\t\tif ( velocity.Length \u003C 1 ) velocity = 0;\r\n\r\n\t\t// Project onto the ground plane so slopes keep horizontal speed\r\n\t\tvar normal = Controller.GroundNormal;\r\n\t\tif ( normal.z \u003E 0 )\r\n\t\t\tvelocity -= Vector3.Up * (velocity.Dot( normal ) / normal.z);\r\n\r\n\t\tvelocity \u002B= groundVelocity;\r\n\t\tbody.Velocity = velocity.Clamp( -MaxVelocity, MaxVelocity );\r\n\t}\r\n\r\n\tVector3 ApplyFriction( Vector3 velocity, float friction )\r\n\t{\r\n\t\tvar speed = velocity.Length;\r\n\t\tif ( speed \u003C 0.1f ) return 0;\r\n\r\n\t\tvar control = MathF.Max( speed, MathF.Max( StopSpeed, 0 ) );\r\n\t\tvar newSpeed = MathF.Max( speed - control * friction * Time.Delta, 0 );\r\n\t\treturn velocity * (newSpeed / speed);\r\n\t}\r\n\r\n\tstatic Vector3 Accelerate( Vector3 velocity, Vector3 direction, float wishSpeed, float accel )\r\n\t{\r\n\t\tvar addSpeed = wishSpeed - velocity.Dot( direction );\r\n\t\tif ( addSpeed \u003C= 0 ) return velocity;\r\n\r\n\t\treturn velocity \u002B direction * MathF.Min( accel * Time.Delta, addSpeed );\r\n\t}\r\n\r\n\tpublic override void PrePhysicsStep()\r\n\t{\r\n\t\tbase.PrePhysicsStep();\r\n\r\n\t\t// Apply air drag once before the solver so contact correction cannot undo it\r\n\t\tif ( !Controller.IsOnGround )\r\n\t\t\tController.Body.Velocity /= 1 \u002B MathF.Max( Controller.AirFriction, 0 ) * Time.Delta;\r\n\r\n\t\tif ( Controller.IsOnGround \u0026\u0026 StepUpHeight \u003E 0 )\r\n\t\t{\r\n\t\t\tTrySteppingUp( StepUpHeight );\r\n\t\t}\r\n\t}\r\n\r\n\tpublic override void PostPhysicsStep()\r\n\t{\r\n\t\tbase.PostPhysicsStep();\r\n\r\n\t\tStickToGround( StepDownHeight );\r\n\t}\r\n\r\n\tpublic override bool IsStandableSurface( in SceneTraceResult result )\r\n\t{\r\n\t\tif ( Vector3.GetAngle( Vector3.Up, result.Normal ) \u003E GroundAngle )\r\n\t\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tpublic override Vector3 UpdateMove( Rotation eyes, Vector3 input )\r\n\t{\r\n\t\t// ignore pitch when walking\r\n\t\teyes = eyes.Angles() with { pitch = 0 };\r\n\r\n\t\tinput = input.ClampLength( 1f );\r\n\t\tVector3 vector = eyes * input;\r\n\t\tbool flag = PlayerInput.CanSprint() \u0026\u0026 Input.Down( Controller.AltMoveButton );\r\n\t\tif ( Controller.RunByDefault )\r\n\t\t{\r\n\t\t\tflag = !flag;\r\n\t\t}\r\n\r\n\t\tfloat num = (flag ? Controller.RunSpeed : Controller.WalkSpeed);\r\n\t\tif ( Controller.IsDucking )\r\n\t\t{\r\n\t\t\tnum = Controller.DuckedSpeed;\r\n\t\t}\r\n\r\n\t\tif ( vector.IsNearlyZero( 0.1f ) )\r\n\t\t\treturn 0f;\r\n\r\n\t\t// No input smoothing, matching upstream: ground acceleration/friction in AddVelocity handle ramping\r\n\t\treturn vector * num;\r\n\t}\r\n\r\n\tpublic override Transform CalculateEyeTransform()\r\n\t{\r\n\t\tvar tr = base.CalculateEyeTransform();\r\n\r\n\t\t//\r\n\t\t// Hack central, but this just moves the eye position a bit so it works better with hand IK\r\n\t\t//\r\n\t\ttr = tr with { Position = tr.Position - Vector3.Up * 0f \u002B tr.Forward * -5f };\r\n\r\n\t\t//\r\n\t\t// :(\r\n\t\t//\r\n\t\tif ( Controller.IsDucking )\r\n\t\t{\r\n\t\t\ttr = tr with { Position = tr.Position \u002B Vector3.Up * 20f };\r\n\t\t}\r\n\r\n\t\treturn tr;\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"FunStuff/JumperWindTunnel.cs","FileName":"JumperWindTunnel.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\n[Title( \u0022Jumper - Wind\u0022 )]\r\n[Category( \u0022Jumper\u0022 )]\r\n[Icon( \u0022wind_power\u0022 )]\r\n\r\npublic sealed class JumperWindTunnel : Component, Component.ITriggerListener\r\n{\r\n\t[Property] public float WindGroundedStrength { get; set; } = 25.0f;\r\n\t[Property] public float WindAirStrength { get; set; } = 15.0f;\r\n\r\n\r\n\tprotected override void DrawGizmos()\r\n\t{\r\n\r\n\t\tGizmo.Draw.LineThickness = 10;\r\n\t\tGizmo.Draw.Color = Color.Red;\r\n\t\tGizmo.Draw.Line( 0, 0 \u002B Vector3.Forward * 100);\r\n\t}\r\n\r\n\tList\u003CGameObject\u003E Players = new();\r\n\r\n\tprotected override void OnUpdate()\r\n\t{\r\n\t\tif ( Players is null )\r\n\t\t\treturn;\r\n\r\n\t\tforeach ( var player in Players )\r\n\t\t{\r\n\t\t\tvar plycomp = player.GetComponent\u003CPlayerController\u003E();\r\n\t\t\tif( plycomp.IsOnGround)\r\n\t\t\t{\r\n\t\t\t\t//plycomp.TryWind( Transform.Rotation.Forward, WindGroundedStrength );\r\n\t\t\t\tplycomp.Body.Velocity \u002B= WorldRotation.Forward * WindGroundedStrength * 0.25f;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tplycomp.Body.Velocity \u002B= WorldRotation.Forward * WindAirStrength * 0.25f;\r\n\t\t\t\t//plycomp.TryWind( Transform.Rotation.Forward, WindAirStrength );\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\t\r\n\tvoid ITriggerListener.OnTriggerEnter( Collider other )\r\n\t{\r\n\r\n\t\tif ( other.GameObject.Root.Tags.Has( \u0022player\u0022 ) )\r\n\t\t{\r\n\t\t\tvar ply = other.GameObject.Root;\r\n\t\t\tvar plyComp = ply.GetComponent\u003CPlayerController\u003E();\r\n\t\t\tif ( plyComp.IsValid() )\r\n\t\t\t{\r\n\t\t\t\tplyComp.PreventGrounding( 0.2f );\r\n\t\t\t\tplyComp.Body.Velocity \u002B= WorldRotation.Forward * 15;\r\n\t\t\t\t//plyComp.TryWind( Transform.Rotation.Forward, 15 );\r\n\t\t\t\tPlayers.Add( ply );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvoid ITriggerListener.OnTriggerExit( Collider other )\r\n\t{\r\n\r\n\t\tif ( other.GameObject.Tags.Has( \u0022player\u0022 ) )\r\n\t\t{\r\n\t\t\tvar ply = other.GameObject.Parent;\r\n\r\n\t\t\tPlayers.Remove( ply );\r\n\t\t}\r\n\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"GamePlay/GameManager.cs","FileName":"GameManager.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"public sealed partial class GameManager : GameObjectSystem\u003CGameManager\u003E, Component.INetworkListener, ISceneStartup\r\n{\r\n\tpublic GameManager( Scene scene ) : base( scene )\r\n\t{\r\n\t}\r\n\r\n\tvoid ISceneStartup.OnHostInitialize()\r\n\t{\r\n\t\tif ( !Networking.IsActive )\r\n\t\t{\r\n\t\t\tNetworking.CreateLobby( new Sandbox.Network.LobbyConfig() { MaxPlayers = 32 } );\r\n\t\t}\r\n\t}\r\n\r\n\tvoid Component.INetworkListener.OnActive( Connection channel )\r\n\t{\r\n\t\tSpawnPlayer( channel );\r\n\t}\r\n\r\n\tpublic void SpawnPlayer( Connection owner )\r\n\t{\r\n\t\t// Find a spawn location for this player\r\n\t\tvar startLocation = FindSpawnLocation().WithScale( 1 );\r\n\r\n\t\t// Spawn this object and make the client the owner\r\n\t\tvar playerGo = GameObject.Clone( \u0022/prefabs/player/jumperplayer.prefab\u0022, new CloneConfig { Name = owner.DisplayName, StartEnabled = false, Transform = startLocation } );\r\n\t\tplayerGo.NetworkSpawn( owner );\r\n\t}\r\n\r\n\t/// \u003Csummary\u003E\r\n\t/// In the editor, spawn the player where they\u0027re looking\r\n\t/// \u003C/summary\u003E\r\n\tpublic static Transform EditorSpawnLocation { get; set; }\r\n\r\n\t/// \u003Csummary\u003E\r\n\t/// Find the most appropriate place to respawn\r\n\t/// \u003C/summary\u003E\r\n\tTransform FindSpawnLocation()\r\n\t{\r\n\r\n\t\t//\r\n\t\t// If we have any SpawnPoint components in the scene, then use those\r\n\t\t//\r\n\t\tvar spawnPoints = Scene.GetAllComponents\u003CSpawnPoint\u003E().ToArray();\r\n\r\n\t\tif ( spawnPoints.Length == 0 )\r\n\t\t{\r\n\t\t\tif ( Application.IsEditor \u0026\u0026 !EditorSpawnLocation.Position.IsNearlyZero() )\r\n\t\t\t{\r\n\t\t\t\treturn EditorSpawnLocation;\r\n\t\t\t}\r\n\r\n\t\t\treturn Transform.Zero;\r\n\t\t}\r\n\r\n\t\treturn Random.Shared.FromArray( spawnPoints ).Transform.World;\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"Player/JumpControllerAnimator.cs","FileName":"JumpControllerAnimator.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using static Sandbox.PhysicsContact;\r\n\r\nnamespace Sandbox;\r\n\r\npublic sealed class JumpControllerAnimator : Component\r\n{\r\n\tSkinnedModelRenderer _renderer;\r\n\t/// \u003Csummary\u003E\r\n\t/// The body will usually be a child object with SkinnedModelRenderer\r\n\t/// \u003C/summary\u003E\r\n\t[Property, Feature( \u0022Animator\u0022 )]\r\n\tpublic SkinnedModelRenderer Renderer\r\n\t{\r\n\t\tget =\u003E _renderer;\r\n\t\tset\r\n\t\t{\r\n\t\t\tif ( _renderer == value ) return;\r\n\r\n\t\t\t_renderer = value;\r\n\t\t}\r\n\t}\r\n\t[Property, RequireComponent] PlayerController Controller { get; set; }\r\n\r\n\t[Sync] public Angles TargetAngles { get; set; }\r\n\r\n\tprotected override void OnUpdate()\r\n\t{\r\n\t\tWithVelocity( Controller.Velocity );\r\n\t\tWithWishVelocity( Controller.WishVelocity );\r\n\t\tIsGrounded = Controller.IsOnGround;\r\n\r\n\t\tVector3 dir = default;\r\n\r\n\t\t// 1) If we have move input, use that to define facing\r\n\t\tvar moveInput = Input.AnalogMove;\r\n\t\tif ( moveInput.Length \u003E 0.01f )\r\n\t\t{\r\n\t\t\t// Convert 2D move into world-space using eye yaw (pitch ignored)\r\n\t\t\tvar eye = Controller.EyeAngles;\r\n\t\t\teye.pitch = 0;\r\n\t\t\teye.roll = 0;\r\n\r\n\t\t\tdir = (eye.ToRotation() * moveInput).WithZ( 0 );\r\n\t\t}\r\n\t\t// 2) Otherwise, fall back to velocity (e.g. sliding / being pushed)\r\n\t\telse if ( Controller.WishVelocity.Length \u003E 0.01f )\r\n\t\t{\r\n\t\t\tdir = Controller.WishVelocity.WithZ( 0 );\r\n\t\t}\r\n\r\n\t\tif ( !dir.IsNearlyZero( 0.001f ) \u0026\u0026 Controller.IsOnGround )\r\n\t\t{\r\n\t\t\tTargetAngles = Rotation\r\n\t\t\t\t.LookAt( dir.Normal )\r\n\t\t\t\t.Angles()\r\n\t\t\t\t.WithRoll( 0 );\r\n\t\t}\r\n\r\n\t\tif ( !Controller.IsOnGround )\r\n\t\t{\r\n\t\t\tTargetAngles = Rotation.LookAt( Controller.Velocity.WithZ( 0 ).Normal ).Angles().WithRoll( 0 );\r\n\t\t}\r\n\r\n\t\tRenderer.WorldRotation = Rotation.Slerp(\r\n\t\t\tRenderer.WorldRotation,\r\n\t\t\tRotation.From( TargetAngles ),\r\n\t\t\t8f * Time.Delta\r\n\t\t);\r\n\r\n\t\tWithLook( Controller.EyeAngles.Forward, 1, 1, 1.0f );\r\n\t}\r\n\r\n\tpublic void WithVelocity( Vector3 Velocity )\r\n\t{\r\n\t\tvar dir = Velocity;\r\n\t\tvar forward = Renderer.WorldRotation.Forward.Dot( dir );\r\n\t\tvar sideward = Renderer.WorldRotation.Right.Dot( dir );\r\n\r\n\t\tvar angle = MathF.Atan2( sideward, forward ).RadianToDegree().NormalizeDegrees();\r\n\r\n\t\tRenderer.Set( \u0022move_direction\u0022, angle );\r\n\t\tRenderer.Set( \u0022move_speed\u0022, Velocity.Length );\r\n\t\tRenderer.Set( \u0022move_groundspeed\u0022, Velocity.WithZ( 0 ).Length );\r\n\t\tRenderer.Set( \u0022move_y\u0022, sideward );\r\n\t\tRenderer.Set( \u0022move_x\u0022, forward );\r\n\t\tRenderer.Set( \u0022move_z\u0022, Velocity.z );\r\n\t}\r\n\r\n\tpublic void WithWishVelocity( Vector3 Velocity )\r\n\t{\r\n\t\tvar dir = Velocity;\r\n\t\tvar forward = Renderer.WorldRotation.Forward.Dot( dir );\r\n\t\tvar sideward = Renderer.WorldRotation.Right.Dot( dir );\r\n\r\n\t\tvar angle = MathF.Atan2( sideward, forward ).RadianToDegree().NormalizeDegrees();\r\n\r\n\t\tRenderer.Set( \u0022wish_direction\u0022, angle );\r\n\t\tRenderer.Set( \u0022wish_speed\u0022, Velocity.Length );\r\n\t\tRenderer.Set( \u0022wish_groundspeed\u0022, Velocity.WithZ( 0 ).Length );\r\n\t\tRenderer.Set( \u0022wish_y\u0022, sideward );\r\n\t\tRenderer.Set( \u0022wish_x\u0022, forward );\r\n\t\tRenderer.Set( \u0022wish_z\u0022, Velocity.z );\r\n\t}\r\n\r\n\tpublic bool IsGrounded\r\n\t{\r\n\t\tget =\u003E Renderer.GetBool( \u0022b_grounded\u0022 );\r\n\t\tset =\u003E Renderer.Set( \u0022b_grounded\u0022, value );\r\n\t}\r\n\r\n\tpublic void WithLook( Vector3 lookDirection, float eyesWeight = 1.0f, float headWeight = 1.0f, float bodyWeight = 1.0f )\r\n\t{\r\n\t\tRenderer.SetLookDirection( \u0022aim_eyes\u0022, lookDirection, eyesWeight );\r\n\t\tRenderer.SetLookDirection( \u0022aim_head\u0022, lookDirection, headWeight );\r\n\t\tRenderer.SetLookDirection( \u0022aim_body\u0022, lookDirection, bodyWeight );\r\n\t}\r\n\r\n\tpublic float DuckLevel\r\n\t{\r\n\t\tget =\u003E Renderer.GetFloat( \u0022duck\u0022 );\r\n\t\tset =\u003E Renderer.Set( \u0022duck\u0022, value );\r\n\t}\r\n\tpublic void TriggerJump()\r\n\t{\r\n\t\tRenderer.Set( \u0022b_jump\u0022, true );\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"UI/JumperMenu.razor","FileName":"JumperMenu.razor","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"@using Sandbox;\r\n@using Sandbox.UI;\r\n@inherits PanelComponent\r\n@if (Network.OwnerConnection is Connection owner \u0026\u0026 owner == Connection.Local)\r\n{\r\n    \u003Croot\u003E\r\n        \u003Cdiv class=\u0022container\u0022\u003E\r\n            \u003Cdiv class=\u0022header\u0022\u003E\r\n                \u003Clabel class=\u0022title\u0022\u003EJUMPER\u003C/label\u003E\r\n            \u003C/div\u003E\r\n            \u003Cdiv class=\u0022rows\u0022\u003E\r\n                \u003Cdiv class=\u0022row\u0022\u003E\r\n                    \u003Clabel class=\u0022title\u0022\u003ENAME\u003C/label\u003E\r\n                    \u003Clabel class=\u0022stat\u0022\u003E@Name\u003C/label\u003E\r\n                \u003C/div\u003E\r\n                \u003Cdiv class=\u0022row\u0022\u003E\r\n                    \u003Clabel class=\u0022title\u0022\u003EPLAYTIME\u003C/label\u003E\r\n                    \u003Clabel class=\u0022stat\u0022\u003E@YourSessionTime\u003C/label\u003E\r\n                \u003C/div\u003E\r\n                \u003Cdiv class=\u0022row\u0022\u003E\r\n                    \u003Clabel class=\u0022title\u0022\u003EJUMPS\u003C/label\u003E\r\n                    \u003Clabel class=\u0022stat\u0022\u003E@Jumps\u003C/label\u003E\r\n                \u003C/div\u003E\r\n                \u003Cdiv class=\u0022row\u0022\u003E\r\n                    \u003Clabel class=\u0022title\u0022\u003EBEST HEIGHT\u003C/label\u003E\r\n                    \u003Clabel class=\u0022stat\u0022\u003E@MaxHeight\u003C/label\u003E\r\n                \u003C/div\u003E\r\n                \u003Cdiv class=\u0022row\u0022\u003E\r\n                    \u003Clabel class=\u0022title\u0022\u003EFALLS\u003C/label\u003E\r\n                    \u003Clabel class=\u0022stat\u0022\u003E@Falls\u003C/label\u003E\r\n                \u003C/div\u003E\r\n                \u003Cdiv class=\u0022row\u0022\u003E\r\n                    \u003Clabel class=\u0022title\u0022\u003ECOMPLETIONS\u003C/label\u003E\r\n                    \u003Clabel class=\u0022stat\u0022\u003E@Completions\u003C/label\u003E\r\n                \u003C/div\u003E\r\n            \u003C/div\u003E\r\n            \u003Cbutton onclick=\u0022@Restart\u0022\u003ERestart\u003C/button\u003E\r\n            \u003Cbutton onclick=\u0022@Unstuck\u0022\u003EUnstuck\u003C/button\u003E\r\n        \u003C/div\u003E\r\n    \u003C/root\u003E\r\n}\r\n@code {\r\n    private string Name =\u003E GameObject.Network.OwnerConnection.DisplayName;\r\n    private float TimePlayed =\u003E GameObject.Components.Get\u003CJumperPlayerStuff\u003E(FindMode.EverythingInAncestors).TimePlayed;\r\n    private int? Jumps =\u003E GameObject.Components.Get\u003CJumperPlayerStuff\u003E(FindMode.EverythingInAncestors)?.TotalJumps;\r\n    private int? Falls =\u003E GameObject.Components.Get\u003CJumperPlayerStuff\u003E(FindMode.EverythingInAncestors)?.TotalFalls;\r\n    private int? Completions =\u003E GameObject.Components.Get\u003CJumperPlayerStuff\u003E(FindMode.EverythingInAncestors)?.Completions;\r\n    private float? MaxHeight =\u003E GameObject.Components.Get\u003CJumperPlayerStuff\u003E(FindMode.EverythingInAncestors)?.MaxHeight;\r\n\r\n    private string YourSessionTime;\r\n\r\n    // private JumperPawn Pawn =\u003E (Game.LocalPawn as JumperPawn);\r\n\r\n\r\n    private void Unstuck()\r\n    {\r\n        GameObject.Components.Get\u003CPlayerInput\u003E(FindMode.EverythingInAncestors)?.Unstuck();\r\n    }\r\n\r\n    private void Restart()\r\n    {\r\n        \r\n\t\tvar spawnpoint = Scene.Components.GetAll\u003CJumperSpawnPoint\u003E().FirstOrDefault();\r\n            if (spawnpoint != null)\r\n            {\r\n            //Do some more stuff but for now just movew the play to spawn\r\n\t\t\tGameObject.Parent.Transform.Position = spawnpoint.Transform.Position;\r\n\t\t\t\r\n            //JumperGame.SetPlayerPosition(spawnpoint.Position \u002B Vector3.Up * 10);\r\n            //Pawn.ResetStats();\r\n        }\r\n    \r\n\r\n    }\r\n\r\n    protected override void OnUpdate()\r\n    {\r\n        base.OnUpdate();\r\n        \r\n        // Tab is bound to the \u0022score\u0022 action, so open on either action\r\n        SetClass(\u0022open\u0022, Input.Down(\u0022menu\u0022) || Input.Down(\u0022score\u0022));\r\n\r\n        if (!HasClass(\u0022open\u0022))\r\n        {\r\n            RemoveClass(\u0022cursor\u0022);\r\n        }\r\n        else\r\n        {\r\n            if (Input.Down(\u0022attack1\u0022) || Input.Down(\u0022attack2\u0022))\r\n            {\r\n                AddClass(\u0022cursor\u0022);\r\n            }\r\n        }\r\n\r\n        YourSessionTime = TimeSpan.FromSeconds((TimePlayed * 60).Clamp(0, float.MaxValue)).ToString(@\u0022dd\\:hh\\:mm\\:ss\u0022);\r\n    }\r\n\r\n    protected override int BuildHash()\r\n    {\r\n        return HashCode.Combine(Jumps, Falls, MaxHeight, YourSessionTime, Completions);\r\n    }\r\n}"},{"Ident":"facepunch.jumper","Path":"UI/JumperScoreboard.razor","FileName":"JumperScoreboard.razor","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"@using Sandbox;\r\n@using Sandbox.UI;\r\n@inherits PanelComponent\r\n\r\n    \u003Croot\u003E\r\n        \u003Cdiv class=\u0022header\u0022\u003E\r\n            \u003Clabel class=\u0022name\u0022\u003EName\u003C/label\u003E\r\n            \u003Clabel class=\u0022score\u0022\u003EHeight\u003C/label\u003E\r\n        \u003C/div\u003E\r\n        \u003Cdiv class=\u0022entries\u0022\u003E\r\n        @foreach (var player in Scene.Components.GetAll\u003CJumperPlayerStuff\u003E())\r\n        {\r\n            \u003Cdiv class=@(player.Network.IsOwner ? \u0022entry me\u0022 : \u0022entry\u0022)\u003E\r\n                \u003Clabel class=\u0022you\u0022\u003EYou\u003C/label\u003E\r\n                \u003Clabel class=\u0022name\u0022\u003E@player.Network.OwnerConnection.DisplayName\u003C/label\u003E\r\n                \u003Clabel class=\u0022score\u0022\u003E@player.Height\u003C/label\u003E\r\n            \u003C/div\u003E\r\n        }\r\n        \u003C/div\u003E\r\n    \u003C/root\u003E\r\n@code {\r\n    bool IsOpen { get; set; }\r\n\r\n    private float Ping(float ping)\r\n    {\r\n        return (ping * 1000).Floor();   \r\n    }\r\n\r\n    protected override int BuildHash()\r\n    {\r\n        IsOpen ^= Input.Pressed(\u0022slot3\u0022);\r\n\r\n        var result = Input.Down(\u0022score\u0022).GetHashCode();\r\n        foreach (var cl in GameObject.Components.GetAll\u003CJumperPlayerStuff\u003E())\r\n        {\r\n\r\n            result = HashCode.Combine(result, cl.MaxHeight);\r\n        }\r\n        return HashCode.Combine(IsOpen, result,Time.Delta);\r\n    }\r\n}"},{"Ident":"facepunch.jumper","Path":"FunStuff/JumperNPCYapper.cs","FileName":"JumperNPCYapper.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"[GameResource( \u0022NPC TEXT\u0022, \u0022npct\u0022, \u0022Npc_text\u0022, Icon = \u0022sentiment_very_satisfied\u0022, IconBgColor = \u0022#fcba03\u0022, IconFgColor = \u0022#363324\u0022 )]\r\npublic class NPCTextGameResource : GameResource\r\n{\r\n\t[Property]\r\n\t[Title( \u0022Name\u0022 )]\r\n\t[Category( \u0022Name\u0022 )]\r\n\tpublic String NPCName { get; set; }\r\n\r\n\t[Property]\r\n\t[Title( \u0022Text\u0022 )]\r\n\t[Category( \u0022Text\u0022 )]\r\n\tpublic List\u003CString\u003E NPCText { get; set; } = new();\r\n\r\n\t[Property, ResourceType( \u0022sound\u0022 )]\r\n\t[Title( \u0022Voice\u0022 )]\r\n\t[Category( \u0022Voice\u0022 )]\r\n\tpublic string NPCVoice { get; set; }\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"Particles/CircleEmitter.cs","FileName":"CircleEmitter.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\nusing System;\r\n\r\n[Title( \u0022Circle Forward Emitter\u0022 )]\r\n[Category( \u0022Particles\u0022 )]\r\npublic sealed class ParticleCircleForwardEmitter : ParticleEmitter\r\n{\r\n\t[Property, Group( \u0022Circle\u0022 )]\r\n\tpublic float Radius { get; set; } = 10.0f;\r\n\r\n\r\n\tprotected override void DrawGizmos()\r\n\t{\r\n\t\tif ( !Gizmo.IsSelected )\r\n\t\t\treturn;\r\n\r\n\t\tGizmo.Draw.LineThickness = 6;\r\n\t\tGizmo.Draw.Color = Color.Green.WithAlpha( 0.3f );\r\n\t\tGizmo.Draw.LineCircle( Vector3.Zero, Radius );\r\n\t}\r\n\r\n\tpublic override bool Emit( ParticleEffect target )\r\n\t{\r\n\t\tvar len = Random.Shared.Float( 0, Radius );\r\n\r\n\t\tvar angle = len * MathF.PI * 2.0f;\r\n\t\t//var pos = new Vector3( MathF.Cos( angle ), MathF.Sin( angle ), 0 ) * Radius;\r\n\t\tvar pos = Vector3.Forward * 0.1f;\r\n\r\n\t\tvar rand = angle;\r\n\t\tpos \u002B= Vector3.Left * MathF.Sin( angle ) * len;\r\n\t\tpos \u002B= Vector3.Up * MathF.Cos( angle ) * len;\r\n\r\n\t\tvar emitPos = pos;\r\n\r\n\t\tvar p = target.Emit( Transform.World.PointToWorld( emitPos ) );\r\n\t\tp.Velocity = Transform.World.NormalToWorld( Vector3.Forward ) * p.Velocity.Length;\r\n\r\n\r\n\t\treturn true;\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"SelfDestructComponent.cs","FileName":"SelfDestructComponent.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\n\r\npublic sealed class SelfDestructComponent : Component\r\n{\r\n\t[Property] float Seconds { get; set; }\r\n\r\n\tTimeUntil timeUntilDie;\r\n\r\n\tprotected override void OnEnabled()\r\n\t{\r\n\t\ttimeUntilDie = Seconds;\r\n\t}\r\n\r\n\tprotected override void OnUpdate()\r\n\t{\r\n\t\tif ( GameObject.IsProxy )\r\n\t\t\treturn;\r\n\r\n\t\tif ( timeUntilDie \u003C= 0.0f )\r\n\t\t{\r\n\t\t\tGameObject.Destroy();\r\n\t\t}\r\n\t}\r\n}\r\n"},{"Ident":"facepunch.jumper","Path":"UI/JumperNameTag.razor","FileName":"JumperNameTag.razor","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"\uFEFF@using Sandbox;\r\n@using Sandbox.UI;\r\n@inherits PanelComponent\r\n\r\n@if (Network.OwnerConnection is Connection owner \u0026\u0026 owner != Connection.Local)\r\n{\r\n    \u003Croot\u003E\r\n\r\n        \u003Cdiv class=\u0022card\u0022\u003E\r\n            \u003Cdiv class=\u0022avatar\u0022 style=\u0022background-image: url( avatar:@owner.SteamId )\u0022\u003E\u003C/div\u003E\r\n            \u003Cdiv class=\u0022name\u0022\u003E@owner.DisplayName\u003C/div\u003E\r\n            @if (IsVoicePlaying)\r\n            {\r\n                \u003Cdiv class=\u0022voice\u0022\u003E\u003C/div\u003E\r\n            }\r\n        \u003C/div\u003E\r\n\r\n    \u003C/root\u003E\r\n}\r\n\r\n@code\r\n{\r\n    Sandbox.Voice voiceComponent;\r\n\r\n    protected override void OnEnabled()\r\n    {\r\n        base.OnEnabled();\r\n        voiceComponent = GameObject.Root.Components.GetInDescendantsOrSelf\u003CVoice\u003E();\r\n    }\r\n\r\n    public bool IsVoicePlaying\r\n    {\r\n        get\r\n        {\r\n            if (voiceComponent is null) return false;\r\n            return voiceComponent.LastPlayed \u003C 0.5f;\r\n        }\r\n    }\r\n\r\n    /// \u003Csummary\u003E\r\n    /// Rebuild if the owner connection changes\r\n    /// \u003C/summary\u003E\r\n    protected override int BuildHash() =\u003E System.HashCode.Combine(Network.OwnerConnection, IsVoicePlaying);\r\n}"},{"Ident":"facepunch.jumper","Path":"FunStuff/JumperNPCLooker.cs","FileName":"JumperNPCLooker.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":443088,"IsPrivate":false,"Code":"using Sandbox;\r\nusing Sandbox.Citizen;\r\nusing Sandbox.Internal;\r\n\r\npublic sealed class JumperNPCLooker : Component, Component.ITriggerListener\r\n{\r\n\t[Property] public CitizenAnimationHelper animhelp { get; set; }\r\n\t[Property] public GameObject LookTarget { get; set; }\r\n\t[Property] List\u003CNPCTextGameResource\u003E Resources { get; set; }\r\n\tNPCTextGameResource NPCTextGameResource { get; set; }\r\n\r\n\tprotected override void OnEnabled()\r\n\t{\r\n\t\tbase.OnEnabled();\r\n\r\n\t\tif ( Resources != null \u0026\u0026 Resources.Count \u003E 0 )\r\n\t\t{\r\n\t\t\tint randomIndex = new Random().Next( 0, Resources.Count );\r\n\r\n\t\t\tNPCTextGameResource = Resources[randomIndex];\r\n\t\t}\r\n\t}\r\n\r\n\tvoid ITriggerListener.OnTriggerEnter( Collider other )\r\n\t{\r\n\r\n\t\tif ( other.GameObject.Tags.Has( \u0022player\u0022 ) )\r\n\t\t{\r\n\t\t\tanimhelp.LookAt = other.GameObject.Parent;\r\n\t\t\tanimhelp.EyesWeight = 1;\r\n\t\t\tanimhelp.HeadWeight = 1;\r\n\t\t\tanimhelp.BodyWeight = 1;\r\n\t\t\t/*\r\n\t\t\tvar yapper = other.GameObject.Parent.Components.Get\u003CJumperNPCTalker\u003E( FindMode.EnabledInSelfAndChildren );\r\n\t\t\tyapper.DisplayMessage( GetRandomMessage() );\r\n\t\t\tyapper.NPCName = NPCTextGameResource.NPCName;\r\n\t\t\tyapper.Voice = NPCTextGameResource.NPCVoice;\r\n\t\t\t*/\r\n\t\t}\r\n\t}\r\n\r\n\tvoid ITriggerListener.OnTriggerExit( Collider other )\r\n\t{\r\n\r\n\t\tif ( other.GameObject.Tags.Has( \u0022player\u0022 ) )\r\n\t\t{\r\n\t\t\tanimhelp.LookAt = LookTarget;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tprivate int lastMessage;\r\n\tprivate string GetRandomMessage()\r\n\t{\r\n\t\tvar idx = Game.Random.Int( 0, NPCTextGameResource.NPCText.Count - 1 );\r\n\t\twhile ( idx == lastMessage )\r\n\t\t\tidx = Game.Random.Int( 0, NPCTextGameResource.NPCText.Count - 1 );\r\n\r\n\t\tlastMessage = idx;\r\n\t\treturn string.Format( NPCTextGameResource.NPCText[idx] );\r\n\t}\r\n}\r\n"}]}