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