zombie claw animation fix (#12537)
This commit is contained in:
@@ -121,7 +121,8 @@ namespace Content.Server.Zombies
|
|||||||
var melee = EnsureComp<MeleeWeaponComponent>(target);
|
var melee = EnsureComp<MeleeWeaponComponent>(target);
|
||||||
melee.ClickAnimation = zombiecomp.AttackAnimation;
|
melee.ClickAnimation = zombiecomp.AttackAnimation;
|
||||||
melee.WideAnimation = zombiecomp.AttackAnimation;
|
melee.WideAnimation = zombiecomp.AttackAnimation;
|
||||||
melee.Range = 0.75f;
|
melee.Range = 1.5f;
|
||||||
|
Dirty(melee);
|
||||||
|
|
||||||
//We have specific stuff for humanoid zombies because they matter more
|
//We have specific stuff for humanoid zombies because they matter more
|
||||||
if (TryComp<HumanoidComponent>(target, out var huApComp)) //huapcomp
|
if (TryComp<HumanoidComponent>(target, out var huApComp)) //huapcomp
|
||||||
@@ -170,8 +171,8 @@ namespace Content.Server.Zombies
|
|||||||
_damageable.SetAllDamage(damageablecomp, 0);
|
_damageable.SetAllDamage(damageablecomp, 0);
|
||||||
|
|
||||||
//gives it the funny "Zombie ___" name.
|
//gives it the funny "Zombie ___" name.
|
||||||
if (TryComp<MetaDataComponent>(target, out var meta))
|
var meta = MetaData(target);
|
||||||
meta.EntityName = Loc.GetString("zombie-name-prefix", ("target", meta.EntityName));
|
meta.EntityName = Loc.GetString("zombie-name-prefix", ("target", meta.EntityName));
|
||||||
|
|
||||||
_identity.QueueIdentityUpdate(target);
|
_identity.QueueIdentityUpdate(target);
|
||||||
|
|
||||||
|
|||||||
@@ -140,11 +140,18 @@ public sealed class MeleeWeaponComponentState : ComponentState
|
|||||||
public TimeSpan NextAttack;
|
public TimeSpan NextAttack;
|
||||||
public TimeSpan? WindUpStart;
|
public TimeSpan? WindUpStart;
|
||||||
|
|
||||||
public MeleeWeaponComponentState(float attackRate, bool attacking, TimeSpan nextAttack, TimeSpan? windupStart)
|
public string ClickAnimation;
|
||||||
|
public string WideAnimation;
|
||||||
|
public float Range;
|
||||||
|
|
||||||
|
public MeleeWeaponComponentState(float attackRate, bool attacking, TimeSpan nextAttack, TimeSpan? windupStart, string clickAnimation, string wideAnimation, float range)
|
||||||
{
|
{
|
||||||
AttackRate = attackRate;
|
AttackRate = attackRate;
|
||||||
Attacking = attacking;
|
Attacking = attacking;
|
||||||
NextAttack = nextAttack;
|
NextAttack = nextAttack;
|
||||||
WindUpStart = windupStart;
|
WindUpStart = windupStart;
|
||||||
|
ClickAnimation = clickAnimation;
|
||||||
|
WideAnimation = wideAnimation;
|
||||||
|
Range = range;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
private void OnGetState(EntityUid uid, MeleeWeaponComponent component, ref ComponentGetState args)
|
private void OnGetState(EntityUid uid, MeleeWeaponComponent component, ref ComponentGetState args)
|
||||||
{
|
{
|
||||||
args.State = new MeleeWeaponComponentState(component.AttackRate, component.Attacking, component.NextAttack,
|
args.State = new MeleeWeaponComponentState(component.AttackRate, component.Attacking, component.NextAttack,
|
||||||
component.WindUpStart);
|
component.WindUpStart, component.ClickAnimation, component.WideAnimation, component.Range);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHandleState(EntityUid uid, MeleeWeaponComponent component, ref ComponentHandleState args)
|
private void OnHandleState(EntityUid uid, MeleeWeaponComponent component, ref ComponentHandleState args)
|
||||||
@@ -217,6 +217,10 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
component.AttackRate = state.AttackRate;
|
component.AttackRate = state.AttackRate;
|
||||||
component.NextAttack = state.NextAttack;
|
component.NextAttack = state.NextAttack;
|
||||||
component.WindUpStart = state.WindUpStart;
|
component.WindUpStart = state.WindUpStart;
|
||||||
|
|
||||||
|
component.ClickAnimation = state.ClickAnimation;
|
||||||
|
component.WideAnimation = state.WideAnimation;
|
||||||
|
component.Range = state.Range;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MeleeWeaponComponent? GetWeapon(EntityUid entity)
|
public MeleeWeaponComponent? GetWeapon(EntityUid entity)
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ namespace Content.Shared.Zombies
|
|||||||
/// The attack arc of the zombie
|
/// The attack arc of the zombie
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("attackArc", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
[DataField("attackArc", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||||
public string AttackAnimation = "WeaponArcClaw";
|
public string AttackAnimation = "WeaponArcBite";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The role prototype of the zombie antag role
|
/// The role prototype of the zombie antag role
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("zombieRoldId", customTypeSerializer: typeof(PrototypeIdSerializer<AntagPrototype>))]
|
[DataField("zombieRoleId", customTypeSerializer: typeof(PrototypeIdSerializer<AntagPrototype>))]
|
||||||
public readonly string ZombieRoleId = "Zombie";
|
public readonly string ZombieRoleId = "Zombie";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user