Remove InteractedWithEvent and friends. (#11939)

This commit is contained in:
Leon Friedrich
2022-10-26 14:15:48 +13:00
committed by GitHub
parent b03f17bda2
commit c0b657ca18
21 changed files with 133 additions and 101 deletions

View File

@@ -150,6 +150,13 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
ev.Target.Value
};
_interaction.DoContactInteraction(ev.Weapon, ev.Target);
_interaction.DoContactInteraction(user, ev.Weapon);
// If the user is using a long-range weapon, this probably shouldn't be happening? But I'll interpret melee as a
// somewhat messy scuffle. See also, heavy attacks.
_interaction.DoContactInteraction(user, ev.Target);
// For stuff that cares about it being attacked.
RaiseLocalEvent(ev.Target.Value, new AttackedEvent(component.Owner, user, targetXform.Coordinates));
@@ -249,9 +256,17 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
var modifiers = itemDamage.ModifiersList;
modifiers.AddRange(hitEvent.ModifiersList);
_interaction.DoContactInteraction(user, ev.Weapon);
// For stuff that cares about it being attacked.
foreach (var target in targets)
{
_interaction.DoContactInteraction(ev.Weapon, target);
// If the user is using a long-range weapon, this probably shouldn't be happening? But I'll interpret melee as a
// somewhat messy scuffle. See also, light attacks.
_interaction.DoContactInteraction(user, target);
RaiseLocalEvent(target, new AttackedEvent(component.Owner, user, Transform(target).Coordinates));
}
@@ -338,6 +353,8 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
inTargetHand = targetHandsComponent.ActiveHand.HeldEntity!.Value;
}
_interaction.DoContactInteraction(user, ev.Target);
var attemptEvent = new DisarmAttemptEvent(target, user, inTargetHand);
if (inTargetHand != null)