* Commune with Lava - Fixed that it did not last until your next turn if it was cast during your turn.

This commit is contained in:
LevelX2 2015-04-12 21:39:29 +02:00
parent f835c0baa3
commit fef57af896

View file

@ -112,6 +112,8 @@ class CommuneWithLavaEffect extends OneShotEffect {
class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl {
int castOnTurn = 0;
public CommuneWithLavaMayPlayEffect() {
super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.Custom, Outcome.Benefit);
this.staticText = "Until the end of your next turn, you may play that card.";
@ -119,6 +121,7 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl {
public CommuneWithLavaMayPlayEffect(final CommuneWithLavaMayPlayEffect effect) {
super(effect);
castOnTurn = effect.castOnTurn;
}
@Override
@ -126,9 +129,15 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl {
return new CommuneWithLavaMayPlayEffect(this);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
castOnTurn = game.getTurnNum();
}
@Override
public boolean isInactive(Ability source, Game game) {
if (game.getPhase().getStep().getType() == PhaseStep.END_TURN) {
if (castOnTurn != game.getTurnNum() && game.getPhase().getStep().getType() == PhaseStep.END_TURN) {
if (game.getActivePlayerId().equals(source.getControllerId())) {
return true;
}