More DoAfter Changes (#14609)
* DoAfters * Compact Clone() * Fix mice and cuffables * Try generalize attempt events * moves climbabledoafter event to shared, fixes issue with climbable target * Fix merge (cuffing) * Make all events netserializable * handful of doafter events moved * moves the rest of the events to their respective shared folders * Changes all mentions of server doafter to shared * stop stripping cancellation * fix merge errors * draw paused doafters * handle unpausing * missing netserializable ref * removes break on stun reference * removes cuffing state reference * Fix tools * Fix door prying. * Fix construction * Fix dumping * Fix wielding assert * fix rev * Fix test * more test fixes --------- Co-authored-by: keronshb <keronshb@live.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Threading;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Jittering;
|
||||
@@ -14,7 +13,6 @@ using Content.Server.Fluids.EntitySystems;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Climbing;
|
||||
using Content.Server.Construction;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Materials;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Shared.DoAfter;
|
||||
@@ -27,7 +25,7 @@ using Robust.Shared.Random;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Medical;
|
||||
|
||||
namespace Content.Server.Medical.BiomassReclaimer
|
||||
{
|
||||
@@ -43,7 +41,7 @@ namespace Content.Server.Medical.BiomassReclaimer
|
||||
[Dependency] private readonly ThrowingSystem _throwing = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly MaterialStorageSystem _material = default!;
|
||||
|
||||
@@ -97,7 +95,7 @@ namespace Content.Server.Medical.BiomassReclaimer
|
||||
SubscribeLocalEvent<BiomassReclaimerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||
SubscribeLocalEvent<BiomassReclaimerComponent, PowerChangedEvent>(OnPowerChanged);
|
||||
SubscribeLocalEvent<BiomassReclaimerComponent, SuicideEvent>(OnSuicide);
|
||||
SubscribeLocalEvent<BiomassReclaimerComponent, DoAfterEvent>(OnDoAfter);
|
||||
SubscribeLocalEvent<BiomassReclaimerComponent, ReclaimerDoAfterEvent>(OnDoAfter);
|
||||
}
|
||||
|
||||
private void OnSuicide(EntityUid uid, BiomassReclaimerComponent component, SuicideEvent args)
|
||||
@@ -152,11 +150,10 @@ namespace Content.Server.Medical.BiomassReclaimer
|
||||
if (!HasComp<MobStateComponent>(args.Used) || !CanGib(uid, args.Used, component))
|
||||
return;
|
||||
|
||||
_doAfterSystem.DoAfter(new DoAfterEventArgs(args.User, 7f, target:args.Target, used:args.Used)
|
||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(args.User, 7f, new ReclaimerDoAfterEvent(), uid, target: args.Target, used: args.Used)
|
||||
{
|
||||
BreakOnTargetMove = true,
|
||||
BreakOnUserMove = true,
|
||||
BreakOnStun = true,
|
||||
NeedHand = true
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Threading;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.DoAfter;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
@@ -39,12 +39,6 @@ namespace Content.Server.Medical.Components
|
||||
[DataField("delay")]
|
||||
public float Delay = 3f;
|
||||
|
||||
/// <summary>
|
||||
/// Cancel token to prevent rapid healing
|
||||
/// </summary>
|
||||
[DataField("cancelToken")]
|
||||
public CancellationTokenSource? CancelToken;
|
||||
|
||||
/// <summary>
|
||||
/// Delay multiplier when healing yourself.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,6 @@ using Content.Server.Body.Systems;
|
||||
using Content.Server.Chemistry.Components.SolutionManager;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Climbing;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Medical.Components;
|
||||
using Content.Server.NodeContainer;
|
||||
using Content.Server.NodeContainer.NodeGroups;
|
||||
@@ -26,7 +25,6 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Medical.Cryogenics;
|
||||
using Content.Shared.MedicalScanner;
|
||||
using Content.Shared.Tools;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -42,7 +40,7 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
@@ -56,9 +54,8 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
|
||||
SubscribeLocalEvent<CryoPodComponent, ComponentInit>(OnComponentInit);
|
||||
SubscribeLocalEvent<CryoPodComponent, GetVerbsEvent<AlternativeVerb>>(AddAlternativeVerbs);
|
||||
SubscribeLocalEvent<CryoPodComponent, GotEmaggedEvent>(OnEmagged);
|
||||
SubscribeLocalEvent<CryoPodComponent, DoAfterEvent>(OnDoAfter);
|
||||
SubscribeLocalEvent<CryoPodComponent, CryoPodDragFinished>(OnDragFinished);
|
||||
SubscribeLocalEvent<CryoPodComponent, CryoPodPryFinished>(OnCryoPodPryFinished);
|
||||
SubscribeLocalEvent<CryoPodComponent, CryoPodPryInterrupted>(OnCryoPodPryInterrupted);
|
||||
|
||||
SubscribeLocalEvent<CryoPodComponent, AtmosDeviceUpdateEvent>(OnCryoPodUpdateAtmosphere);
|
||||
SubscribeLocalEvent<CryoPodComponent, DragDropTargetEvent>(HandleDragDropOn);
|
||||
@@ -130,25 +127,23 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
|
||||
if (cryoPodComponent.BodyContainer.ContainedEntity != null)
|
||||
return;
|
||||
|
||||
var doAfterArgs = new DoAfterEventArgs(args.User, cryoPodComponent.EntryDelay, target:args.Dragged, used:uid)
|
||||
var doAfterArgs = new DoAfterArgs(args.User, cryoPodComponent.EntryDelay, new CryoPodDragFinished(), uid, target: args.Dragged, used: uid)
|
||||
{
|
||||
BreakOnDamage = true,
|
||||
BreakOnStun = true,
|
||||
BreakOnTargetMove = true,
|
||||
BreakOnUserMove = true,
|
||||
NeedHand = false,
|
||||
};
|
||||
_doAfterSystem.DoAfter(doAfterArgs);
|
||||
_doAfterSystem.TryStartDoAfter(doAfterArgs);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnDoAfter(EntityUid uid, CryoPodComponent component, DoAfterEvent args)
|
||||
private void OnDragFinished(EntityUid uid, CryoPodComponent component, CryoPodDragFinished args)
|
||||
{
|
||||
if (args.Cancelled || args.Handled || args.Args.Target == null)
|
||||
return;
|
||||
|
||||
InsertBody(uid, args.Args.Target.Value, component);
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -179,18 +174,7 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
|
||||
if (args.Handled || !cryoPodComponent.Locked || cryoPodComponent.BodyContainer.ContainedEntity == null)
|
||||
return;
|
||||
|
||||
if (TryComp(args.Used, out ToolComponent? tool)
|
||||
&& tool.Qualities.Contains("Prying")) // Why aren't those enums?
|
||||
{
|
||||
if (cryoPodComponent.IsPrying)
|
||||
return;
|
||||
cryoPodComponent.IsPrying = true;
|
||||
|
||||
var toolEvData = new ToolEventData(new CryoPodPryFinished(), targetEntity:uid);
|
||||
_toolSystem.UseTool(args.Used, args.User, uid, cryoPodComponent.PryDelay, new [] {"Prying"}, toolEvData);
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
args.Handled = _toolSystem.UseTool(args.Used, args.User, uid, cryoPodComponent.PryDelay, "Prying", new CryoPodPryFinished());
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid uid, CryoPodComponent component, ExaminedEvent args)
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
using System.Threading;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Medical.Components;
|
||||
using Content.Server.Stack;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Medical;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
@@ -24,7 +24,7 @@ public sealed class HealingSystem : EntitySystem
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly StackSystem _stacks = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
@@ -36,45 +36,43 @@ public sealed class HealingSystem : EntitySystem
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<HealingComponent, UseInHandEvent>(OnHealingUse);
|
||||
SubscribeLocalEvent<HealingComponent, AfterInteractEvent>(OnHealingAfterInteract);
|
||||
SubscribeLocalEvent<DamageableComponent, DoAfterEvent<HealingData>>(OnDoAfter);
|
||||
SubscribeLocalEvent<DamageableComponent, HealingDoAfterEvent>(OnDoAfter);
|
||||
}
|
||||
|
||||
private void OnDoAfter(EntityUid uid, DamageableComponent component, DoAfterEvent<HealingData> args)
|
||||
private void OnDoAfter(EntityUid uid, DamageableComponent component, HealingDoAfterEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
{
|
||||
args.AdditionalData.HealingComponent.CancelToken = null;
|
||||
if (!TryComp(args.Used, out HealingComponent? healing))
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Handled || args.Cancelled || _mobStateSystem.IsDead(uid) || args.Args.Used == null)
|
||||
if (args.Handled || args.Cancelled || _mobStateSystem.IsDead(uid))
|
||||
return;
|
||||
|
||||
if (component.DamageContainerID is not null && !component.DamageContainerID.Equals(component.DamageContainerID))
|
||||
return;
|
||||
|
||||
// Heal some bloodloss damage.
|
||||
if (args.AdditionalData.HealingComponent.BloodlossModifier != 0)
|
||||
_bloodstreamSystem.TryModifyBleedAmount(uid, args.AdditionalData.HealingComponent.BloodlossModifier);
|
||||
if (healing.BloodlossModifier != 0)
|
||||
_bloodstreamSystem.TryModifyBleedAmount(uid, healing.BloodlossModifier);
|
||||
|
||||
var healed = _damageable.TryChangeDamage(uid, args.AdditionalData.HealingComponent.Damage, true, origin: args.Args.User);
|
||||
var healed = _damageable.TryChangeDamage(uid, healing.Damage, true, origin: args.Args.User);
|
||||
|
||||
if (healed == null)
|
||||
if (healed == null && healing.BloodlossModifier != 0)
|
||||
return;
|
||||
|
||||
var total = healed?.Total ?? FixedPoint2.Zero;
|
||||
|
||||
// Reverify that we can heal the damage.
|
||||
_stacks.Use(args.Args.Used.Value, 1, args.AdditionalData.Stack);
|
||||
|
||||
if (uid != args.Args.User)
|
||||
_adminLogger.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.Args.User):user} healed {EntityManager.ToPrettyString(uid):target} for {healed.Total:damage} damage");
|
||||
_stacks.Use(args.Used.Value, 1);
|
||||
|
||||
if (uid != args.User)
|
||||
_adminLogger.Add(LogType.Healed,
|
||||
$"{EntityManager.ToPrettyString(args.User):user} healed {EntityManager.ToPrettyString(uid):target} for {total:damage} damage");
|
||||
else
|
||||
_adminLogger.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.Args.User):user} healed themselves for {healed.Total:damage} damage");
|
||||
_adminLogger.Add(LogType.Healed,
|
||||
$"{EntityManager.ToPrettyString(args.User):user} healed themselves for {total:damage} damage");
|
||||
|
||||
if (args.AdditionalData.HealingComponent.HealingEndSound != null)
|
||||
_audio.PlayPvs(args.AdditionalData.HealingComponent.HealingEndSound, uid, AudioHelpers.WithVariation(0.125f, _random).WithVolume(-5f));
|
||||
_audio.PlayPvs(healing.HealingEndSound, uid, AudioHelpers.WithVariation(0.125f, _random).WithVolume(-5f));
|
||||
|
||||
args.AdditionalData.HealingComponent.CancelToken = null;
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -98,13 +96,14 @@ public sealed class HealingSystem : EntitySystem
|
||||
|
||||
private bool TryHeal(EntityUid uid, EntityUid user, EntityUid target, HealingComponent component)
|
||||
{
|
||||
if (_mobStateSystem.IsDead(target) || !TryComp<DamageableComponent>(target, out var targetDamage) || component.CancelToken != null)
|
||||
if (_mobStateSystem.IsDead(target) || !TryComp<DamageableComponent>(target, out var targetDamage))
|
||||
return false;
|
||||
|
||||
if (targetDamage.TotalDamage == 0)
|
||||
return false;
|
||||
|
||||
if (component.DamageContainerID is not null && !component.DamageContainerID.Equals(targetDamage.DamageContainerID))
|
||||
if (component.DamageContainerID is not null &&
|
||||
!component.DamageContainerID.Equals(targetDamage.DamageContainerID))
|
||||
return false;
|
||||
|
||||
if (user != target && !_interactionSystem.InRangeUnobstructed(user, target, popup: true))
|
||||
@@ -114,7 +113,8 @@ public sealed class HealingSystem : EntitySystem
|
||||
return false;
|
||||
|
||||
if (component.HealingBeginSound != null)
|
||||
_audio.PlayPvs(component.HealingBeginSound, uid, AudioHelpers.WithVariation(0.125f, _random).WithVolume(-5f));
|
||||
_audio.PlayPvs(component.HealingBeginSound, uid,
|
||||
AudioHelpers.WithVariation(0.125f, _random).WithVolume(-5f));
|
||||
|
||||
var isNotSelf = user != target;
|
||||
|
||||
@@ -122,27 +122,18 @@ public sealed class HealingSystem : EntitySystem
|
||||
? component.Delay
|
||||
: component.Delay * GetScaledHealingPenalty(user, component);
|
||||
|
||||
component.CancelToken = new CancellationTokenSource();
|
||||
|
||||
var healingData = new HealingData(component, stack);
|
||||
|
||||
var doAfterEventArgs = new DoAfterEventArgs(user, delay, cancelToken: component.CancelToken.Token,target: target, used: uid)
|
||||
{
|
||||
//Raise the event on the target if it's not self, otherwise raise it on self.
|
||||
RaiseOnTarget = isNotSelf,
|
||||
RaiseOnUser = !isNotSelf,
|
||||
BreakOnUserMove = true,
|
||||
BreakOnTargetMove = true,
|
||||
// Didn't break on damage as they may be trying to prevent it and
|
||||
// not being able to heal your own ticking damage would be frustrating.
|
||||
BreakOnStun = true,
|
||||
NeedHand = true,
|
||||
// Juusstt in case damageble gets removed it avoids having to re-cancel the token. Won't need this when DoAfterEvent<T> gets added.
|
||||
PostCheck = () => true
|
||||
};
|
||||
|
||||
_doAfter.DoAfter(doAfterEventArgs, healingData);
|
||||
var doAfterEventArgs =
|
||||
new DoAfterArgs(user, delay, new HealingDoAfterEvent(), target, target: target, used: uid)
|
||||
{
|
||||
//Raise the event on the target if it's not self, otherwise raise it on self.
|
||||
BreakOnUserMove = true,
|
||||
BreakOnTargetMove = true,
|
||||
// Didn't break on damage as they may be trying to prevent it and
|
||||
// not being able to heal your own ticking damage would be frustrating.
|
||||
NeedHand = true,
|
||||
};
|
||||
|
||||
_doAfter.TryStartDoAfter(doAfterEventArgs);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -155,7 +146,8 @@ public sealed class HealingSystem : EntitySystem
|
||||
public float GetScaledHealingPenalty(EntityUid uid, HealingComponent component)
|
||||
{
|
||||
var output = component.Delay;
|
||||
if (!TryComp<MobThresholdsComponent>(uid, out var mobThreshold) || !TryComp<DamageableComponent>(uid, out var damageable))
|
||||
if (!TryComp<MobThresholdsComponent>(uid, out var mobThreshold) ||
|
||||
!TryComp<DamageableComponent>(uid, out var damageable))
|
||||
return output;
|
||||
if (!_mobThresholdSystem.TryGetThresholdForState(uid, MobState.Critical, out var amount, mobThreshold))
|
||||
return 1;
|
||||
@@ -165,10 +157,4 @@ public sealed class HealingSystem : EntitySystem
|
||||
var modifier = percentDamage * (component.SelfHealPenaltyMultiplier - 1) + 1;
|
||||
return Math.Max(modifier, 1);
|
||||
}
|
||||
|
||||
private record struct HealingData(HealingComponent HealingComponent, StackComponent Stack)
|
||||
{
|
||||
public HealingComponent HealingComponent = HealingComponent;
|
||||
public StackComponent Stack = Stack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Medical.Components;
|
||||
using Content.Server.Disease;
|
||||
using Content.Server.Popups;
|
||||
@@ -6,6 +5,7 @@ using Content.Shared.Damage;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.MedicalScanner;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using static Content.Shared.MedicalScanner.SharedHealthAnalyzerComponent;
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Medical
|
||||
{
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly DiseaseSystem _disease = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Content.Server.Medical
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, ActivateInWorldEvent>(HandleActivateInWorld);
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, AfterInteractEvent>(OnAfterInteract);
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, DoAfterEvent>(OnDoAfter);
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, HealthAnalyzerDoAfterEvent>(OnDoAfter);
|
||||
}
|
||||
|
||||
private void HandleActivateInWorld(EntityUid uid, HealthAnalyzerComponent healthAnalyzer, ActivateInWorldEvent args)
|
||||
@@ -40,11 +40,10 @@ namespace Content.Server.Medical
|
||||
|
||||
_audio.PlayPvs(healthAnalyzer.ScanningBeginSound, uid);
|
||||
|
||||
_doAfterSystem.DoAfter(new DoAfterEventArgs(args.User, healthAnalyzer.ScanDelay, target: args.Target, used:uid)
|
||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(args.User, healthAnalyzer.ScanDelay, new HealthAnalyzerDoAfterEvent(), uid, target: args.Target, used: uid)
|
||||
{
|
||||
BreakOnTargetMove = true,
|
||||
BreakOnUserMove = true,
|
||||
BreakOnStun = true,
|
||||
NeedHand = true
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Medical.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Actions;
|
||||
@@ -11,6 +10,7 @@ using Content.Shared.Verbs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Medical;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Medical
|
||||
@@ -18,7 +18,7 @@ namespace Content.Server.Medical
|
||||
public sealed class StethoscopeSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -29,7 +29,7 @@ namespace Content.Server.Medical
|
||||
SubscribeLocalEvent<WearingStethoscopeComponent, GetVerbsEvent<InnateVerb>>(AddStethoscopeVerb);
|
||||
SubscribeLocalEvent<StethoscopeComponent, GetItemActionsEvent>(OnGetActions);
|
||||
SubscribeLocalEvent<StethoscopeComponent, StethoscopeActionEvent>(OnStethoscopeAction);
|
||||
SubscribeLocalEvent<StethoscopeComponent, DoAfterEvent>(OnDoAfter);
|
||||
SubscribeLocalEvent<StethoscopeComponent, StethoscopeDoAfterEvent>(OnDoAfter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -103,11 +103,10 @@ namespace Content.Server.Medical
|
||||
// construct the doafter and start it
|
||||
private void StartListening(EntityUid scope, EntityUid user, EntityUid target, StethoscopeComponent comp)
|
||||
{
|
||||
_doAfterSystem.DoAfter(new DoAfterEventArgs(user, comp.Delay, target: target, used:scope)
|
||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(user, comp.Delay, new StethoscopeDoAfterEvent(), scope, target: target, used: scope)
|
||||
{
|
||||
BreakOnTargetMove = true,
|
||||
BreakOnUserMove = true,
|
||||
BreakOnStun = true,
|
||||
NeedHand = true
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user