M1 回合制战斗架构收敛与 1v1 攻击闭环:BattleRuntime 内核、组件唯一入口、UI 数据驱动与 EditMode 测试
- 删除中间契约(BattleStartRequest/BattlePlayerInput/BattleReturnPlan/桥接与策略接口/FlowState),收敛为 BattleViewState/BattleStep/一层 BattleEvent - 新增内部 BattleRuntime/BattleUnit/BattleStatus 共享上下文;TurnBattleComponent 成为唯一外部入口,吸收启动/暂停/回写职责 - 内核支持 1v1 攻击闭环:效果公式、HP/MP 钳制、阵亡、Victory/TotalDefeat、敌人随机决策;敌人行动间歇 0.6s 由组件协程编排并经 StepListener 推送 - UI:玩家卡片/敌人槽/回合槽按战局重建,图标配置驱动(含新增 EnemyConfig.Icon),每轮刷新一次 TurnSlots 且轮内只移动高亮 - 新增 Tests 程序集 + InternalsVisibleTo,25 个 BattleRuntime 纯逻辑用例全部通过
This commit is contained in:
@@ -11,7 +11,7 @@ namespace SepCore.Debugger
|
||||
/// <summary>
|
||||
/// 战斗壳层调试入口(仅供 Editor/Development Build,正式构建不注册)。
|
||||
/// 模拟探索层:缺少单局状态时用配表角色与固定种子初始化临时状态,
|
||||
/// 然后通过 RunBattleCoordinator 以固定调试遭遇开始/结束战斗,不依赖尚未实现的地图敌人。
|
||||
/// 然后通过 TurnBattleComponent 以固定调试遭遇开始/结束战斗,不依赖尚未实现的地图敌人。
|
||||
/// </summary>
|
||||
public class BattleDebuggerWindow : IDebuggerWindow
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace SepCore.Debugger
|
||||
|
||||
if (GUILayout.Button("Close", GUILayout.Height(30)))
|
||||
{
|
||||
GameEntry.RunBattle.EndDebugBattle();
|
||||
GameEntry.TurnBattle.CloseBattle();
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
@@ -81,8 +81,8 @@ namespace SepCore.Debugger
|
||||
{
|
||||
InitDebugRunStateIfNeeded();
|
||||
|
||||
// 固定调试遭遇:EncounterId=1,敌人队伍预设 1,普通战斗
|
||||
bool started = GameEntry.RunBattle.TryStartBattle(new BattleEncounter(1, 1, false));
|
||||
// 固定调试遭遇:EncounterId=1,敌人队伍预设 4001(单敌人),普通战斗
|
||||
bool started = GameEntry.TurnBattle.TryStartBattle(new BattleEncounter(1, 4001, false), null);
|
||||
if (!started)
|
||||
{
|
||||
Log.Warning("Battle debug shell can not start, maybe a battle is already active.");
|
||||
@@ -112,9 +112,21 @@ namespace SepCore.Debugger
|
||||
return players;
|
||||
}
|
||||
|
||||
// M1 为 1v1:只取第一个新存档角色作为我方单位
|
||||
if (global.NewGameCharacterIds == null || global.NewGameCharacterIds.Count == 0)
|
||||
{
|
||||
Log.Warning("Can not build debug players without new game character ids.");
|
||||
return players;
|
||||
}
|
||||
|
||||
int order = 1;
|
||||
foreach (int characterId in global.NewGameCharacterIds)
|
||||
{
|
||||
if (order > 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
CharacterConfig config = GameEntry.Luban.Get<CharacterConfig>(characterId);
|
||||
if (config == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user