- tweak: Less attack cooldown on miss. (#140)
This commit is contained in:
@@ -428,8 +428,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
switch (attack)
|
switch (attack)
|
||||||
{
|
{
|
||||||
case LightAttackEvent light:
|
case LightAttackEvent light:
|
||||||
DoLightAttack(user, light, weaponUid, weapon, session, out var anim); // WD EDIT
|
DoLightAttack(user, light, weaponUid, weapon, session, out var miss); // WD EDIT
|
||||||
animation = anim ?? weapon.Animation; // WD EDIT
|
// WD EDIT START
|
||||||
|
animation = miss && weapon.Animation == "WeaponArcThrust"
|
||||||
|
? weapon.MissAnimation
|
||||||
|
: weapon.Animation;
|
||||||
|
if (miss)
|
||||||
|
weapon.NextAttack -= fireRate / 2f;
|
||||||
|
// WD EDIT END
|
||||||
break;
|
break;
|
||||||
case DisarmAttackEvent disarm:
|
case DisarmAttackEvent disarm:
|
||||||
if (!DoDisarm(user, disarm, weaponUid, weapon, session))
|
if (!DoDisarm(user, disarm, weaponUid, weapon, session))
|
||||||
@@ -459,9 +465,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
|
|
||||||
protected abstract bool InRange(EntityUid user, EntityUid target, float range, ICommonSession? session);
|
protected abstract bool InRange(EntityUid user, EntityUid target, float range, ICommonSession? session);
|
||||||
|
|
||||||
protected virtual void DoLightAttack(EntityUid user, LightAttackEvent ev, EntityUid meleeUid, MeleeWeaponComponent component, ICommonSession? session, out string? animation) // WD EDIT
|
protected virtual void DoLightAttack(EntityUid user, LightAttackEvent ev, EntityUid meleeUid, MeleeWeaponComponent component, ICommonSession? session, out bool miss) // WD EDIT
|
||||||
{
|
{
|
||||||
animation = null; // WD EDIT
|
miss = false; // WD EDIT
|
||||||
// If I do not come back later to fix Light Attacks being Heavy Attacks you can throw me in the spider pit -Errant
|
// 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 damage = GetDamage(meleeUid, user, component) * GetHeavyDamageModifier(meleeUid, user, component);
|
||||||
var target = GetEntity(ev.Target);
|
var target = GetEntity(ev.Target);
|
||||||
@@ -490,8 +496,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
var missEvent = new MeleeHitEvent(new List<EntityUid>(), user, meleeUid, damage, null);
|
var missEvent = new MeleeHitEvent(new List<EntityUid>(), user, meleeUid, damage, null);
|
||||||
RaiseLocalEvent(meleeUid, missEvent);
|
RaiseLocalEvent(meleeUid, missEvent);
|
||||||
Audio.PlayPredicted(component.SwingSound, meleeUid, user);
|
Audio.PlayPredicted(component.SwingSound, meleeUid, user);
|
||||||
if (component.Animation == "WeaponArcThrust") // WD EDIT
|
miss = true; // WD EDIT
|
||||||
animation = component.MissAnimation;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user