Syringe gun! (#32112)

* Init testing

* copyright

* oops

* Tracking the embed entity uid

* testing stuff for gradual injection

* work

* weh

* god save me

* bleh

* Yippee!

* Again

* Mini syringe ammo

* cleaning up

* mini syringes have a texture for fill amount

* -3 cool points :(

* hitboxes

* init cleanup

* much needed fixes

* Fixes

(cherry picked from commit 62f5a31c4abcaaca09af84f591cbe727e6fcb7cb)
This commit is contained in:
ScarKy0
2024-10-22 16:03:42 +03:00
committed by Spatison
parent 1b688b8282
commit 2849008ba1
41 changed files with 188 additions and 424 deletions

View File

@@ -2,10 +2,9 @@ using Content.Server._White.Chemistry.Components;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Chemistry.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Explosion.Components;
using Content.Shared._White.Blocking;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Events;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Projectiles;
@@ -33,11 +32,9 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<SolutionInjectOnProjectileHitComponent, ProjectileHitEvent>(HandleProjectileHit);
SubscribeLocalEvent<SolutionInjectOnEmbedComponent, EmbedEvent>(HandleEmbed);
//WWDP edit start
SubscribeLocalEvent<MeleeChemicalInjectorComponent, MeleeHitEvent>(HandleMeleeHit,
after: new[] {typeof(MeleeBlockSystem)});
SubscribeLocalEvent<SolutionInjectOnTriggerComponent, StepTriggerAttemptEvent>(HandleTrigger);
//WWDP edit end
SubscribeLocalEvent<MeleeChemicalInjectorComponent, MeleeHitEvent>(HandleMeleeHit, after: new[] {typeof(MeleeBlockSystem)}); // WD EDIT
SubscribeLocalEvent<SolutionInjectWhileEmbeddedComponent, InjectOverTimeEvent>(OnInjectOverTime);
SubscribeLocalEvent<SolutionInjectOnTriggerComponent, StepTriggerAttemptEvent>(HandleTrigger); // WD EDIT
}
private void HandleProjectileHit(Entity<SolutionInjectOnProjectileHitComponent> entity, ref ProjectileHitEvent args)
@@ -68,6 +65,11 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
TryInjectTargets((entity.Owner, entity.Comp), args.HitEntities, args.User);
}
private void OnInjectOverTime(Entity<SolutionInjectWhileEmbeddedComponent> entity, ref InjectOverTimeEvent args)
{
DoInjection((entity.Owner, entity.Comp), args.EmbeddedIntoUid);
}
private void DoInjection(Entity<BaseSolutionInjectOnEventComponent> injectorEntity, EntityUid target, EntityUid? source = null)
{
TryInjectTargets(injectorEntity, [target], source);