Commit 64526e23 authored by wind2009's avatar wind2009 Committed by GitHub

Add OnSpSummoned (#202)

parent b0a420e2
...@@ -177,6 +177,22 @@ namespace WindBot.Game.AI.Decks ...@@ -177,6 +177,22 @@ namespace WindBot.Game.AI.Decks
return null; 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() private bool DragonShrineEffect()
{ {
AI.SelectCard( AI.SelectCard(
...@@ -501,7 +517,6 @@ namespace WindBot.Game.AI.Decks ...@@ -501,7 +517,6 @@ namespace WindBot.Game.AI.Decks
private bool AlternativeWhiteDragonSummon() private bool AlternativeWhiteDragonSummon()
{ {
AlternativeWhiteDragonSummoned = true;
return true; return true;
} }
......
...@@ -237,6 +237,16 @@ namespace WindBot.Game.AI ...@@ -237,6 +237,16 @@ namespace WindBot.Game.AI
return 0; return 0;
} }
/// <summary>
/// Called when card is successfully special summoned.
/// Used on monsters that can only special summoned once per turn.
/// </summary>
public virtual void OnSpSummoned()
{
// For overriding
return;
}
public void SetMain(MainPhase main) public void SetMain(MainPhase main)
{ {
Main = main; Main = main;
......
...@@ -164,6 +164,15 @@ namespace WindBot.Game ...@@ -164,6 +164,15 @@ namespace WindBot.Game
{ {
Executor.OnChainSolved(chainIndex); Executor.OnChainSolved(chainIndex);
} }
/// <summary>
/// Called when card is successfully special summoned.
/// Used on monsters that can only special summoned once per turn.
/// </summary>
public void OnSpSummoned()
{
Executor.OnSpSummoned();
}
/// <summary> /// <summary>
/// Called when a chain has been solved. /// Called when a chain has been solved.
......
...@@ -27,7 +27,7 @@ namespace WindBot.Game ...@@ -27,7 +27,7 @@ namespace WindBot.Game
private Room _room; private Room _room;
private Duel _duel; private Duel _duel;
private int _hand; private int _hand;
private bool _debug; private bool _debug;
private int _select_hint; private int _select_hint;
private GameMessage _lastMessage; private GameMessage _lastMessage;
...@@ -1971,6 +1971,7 @@ namespace WindBot.Game ...@@ -1971,6 +1971,7 @@ namespace WindBot.Game
card.IsSpecialSummoned = true; card.IsSpecialSummoned = true;
_duel.LastSummonedCards.Add(card); _duel.LastSummonedCards.Add(card);
} }
_ai.OnSpSummoned();
_duel.SummoningCards.Clear(); _duel.SummoningCards.Clear();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment