Skip to content

Commit

Permalink
Cherry-picked commit 362d569 from space-wizards/space-station-14/master
Browse files Browse the repository at this point in the history
  • Loading branch information
SimpleStation14 authored and nikthechampiongr committed Mar 19, 2024
1 parent 3bf08c7 commit 3d46c77
Show file tree
Hide file tree
Showing 75 changed files with 160 additions and 229 deletions.
3 changes: 1 addition & 2 deletions Content.Server/Access/Systems/AccessOverriderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ private void AfterInteractOn(EntityUid uid, AccessOverriderComponent component,

var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.DoAfter, new AccessOverriderDoAfterEvent(), uid, target: args.Target, used: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnMove = true,
BreakOnDamage = true,
NeedHand = true,
};
Expand Down
5 changes: 2 additions & 3 deletions Content.Server/Animals/Systems/UdderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Content.Server.Animals.Systems;

/// <summary>
/// Gives ability to produce milkable reagents, produces endless if the
/// Gives ability to produce milkable reagents, produces endless if the
/// owner has no HungerComponent
/// </summary>
internal sealed class UdderSystem : EntitySystem
Expand Down Expand Up @@ -76,9 +76,8 @@ private void AttemptMilk(Entity<UdderComponent?> udder, EntityUid userUid, Entit

var doargs = new DoAfterArgs(EntityManager, userUid, 5, new MilkingDoAfterEvent(), udder, udder, used: containerUid)
{
BreakOnUserMove = true,
BreakOnMove = true,
BreakOnDamage = true,
BreakOnTargetMove = true,
MovementThreshold = 1.0f,
};

Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Body/Systems/InternalsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ private void StartToggleInternalsDoAfter(EntityUid user, EntityUid target, Inter

_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, delay, new InternalsDoAfterEvent(), target, target: target)
{
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnTargetMove = true,
BreakOnMove = true,
MovementThreshold = 0.1f,
});
}
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Botany/Systems/BotanySwabSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ private void OnAfterInteract(EntityUid uid, BotanySwabComponent swab, AfterInter
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, swab.SwabDelay, new BotanySwabDoAfterEvent(), uid, target: args.Target, used: uid)
{
Broadcast = true,
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnMove = true,
NeedHand = true
});
}
Expand Down
6 changes: 4 additions & 2 deletions Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@ private void InjectDoAfter(Entity<InjectorComponent> injector, EntityUid target,

DoAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, actualDelay, new InjectorDoAfterEvent(), injector.Owner, target: target, used: injector.Owner)
{
BreakOnUserMove = true,
BreakOnMove = true,
BreakOnWeightlessMove = false,
BreakOnDamage = true,
BreakOnTargetMove = true,
NeedHand = true,
BreakOnHandChange = true,
MovementThreshold = 0.1f,
});
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Communications/CommsHackerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void OnBeforeInteractHand(EntityUid uid, CommsHackerComponent comp, Befo
var doAfterArgs = new DoAfterArgs(EntityManager, uid, comp.Delay, new TerrorDoAfterEvent(), target: target, used: uid, eventTarget: uid)
{
BreakOnDamage = true,
BreakOnUserMove = true,
BreakOnMove = true,
MovementThreshold = 0.5f,
CancelDuplicate = false
};
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Construction/ConstructionSystem.Initial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ void ShutdownContainers()
var doAfterArgs = new DoAfterArgs(EntityManager, user, doAfterTime, new AwaitedDoAfterEvent(), null)
{
BreakOnDamage = true,
BreakOnTargetMove = false,
BreakOnUserMove = true,
BreakOnMove = true,
NeedHand = false,
// allow simultaneously starting several construction jobs using the same stack of materials.
CancelDuplicate = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ private HandleResult HandleInteraction(EntityUid uid, object ev, ConstructionGra
var doAfterEventArgs = new DoAfterArgs(EntityManager, interactUsing.User, step.DoAfter, doAfterEv, uid, uid, interactUsing.Used)
{
BreakOnDamage = false,
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnMove = true,
NeedHand = true
};

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Construction/PartExchangerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private void OnAfterInteract(EntityUid uid, PartExchangerComponent component, Af
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.ExchangeDuration, new ExchangerDoAfterEvent(), uid, target: args.Target, used: uid)
{
BreakOnDamage = true,
BreakOnUserMove = true
BreakOnMove = true
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,7 @@ public bool TryInsert(EntityUid unitId, EntityUid toInsertId, EntityUid? userId,
var doAfterArgs = new DoAfterArgs(EntityManager, userId.Value, delay, new DisposalDoAfterEvent(), unitId, target: toInsertId, used: unitId)
{
BreakOnDamage = true,
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnMove = true,
NeedHand = false
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async void AttemptDisassemble(EntityUid uid, EntityUid user, EntityUid ta
{
var doAfterArgs = new DoAfterArgs(EntityManager, user, component.DoAfterTime, new AwaitedDoAfterEvent(), null)
{
BreakOnUserMove = true,
BreakOnMove = true,
};
var result = await doAfterSystem.WaitDoAfter(doAfterArgs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool IsTileClear()
{
var doAfterArgs = new DoAfterArgs(EntityManager, args.User, component.DoAfterTime, new AwaitedDoAfterEvent(), null)
{
BreakOnUserMove = true,
BreakOnMove = true,
};
var result = await _doAfterSystem.WaitDoAfter(doAfterArgs);

Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Ensnaring/EnsnareableSystem.Ensnaring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ public void TryFree(EntityUid target, EntityUid user, EntityUid ensnare, Ensnar

var doAfterEventArgs = new DoAfterArgs(EntityManager, user, freeTime, new EnsnareableDoAfterEvent(), target, target: target, used: ensnare)
{
BreakOnUserMove = breakOnMove,
BreakOnTargetMove = breakOnMove,
BreakOnMove = breakOnMove,
BreakOnDamage = false,
NeedHand = true,
BlockDuplicate = true,
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Fluids/EntitySystems/DrainSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,8 @@ private void OnInteract(Entity<DrainComponent> entity, ref AfterInteractUsingEve

var doAfterArgs = new DoAfterArgs(EntityManager, args.User, entity.Comp.UnclogDuration, new DrainDoAfterEvent(), entity, args.Target, args.Used)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnMove = true,
BreakOnHandChange = true
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,8 @@ private void AddSpillVerb(Entity<SpillableComponent> entity, ref GetVerbsEvent<V
{
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, entity.Comp.SpillDelay ?? 0, new SpillDoAfterEvent(), entity.Owner, target: entity.Owner)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true,
});
};
Expand Down
5 changes: 2 additions & 3 deletions Content.Server/Forensics/Systems/ForensicPadSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ private void StartScan(EntityUid used, EntityUid user, EntityUid target, Forensi

var doAfterEventArgs = new DoAfterArgs(EntityManager, user, pad.ScanDelay, ev, used, target: target, used: used)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
NeedHand = true
NeedHand = true,
BreakOnMove = true,
};

_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ private void StartScan(EntityUid uid, ForensicScannerComponent component, Entity
{
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.ScanDelay, new ForensicScannerDoAfterEvent(), uid, target: target, used: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnMove = true,
NeedHand = true
});
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Forensics/Systems/ForensicsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void OnAfterInteract(EntityUid uid, CleansForensicsComponent component,
BreakOnHandChange = true,
NeedHand = true,
BreakOnDamage = true,
BreakOnTargetMove = true,
BreakOnMove = true,
MovementThreshold = 0.01f,
DistanceThreshold = forensicsComp.CleanDistance,
};
Expand Down
6 changes: 1 addition & 5 deletions Content.Server/Guardian/GuardianSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,7 @@ private void UseCreator(EntityUid user, EntityUid target, EntityUid injector, Gu
return;
}

_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.InjectionDelay, new GuardianCreatorDoAfterEvent(), injector, target: target, used: injector)
{
BreakOnTargetMove = true,
BreakOnUserMove = true
});
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.InjectionDelay, new GuardianCreatorDoAfterEvent(), injector, target: target, used: injector){BreakOnMove = true});
}

private void OnDoAfter(EntityUid uid, GuardianCreatorComponent component, DoAfterEvent args)
Expand Down
6 changes: 2 additions & 4 deletions Content.Server/Implants/ImplanterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ public void TryImplant(ImplanterComponent component, EntityUid user, EntityUid t
{
var args = new DoAfterArgs(EntityManager, user, component.ImplantTime, new ImplantEvent(), implanter, target: target, used: implanter)
{
BreakOnUserMove = true,
BreakOnTargetMove = true,
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true,
};

Expand All @@ -105,9 +104,8 @@ public void TryDraw(ImplanterComponent component, EntityUid user, EntityUid targ
{
var args = new DoAfterArgs(EntityManager, user, component.DrawTime, new DrawEvent(), implanter, target: target, used: implanter)
{
BreakOnUserMove = true,
BreakOnTargetMove = true,
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true,
};

Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Kitchen/EntitySystems/KitchenSpikeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ public bool TrySpike(EntityUid uid, EntityUid userUid, EntityUid victimUid, Kitc

var doAfterArgs = new DoAfterArgs(EntityManager, userUid, component.SpikeDelay + butcherable.ButcherDelay, new SpikeDoAfterEvent(), uid, target: victimUid, used: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true
};

Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Kitchen/EntitySystems/SharpSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ private void TryStartButcherDoafter(EntityUid knife, EntityUid target, EntityUid
var doAfter =
new DoAfterArgs(EntityManager, user, sharp.ButcherDelayModifier * butcher.ButcherDelay, new SharpDoAfterEvent(), knife, target: target, used: knife)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true
};

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Light/EntitySystems/PoweredLightSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private void OnInteractHand(EntityUid uid, PoweredLightComponent light, Interact
// removing a working bulb, so require a delay
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, userUid, light.EjectBulbDelay, new PoweredLightDoAfterEvent(), uid, target: uid)
{
BreakOnUserMove = true,
BreakOnMove = true,
BreakOnDamage = true,
});

Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Magic/MagicSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ private void AttemptLearn(EntityUid uid, SpellbookComponent component, UseInHand
{
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.LearnTime, new SpellbookDoAfterEvent(), uid, target: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true //What, are you going to read with your eyes only??
};

Expand Down
15 changes: 3 additions & 12 deletions Content.Server/MagicMirror/MagicMirrorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,9 @@ private void OnMagicMirrorSelect(EntityUid uid, MagicMirrorComponent component,
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.SelectSlotTime, doAfter, uid, target: target, used: uid)
{
DistanceThreshold = SharedInteractionSystem.InteractionRange,
BreakOnTargetMove = true,
BreakOnDamage = true,
BreakOnMove = true,
BreakOnHandChange = false,
BreakOnUserMove = true,
BreakOnWeightlessMove = false,
NeedHand = true
}, out var doAfterId);

Expand Down Expand Up @@ -151,11 +149,9 @@ private void OnTryMagicMirrorChangeColor(EntityUid uid, MagicMirrorComponent com

_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.ChangeSlotTime, doAfter, uid, target: target, used: uid)
{
BreakOnTargetMove = true,
BreakOnDamage = true,
BreakOnMove = true,
BreakOnHandChange = false,
BreakOnUserMove = true,
BreakOnWeightlessMove = false,
NeedHand = true
}, out var doAfterId);

Expand Down Expand Up @@ -206,11 +202,8 @@ private void OnTryMagicMirrorRemoveSlot(EntityUid uid, MagicMirrorComponent comp
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.RemoveSlotTime, doAfter, uid, target: target, used: uid)
{
DistanceThreshold = SharedInteractionSystem.InteractionRange,
BreakOnTargetMove = true,
BreakOnDamage = true,
BreakOnHandChange = false,
BreakOnUserMove = true,
BreakOnWeightlessMove = false,
NeedHand = true
}, out var doAfterId);

Expand Down Expand Up @@ -263,11 +256,9 @@ private void OnTryMagicMirrorAddSlot(EntityUid uid, MagicMirrorComponent compone

_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, message.Session.AttachedEntity.Value, component.AddSlotTime, doAfter, uid, target: component.Target.Value, used: uid)
{
BreakOnTargetMove = true,
BreakOnDamage = true,
BreakOnMove = true,
BreakOnHandChange = false,
BreakOnUserMove = true,
BreakOnWeightlessMove = false,
NeedHand = true
}, out var doAfterId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ private void OnInteract(EntityUid uid, MechGrabberComponent component, InteractN
component.AudioStream = _audio.PlayPvs(component.GrabSound, uid).Value.Entity;
var doAfterArgs = new DoAfterArgs(EntityManager, args.User, component.GrabDelay, new GrabberDoAfterEvent(), uid, target: target, used: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true
BreakOnMove = true
};

_doAfter.TryStartDoAfter(doAfterArgs, out component.DoAfter);
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Mech/Systems/MechEquipmentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ private void OnUsed(EntityUid uid, MechEquipmentComponent component, AfterIntera

var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.InstallDuration, new InsertEquipmentEvent(), uid, target: mech, used: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true
BreakOnMove = true,
};

_doAfter.TryStartDoAfter(doAfterEventArgs);
Expand Down
15 changes: 6 additions & 9 deletions Content.Server/Mech/Systems/MechSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ private void OnInteractUsing(EntityUid uid, MechComponent component, InteractUsi

if (TryComp<ToolComponent>(args.Used, out var tool) && tool.Qualities.Contains("Prying") && component.BatterySlot.ContainedEntity != null)
{
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.BatteryRemovalDelay, new RemoveBatteryEvent(), uid, target: uid, used: args.Target)
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.BatteryRemovalDelay,
new RemoveBatteryEvent(), uid, target: uid, used: args.Target)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnMove = true
};

_doAfter.TryStartDoAfter(doAfterEventArgs);
Expand Down Expand Up @@ -186,7 +186,7 @@ private void OnAlternativeVerb(EntityUid uid, MechComponent component, GetVerbsE
{
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.EntryDelay, new MechEntryEvent(), uid, target: uid)
{
BreakOnUserMove = true,
BreakOnMove = true,
};

_doAfter.TryStartDoAfter(doAfterEventArgs);
Expand Down Expand Up @@ -214,11 +214,8 @@ private void OnAlternativeVerb(EntityUid uid, MechComponent component, GetVerbsE
return;
}

var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.ExitDelay, new MechExitEvent(), uid, target: uid)
{
BreakOnUserMove = true,
BreakOnTargetMove = true,
};
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.ExitDelay,
new MechExitEvent(), uid, target: uid);

_doAfter.TryStartDoAfter(doAfterEventArgs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@ private void OnAfterInteractUsing(Entity<BiomassReclaimerComponent> reclaimer, r

_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, 7f, new ReclaimerDoAfterEvent(), reclaimer, target: args.Target, used: args.Used)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
NeedHand = true
NeedHand = true,
BreakOnMove = true
});
}

Expand Down
Loading

0 comments on commit 3d46c77

Please sign in to comment.