-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'VMSolidus-Upstream-Merge-8-2-2024' of https://github.co…
…m/VMSolidus/deep-station-14 into VMSolidus-Upstream-Merge-8-2-2024
- Loading branch information
Showing
247 changed files
with
2,045 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Delta-V - This file is licensed under AGPLv3 | ||
* Copyright (c) 2024 Delta-V Contributors | ||
* See AGPLv3.txt for details. | ||
*/ | ||
|
||
using Robust.Client.GameObjects; | ||
using System.Numerics; | ||
using Content.Shared.SegmentedEntity; | ||
|
||
namespace Content.Client.DeltaV.Lamiae; | ||
|
||
public sealed class ClientLamiaVisualSystem : VisualizerSystem<SegmentedEntitySegmentVisualsComponent> | ||
{ | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<SegmentedEntitySegmentComponent, AppearanceChangeEvent>(OnAppearanceChange); | ||
} | ||
private void OnAppearanceChange(EntityUid uid, SegmentedEntitySegmentComponent component, ref AppearanceChangeEvent args) | ||
{ | ||
if (args.Sprite == null) return; | ||
|
||
if (AppearanceSystem.TryGetData<float>(uid, ScaleVisuals.Scale, out var scale) && TryComp<SpriteComponent>(uid, out var sprite)) | ||
{ | ||
sprite.Scale = new Vector2(scale, scale); | ||
} | ||
|
||
if (AppearanceSystem.TryGetData<bool>(uid, SegmentedEntitySegmentVisualLayers.Armor, out var worn) | ||
&& AppearanceSystem.TryGetData<string>(uid, SegmentedEntitySegmentVisualLayers.ArmorRsi, out var path)) | ||
{ | ||
var valid = !string.IsNullOrWhiteSpace(path); | ||
if (valid) | ||
{ | ||
args.Sprite.LayerSetRSI(SegmentedEntitySegmentVisualLayers.Armor, path); | ||
} | ||
args.Sprite.LayerSetVisible(SegmentedEntitySegmentVisualLayers.Armor, worn); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Content.Client/DeltaV/Lamiae/LamiaSegmentVisualsComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Delta-V - This file is licensed under AGPLv3 | ||
* Copyright (c) 2024 Delta-V Contributors | ||
* See AGPLv3.txt for details. | ||
*/ | ||
|
||
namespace Content.Client.DeltaV.Lamiae; | ||
|
||
[RegisterComponent] | ||
public sealed partial class SegmentedEntitySegmentVisualsComponent : Component | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Content.Server/SimpleStation14/Power/Systems/SiliconEmitSoundOnDrainedSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Content.Shared.SegmentedEntity; | ||
public sealed class SegmentSpawnedEvent : EntityEventArgs | ||
{ | ||
public EntityUid Lamia = default!; | ||
|
||
public SegmentSpawnedEvent(EntityUid lamia) | ||
{ | ||
Lamia = lamia; | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
Content.Shared/SegmentedEntity/SegmentedEntityComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Delta-V - This file is licensed under AGPLv3 | ||
* Copyright (c) 2024 Delta-V Contributors | ||
* See AGPLv3.txt for details. | ||
*/ | ||
|
||
namespace Content.Shared.SegmentedEntity | ||
{ | ||
/// <summary> | ||
/// Controls initialization of any Multi-segmented entity | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class SegmentedEntityComponent : Component | ||
{ | ||
/// <summary> | ||
/// A list of each UID attached to the Lamia, in order of spawn | ||
/// </summary> | ||
[DataField("segments")] | ||
public List<EntityUid> Segments = new(); | ||
|
||
/// <summary> | ||
/// A clamped variable that represents the number of segments to be spawned | ||
/// </summary> | ||
[DataField("numberOfSegments")] | ||
public int NumberOfSegments = 18; | ||
|
||
/// <summary> | ||
/// If UseTaperSystem is true, this constant represents the rate at which a segmented entity will taper towards the tip. Tapering is on a logarithmic scale, and will asymptotically approach 0. | ||
/// </summary> | ||
[DataField("offsetConstant")] | ||
public float OffsetConstant = 1.03f; | ||
|
||
/// <summary> | ||
/// Represents the prototype used to parent all segments | ||
/// </summary> | ||
[DataField("initialSegmentId")] | ||
public string InitialSegmentId = "LamiaInitialSegment"; | ||
|
||
/// <summary> | ||
/// Represents the segment prototype to be spawned | ||
/// </summary> | ||
[DataField("SegmentId")] | ||
public string SegmentId = "LamiaSegment"; | ||
|
||
/// <summary> | ||
/// Toggles the tapering system on and off. When false, segmented entities will have a constant width. | ||
/// </summary> | ||
[DataField("useTaperSystem")] | ||
public bool UseTaperSystem = true; | ||
|
||
/// <summary> | ||
/// The standard distance between the centerpoint of each segment. | ||
/// </summary> | ||
[DataField("staticOffset")] | ||
public float StaticOffset = 0.15f; | ||
|
||
/// <summary> | ||
/// The standard sprite scale of each segment. | ||
/// </summary> | ||
[DataField("staticScale")] | ||
public float StaticScale = 1f; | ||
|
||
/// <summary> | ||
/// Used to more finely tune how much damage should be transfered from tail to body. | ||
/// </summary> | ||
[DataField("damageModifierOffset")] | ||
public float DamageModifierOffset = 0.4f; | ||
|
||
/// <summary> | ||
/// A clamped variable that represents how far from the tip should tapering begin. | ||
/// </summary> | ||
[DataField("taperOffset")] | ||
public int TaperOffset = 18; | ||
|
||
/// <summary> | ||
/// Coefficient used to finely tune how much explosion damage should be transfered to the body. This is calculated multiplicatively with the derived damage modifier set. | ||
/// </summary> | ||
[DataField("explosiveModifierOffset")] | ||
public float ExplosiveModifierOffset = 0.1f; | ||
|
||
[DataField("bulletPassover")] | ||
public bool BulletPassover = true; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Content.Shared/SegmentedEntity/SegmentedEntitySegmentComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Delta-V - This file is licensed under AGPLv3 | ||
* Copyright (c) 2024 Delta-V Contributors | ||
* See AGPLv3.txt for details. | ||
*/ | ||
|
||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.SegmentedEntity | ||
{ | ||
/// <summary> | ||
/// Lamia segment | ||
/// </summary> | ||
[RegisterComponent] | ||
[NetworkedComponent] | ||
public sealed partial class SegmentedEntitySegmentComponent : Component | ||
{ | ||
[DataField("AttachedToUid")] | ||
public EntityUid AttachedToUid = default!; | ||
public float DamageModifyFactor = default!; | ||
public float OffsetSwitching = default!; | ||
public float ScaleFactor = default!; | ||
[DataField("DamageModifierCoefficient")] | ||
public float DamageModifierCoefficient = default!; | ||
public float ExplosiveModifyFactor = default!; | ||
public float OffsetConstant = default!; | ||
[DataField("Lamia")] | ||
public EntityUid Lamia = default!; | ||
public int MaxSegments = default!; | ||
public int SegmentNumber = default!; | ||
public float DamageModifierConstant = default!; | ||
[DataField("segmentId")] | ||
public string? segmentId; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Content.Shared/SegmentedEntity/SegmentedEntitySegmentVisuals.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Delta-V - This file is licensed under AGPLv3 | ||
* Copyright (c) 2024 Delta-V Contributors | ||
* See AGPLv3.txt for details. | ||
*/ | ||
|
||
using Robust.Shared.Serialization; | ||
|
||
namespace Content.Shared.SegmentedEntity | ||
{ | ||
[Serializable, NetSerializable] | ||
public enum SegmentedEntitySegmentVisualLayers | ||
{ | ||
Tail, | ||
Armor, | ||
ArmorRsi, | ||
} | ||
} |
Oops, something went wrong.