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

When you add/draw a card and have to discard immediately afterwards, the bot does not see that card in the hand. #150

Open
KingDwarf25 opened this issue Sep 20, 2022 · 1 comment

Comments

@KingDwarf25
Copy link

KingDwarf25 commented Sep 20, 2022

//Effect: Each player draws 1 card, then each player discards 1 card.
private bool ActivateDarkWorldDealings()
{
AI.SelectCard(CardToDiscard());
return true;
}

//Effect: During the Main Phase: You can add 1 "Ojama" card from your Deck to your hand, then discard 1 card
private bool ActivateOjamaPajamaSearch()
{
if (OjamaPajamaMaySearch == true)
{
AI.SelectCard(OjamaPajamaSearchHelper());
AI.SelectNextCard(CardToDiscard());
return true;
}
return false;
}

For instance: If we draw a card with dark world dealings or add a card to our hand with OjamaPajama we then have to discard a card.
I wrote a method that goes over my hand since I am an OjamaABC player and want to discard Ojama Magic A, B, or C as much as possible.

But I found out that the card we just added is not yet in the Bot.Hand.

Is there a fix for this? Or am I just doing it wrong xD

@mercury233
Copy link
Collaborator

The ExecutorType.Activate function is only checked when the bot decide whether to activate the card, it is not when the bot actually select the card to discard ,so it can't get the hand cards list of future.

You should override OnSelectCard, check hint == HintMsg.Discard and return the cards selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants