Skip to content

Commit

Permalink
LamiaSystem is returning to the server again
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Dec 12, 2023
1 parent cdb83f6 commit c484b58
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 43 deletions.
36 changes: 0 additions & 36 deletions Content.Client/Nyanotrasen/Lamiae/ClientLamiaeSystem.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
using Robust.Shared.Physics;
using Content.Shared.Damage;
using Content.Server.Damage;
using Content.Server.Humanoid;
using Robust.Server.GameObjects;
using Content.Shared.Humanoid;
using Robust.Shared.GameObjects;
using Robust.Server.Prototypes;
using Robust.Server.Containers;
using System.Numerics;
using Content.Server.Nyanotrasen.Lamiae;
using Content.Shared.Nyanotrasen.Lamiae;
using Robust.Shared.Physics;
using Content.Shared.Damage;
using Content.Server.Humanoid;
using Content.Server.Access.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Physics.Components;
using Robust.Shared.Maths;
using System.Numerics;
using Content.Shared.Nyanotrasen.Lamiae;

namespace Content.Shared.Nyanotrasen.Lamiae
namespace Content.Server.Nyanotrasen.Lamiae
{
public partial class SharedLamiaSystem : EntitySystem
public partial class LamiaSystem : EntitySystem
{
[Dependency] private readonly SharedJointSystem _jointSystem = default!;
[Dependency] private readonly IPrototypeManager _prototypes = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;

Queue<(LamiaSegmentComponent segment, EntityUid lamia)> _segments = new();
public override void Update(float frameTime)
Expand All @@ -37,6 +46,9 @@ public override void Update(float frameTime)
EnsureComp<PhysicsComponent>(segmentUid);
EnsureComp<PhysicsComponent>(attachedUid); // Hello I hate tests

var ev = new SegmentSpawnedEvent(segment.lamia);
RaiseLocalEvent(segmentUid, ev, false);

if (segment.segment.SegmentNumber == 1)
{
Transform(segmentUid).Coordinates = Transform(attachedUid).Coordinates;
Expand Down Expand Up @@ -64,6 +76,16 @@ public override void Initialize()
SubscribeLocalEvent<LamiaSegmentComponent, DamageModifyEvent>(HandleSegmentDamage);
}

private void OnSegmentSpawned(EntityUid uid, LamiaSegmentComponent component, SegmentSpawnedEvent args)
{
component.Lamia = args.Lamia;

if (TryComp<HumanoidAppearanceComponent>(args.Lamia, out var segmentcolor))
{
_appearance.SetData(uid, LamiaSegmentVisuals.Color, segmentcolor);
}
}

private void OnInit(EntityUid uid, LamiaComponent component, ComponentInit args)
{
SpawnSegments(uid, component);
Expand Down

0 comments on commit c484b58

Please sign in to comment.