From 0c82a61416ae29c863056a8c0fc2161f57050ea1 Mon Sep 17 00:00:00 2001 From: fenndragon Date: Tue, 17 Dec 2024 13:22:58 -0700 Subject: [PATCH] additions --- .../DeltaV/Lamiae/ClientLamiaVisuals.cs | 42 +++++++++++++++++++ .../Lamiae/LamiaSegmentVisualsComponent.cs | 11 +++++ .../Entities/Mobs/NPCs/Rainlizard.yml | 18 +++++++- .../Objects/Specific/Species/lamia.yml | 6 +-- 4 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 Content.Client/DeltaV/Lamiae/ClientLamiaVisuals.cs create mode 100644 Content.Client/DeltaV/Lamiae/LamiaSegmentVisualsComponent.cs diff --git a/Content.Client/DeltaV/Lamiae/ClientLamiaVisuals.cs b/Content.Client/DeltaV/Lamiae/ClientLamiaVisuals.cs new file mode 100644 index 0000000000..046f6a7a3c --- /dev/null +++ b/Content.Client/DeltaV/Lamiae/ClientLamiaVisuals.cs @@ -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 +{ + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAppearanceChange); + } + private void OnAppearanceChange(EntityUid uid, SegmentedEntitySegmentComponent component, ref AppearanceChangeEvent args) + { + if (args.Sprite == null) return; + + if (AppearanceSystem.TryGetData(uid, ScaleVisuals.Scale, out var scale) && TryComp(uid, out var sprite)) + { + sprite.Scale = new Vector2(scale, scale); + } + + if (AppearanceSystem.TryGetData(uid, SegmentedEntitySegmentVisualLayers.Armor, out var worn) + && AppearanceSystem.TryGetData(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); + } + } +} diff --git a/Content.Client/DeltaV/Lamiae/LamiaSegmentVisualsComponent.cs b/Content.Client/DeltaV/Lamiae/LamiaSegmentVisualsComponent.cs new file mode 100644 index 0000000000..e2c1139f23 --- /dev/null +++ b/Content.Client/DeltaV/Lamiae/LamiaSegmentVisualsComponent.cs @@ -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 +{} diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/Rainlizard.yml b/Resources/Prototypes/Entities/Mobs/NPCs/Rainlizard.yml index 0aba7bf036..dddd1542b2 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/Rainlizard.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/Rainlizard.yml @@ -12,11 +12,23 @@ speed: 6 qualities: - Prying + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeCircle + radius: 0.2 + density: 0.0007 + mask: + - FlyingMobMask + layer: + - FlyingMobLayer - type: Sprite - drawdepth: Mobs + drawdepth: SmallMobs + noRot: false sprite: /Textures/Floof/Mobs/Animals/rainlizard.rsi scale: 0.6,0.6 - offset: 0,0 + offset: 0,0.4 layers: - map: ["enum.DamageStateVisualLayers.Base"] state: running @@ -26,6 +38,8 @@ energy: 1 color: "#30ce00" - type: SegmentedEntity + initialSegmentId: LamiaInitialSegment + segmentId: LamiaSegment numberOfSegments: 3 initialRadius: 0.25 staticScale: 0.9 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Species/lamia.yml b/Resources/Prototypes/Entities/Objects/Specific/Species/lamia.yml index f5fad8c21c..ba15340ff8 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Species/lamia.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Species/lamia.yml @@ -20,12 +20,12 @@ shape: !type:PhysShapeCircle radius: 0.25 - density: 80 + density: 1 restitution: 0.0 mask: - - MobMask + - FlyingMobMask layer: - - MobLayer + - FlyingMobLayer - type: Transform anchored: false - type: Tag