Skip to content

Commit

Permalink
additions
Browse files Browse the repository at this point in the history
  • Loading branch information
fenndragon committed Dec 17, 2024
1 parent 085598a commit 0c82a61
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 5 deletions.
42 changes: 42 additions & 0 deletions Content.Client/DeltaV/Lamiae/ClientLamiaVisuals.cs
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 Content.Client/DeltaV/Lamiae/LamiaSegmentVisualsComponent.cs
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
{}
18 changes: 16 additions & 2 deletions Resources/Prototypes/Entities/Mobs/NPCs/Rainlizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,6 +38,8 @@
energy: 1
color: "#30ce00"
- type: SegmentedEntity
initialSegmentId: LamiaInitialSegment
segmentId: LamiaSegment
numberOfSegments: 3
initialRadius: 0.25
staticScale: 0.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c82a61

Please sign in to comment.