{"TotalCount":42,"Files":[{"Ident":"jco.iso2","Path":"core/npc/NpcMovement.cs","FileName":"NpcMovement.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class NpcMovement : Component {\r\n\t[Property] public Vector3 Goal {get; set;}\r\n\tpublic Action OnReachTarget {get; set;}\r\n\t[Property] public Vector3 OnReachTargetPosition {get; set;}\r\n\t[Button] public bool Go(bool force = true) {\r\n\t\tGoal = Grid.Snap(Goal);\r\n\t\tif (Path.Count \u003E 0) {\r\n\t\t\tPath.Clear();\r\n\t\t\tWaitingForGo = true;\r\n\t\t\tHitGo = 0.1f;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tPath.Clear();\r\n\t\tif (Grid.IsBlocked(Goal)) {\r\n\t\t\tif (Goal == OnReachTargetPosition)\r\n\t\t\t\tOnReachTarget.Invoke();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tPath.Add(Grid.Snap(WorldPosition));\r\n\t\tAdvance(new());\r\n\t\tif (Path.Count == 0) {\r\n\t\t\tif (Goal == OnReachTargetPosition)\r\n\t\t\t\tOnReachTarget.Invoke();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!Path.Last().AlmostEqual(Goal)) {\r\n\t\t\tif (Goal == OnReachTargetPosition)\r\n\t\t\t\tOnReachTarget.Invoke();\r\n\t\t\tPath.Clear();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//DebugOverlay.Line(Path, Color.Red, 5);\r\n\t\tRun = LastGo \u003C 0.4f;\r\n\t\tLastGo = 0;\r\n\t\treturn true;\r\n\t}\r\n\t[Property, ReadOnly] public bool WaitingForGo {get ; set;}\r\n\tprivate TimeSince LastGo {get; set;} = 1000;\r\n\tprivate TimeUntil HitGo {get; set;}\r\n\t[Property] public bool DontUpdateActivity {get; set;}\r\n\t[Property, ReadOnly] public bool Run {get; set;} = false;\r\n\t[Property, ReadOnly] public List\u003CVector3\u003E Path {get; set;} = new();\r\n\r\n\tpublic void Advance(List\u003CVector3\u003E invalid, bool useangle = false, float angle = 0f) {\r\n\t\tif (Path.Last() == Goal)\r\n\t\t\treturn;\r\n\t\tif (useangle) {\r\n\t\t\tvar canidate = Grid.Snap(Path.Last() \u002B Rotation.FromYaw(angle).Forward * 30f);\r\n\t\t\tif (Grid.IsBlocked(canidate) || Path.Last().Distance(Goal) \u003C= canidate.Distance(Goal) \u002B Path.Last().Distance(canidate) * 0.5f)\r\n\t\t\t\tuseangle = false;\r\n\t\t}\r\n\t\tif (!useangle) {\r\n\t\t\tvar best = -1f;\r\n\t\t\tfor (int i = 0; i \u003C 6; i\u002B\u002B) {\r\n\t\t\t\tvar canidate = Grid.Snap(Path.Last() \u002B Rotation.FromYaw(i * 60f - 30f).Forward * 30f);\r\n\t\t\t\tif (Grid.IsBlocked(canidate))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tvar dot = Vector3.Direction(Path.Last(), canidate).Dot(Vector3.Direction(Path.Last(), Goal));\r\n\t\t\t\tif (dot \u003C best)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tangle = i * 60f - 30f;\r\n\t\t\t\tbest = dot;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar point = Grid.Snap(Path.Last() \u002B Rotation.FromYaw(angle).Forward * 30f);\r\n\t\tPath.Add(point);\r\n\t\tif (Path.Count \u003E 40)\r\n\t\t\treturn;\r\n\t\tAdvance(invalid, true, angle);\r\n\t}\r\n\r\n\tpublic Vector3 EntityRoot {get; set;}\r\n\tprotected override void OnUpdate() {\r\n\t\tif (WaitingForGo \u0026\u0026 HitGo) {\r\n\t\t\tGo();\r\n\t\t\tWaitingForGo = false;\r\n\t\t}\r\n\t\tif (!Grid.Snap(OnReachTargetPosition).AlmostEqual(Grid.Snap(Goal)))\r\n\t\t\tOnReachTarget = null;\r\n\t\tif (!WaitingForGo \u0026\u0026 Path.Count == 0 \u0026\u0026 Grid.Snap(EntityRoot).AlmostEqual(Grid.Snap(Goal)))\r\n\t\t\tOnReachTarget?.Invoke();\r\n\t\tbase.OnUpdate();\r\n\t\tvar a = Components.Get\u003CNpcAnimator\u003E();\r\n\t\tif (!a.IsValid())\r\n\t\t\treturn;\r\n\t\tPath ??= new();\r\n\t\tUpdateActivity(a);\r\n\t\tif (Path.Count == 0)\r\n\t\t\ta.Owner.SnapToGrid();\r\n\t\tvar root = a.Owner.Renderer.GetAttachment(\u0022root\u0022).Value.Position;\r\n\t\troot.z = 0;\r\n\t\troot = WorldTransform.PointToWorld(WorldTransform.PointToLocal(root).WithY(0f));\r\n\t\tif (Grid.Snap(root).Distance(root) \u003C 5)\r\n\t\t\troot = Grid.Snap(root);\r\n\t\t//DebugOverlay.Sphere(new(root, 2), Color.Green, 0.5f);\r\n\t\tEntityRoot = root;\r\n\t\tif (Path.Count == 0)\r\n\t\t\treturn;\r\n\t\tif (root.AlmostEqual(Path[0]))\r\n\t\t\tPath.RemoveAt(0);\r\n\t}\r\n\r\n\tprivate void UpdateActivity(NpcAnimator a) {\r\n\t\tif (!DontUpdateActivity \u0026\u0026 !a.ActivitySet.NonInteruptActivities.Contains(a.Activity)) {\r\n\t\t\ta.Activity = \u0022walk\u0022;\r\n\t\t\tif (Run)\r\n\t\t\t\ta.Activity = \u0022jog\u0022;\r\n\t\t\tif (Path.Count == 0) {\r\n\t\t\t\ta.Activity = \u0022idle\u0022;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (Path[0].AlmostEqual(WorldPosition))\r\n\t\t\t\tPath.RemoveAt(0);\r\n\t\t\tif (Path.Count == 0) {\r\n\t\t\t\ta.Activity = \u0022idle\u0022;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Path.Count == 0)\r\n\t\t\treturn;\r\n\t\tvar newrot = Rotation.LookAt(Vector3.Direction(EntityRoot, Path[0]), Vector3.Up);\r\n\t\tif (newrot != WorldRotation) {\r\n\t\t\tWorldPosition = WorldPosition.RotateAround(EntityRoot, Rotation.Difference(WorldRotation, newrot));\r\n\t\t\tWorldRotation = newrot;\r\n\t\t\ta.Owner.SnapToGrid();\r\n\t\t}\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/player/BasePlayer.cs","FileName":"BasePlayer.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class BasePlayer : Component {\r\n\tpublic static BasePlayer Local {get; set;}\r\n\t[Property, ReadOnly] public int Index {get; set;} = 0;\r\n\r\n\t[Property, Change(nameof(UpdateMode))] public bool Isometric {get; set;}\r\n\r\n\t[Property, Hide] public GameObject PacCameraRoot {get; set;}\r\n\t[Property, Hide] public GameObject IsoCameraRoot {get; set;}\r\n\t[Property, Hide] public GameObject IsoNpcRoot {get; set;}\r\n\r\n\t[Property, Hide] public PlayerInventory Inventory {get; set;}\r\n\t[Property, Hide] public PlayerMouse Mouse {get; set;}\r\n\t[Property, Hide] public PlayerPacCamera PacCamera {get; set;}\r\n\t[Property, Hide] public PlayerIsoCamera IsoCamera {get; set;}\r\n\t[Property, Hide] public PlayerIsoMovement IsoMovement {get; set;}\r\n\t[Property, Hide] public IsoEntity IsoEntity {get; set;}\r\n\r\n\tprotected override void DrawGizmos() {\r\n\t\tGameObject.Name = \u0022PLAYER_\u0022\u002BIndex;\r\n\t\tbase.DrawGizmos();\r\n\t}\r\n\r\n\tprotected override void OnAwake() {\r\n\t\tLocal = this;\r\n\t\tIndex = 0;//Scene.GetAllComponents\u003CPlayerProxyBody\u003E().Count();\r\n\t\tGameObject.Name = \u0022PLAYER_\u0022\u002BIndex;\r\n\t\tGameObject.NetworkMode = NetworkMode.Never;\r\n\t\tTags.Add(\u0022dynamic\u0022);\r\n\r\n\t\tSpawn.SetOwner(this);\r\n\r\n\t\tSpawn.GameObject(nameof(PacCameraRoot), \u0022_PAC_CAMERA\u0022);\r\n\t\tSpawn.GameObject(nameof(IsoCameraRoot), \u0022_ISO_CAMERA\u0022);\r\n\t\tSpawn.GameObject(nameof(IsoNpcRoot), \u0022_ISO_NPC\u0022);\r\n\t\tIsoNpcRoot.SetParent(null);\r\n\r\n\t\tSpawn.Component(nameof(Inventory));\r\n\t\tSpawn.Component(nameof(Mouse));\r\n\r\n\t\tSpawn.Component(nameof(PacCamera), PacCameraRoot);\r\n\r\n\t\tSpawn.Component(nameof(IsoCamera), IsoCameraRoot);\r\n\t\tSpawn.Component(nameof(IsoMovement), IsoNpcRoot);\r\n\t\tIsoNpcRoot.Components.Create\u003CSkinnedModelRenderer\u003E().Model = Model.Load(\u0022models/characters/player.vmdl\u0022);\r\n\t\tSpawn.Component(nameof(IsoEntity), IsoNpcRoot);\r\n\r\n\t\tUpdateMode();\r\n\t\tbase.OnAwake();\r\n\t}\r\n\r\n\tpublic void UpdateMode() {\r\n\t\tif (Isometric)\r\n\t\t\tGameObject.SetParent(null);\r\n\t\tIsoMovement.Enabled = Isometric;\r\n\t\tIsoCameraRoot.Enabled = Isometric;\r\n\t\tPacCameraRoot.Enabled = !Isometric;\r\n\t}\r\n\r\n\tprotected override void OnUpdate() {\r\n\t\tif (Isometric) {\r\n\t\t\tWorldRotation = Rotation.Identity;\r\n\t\t\tIsoMovement.Update();\r\n\t\t\tIsoCamera.Update();\r\n\t\t} else {\r\n\t\t\tPacCamera.Update();\r\n\t\t}\r\n\t\tbase.OnUpdate();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"iso2/scene/ScenePlayerExitBunker.cs","FileName":"ScenePlayerExitBunker.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"using Sandbox.Utility;\r\n\r\npublic class ScenePlayerExitBunker : Component {\r\n\t[Property] public SkinnedModelRenderer Renderer {get; set;}\r\n\t[Property] public bool Play {get; set;}\r\n\t[Property, ReadOnly] public bool Playing {get; set;}\r\n\r\n\tprivate TimeUntil PlayTime;\r\n\tprivate TimeUntil LoadTime;\r\n\tprotected override void OnUpdate() {\r\n\t\tPlaying = Playing \u0026\u0026 Play;\r\n\t\tif (!Play) {\r\n\t\t\tRenderer.Set(\u0022play\u0022, false);\r\n\t\t\tRenderer.Enabled = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!Playing) {\r\n\t\t\tRenderer.Enabled = true;\r\n\t\t\tforeach (var node in Scene.GetAllComponents\u003CPacViewNode\u003E())\r\n\t\t\t\tnode.AttachedPlayer = null;\r\n\t\t\tBasePlayer.Local.GameObject.SetParent(Renderer.GetAttachmentObject(\u0022camera\u0022), false);\r\n\t\t\tBasePlayer.Local.GameObject.LocalRotation = Rotation.FromPitch(90f);\r\n\t\t\tBasePlayer.Local.PacCamera.FullScreenFMV = true;\r\n\t\t\tRenderer.Set(\u0022play\u0022, true);\r\n\t\t\tSound.Play(\u0022sounds/choreo/player_leave_foley.sound\u0022);\r\n\t\t\tSound.StopAll(1.22f);\r\n\t\t\tPlayTime = 1.22f;\r\n\t\t\tPlaying = true;\r\n\t\t}\r\n\t\tBasePlayer.Local.PacCamera.OverlayStrength = 0f;\r\n\t\tBasePlayer.Local.GameObject.LocalRotation = Rotation.Identity;\r\n\t\tBasePlayer.Local.PacCamera.Fade = MathF.Pow(PlayTime.Fraction, 8);\r\n\t\tif (!PlayTime)\r\n\t\t\tLoadTime = 0.3f;\r\n\t\tif (LoadTime)\r\n\t\t\tScene.LoadFromFile(\u0022scenes/iso2_world.scene\u0022);\r\n\t\tbase.OnUpdate();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"Assembly.cs","FileName":"Assembly.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"global using Sandbox;\r\nglobal using System.Collections.Generic;\r\nglobal using System.Linq;\r\nglobal using System;\r\n\r\nusing System.Diagnostics.CodeAnalysis;\r\n[assembly: SuppressMessage(\u0022Design\u0022, \u0022CA1050:Declare types in namespaces\u0022, Justification = \u0022\u003CPending\u003E\u0022)]\r\n[assembly: SuppressMessage(\u0022Performance\u0022, \u0022CA1806:Do not ignore method results\u0022, Justification = \u0022\u003CPending\u003E\u0022)]\r\n[assembly: SuppressMessage(\u0022Style\u0022, \u0022IDE0028:Simplify collection initialization\u0022, Justification = \u0022\u003CPending\u003E\u0022)]\r\n"},{"Ident":"jco.iso2","Path":"core/player/PlayerMouse.cs","FileName":"PlayerMouse.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"using static Sandbox.PhysicsContact;\r\n\r\npublic class PlayerMouse : Component {\r\n\t[Property, ReadOnly] public BasePlayer Owner {get;set;}\r\n\tpublic enum Layer {\r\n\t\tWorld,\r\n\t\tInterface,\r\n\t}\r\n\tpublic enum Button {\r\n\t\tNone,\r\n\t\tSwap,\r\n\t\tWeapon,\r\n\t}\r\n\tpublic enum Mode {\r\n\t\tMove,\r\n\t\tInteract,\r\n\t\tShoot\r\n\t}\r\n\t[Property, ReadOnly] public Layer TargetLayer {get; set;} = Layer.World;\r\n\t[Property, ReadOnly] public Button TargetButton {get; set;} = Button.None;\r\n\t[Property] public Mode InteractMode {get; set;} = Mode.Move;\r\n\t[Property, ReadOnly] public IsoEntity HoveredEntity {get; set;}\r\n\t[Property, ReadOnly] public IsoInteractable HoveredInteract {get; set;}\r\n\t[Property, ReadOnly] public Vector2 Position =\u003E Mouse.Position;\r\n\r\n\tprivate bool InNodeOverride = false;\r\n\tprivate Mode LastMode;\r\n\tprotected override void OnFixedUpdate() {\r\n\t\tbase.OnFixedUpdate();\r\n\t\tTargetButton = Button.None;\r\n\t\tTargetLayer = Layer.World;\r\n\t\tvar uipos = Position;\r\n\t\tuipos.y -= Screen.Height;\r\n\t\tif (uipos.x \u003E 331 \u0026\u0026 uipos.y \u003E -173 \u0026\u0026 uipos.x \u003C 773 \u0026\u0026 uipos.y \u003C -36)\r\n\t\t\tTargetButton = Button.Weapon;\r\n\t\telse if (uipos.x \u003E 329 \u0026\u0026 uipos.y \u003E -276 \u0026\u0026 uipos.x \u003C 456 \u0026\u0026 uipos.y \u003C -235)\r\n\t\t\tTargetButton = Button.Swap;\r\n\t\tif (uipos.x \u003C 495 \u0026\u0026 uipos.y \u003E -301)\r\n\t\t\tTargetLayer = Layer.Interface;\r\n\t\tif (uipos.x \u003C 821 \u0026\u0026 uipos.y \u003E -222)\r\n\t\t\tTargetLayer = Layer.Interface;\r\n\t\tif (Input.Pressed(\u0022attack2\u0022) \u0026\u0026 TargetButton == Button.None) {\r\n\t\t\tif (InteractMode != Mode.Shoot)\r\n\t\t\t\tInteractMode = (Mode)((int)InteractMode \u002B 1);\r\n\t\t\telse\r\n\t\t\t\tInteractMode = Mode.Move;\r\n\t\t}\r\n\t\tif (InNodeOverride)\r\n\t\t\tInteractMode = LastMode;\r\n\t\tInNodeOverride = false;\r\n\t\tHoveredEntity = null;\r\n\t\tHoveredInteract = null;\r\n\t\tif (Owner.Isometric) {\r\n\t\t\tvar target = Owner.IsoCamera.MouseTarget();\r\n\t\t\tvar ray = new Ray(target \u002B Owner.IsoCamera.WorldRotation.Backward * 512f, Owner.IsoCamera.WorldRotation.Forward);\r\n\t\t\tif (InteractMode != Mode.Move \u0026\u0026 Owner.Isometric) {\r\n\t\t\t\tvar tr = Scene.Trace.Ray(ray, 2048).UsePhysicsWorld(false).UseHitboxes(true).WithTag(\u0022entity\u0022).Run();\r\n\t\t\t\tif (tr.GameObject.IsValid() \u0026\u0026 tr.GameObject.Components.TryGet\u003CIsoEntity\u003E(out var ent))\r\n\t\t\t\t\tHoveredEntity = ent;\r\n\t\t\t}\r\n\t\t\tif (!HoveredEntity.IsValid()) {\r\n\t\t\t\tvar max = Scene.Trace.Ray(ray, 2048f).WithTag(\u0022block_interactable\u0022).Run().Fraction * 2048;\r\n\t\t\t\tforeach (var interactable in Scene.GetAllComponents\u003CIsoInteractable\u003E()) {\r\n\t\t\t\t\tif (BasePlayer.Local.IsoEntity.Components.Get\u003CNpcMovement\u003E().EntityRoot.Distance(interactable.WorldPosition) \u003E 700)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tif (interactable.Box.Trace(ray.ToLocal(interactable.WorldTransform), max, out var _)) {\r\n\t\t\t\t\t\tHoveredInteract = interactable;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (HoveredInteract.IsValid()) {\r\n\t\t\tLastMode = InteractMode;\r\n\t\t\tInNodeOverride = true;\r\n\t\t\tInteractMode = Mode.Interact;\r\n\t\t}\r\n\t\tif (Input.Pressed(\u0022attack1\u0022) \u0026\u0026 HoveredInteract.IsValid()) {\r\n\t\t\tvar m = BasePlayer.Local.IsoEntity.Components.Get\u003CNpcMovement\u003E();\r\n\t\t\tm.Goal = HoveredInteract.IsoPathGoal.WorldPosition;\r\n\t\t\tm.OnReachTargetPosition = m.Goal;\r\n\t\t\tm.OnReachTarget = HoveredInteract.Interact;\r\n\t\t\tm.Go();\r\n\t\t}\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"iso2/env/HeatSource.cs","FileName":"HeatSource.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class HeatSource : Component {\r\n\tpublic static bool IsWarm(Scene scene, Vector3 position) {\r\n\t\tforeach (var heat in scene.GetAllComponents\u003CHeatSource\u003E()) {\r\n\t\t\tif (heat.WorldPosition.Distance(position) \u003C 130)\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tprotected override void DrawGizmos() {\r\n\t\tGizmo.Draw.Color = Color.Orange;\r\n\t\tGizmo.Draw.LineSphere(0, 130);\r\n\t\tbase.DrawGizmos();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"iso2/env/SpikeField.cs","FileName":"SpikeField.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class SpikeField : Component {\r\n\t[Property] public Vector2 Bounds {get; set;}\r\n\t[Property] public int Density {get; set;} = 15;\r\n\tpublic List\u003CModel\u003E Models {get; set;} = new() {\r\n\t\tModel.Load(\u0022models/props/wasteland/spike_01.vmdl\u0022),\r\n\t\tModel.Load(\u0022models/props/wasteland/spike_02.vmdl\u0022),\r\n\t\tModel.Load(\u0022models/props/wasteland/spike_03.vmdl\u0022),\r\n\t\tModel.Load(\u0022models/props/wasteland/spike_04.vmdl\u0022),\r\n\t\tModel.Load(\u0022models/props/wasteland/spike_05.vmdl\u0022),\r\n\t};\r\n\t[Property, RequireComponent, ReadOnly] public BoxCollider Collider {get; set;}\r\n\r\n\t[Button] public void Generate() {\r\n\t\tforeach (var child in GameObject.Children)\r\n\t\t\tchild.Destroy();\r\n\t\tvar bounds = new Rect(-Bounds * 0.5f, Bounds);\r\n\t\tfor (var x = bounds.Left.FloorToInt(); x \u003C bounds.Right.FloorToInt() \u002B 1; x \u002B= Density) {\r\n\t\t\tfor (var y = bounds.Top.FloorToInt(); y \u003C bounds.Bottom.FloorToInt() \u002B 1; y \u002B= Density) {\r\n\t\t\t\tvar ob = Scene.CreateObject();\r\n\t\t\t\tob.Name = \u0022generated_spike\u0022;\r\n\t\t\t\tob.SetParent(GameObject, false);\r\n\t\t\t\tob.LocalPosition = new Vector3(x, y, WorldPosition.z) \u002B Vector3.Random.WithZ(0f) * Density * 0.5f;\r\n\t\t\t\tob.LocalRotation = Rotation.Random * 0.2f;\r\n\t\t\t\tob.LocalScale = Random.Shared.Float(0.5f, 1.1f);\r\n\t\t\t\tob.Components.Create\u003CModelRenderer\u003E().Model = Random.Shared.FromList(Models);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected override void DrawGizmos() {\r\n\t\tCollider.Static = true;\r\n\t\tCollider.Scale = new Vector3(Bounds.x \u002B Density * 0.5f, Bounds.y \u002B Density * 0.5f, 32);\r\n\t\tCollider.Center = new Vector3(-Density).WithZ(0f) * 0.5f;\r\n\t\tbase.DrawGizmos();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"iso2/scene/EnableFoliage.cs","FileName":"EnableFoliage.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class EnableFoliage : Component, Component.ExecuteInEditor {\r\n\t[Property] public bool Foliage {get; set;}\r\n\tprotected override void OnUpdate() {\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_ALLOW_FOLIAGE\u0022, Foliage);\r\n\t\tbase.OnUpdate();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/iso/IsoWaypoint.cs","FileName":"IsoWaypoint.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class IsoWaypoint : Component {\r\n\t[Property] public ModelRenderer Inner {get; set;}\r\n\t[Property] public ModelRenderer Outer {get; set;}\r\n\r\n\tprotected override void OnAwake() {\r\n\t\tGameObject.Name = \u0022PLAYER_0_ISO_WAYPOINT\u0022;\r\n\t\tTags.Add(\u0022iso_waypoint\u0022);\r\n\t\tTags.Add(\u0022no_depth\u0022);\r\n\t\tInner = Components.Create\u003CModelRenderer\u003E();\r\n\t\tInner.Model = Model.Load(\u0022models/interface/waypoint_inner.vmdl\u0022);\r\n\t\tOuter = Components.Create\u003CModelRenderer\u003E();\r\n\t\tOuter.Model = Model.Load(\u0022models/interface/waypoint_glow.vmdl\u0022);\r\n\t\tbase.OnAwake();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/lighting/LightingRigs.cs","FileName":"LightingRigs.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class LightingRigs : Component {\r\n\t[Property, ReadOnly] public EntityShadows EntityShadows {get; set;}\r\n\t[Property, ReadOnly] public AlphaZeroDepthFloor AlphaZeroDepthFloor {get; set;}\r\n\r\n\tprotected override void OnAwake() {\r\n\t\tGameObject.Name = \u0022LIGHTING_RIGS\u0022;\r\n\t\tEntityShadows = Scene.CreateObject().Components.Create\u003CEntityShadows\u003E();\r\n\t\tEntityShadows.GameObject.SetParent(GameObject);\r\n\t\tAlphaZeroDepthFloor = Scene.CreateObject().Components.Create\u003CAlphaZeroDepthFloor\u003E();\r\n\t\tAlphaZeroDepthFloor.GameObject.SetParent(GameObject);\r\n\t\tbase.OnAwake();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/npc/NpcAnimator.cs","FileName":"NpcAnimator.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class NpcAnimator : Component {\r\n\t[Property, ReadOnly] public IsoEntity Owner {get; set;}\r\n\r\n\tpublic IsoActivitySet ActivitySet =\u003E Owner.ActivitySet;\r\n\tprivate SkinnedModelRenderer Renderer =\u003E Owner.Renderer;\r\n\t[Property] public string Weapon {get; set;} = \u0022unarmed\u0022;\r\n\t[Property] public string Activity {get; set;}\r\n\tpublic Action AttackAction {get; set;}\r\n\r\n\tprotected override void OnAwake() {\r\n\t\tTags.Add(\u0022dynamic\u0022);\r\n\t\tTags.Add(\u0022entity\u0022);\r\n\t\tif (ActivitySet.IsValid() \u0026\u0026 string.IsNullOrEmpty(Activity))\r\n\t\t\tActivity = ActivitySet.Default;\r\n\t\tbase.OnAwake();\r\n\t}\r\n\r\n\tprotected override void OnFixedUpdate() {\r\n\t\tUpdateAnimation();\r\n\t\tbase.OnFixedUpdate();\r\n\t}\r\n\r\n\t[Button] public void ResetToIdle() {\r\n\t\tAnimationState = AnimatorState.Idle;\r\n\t\tRenderer.Sequence.TimeNormalized = 1f;\r\n\t\tUpdateAnimation();\r\n\t}\r\n\r\n\tprivate enum AnimatorState {\r\n\t\tEnter,\r\n\t\tWaitForEnter,\r\n\t\tIdle,\r\n\t\tExit\r\n\t}\r\n\t[Property, Category(\u0022anm\u0022), ReadOnly] private AnimatorState AnimationState {get; set;}\r\n\t[Property, Category(\u0022anm\u0022), ReadOnly] private string CurrentActivity;\r\n\t[Property, ReadOnly] public List\u003CComponent\u003E Attached {get; set;} = new();\r\n\t[Property, ReadOnly] public bool PlayedAttackEvent {get; set;}\r\n\tpublic void UpdateAnimation() {\r\n\t\tvoid InternalUpdate() {\r\n\t\t\tif (!ActivitySet.IsValid())\r\n\t\t\t\treturn;\r\n\t\t\tRenderer.UseAnimGraph = false;\r\n\t\t\tRenderer.Sequence.Looping = false;\r\n\t\t\tvar lastactivity = CurrentActivity;\r\n\t\t\tif (!string.IsNullOrEmpty(Activity) \u0026\u0026 ActivitySet.WeaponActivityMap.TryGetValue(Weapon, out var map)) {\r\n\t\t\t\tif (map.Map.TryGetValue(Activity, out var newactivity))\r\n\t\t\t\t\tActivity = newactivity;\r\n\t\t\t}\r\n\t\t\tif (ActivitySet.Activities.ContainsKey(Activity))\r\n\t\t\t\tCurrentActivity = Activity;\r\n\t\t\tif (string.IsNullOrEmpty(CurrentActivity))\r\n\t\t\t\tCurrentActivity = ActivitySet.Default;\r\n\t\t\tif (string.IsNullOrEmpty(CurrentActivity))\r\n\t\t\t\treturn;\r\n\t\t\tif (lastactivity != CurrentActivity) {\r\n\t\t\t\tif (lastactivity == \u0022die\u0022)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tif (AnimationState == AnimatorState.WaitForEnter || AnimationState == AnimatorState.Idle)\r\n\t\t\t\t\tAnimationState = AnimatorState.Exit;\r\n\t\t\t\telse if(!string.IsNullOrEmpty(lastactivity))\r\n\t\t\t\t\tCurrentActivity = lastactivity;\r\n\t\t\t}\r\n\r\n\t\t\tif (AnimationState == AnimatorState.Enter) { //entry\r\n\t\t\t\tif (Renderer.Sequence.Duration \u003E 0 \u0026\u0026 !Renderer.Sequence.IsFinished)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tif (!string.IsNullOrEmpty(ActivitySet.Activities[CurrentActivity].Entry))\r\n\t\t\t\t\tRenderer.Sequence.Name = ActivitySet.Activities[CurrentActivity].Entry;\r\n\t\t\t\tAnimationState = AnimatorState.WaitForEnter;\r\n\t\t\t}\r\n\t\t\tif (AnimationState == AnimatorState.WaitForEnter || AnimationState == AnimatorState.Idle) { //idle\r\n\t\t\t\tif (Renderer.Sequence.Duration \u003E 0 \u0026\u0026 !Renderer.Sequence.IsFinished)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tAnimationState = AnimatorState.Idle;\r\n\t\t\t\tvar act = ActivitySet.Activities[CurrentActivity].Idle;\r\n\t\t\t\tif ((string.IsNullOrEmpty(act) || Random.Shared.Int(3) == 1) \u0026\u0026 ActivitySet.Activities[CurrentActivity].Fidget.Count \u003E 0)\r\n\t\t\t\t\tact = Random.Shared.FromList(ActivitySet.Activities[CurrentActivity].Fidget);\r\n\t\t\t\tif (!string.IsNullOrEmpty(act))\r\n\t\t\t\t\tRenderer.Sequence.Name = act;\r\n\t\t\t\telse\r\n\t\t\t\t\tAnimationState = AnimatorState.Exit;\r\n\t\t\t}\r\n\t\t\tif (AnimationState == AnimatorState.Exit) { //exit\r\n\t\t\t\tif (lastactivity == CurrentActivity)\r\n\t\t\t\t\tAnimationState = AnimatorState.Enter;\r\n\t\t\t\tif (string.IsNullOrEmpty(lastactivity))\r\n\t\t\t\t\tAnimationState = AnimatorState.Enter;\r\n\t\t\t\telse if (!string.IsNullOrEmpty(ActivitySet.Activities[lastactivity].Exit))\r\n\t\t\t\t\tRenderer.Sequence.Name = ActivitySet.Activities[lastactivity].Exit;\r\n\t\t\t\telse\r\n\t\t\t\t\tRenderer.Sequence.TimeNormalized = 1;\r\n\t\t\t\tif (!string.IsNullOrEmpty(lastactivity) \u0026\u0026 !string.IsNullOrEmpty(ActivitySet.Activities[lastactivity].ReturnToActivity))\r\n\t\t\t\t\tActivity = ActivitySet.Activities[lastactivity].ReturnToActivity;\r\n\t\t\t\tAnimationState = AnimatorState.Enter;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar startcycle = Renderer.Sequence.TimeNormalized;\r\n\t\tvar startsequence = Renderer.Sequence.Name;\r\n\t\tvar startact = CurrentActivity;\r\n\t\tInternalUpdate();\r\n\t\tif (startcycle \u003C= Renderer.Sequence.TimeNormalized) {\r\n\t\t\tif (string.IsNullOrEmpty(startact))\r\n\t\t\t\treturn;\r\n\t\t\tif (startact != CurrentActivity)\r\n\t\t\t\treturn;\r\n\t\t\tif (ActivitySet.DeathActivies.Contains(CurrentActivity)) {\r\n\t\t\t\tComponents.Get\u003CNpcMovement\u003E()?.Destroy();\r\n\t\t\t\tComponents.Get\u003CNpcTalker\u003E()?.Destroy();\r\n\t\t\t\tComponents.Get\u003CBoxCollider\u003E()?.Destroy();\r\n\t\t\t\tvar blood = Owner.Renderer.GetAttachment(\u0022blood\u0022);\r\n\t\t\t\tif (blood.HasValue) {\r\n\t\t\t\t\tvar pool = Scene.CreateObject().Components.Create\u003CBloodPool\u003E();\r\n\t\t\t\t\tpool.GameObject.WorldTransform = blood.Value;\r\n\t\t\t\t\tpool.GameObject.Name = \u0022BLOOD_POOL\u0022;\r\n\t\t\t\t}\r\n\t\t\t\tOwner.Destroy();\r\n\t\t\t\tRenderer.Sequence.Name = ActivitySet.Activities[CurrentActivity].Entry;\r\n\t\t\t\tDestroy();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!PlayedAttackEvent \u0026\u0026 ActivitySet.AttackEvents.TryGetValue(startact, out var time) \u0026\u0026 time \u003C= Renderer.Sequence.Time) {\r\n\t\t\t\tAttackAction?.Invoke();\r\n\t\t\t\tPlayedAttackEvent = true;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tPlayedAttackEvent = false;\r\n\t\tforeach (var attached in Attached)\r\n\t\t\tattached.Destroy();\r\n\t\tAttached.Clear();\r\n\t\tif (ActivitySet.ActivityAttachments.TryGetValue(CurrentActivity, out var attachments)) {\r\n\t\t\tRenderer.CreateAttachments = true;\r\n\t\t\tforeach (var model in attachments.Models) {\r\n\t\t\t\tvar smr = Renderer.GetAttachmentObject(model.Key).Components.Create\u003CSkinnedModelRenderer\u003E();\r\n\t\t\t\tsmr.Model = model.Value;\r\n\t\t\t\tAttached.Add(smr);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (ActivitySet.SequenceRootMotion.TryGetValue(startsequence, out var motion)) {\r\n\t\t\tif (startcycle \u003E 0.9f)\r\n\t\t\t\tWorldPosition \u002B= motion.RotateAround(Vector3.Zero, WorldRotation);\r\n\t\t\telse\r\n\t\t\t\tWorldPosition \u002B= motion.RotateAround(Vector3.Zero, WorldRotation) * startcycle;\r\n\t\t\tvar m = Components.Get\u003CNpcMovement\u003E();\r\n\t\t\tif (m.IsValid())\r\n\t\t\t\tm.EntityRoot = WorldPosition;\r\n\t\t\tGameObject.Transform.ClearInterpolation();\r\n\t\t}\r\n\t}\r\n}\r\n\r\n[GameResource(\u0022Activity Set\u0022, \u0022anm\u0022, \u0022\u0022, Icon = \u0022sports_martial_arts\u0022)]\r\npublic class IsoActivitySet : GameResource {\r\n\tpublic struct Activity {\r\n\t\tpublic string Entry {get; set;}\r\n\t\tpublic string Idle {get; set;}\r\n\t\tpublic List\u003Cstring\u003E Fidget {get; set;}\r\n\t\tpublic string Exit {get; set;}\r\n\t\tpublic string ReturnToActivity {get; set;}\r\n\t}\r\n\t[WideMode, InlineEditor] public Dictionary\u003Cstring, Activity\u003E Activities {get; set;} = new();\r\n\tpublic string Default {get; set;}\r\n\tpublic struct WeaponActivities {\r\n\t\tpublic Dictionary\u003Cstring, string\u003E Map {get; set;}\r\n\t}\r\n\t[WideMode, InlineEditor] public Dictionary\u003Cstring, WeaponActivities\u003E WeaponActivityMap {get; set;} = new();\r\n\tpublic struct Attachments {\r\n\t\t[WideMode] public Dictionary\u003Cstring, Model\u003E Models {get; set;}\r\n\t}\r\n\t[WideMode, InlineEditor] public Dictionary\u003Cstring, Attachments\u003E ActivityAttachments {get; set;} = new();\r\n\t[WideMode] public Dictionary\u003Cstring, Vector3\u003E SequenceRootMotion {get; set;} = new();\r\n\tpublic List\u003Cstring\u003E NonInteruptActivities {get; set;} = new();\r\n\tpublic List\u003Cstring\u003E DeathActivies {get; set;} = new();\r\n\t[WideMode] public Dictionary\u003Cstring, float\u003E AttackEvents {get; set;} = new();\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/player/PlayerInventory.cs","FileName":"PlayerInventory.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"using Sandbox.UI;\r\n\r\npublic class PlayerInventory : Component {\r\n\t[Property, ReadOnly] public BasePlayer Owner {get; set;}\r\n\tpublic enum Slot {\r\n\t\tUnarmed,\r\n\t\tPrimary,\r\n\t}\r\n\t[Property] public Slot ActiveSlot {get; set;} = Slot.Primary;\r\n\t[Property, ReadOnly] public Texture Interface {get; set;} = Texture.CreateRenderTarget().WithUAVBinding().WithSize(384,166).Create();\r\n\tpublic enum WeaponMode {\r\n\t\tSingle,\r\n\t\tReload,\r\n\t}\r\n\t[Property] public WeaponMode Mode {get; set;} = WeaponMode.Single;\r\n\t[Property, ReadOnly] public Dictionary\u003CSlot, string\u003E Equipped {get; set;} = new() {{Slot.Unarmed, \u0022unarmed\u0022}, {Slot.Primary, \u00221887\u0022}};\r\n\t[Property, ReadOnly] public Dictionary\u003Cstring, int\u003E AmmoLoaded {get; set;} = new() {{\u0022unarmed\u0022, 0}, {\u00221887\u0022, 6}};\r\n\t[Property, Range(-20,20)] public float Temperature {get; set;} = 20;\r\n\r\n\tprivate TimeUntil FreezeDialougeCooldown;\r\n\tprivate TimeUntil NextFreezeDamage;\r\n\tpublic bool NeedToResetFiringMode;\r\n\tpublic PlayerMouse.Mode LastMode;\r\n\tprotected override void OnFixedUpdate() {\r\n\t\tvar a = Owner.IsoEntity.Components.Get\u003CNpcAnimator\u003E();\r\n\t\tvar m = Owner.IsoEntity.Components.Get\u003CNpcMovement\u003E();\r\n\t\tif (!a.IsValid() || !m.IsValid())\r\n\t\t\treturn;\r\n\t\t//none of the temeperature or damage logic should be here but FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU\r\n\t\tif (!Owner.Isometric)\r\n\t\t\tTemperature = Math.Max(Temperature.Approach(20, Time.Delta * 5), Temperature);\r\n\t\telse if (HeatSource.IsWarm(Scene, Grid.Snap(m.EntityRoot)))\r\n\t\t\tTemperature = Temperature.Approach(20, Time.Delta * (Temperature \u003E 10 ? 0.3f : 1));\r\n\t\telse {\r\n\t\t\tTemperature = Temperature.Approach(-20, Time.Delta * (m.Run \u0026\u0026 m.Path.Count \u003E 0 ? 1.3f : 0.5f));\r\n\t\t}\r\n\t\tif (FreezeDialougeCooldown \u0026\u0026 Temperature \u003C -12 \u0026\u0026 !HeatSource.IsWarm(Scene, Grid.Snap(m.EntityRoot))) {\r\n\t\t\tFreezeDialougeCooldown = 15f;\r\n\t\t\tOwner.IsoEntity.Components.GetOrCreate\u003CNpcTalker\u003E().Speak(Random.Shared.FromList(Owner.IsoEntity.TalkerScript.Freezing), 6);\r\n\t\t}\r\n\t\tif (NextFreezeDamage \u0026\u0026 Temperature \u003C -15) {\r\n\t\t\tOwner.IsoEntity.Health -= Random.Shared.Int(1,3);\r\n\t\t\tif (Owner.IsoEntity.Health \u003E 0 \u0026\u0026 !a.ActivitySet.NonInteruptActivities.Contains(a.Activity))\r\n\t\t\t\ta.Activity = \u0022flinch\u0022;\r\n\t\t\tNextFreezeDamage = 3f;\r\n\t\t}\r\n\t\tif (Owner.IsoEntity.Health \u003C= 0) {\r\n\t\t\ta.Activity = \u0022die\u0022;\r\n\t\t\tScene.GetAllComponents\u003CPlayerDeath\u003E().FirstOrDefault()?.Dead();\r\n\t\t}\r\n\t\tif (Input.Pressed(\u0022attack1\u0022) \u0026\u0026 Owner.Mouse.TargetButton == PlayerMouse.Button.Swap) {\r\n\t\t\tSound.Play(\u0022sounds/interface/press_button.sound\u0022);\r\n\t\t\tif (ActiveSlot == Slot.Primary)\r\n\t\t\t\tActiveSlot = Slot.Unarmed;\r\n\t\t\telse if (ActiveSlot == Slot.Unarmed)\r\n\t\t\t\tActiveSlot = Slot.Primary;\r\n\t\t\tif (Equipped[ActiveSlot] == \u00221887\u0022) {\r\n\t\t\t\tm.Path.Clear();\r\n\t\t\t\tif (!a.ActivitySet.NonInteruptActivities.Contains(a.Activity))\r\n\t\t\t\t\ta.Activity = \u00221887_draw\u0022;\r\n\t\t\t}\r\n\t\t\tMode = WeaponMode.Single;\r\n\t\t}\r\n\t\tif (Input.Pressed(\u0022attack2\u0022) \u0026\u0026 Owner.Mouse.TargetButton == PlayerMouse.Button.Weapon) {\r\n\t\t\tSound.Play(\u0022sounds/interface/press_button.sound\u0022);\r\n\t\t\tif (Mode == WeaponMode.Reload)\r\n\t\t\t\tMode = WeaponMode.Single;\r\n\t\t\telse\r\n\t\t\t\tMode = (WeaponMode)((int)Mode \u002B 1);\r\n\t\t}\r\n\t\tif (Input.Pressed(\u0022attack1\u0022) \u0026\u0026 Owner.Mouse.TargetButton == PlayerMouse.Button.Weapon) {\r\n\t\t\tif (Mode == WeaponMode.Reload) {\r\n\t\t\t\tif (!Reload(Equipped[ActiveSlot]))\r\n\t\t\t\t\tSound.Play(\u0022sounds/interface/press_button.sound\u0022);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tSound.Play(\u0022sounds/interface/press_button.sound\u0022);\r\n\t\t\tif (ActiveSlot == Slot.Unarmed)\r\n\t\t\t\treturn;\r\n\t\t\tif (AmmoLoaded[Equipped[ActiveSlot]] \u003C= 0)\r\n\t\t\t\tMode = WeaponMode.Reload;\r\n\t\t\telse {\r\n\t\t\t\tLastMode = Owner.Mouse.InteractMode;\r\n\t\t\t\tOwner.Mouse.InteractMode = PlayerMouse.Mode.Shoot;\r\n\t\t\t\t//NeedToResetFiringMode = LastMode != PlayerMouse.Mode.Shoot;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Input.Pressed(\u0022attack1\u0022) \u0026\u0026 Owner.Mouse.TargetLayer != PlayerMouse.Layer.Interface \u0026\u0026 Owner.Mouse.InteractMode == PlayerMouse.Mode.Shoot) {\r\n\t\t\tif (NeedToResetFiringMode)\r\n\t\t\t\tOwner.Mouse.InteractMode = LastMode;\r\n\t\t\tNeedToResetFiringMode = false;\r\n\t\t\tif (ActiveSlot == Slot.Unarmed)\r\n\t\t\t\treturn;\r\n\t\t\tif (Mode == WeaponMode.Reload) {\r\n\t\t\t\tReload(Equipped[ActiveSlot]);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (Owner.Mouse.HoveredEntity == Owner.IsoEntity)\r\n\t\t\t\treturn;\r\n\t\t\tif (m.Path.Count \u003E 0) {\r\n\t\t\t\tm.Path.Clear();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (a.ActivitySet.NonInteruptActivities.Contains(a.Activity))\r\n\t\t\t\treturn;\r\n\t\t\tif (AmmoLoaded[Equipped[ActiveSlot]] \u003C= 0)\r\n\t\t\t\tShoot(Equipped[ActiveSlot], Owner.Mouse.HoveredEntity);\r\n\t\t\telse {\r\n\t\t\t\tvar pos = Owner.IsoCamera.MouseTarget();\r\n\t\t\t\tif (Owner.Mouse.HoveredEntity.IsValid()) {\r\n\t\t\t\t\tpos = Owner.Mouse.HoveredEntity.WorldPosition;\r\n\t\t\t\t\tif (Owner.Mouse.HoveredEntity.Components.TryGet\u003CNpcMovement\u003E(out var hm))\r\n\t\t\t\t\t\tpos = hm.EntityRoot;\r\n\t\t\t\t}\r\n\t\t\t\tpos = Grid.Snap(pos);\r\n\t\t\t\tvar best = -1f;\r\n\t\t\t\tvar angle = Rotation.Identity;\r\n\t\t\t\tfor (int i = 0; i \u003C 6; i\u002B\u002B) {\r\n\t\t\t\t\tvar canidate = Grid.Snap(m.EntityRoot \u002B Rotation.FromYaw(i * 60f - 30f).Forward * 30f);\r\n\t\t\t\t\tvar dot = Vector3.Direction(m.EntityRoot, canidate).Dot(Vector3.Direction(m.EntityRoot, pos));\r\n\t\t\t\t\tif (dot \u003C best)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tangle = Rotation.FromYaw(i * 60f - 30f);\r\n\t\t\t\t\tbest = dot;\r\n\t\t\t\t}\r\n\t\t\t\tOwner.IsoEntity.WorldRotation = angle;\r\n\t\t\t\tOwner.IsoEntity.SnapToGrid();\r\n\t\t\t\tOwner.IsoEntity.Transform.ClearInterpolation();\r\n\t\t\t\tvar ent = Owner.Mouse.HoveredEntity;\r\n\t\t\t\ta.AttackAction = () =\u003E Shoot(Equipped[ActiveSlot], ent);\r\n\t\t\t\tif (a.Activity != \u0022die\u0022)\r\n\t\t\t\t\ta.Activity = \u00221887_fire\u0022\u002BRandom.Shared.Int(1,3);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRenderInterface();\r\n\t\tOwner.IsoEntity.Components.Get\u003CNpcAnimator\u003E().Weapon = Equipped[ActiveSlot];\r\n\t\tbase.OnFixedUpdate();\r\n\t}\r\n\r\n\tpublic bool Reload(string weapon) {\r\n\t\tvar max = 0;\r\n\t\tif (weapon == \u00221887\u0022)\r\n\t\t\tmax = 6;\r\n\t\t//if (AmmoLoaded[weapon] == 0)\r\n\t\t//\tmax = Math.Max(max - 1, 0);\r\n\t\tif (AmmoLoaded[weapon] \u003E= max)\r\n\t\t\treturn false;\r\n\t\tAmmoLoaded[weapon] = max;\r\n\t\tSound.Play(\u0022sounds/weapons/1887_reload.sound\u0022);\r\n\t\tMode = WeaponMode.Single;\r\n\t\treturn true;\r\n\t}\r\n\r\n\tprivate TimeUntil NextFire;\r\n\tprivate TimeUntil WarnAmmo;\r\n\tpublic void Shoot(string weapon, IsoEntity target) {\r\n\t\tif (!NextFire)\r\n\t\t\treturn;\r\n\t\tNextFire = 0.5f;\r\n\t\tif (AmmoLoaded[weapon] \u003C= 0) {\r\n\t\t\tWarnAmmo = 1f;\r\n\t\t\tSound.Play(\u0022sounds/weapons/dry_fire.sound\u0022);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tAmmoLoaded[weapon]--;\r\n\t\tSound.Play(\u0022sounds/weapons/1887_fire.sound\u0022);\r\n\t\tif (target.IsValid()) {\r\n\t\t\tif (target.WorldPosition.Distance(Owner.IsoEntity.WorldPosition) \u003E 600)\r\n\t\t\t\treturn;\r\n\t\t\tif (target.WorldPosition.Distance(Owner.IsoEntity.WorldPosition) \u003E 200)\r\n\t\t\t\ttarget.Health -= Random.Shared.Int(20,30);\r\n\t\t\telse\r\n\t\t\t\ttarget.Health -= Random.Shared.Int(30,60);\r\n\t\t\tif (target.Components.TryGet\u003CNpcAnimator\u003E(out var a)) {\r\n\t\t\t\tif (target.Health \u003E 0)\r\n\t\t\t\t\ta.Activity = \u0022flinch\u0022;\r\n\t\t\t\telse\r\n\t\t\t\t\ta.Activity = \u0022die\u0022;\r\n\t\t\t}\r\n\t\t\tif (target.Components.TryGet\u003CNpcWolfBrain\u003E(out var br)) {\r\n\t\t\t\tbr.ExitCombat = 5f;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic void RenderInterface() {\r\n\t\tvar shader = new ComputeShader(\u0022shaders/cs_interface_draw.shader\u0022);\r\n\t\tshader.Attributes.Set(\u0022Base\u0022, Texture.Load(\u0022materials/interface/interface_base.vtex\u0022));\r\n\t\tif (!WarnAmmo \u0026\u0026 AmmoLoaded[Equipped[ActiveSlot]] \u003C= 0 \u0026\u0026 MathF.Sin(WarnAmmo.Relative * 15) \u003E 0f)\r\n\t\t\tshader.Attributes.Set(\u0022Ammo\u0022, Texture.Load(\u0022materials/interface/interface_ammo_error.vtex\u0022));\r\n\t\telse\r\n\t\t\tshader.Attributes.Set(\u0022Ammo\u0022, Texture.Load(\u0022materials/interface/interface_ammo_\u0022\u002BAmmoLoaded[Equipped[ActiveSlot]]\u002B\u0022.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022Swap\u0022, Texture.Load(\u0022materials/interface/interface_swap_base.vtex\u0022));\r\n\t\tif (Temperature \u003C -12 \u0026\u0026 MathF.Sin(Time.Now * 15) \u003E 0f)\r\n\t\t\tshader.Attributes.Set(\u0022Temp\u0022, Texture.Load(\u0022materials/interface/interface_temp_on.vtex\u0022));\r\n\t\telse\r\n\t\t\tshader.Attributes.Set(\u0022Temp\u0022, Texture.Load(\u0022materials/interface/interface_temp_off.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022Thermo0\u0022, Texture.Load(\u0022materials/interface/interface_thermometer_empty.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022Thermo1\u0022, Texture.Load(\u0022materials/interface/interface_thermometer_full.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022ThermoFill\u0022, Temperature.Remap(-20f, 20f, 0.53f, 0.94f));\r\n\t\tshader.Attributes.Set(\u0022Unarmed\u0022, Equipped[ActiveSlot] == \u0022unarmed\u0022);\r\n\t\tif (Mode == WeaponMode.Single)\r\n\t\t\tshader.Attributes.Set(\u0022WeapAp\u0022, Texture.Load(\u0022materials/interface/interface_weapon_ap_3.vtex\u0022));\r\n\t\telse if (Mode == WeaponMode.Reload)\r\n\t\t\tshader.Attributes.Set(\u0022WeapAp\u0022, Texture.Load(\u0022materials/interface/interface_weapon_ap_2.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022WeapBase\u0022, Texture.Load(\u0022materials/interface/interface_weapon_base.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022WeapIcon\u0022, Texture.Load(\u0022materials/interface/interface_weapon_icon_1887.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022WeapMode\u0022, Texture.Load(\u0022materials/interface/interface_weapon_mode_\u0022\u002BMode.ToString().ToLower()\u002B\u0022.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022WeapSlot\u0022, Texture.Load(\u0022materials/interface/interface_weapon_slot_primary.vtex\u0022));\r\n\t\tvar text = new Bitmap(384,166);\r\n\t\ttext.DrawText(new() {\r\n\t\t\tText = Owner.IsoEntity.Health.Clamp(0,100).ToString(\u0022000\u0022),\r\n\t\t\tTextColor = Owner.IsoEntity.Health \u003E 10 ? Color.Green.Darken(0.3f) : Color.Red,\r\n\t\t\tFontSize = 12,\r\n\t\t}, new(new(34f,47), 80), TextFlag.LeftTop);\r\n\t\ttext.DrawText(new() {\r\n\t\t\tText = \u0022ERR\u0022,\r\n\t\t\tTextColor = Color.Red.Darken(0.5f),\r\n\t\t\tFontSize = 12,\r\n\t\t}, new(new(34f,71), 80), TextFlag.LeftTop);\r\n\t\tshader.Attributes.Set(\u0022Text\u0022, text.ToTexture());\r\n\t\tshader.Attributes.Set(\u0022RenderSize\u0022, Interface.Size);\r\n\t\tshader.Attributes.Set(\u0022Result\u0022, Interface);\r\n\t\tshader.Dispatch(Interface.Width, Interface.Height, 1);\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/player/PlayerIsoCamera.cs","FileName":"PlayerIsoCamera.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"using Sandbox.Rendering;\r\n\r\npublic class PlayerIsoCamera : Component {\r\n\t[Property, ReadOnly] public BasePlayer Owner {get; set;}\r\n\r\n\t[Property, ReadOnly] public Vector2Int RenderSize {get; set;} = new(640,480);\r\n\t[Property, ReadOnly] public CameraComponent RenderCamera {get; set;}\r\n\t[Property, ReadOnly] public CameraComponent DrawCamera {get; set;}\r\n\t[Property, ReadOnly] public LightingRigs Lighting {get; set;}\r\n\t[Property, ReadOnly] public Vector2 DitherOffset {get; set;}\r\n\t[Property, ReadOnly] public Texture Background {get; set;}\r\n\t[Property, ReadOnly] public Texture BackgroundDepth {get; set;}\r\n\t[Property, ReadOnly] public Texture EntityShadow {get; set;}\r\n\t[Property, ReadOnly] public Texture EntityShadowDepth {get; set;}\r\n\t[Property, ReadOnly] public Texture EntityLighting {get; set;}\r\n\t[Property, ReadOnly] public Texture WorldText {get; set;}\r\n\t[Property, ReadOnly] public Texture Mask {get; set;}\r\n\t[Property, ReadOnly] public Texture Composite {get; set;}\r\n\t[Property, ReadOnly] public Texture Snow {get; set;}\r\n\t[Property, ReadOnly] public Texture Waypoint {get; set;}\r\n\t[Property, ReadOnly] public Texture WaypointMask {get; set;}\r\n\t[Property, ReadOnly] public Texture Final {get; set;}\r\n\r\n\tprotected override void OnAwake() {\r\n\t\tLocalRotation = Rotation.FromYaw(60f) * Rotation.FromPitch(30f);\r\n\t\tLocalPosition = LocalRotation. Backward * 1024f;\r\n\r\n\t\tLighting = Scene.CreateObject().Components.Create\u003CLightingRigs\u003E();\r\n\r\n\t\tSpawn.SetOwner(this);\r\n\t\tSpawn.Component(nameof(RenderCamera));\r\n\t\tRenderCamera.Orthographic = true;\r\n\t\tRenderCamera.BackgroundColor = Color.Black;\r\n\t\tRenderCamera.ZFar = 2048;\r\n\t\tSpawn.Component(nameof(DrawCamera));\r\n\t\tDrawCamera.RenderTags.Add(\u0022null\u0022);\r\n\t\tDrawCamera.BackgroundColor = Color.Black;\r\n\t\tDrawCamera.Priority = 1000;\r\n\t\tbase.OnAwake();\r\n\t}\r\n\r\n\tpublic Vector2 PointToRenderPixels(Vector3 point) {\r\n\t\tvar uv = RenderCamera.PointToScreenNormal(point);\r\n\t\tuv -= 0.5f;\r\n\t\tuv /= RenderSize / Screen.Size;\r\n\t\tuv \u002B= 0.5f;\r\n\t\tuv *= RenderSize;\r\n\t\tuv.x = uv.x.Floor();\r\n\t\tuv.y = uv.y.Floor();\r\n\t\treturn uv;\r\n\t}\r\n\r\n\tpublic Vector3 MouseTarget() =\u003E ScreenPixelsToPoint(Mouse.Position);\r\n\tpublic Vector3 ScreenPixelsToPoint(Vector2 position) {\r\n\t\tvar uv = position / Screen.Size;\r\n\t\tuv -= 0.5f;\r\n\t\tuv *= RenderSize / Screen.Size;\r\n\t\tuv.x *= Screen.Aspect;\r\n\t\tuv.x /= (float)RenderSize.x / RenderSize.y;\r\n\t\tuv \u002B= 0.5f;\r\n\t\treturn new Plane(Vector3.Zero, Vector3.Up).Trace(RenderCamera.ScreenNormalToRay(uv)).Value;\r\n\t}\r\n\r\n\tprivate TimeUntil NextFullRender = 0;\r\n\tpublic void Update() {\r\n\t\tUpdateZoom();\r\n\t\tResetTextures();\r\n\t\tMouse.Visibility = MouseVisibility.Visible;\r\n\t\tif (Owner.Mouse.InteractMode == PlayerMouse.Mode.Move \u0026\u0026 Owner.Mouse.TargetLayer != PlayerMouse.Layer.Interface)\r\n\t\t\tMouse.CursorType = \u0022None\u0022;\r\n\t\telse if (Owner.Mouse.InteractMode == PlayerMouse.Mode.Shoot)\r\n\t\t\tMouse.CursorType = \u0022iso2_crosshair\u0022;\r\n\t\telse\r\n\t\t\tMouse.CursorType = \u0022iso2_pointer\u0022;\r\n\t\tUpdateMouseDrag();\r\n\t\tif (NextFullRender)\r\n\t\t\tFullRender();\r\n\t\tInterfaceRender();\r\n\t}\r\n\r\n\t[Property] public float ZoomScale {get; set;} = 0.25f;\r\n\tprivate void UpdateZoom() {\r\n\t\tif (Input.MouseWheel.y == 0)\r\n\t\t\treturn;\r\n\t\tvar startscale = ZoomScale;\r\n\t\tif (Input.MouseWheel.y \u003E 0)\r\n\t\t\tZoomScale /= 2f;\r\n\t\telse\r\n\t\t\tZoomScale *= 2f;\r\n\t\tZoomScale = ZoomScale.Clamp(0.25f, 0.5f);\r\n\t\tif (startscale != ZoomScale) {\r\n\t\t\tLastSize = Vector2.Zero;\r\n\t\t\tNextFullRender = 0f;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate bool IsDragging = false;\r\n\tprivate Vector3 StartPosition;\r\n\tprivate Vector2 MouseStart;\r\n\tprivate Vector2 DitherStart;\r\n\tprivate void UpdateMouseDrag() {\r\n\t\tif (!IsDragging \u0026\u0026 Input.Pressed(\u0022drag_camera\u0022)) {\r\n\t\t\tIsDragging = true;\r\n\t\t\tStartPosition = Owner.WorldPosition;\r\n\t\t\tDitherStart = DitherOffset;\r\n\t\t\tMouseStart = Mouse.Position;\r\n\t\t}\r\n\t\tif (IsDragging \u0026\u0026 Input.Released(\u0022drag_camera\u0022))\r\n\t\t\tIsDragging = false;\r\n\t\tif (IsDragging) {\r\n\t\t\tvar mouse = ((Mouse.Position - MouseStart) * (RenderSize / Screen.Size)).SnapToGrid(1);\r\n\t\t\tvar delta = ScreenPixelsToPoint(mouse) - ScreenPixelsToPoint(0);\r\n\t\t\tdelta *= new Vector3(Screen.Size / RenderSize, 0f);\r\n\t\t\tOwner.WorldPosition = StartPosition - delta;\r\n\t\t\tDitherOffset = DitherStart - mouse;\r\n\t\t\tif (!mouse.IsNearZeroLength)\r\n\t\t\t\tFullRender();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate Vector2 LastSize = Vector2.Zero;\r\n\tprivate void ResetTextures() {\r\n\t\tif (LastSize == Screen.Size)\r\n\t\t\treturn;\r\n\t\tLastSize = Screen.Size;\r\n\t\tRenderSize = (Vector2Int)(Screen.Size * ZoomScale);\r\n\r\n\t\tBackground?.Dispose();\r\n\t\tBackground = Texture.CreateRenderTarget().WithSize(RenderSize).Create();\r\n\t\tBackgroundDepth?.Dispose();\r\n\t\tBackgroundDepth = Texture.CreateRenderTarget().WithSize(RenderSize).WithFormat(ImageFormat.RGBA32323232F).Create();\r\n\t\tEntityShadow?.Dispose();\r\n\t\tEntityShadow = Texture.CreateRenderTarget().WithSize(RenderSize).Create();\r\n\t\tEntityShadowDepth?.Dispose();\r\n\t\tEntityShadowDepth = Texture.CreateRenderTarget().WithSize(RenderSize).WithFormat(ImageFormat.RGBA32323232F).Create();\r\n\t\tEntityLighting?.Dispose();\r\n\t\tEntityLighting = Texture.CreateRenderTarget().WithSize(RenderSize).Create();\r\n\t\tComposite?.Dispose();\r\n\t\tComposite = Texture.CreateRenderTarget().WithUAVBinding().WithSize(RenderSize).Create();\r\n\t\tSnow?.Dispose();\r\n\t\tSnow = Texture.CreateRenderTarget().WithUAVBinding().WithSize(RenderSize).Create();\r\n\t\tWaypoint?.Dispose();\r\n\t\tWaypoint = Texture.CreateRenderTarget().WithSize(RenderSize).Create();\r\n\t\tWaypointMask?.Dispose();\r\n\t\tWaypointMask = Texture.CreateRenderTarget().WithSize(RenderSize).Create();\r\n\t\tFinal?.Dispose();\r\n\t\tFinal = Texture.CreateRenderTarget().WithUAVBinding().WithSize(RenderSize).Create();\r\n\r\n\t\tDrawCamera.ClearCommandLists();\r\n\t\tvar cmds = new CommandList();\r\n\t\tcmds.Attributes.Set(\u0022Frame\u0022, Final);\r\n\t\tcmds.Attributes.Set(\u0022Interface\u0022, Owner.Inventory.Interface);\r\n\t\tcmds.Attributes.SetCombo(\u0022D_DRAW_INTERFACE\u0022, true);\r\n\t\tcmds.Blit(Material.FromShader(Shader.Load(\u0022shaders/post_draw.shader\u0022)));\r\n\t\tDrawCamera.AddCommandList(cmds, Stage.AfterPostProcess);\r\n\t\tFullRender();\r\n\t}\r\n\r\n\tprivate Vector2 LastEntityRenderOffset {get; set;}\r\n\tpublic void FullRender() {\r\n\t\tRenderCamera.OrthographicHeight = 1024 * (Screen.Height / 1024);\r\n\t\tRenderBackground();\r\n\t\tif (NextFullRender) {\r\n\t\t\tRenderShadows();\r\n\t\t\tRenderEntities();\r\n\t\t\tLastEntityRenderOffset = DitherOffset;\r\n\t\t}\r\n\t\tRenderWorldText();\r\n\t\t//RenderMask();\r\n\t\tDoComposite();\r\n\t\tif (NextFullRender)\r\n\t\t\tNextFullRender = 1f/8f;\r\n\t}\r\n\r\n\tprivate void RenderBackground() { //areas of static land behind the characters\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022entity\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022flame\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022alpha_zero_depth_floor\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022iso_waypoint\u0022);\r\n\t\tTerrainSuperBlendController.Set(Scene, Scene.RenderAttributes);\r\n\t\tRenderCamera.RenderToTexture(Background);\r\n\t\tScene.RenderAttributes.Clear();\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_MANUAL_DEPTH\u0022, true);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022light\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022flame\u0022);\r\n\t\t//RenderCamera.RenderExcludeTags.Add(\u0022no_depth\u0022);\r\n\t\tRenderCamera.RenderToTexture(BackgroundDepth);\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_MANUAL_DEPTH\u0022, false);\r\n\t\tRenderCamera.RenderExcludeTags.RemoveAll();\r\n\t}\r\n\r\n\tprivate void RenderShadows() {\r\n\t\tRenderCamera.RenderTags.Add(\u0022entity\u0022);\r\n\t\tRenderCamera.RenderTags.Add(\u0022entity_shadows\u0022);\r\n\t\tLighting.EntityShadows.GameObject.Enabled = true;\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_SHADOW_PASS\u0022, true);\r\n\t\tRenderCamera.RenderToTexture(EntityShadow);\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_MANUAL_DEPTH\u0022, true);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022light\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022iso_waypoint\u0022);\r\n\t\tRenderCamera.RenderTags.Add(\u0022flame\u0022);\r\n\t\tRenderCamera.RenderToTexture(EntityShadowDepth);\r\n\t\tRenderCamera.RenderTags.RemoveAll();\r\n\t\tRenderCamera.RenderExcludeTags.RemoveAll();\r\n\t\tLighting.EntityShadows.GameObject.Enabled = false;\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_MANUAL_DEPTH\u0022, false);\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_SHADOW_PASS\u0022, false);\r\n\t}\r\n\r\n\tprivate void RenderEntities() { //areas of static land behind the characters\r\n\t\tRenderCamera.RenderTags.Add(\u0022entity\u0022);\r\n\t\tRenderCamera.RenderTags.Add(\u0022flame\u0022);\r\n\t\tRenderCamera.RenderTags.Add(\u0022light_directional\u0022);\r\n\t\tRenderCamera.RenderToTexture(EntityLighting);\r\n\t\tRenderCamera.RenderTags.RemoveAll();\r\n\t}\r\n\r\n\tprivate void RenderWorldText() {\r\n\t\tWorldText?.Dispose();\r\n\t\tvar tex = new Bitmap(RenderSize.x, RenderSize.y);\r\n\t\tforeach (var talker in Scene.GetAllComponents\u003CNpcTalker\u003E()) {\r\n\t\t\tif (!talker.Message.HasValue)\r\n\t\t\t\tcontinue;\r\n\t\t\ttex.SetPen(Color.Yellow, 1);\r\n\t\t\tvar center = new Rect(PointToRenderPixels(talker.GetCaptionPosition()), 0);\r\n\t\t\tcenter = center.Grow(Graphics.MeasureText(center, talker.Message.Value).Width * 0.5f, 8);\r\n\t\t\tcenter.Top = center.Top.Floor();\r\n\t\t\tcenter.Left = center.Left.Floor();\r\n\t\t\tcenter.Width = MathF.Ceiling(center.Width);\r\n\t\t\ttex.DrawText(talker.Message.Value, center, TextFlag.Center);\r\n\t\t}\r\n\t\tWorldText = tex.ToTexture();\r\n\t\ttex.Dispose();\r\n\t}\r\n\r\n\tprivate void RenderMask() {\r\n\t\tMask?.Dispose();\r\n\t\tvar tex = new Bitmap(RenderSize.x, RenderSize.y);\r\n\t\tvar any = false;\r\n\t\tforeach (var bounds in Scene.GetAllComponents\u003CIsoCropBounds\u003E()) {\r\n\t\t\tvar bbox = bounds.BBox;\r\n\t\t\tif (!any)\r\n\t\t\t\ttex.Clear(Color.Black);\r\n\t\t\tany = true;\r\n\t\t\ttex.SetPen(Color.White,0);\r\n\t\t\ttex.SetFill(Color.White);\r\n\t\t\tvar top = PointToRenderPixels(bounds.WorldPosition \u002B WorldRotation.Left * bounds.Bounds.x * 0.5f \u002B WorldRotation.Up * bounds.Bounds.y * 0.5f).Clamp(0f, RenderSize);\r\n\t\t\tvar bot = PointToRenderPixels(bounds.WorldPosition \u002B WorldRotation.Left *-bounds.Bounds.x * 0.5f \u002B WorldRotation.Up *-bounds.Bounds.y * 0.5f).Clamp(0f, RenderSize) - top;\r\n\t\t\tif (bot.IsNearZeroLength)\r\n\t\t\t\tcontinue;\r\n\t\t\ttex.DrawRect(new(top,bot));\r\n\t\t}\r\n\t\tif (!any)\r\n\t\t\ttex.Clear(Color.White);\r\n\t\tMask = tex.ToTexture();\r\n\t\ttex.Dispose();\r\n\t}\r\n\r\n\tprivate void DoComposite() { //combine world renders, not including ui\r\n\t\tvar shader = new ComputeShader(\u0022shaders/cs_iso_composite_a.shader\u0022);\r\n\t\tshader.Attributes.Set(\u0022Background\u0022, Background);\r\n\t\tshader.Attributes.Set(\u0022BackgroundDepth\u0022, BackgroundDepth);\r\n\t\tshader.Attributes.Set(\u0022EntityShadow\u0022, EntityShadow);\r\n\t\tshader.Attributes.Set(\u0022EntityShadowDepth\u0022, EntityShadowDepth);\r\n\t\tshader.Attributes.Set(\u0022EntityLighting\u0022, EntityLighting);\r\n\t\tshader.Attributes.Set(\u0022WorldText\u0022, WorldText);\r\n\t\tshader.Attributes.Set(\u0022Mask\u0022, Mask);\r\n\t\tshader.Attributes.Set(\u0022Snow\u0022, Snow);\r\n\t\tshader.Attributes.Set(\u0022EntityOffset\u0022, DitherOffset - LastEntityRenderOffset);\r\n\t\tshader.Attributes.Set(\u0022DitherOffset\u0022, DitherOffset);\r\n\t\tshader.Attributes.Set(\u0022RenderSize\u0022, Composite.Size);\r\n\t\tshader.Attributes.Set(\u0022Result\u0022, Composite);\r\n\t\tshader.Dispatch(Composite.Width, Composite.Height, 1);\r\n\t}\r\n\r\n\tpublic void InterfaceRender() {\r\n\t\tRenderSnow();\r\n\t\tRenderWaypoint();\r\n\t\tDoFinalComposite();\r\n\t}\r\n\r\n\tprivate TimeUntil SnowUpdateTime {get; set;}\r\n\tprivate Vector2 LastDitherOffset {get; set;}\r\n\tprivate GpuBuffer\u003CVector4\u003E SnowPositionBuffer {get; set;}\r\n\tprivate void RenderSnow() {\r\n\t\tif (SnowPositionBuffer == null)\r\n\t\t\tSnowPositionBuffer = new(2048);\r\n\t\tif (SnowUpdateTime || DitherOffset != LastDitherOffset) {\r\n\t\t\tvar update = new ComputeShader(\u0022shaders/cs_snow_update.shader\u0022);\r\n\t\t\tupdate.Attributes.Set(\u0022PositionBuffer\u0022, SnowPositionBuffer);\r\n\t\t\tupdate.Attributes.Set(\u0022DeltaTime\u0022, SnowUpdateTime.Passed);\r\n\t\t\tupdate.Attributes.Set(\u0022TimeNow\u0022, Time.Now);\r\n\t\t\tupdate.Attributes.Set(\u0022DitherOffset\u0022, DitherOffset);\r\n\t\t\tupdate.Attributes.Set(\u0022MoveDelta\u0022, (DitherOffset - LastDitherOffset) / Snow.Size);\r\n\t\t\tupdate.Attributes.Set(\u0022Update\u0022, (bool)SnowUpdateTime);\r\n\t\t\tupdate.Dispatch(SnowPositionBuffer.ElementCount, 1, 1);\r\n\t\t\tLastDitherOffset = DitherOffset;\r\n\t\t\tif (SnowUpdateTime)\r\n\t\t\t\tSnowUpdateTime = 1f/20f;\r\n\t\t}\r\n\t\tvar shader = new ComputeShader(\u0022shaders/cs_snow_draw.shader\u0022);\r\n\t\tshader.Attributes.Set(\u0022PositionBuffer\u0022, SnowPositionBuffer);\r\n\t\tshader.Attributes.Set(\u0022BufferSize\u0022, SnowPositionBuffer.ElementCount);\r\n\t\tshader.Attributes.Set(\u0022RenderSize\u0022, Snow.Size);\r\n\t\tshader.Attributes.Set(\u0022ZoomScale\u0022, ZoomScale);\r\n\t\tshader.Attributes.Set(\u0022Result\u0022, Snow);\r\n\t\tshader.Dispatch(Snow.Width, Snow.Height, 1);\r\n\t}\r\n\r\n\tprivate void RenderWaypoint() {\r\n\t\tRenderCamera.BackgroundColor = Color.Transparent;\r\n\t\tRenderCamera.RenderTags.Add(\u0022light_directional\u0022);\r\n\t\tif (Owner.Mouse.InteractMode == PlayerMouse.Mode.Move \u0026\u0026 Owner.Mouse.TargetLayer != PlayerMouse.Layer.Interface \u0026\u0026 !Input.Down(\u0022drag_camera\u0022))\r\n\t\t\tRenderCamera.RenderTags.Add(\u0022iso_waypoint\u0022);\r\n\t\tRenderCamera.RenderToTexture(Waypoint);\r\n\t\tRenderCamera.RenderTags.RemoveAll();\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022no_depth\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022iso_waypoint\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022ground\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022dynamic\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022flame\u0022);\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_MANUAL_DEPTH\u0022, true);\r\n\t\tRenderCamera.RenderToTexture(WaypointMask);\r\n\t\tScene.RenderAttributes.SetCombo(\u0022D_MANUAL_DEPTH\u0022, false);\r\n\t\tRenderCamera.RenderExcludeTags.RemoveAll();\r\n\t\tRenderCamera.BackgroundColor = Color.Black;\r\n\t}\r\n\r\n\t[Property, Range(-1,1)] public float Fade {get; set;}\r\n\tprivate void DoFinalComposite() { //combine world renders, not including ui\r\n\t\tvar shader = new ComputeShader(\u0022shaders/cs_iso_composite_b.shader\u0022);\r\n\t\tshader.Attributes.Set(\u0022Composite\u0022, Composite);\r\n\t\tshader.Attributes.Set(\u0022Snow\u0022, Snow);\r\n\t\tshader.Attributes.Set(\u0022Waypoint\u0022, Waypoint);\r\n\t\tshader.Attributes.Set(\u0022WaypointMask\u0022, WaypointMask);\r\n\t\tshader.Attributes.Set(\u0022EntityShadow\u0022, EntityShadow);\r\n\t\tshader.Attributes.Set(\u0022EntityOffset\u0022, DitherOffset - LastEntityRenderOffset);\r\n\t\tshader.Attributes.Set(\u0022BackgroundDepth\u0022, BackgroundDepth);\r\n\t\tshader.Attributes.Set(\u0022Freeze\u0022, Owner.Inventory.Temperature.Remap(-20,0,1,0).SnapToGrid(0.05f));\r\n\t\tshader.Attributes.Set(\u0022FreezeOverlay\u0022, Texture.Load(\u0022materials/interface/freeze.vtex\u0022));\r\n\t\tshader.Attributes.Set(\u0022Fade\u0022, Fade);\r\n\t\tshader.Attributes.Set(\u0022RenderSize\u0022, Final.Size);\r\n\t\tshader.Attributes.Set(\u0022Result\u0022, Final);\r\n\t\tshader.Dispatch(Final.Width, Final.Height, 1);\r\n\t}\r\n}\r\n\r\npublic class IsoCropBounds : Component {\r\n\t[Property] public Vector2 Bounds {get; set;}\r\n\tpublic BBox BBox =\u003E new(new Vector3(100, Bounds.x, Bounds.y) *-0.5f, new Vector3(100, Bounds.x, Bounds.y) * 0.5f);\r\n\tprotected override void DrawGizmos() {\r\n\t\tGizmo.Transform = Gizmo.Transform.WithRotation(Rotation.FromYaw(60f) * Rotation.FromPitch(30f));\r\n\t\tVector3 vec = 0.5f;\r\n\t\tvec.x = 1000;\r\n\t\tvec.y *= Bounds.x;\r\n\t\tvec.z *= Bounds.y;\r\n\t\tGizmo.Draw.Color = Color.Black;\r\n\t\tGizmo.Draw.LineThickness = 5;\r\n\t\tGizmo.Draw.LineBBox(new(-vec, vec));\r\n\t\tbase.DrawGizmos();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"iso2/effects/Blight.cs","FileName":"Blight.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class Blight : BaseSpot {\r\n\tprotected override void DrawGizmos() {\r\n\t\tGizmo.Draw.Color = Color.Green;\r\n\t\tif (Gizmo.IsSelected)\r\n\t\t\tGizmo.Draw.LineSphere(Vector3.Zero, Range);\r\n\t\tbase.DrawGizmos();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"iso2/scene/SurfaceMusicManager.cs","FileName":"SurfaceMusicManager.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class SurfaceMusicManager : Component {\r\n\tpublic SoundHandle ColdA;\r\n\tpublic SoundHandle ColdB;\r\n\tpublic SoundHandle Warm;\r\n\tpublic SoundHandle HouseAmb;\r\n\tpublic enum Track {\r\n\t\tNone,\r\n\t\tCold,\r\n\t\tWarm,\r\n\t\tHouse\r\n\t}\r\n\t[Property] public Track PlayingTrack {get;set;} = Track.Cold;\r\n\r\n\tprivate bool ColdSwitch;\r\n\tprotected override void OnUpdate() {\r\n\t\tif (ColdSwitch) {\r\n\t\t\tif (!ColdA.IsValid() || !ColdA.IsPlaying)\r\n\t\t\t\tColdA = Sound.Play(\u0022sounds/music/freeze.sound\u0022);\r\n\t\t\tif (ColdA.Time \u003E 130)\r\n\t\t\t\tColdSwitch = false;\r\n\t\t} else {\r\n\t\t\tif (!ColdB.IsValid() || !ColdB.IsPlaying)\r\n\t\t\t\tColdB = Sound.Play(\u0022sounds/music/freeze.sound\u0022);\r\n\t\t\tif (ColdB.Time \u003E 130)\r\n\t\t\t\tColdSwitch = true;\r\n\t\t}\r\n\t\tif (!HouseAmb.IsValid() || !HouseAmb.IsPlaying) {\r\n\t\t\tHouseAmb = Sound.Play(\u0022sounds/ambient/room_house.sound\u0022);\r\n\t\t\tHouseAmb.Volume = 0f;\r\n\t\t}\r\n\t\tif (ColdA.IsValid())\r\n\t\t\tColdA.Volume = ColdA.Volume.Approach((PlayingTrack == Track.Cold)? 1 : 0, Time.Delta / 4f);\r\n\t\tif (ColdB.IsValid())\r\n\t\t\tColdB.Volume = ColdB.Volume.Approach((PlayingTrack == Track.Cold)? 1 : 0, Time.Delta / 4f);\r\n\t\tif (HouseAmb.IsValid())\r\n\t\t\tHouseAmb.Volume = HouseAmb.Volume.Approach((PlayingTrack == Track.House)? 1 : 0, Time.Delta / 4f);\r\n\t\tbase.OnUpdate();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/iso/IsoEntity.cs","FileName":"IsoEntity.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class IsoEntity : Component {\r\n\t[Property, RequireComponent, Change(nameof(SetActivitySet))] public SkinnedModelRenderer Renderer {get; set;}\r\n\t[Property, RequireComponent, Change(nameof(SetCollider))] public BoxCollider Collider {get; set;}\r\n\t[Button] public void SnapToGrid() {\r\n\t\tWorldPosition = Grid.Snap(WorldPosition);\r\n\t\tWorldRotation = WorldRotation.Angles().WithYaw((WorldRotation.Yaw() \u002B 30).SnapToGrid(60) - 30);\r\n\t}\r\n\t[Property] public IsoActivitySet ActivitySet {get; set;}\r\n\t[Property] public IsoTalkerScript TalkerScript {get; set;}\r\n\t[Property] public bool NoIsoTags {get; set;}\r\n\t[Property] public int Health {get; set;} = 40;\r\n\t[Property] public int MaxHealth {get; set;} = 40;\r\n\r\n\tprivate void SetActivitySet() {\r\n\t\tif (Renderer.IsValid()) {\r\n\t\t\tActivitySet ??= ResourceLibrary.Get\u003CIsoActivitySet\u003E(Renderer.Model.ResourcePath.Replace(\u0022.vmdl\u0022, \u0022.anm\u0022));\r\n\t\t\tTalkerScript ??= ResourceLibrary.Get\u003CIsoTalkerScript\u003E(Renderer.Model.ResourcePath.Replace(\u0022.vmdl\u0022, \u0022.tlk\u0022));\r\n\t\t}\r\n\t}\r\n\tprivate void SetCollider() {\r\n\t\tif (!Collider.IsValid())\r\n\t\t\treturn;\r\n\t\tCollider.Scale = new Vector3(25,25,5);\r\n\t}\r\n\r\n\tprotected override void OnAwake() {\r\n\t\tTags.Add(\u0022dynamic\u0022);\r\n\t\tif (!NoIsoTags) {\r\n\t\t\tTags.Add(\u0022entity\u0022);\r\n\t\t\tTags.Add(\u0022iso_entity\u0022);\r\n\t\t}\r\n\t\tif (ActivitySet.IsValid())\r\n\t\t\tComponents.GetOrCreate\u003CNpcAnimator\u003E().Owner = this;\r\n\t\tif (TalkerScript.IsValid())\r\n\t\t\tComponents.GetOrCreate\u003CNpcTalker\u003E().Owner = this;\r\n\t\tbase.OnAwake();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/pac/FmvBounds.cs","FileName":"FmvBounds.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class FmvBounds : Component {\r\n\t[Property] public Vector3 Size {get; set;}\r\n\t[Property] public Vector3 Center {get; set;}\r\n\tpublic BBox Box =\u003E new(Center - Size * 0.5f, Center \u002B Size * 0.5f);\r\n\tprotected override void DrawGizmos() {\r\n\t\tGizmo.Draw.Color = Color.Green;\r\n\t\tGizmo.Draw.LineBBox(Box);\r\n\t\tbase.DrawGizmos();\r\n\t}\r\n}\r\n\r\npublic class FmvBoundsCollection : Component {\r\n\tpublic bool Test(Frustum frustrum) {\r\n\t\tforeach (var bound in Components.GetAll\u003CFmvBounds\u003E()) {\r\n\t\t\tif (frustrum.IsInside(bound.Box.Transform(bound.WorldTransform), true))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\tpublic List\u003CVector3\u003E GetCorners() {\r\n\t\tList\u003CVector3\u003E result = new();\r\n\t\tforeach (var bound in Components.GetAll\u003CFmvBounds\u003E())\r\n\t\t\tforeach (var corner in bound.Box.Corners)\r\n\t\t\t\tresult.Add(corner);\r\n\t\treturn result;\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/pac/Interactable.cs","FileName":"Interactable.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class IsoInteractable : Component {\r\n\t[Property] public Vector3 Size {get; set;}\r\n\t[Property] public Vector3 Center {get; set;}\r\n\t[Property] public List\u003CPacViewNode\u003E ValidNodes {get; set;}\r\n\t[Property] public GameObject IsoPathGoal {get; set;}\r\n\tpublic BBox Box =\u003E new(Center - Size * 0.5f, Center \u002B Size * 0.5f);\r\n\tprotected override void DrawGizmos() {\r\n\t\tGizmo.Draw.IgnoreDepth = true;\r\n\t\tGizmo.Draw.Color = Color.Yellow;\r\n\t\tGizmo.Draw.LineBBox(Box);\r\n\t\tbase.DrawGizmos();\r\n\t}\r\n\t[Property] public Action OnUse {get; set;}\r\n\tpublic void Interact() {\r\n\t\tOnUse?.Invoke();\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"core/player/PlayerPacCamera.cs","FileName":"PlayerPacCamera.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"using Sandbox.Rendering;\r\nusing Sandbox.Utility;\r\n\r\npublic class PlayerPacCamera : Component {\r\n\t[Property, ReadOnly] public BasePlayer Owner {get; set;}\r\n\r\n\t[Property, ReadOnly] public Vector2Int RenderSize {get; set;} = new(640,480);\r\n\t[Property, ReadOnly] public CameraComponent RenderCamera {get; set;}\r\n\t[Property, ReadOnly] public CameraComponent DrawCamera {get; set;}\r\n\t[Property] public bool AlwaysRerender {get; set;}\r\n\t[Property, Change(nameof(UpdateVideoMask))] public bool FullScreenFMV {get; set;}\r\n\t[Property, Range(-1,1)] public float Fade {get; set;}\r\n\tpublic enum TransitionType {\r\n\t\tNone,\r\n\t\tSlideLeft,\r\n\t\tSlideRight,\r\n\t\tFade,\r\n\t}\r\n\tpublic TransitionType DoTransition {get; set;}\r\n\tprivate TransitionType CurrentTransition {get; set;}\r\n\tpublic TimeUntil TransitionTime {get; set;}\r\n\t[Property, ReadOnly] public Texture StaticCurrent {get; set;}\r\n\t[Property, ReadOnly] public Texture StaticLast {get; set;}\r\n\t[Property, ReadOnly] public Texture VideoMask {get; set;}\r\n\t[Property, ReadOnly] public Texture VideoCurrent {get; set;}\r\n\t[Property, ReadOnly] public Texture VideoLast {get; set;}\r\n\t[Property, ReadOnly] public Texture Composite {get; set;}\r\n\t[Property, ReadOnly] public Action DelayMoveAction {get; set;}\r\n\t[Property, ReadOnly, Range(-1,1)] public int Turn {get; set;}\r\n\t[Property] public Texture OverlayTexture {get; set;}\r\n\t[Property, Range(0,1)] public float OverlayStrength {get; set;}\r\n\r\n\tprotected override void OnAwake() {\r\n\t\tComposite = Texture.CreateRenderTarget().WithUAVBinding().WithSize(RenderSize).Create();\r\n\r\n\t\tSpawn.SetOwner(this);\r\n\t\tSpawn.Component(nameof(RenderCamera));\r\n\t\tRenderCamera.BackgroundColor = Color.Black;\r\n\t\tSpawn.Component(nameof(DrawCamera));\r\n\t\tDrawCamera.RenderTags.Add(\u0022null\u0022);\r\n\t\tDrawCamera.BackgroundColor = Color.Black;\r\n\t\tDrawCamera.Priority = 1000;\r\n\t\tDrawCamera.ClearCommandLists();\r\n\t\tvar cmds = new CommandList();\r\n\t\tcmds.Attributes.Set(\u0022Frame\u0022, Composite);\r\n\t\tcmds.Blit(Material.FromShader(Shader.Load(\u0022shaders/post_draw.shader\u0022)));\r\n\t\tDrawCamera.AddCommandList(cmds, Stage.AfterPostProcess);\r\n\t\tbase.OnAwake();\r\n\t}\r\n\r\n\tpublic Vector2 PointToRenderPixels(Vector3 point) {\r\n\t\tRenderCamera.CustomSize = RenderSize;\r\n\t\tvar uv = RenderCamera.PointToScreenNormal(point);\r\n\t\tif (uv.x == 0) uv.x = -1; else if (uv.x == 1) uv.x = 2;\r\n\t\tif (uv.y == 0) uv.y = -1; else if (uv.y == 1) uv.y = 2;\r\n\t\tuv -= 0.5f;\r\n\t\tuv.y *= ((float)RenderSize.x/RenderSize.y) / Screen.Aspect;\r\n\t\tuv \u002B= 0.5f;\r\n\t\tuv *= RenderSize;\r\n\t\tuv.x = uv.x.Floor();\r\n\t\tuv.y = uv.y.Floor();\r\n\t\treturn uv;\r\n\t}\r\n\r\n\tpublic void Update() {\r\n\t\tLocalTransform = global::Transform.Zero;\r\n\t\tMouse.Visibility = MouseVisibility.Visible;\r\n\t\tMouse.CursorType = \u0022iso2_pointer\u0022;\r\n\t\tif (Turn == -1)\r\n\t\t\tMouse.CursorType = \u0022iso2_left\u0022;\r\n\t\tif (Turn == 1)\r\n\t\t\tMouse.CursorType = \u0022iso2_right\u0022;\r\n\t\tif (FullScreenFMV)\r\n\t\t\tMouse.CursorType = \u0022None\u0022;\r\n\t\tif (TransitionTime)\r\n\t\t\tCurrentTransition = TransitionType.None;\r\n\t\telse foreach (var animator in Scene.GetAllComponents\u003CNpcAnimator\u003E())\r\n\t\t\tanimator.ResetToIdle();\r\n\t\tTerrainSuperBlendController.Set(Scene, Scene.RenderAttributes);\r\n\t\tRenderStatic();\r\n\t\tRenderVideo();\r\n\t\tScene.RenderAttributes.Clear();\r\n\t\tDoComposite();\r\n\t}\r\n\r\n\tprivate int ViewHash = 0;\r\n\tprivate void RenderStatic() {\r\n\t\tvar newtransition = DoTransition;\r\n\t\tDoTransition = TransitionType.None;\r\n\t\tif (FullScreenFMV)\r\n\t\t\treturn;\r\n\t\tvar angle = HashCode.Combine(WorldTransform, RenderCamera.FieldOfView);\r\n\t\tif (angle == ViewHash \u0026\u0026 !AlwaysRerender)\r\n\t\t\treturn;\r\n\t\tViewHash = angle;\r\n\t\tif (!AlwaysRerender) {\r\n\t\t\tforeach (var animator in Scene.GetAllComponents\u003CNpcAnimator\u003E())\r\n\t\t\t\tanimator.ResetToIdle();\r\n\t\t}\r\n\r\n\t\tStaticLast?.Dispose();\r\n\t\tStaticLast = StaticCurrent;\r\n\t\tStaticCurrent = Texture.CreateRenderTarget().WithSize(RenderSize).Create();\r\n\t\t//RenderCamera.RenderExcludeTags.Add(\u0022dynamic\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022iso_waypoint\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022iso_entity\u0022);\r\n\t\tRenderCamera.RenderToTexture(StaticCurrent);\r\n\t\tRenderCamera.RenderExcludeTags.RemoveAll();\r\n\t\tUpdateVideoMask();\r\n\t\tLastVideoRender = 20f;\r\n\t\tif (newtransition != TransitionType.None) {\r\n\t\t\tCurrentTransition = newtransition;\r\n\t\t\tTransitionTime = 0.3f;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic void InvalidateView() {\r\n\t\tViewHash = 0;\r\n\t}\r\n\r\n\tpublic void UpdateVideoMask() {\r\n\t\tVideoMask?.Dispose();\r\n\t\tif (FullScreenFMV) {\r\n\t\t\tVideoMask = Texture.Create(1, 1).WithData(new byte[4] {255, 255, 255, 255}).Finish();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar tex = new Bitmap(RenderSize.x, RenderSize.y);\r\n\t\ttex.Clear(Color.Black);\r\n\t\ttex.SetFill(Color.White);\r\n\t\tforeach (var bound in Scene.GetAllComponents\u003CFmvBoundsCollection\u003E()) {\r\n\t\t\tif (!bound.Test(RenderCamera.GetFrustum(new(0,Screen.Size))))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar created = false;\r\n\t\t\tRect rough = new();\r\n\t\t\tforeach (var corner in bound.GetCorners()) {\r\n\t\t\t\tvar point = PointToRenderPixels(bound.WorldTransform.PointToWorld(corner));\r\n\t\t\t\t//tex.DrawCircle(point, 2);\r\n\t\t\t\t//DebugOverlay.Sphere(new(bound.WorldTransform.PointToWorld(corner), 1), Color.Red, 20f, default, true);\r\n\t\t\t\tif (!created)\r\n\t\t\t\t\trough = new(point);\r\n\t\t\t\telse\r\n\t\t\t\t\trough = rough.AddPoint(point);\r\n\t\t\t\tcreated = true;\r\n\t\t\t}\r\n\t\t\tif (rough.Width.AlmostEqual(0f) || rough.Height.AlmostEqual(0f))\r\n\t\t\t\tcontinue;\r\n\t\t\ttex.DrawRect(rough);\r\n\t\t}\r\n\t\tVideoMask = tex.ToTexture();\r\n\t}\r\n\r\n\tprivate TimeSince LastVideoRender;\r\n\tprivate void RenderVideo() {\r\n\t\tif (CurrentTransition != TransitionType.None)\r\n\t\t\treturn;\r\n\t\tif (LastVideoRender \u003C 1f/(FullScreenFMV ? 30f : 15f))\r\n\t\t\treturn;\r\n\t\tLastVideoRender = 0f;\r\n\t\tVideoLast?.Dispose();\r\n\t\tVideoLast = VideoCurrent;\r\n\t\tVideoCurrent = Texture.CreateRenderTarget().WithUAVBinding().WithSize(RenderSize).Create();\r\n\t\tvar videonew = Texture.CreateRenderTarget().WithUAVBinding().WithSize(RenderSize).Create();\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022iso_waypoint\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022iso_entity\u0022);\r\n\t\tRenderCamera.RenderExcludeTags.Add(\u0022flame\u0022);\r\n\t\tRenderCamera.RenderToTexture(videonew);\r\n\t\tRenderCamera.RenderExcludeTags.RemoveAll();\r\n\t\tvar shader = new ComputeShader(\u0022shaders/cs_pac_video_p_frames.shader\u0022);\r\n\t\tshader.Attributes.Set(\u0022VideoCurrent\u0022, videonew);\r\n\t\tshader.Attributes.Set(\u0022VideoLast\u0022, VideoLast);\r\n\t\tshader.Attributes.Set(\u0022RenderSize\u0022, VideoCurrent.Size);\r\n\t\tshader.Attributes.Set(\u0022Result\u0022, VideoCurrent);\r\n\t\tshader.Dispatch(VideoCurrent.Width, VideoCurrent.Height, 1);\r\n\t\tvideonew.Dispose();\r\n\t}\r\n\r\n\tprivate void DoComposite() {\r\n\t\tvar shader = new ComputeShader(\u0022shaders/cs_pac_composite.shader\u0022);\r\n\t\tshader.Attributes.Set(\u0022StaticLast\u0022, StaticLast);\r\n\t\tshader.Attributes.Set(\u0022StaticCurrent\u0022, StaticCurrent);\r\n\t\tshader.Attributes.Set(\u0022VideoMask\u0022, VideoMask);\r\n\t\tshader.Attributes.Set(\u0022VideoCurrent\u0022, VideoCurrent);\r\n\t\tif (CurrentTransition != TransitionType.None) {\r\n\t\t\tshader.Attributes.Set(\u0022RenderVideo\u0022, false);\r\n\t\t\tshader.Attributes.Set(\u0022TransitionFade\u0022, 1f);\r\n\t\t\tif (CurrentTransition == TransitionType.SlideLeft)\r\n\t\t\t\tshader.Attributes.Set(\u0022TransitionSlide\u0022,-Easing.SineEaseInOut(TransitionTime.Fraction));\r\n\t\t\telse if (CurrentTransition == TransitionType.SlideRight)\r\n\t\t\t\tshader.Attributes.Set(\u0022TransitionSlide\u0022, Easing.SineEaseInOut(TransitionTime.Fraction));\r\n\t\t\telse if (CurrentTransition == TransitionType.Fade)\r\n\t\t\t\tshader.Attributes.Set(\u0022TransitionFade\u0022, 1f - TransitionTime.Fraction);\r\n\t\t} else {\r\n\t\t\tshader.Attributes.Set(\u0022RenderVideo\u0022, true);\r\n\t\t\tshader.Attributes.Set(\u0022TransitionSlide\u0022, 0f);\r\n\t\t\tshader.Attributes.Set(\u0022TransitionFade\u0022, 0f);\r\n\t\t}\r\n\t\tshader.Attributes.Set(\u0022Overlay\u0022, OverlayTexture);\r\n\t\tshader.Attributes.Set(\u0022OverlayStrength\u0022, OverlayStrength);\r\n\t\tshader.Attributes.Set(\u0022Fade\u0022, Fade);\r\n\t\tshader.Attributes.Set(\u0022RenderSize\u0022, Composite.Size);\r\n\t\tshader.Attributes.Set(\u0022Result\u0022, Composite);\r\n\t\tshader.Dispatch(Composite.Width, Composite.Height, 1);\r\n\t}\r\n}\r\n"},{"Ident":"jco.iso2","Path":"iso2/scene/HouseDoor.cs","FileName":"HouseDoor.cs","PackageType":"game","CodeKind":"Game","AssetVersionId":446618,"IsPrivate":false,"Code":"public class HouseDoor : Component {\r\n\t[Property] Rotation ClosedRot {get; set;}\r\n\t[Property] Rotation OpenRot {get; set;}\r\n\t[Property] Action StartAnimating {get; set;}\r\n\t[Property] Action OnOpen {get; set;}\r\n\t[Property] Action OnClose {get; set;}\r\n\tprivate TimeUntil Animation {get; set;}\r\n\t[Property, Change(nameof(Switch))] public bool Open {get; set;}\r\n\t[Property, ReadOnly] public bool Animating {get; set;}\r\n\r\n\tpublic void Switch() {\r\n\t\tAnimation = 2.5f;\r\n\t\tStartAnimating?.Invoke();\r\n\t\tif (Open)\r\n\t\t\tSound.Play(\u0022sounds/door/door_wood_old_open.sound\u0022);\r\n\t\telse\r\n\t\t\tSound.Play(\u0022sounds/door/door_wood_old_close.sound\u0022);\r\n\t}\r\n\r\n\tprotected override void OnUpdate() {\r\n\t\tif (Animation \u0026\u0026 Animating) {\r\n\t\t\tif (Open)\r\n\t\t\t\tWorldRotation = OpenRot;\r\n\t\t\telse\r\n\t\t\t\tWorldRotation = ClosedRot;\r\n\t\t\tif (Open)\r\n\t\t\t\tOnOpen?.Invoke();\r\n\t\t\telse\r\n\t\t\t\tOnOpen?.Invoke();\r\n\t\t\tAnimating = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (Animation)\r\n\t\t\treturn;\r\n\t\tAnimating = true;\r\n\t\tif (Open)\r\n\t\t\tWorldRotation = ClosedRot.SlerpTo(OpenRot, Animation.Fraction);\r\n\t\telse\r\n\t\t\tWorldRotation = OpenRot.SlerpTo(ClosedRot, Animation.Fraction);\r\n\t\tbase.OnUpdate();\r\n\t}\r\n}\r\n"}]}