Skip to content

fix select forced chain on DUEL_SIMPLE_AI#842

Merged
mercury233 merged 3 commits into
Fluorohydride:masterfrom
mercury233:patch-ai-select-chain
Apr 29, 2026
Merged

fix select forced chain on DUEL_SIMPLE_AI#842
mercury233 merged 3 commits into
Fluorohydride:masterfrom
mercury233:patch-ai-select-chain

Conversation

@mercury233

@mercury233 mercury233 commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

When AI is asked to select a forced chain, it should always return a item.

before #753 : always return the first item when forced
after #753 : may return -1 when the current chain include the card of AI (broken, don't respond to forced chain)

after fix:

  • return the first item if the chain is forced
  • don't chain only if the last chain is triggered by the AI itself (breaking change)

fix Fluorohydride/ygopro#3025 , close #838

@mercury233 mercury233 requested a review from Copilot April 21, 2026 02:22
@mercury233 mercury233 changed the title Patch ai select chain fix select forced chain on DUEL_SIMPLE_AI Apr 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Simple AI behavior when prompted to select a chain, ensuring it always selects an option when chaining is forced and avoids incorrectly passing due to earlier AI chain links.

Changes:

  • Update Simple AI select_chain logic to only avoid chaining when the last chain link was triggered by the AI itself.
  • Ensure Simple AI selects the first available chain option when any candidate chain is marked CHAIN_FORCED.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mercury233

Copy link
Copy Markdown
Collaborator Author

@yybbwc 修改前,只要连锁中有一张卡是AI发动的,AI就不会再继续连锁。修改后,只有连锁中最后一张卡是AI发动的,AI才不会连锁。虽然这样才是正确的防止AI康自己,但对于残局会不会有负面影响?

@yybbwc

yybbwc commented Apr 22, 2026

Copy link
Copy Markdown

@yybbwc 修改前,只要连锁中有一张卡是AI发动的,AI就不会再继续连锁。修改后,只有连锁中最后一张卡是AI发动的,AI才不会连锁。虽然这样才是正确的防止AI康自己,但对于残局会不会有负面影响?

会吧。就是一些老局可能会解不开了。许多残局都到了利用对手操作的程度。

不过,上次调整连锁顺序已经让一些老局中招了,再来一些破坏性更新,应该也问题不大。“修改后,只有连锁中最后一张卡是AI发动的,AI才不会连锁”可以让ai变强。

@mercury233

Copy link
Copy Markdown
Collaborator Author

@yybbwc 修改前,只要连锁中有一张卡是AI发动的,AI就不会再继续连锁。修改后,只有连锁中最后一张卡是AI发动的,AI才不会连锁。虽然这样才是正确的防止AI康自己,但对于残局会不会有负面影响?

会吧。就是一些老局可能会解不开了。许多残局都到了利用对手操作的程度。

不过,上次调整连锁顺序已经让一些老局中招了,再来一些破坏性更新,应该也问题不大。“修改后,只有连锁中最后一张卡是AI发动的,AI才不会连锁”可以让ai变强。

那先不改了,有空加个flag

@mercury233 mercury233 merged commit a82cf03 into Fluorohydride:master Apr 29, 2026
2 checks passed
@mercury233 mercury233 deleted the patch-ai-select-chain branch April 29, 2026 07:19
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.

疑似bug:残局模式

3 participants