(client) feat:添加基地界面到游玩界面的过程,添加存档管理,技能树变得可用 (#58)

Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com>
Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/58
This commit is contained in:
2025-10-03 00:31:34 +08:00
parent aff747be17
commit dd9d90439d
134 changed files with 10322 additions and 4872 deletions

View File

@@ -54,7 +54,7 @@ namespace Entity
/// <summary>
/// 获取实体当前的最终属性包括所有健康状态Hediff的修正。
/// </summary>
public override Attributes attributes
public override Attributes AttributesNow
{
get
{
@@ -87,8 +87,17 @@ namespace Entity
}
protected set => _cachedAttributes = value;
}
public EntityPathManager pathManager;
public override bool OnTargetPoint => pathManager.IsPathComplete;
public LivingEntity()
{
pathManager = new EntityPathManager(this);
}
/// <summary>
/// 供内部使用的属性标记方法。当 Hediff 自身状态改变并影响属性时,通过此方法通知 LivingEntity。
/// </summary>
@@ -96,7 +105,7 @@ namespace Entity
{
_needUpdateAttributes = true;
}
/// <summary>
/// 每帧调用的更新函数,传入时间增量。
/// </summary>
@@ -156,5 +165,23 @@ namespace Entity
_needUpdateAttributes = true; // 移除Hediff需要更新属性缓存
}
}
public override void SetTarget(Vector3 pos)
{
base.SetTarget(pos);
pathManager.GeneratePath(pos);
}
public override void TryMove()
{
if (pathManager.IsPathComplete)
return;
_walkingTimer = 2;
var target= pathManager.GetNextPosition(Position, AttributesNow.moveSpeed);
Direction = target - Position;
SetBodyTexture(EntityState.Walking, CurrentOrientation);
transform.position = target;
}
}
}