Skip to content

Commit

Permalink
refactor: fixed miss copy effect (related to magefree#12605)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDi85 committed Aug 15, 2024
1 parent 7969ffb commit e7585e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Mage/src/main/java/mage/abilities/effects/OneShotEffect.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package mage.abilities.effects;

import mage.constants.EffectType;
Expand Down Expand Up @@ -37,4 +35,7 @@ public Effect setTargetPointer(TargetPointer targetPointer) {
super.setTargetPointer(targetPointer);
return this;
}

@Override
abstract public OneShotEffect copy();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
Expand Down Expand Up @@ -44,7 +43,7 @@ protected ExileThenReturnTargetEffect(final ExileThenReturnTargetEffect effect)
this.putCards = effect.putCards;
this.yourControl = effect.yourControl;
this.textThatCard = effect.textThatCard;
this.afterEffect = effect.afterEffect;
this.afterEffect = effect.afterEffect == null ? null : effect.afterEffect.copy();
}

@Override
Expand Down Expand Up @@ -78,7 +77,7 @@ public boolean apply(Game game, Ability source) {
yourControl ? controller : game.getPlayer(card.getOwnerId()),
card.getMainCard(), source, game, "card");
}
if (afterEffect != null){
if (afterEffect != null) {
afterEffect.setTargetPointer(new FixedTargets(toFlicker, game));
afterEffect.apply(game, source);
}
Expand All @@ -105,7 +104,7 @@ public String getText(Mode mode) {
sb.append(this.yourControl ? "your" : "its owner's");
}
sb.append(" control");
if (afterEffect != null){
if (afterEffect != null) {
sb.append(". ").append(CardUtil.getTextWithFirstCharUpperCase(afterEffect.getText(mode)));
}
return sb.toString();
Expand Down

0 comments on commit e7585e8

Please sign in to comment.