feat(gameplay): 实现召唤师对决模式核心功能

- 新增召唤师对决管理模式,支持点卡片直接召唤单位
- 添加召唤师点地移动控制,移动时不攻击、站定时自动攻击
- 实现召唤师模式开关,单位不再自动追击远处敌人
- 更新卡牌按钮逻辑,对决模式下按能量消耗直接召唤
- 修改单位基础行为,支持移动中不攻击的召唤师模式
- 更新核心玩法文档,从建筑生产模式转向召唤师对决模式
- 添加召唤师对决测试场景,整合新的战斗逻辑
```
This commit is contained in:
huadexuan committed 2026-09-16 18:16:13 +08:00
1 parent 1cdb7c3910
commit f06a1d8f92
21 files changed
+870 -220

No files matched your search

+36 -1
View File
@@ -72,6 +72,13 @@ public class UnitBase : MonoBehaviour
[Min(0f)] public float separationWeight = 3f;
[Min(0f)] public float targetSpreadBias = 6f;
[Header("召唤师模式")]
// 召唤师:不自动追击远处敌人,只在站定后攻击射程内的目标;移动由 SummonerClickMovement 控制。
public bool summonerMode = false;
//召唤师模式下允许自动攻击的开关(移动时由操控脚本关闭,站定时开启)。
private bool summonerAttackEnabled = true;
private static Collider[] s_separationBuffer = new Collider[30];
//角色状态
@@ -243,6 +250,20 @@ public class UnitBase : MonoBehaviour
target = FindNearestOpponent();
if (target != null)
{
// 召唤师模式:不主动追击,站定且攻击开关开启时才攻击射程内目标。
if (summonerMode)
{
if (!IsWithinAttackReach(target) || !summonerAttackEnabled)
{
state = State.Alert;
// 动画由 SummonerClickMovement 控制,这里不设置
applyGravity();
return;
}
attack(target);
return;
}
state = State.Track;
//目标在攻击范围外则朝目标移动,否则开始攻击
@@ -260,7 +281,11 @@ public class UnitBase : MonoBehaviour
//场上没有敌人时进入待机,不再巡逻移动
state = State.Alert;
animator.SetInteger("speed", 0);
// 召唤师模式下动画由 SummonerClickMovement 控制(移动时 speed=1,站定后 speed=0)
if (!summonerMode)
{
animator.SetInteger("speed", 0);
}
applyGravity();
}
@@ -268,6 +293,16 @@ public class UnitBase : MonoBehaviour
public string OpponentTag => GetOpponentTag();
// 召唤师模式下控制"移动中不攻击":移动时 false,站定后 true。
public void SetSummonerAttackEnabled(bool enabled)
{
summonerAttackEnabled = enabled;
if (!enabled && state == State.Track)
{
state = State.Alert;
}
}
public float AttackSpeedMultiplier => attackSpeedMultiplier;
public bool IsStunned => statusEffectController != null && statusEffectController.IsStunned;