-
Notifications
You must be signed in to change notification settings - Fork 809
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
base: master
Are you sure you want to change the base?
Conversation
Player player = game.getPlayer(playerId); | ||
if (player != null) { | ||
if (player.chooseUse(Outcome.DrawCard, "Draw a card ?", source, game)) { | ||
player.drawCards(1, source, game); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this 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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
Part of #10653 .
Implement [[The Second Doctor]].
Card was tested and seems to work fine.