]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Darts can now pop balloons. (#30088)
authorLankLTE <135308300+LankLTE@users.noreply.github.com>
Mon, 22 Jul 2024 05:38:56 +0000 (22:38 -0700)
committerGitHub <noreply@github.com>
Mon, 22 Jul 2024 05:38:56 +0000 (22:38 -0700)
Basic implementation.

Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs
Resources/Prototypes/Entities/Objects/Fun/darts.yml
Resources/Prototypes/Entities/Objects/Weapons/Melee/needle.yml

index 45c6a3d9d5572a4ce008702d8c0eb6c43bff2a11..a8460a8c6600c3a4b63b87b4a07b182fa69ea633 100644 (file)
@@ -4,7 +4,7 @@ using Content.Shared.IdentityManagement;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee.Events;
-using Robust.Shared.Audio;
+using Content.Shared.Throwing;
 using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Weapons.Melee.Balloon;
@@ -23,6 +23,7 @@ public sealed class BalloonPopperSystem : EntitySystem
     public override void Initialize()
     {
         SubscribeLocalEvent<BalloonPopperComponent, MeleeHitEvent>(OnMeleeHit);
+        SubscribeLocalEvent<BalloonPopperComponent, ThrowDoHitEvent>(OnThrowHit);
     }
 
     private void OnMeleeHit(EntityUid uid, BalloonPopperComponent component, MeleeHitEvent args)
@@ -40,6 +41,15 @@ public sealed class BalloonPopperSystem : EntitySystem
         }
     }
 
+    private void OnThrowHit(EntityUid uid, BalloonPopperComponent component, ThrowDoHitEvent args)
+    {
+        foreach (var held in _hands.EnumerateHeld(args.Target))
+        {
+            if (_tag.HasTag(held, component.BalloonTag))
+                PopBallooon(uid, held, component);
+        }
+    }
+
     /// <summary>
     /// Pops a target balloon, making a popup and playing a sound.
     /// </summary>
index dd25d503ce23b54d1ec0e9c413ecadcac60a0747..31fd4fd8e2760e3744dcf056af6dfddd06115173 100644 (file)
@@ -84,6 +84,7 @@
             max: 1
       - !type:DoActsBehavior
         acts: [ "Destruction" ]
+  - type: BalloonPopper
 
 - type: entity
   parent: Dart
index 11efeba5f8c001acdcce3f214192c521dbaebb09..e472157081a8ccadb38a7a60a7b05a1bc5e450fe 100644 (file)
     damage:
       types:
         Piercing: 1
+  - type: DamageOtherOnHit
+    damage:
+      types:
+        Piercing: 1
   - type: Item
     size: Tiny
   - type: BalloonPopper
+  - type: ThrowingAngle
+    angle: -135
+  - type: LandAtCursor