Commit d6afaed2 authored by handsomekiwi's avatar handsomekiwi Committed by mercury233

add chaintargetonly list (#73)

parent 787e3cab
......@@ -350,7 +350,7 @@ namespace WindBot.Game.AI
public bool IsChainTargetOnly(ClientCard card)
{
return Duel.ChainTargets.Count == 1 && card.Equals(Duel.ChainTargets[0]);
return Duel.ChainTargetOnly.Count == 1 && card.Equals(Duel.ChainTargetOnly[0]);
}
public bool ChainContainsCard(int id)
......
......@@ -19,6 +19,7 @@ namespace WindBot.Game
public int LastChainPlayer { get; set; }
public IList<ClientCard> CurrentChain { get; set; }
public IList<ClientCard> ChainTargets { get; set; }
public IList<ClientCard> ChainTargetOnly { get; set; }
public int LastSummonPlayer { get; set; }
public Duel()
......@@ -29,6 +30,7 @@ namespace WindBot.Game
LastChainPlayer = -1;
CurrentChain = new List<ClientCard>();
ChainTargets = new List<ClientCard>();
ChainTargetOnly = new List<ClientCard>();
LastSummonPlayer = -1;
}
......
......@@ -621,7 +621,8 @@ namespace WindBot.Game
if (_debug)
if (card != null) Logger.WriteLine("(" + cc.ToString() + " 's " + (card.Name ?? "UnKnowCard") + " activate effect)");
_ai.OnChaining(card, cc);
_duel.ChainTargets.Clear();
//_duel.ChainTargets.Clear();
_duel.ChainTargetOnly.Clear();
_duel.LastSummonPlayer = -1;
_duel.CurrentChain.Add(card);
_duel.LastChainPlayer = cc;
......@@ -633,7 +634,8 @@ namespace WindBot.Game
_ai.OnChainEnd();
_duel.LastChainPlayer = -1;
_duel.CurrentChain.Clear();
//_duel.ChainTargets.Clear();
_duel.ChainTargets.Clear();
_duel.ChainTargetOnly.Clear();
}
private void OnCardSorting(BinaryReader packet)
......@@ -758,6 +760,7 @@ namespace WindBot.Game
if (_debug)
Logger.WriteLine("(" + (CardLocation)loc + " 's " + (card.Name ?? "UnKnowCard") + " become target)");
_duel.ChainTargets.Add(card);
_duel.ChainTargetOnly.Add(card);
}
}
......
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