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

[WHO] Implement The Second Doctor #13435

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

padfoothelix
Copy link
Contributor

Part of #10653 .

Implement [[The Second Doctor]].

Card was tested and seems to work fine.

@github-actions github-actions bot added the cards label Mar 11, 2025
Player player = game.getPlayer(playerId);
if (player != null) {
if (player.chooseUse(Outcome.DrawCard, "Draw a card ?", source, game)) {
player.drawCards(1, source, game);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to check for prevention/replacement right? drawCards returns an int, only add restriction effect if > 0

(then could combine these four conditions into a single if statement)

Copy link
Contributor Author

@padfoothelix padfoothelix Mar 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I'm implementing the change.

If I read you correctly, that means that the "Tempt With" cycle is bugged ? I was checking the code of [[Tempt With Bunnies]] and it seems to be lacking that check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, then that card would be bugged on this edge case. Can open separate issue for it and see if anything else in scope.

}
}

class TheSecondDoctorCantAttackEffect extends RestrictionEffect {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you base this class off of existing code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did ; the restriction effect itself is based on CantAttackYouAllEffect and TargetPlayerCantAttackYouEffect. For the duration, I used code from [[Oracle en-Vec]].


@Override
public boolean isInactive(Ability source, Game game) {
return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure this is correct? what if the affected player takes an extra turn?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check again, but I do think this is correct. If I'm correct, the effect is just discarded at the end of the player's next end step.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where it gets discarded at the end of affected player's turn, can you point me to what part of the code is handling that?

Copy link
Contributor

@xenohedron xenohedron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only remaining open question is the duration of the restriction effect working as intended


@Override
public boolean isInactive(Ability source, Game game) {
return game.getTurnPhaseType() == TurnPhase.END && this.isYourNextTurn(game);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where it gets discarded at the end of affected player's turn, can you point me to what part of the code is handling that?

Player player = game.getPlayer(playerId);
if (player != null) {
if (player.chooseUse(Outcome.DrawCard, "Draw a card ?", source, game)) {
player.drawCards(1, source, game);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, then that card would be bugged on this edge case. Can open separate issue for it and see if anything else in scope.

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

Successfully merging this pull request may close these issues.

2 participants