Added fun: Darts (#20582)
* add textures * fix cargo/cargo-fun.ftl * fix cargo/cargo-fun.ftl again * update icons and resize hitbox * really fixed cargo.ftl * fix soundSpecifier * balance changes: solution transfer has been reduced from 2 to 1. Now the transfer does not work on targets wearing anything in the outerclothing slot * add hypodart to uplink * return of darts solution capacity to 2u * Update uplink-catalog.ftl * Update uplink_catalog.yml * Update darts.yml * remove hypodart sprite * Update darts.yml * Update fun.yml * add random popups component, resprite dartboard * localize darts * fix * Update darts.yml
This commit is contained in:
27
Content.Server/Damage/Systems/DamageRandomPopupSystem.cs
Normal file
27
Content.Server/Damage/Systems/DamageRandomPopupSystem.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Content.Server.Damage.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Damage;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Damage.Systems;
|
||||
|
||||
/// <summary>
|
||||
/// Outputs a random pop-up from the strings list when an object receives damage
|
||||
/// </summary>
|
||||
public sealed class DamageRandomPopupSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<DamageRandomPopupComponent, DamageChangedEvent>(OnDamageChange);
|
||||
}
|
||||
|
||||
private void OnDamageChange(EntityUid uid, DamageRandomPopupComponent component, DamageChangedEvent args)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.Popups)), uid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user