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 1 commit 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)

@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

just a style thing, but it's easier to read with less nesting, e.g.

if (controller == null) {
    return false;
}
// then continue code path here for non null case

}
}

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?


@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?

}
// defender is a permanent
if (game.getPermanent(defenderId) != null) {
return !game.getPermanent(defenderId).getControllerId().equals(controllerId);
Copy link
Contributor

Choose a reason for hiding this comment

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

better to declare a permanent and null check it to ensure you're getting the same object

also can simplify with '.isControlledBy()`

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