Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #199

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Fix #199

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Game/AI/DefaultExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ protected bool DefaultCheckWhetherCardIsNegated(ClientCard card)
if (originId == 0) originId = card.Data.Id;
return crossoutDesignatorIdList.Contains(originId)
|| (calledbytheGraveIdCountMap.ContainsKey(originId) && calledbytheGraveIdCountMap[originId] > 0)
|| card.IsDisabled();
|| (card.IsDisabled() && ((int)card.Location & (int)CardLocation.Onfield) > 0);
}

protected bool DefaultCheckWhetherCardIdIsNegated(int cardId)
Expand Down
2 changes: 1 addition & 1 deletion Game/GameAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,14 @@ public BattlePhaseAction ToMainPhase2()

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 (_activatedCards.ContainsKey(card.Id) && _activatedCards[card.Id] >= 9)
return false;
if (!Executor.OnPreActivate(card))
return false;
}
Executor.SetCard(type, card, desc, timing);
bool result = card != null && exec.Type == type &&
(exec.CardId == -1 || exec.CardId == card.Id) &&
(exec.Func == null || exec.Func());
Expand Down
2 changes: 1 addition & 1 deletion Game/GameBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ private void InternalOnSelectCard(BinaryReader packet, Func<IList<ClientCard>, i
card.Controller = player;
}
if (card == null) continue;
if (card.Id == 0)
if (card.Id == 0 || card.Location == CardLocation.Deck)
card.SetId(id);
cards.Add(card);
}
Expand Down