From 897388eb7654eed5e2168d1057bd1848b701ae70 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:12:18 -0600 Subject: [PATCH 01/35] Update modinfo_stable.sbmi From ab90fd4d436513a594b1fa2af6fb491222e320ee Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:23:48 -0600 Subject: [PATCH 02/35] Update CommandHandler.cs From 863a5e240105b972613f1fa80b96602079da608c Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 30 Jan 2025 21:41:41 -0600 Subject: [PATCH 03/35] Update modinfo_stable.sbmi From c0676fe15dc92abe3ffb934bb42881fe2ab117a3 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:29:21 -0600 Subject: [PATCH 04/35] Unnerf Fusion Radiators (#1874) From b8f8e3d4e971362f339876b1837ee676173d6fc7 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:39:20 -0600 Subject: [PATCH 05/35] Remove unnecessary textures (#1875) From 70b6a0487dcdd5683d9b9eaa75e35d93aad30627 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:40:54 -0600 Subject: [PATCH 06/35] Remove stable version of NHI (#1873) From db8ce540d23deb8ed80e22be1210b252cf1674d5 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Feb 2025 14:20:15 -0600 Subject: [PATCH 07/35] Update Aristeas NewUniversalUpload.yml From bf8263474aeef58d979c1e580c391d9c9c01328c Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Feb 2025 14:21:48 -0600 Subject: [PATCH 08/35] Merge branch 'stable' into main From 478662b98e93c76f3fddad49414774c7c731bed6 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Feb 2025 14:47:02 -0600 Subject: [PATCH 09/35] Unnerf Fusion Radiators, Cleanup Files, and Only Trigger Upload Workflow on Main Repository (#1876) From d47daf3f072a832109ea45a4f42a7f421e67aeb7 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Mon, 3 Feb 2025 20:02:47 -0600 Subject: [PATCH 10/35] Update SUGMA Clearboard (#1879) --- .../Data/Scripts/SUGMA/Utilities/SUtils.cs | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs index 3285df400..d1dc25512 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs @@ -110,31 +110,42 @@ public static void ClearBoard(bool resetFactions) if (!MyAPIGateway.Session.IsServer) return; - var playerIds = new List(); + var playerIds = new List(); // All players that aren't spectators. foreach (var faction in PlayerTracker.I.GetPlayerFactions()) playerIds.AddRange(faction.Members.Values.Select(player => player.PlayerId)); - var greenSpawn = GetFactionSpawns().FirstOrDefault(b => b.Key.Tag == "NEU").Value; - foreach (var player in PlayerTracker.I.AllPlayers.Where(p => playerIds.Contains(p.Key))) + var factionSpawns = GetFactionSpawns(); + if (factionSpawns.Any(b => b.Key.Tag == "NEU")) { - if (greenSpawn != null) - player.Value.Character?.SetWorldMatrix(greenSpawn.WorldMatrix); - else + var spawnPos = GetFactionSpawns().First(b => b.Key.Tag == "NEU").Value.WorldMatrix.Translation; + spawnPos -= spawnPos.Normalized() * 100; + + foreach (var player in PlayerTracker.I.AllPlayers) + { + (player.Value.Controller.ControlledEntity as IMyCockpit)?.RemovePilot(); + player.Value.Character?.SetPosition(spawnPos + RandVector(-50, 50) * Vector3D.Right); + } + } + else + { + foreach (var player in PlayerTracker.I.AllPlayers.Where(p => playerIds.Contains(p.Key))) player.Value.Character?.Kill(); } - + SUGMA_SessionComponent.I.StopGamemode(true); + List bufferGroupGrids = new List(); MyAPIGateway.Entities.GetEntities(null, g => { IMyCubeGrid grid = g as IMyCubeGrid; if (grid == null) return false; - // If this ever becomes an issue with deleting existing subgrids, change it to a GridGroup check. - if (!grid.IsStatic) + grid.GetGridGroup(GridLinkTypeEnum.Physical).GetGrids(bufferGroupGrids); // Ignore the spawn stations, blockers, and any grids attached to them. + if (!bufferGroupGrids.Any(attachedGrid => attachedGrid.IsStatic)) grid.Close(); + bufferGroupGrids.Clear(); return false; }); From 447fd609194bf3635687aebf650208ef256c3c17 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 6 Feb 2025 01:11:04 -0600 Subject: [PATCH 11/35] Revert mistaken fusion heat edits (#1882) From a99132331374e6ff6ae956f4b68837aac2902c45 Mon Sep 17 00:00:00 2001 From: CommodoreChet <50426713+CommodoreChet@users.noreply.github.com> Date: Thu, 6 Feb 2025 19:51:53 -0600 Subject: [PATCH 12/35] KOTH go Brrrr --- .../GameModes/Elimination/EliminationHud.cs | 7 +- .../GameModes/KingOfTheHill/KOTHGamemode.cs | 106 ++++++++++++ .../SUGMA/GameModes/KingOfTheHill/KOTHHud.cs | 153 ++++++++++++++++++ .../Scripts/SUGMA/GameState/KOTHSphereZone.cs | 112 +++++++++++++ .../Scripts/SUGMA/SUGMA_SessionComponent.cs | 2 + 5 files changed, 377 insertions(+), 3 deletions(-) create mode 100644 Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs create mode 100644 Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs create mode 100644 Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/KOTHSphereZone.cs diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs index 91f3fcbe0..ccdfb9277 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs @@ -59,7 +59,8 @@ internal class elmHud_Window : HudElementBase private bool _matchEnded; private readonly MatchTimer _timer; - private readonly LabelBox _timerLabel; + internal readonly LabelBox _timerLabel; + internal LabelBox _winnerLabel; public EliminationHud_TeamBanner[] Banners; public elmHud_Window(HudParentBase parent, EliminationGamemode gamemode) : base(parent) @@ -136,7 +137,7 @@ public void MatchEnded(IMyFaction winner) if (_timerLabel == null) return; - var winnerLabel = new LabelBox(_timerLabel) + _winnerLabel = new LabelBox(_timerLabel) { Text = winner != null ? $"A WINNER IS {winner.Name}. {winnerPoints} tickets remaining." @@ -147,7 +148,7 @@ public void MatchEnded(IMyFaction winner) Color = HudConstants.HudBackgroundColor }; - winnerLabel.TextBoard.SetFormatting(GlyphFormat.White.WithColor(Color.Red).WithSize(3) + _winnerLabel.TextBoard.SetFormatting(GlyphFormat.White.WithColor(Color.Red).WithSize(3) .WithAlignment(TextAlignment.Center)); } } diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs new file mode 100644 index 000000000..1b2922307 --- /dev/null +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using Sandbox.ModAPI; +using SC.SUGMA.GameModes.Elimination; +using SC.SUGMA.GameState; +using SC.SUGMA.Utilities; +using VRage.Game.ModAPI; +using VRageMath; + +namespace SC.SUGMA.GameModes.KOTH +{ + internal partial class KOTHGamemode : EliminationGamemode + { + public KOTHSphereZone ControlPoint; + + private Vector3D _controlPointPosition = new Vector3D(0, 0, 0); + private float _controlPointRadius = 2500f; + + private int ActivationTime = 300; + public int ActivationTimeCounter = 0; + + private int WinTime = 120; + + public override string ReadableName { get; internal set; } = "King Of The Hill"; + + public override string Description { get; internal set; } = + "Factions fight over a Central Capture Point. Either spend 2 minutes uncontested in the center zone, or eliminate the enemy team to win."; + + public KOTHGamemode() + { + ArgumentParser += new ArgumentParser( + new ArgumentParser.ArgumentDefinition( + text => ActivationTime = int.Parse(text), + "at", "activation-time", + $"Delay before Center Zone is Capturable, in Seconds" + ), + new ArgumentParser.ArgumentDefinition( + text => WinTime = int.Parse(text), + "wt", "win-time", + "How long a team has to hold the zone uncontested to win, in Seconds" + ) + ); + } + + public override void StartRound(string[] arguments = null) + { + base.StartRound(arguments); + + if (TrackedFactions.Count <= 1) + return; + + ActivationTimeCounter = ActivationTime; + ControlPoint = null; + + if (!MyAPIGateway.Utilities.IsDedicated) + SUGMA_SessionComponent.I.RegisterComponent("KOTHHud", new KOTHHud(this)); + } + + public override void StopRound() + { + base.StopRound(); + + SUGMA_SessionComponent.I.GetComponent("KOTHHud")?.MatchEnded(ControlPoint._zoneOwner); + SUGMA_SessionComponent.I.UnregisterComponent("KOTHHud"); + + ControlPoint = null; + SUGMA_SessionComponent.I.UnregisterComponent("KOTHZone"); + } + + internal override void DisplayWinMessage() + { + if (ControlPoint._zoneOwner == null) + { + MyAPIGateway.Utilities.ShowNotification("YOU ARE ALL LOSERS.", 10000, "Red"); + return; + } + + MyAPIGateway.Utilities.ShowNotification($"A WINNER IS [{ControlPoint._zoneOwner?.Name}]!", 10000); + } + + public override void UpdateActive() + { + if (ActivationTimeCounter > 0) + { + if (_matchTimer.Ticks % 60 == 0) + { + ActivationTimeCounter--; + + if (ActivationTimeCounter <= 0) + { + ControlPoint = new KOTHSphereZone(_controlPointPosition, _controlPointRadius, WinTime); + SUGMA_SessionComponent.I.RegisterComponent("KOTHZone", ControlPoint); + } + } + } + + if (ControlPoint == null) + return; + + if (ControlPoint.IsCaptured) + { + StopRound(); + } + } + } +} \ No newline at end of file diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs new file mode 100644 index 000000000..3dd313484 --- /dev/null +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using RichHudFramework; +using RichHudFramework.Client; +using RichHudFramework.UI; +using RichHudFramework.UI.Client; +using RichHudFramework.UI.Rendering; +using SC.SUGMA.GameModes.Elimination; +using SC.SUGMA.GameState; +using SC.SUGMA.Utilities; +using VRage.Game.ModAPI; +using VRage.Utils; +using VRageMath; + +namespace SC.SUGMA.GameModes.KOTH +{ + internal class KOTHHud : ComponentBase + { + private readonly KOTHGamemode _gamemode; + private KOTHHud_Window _window; + + public KOTHHud(KOTHGamemode gamemode) + { + _gamemode = gamemode; + } + + public override void Init(string id) + { + base.Init(id); + + if (!RichHudClient.Registered) + throw new Exception("RichHudAPI was not initialized in time!"); + + _window = new KOTHHud_Window(HudMain.HighDpiRoot, _gamemode); + } + + public override void Close() + { + HudMain.HighDpiRoot.RemoveChild(_window); + } + + public override void UpdateTick() + { + if (SUGMA_SessionComponent.I.CurrentGamemode != null) + _window.Update(); + } + + public void MatchEnded(IMyFaction winner) + { + _window.MatchEnded(winner); + } + } + + internal class KOTHHud_Window : WindowBase + { + private static readonly Material _circleMaterial = + new Material(MyStringId.GetOrCompute("SugmaCircle"), new Vector2(32, 32)); + + private readonly KOTHGamemode _gamemode; + private readonly elmHud_Window _windowBase; + + private TexturedBox _captureIndicator; + + private Label _captureLabel; + + public KOTHHud_Window(HudParentBase parent, KOTHGamemode gamemode) : base(parent) + { + _gamemode = gamemode; + _windowBase = SUGMA_SessionComponent.I.GetComponent("elmHud").Window; + + _captureIndicator = new TexturedBox(_windowBase) + { + Material = _circleMaterial, + ParentAlignment = ParentAlignments.Bottom | ParentAlignments.Center, + Size = Vector2.One * 64, + Offset = new Vector2(0, -15), + ZOffset = sbyte.MaxValue + }; + + _captureLabel = new Label(_captureIndicator) + { + ParentAlignment = ParentAlignments.Center, + Offset = new Vector2(0, -55), + Text = "Initializing KOTH..." + }; + + foreach (var banner in _windowBase.Banners) + { + banner.Visible = false; + } + } + + public void Update() + { + if (_gamemode.ControlPoint == null) + { + int timeLeft = Math.Max(0, _gamemode.ActivationTimeCounter); + if (timeLeft > 0) + { + _captureIndicator.Color = Color.White; + _captureLabel.Text = $"Zone Locked: {timeLeft}s"; + } + else + { + _captureIndicator.Color = Color.White; + _captureLabel.Text = "Waiting for zone creation..."; + } + return; + } + + var zone = _gamemode.ControlPoint; + + bool isActivelyCapturing = zone.ActiveCapturingFaction != null && zone.CaptureTimeCurrent > 0f; + Color capturingColor = isActivelyCapturing + ? zone.ActiveCapturingFaction.CustomColor.ColorMaskToRgb() + : Color.White; + + _captureIndicator.Color = capturingColor.SetAlphaPct(0.5f); + + float current = zone.CaptureTimeCurrent; + float total = zone.CaptureTime; + + if (!isActivelyCapturing && current > 0f) + { + _captureIndicator.Color = Color.White.SetAlphaPct(0.5f); + } + + _captureLabel.Text = $"Capturing: {current:0.0}s / {total:0.0}s"; + } + + public void MatchEnded(IMyFaction winner) + { + _captureIndicator.Visible = false; + _captureLabel.Visible = false; + + _windowBase._winnerLabel.Visible = false; + _windowBase._winnerLabel = new LabelBox(_windowBase._timerLabel) + { + Text = winner != null + ? $"A WINNER IS {winner.Name}" + : "YOU ARE ALL LOSERS", + ParentAlignment = ParentAlignments.Bottom, + Height = EliminationHud_TeamBanner.BaseHeight, + TextPadding = new Vector2(2.5f, 0), + Color = HudConstants.HudBackgroundColor + }; + _windowBase._winnerLabel.Visible = true; + + _windowBase._winnerLabel.TextBoard.SetFormatting(GlyphFormat.White.WithColor(Color.Red).WithSize(3) + .WithAlignment(TextAlignment.Center)); + } + } +} \ No newline at end of file diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/KOTHSphereZone.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/KOTHSphereZone.cs new file mode 100644 index 000000000..fe7e3fb0b --- /dev/null +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameState/KOTHSphereZone.cs @@ -0,0 +1,112 @@ +using RichHudFramework; +using Sandbox.Game; +using Sandbox.Game.Entities; +using SC.SUGMA.Utilities; +using VRage.Game.ModAPI; +using VRageMath; +using System; +using System.Linq; +using System.Collections.Generic; + +namespace SC.SUGMA.GameState +{ + public class KOTHSphereZone : SphereZone + { + public IMyFaction _zoneOwner; + private Color _baseColor = Color.White.SetAlphaPct(0.25f); + + public bool IsCaptured = false; + public float CaptureTime; + public float CaptureTimeCurrent; + public MySoundPair CaptureSound = new MySoundPair("SUGMA_CaptureSound_TF2"); + + public IMyFaction ActiveCapturingFaction; + + public KOTHSphereZone(Vector3D center, double radius, float captureTime, IMyFaction initialOwner = null) + : base(center, radius) + { + _zoneOwner = initialOwner; + CaptureTime = captureTime; + + SphereDrawColor = (_zoneOwner?.CustomColor.ColorMaskToRgb() ?? Color.White).SetAlphaPct(0.25f); + _baseColor = SphereDrawColor; + } + + public override void UpdateTick() + { + GridFilter = SUGMA_SessionComponent.I.ShareTrackApi.GetTrackedGrids(); + base.UpdateTick(); + + var distinctFactions = new HashSet(); + foreach (var grid in ContainedGrids) + { + var faction = grid.GetFaction(); + if (faction != null) + distinctFactions.Add(faction); + } + + if (distinctFactions.Count == 0) + { + CaptureTimeCurrent = MathHelper.Max(0f, CaptureTimeCurrent - (1f / 120f)); + if (CaptureTimeCurrent <= 0f) + ActiveCapturingFaction = null; + } + else if (distinctFactions.Count > 1) + { + CaptureTimeCurrent = MathHelper.Max(0f, CaptureTimeCurrent - (1f / 120f)); + if (CaptureTimeCurrent <= 0f) + ActiveCapturingFaction = null; + } + else + { + var occupant = distinctFactions.First(); + + if (occupant == _zoneOwner) + { + CaptureTimeCurrent = 0f; + ActiveCapturingFaction = null; + } + else + { + if (ActiveCapturingFaction == null) + { + ActiveCapturingFaction = occupant; + } + else if (ActiveCapturingFaction != occupant) + { + CaptureTimeCurrent = MathHelper.Max(0f, CaptureTimeCurrent - (1f / 60f)); + + if (CaptureTimeCurrent <= 0f) + { + ActiveCapturingFaction = occupant; + CaptureTimeCurrent = 0f; + } + } + + if (ActiveCapturingFaction == occupant) + { + CaptureTimeCurrent += (1f / 60f); + + if (CaptureTimeCurrent >= CaptureTime) + { + _zoneOwner = ActiveCapturingFaction; + CaptureTimeCurrent = 0f; + ActiveCapturingFaction = null; + OnCapture(); + } + } + } + } + + float lerpAmount = (CaptureTime <= 0f ? 0f : CaptureTimeCurrent / CaptureTime); + Color capturingColor = ActiveCapturingFaction?.CustomColor.ColorMaskToRgb() ?? Color.White; + SphereDrawColor = Color.Lerp(_baseColor, capturingColor, lerpAmount).SetAlphaPct(0.25f); + } + + public virtual void OnCapture() + { + IsCaptured = true; + SUtils.PlaySound(CaptureSound); + } + } +} diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs index bc51ba722..b237979cb 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/SUGMA_SessionComponent.cs @@ -10,6 +10,7 @@ using SC.SUGMA.GameModes.Domination; using SC.SUGMA.GameModes.Elimination; using SC.SUGMA.GameModes.TeamDeathmatch; +using SC.SUGMA.GameModes.KOTH; using SC.SUGMA.GameState; using SC.SUGMA.HeartNetworking; using SC.SUGMA.HeartNetworking.Custom; @@ -33,6 +34,7 @@ internal class SUGMA_SessionComponent : MySessionComponentBase ["elm"] = new EliminationGamemode(), ["dom"] = new DominationGamemode(), ["tdm"] = new TeamDeathmatchGamemode(), + ["koth"] = new KOTHGamemode(), }; /// From b6c8e885a2376c56164eb27a47a14c5745ef5269 Mon Sep 17 00:00:00 2001 From: CommodoreChet <50426713+CommodoreChet@users.noreply.github.com> Date: Thu, 6 Feb 2025 19:54:02 -0600 Subject: [PATCH 13/35] KOTH go Brrrr (#1884) From cdfb4a5ac3d6feb9f670b635a3c7ef01c964bd34 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:40:37 -0600 Subject: [PATCH 14/35] Revert erroneous heat change (#1883) From 1eaf3803022e21d683191736f663f0e2e62153f8 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:50:21 -0600 Subject: [PATCH 15/35] Hard-sync winning KOTH faction (#1885) --- .../SUGMA/GameModes/Elimination/EliminationGamemode.cs | 7 ++++--- .../Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs index ad0a0a902..4ce267c3f 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs @@ -182,9 +182,10 @@ public override void StartRound(string[] arguments = null) "\n- Tracked grids:" + trackedGrids); } + protected bool _setWinnerFromArgs = false; public override void StopRound() { - bool setWinnerFromArgs = false; + _setWinnerFromArgs = false; foreach (var arg in Arguments) { if (arg.StartsWith("win")) @@ -194,12 +195,12 @@ public override void StopRound() long.TryParse(arg.Remove(0, 3), out factionId); _winningFaction = MyAPIGateway.Session.Factions.TryGetFactionById(factionId); - setWinnerFromArgs = true; + _setWinnerFromArgs = true; break; } } - if (!setWinnerFromArgs && MyAPIGateway.Session.IsServer) + if (!_setWinnerFromArgs && MyAPIGateway.Session.IsServer) { Arguments = Arguments.Concat(new[] { $"win{_winningFaction?.FactionId ?? -1}" }).ToArray(); } diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs index 1b2922307..14eac3484 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs @@ -59,8 +59,10 @@ public override void StartRound(string[] arguments = null) public override void StopRound() { base.StopRound(); + if (!_setWinnerFromArgs) + _winningFaction = ControlPoint._zoneOwner; - SUGMA_SessionComponent.I.GetComponent("KOTHHud")?.MatchEnded(ControlPoint._zoneOwner); + SUGMA_SessionComponent.I.GetComponent("KOTHHud")?.MatchEnded(_winningFaction); SUGMA_SessionComponent.I.UnregisterComponent("KOTHHud"); ControlPoint = null; From 82c69018e11241757ce14194bcd8104935c7f11f Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:58:09 -0600 Subject: [PATCH 16/35] Dev (#1886) --- .../Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs index 14eac3484..5d1fda10a 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs @@ -58,6 +58,7 @@ public override void StartRound(string[] arguments = null) public override void StopRound() { + _winningFaction = ControlPoint._zoneOwner; base.StopRound(); if (!_setWinnerFromArgs) _winningFaction = ControlPoint._zoneOwner; From 355f22bacac3998c4e6d18737edcd3f606a6d184 Mon Sep 17 00:00:00 2001 From: CommodoreChet <50426713+CommodoreChet@users.noreply.github.com> Date: Thu, 6 Feb 2025 21:00:02 -0600 Subject: [PATCH 17/35] shrink Indicator --- .../Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs | 2 +- .../Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs index 5d1fda10a..48e8ff78d 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs @@ -24,7 +24,7 @@ internal partial class KOTHGamemode : EliminationGamemode public override string ReadableName { get; internal set; } = "King Of The Hill"; public override string Description { get; internal set; } = - "Factions fight over a Central Capture Point. Either spend 2 minutes uncontested in the center zone, or eliminate the enemy team to win."; + "Fight to Control the Capture Point. Either hold it uncontested, or eliminate the enemy team to win."; public KOTHGamemode() { diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs index 3dd313484..0a8c4756c 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs @@ -72,15 +72,15 @@ public KOTHHud_Window(HudParentBase parent, KOTHGamemode gamemode) : base(parent { Material = _circleMaterial, ParentAlignment = ParentAlignments.Bottom | ParentAlignments.Center, - Size = Vector2.One * 64, - Offset = new Vector2(0, -15), + Size = Vector2.One * 32, + Offset = new Vector2(0, -10), ZOffset = sbyte.MaxValue }; _captureLabel = new Label(_captureIndicator) { ParentAlignment = ParentAlignments.Center, - Offset = new Vector2(0, -55), + Offset = new Vector2(0, -35), Text = "Initializing KOTH..." }; From 4fa23af36748d122a5116d166383c78b508034b1 Mon Sep 17 00:00:00 2001 From: CommodoreChet <50426713+CommodoreChet@users.noreply.github.com> Date: Thu, 6 Feb 2025 21:03:05 -0600 Subject: [PATCH 18/35] shrink Indicator (#1887) From bb4ea6571812041040a07718daa68f1ebde6c481 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 6 Feb 2025 21:35:40 -0600 Subject: [PATCH 19/35] Fix KOTH win condition display (#1888) --- .../SUGMA/GameModes/Elimination/EliminationGamemode.cs | 4 ++-- .../Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs index 4ce267c3f..e58604d45 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs @@ -190,12 +190,12 @@ public override void StopRound() { if (arg.StartsWith("win")) { - Log.Info("Winner in arguments found: " + arg); long factionId; long.TryParse(arg.Remove(0, 3), out factionId); _winningFaction = MyAPIGateway.Session.Factions.TryGetFactionById(factionId); - _setWinnerFromArgs = true; + setWinnerFromArgs = true; + Log.Info($"Winner in arguments found: {factionId} ({_winningFaction?.Name})"); break; } } diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs index 48e8ff78d..1ef5a9c00 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs @@ -72,13 +72,13 @@ public override void StopRound() internal override void DisplayWinMessage() { - if (ControlPoint._zoneOwner == null) + if (_winningFaction == null) { MyAPIGateway.Utilities.ShowNotification("YOU ARE ALL LOSERS.", 10000, "Red"); return; } - MyAPIGateway.Utilities.ShowNotification($"A WINNER IS [{ControlPoint._zoneOwner?.Name}]!", 10000); + MyAPIGateway.Utilities.ShowNotification($"A WINNER IS [{_winningFaction?.Name}]!", 10000); } public override void UpdateActive() From 54b1f8ef68bcd9f547217f6e708144f7bc9cb3a6 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 6 Feb 2025 21:44:12 -0600 Subject: [PATCH 20/35] fix merge failure (#1890) --- .../SUGMA/GameModes/Elimination/EliminationGamemode.cs | 5 ++--- .../Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs | 2 -- .../Data/Scripts/SUGMA/Utilities/SUtils.cs | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs index e58604d45..c7034ba57 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationGamemode.cs @@ -182,10 +182,9 @@ public override void StartRound(string[] arguments = null) "\n- Tracked grids:" + trackedGrids); } - protected bool _setWinnerFromArgs = false; public override void StopRound() { - _setWinnerFromArgs = false; + bool setWinnerFromArgs = false; foreach (var arg in Arguments) { if (arg.StartsWith("win")) @@ -200,7 +199,7 @@ public override void StopRound() } } - if (!_setWinnerFromArgs && MyAPIGateway.Session.IsServer) + if (!setWinnerFromArgs && MyAPIGateway.Session.IsServer) { Arguments = Arguments.Concat(new[] { $"win{_winningFaction?.FactionId ?? -1}" }).ToArray(); } diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs index 1ef5a9c00..274dd7ffd 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs @@ -60,8 +60,6 @@ public override void StopRound() { _winningFaction = ControlPoint._zoneOwner; base.StopRound(); - if (!_setWinnerFromArgs) - _winningFaction = ControlPoint._zoneOwner; SUGMA_SessionComponent.I.GetComponent("KOTHHud")?.MatchEnded(_winningFaction); SUGMA_SessionComponent.I.UnregisterComponent("KOTHHud"); diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs index d1dc25512..525c171a9 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs @@ -49,7 +49,7 @@ public static void SetWorldPermissionsForMatch(bool matchActive) MySessionComponentSafeZones.AllowedActions = CastProhibit(MySessionComponentSafeZones.AllowedActions, matchActive ? MatchPermsInt : FullPermsInt); - if (matchActive && MyAPIGateway.Session.IsServer) + if (matchActive && (MyAPIGateway.Session?.IsServer ?? false)) ClearImageLcds(); } From c47a4bffd8d49e00e0844063bc33d38aea66d911 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Thu, 6 Feb 2025 22:20:52 -0600 Subject: [PATCH 21/35] Misc. SUGMA changes (#1891) --- .../Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs | 1 + .../Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs | 2 +- .../Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs | 1 + .../Data/Scripts/SUGMA/Utilities/SUtils.cs | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs index ccdfb9277..ecbbeccfa 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/Elimination/EliminationHud.cs @@ -122,6 +122,7 @@ public void Update() public void MatchEnded(IMyFaction winner) { + Log.Info("EliminationHud.cs:125 MatchEnded (" + winner?.Name + ")"); _matchEnded = true; var winnerPoints = 0; foreach (var banner in Banners) diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs index 274dd7ffd..151ea2ae9 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHGamemode.cs @@ -58,7 +58,7 @@ public override void StartRound(string[] arguments = null) public override void StopRound() { - _winningFaction = ControlPoint._zoneOwner; + _winningFaction = ControlPoint?._zoneOwner; base.StopRound(); SUGMA_SessionComponent.I.GetComponent("KOTHHud")?.MatchEnded(_winningFaction); diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs index 0a8c4756c..2a899b44c 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/GameModes/KingOfTheHill/KOTHHud.cs @@ -130,6 +130,7 @@ public void Update() public void MatchEnded(IMyFaction winner) { + Log.Info("KOTHHud.cs:133 MatchEnded (" + winner?.Name + ")"); _captureIndicator.Visible = false; _captureLabel.Visible = false; diff --git a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs index 525c171a9..aec9bd4a1 100644 --- a/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs +++ b/Gamemode Mods/StarCore SUGMA Gamemodes/Data/Scripts/SUGMA/Utilities/SUtils.cs @@ -124,7 +124,7 @@ public static void ClearBoard(bool resetFactions) foreach (var player in PlayerTracker.I.AllPlayers) { (player.Value.Controller.ControlledEntity as IMyCockpit)?.RemovePilot(); - player.Value.Character?.SetPosition(spawnPos + RandVector(-50, 50) * Vector3D.Right); + player.Value.Character?.Teleport(MatrixD.CreateWorld(spawnPos + RandVector(-50, 50) * Vector3D.Right)); } } else From 8398e4d268608bd1563b50ceceec12ee746d4718 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:32:22 -0600 Subject: [PATCH 22/35] Tune up new fusion radiators (#1892) --- .../Data/Scripts/Additions/PointAdditions.cs | 3 +++ .../MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc | 2 +- Utility Mods/MoA Fusion Systems/Data/BlockCategories.sbc | 2 +- .../MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs b/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs index 9ea961c32..3bcf84387 100644 --- a/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs +++ b/Gamemode Mods/Starcore_Pointslist/Data/Scripts/Additions/PointAdditions.cs @@ -762,6 +762,9 @@ internal class PointAdditions : MySessionComponentBase ["Caster_Reactor"] = 125, ["Heat_Heatsink"] = 10, ["Heat_FlatRadiator"] = 10, + ["ActiveRadiator"] = 250, + ["RadiatorPanel"] = 5, + ["ExtendableRadiatorBase"] = 5, #endregion }; diff --git a/Utility Mods/MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc b/Utility Mods/MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc index 7f6031369..c908eab58 100644 --- a/Utility Mods/MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc +++ b/Utility Mods/MoA Fusion Systems/Data/ActiveRadiatorParticle.sbc @@ -315,7 +315,7 @@ true - 0 + 1 0 diff --git a/Utility Mods/MoA Fusion Systems/Data/BlockCategories.sbc b/Utility Mods/MoA Fusion Systems/Data/BlockCategories.sbc index b9195b695..47d25cb99 100644 --- a/Utility Mods/MoA Fusion Systems/Data/BlockCategories.sbc +++ b/Utility Mods/MoA Fusion Systems/Data/BlockCategories.sbc @@ -7,7 +7,7 @@ Fusion Systems - FusionSystems + Fusion Systems Caster_Accelerator_0 Caster_Accelerator_90 diff --git a/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc b/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc index 491910d46..d915be8dc 100644 --- a/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc +++ b/Utility Mods/MoA Fusion Systems/Data/CubeBlocks/ActiveRadiator.sbc @@ -35,6 +35,7 @@ + X \ No newline at end of file From 0a2b1cf98554e954a30c67711fae81012c2dca2e Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:40:37 -0600 Subject: [PATCH 23/35] Mostly functional upgraded fusion hud (#1894) --- ...f_score_background.sbc => HudTextures.sbc} | 12 + .../HudHelpers/FusionWindow.cs | 220 ++++++++++++++++++ .../HudHelpers/HudConstants.cs | 20 ++ .../ModularAssemblies/S_FusionPlayerHud.cs | 12 +- .../Textures/HudBackground.dds | Bin 0 -> 54548 bytes .../Textures/HudBackground.pdn | Bin 0 -> 5317 bytes 6 files changed, 259 insertions(+), 5 deletions(-) rename Utility Mods/MoA Fusion Systems/Data/{ctf_score_background.sbc => HudTextures.sbc} (71%) create mode 100644 Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs create mode 100644 Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/HudConstants.cs create mode 100644 Utility Mods/MoA Fusion Systems/Textures/HudBackground.dds create mode 100644 Utility Mods/MoA Fusion Systems/Textures/HudBackground.pdn diff --git a/Utility Mods/MoA Fusion Systems/Data/ctf_score_background.sbc b/Utility Mods/MoA Fusion Systems/Data/HudTextures.sbc similarity index 71% rename from Utility Mods/MoA Fusion Systems/Data/ctf_score_background.sbc rename to Utility Mods/MoA Fusion Systems/Data/HudTextures.sbc index 0e6538197..dadd3556e 100644 --- a/Utility Mods/MoA Fusion Systems/Data/ctf_score_background.sbc +++ b/Utility Mods/MoA Fusion Systems/Data/HudTextures.sbc @@ -25,5 +25,17 @@ 0.1 Textures\fusionBarBackground.dds + + + TransparentMaterialDefinition + HudBackground + + false + 1 + false + false + 0.1 + Textures\HudBackground.dds + diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs new file mode 100644 index 000000000..8a8f76261 --- /dev/null +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs @@ -0,0 +1,220 @@ +using Epstein_Fusion_DS.Communication; +using Epstein_Fusion_DS.FusionParts; +using Epstein_Fusion_DS.HeatParts; +using RichHudFramework.UI; +using RichHudFramework.UI.Rendering; +using RichHudFramework.UI.Rendering.Client; +using Sandbox.Game.Entities; +using Sandbox.ModAPI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VRage.Game.Entity; +using VRage.Game.ModAPI; +using VRageMath; + +namespace Epstein_Fusion_DS.HudHelpers +{ + internal class FusionWindow : CamSpaceNode + { + private readonly TexturedBox _backgroundBox, _foregroundBox, _heatBox, _storBox; + private readonly Label _heatLabel, _storageLabel, _infoLabelLeft; + + private readonly GlyphFormat _stdTextFormat = new GlyphFormat(color: HudConstants.HudTextColor, alignment: TextAlignment.Center, font: FontManager.GetFont("BI_Monospace")); + private readonly GlyphFormat _stdTextFormatInfo = new GlyphFormat(color: HudConstants.HudTextColor, textSize: 0.85f, alignment: TextAlignment.Left, font: FontManager.GetFont("BI_Monospace")); + + public FusionWindow(HudParentBase parent) : base(parent) + { + RotationAxis = new Vector3(0, 1, 0); + RotationAngle = 0.25f; + TransformOffset = new Vector3D(-0.0675, -0.04, -0.05); + + _backgroundBox = new TexturedBox(this) + { + Material = new Material("WhiteSquare", HudConstants.HudSize), + Size = HudConstants.HudSize, + Color = HudConstants.HudBackgroundColor, + IsMasking = true, + ZOffset = sbyte.MinValue, + Padding = Vector2.Zero, + }; + _foregroundBox = new TexturedBox(this) + { + Material = new Material("HudBackground", new Vector2(400, 136)), + Size = HudConstants.HudSize, + ZOffset = sbyte.MaxValue, + }; + + _heatLabel = new Label(this) + { + Text = "00% HEAT", + Offset = new Vector2(0, 0), + Format = _stdTextFormat, + ZOffset = sbyte.MaxValue, + }; + _storageLabel = new Label(this) + { + Text = "00% STOR", + Offset = new Vector2(0, -_backgroundBox.Size.Y/3), + Format = _stdTextFormat, + ZOffset = sbyte.MaxValue, + }; + + _infoLabelLeft = new Label(this) + { + Text = "100% INTEGRITY - ALL SYSTEMS NOMINAL", + Offset = new Vector2(0, _backgroundBox.Size.Y/3), + Format = _stdTextFormat, + ZOffset = sbyte.MaxValue, + }; + + _heatBox = new TexturedBox(_backgroundBox) + { + Material = new Material("WhiteSquare", new Vector2(384, 38) * HudConstants.HudSizeRatio), + Size = new Vector2(384, 38) * HudConstants.HudSizeRatio, + ParentAlignment = ParentAlignments.Left | ParentAlignments.Top | ParentAlignments.Inner, + Offset = new Vector2(8, -49) * HudConstants.HudSizeRatio, + ZOffset = 0, + Color = Color.Red, + }; + + _storBox = new TexturedBox(_backgroundBox) + { + Material = new Material("WhiteSquare", new Vector2(384, 38) * HudConstants.HudSizeRatio), + Size = new Vector2(384, 38) * HudConstants.HudSizeRatio, + ParentAlignment = ParentAlignments.Left | ParentAlignments.Top | ParentAlignments.Inner, + Offset = new Vector2(8, -95) * HudConstants.HudSizeRatio, + ZOffset = 0, + Color = Color.Orange, + }; + } + + + private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi; + private int _ticks = 0; + private bool _shouldHide; + private MyEntity3DSoundEmitter _soundEmitter = null; + private readonly MySoundPair _alertSound = new MySoundPair("ArcSoundBlockAlert2"); + + public void Update() + { + _ticks++; + var playerCockpit = MyAPIGateway.Session?.Player?.Controller?.ControlledEntity?.Entity as IMyShipController; + + // Pulling the current HudState is SLOOOOWWWW, so we only pull it when tab is just pressed. + //if (MyAPIGateway.Input.IsNewKeyPressed(MyKeys.Tab)) + // _shouldHide = MyAPIGateway.Session?.Config?.HudState != 1; + + // Hide HUD element if the player isn't in a cockpit + if (playerCockpit == null || _shouldHide) + { + if (Visible) Visible = false; + + if (_soundEmitter != null) + { + _soundEmitter.StopSound(true); + _soundEmitter = null; + } + return; + } + + var playerGrid = playerCockpit.CubeGrid; + + float totalFusionCapacity = 0; + float totalFusionGeneration = 0; + float totalFusionStored = 0; + float reactorIntegrity = 0; + int reactorCount = 0; + + foreach (var system in SFusionManager.I.FusionSystems) + { + if (playerGrid != ModularApi.GetAssemblyGrid(system.Key)) + continue; + + totalFusionCapacity += system.Value.MaxPowerStored; + totalFusionGeneration += system.Value.PowerGeneration; + totalFusionStored += system.Value.PowerStored; + foreach (var reactor in system.Value.Reactors) + { + reactorIntegrity += reactor.Block.SlimBlock.Integrity/reactor.Block.SlimBlock.MaxIntegrity; + reactorCount++; + } + foreach (var thruster in system.Value.Thrusters) + { + reactorIntegrity += thruster.Block.SlimBlock.Integrity/thruster.Block.SlimBlock.MaxIntegrity; + reactorCount++; + } + } + reactorIntegrity /= reactorCount; + + // Hide HUD element if the grid has no fusion systems (capacity is always >0 for a fusion system) + if (totalFusionCapacity == 0) + { + if (Visible) Visible = false; + return; + } + + // Show otherwise + if (!Visible) Visible = true; + + var heatPct = HeatManager.I.GetGridHeatLevel(playerGrid); + + _heatBox.Width = 384 * HudConstants.HudSizeRatio.X * heatPct; + _heatBox.Color = new Color(heatPct, 1-heatPct, 0, 0.75f); + + _storBox.Width = 384 * HudConstants.HudSizeRatio.X * (totalFusionStored / totalFusionCapacity); + + _infoLabelLeft.Text = new RichText + { + {(reactorIntegrity*100).ToString("N0") + "%", _stdTextFormatInfo.WithColor(reactorIntegrity > 0.6 ? Color.White : Color.Red)}, + {" INTEGRITY - ", _stdTextFormatInfo}, + {GetNoticeText(heatPct, reactorIntegrity), GetNoticeFormat(heatPct, reactorIntegrity)}, + }; + + _heatLabel.Text = $"{heatPct*100:N0}% HEAT"; + _storageLabel.Text = $"{(totalFusionStored / totalFusionCapacity) * 100:N0}% STOR"; + + if (heatPct > 0.8f) + { + if (_soundEmitter == null) + { + _soundEmitter = new MyEntity3DSoundEmitter((MyEntity) playerCockpit.Entity) + { + CanPlayLoopSounds = true + }; + _soundEmitter.PlaySound(_alertSound); + } + } + else + { + if (_soundEmitter != null) + { + _soundEmitter.StopSound(true); + _soundEmitter = null; + } + } + } + + private string GetNoticeText(float heatPct, float integrityPct) + { + if (integrityPct < 0.1) + return "I DON'T WANT TO DIE."; + if (integrityPct < 0.5) + return "-!- REACTOR FAILURE -!-"; + if (integrityPct < 0.6) + return "-!- SHUTDOWN IMMINENT -!-"; + if (heatPct > 0.8) + return "! THERMAL DAMAGE !"; + return "ALL SYSTEMS NOMINAL"; + } + + private GlyphFormat GetNoticeFormat(float heatPct, float integrityPct) + { + if (integrityPct < 0.6 || heatPct > 0.8) + return _stdTextFormatInfo.WithColor(Color.Red); + return _stdTextFormatInfo; + } + } +} diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/HudConstants.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/HudConstants.cs new file mode 100644 index 000000000..cab42a67e --- /dev/null +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/HudConstants.cs @@ -0,0 +1,20 @@ +using RichHudFramework.UI.Rendering; +using VRageMath; + +namespace Epstein_Fusion_DS.HudHelpers +{ + /// + /// HUD constants class for Fusion Systems + /// + public static class HudConstants + { + public static readonly Color HudBackgroundColor = new Color(255, 255, 255, 40); + public static readonly Color HudTextColor = Color.White; + public static Vector2 HudSize = new Vector2(300, 102); + public static Vector2 HudSizeRatio = HudSize / new Vector2(400, 136); + + //public static Material BackgroundMaterial = new Material("HudBackground", new Vector2(435, 102)); + + //public static Vector2 HudAngle = new Vector2( + } +} diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs index e21fca76b..76f6d0a24 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/S_FusionPlayerHud.cs @@ -21,7 +21,7 @@ public class SFusionPlayerHud : MySessionComponentBase public static SFusionPlayerHud I; private int _ticks; - private ConsumptionBar _consumptionBar; + private FusionWindow _fusionHud; private static ModularDefinitionApi ModularApi => Epstein_Fusion_DS.ModularDefinition.ModularApi; private static SFusionManager FusionManager => SFusionManager.I; private static HeatManager HeatManager => HeatManager.I; @@ -53,15 +53,17 @@ public override void UpdateAfterSimulation() _ticks++; try { - if (_consumptionBar == null && RichHudClient.Registered) - _consumptionBar = new ConsumptionBar(HudMain.HighDpiRoot) + if (_fusionHud == null && RichHudClient.Registered) + { + _fusionHud = new FusionWindow(HudMain.HighDpiRoot) { Visible = true - }; + }; + } HeatManager.UpdateTick(); FusionManager.UpdateTick(); - _consumptionBar?.Update(); + _fusionHud?.Update(); if (ModularApi.IsDebug()) { diff --git a/Utility Mods/MoA Fusion Systems/Textures/HudBackground.dds b/Utility Mods/MoA Fusion Systems/Textures/HudBackground.dds new file mode 100644 index 0000000000000000000000000000000000000000..1e517cff8cdc7acb5740cec450102dc7a292fbf0 GIT binary patch literal 54548 zcmeI)L246G0LJkbA}ER^C#VH4pu2)lH@$%y*RBd)piy*X>sNpMrRCjcKh&q@H&3ts=K6N~F#B6ByGJ~BB(_^T@JIrDNE-5#4}3@hd`KGd zfe(C00(?js@_`S0NCJFF8uEb;d`JR(NE-5i4}3@hd`KGdfe(C00(?js@_`S0NCJFF z8uEb;d`JR(NE-5i4}3@hd`KGdfe(C00(?js@_`S0NCJFF8uEb;d`JR(NE-5i4}3@h zd`KGdfe(C00(?js@_`S0NCJFF8uEb;d`JR(NE-5i4}3@h56y?wWxKtdH@}{po}MmW zoHbt-<+^QW&H4rVc<{k`kO$Mq!+jroT6}$ZbaeEuKHDE(`{U!fKe7z#&-S}O@W3Mp z@F8i)i-+#Rz7J}DywM-}ue-eQz@tOpq350V-`I|+=9dac|J;F~uI1cT}snO?p&ai+jWCEE8Ji*l1)u!~~g;_w0sbo0i@_yJ0o$cEi)r zl(<*j<_qOMb1tRmh?IP#)=btE@>PN+znegHQVYgG$CjZ7?dB_GCW8z!Bt@J#Wvx_W zd4v*!gMKeoFV$dHR!TN6NPV)>%#mhPK$6_+reHzFU#XS(?Q|1I7FJ3vzy@Xore&tk|nD_0a*l z+b9^gjMIHz8Yjy_XV@!ccs_#?i8@Lq`zVuDP)R_%l0pfTOD0h!lO>0&BBZnt&*#Py zQ6JTL1t|j0la54by7Xuw%ApitB!l{;5>k}I@zT7g_3IHW%p~fA9dYEV>Kq@-n3mPE zB0G^_f%EscQEd0Zt}dsxs$AFa>+f^}wqflX7aFlGd#l|GihjA<3wDcrlrtLsAQ#yU z*rj~m4u@k#I?&x0V|+boVa)Q;07`{+7(ZsWqqUy36BFwEAibjp#V%)5M>>*yMs^3Y z`D%$*8tEL;EVb z{9F4?A=;?63kfx6gnUA=%W!QqCTMasQYbXTLiwO!T8(r`ibYVGDT~F(`RK5Y4pLks z5lk?C6zEEtHVA2KI6J;$*>WwMG!C#)eo^2*X&kn z0pL#`L)9g_jWx?f29{M*P|c2RV%as0J_}BCa*gAX`*s-mm~CPshb>Vid&*e2ZBp|T zH8)2;HVb_o0@!)gwBRU9OAl9uCYic^bb{a0N9}~(YGKJDVa;4mVGSFqv`#j?Ew*e- z;EcM=lysw|Hl}oh)*1MHFbj=nR18bu2+IXSn2B+h*8Z2^mo8p{ z!&B}#BCZhfzXlD$73E$aVgb7E&Kb;cbwq=h<`gmvaR@~E_EaEyb*95qNBEJMc5j>^ z<_Y{=?L4*xNH_R`dyxp(1=RDP^bRvQ``F8g2fE?f%c&Yvysfrm_g)$IRLDkT5i#%5 z5}c?>{@(s9MRl$cNa%1J8$jlM_dpnY{_o@xKNv>^Cz?CN!-XDPRho9WNykG^LOuB>(=<=vCdCM?i@~|Pn$jg!!jy3GyxHsVSH~?{PEw$BYXeGOPxLwN# zH9J=cF$j&rCjD2!D{$*tIi@8FS{@=@{;8G#2hS(aLa@h5$Rp}V33&xLahU$|1aS2j zU|i(3EjZc;CPR@0<=6n8_;>xYKt8wtUKwVW9S`hSSmIbP21QP zC49;m^iA`~$#I91Mpnk(<79F)a|+=EpZRCsN1ty-ck#Ab@W4lBS5(H^06yrYrKe_x z#>yRe9KeZ%pCBvTpCn=$rJn#0AlYI2Q{=<_X(FZ*K0_Kb7{HnEB>8ZkA!0hgLmCT! z{GXi);__mHc!gZ(%s(@Gh8jt`{CL3h<#nSiwvL)`2<(>Zfo+Q-Vr6$8oC`Sa=MIZNL2F=%EN)CPdqVee8+Via|0I>gS$wwrIx3x zxt}I&n!dI0YZ8V2&3ebloCvnJM=b#w6dK&zxeL!g3;Z2?>6pns2P5G7V0PE%iCA>D z<_V5*f_I1XgJ5;-uxc;@CnbY=U%`0 tqc=AB`(ZTZoocOi?lwOYp6;Q(arN4@gD>2}!aJ92emnmB50oY_@h`2dANK$N literal 0 HcmV?d00001 From ea9dd5894d85e58da69cc5568b4ecc83bbb0b9d4 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Wed, 26 Feb 2025 21:08:53 -0600 Subject: [PATCH 24/35] modify fusion hud (#1895) --- .../HudHelpers/FusionWindow.cs | 65 +++++++++++++++---- .../Data/Scripts/ModularAssemblies/Utils.cs | 5 +- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs index 8a8f76261..9ebfcca15 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs @@ -22,11 +22,14 @@ internal class FusionWindow : CamSpaceNode private readonly TexturedBox _backgroundBox, _foregroundBox, _heatBox, _storBox; private readonly Label _heatLabel, _storageLabel, _infoLabelLeft; - private readonly GlyphFormat _stdTextFormat = new GlyphFormat(color: HudConstants.HudTextColor, alignment: TextAlignment.Center, font: FontManager.GetFont("BI_Monospace")); - private readonly GlyphFormat _stdTextFormatInfo = new GlyphFormat(color: HudConstants.HudTextColor, textSize: 0.85f, alignment: TextAlignment.Left, font: FontManager.GetFont("BI_Monospace")); + private readonly GlyphFormat _stdTextFormat = new GlyphFormat(color: HudConstants.HudTextColor, alignment: TextAlignment.Center, font: FontManager.GetFont("Monospace")); + private readonly GlyphFormat _stdTextFormatInfo = new GlyphFormat(color: HudConstants.HudTextColor, textSize: 0.6f, alignment: TextAlignment.Left, font: FontManager.GetFont("Monospace")); public FusionWindow(HudParentBase parent) : base(parent) { + foreach (var font in FontManager.Fonts) + MyAPIGateway.Utilities.ShowMessage("FUS", font.Name); + RotationAxis = new Vector3(0, 1, 0); RotationAngle = 0.25f; TransformOffset = new Vector3D(-0.0675, -0.04, -0.05); @@ -169,7 +172,7 @@ public void Update() _infoLabelLeft.Text = new RichText { {(reactorIntegrity*100).ToString("N0") + "%", _stdTextFormatInfo.WithColor(reactorIntegrity > 0.6 ? Color.White : Color.Red)}, - {" INTEGRITY - ", _stdTextFormatInfo}, + {" INTEGRITY - ", _stdTextFormatInfo}, {GetNoticeText(heatPct, reactorIntegrity), GetNoticeFormat(heatPct, reactorIntegrity)}, }; @@ -197,23 +200,63 @@ public void Update() } } + private int _errRemainingTicks = 0; + private float _lastIntegrityPct = 1; + private string _lastErrText = ""; private string GetNoticeText(float heatPct, float integrityPct) { + if (integrityPct < _lastIntegrityPct && _errRemainingTicks == 0) + _errRemainingTicks = Utils.Random.Next(60, 120); + //_lastIntegrityPct = integrityPct; + + string baseText = "ALL SYSTEMS NOMINAL"; + char[] errArray = new[] + { + '?', + '░', + '▒', + '▓', + '█', + '*', + '%', + '@', + }; + if (integrityPct < 0.1) - return "I DON'T WANT TO DIE."; - if (integrityPct < 0.5) - return "-!- REACTOR FAILURE -!-"; - if (integrityPct < 0.6) - return "-!- SHUTDOWN IMMINENT -!-"; - if (heatPct > 0.8) - return "! THERMAL DAMAGE !"; - return "ALL SYSTEMS NOMINAL"; + baseText = " I DON'T WANT TO DIE. "; + else if (integrityPct < 0.5) + baseText = " -! REACTOR FAILURE !- "; + else if (integrityPct < 0.6) + baseText = "-! SHUTDOWN IMMINENT !-"; + else if (heatPct > 0.8) + baseText = " ! THERMAL DAMAGE ! "; + + if (_errRemainingTicks > 0 || integrityPct < 0.6) + { + if (_errRemainingTicks % 4 == 0) + { + var chars = baseText.ToCharArray(); + for (int i = Utils.Random.Next(0, baseText.Length/4); i < baseText.Length; i += Utils.Random.Next(1, baseText.Length/2)) + chars[i] = errArray[Utils.Random.Next(0, errArray.Length - 1)]; + baseText = new string(chars); + _lastErrText = baseText; + } + else + { + baseText = _lastErrText; + } + _errRemainingTicks--; + } + + return baseText; } private GlyphFormat GetNoticeFormat(float heatPct, float integrityPct) { if (integrityPct < 0.6 || heatPct > 0.8) return _stdTextFormatInfo.WithColor(Color.Red); + else if (_errRemainingTicks > 0) + return _stdTextFormatInfo.WithColor(Color.Yellow); return _stdTextFormatInfo; } } diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Utils.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Utils.cs index 50d5541e1..466ec002b 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Utils.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/Utils.cs @@ -1,9 +1,12 @@ -using VRageMath; +using System; +using VRageMath; namespace Epstein_Fusion_DS { public static class Utils { + public static Random Random = new Random(); + // TODO make this less inefficient. public static Matrix RotateMatrixAroundPoint(Matrix matrix, Vector3D point, Vector3D axis, double angleRadians) { From 2af5bdb5d102541ba879a18624e4db7676593270 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Fri, 28 Feb 2025 01:23:47 -0600 Subject: [PATCH 25/35] Update FusionWindow.cs --- .../Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs index 9ebfcca15..9d9df4b8f 100644 --- a/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs +++ b/Utility Mods/MoA Fusion Systems/Data/Scripts/ModularAssemblies/HudHelpers/FusionWindow.cs @@ -27,9 +27,6 @@ internal class FusionWindow : CamSpaceNode public FusionWindow(HudParentBase parent) : base(parent) { - foreach (var font in FontManager.Fonts) - MyAPIGateway.Utilities.ShowMessage("FUS", font.Name); - RotationAxis = new Vector3(0, 1, 0); RotationAngle = 0.25f; TransformOffset = new Vector3D(-0.0675, -0.04, -0.05); From ac8a26b34a365a42b121c2b2d2ff92e9c31451d8 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Mar 2025 16:05:20 -0600 Subject: [PATCH 26/35] Re-exclude SRBs from grid integrity calcs (#1898) --- .../Scripts/ShipPoints/ShipTracking/GridStats.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/ShipTracking/GridStats.cs b/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/ShipTracking/GridStats.cs index f0dc41672..205cde8be 100644 --- a/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/ShipTracking/GridStats.cs +++ b/Gamemode Mods/Starcore_Sharetrack/Data/Scripts/ShipPoints/ShipTracking/GridStats.cs @@ -13,6 +13,11 @@ namespace StarCore.ShareTrack.ShipTracking { internal class GridStats // TODO convert this to be event-driven. OnBlockPlace, etc. Keep a queue. { + private readonly string[] _ignoredIntegrityBlocks = new[] + { + "SC_SRB" + }; + private readonly HashSet _fatBlocks = new HashSet(); private readonly HashSet _slimBlocks; @@ -38,7 +43,7 @@ public GridStats(IMyCubeGrid grid) foreach (var block in _slimBlocks) { - if (block?.FatBlock != null) + if (block?.FatBlock != null && !_ignoredIntegrityBlocks.Contains(block.BlockDefinition.Id.SubtypeName)) { _fatBlocks.Add(block.FatBlock); GridIntegrity += block.Integrity; @@ -72,11 +77,11 @@ public void UpdateAfterSim() { float tempGridInteg = 0; - foreach (var block in _slimBlocks) + foreach (var block in _fatBlocks) { - if (block.FatBlock != null) // Remove To Count All Blocks + if (block != null && !_ignoredIntegrityBlocks.Contains(block.BlockDefinition.SubtypeName)) // Remove To Count All Blocks { - tempGridInteg += block.Integrity; + tempGridInteg += block.SlimBlock.Integrity; } } From 8ebc0ae155b632e50a877ccf7bff01de270dea2b Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Mar 2025 16:28:07 -0600 Subject: [PATCH 27/35] Emergency bounce zone fix (#1899) From 395c59b03378f6d1fbb9f8cb7eacf4ac154232fb Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Mar 2025 16:32:46 -0600 Subject: [PATCH 28/35] Emergency bounce zone fix (#1899) (#1900) From 7ea15c944e2d7083cb57814ac3dbfa57ccdee337 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Mar 2025 19:12:41 -0600 Subject: [PATCH 29/35] Create AiRange_EntityComponents.sbc --- .../Data/AiRange_EntityComponents.sbc | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 Utility Mods/SC_Season_4_Adjustments/Data/AiRange_EntityComponents.sbc diff --git a/Utility Mods/SC_Season_4_Adjustments/Data/AiRange_EntityComponents.sbc b/Utility Mods/SC_Season_4_Adjustments/Data/AiRange_EntityComponents.sbc new file mode 100644 index 000000000..b32182fb9 --- /dev/null +++ b/Utility Mods/SC_Season_4_Adjustments/Data/AiRange_EntityComponents.sbc @@ -0,0 +1,111 @@ + + + + + + + BasicMissionFollowHome + BasicMissionBlock + + 2 + 0 + 19990 + 0 + 1 + 20000 + 1000 + + + + EventDistanceToLockedTarget + EventControllerBlockComponent + + 22 + 25000 + 25000 + + + + + OffensiveCombatCircleOrbit + OffensiveCombatBlock + + 0 + 100 + 20000 + 2 + + + + OffensiveCombatHitAndRun + OffensiveCombatBlock + + 5000 + 10000 + 2 + 90 + 2 + + + + OffensiveCombatIntercept + OffensiveCombatBlock + + 3 + + + + OffensiveCombatStayAtRange + OffensiveCombatBlock + + 2 + 1 + + + + + SearchEnemyComponent + DefaultEnemySearch + + 20000 + + + From c030a706710dd277c04da917bab4574e0da5c289 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Mar 2025 19:39:01 -0600 Subject: [PATCH 30/35] Disable monowhip animation (#1896) Co-authored-by: Darth411 <128270123+Darth411@users.noreply.github.com> --- .../{NEC_Whip_Crystal.bsl => NEC_Whip_Crystal.bsl.disabled} | 2 +- Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info | 1 - Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info.disabled | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) rename Weapon Mods/40k-Weapons-Mod/Data/Animation/{NEC_Whip_Crystal.bsl => NEC_Whip_Crystal.bsl.disabled} (99%) delete mode 100644 Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info create mode 100644 Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info.disabled diff --git a/Weapon Mods/40k-Weapons-Mod/Data/Animation/NEC_Whip_Crystal.bsl b/Weapon Mods/40k-Weapons-Mod/Data/Animation/NEC_Whip_Crystal.bsl.disabled similarity index 99% rename from Weapon Mods/40k-Weapons-Mod/Data/Animation/NEC_Whip_Crystal.bsl rename to Weapon Mods/40k-Weapons-Mod/Data/Animation/NEC_Whip_Crystal.bsl.disabled index 444c291d7..0f65db8c4 100644 --- a/Weapon Mods/40k-Weapons-Mod/Data/Animation/NEC_Whip_Crystal.bsl +++ b/Weapon Mods/40k-Weapons-Mod/Data/Animation/NEC_Whip_Crystal.bsl.disabled @@ -30,4 +30,4 @@ action Block() { API.stoploop("rotateCrystal") API.stoploop("bounceCrystal") } -} \ No newline at end of file +} diff --git a/Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info b/Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info deleted file mode 100644 index 671be8d7d..000000000 --- a/Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info +++ /dev/null @@ -1 +0,0 @@ -Animation NEC_Whip_Crystal \ No newline at end of file diff --git a/Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info.disabled b/Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info.disabled new file mode 100644 index 000000000..5dc7658b9 --- /dev/null +++ b/Weapon Mods/40k-Weapons-Mod/Data/Animation/main.info.disabled @@ -0,0 +1 @@ +Animation NEC_Whip_Crystal From 25038c0ad05f76972bf18ae880e51e720db7ad70 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sat, 1 Mar 2025 19:40:09 -0600 Subject: [PATCH 31/35] Merge branch 'stable' into main From 24c51c2088f9f8d811d6f44a29de04759e0288ff Mon Sep 17 00:00:00 2001 From: CommodoreChet <50426713+CommodoreChet@users.noreply.github.com> Date: Sat, 1 Mar 2025 22:37:48 -0600 Subject: [PATCH 32/35] Configurable Minimum Siege Time --- .../FieldGenerator/FieldGenerator_Config.cs | 2 ++ .../FieldGenerator/FieldGenerator_Core.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Config.cs b/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Config.cs index 7b821d10f..4822e35e5 100644 --- a/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Config.cs +++ b/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Config.cs @@ -34,6 +34,7 @@ public class Generator_Settings public float MinPowerDraw = 50.00f; public int MaxSiegeTime = 60; + public int MinSiegeTime = 15; public int SiegePowerDraw = 900; public float SiegeModeResistence = 0.9f; @@ -56,6 +57,7 @@ void LoadConfig(MyIni iniParser) MinPowerDraw = iniParser.Get(IniSection, nameof(MinPowerDraw)).ToSingle(MinPowerDraw); MaxSiegeTime = iniParser.Get(IniSection, nameof(MaxSiegeTime)).ToInt32(MaxSiegeTime); + MinSiegeTime = iniParser.Get(IniSection, nameof(MinSiegeTime)).ToInt32(MinSiegeTime); SiegePowerDraw = iniParser.Get(IniSection, nameof(SiegePowerDraw)).ToInt32(SiegePowerDraw); SiegeModeResistence = iniParser.Get(IniSection, nameof(SiegeModeResistence)).ToSingle(SiegeModeResistence); diff --git a/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs b/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs index ab5b00db3..cb8c55567 100644 --- a/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs +++ b/Utility Mods/SCDefenseBlocks/Data/Scripts/OneFuckingFolderDeeper/FieldGenerator/FieldGenerator_Core.cs @@ -471,7 +471,7 @@ private void EndSiegeMode() SiegeBlockEnabler(Block.CubeGrid.GetFatBlocks(), true); - SiegeCooldownTime.Value = (SiegeElapsedTime.Value > 5) ? (SiegeElapsedTime.Value * 2) : 5; + SiegeCooldownTime.Value = (SiegeElapsedTime.Value > Config.MinSiegeTime) ? (SiegeElapsedTime.Value * 2) : Config.MinSiegeTime; SiegeElapsedTime.Value = 0; SiegeCooldownActive.Value = true; } From 5831e2d771a92b1b7089da4f87daf330782a3dca Mon Sep 17 00:00:00 2001 From: CommodoreChet <50426713+CommodoreChet@users.noreply.github.com> Date: Sat, 1 Mar 2025 22:39:52 -0600 Subject: [PATCH 33/35] Configurable Minimum Siege Time (#1902) From 5468952e5edce4812d4e0dc7a756ceb5329b3fe5 Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Sun, 2 Mar 2025 13:22:05 -0600 Subject: [PATCH 34/35] Update and rename modinfo.sbmi to modinfo_main.sbmi From 67f87a4fac9d0539e496df5b13641ae5bbf4422d Mon Sep 17 00:00:00 2001 From: Aristeas <94058548+ari-steas@users.noreply.github.com> Date: Wed, 5 Mar 2025 19:41:43 -0600 Subject: [PATCH 35/35] Azimuth lock Charon to a 90 degree cone --- .../Data/Scripts/CoreParts/Charon.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs b/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs index 7a5721d15..3a9db9986 100644 --- a/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs +++ b/Weapon Mods/Starcore_Serpent_Arms_Heavy_Metal/Data/Scripts/CoreParts/Charon.cs @@ -94,8 +94,8 @@ partial class Parts { { RotateRate = 0.013f, // Max traversal speed of azimuth subpart in radians per tick (0.1 is approximately 360 degrees per second). ElevateRate = 0.0075f, // Max traversal speed of elevation subpart in radians per tick. - MinAzimuth = -180, - MaxAzimuth = 180, + MinAzimuth = -45, + MaxAzimuth = 45, MinElevation = -13, MaxElevation = 45, HomeAzimuth = 0, // Default resting rotation angle