Simplify DoAfterArgs behavior for movement and distance checks (#25226)

* Merge BreakOnWeightlessMove and BreakOnMove. Provide different theshold for weightless movement.

* Adjust WeightlessMovementThresholds. Put a thing I forgot to put in the doafterargs.

* Make DoAfterArgs only use OnMove to determine whether to check for
movement and MoveThreshold to determine the threshold regardless of
weightlessness. Gave DistanceThreshold a default value which will always
be checked now.

* Fix issue introduced by merge.

* Use interaction system for determining whether a distance is within range

* Fix incorrect doafter args introduced by previous merge.
Forgor to commit these.

* Exorcise ghost.

The execution system should have been deleted when I merged previously.
For a reason I cannot comprehend it came back, but only the execution
system.

* Exorcise ghost Pt. 2

* Allow for movement check to be overriden in zero g and adjust doafter args where needed.

You can now override checking for movement in zero g with the BreakOnWeightlessMove bool. By default it will check.
The following doafters were made to ignore the movement check in zero g:
- Healing yourself with healing items,
- Removing embedded projectiles,
- Using tools like welders and crowbars

* Adjust distance for cuffing/uncuffing to work. Make injections not break on weightless movement.

* Fix evil incorrect and uneeded comments
This commit is contained in:
nikthechampiongr
2024-03-19 12:09:00 +02:00
committed by GitHub
parent 06b3f273ea
commit 362d56981f
75 changed files with 158 additions and 229 deletions

View File

@@ -165,9 +165,8 @@ namespace Content.Server.Medical.BiomassReclaimer
var delay = reclaimer.Comp.BaseInsertionDelay * physics.FixturesMass;
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, delay, new ReclaimerDoAfterEvent(), reclaimer, target: args.Target, used: args.Used)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
NeedHand = true
NeedHand = true,
BreakOnMove = true
});
}

View File

@@ -142,8 +142,7 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
var doAfterArgs = new DoAfterArgs(EntityManager, args.User, entity.Comp.EntryDelay, new CryoPodDragFinished(), entity, target: args.Dragged, used: entity)
{
BreakOnDamage = true,
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnMove = true,
NeedHand = false,
};
_doAfterSystem.TryStartDoAfter(doAfterArgs);

View File

@@ -178,8 +178,6 @@ public sealed class DefibrillatorSystem : EntitySystem
uid, target, uid)
{
BlockDuplicate = true,
BreakOnUserMove = true,
BreakOnTargetMove = true,
BreakOnHandChange = true,
NeedHand = true
});

View File

@@ -196,12 +196,11 @@ public sealed class HealingSystem : EntitySystem
var doAfterEventArgs =
new DoAfterArgs(EntityManager, 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,
BreakOnMove = true,
BreakOnWeightlessMove = false,
};
_doAfter.TryStartDoAfter(doAfterEventArgs);

View File

@@ -76,9 +76,8 @@ public sealed class HealthAnalyzerSystem : EntitySystem
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, uid.Comp.ScanDelay, new HealthAnalyzerDoAfterEvent(), uid, target: args.Target, used: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
NeedHand = true
NeedHand = true,
BreakOnMove = true
});
}

View File

@@ -107,9 +107,8 @@ namespace Content.Server.Medical.Stethoscope
{
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, comp.Delay, new StethoscopeDoAfterEvent(), scope, target: target, used: scope)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
NeedHand = true
NeedHand = true,
BreakOnMove = true,
});
}