]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
New Feature: Symptoms of radiation poisoning (#39805)
authorWinkarst-cpu <74284083+Winkarst-cpu@users.noreply.github.com>
Wed, 27 Aug 2025 21:56:09 +0000 (00:56 +0300)
committerGitHub <noreply@github.com>
Wed, 27 Aug 2025 21:56:09 +0000 (14:56 -0700)
* 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>
Content.Server/Destructible/Thresholds/Behaviors/PopupBehavior.cs
Content.Server/Destructible/Thresholds/Behaviors/VomitBehavior.cs [new file with mode: 0644]
Resources/Locale/en-US/damage/radiation.ftl [new file with mode: 0644]
Resources/Prototypes/Entities/Mobs/base.yml

index 1d7ce24f60080c39052523cf0b9be52f07af5dd7..0bca5451c401c85fbfda5e0a631ac20cf239b4b2 100644 (file)
@@ -20,11 +20,21 @@ public sealed partial class PopupBehavior : IThresholdBehavior
     [DataField("popupType")]
     public PopupType PopupType;
 
+    /// <summary>
+    /// Only the affected entity will see the popup.
+    /// </summary>
+    [DataField]
+    public bool TargetOnly;
+
     public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null)
     {
         var popup = system.EntityManager.System<SharedPopupSystem>();
         // popup is placed at coords since the entity could be deleted after, no more popup then
         var coords = system.EntityManager.GetComponent<TransformComponent>(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 (file)
index 0000000..067e7d4
--- /dev/null
@@ -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<VomitSystem>().Vomit(uid);
+    }
+}
diff --git a/Resources/Locale/en-US/damage/radiation.ftl b/Resources/Locale/en-US/damage/radiation.ftl
new file mode 100644 (file)
index 0000000..bfe32fa
--- /dev/null
@@ -0,0 +1 @@
+mouth-taste-metal = You taste something metallic in your mouth!
index 90bb90e6630dce7a2b804dbe02a143b678e27579..a0b2da3975410bce0f4337703935cb3cc52bc711 100644 (file)
       - !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