* Dawns Reflection - Fixed possible null pointer exception.
@@ -58,7 +58,6 @@ public class DawnsReflection extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
this.subtype.add("Aura");
-
// Enchant land
TargetPermanent auraTarget = new TargetLandPermanent();
this.getSpellAbility().addTarget(auraTarget);
@@ -78,6 +77,7 @@ public class DawnsReflection extends CardImpl {
return new DawnsReflection(this);
}
}
+
class DawnsReflectionTriggeredAbility extends TriggeredManaAbility {
public DawnsReflectionTriggeredAbility() {
@@ -104,14 +104,12 @@ class DawnsReflectionTriggeredAbility extends TriggeredManaAbility {
return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo());
}
-
@Override
public String getRule() {
return "Whenever enchanted land is tapped for mana, its controller adds two mana in any combination of colors to his or her mana pool <i>(in addition to the mana the land produces)</i>.";
}
}
-
class DawnsReflectionManaEffect extends ManaEffect {
public DawnsReflectionManaEffect() {
@@ -133,16 +131,16 @@ class DawnsReflectionManaEffect extends ManaEffect {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int x = 2;
-
Mana mana = new Mana();
for (int i = 0; i < x; i++) {
ChoiceColor choiceColor = new ChoiceColor();
- while (controller.canRespond() && !controller.choose(Outcome.Benefit, choiceColor, game)) {
+ while (!controller.choose(Outcome.Benefit, choiceColor, game)) {
+ if (!controller.isInGame()) {
+ return false;
+ }
}
-
choiceColor.increaseMana(mana);
}
-
controller.getManaPool().addMana(mana, game, source);
return true;
@@ -155,5 +153,4 @@ class DawnsReflectionManaEffect extends ManaEffect {
return null;
}
-
}
