Skip to content

Commit

Permalink
Lamia can now shoot over tail
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Feb 14, 2024
1 parent 101cb4b commit 33ef4d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Content.Server/Nyanotrasen/Lamiae/LamiaSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Content.Server.Humanoid;
using Content.Shared.Inventory.Events;
using Content.Shared.Tag;
using Content.Shared.Standing;
using Content.Shared.Storage.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Containers;
Expand All @@ -24,6 +25,7 @@ public sealed partial class LamiaSystem : EntitySystem
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly StandingStateSystem _standing = default!;

[ValidatePrototypeId<TagPrototype>]
private const string LamiaHardsuitTag = "AllowLamiaHardsuit";
Expand Down Expand Up @@ -81,6 +83,7 @@ public override void Initialize()
SubscribeLocalEvent<LamiaComponent, DidEquipEvent>(OnDidEquipEvent);
SubscribeLocalEvent<LamiaComponent, DidUnequipEvent>(OnDidUnequipEvent);
SubscribeLocalEvent<LamiaSegmentComponent, BeforeDamageChangedEvent>(OnHitSelf);
SubscribeLocalEvent<LamiaSegmentComponent, StandAttemptEvent>(TailCantStand);
}

/// <summary>
Expand All @@ -94,6 +97,7 @@ public override void Initialize()
private void OnSegmentSpawned(EntityUid uid, LamiaSegmentComponent component, SegmentSpawnedEvent args)
{
component.Lamia = args.Lamia;
_standing.Down(uid);

if (!TryComp<HumanoidAppearanceComponent>(uid, out var species)) return;
if (!TryComp<HumanoidAppearanceComponent>(args.Lamia, out var humanoid)) return;
Expand Down Expand Up @@ -166,6 +170,11 @@ private void OnHitSelf(EntityUid uid, LamiaSegmentComponent component, ref Befor
}
}

private void TailCantStand(EntityUid uid, LamiaSegmentComponent component, StandAttemptEvent args)
{
args.Cancelled = true;
}

private void SpawnSegments(EntityUid uid, LamiaComponent component)
{
int i = 1;
Expand Down

0 comments on commit 33ef4d3

Please sign in to comment.