diff --git a/Game/AI/Decks/BlueEyesExecutor.cs b/Game/AI/Decks/BlueEyesExecutor.cs index 9939f7b7..1abf3b4b 100644 --- a/Game/AI/Decks/BlueEyesExecutor.cs +++ b/Game/AI/Decks/BlueEyesExecutor.cs @@ -177,6 +177,22 @@ public override IList OnSelectSynchroMaterial(IList card return null; } + public override void OnSpSummoned() + { + // not special summoned by chain + if (Duel.GetCurrentSolvingChainCard() == null) + { + foreach (ClientCard card in Duel.LastSummonedCards) + { + if (card.Controller == 0 && card.IsCode(CardId.AlternativeWhiteDragon)) + { + AlternativeWhiteDragonSummoned = true; + } + } + } + base.OnSpSummoned(); + } + private bool DragonShrineEffect() { AI.SelectCard( @@ -501,7 +517,6 @@ private bool WhiteStoneOfAncientsEffect() private bool AlternativeWhiteDragonSummon() { - AlternativeWhiteDragonSummoned = true; return true; } diff --git a/Game/AI/Executor.cs b/Game/AI/Executor.cs index 7ef678d6..548f1a49 100644 --- a/Game/AI/Executor.cs +++ b/Game/AI/Executor.cs @@ -237,6 +237,16 @@ public virtual int OnAnnounceCard(IList avail) return 0; } + /// + /// Called when card is successfully special summoned. + /// Used on monsters that can only special summoned once per turn. + /// + public virtual void OnSpSummoned() + { + // For overriding + return; + } + public void SetMain(MainPhase main) { Main = main; diff --git a/Game/GameAI.cs b/Game/GameAI.cs index 18a81d2d..1848dd17 100644 --- a/Game/GameAI.cs +++ b/Game/GameAI.cs @@ -164,6 +164,15 @@ public void OnChainSolved(int chainIndex) { Executor.OnChainSolved(chainIndex); } + + /// + /// Called when card is successfully special summoned. + /// Used on monsters that can only special summoned once per turn. + /// + public void OnSpSummoned() + { + Executor.OnSpSummoned(); + } /// /// Called when a chain has been solved. diff --git a/Game/GameBehavior.cs b/Game/GameBehavior.cs index c0bdc892..0770fe08 100644 --- a/Game/GameBehavior.cs +++ b/Game/GameBehavior.cs @@ -27,7 +27,7 @@ public class GameBehavior private Room _room; private Duel _duel; private int _hand; - private bool _debug; + private bool _debug; private int _select_hint; private GameMessage _lastMessage; @@ -1971,6 +1971,7 @@ private void OnSpSummoned(BinaryReader packet) card.IsSpecialSummoned = true; _duel.LastSummonedCards.Add(card); } + _ai.OnSpSummoned(); _duel.SummoningCards.Clear(); }