Lights now show a popup message when you burn yourself.

This commit is contained in:
Víctor Aguilera Puerto
2020-08-22 19:37:23 +02:00
parent 7e957ceff1
commit 35e963a0ea

View File

@@ -18,6 +18,7 @@ using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -29,6 +30,8 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
[RegisterComponent]
public class PoweredLightComponent : Component, IInteractHand, IInteractUsing, IMapInit
{
[Dependency] private IServerNotifyManager _notifyManager = default!;
public override string Name => "PoweredLight";
private static readonly TimeSpan _thunkDelay = TimeSpan.FromSeconds(2);
@@ -100,6 +103,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
void Burn()
{
_notifyManager.PopupMessage(Owner, eventArgs.User, Loc.GetString("You burn your hand!"));
damageableComponent.ChangeDamage(DamageType.Heat, 20, false, Owner);
var audioSystem = EntitySystem.Get<AudioSystem>();
audioSystem.PlayFromEntity("/Audio/Effects/lightburn.ogg", Owner);