Commit 721a8337 authored by wind2009's avatar wind2009 Committed by GitHub

Fix (#199)

parent 11169f23
...@@ -1579,7 +1579,7 @@ namespace WindBot.Game.AI ...@@ -1579,7 +1579,7 @@ namespace WindBot.Game.AI
if (originId == 0) originId = card.Data.Id; if (originId == 0) originId = card.Data.Id;
return crossoutDesignatorIdList.Contains(originId) return crossoutDesignatorIdList.Contains(originId)
|| (calledbytheGraveIdCountMap.ContainsKey(originId) && calledbytheGraveIdCountMap[originId] > 0) || (calledbytheGraveIdCountMap.ContainsKey(originId) && calledbytheGraveIdCountMap[originId] > 0)
|| card.IsDisabled(); || (card.IsDisabled() && ((int)card.Location & (int)CardLocation.Onfield) > 0);
} }
protected bool DefaultCheckWhetherCardIdIsNegated(int cardId) protected bool DefaultCheckWhetherCardIdIsNegated(int cardId)
......
...@@ -1162,6 +1162,7 @@ namespace WindBot.Game ...@@ -1162,6 +1162,7 @@ namespace WindBot.Game
private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1, int timing = -1) private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1, int timing = -1)
{ {
Executor.SetCard(type, card, desc, timing);
if (card.Id != 0 && type == ExecutorType.Activate) if (card.Id != 0 && type == ExecutorType.Activate)
{ {
if (_activatedCards.ContainsKey(card.Id) && _activatedCards[card.Id] >= 9) if (_activatedCards.ContainsKey(card.Id) && _activatedCards[card.Id] >= 9)
...@@ -1169,7 +1170,6 @@ namespace WindBot.Game ...@@ -1169,7 +1170,6 @@ namespace WindBot.Game
if (!Executor.OnPreActivate(card)) if (!Executor.OnPreActivate(card))
return false; return false;
} }
Executor.SetCard(type, card, desc, timing);
bool result = card != null && exec.Type == type && bool result = card != null && exec.Type == type &&
(exec.CardId == -1 || exec.CardId == card.Id) && (exec.CardId == -1 || exec.CardId == card.Id) &&
(exec.Func == null || exec.Func()); (exec.Func == null || exec.Func());
......
...@@ -1024,7 +1024,7 @@ namespace WindBot.Game ...@@ -1024,7 +1024,7 @@ namespace WindBot.Game
card.Controller = player; card.Controller = player;
} }
if (card == null) continue; if (card == null) continue;
if (card.Id == 0) if (card.Id == 0 || card.Location == CardLocation.Deck)
card.SetId(id); card.SetId(id);
cards.Add(card); cards.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