(client) chore:修复子弹属性错误,人物属性错误,侧边消息堆叠错误

This commit is contained in:
m0_75251201
2025-09-08 09:24:32 +08:00
parent 379ed07773
commit 6cb4483d20
9 changed files with 122 additions and 6171 deletions

View File

@ -62,12 +62,14 @@ namespace Entity
protected set => _attribute = value;
}
private Attributes _baseAttributes;
public virtual Attributes baseAttributes
public virtual Attributes baseAttributes => defAttributes;
private Attributes _defAttributes;
public virtual Attributes defAttributes
{
get
{
return _baseAttributes ??= entityDef == null ? new Attributes() : new Attributes(entityDef.attributes);
return _defAttributes ??= entityDef == null ? new Attributes() : new Attributes(entityDef.attributes);
}
}
@ -392,6 +394,8 @@ namespace Entity
{
_attackTimer = weaponResource.AttackCooldown;
_attackDetectionTime = weaponResource.AttackDetectionTime;
currentAttackWeapon = weaponResource;
if (weaponResource.AttackAnimationTime > 0)
{
TemporaryAnimationManager.Instance.GenerateTemporaryAnimation(
@ -409,14 +413,13 @@ namespace Entity
HideCurrentBodyTexture();
}
currentAttackWeapon = weaponResource;
}
public void SetBodyTexture(EntityState state, Orientation orientation)
{
HideCurrentBodyTexture();
if (IsAttacking && !currentAttackWeapon.UseEntityAttackAnimation)
if (IsAttacking && currentAttackWeapon is { UseEntityAttackAnimation: false })
return;
if (bodyNodes.TryGetValue(state, out var showStateNode))
{
@ -462,7 +465,6 @@ namespace Entity
{
return;
}
var hit = from.attributes.attack - attributes.defense;
if (hit < 0)
hit = from.attributes.attack / 100;