This commit is contained in:
Redrover1760
2026-04-02 11:03:33 -04:00
parent 8d91e0d13e
commit 145e311621
7 changed files with 65 additions and 50 deletions
@@ -9,7 +9,6 @@ using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Systems;
using Robust.Shared.Map.Components;
using Robust.Shared.Timing;
using System;
namespace Content.Server._Mono.Detection;
@@ -21,18 +20,22 @@ public sealed class ThermalSignatureSystem : EntitySystem
[Dependency] private readonly SharedPowerReceiverSystem _power = default!;
[Dependency] private readonly IGameTiming _timing = default!;
private float _updateInterval = 0.5f;
private float _updateAccumulator = 0f;
private EntityQuery<MapGridComponent> _gridQuery;
private const float UpdateIntervalSeconds = 1f;
private static readonly TimeSpan UpdateInterval = TimeSpan.FromSeconds(UpdateIntervalSeconds);
private TimeSpan _nextUpdateTime;
private const float HeatChangeThreshold = 1.02f;
private EntityQuery<ThermalSignatureComponent> _sigQuery;
private EntityQuery<GunComponent> _gunQuery;
private Dictionary<EntityUid, ThermalSignatureComponent> _gridCompMap = new();
private EntityQuery<MapGridComponent> _mapGridQuery;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<GridInitializeEvent>(OnGridInitialized);
// some of this could also be handled in shared but there's no point since PVS is a thing
SubscribeLocalEvent<MachineThermalSignatureComponent, GetThermalSignatureEvent>(OnMachineGetSignature);
SubscribeLocalEvent<PassiveThermalSignatureComponent, GetThermalSignatureEvent>(OnPassiveGetSignature);
@@ -42,9 +45,14 @@ public sealed class ThermalSignatureSystem : EntitySystem
SubscribeLocalEvent<ThrusterComponent, GetThermalSignatureEvent>(OnThrusterGetSignature);
SubscribeLocalEvent<FTLDriveComponent, GetThermalSignatureEvent>(OnFTLGetSignature);
_gridQuery = GetEntityQuery<MapGridComponent>();
_sigQuery = GetEntityQuery<ThermalSignatureComponent>();
_gunQuery = GetEntityQuery<GunComponent>();
_mapGridQuery = GetEntityQuery<MapGridComponent>();
}
private void OnGridInitialized(GridInitializeEvent args)
{
EnsureComp<ThermalSignatureComponent>(args.EntityUid);
}
private void OnGunShot(Entity<ThermalSignatureComponent> ent, ref GunShotEvent args)
@@ -87,48 +95,45 @@ public sealed class ThermalSignatureSystem : EntitySystem
public override void Update(float frameTime)
{
_updateAccumulator += frameTime;
if (_updateAccumulator < _updateInterval)
if (_timing.CurTime < _nextUpdateTime)
return;
_updateAccumulator -= _updateInterval;
var interval = _updateInterval;
_nextUpdateTime = _timing.CurTime + UpdateInterval;
_gridCompMap.Clear();
var gridQuery = EntityQueryEnumerator<MapGridComponent>();
while (gridQuery.MoveNext(out var uid, out _))
var gridQuery = EntityQueryEnumerator<MapGridComponent, ThermalSignatureComponent>();
while (gridQuery.MoveNext(out _, out _, out var gridSigComp))
{
if (!_sigQuery.TryComp(uid, out var sigComp))
sigComp = EnsureComp<ThermalSignatureComponent>(uid);
sigComp.TotalHeat = 0f;
_gridCompMap.Add(uid, sigComp);
gridSigComp.TotalHeat = 0f;
}
var query = EntityQueryEnumerator<ThermalSignatureComponent>();
while (query.MoveNext(out var uid, out var sigComp))
{
var ev = new GetThermalSignatureEvent(interval);
var ev = new GetThermalSignatureEvent();
RaiseLocalEvent(uid, ref ev);
sigComp.StoredHeat += ev.Signature * interval;
sigComp.StoredHeat *= MathF.Pow(sigComp.HeatDissipation, interval);
if (_gridCompMap.ContainsKey(uid))
sigComp.StoredHeat += ev.Signature * UpdateIntervalSeconds;
sigComp.StoredHeat *= MathF.Pow(sigComp.HeatDissipation, UpdateIntervalSeconds);
if (_mapGridQuery.HasComp(uid))
{
sigComp.TotalHeat += sigComp.StoredHeat;
// don't sync it if it didn't change heat much since last time, we don't need to sync 500 cold asteroids every system update
if (sigComp.TotalHeat <= sigComp.LastUpdateHeat * HeatChangeThreshold
&& sigComp.TotalHeat >= sigComp.LastUpdateHeat / HeatChangeThreshold)
continue;
sigComp.LastUpdateHeat = sigComp.TotalHeat;
Dirty(uid, sigComp);
}
else
{
var xform = Transform(uid);
sigComp.TotalHeat = sigComp.StoredHeat;
if (xform.GridUid != null && _gridCompMap.TryGetValue(xform.GridUid.Value, out var gridSig))
if (xform.GridUid != null && _sigQuery.TryGetComponent(xform.GridUid.Value, out var gridSig))
gridSig.TotalHeat += sigComp.StoredHeat;
}
}
foreach (var (uid, sigComp) in _gridCompMap)
{
Dirty(uid, sigComp); // sync to client
}
}
}
@@ -107,7 +107,8 @@ public sealed partial class RadarBlipSystem : EntitySystem
if (blipGrid != null)
{
var gridXform = Transform(blipGrid.Value);
blipVelocity -= _physics.GetLinearVelocity(blipGrid.Value, coord.Position);
if (TryComp<PhysicsComponent>(blipGrid.Value, out var gridBody)) // prevent log spam
blipVelocity -= _physics.GetLinearVelocity(blipGrid.Value, coord.Position, gridBody);
// it's local-frame velocity so rotate it too
blipVelocity = (-gridXform.LocalRotation).RotateVec(blipVelocity);
// and also offset the rotation
@@ -38,7 +38,6 @@ public sealed class VendingMachinePurchaseSystem : EntitySystem
var purchaseComponent = AddComp<VendingMachinePurchaseComponent>(purchasedEntity);
purchaseComponent.PurchaseGrid = vendingTransform.GridUid.Value;
purchaseComponent.OriginalPurchasePrice = purchasePrice;
purchaseComponent.VendingMachine = vendingMachine;
Dirty(purchasedEntity, purchaseComponent);
}
@@ -9,6 +9,9 @@ namespace Content.Shared._Mono.Detection;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ThermalSignatureComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public float LastUpdateHeat = 0f;
[DataField]
public float StoredHeat = 0f;
@@ -22,11 +22,4 @@ public sealed partial class VendingMachinePurchaseComponent : Component
/// </summary>
[DataField, AutoNetworkedField]
public double OriginalPurchasePrice;
/// <summary>
/// The entity ID of the vending machine this was purchased from.
/// Stored for reference and potential future features.
/// </summary>
[DataField, AutoNetworkedField]
public EntityUid VendingMachine;
}
+24 -10
View File
@@ -14775,7 +14775,7 @@ Entries:
- type: Add
message: >-
The DIS Pluto MK. II has pierced it's way on the hull market. A
replacement of the honorable Pluto.
replacement of the honorable Pluto.
- type: Remove
message: >-
DIS Pluto hulls are no longer available on the hull market. We will miss
@@ -14885,7 +14885,7 @@ Entries:
- type: Tweak
message: >-
Spasaka sabotage kit has gotten equipment changes to help with boarding
as well as receiving the RX-01 suit.
as well as receiving the RX-01 suit.
id: 1651
time: '2025-12-13T08:10:05.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/2782
@@ -15226,7 +15226,7 @@ Entries:
- type: Tweak
message: >-
Bluespace crates occur more frequently. By extension there will be fewer
solar flares.
solar flares.
- type: Tweak
message: >-
Increased the number of smuggling hints sent out to ships. Happy
@@ -15789,7 +15789,7 @@ Entries:
- type: Add
message: >-
A new challanger! BT-Y Hazel enters the PDV Roster as a small-strafer in
place of the Vega featuring a 3 barreled 220m Battery!
place of the Vega featuring a 3 barreled 220m Battery!
- type: Remove
message: PDV Vega is now gone, o7.
id: 1752
@@ -15815,7 +15815,7 @@ Entries:
The Europa is now a beefy capital ship with medical and cloning
capabilities. She is now restricted to two vessels active at a time, as
well as costing 240k. These changes come with the benefit of a heavy
upgrade. Glory to Phaethon.
upgrade. Glory to Phaethon.
id: 1754
time: '2026-01-05T16:53:42.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/2929
@@ -16677,7 +16677,7 @@ Entries:
- type: Tweak
message: >-
Advanced chemicals now have 0.15u metabolism rate. Pyrazine healing was
buffed to 2.
buffed to 2.
- type: Tweak
message: Overseer's heavy maul sprite received changes.
id: 1847
@@ -16904,7 +16904,7 @@ Entries:
- type: Tweak
message: >-
Horizon Energy has begun sale of modernized versions of the Windreign to
the Colossus Sector.
the Colossus Sector.
id: 1871
time: '2026-02-01T19:28:28.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/3141
@@ -17076,7 +17076,7 @@ Entries:
message: >-
the local syndicate outpost has finally invested in some automated
defenses. woe be the raider who tries to illegally park their ship right
in front of the outpost.
in front of the outpost.
id: 1887
time: '2026-02-11T01:31:25.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/3044
@@ -17408,7 +17408,7 @@ Entries:
- type: Tweak
message: >-
Mech Fuel Cell now costs Fissile Uranium (1) and Diamond (1) among other
cost changes, but auto-regens to full within 4 minutes.
cost changes, but auto-regens to full within 4 minutes.
- type: Tweak
message: >-
Balance pass on Armored Frame (S2/S4 mech) weapons - RAC-6 spreads
@@ -18895,7 +18895,7 @@ Entries:
- type: Tweak
message: >-
The DIS Femur has seen a light rework, see PR for more details. Report
feedback & issues to me on discord (@unicornonlsd)
feedback & issues to me on discord (@unicornonlsd)
id: 2085
time: '2026-03-26T05:55:13.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/3560
@@ -19158,3 +19158,17 @@ Entries:
id: 2112
time: '2026-03-30T16:56:00.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/3643
- author: Redrover1760
changes:
- type: Tweak
message: Biomass spread rate, health, and slowdown reduced.
id: 2113
time: '2026-04-01T16:22:03.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/3635
- author: UnicornOnLSD
changes:
- type: Add
message: Management has sent an ore box to the DIS Rig after customer complaints.
id: 2114
time: '2026-04-01T22:08:49.0000000+00:00'
url: https://github.com/Monolith-Station/Monolith/pull/3672
@@ -8,7 +8,7 @@
Players must have valid in-character reasons to kill or attack another player.
- Any conflict is allowed with a [color=red][bold]proper, reasonable RP reason[/bold][/color]. A stolen magazine may be reasoning for a fistfight, but not a meatgrinder.
-- Vessel crew is allowed to KOS anyone who hacks or breaks their locked doors under "Castle doctrine".
-- Vessel crew is allowed to KOS anyone who hacks or breaks their locked doors under "Castle doctrine".
- Combat should arise naturally through roleplay, with proper escalation and meaningful interaction.
-- Combat escalation should be stated in local, shortband, or broadband chat/radio channels and must be clearly declared to those involved. (ex. "It's over Jackson, die fucker!!" in local chat, or shortband)
- Escalation to combat immediately is allowed in select circumstances such as command bounties, confirmed pirates, chimera/ADC, etc.