Merge branch 'master' into offmed-staging

This commit is contained in:
Janet Blackquill
2025-10-03 20:30:42 -04:00
9 changed files with 26 additions and 29 deletions

View File

@@ -54,7 +54,7 @@ public sealed class XATMagnetSystem : BaseQueryUpdateXATSystem<XATMagnetComponen
if (node.Attached == null)
continue;
var artifact = _xenoArtifactQuery.Get(GetEntity(node.Attached.Value));
var artifact = _xenoArtifactQuery.Get(node.Attached.Value);
if (!CanTrigger(artifact, (uid, node)))
continue;

View File

@@ -32,7 +32,7 @@ public sealed partial class XenoArtifactNodeComponent : Component
/// The entity whose graph this node is a part of.
/// </summary>
[DataField, AutoNetworkedField]
public NetEntity? Attached;
public EntityUid? Attached;
#region Durability
/// <summary>

View File

@@ -53,8 +53,8 @@ public abstract partial class SharedXenoArtifactSystem
/// <exception cref="ArgumentException">Throws if requested index doesn't exist on artifact. </exception>
public Entity<XenoArtifactNodeComponent> GetNode(Entity<XenoArtifactComponent> ent, int index)
{
if (ent.Comp.NodeVertices[index] is { } netUid && GetEntity(netUid) is var uid)
return (uid, XenoArtifactNode(uid));
if (ent.Comp.NodeVertices[index] is { } netUid && GetEntity(netUid) is var uid && _nodeQuery.TryComp(uid, out var comp))
return (uid, comp);
throw new ArgumentException($"index {index} does not correspond to an existing node in {ToPrettyString(ent)}");
}
@@ -71,8 +71,8 @@ public abstract partial class SharedXenoArtifactSystem
if (index < 0 || index >= ent.Comp.NodeVertices.Length)
return false;
if (ent.Comp.NodeVertices[index] is { } netUid && GetEntity(netUid) is var uid)
node = (uid, XenoArtifactNode(uid));
if (ent.Comp.NodeVertices[index] is { } netUid && GetEntity(netUid) is var uid && _nodeQuery.TryComp(uid, out var comp))
node = (uid, comp);
return node != null;
}
@@ -102,8 +102,8 @@ public abstract partial class SharedXenoArtifactSystem
{
foreach (var netNode in ent.Comp.NodeVertices)
{
if (TryGetEntity(netNode, out var node))
yield return (node.Value, XenoArtifactNode(node.Value));
if (TryGetEntity(netNode, out var node) && _nodeQuery.TryComp(node, out var comp))
yield return (node.Value, comp);
}
}
@@ -253,7 +253,8 @@ public abstract partial class SharedXenoArtifactSystem
return false;
var uid = Spawn(entProtoId);
node = (uid, XenoArtifactNode(uid));
var comp = EnsureComp<XenoArtifactNodeComponent>(uid);
node = (uid, comp);
return AddNode(ent, (node.Value, node.Value.Comp), dirty: dirty);
}
@@ -269,11 +270,10 @@ public abstract partial class SharedXenoArtifactSystem
/// <returns>True if node adding was successful, false otherwise.</returns>
public bool AddNode(Entity<XenoArtifactComponent?> ent, Entity<XenoArtifactNodeComponent?> node, bool dirty = true)
{
if (!Resolve(ent, ref ent.Comp))
if (!Resolve(ent, ref ent.Comp) || !Resolve(node, ref node.Comp, false))
return false;
node.Comp ??= XenoArtifactNode(node);
node.Comp.Attached = GetNetEntity(ent);
node.Comp.Attached = ent.Owner;
var nodeIdx = GetFreeNodeIndex((ent, ent.Comp));
_container.Insert(node.Owner, ent.Comp.NodeContainer);
@@ -300,11 +300,9 @@ public abstract partial class SharedXenoArtifactSystem
/// <returns>True if node was removed successfully, false otherwise.</returns>
public bool RemoveNode(Entity<XenoArtifactComponent?> ent, Entity<XenoArtifactNodeComponent?> node, bool dirty = true)
{
if (!Resolve(ent, ref ent.Comp))
if (!Resolve(ent, ref ent.Comp) || !Resolve(node, ref node.Comp, false))
return false;
node.Comp ??= XenoArtifactNode(node);
if (!TryGetIndex(ent, node, out var idx))
return false; // node isn't attached to this entity.

View File

@@ -33,21 +33,14 @@ public abstract partial class SharedXenoArtifactSystem
SetNodeDurability((ent, ent), nodeComponent.MaxDurability);
}
/// <summary> Gets node component by node entity uid. </summary>
public XenoArtifactNodeComponent XenoArtifactNode(EntityUid uid)
{
return _nodeQuery.Get(uid);
}
public void SetNodeUnlocked(Entity<XenoArtifactNodeComponent?> ent)
{
if (!Resolve(ent, ref ent.Comp))
return;
if (ent.Comp.Attached is not { } netArtifact)
if (ent.Comp.Attached is not { } artifact)
return;
var artifact = GetEntity(netArtifact);
if (!TryComp<XenoArtifactComponent>(artifact, out var artifactComponent))
return;
@@ -197,7 +190,10 @@ public abstract partial class SharedXenoArtifactSystem
foreach (var netNode in segment)
{
var node = GetEntity(netNode);
outSegment.Add((node, XenoArtifactNode(node)));
if (!_nodeQuery.TryComp(node, out var comp))
continue;
outSegment.Add((node, comp));
}
output.Add(outSegment);
@@ -385,7 +381,7 @@ public abstract partial class SharedXenoArtifactSystem
return;
}
var artifact = _xenoArtifactQuery.Get(GetEntity(nodeComponent.Attached.Value));
var artifact = _xenoArtifactQuery.Get(nodeComponent.Attached.Value);
var nonactiveNodes = GetActiveNodes(artifact);
var durabilityEffect = MathF.Pow((float)nodeComponent.Durability / nodeComponent.MaxDurability, 2);

View File

@@ -45,7 +45,7 @@ public abstract partial class SharedXenoArtifactSystem
if (!Resolve(ent, ref ent.Comp))
return false;
var artifact = GetEntity(ent.Comp.Attached);
var artifact = ent.Comp.Attached;
if (!TryComp<XenoArtifactComponent>(artifact, out var artiComp))
return false;

View File

@@ -31,7 +31,7 @@ public abstract class BaseQueryUpdateXATSystem<T> : BaseXATSystem<T> where T : C
if (node.Attached == null)
continue;
var artifact = _xenoArtifactQuery.Get(GetEntity(node.Attached.Value));
var artifact = _xenoArtifactQuery.Get(node.Attached.Value);
if (!CanTrigger(artifact, (uid, node)))
continue;

View File

@@ -36,7 +36,7 @@ public sealed class XATDeathSystem : BaseXATSystem<XATDeathComponent>
if (node.Attached == null)
continue;
var artifact = _xenoArtifactQuery.Get(GetEntity(node.Attached.Value));
var artifact = _xenoArtifactQuery.Get(node.Attached.Value);
if (!CanTrigger(artifact, (uid, node)))
continue;

View File

@@ -64,7 +64,8 @@
- type: UnpoweredFlashlight
- type: PointLight
enabled: false
radius: 1.5
radius: 1.7
falloff: 3
softness: 5
autoRot: true
- type: Ringer

View File

@@ -188,6 +188,8 @@
totalIntensity: 400
intensitySlope: 30
maxIntensity: 125
deleteAfterExplosion: false
repeatable: true
canCreateVacuum: true
- type: TimerTrigger
delay: 4.5