Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidenkrz committed Dec 16, 2024
1 parent dee02c4 commit 01fd903
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Linq;
using Content.Client.Projectiles;
using Content.Shared._RMC14.Weapons.Ranged.Prediction;
using Content.Shared._RMC14.Xenonids;
using Content.Shared.Projectiles;
using Content.Shared.Weapons.Ranged.Events;
using Content.Shared.Weapons.Ranged.Systems;
Expand Down
8 changes: 5 additions & 3 deletions Content.Shared/Damage/Systems/DamageableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void DamageChanged(EntityUid uid, DamageableComponent component, DamageSp
/// null if the user had no applicable components that can take damage.
/// </returns>
public DamageSpecifier? TryChangeDamage(EntityUid? uid, DamageSpecifier damage, bool ignoreResistances = false,
bool interruptsDoAfters = true, DamageableComponent? damageable = null, EntityUid? origin = null)
bool interruptsDoAfters = true, DamageableComponent? damageable = null, EntityUid? origin = null, EntityUid? tool = null)
{
if (!uid.HasValue || !_damageableQuery.Resolve(uid.Value, ref damageable, false))
{
Expand Down Expand Up @@ -154,7 +154,7 @@ public void DamageChanged(EntityUid uid, DamageableComponent component, DamageSp
damage = DamageSpecifier.ApplyModifierSet(damage, modifierSet);
}

var ev = new DamageModifyEvent(damage, origin);
var ev = new DamageModifyEvent(damage, origin, tool);
RaiseLocalEvent(uid.Value, ev);
damage = ev.Damage;

Expand Down Expand Up @@ -303,12 +303,14 @@ public sealed class DamageModifyEvent : EntityEventArgs, IInventoryRelayEvent
public readonly DamageSpecifier OriginalDamage;
public DamageSpecifier Damage;
public EntityUid? Origin;
public EntityUid? Tool;

public DamageModifyEvent(DamageSpecifier damage, EntityUid? origin = null)
public DamageModifyEvent(DamageSpecifier damage, EntityUid? origin = null, EntityUid? tool = null)
{
OriginalDamage = damage;
Damage = damage;
Origin = origin;
Tool = tool;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Projectiles/SharedProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,4 @@ public record struct ProjectileReflectAttemptEvent(EntityUid ProjUid, Projectile
/// Raised when a projectile hits an entity
/// </summary>
[ByRefEvent]
public record struct ProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, EntityUid? Shooter = null);
public record struct ProjectileHitEvent(DamageSpecifier Damage, EntityUid Target, EntityUid? Shooter = null, bool Handled = false);

0 comments on commit 01fd903

Please sign in to comment.