Wieldable/two-handed weapons (#4554)

* wielding kinda works

* rough out all the edges, wielding works nicely

* popups + loc

* increase damage & extra damage against whitelist

* small fixes

* forgot to actually do that

* reviews

* reviews + thing

* use resistances and not extradamageagainstwhitelist

* slashy

* make increasedamageonwield and melee hit events work with modifiersets

* Silly individual
This commit is contained in:
mirrorcult
2021-09-17 07:16:11 -07:00
committed by GitHub
parent 078a62762f
commit 62f6c8dd8e
36 changed files with 719 additions and 161 deletions

View File

@@ -88,7 +88,9 @@ namespace Content.Server.Weapon.Melee
{
var targets = new[] { target };
SendAnimation(comp.ClickArc, angle, args.User, owner, targets, comp.ClickAttackEffect, false);
_damageableSystem.TryChangeDamage(target.Uid, comp.Damage);
_damageableSystem.TryChangeDamage(target.Uid,
DamageSpecifier.ApplyModifierSets(comp.Damage, hitEvent.ModifiersList));
SoundSystem.Play(Filter.Pvs(owner), comp.HitSound.GetSound(), target);
}
}
@@ -153,7 +155,8 @@ namespace Content.Server.Weapon.Melee
foreach (var entity in hitEntities)
{
_damageableSystem.TryChangeDamage(entity.Uid, comp.Damage);
_damageableSystem.TryChangeDamage(entity.Uid,
DamageSpecifier.ApplyModifierSets(comp.Damage, hitEvent.ModifiersList));
}
}
@@ -274,6 +277,17 @@ namespace Content.Server.Weapon.Melee
/// </summary>
public class MeleeHitEvent : HandledEntityEventArgs
{
/// <summary>
/// Modifier sets to apply to the hit event when it's all said and done.
/// This should be modified by adding a new entry to the list.
/// </summary>
public List<DamageModifierSet> ModifiersList = new();
/// <summary>
/// A flat amount of damage to add. Same reason as above with Multiplier.
/// </summary>
public int FlatDamage = 0;
/// <summary>
/// A list containing every hit entity. Can be zero.
/// </summary>