feat(battle-node): TurnEndHandler emits {turnState:0} to opponent only in PvP
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using SVSim.BattleNode.Protocol;
|
||||
using SVSim.BattleNode.Protocol.Bodies;
|
||||
|
||||
namespace SVSim.BattleNode.Sessions.Dispatch.Handlers;
|
||||
|
||||
@@ -16,15 +17,11 @@ internal sealed class TurnEndHandler : IFrameHandler
|
||||
{
|
||||
if (ctx.Type == BattleType.Pvp && ctx.BothAfterReady())
|
||||
{
|
||||
var te = BattleFrames.BuildTurnEndBroadcast();
|
||||
var jg = BattleFrames.BuildJudgeBroadcast();
|
||||
return new[]
|
||||
{
|
||||
new DispatchRoute(ctx.From, te, false),
|
||||
new DispatchRoute(ctx.Other, te, false),
|
||||
new DispatchRoute(ctx.From, jg, false),
|
||||
new DispatchRoute(ctx.Other, jg, false),
|
||||
};
|
||||
// Opponent sees {turnState}; receiving TurnEnd drives its SendJudge (handover gate).
|
||||
// battleCode/actionSeq/cemetery are dropped. The paired Judge{spin} is emitted by
|
||||
// JudgeHandler when the active player sends its own Judge frame.
|
||||
var te = ctx.Env with { Body = new TurnEndBody(TurnState: 0) };
|
||||
return new[] { new DispatchRoute(ctx.Other, te, false) };
|
||||
}
|
||||
if (ctx.Type == BattleType.Scripted)
|
||||
return new[] { new DispatchRoute(ctx.Other, ctx.Env, false) };
|
||||
|
||||
Reference in New Issue
Block a user