fixed Frenetic Efreet not flipping coins if not on the battlefield (fixes
-
package mage.cards.f;
import java.util.UUID;
@@ -34,7 +33,11 @@ public final class FreneticEfreet extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// {0}: Flip a coin. If you win the flip, Frenetic Efreet phases out. If you lose the flip, sacrifice Frenetic Efreet.
- this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new FreneticEfreetEffect(), new GenericManaCost(0)));
+ this.addAbility(new SimpleActivatedAbility(
+ Zone.BATTLEFIELD,
+ new FreneticEfreetEffect(),
+ new GenericManaCost(0)
+ ));
}
public FreneticEfreet(final FreneticEfreet card) {
@@ -50,8 +53,9 @@ public final class FreneticEfreet extends CardImpl {
class FreneticEfreetEffect extends OneShotEffect {
public FreneticEfreetEffect() {
- super(Outcome.Damage);
- staticText = "Flip a coin. If you win the flip, {this} phases out. If you lose the flip, sacrifice {this}";
+ super(Outcome.Neutral);
+ staticText = "Flip a coin. If you win the flip, "
+ + "{this} phases out. If you lose the flip, sacrifice {this}";
}
public FreneticEfreetEffect(FreneticEfreetEffect effect) {
@@ -62,16 +66,20 @@ class FreneticEfreetEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
- if (controller != null && permanent != null) {
- if (controller.flipCoin(game)) {
+ if (controller == null) {
+ return false;
+ }
+ boolean flip = controller.flipCoin(game);
+ if (permanent == null) {
+ return false;
+ }
+ if (flip) {
return permanent.phaseOut(game);
} else {
permanent.sacrifice(source.getSourceId(), game);
return true;
}
}
- return false;
- }
@Override
public FreneticEfreetEffect copy() {
