Skip to content

Record SelectOption announces on ChainInfo - #282

Open
Wind2009-Louse wants to merge 1 commit into
IceYGO:masterfrom
Wind2009-Louse:patch-chain-options
Open

Record SelectOption announces on ChainInfo#282
Wind2009-Louse wants to merge 1 commit into
IceYGO:masterfrom
Wind2009-Louse:patch-chain-options

Conversation

@Wind2009-Louse

Copy link
Copy Markdown
Contributor

Summary / 摘要

Record Duel.SelectOption announces (HINT_OPSELECTED) on ChainInfo after a chain is activated and before it starts resolving. Drop the executor-local Lightning Storm option flag and read that chain snapshot instead.

在连锁发动后、处理前,把 Duel.SelectOption 的宣言(HINT_OPSELECTED)记到 ChainInfo。去掉执行器里 Lightning Storm 的局部选项旗标,改为读这条连锁快照。

Lightning Storm (c14532163) chooses its effect in target with Duel.SelectOption:

Lightning Storm(c14532163)在 target 里用 Duel.SelectOption 选择效果:

  • aux.Stringid(14532163, 0) — destroy opponent's Attack Position monsters / 破坏对方攻击表示怪兽
  • aux.Stringid(14532163, 1) — destroy opponent's Spells/Traps / 破坏对方魔陷

ocgcore then sends MSG_HINT / HINT_OPSELECTED with that string id. State is stored in GameBehavior on the chain (same layer as Targets), not parsed by deck executors.

ocgcore 随后发出带该 string id 的 MSG_HINT / HINT_OPSELECTED。状态由 GameBehavior 落到连锁上(与 Targets 同层),牌组执行器不解析网络包。

Changes / 改动

Area Notes
ChainInfo Add Announces (IList<int>) and HasAnnounce. Values are option string ids only; the activator is already ActivatePlayer.
GameBehavior.OnHint On HINT_OPSELECTED, if CurrentChainInfo is non-empty and SolvingChainIndex == 0, append data to the latest chain. Skip when there is no chain or resolution has started. Still call OnReceivingAnnouce. Cleared with CurrentChainInfo on chain end.
DefaultExecutor Remove lightningStormOption, OnReceivingAnnouce, and OnChainEnd. DefaultOnBecomeTarget treats the bot's Attack Position monsters / Spell & Trap Zone as threatened when an opponent Lightning Storm chain HasAnnounce of str0 / str1.
位置 说明
ChainInfo 新增 AnnouncesIList<int>)和 HasAnnounce。只存选项 string id;发动者已有 ActivatePlayer
GameBehavior.OnHint 收到 HINT_OPSELECTED 时,若 CurrentChainInfo 非空且 SolvingChainIndex == 0,把 data 追加到最后一条连锁。无连锁或已进入处理则不写。仍调用 OnReceivingAnnouce。连锁结束随 CurrentChainInfo 一起清掉。
DefaultExecutor 删除 lightningStormOptionOnReceivingAnnouceOnChainEnd。对方 Lightning Storm 连锁 HasAnnounce 为 str0 / str1 时,DefaultOnBecomeTarget 分别把我方攻击表示怪兽 / 魔陷区视为受威胁。

Executor.OnReceivingAnnouce / GameAI.OnReceivingAnnouce are unchanged for other decks.

Executor.OnReceivingAnnouce / GameAI.OnReceivingAnnouce 保留,供其它牌组覆盖。

Out of scope: AnnounceCard / AnnounceNumber / AnnounceRace / AnnounceAttrib (they do not go through HINT_OPSELECTED); bot-side Lightning Storm AI.SelectOption.

本次不改:AnnounceCard / AnnounceNumber / AnnounceRace / AnnounceAttrib(不走 HINT_OPSELECTED);己方发动 Lightning Storm 时的 AI.SelectOption

* Update AI logic for Lightning Storm interactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant