Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darts can now pop balloons. #30088

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Content.Server/Weapons/Melee/Balloon/BalloonPopperSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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;
Expand All @@ -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)
Expand All @@ -40,6 +41,15 @@ private void OnMeleeHit(EntityUid uid, BalloonPopperComponent component, MeleeHi
}
}

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>
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Objects/Fun/darts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: BalloonPopper

- type: entity
parent: Dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
damage:
types:
Piercing: 1
- type: DamageOtherOnHit
damage:
types:
Piercing: 1
- type: Item
size: Tiny
- type: BalloonPopper
- type: ThrowingAngle
angle: -135
- type: LandAtCursor
Loading