From 5028161c7bef126ec115bf34c7778d520f72169b Mon Sep 17 00:00:00 2001 From: Winkarst-cpu <74284083+Winkarst-cpu@users.noreply.github.com> Date: Thu, 28 Aug 2025 00:56:09 +0300 Subject: [PATCH] New Feature: Symptoms of radiation poisoning (#39805) * New Feature * Cleanup * Bump threshold * Update * Update * Single change * Me when I forgor the yaml --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- .../Thresholds/Behaviors/PopupBehavior.cs | 12 +++++++++++- .../Thresholds/Behaviors/VomitBehavior.cs | 12 ++++++++++++ Resources/Locale/en-US/damage/radiation.ftl | 1 + Resources/Prototypes/Entities/Mobs/base.yml | 15 +++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Content.Server/Destructible/Thresholds/Behaviors/VomitBehavior.cs create mode 100644 Resources/Locale/en-US/damage/radiation.ftl diff --git a/Content.Server/Destructible/Thresholds/Behaviors/PopupBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/PopupBehavior.cs index 1d7ce24f60..0bca5451c4 100644 --- a/Content.Server/Destructible/Thresholds/Behaviors/PopupBehavior.cs +++ b/Content.Server/Destructible/Thresholds/Behaviors/PopupBehavior.cs @@ -20,11 +20,21 @@ public sealed partial class PopupBehavior : IThresholdBehavior [DataField("popupType")] public PopupType PopupType; + /// + /// Only the affected entity will see the popup. + /// + [DataField] + public bool TargetOnly; + public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null) { var popup = system.EntityManager.System(); // popup is placed at coords since the entity could be deleted after, no more popup then var coords = system.EntityManager.GetComponent(uid).Coordinates; - popup.PopupCoordinates(Loc.GetString(Popup), coords, PopupType); + + if (TargetOnly) + popup.PopupCoordinates(Loc.GetString(Popup), coords, uid, PopupType); + else + popup.PopupCoordinates(Loc.GetString(Popup), coords, PopupType); } } diff --git a/Content.Server/Destructible/Thresholds/Behaviors/VomitBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/VomitBehavior.cs new file mode 100644 index 0000000000..067e7d4565 --- /dev/null +++ b/Content.Server/Destructible/Thresholds/Behaviors/VomitBehavior.cs @@ -0,0 +1,12 @@ +using Content.Server.Medical; + +namespace Content.Server.Destructible.Thresholds.Behaviors; + +[DataDefinition] +public sealed partial class VomitBehavior : IThresholdBehavior +{ + public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null) + { + system.EntityManager.System().Vomit(uid); + } +} diff --git a/Resources/Locale/en-US/damage/radiation.ftl b/Resources/Locale/en-US/damage/radiation.ftl new file mode 100644 index 0000000000..bfe32fa9bb --- /dev/null +++ b/Resources/Locale/en-US/damage/radiation.ftl @@ -0,0 +1 @@ +mouth-taste-metal = You taste something metallic in your mouth! diff --git a/Resources/Prototypes/Entities/Mobs/base.yml b/Resources/Prototypes/Entities/Mobs/base.yml index 90bb90e663..a0b2da3975 100644 --- a/Resources/Prototypes/Entities/Mobs/base.yml +++ b/Resources/Prototypes/Entities/Mobs/base.yml @@ -85,6 +85,21 @@ - !type:PlaySoundBehavior sound: collection: MeatLaserImpact + - trigger: + !type:DamageTypeTrigger + damageType: Radiation + damage: 15 + behaviors: + - !type:PopupBehavior + popup: mouth-taste-metal + popupType: LargeCaution + targetOnly: true + - trigger: + !type:DamageTypeTrigger + damageType: Radiation + damage: 40 + behaviors: + - !type:VomitBehavior - type: RadiationReceiver - type: Stamina - type: MobState -- 2.51.2