From c3b5e6e13be3a7b4b6db4b4a8c49ba37d5af7ed7 Mon Sep 17 00:00:00 2001 From: donnyjang Date: Thu, 15 Oct 2026 21:04:13 -0700 Subject: [PATCH] core: Tag duel has no Battle Phase on turns 1-3; the fourth duelist battles first The official Tag Duel rules: duelists 1A, 2A and 1B cannot enter their Battle Phase; 2B (turn 4) is the first who can. The core blocked turn 1 only, so team B's first duelist could attack on turn 2. One helper, field::is_opening_turn_without_bp, now decides for the idle command and for Duel.IsAbleToEnterBP: turns 1-3 in DUEL_TAG_MODE, turn 1 otherwise, DUEL_ATTACK_FIRST_TURN still lifts it. Rules only; no contract change. Co-Authored-By: Claude Fable 5.1 --- CHANGELOG.md | 8 ++++++++ contract/engine-contract.md | 1 + core/field.cpp | 8 +++++++- core/field.h | 1 + core/processor.cpp | 2 +- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 473a017..f9d9671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ wire protocol, the engine message stream, the setup pairs and the Lua API. A row change first shipped in the Unity repo, the ticket, and the contract part it touched. Rows 0001-0024 are the fork patches replayed into this repo as commits (`git log --oneline -- server/gframe core`). +## v1.1.1 — 2026-10-15 + +A rules fix in the core only. No contract change: same exports, protocol 8, capabilities `0x7FF`. + +| Date | Change | Ticket | Contract part | +|---|---|---|---| +| 2026-10-15 | Tag duel opening turns: no Battle Phase on turns 1, 2 and 3 (duelists 1A, 2A, 1B); the fourth duelist (2B) is the first who can battle, as the official Tag Duel rules say. Single duels keep turn 1 only. `DUEL_ATTACK_FIRST_TURN` still lifts the block. Core (`field::is_opening_turn_without_bp`, used by the idle command and `Duel.IsAbleToEnterBP`). | - | Rules only; no contract change | + ## v1.1.0 — 2026-10-15 The C# binding joins the release: `ygol-engine-binding.zip` (`YGOLegacy.Engine.dll` + `.pdb`) beside diff --git a/contract/engine-contract.md b/contract/engine-contract.md index 329e28e..7b46e4e 100644 --- a/contract/engine-contract.md +++ b/contract/engine-contract.md @@ -243,6 +243,7 @@ carry a new feature inside another feature's message. | 0016 | Tag: team B is loaded as seat 2 main deck + seat 3 tag deck, the prompt owner starts at seat 2; with core patch 0015 the turn order is seat 0, 2, 1, 3. | | 0018 | Spectators see all: every observer gets the UNMASKED stream (both hands, draws, set cards, extra, banished, the 0005 snapshot) unless the setup pair `ygol.room.spectatorview=hidden` is present, which restores the stock masked stream byte for byte. Duelists' streams never change. | | 0021 | START ends a rules-restart reservation window and stops the lobby clock, so an untimed duel no longer ends at once on "time limit up". | +| v1.1.1 | Tag: no Battle Phase on turns 1, 2 and 3 (1A, 2A, 1B); the fourth duelist (2B) is the first who can battle. `MSG_SELECT_IDLECMD` carries `to_bp` = 0 on those turns and `Duel.IsAbleToEnterBP` answers false. Single duels: turn 1 only, as stock. | ### Replay diff --git a/core/field.cpp b/core/field.cpp index f181c0d..227e21b 100644 --- a/core/field.cpp +++ b/core/field.cpp @@ -3704,8 +3704,14 @@ int32_t field::check_spself_from_hand_trigger(const chain& ch) const { } return TRUE; } +// [YGOL] Tag: the first three duelists (1A, 2A, 1B) have no Battle Phase; the fourth is the first who can battle. +int32_t field::is_opening_turn_without_bp() { + if(core.duel_options & DUEL_ATTACK_FIRST_TURN) + return FALSE; + return infos.turn_id <= ((core.duel_options & DUEL_TAG_MODE) ? 3 : 1); +} int32_t field::is_able_to_enter_bp() { - return ((core.duel_options & DUEL_ATTACK_FIRST_TURN) || infos.turn_id != 1) + return !is_opening_turn_without_bp() && infos.phase < PHASE_BATTLE_START && !is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_BP); } diff --git a/core/field.h b/core/field.h index 98b9a81..e4627b4 100644 --- a/core/field.h +++ b/core/field.h @@ -531,6 +531,7 @@ public: int32_t check_trigger_effect(const chain& ch) const; int32_t check_spself_from_hand_trigger(const chain& ch) const; int32_t is_able_to_enter_bp(); + int32_t is_opening_turn_without_bp(); void add_process(uint16_t type, uint16_t step, effect* peffect, group* target, int32_t arg1, int32_t arg2, int32_t arg3 = 0, int32_t arg4 = 0, void* ptr1 = nullptr, void* ptr2 = nullptr); uint32_t process(); diff --git a/core/processor.cpp b/core/processor.cpp index 267c0f6..301c3e8 100644 --- a/core/processor.cpp +++ b/core/processor.cpp @@ -2078,7 +2078,7 @@ int32_t field::process_idle_command(uint16_t step) { chain newchain; core.to_bp = TRUE; core.to_ep = TRUE; - if((!(core.duel_options & DUEL_ATTACK_FIRST_TURN) && infos.turn_id == 1) || infos.phase == PHASE_MAIN2 || is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_BP)) + if(is_opening_turn_without_bp() || infos.phase == PHASE_MAIN2 || is_player_affected_by_effect(infos.turn_player, EFFECT_CANNOT_BP)) core.to_bp = FALSE; if(infos.phase == PHASE_MAIN1) { for(auto& pcard : player[infos.turn_player].list_mzone) {