* Burning-Tree Shaman - Fixed bug that happended (NPE) after using a special action.

This commit is contained in:
LevelX2 2015-08-18 16:36:18 +02:00
parent 4f886d2097
commit 692148d3c2

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.guildpact; package mage.sets.guildpact;
import java.util.UUID; import java.util.UUID;
@ -49,19 +48,18 @@ import mage.target.TargetPlayer;
*/ */
public class BurningTreeShaman extends CardImpl { public class BurningTreeShaman extends CardImpl {
public BurningTreeShaman (UUID ownerId) { public BurningTreeShaman(UUID ownerId) {
super(ownerId, 105, "Burning-Tree Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); super(ownerId, 105, "Burning-Tree Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}");
this.expansionSetCode = "GPT"; this.expansionSetCode = "GPT";
this.subtype.add("Centaur"); this.subtype.add("Centaur");
this.subtype.add("Shaman"); this.subtype.add("Shaman");
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
this.addAbility(new BurningTreeShamanTriggeredAbility()); this.addAbility(new BurningTreeShamanTriggeredAbility());
} }
public BurningTreeShaman (final BurningTreeShaman card) { public BurningTreeShaman(final BurningTreeShaman card) {
super(card); super(card);
} }
@ -72,6 +70,7 @@ public class BurningTreeShaman extends CardImpl {
} }
class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl {
BurningTreeShamanTriggeredAbility() { BurningTreeShamanTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); super(Zone.BATTLEFIELD, new DamageTargetEffect(1));
this.addTarget(new TargetPlayer()); this.addTarget(new TargetPlayer());
@ -94,7 +93,7 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
if (stackAbility.getAbilityType() == AbilityType.ACTIVATED) { if (stackAbility != null && stackAbility.getAbilityType() == AbilityType.ACTIVATED) {
this.getTargets().get(0).add(event.getPlayerId(), game); this.getTargets().get(0).add(event.getPlayerId(), game);
return true; return true;
} }
@ -105,4 +104,4 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() { public String getRule() {
return "Whenever a player activates an ability that isn't a mana ability, {this} deals 1 damage to that player."; return "Whenever a player activates an ability that isn't a mana ability, {this} deals 1 damage to that player.";
} }
} }