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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
1
Resources/Locale/en-US/damage/radiation.ftl
Normal file
1
Resources/Locale/en-US/damage/radiation.ftl
Normal file
@@ -0,0 +1 @@
|
||||
mouth-taste-metal = You taste something metallic in your mouth!
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user