Hardlight spear tweaks (#3)

* - tweak: Increased hardlight spear throw force and use delay

* - fix: Hardlight spear can now hit holocarps when thrown

* - add: New sprites for hardlight spear

* - fix: Fix duping hardlight spears by inserting them into containers
This commit is contained in:
Aviu00
2024-01-31 21:47:18 +09:00
committed by GitHub
parent 699f42c45b
commit 27d4cf977f
10 changed files with 63 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using System.Linq;
using Content.Shared.Body.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Implants.Components;
using Content.Shared.Interaction.Events;
@@ -7,6 +8,7 @@ using Content.Shared.Physics;
using Content.Shared.Popups;
using Content.Shared.Throwing;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Events;
using Robust.Shared.Spawners;
@@ -25,6 +27,7 @@ public sealed class HardlightSpearSystem : EntitySystem
SubscribeLocalEvent<HardlightSpearComponent, LandEvent>(OnLand);
SubscribeLocalEvent<HardlightSpearComponent, DroppedEvent>(OnDrop);
SubscribeLocalEvent<HardlightSpearComponent, EntGotInsertedIntoContainerMessage>(OnInsert);
SubscribeLocalEvent<HardlightSpearComponent, GettingPickedUpAttemptEvent>(OnPickupAttempt);
SubscribeLocalEvent<HardlightSpearComponent, PreventCollideEvent>(OnPreventCollision);
SubscribeLocalEvent<SubdermalImplantComponent, ActivateHardlightSpearImplantEvent>(OnImplantActivate);
@@ -76,4 +79,10 @@ public sealed class HardlightSpearSystem : EntitySystem
{
EnsureComp<TimedDespawnComponent>(uid);
}
private void OnInsert(EntityUid uid, HardlightSpearComponent component, EntGotInsertedIntoContainerMessage args)
{
if (!HasComp<BodyComponent>(args.Container.Owner))
EnsureComp<TimedDespawnComponent>(uid);
}
}