Merge remote-tracking branch 'upstream/master' into ed-05-08-2024-upstream
# Conflicts: # Content.Shared/Inventory/InventorySystem.Equip.cs # Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
This commit is contained in:
@@ -216,7 +216,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
if (!Resolve(uid, ref component, false))
|
||||
return new DamageSpecifier();
|
||||
|
||||
var ev = new GetMeleeDamageEvent(uid, new (component.Damage), new(), user);
|
||||
var ev = new GetMeleeDamageEvent(uid, new(component.Damage), new(), user, component.ResistanceBypass);
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
|
||||
return DamageSpecifier.ApplyModifierSets(ev.Damage, ev.Modifiers);
|
||||
@@ -244,6 +244,17 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
return ev.DamageModifier * ev.Multipliers;
|
||||
}
|
||||
|
||||
public bool GetResistanceBypass(EntityUid uid, EntityUid user, MeleeWeaponComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
return false;
|
||||
|
||||
var ev = new GetMeleeDamageEvent(uid, new(component.Damage), new(), user, component.ResistanceBypass);
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
|
||||
return ev.ResistanceBypass;
|
||||
}
|
||||
|
||||
public bool TryGetWeapon(EntityUid entity, out EntityUid weaponUid, [NotNullWhen(true)] out MeleeWeaponComponent? melee)
|
||||
{
|
||||
weaponUid = default;
|
||||
@@ -446,6 +457,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
// If I do not come back later to fix Light Attacks being Heavy Attacks you can throw me in the spider pit -Errant
|
||||
var damage = GetDamage(meleeUid, user, component) * GetHeavyDamageModifier(meleeUid, user, component);
|
||||
var target = GetEntity(ev.Target);
|
||||
var resistanceBypass = GetResistanceBypass(meleeUid, user, component);
|
||||
|
||||
// For consistency with wide attacks stuff needs damageable.
|
||||
if (Deleted(target) ||
|
||||
@@ -502,7 +514,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
RaiseLocalEvent(target.Value, attackedEvent);
|
||||
|
||||
var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + attackedEvent.BonusDamage, hitEvent.ModifiersList);
|
||||
var damageResult = Damageable.TryChangeDamage(target, modifiedDamage, origin:user);
|
||||
var damageResult = Damageable.TryChangeDamage(target, modifiedDamage, origin:user, ignoreResistances:resistanceBypass);
|
||||
|
||||
if (damageResult is {Empty: false})
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user