Repository navigation
Add OneForSynchro - #289
Open
Wind2009-Louse wants to merge 2 commits into
Open
Wind2009-Louse wants to merge 2 commits into
Wind2009-Louse wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OneForSynchro/OneForSynchroEffect已知卡分类,用于识别“场上没有调整 + 非调整也能同调”的怪兽与效果。Add
OneForSynchro/OneForSynchroEffectknown-card enums for monsters and effects that can Synchro Summon without Tuner + non-Tuner already on the field.Default Dimensional Barrier, Labrynth Dimensional Barrier, and Fallen of Albaz fusion-material evaluation now use these enums so those Synchro lines are not missed.
Duel.CurrentChainInfo,以便同时用ActivateDescription、Announces和-1回退判断效果。Chain-side checks now read
Duel.CurrentChainInfo, soActivateDescription,Announces, and the-1fallback can all be used.背景 / Background
原先「次元障壁 / Dimensional Barrier」把“对方可能同调”主要理解成两类情况:场上已有调整 + 非调整,或连锁卡本身是同调怪兽 / 同调相关卡。这会漏掉两类常见局面:
Previously, Dimensional Barrier treated “the opponent may Synchro Summon” mainly as Tuner + non-Tuner already on the field, or the chain card itself being a Synchro monster / Synchro-related card. That missed two common cases:
When this on-field monster is used as Synchro Material, a card in the hand can also be used as material. Tuner + non-Tuner do not both need to be on the field. Examples: Eccentric Boy, Tatsunoko, Kewl Tune.
StringId,有时写进ChainInfo.Announces,可选诱发还可能是-1。Activating an effect can Synchro Summon without Tuner + non-Tuner already on the field. Examples: Crystron, Ashtra, Kewl Tune Clip, Kewl Tune Remix, Magikey Locking. The description may be a concrete
StringId, a value written intoChainInfo.Announces, or-1for optional triggers.这组改动与已有的
OneForXyz同类:把已知卡收进枚举,再在公共检查里复用。This follows the existing
OneForXyzpattern: collect known cards into enums, then reuse them in shared checks.改动 / Changes
已知卡与查询接口 / Known cards and query helpers
新增
Game/AI/Enums/OneForSynchro.cs:Add
Game/AI/Enums/OneForSynchro.cs:OneForSynchro:场上这只怪兽当同调素材时,可以用手牌当素材。OneForSynchro: when this on-field monster is used as Synchro Material, a card in the hand can also be used as material.OneForSynchroEffect:效果描述或HINT_OPSELECTED宣告值,编码为cardId * 16 + offset。OneForSynchroEffect: activate descriptions orHINT_OPSELECTEDannounce values, encoded ascardId * 16 + offset.CardExtension增加:CardExtensionadds:ClientCard.IsOneForSynchro():按卡号查OneForSynchro。ClientCard.IsOneForSynchro(): look upOneForSynchroby card ID.ChainInfo.IsOneForSynchroEffect():按顺序匹配Announces、ActivateDescription;描述为-1时,只对“几乎可以确定就是这条同调效果”的卡做回退。回退会看发动位置:「杀手级调整曲·削波手 / Kewl Tune Clip」只在手牌,「水晶机巧-三位玉晶 / Crystron Tristaros」只在怪兽区域。ChainInfo.IsOneForSynchroEffect(): matchAnnounces, thenActivateDescription; if the description is-1, fall back only for cards that are almost certainly this Synchro effect. The fallback uses activation location: Kewl Tune Clip from the hand only, Crystron Tristaros from the Monster Zone only.没有
SetDescription的卡不进OneForSynchroEffect枚举,只走-1回退,例如「魔键锭-施- / Magikey Locking」、「同调呼唤 / Synchro Call」、「超重武者 魂-C / Superheavy Samurai Battleball」、「同调素材 / Synchro Material」、「娱乐伙伴 诱导女导演 / Performapal Miss Director」。艮神鬼 / Ashtra 一类在连锁建立时用SelectFromOptions的卡,依赖ChainInfo.Announces(#282)。Cards without
SetDescriptionare not in theOneForSynchroEffectenum and only use the-1fallback, e.g. Magikey Locking, Synchro Call, Superheavy Samurai Battleball, Synchro Material, Performapal Miss Director. Ashtra cards that useSelectFromOptionswhile the chain is built depend onChainInfo.Announces(#282).调用点 / Call sites
DefaultDimensionalBarrier:对方场上有IsOneForSynchro()怪兽时选同调;最新连锁是IsOneForSynchroEffect()时也选同调。最新连锁改为CurrentChainInfo.LastOrDefault(),关联卡为空或未无效时仍可按效果描述判断。DefaultDimensionalBarrier: choose Synchro if the opponent has anIsOneForSynchro()monster, or if the latest chain isIsOneForSynchroEffect(). The latest chain is nowCurrentChainInfo.LastOrDefault(), so the effect can still be judged when the related card is null or not disabled.LabrynthExecutor.DimensionalBarrierForSynchro:同样检查连锁中的 OneForSynchro 效果,以及对方场上的 OneForSynchro 怪兽。LabrynthExecutor.DimensionalBarrierForSynchro: the same checks for OneForSynchro effects on the chain and OneForSynchro monsters on the opponent's field.AlbazExecutor:三处融合素材评估把 OneForSynchro 怪兽与 OneForXyz、Floodgate 一样视为高价值素材。AlbazExecutor: three fusion-material checks now treat OneForSynchro monsters as high-value materials, same as OneForXyz and Floodgate.文件 / Files
Game/AI/Enums/OneForSynchro.csGame/AI/CardExtension.cs-1回退 / Query helpers and-1fallbackGame/AI/DefaultExecutor.csGame/AI/Decks/LabrynthExecutor.csGame/AI/Decks/AlbazExecutor.cs枚举收录卡名 / Cards in the enums
名称来自 ygocdb.com。艮神鬼 / Ashtra 目前没有
en_name,英文用wiki_en。Names are from ygocdb.com. Ashtra cards currently have no
en_name; English names usewiki_en.OneForSynchro场上这只怪兽当同调素材时,可以用手牌当素材。
On-field monsters that can use a card in the hand as Synchro Material.
OneForSynchroEffect效果描述或
HINT_OPSELECTED宣告。Activate descriptions or
HINT_OPSELECTEDannounces.-1回退额外覆盖 / Extra cards in the-1fallback这些卡没有
SetDescription,只在描述为-1时按卡号(及发动位置)回退。These cards have no
SetDescriptionand are only matched by card ID (and location) when the description is-1.「杀手级调整曲·削波手 / Kewl Tune Clip」在手牌、「水晶机巧-三位玉晶 / Crystron Tristaros」在怪兽区域时,描述为
-1也会走这条回退。Kewl Tune Clip from the hand and Crystron Tristaros from the Monster Zone also use this fallback when the description is
-1.