* Kurkesh, Onakke Ancient - Fixed possible null pointer exception.

This commit is contained in:
LevelX2 2015-09-06 22:39:55 +02:00
parent 7aa27a9800
commit 561d254b22

View file

@ -80,15 +80,15 @@ public class KurkeshOnakkeAncient extends CardImpl {
}
class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl {
KurkeshOnakkeAncientTriggeredAbility() {
super(Zone.BATTLEFIELD, new KurkeshOnakkeAncientEffect(), false);
}
KurkeshOnakkeAncientTriggeredAbility(final KurkeshOnakkeAncientTriggeredAbility ability) {
super(ability);
}
@Override
public KurkeshOnakkeAncientTriggeredAbility copy() {
return new KurkeshOnakkeAncientTriggeredAbility(this);
@ -98,11 +98,11 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.ACTIVATED_ABILITY;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Card source = game.getPermanentOrLKIBattlefield(event.getSourceId());
if (source.getCardType().contains(CardType.ARTIFACT)) {
if (source != null && source.getCardType().contains(CardType.ARTIFACT)) {
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
if (!(stackAbility.getStackAbility() instanceof ManaAbility)) {
Effect effect = this.getEffects().get(0);
@ -112,7 +112,7 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl {
}
return false;
}
@Override
public String getRule() {
return "Whenever you activate an ability of an artifact, if it isn't a mana ability, you may pay {R}. If you do, copy that ability. You may choose new targets for the copy.";
@ -120,21 +120,21 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl {
}
class KurkeshOnakkeAncientEffect extends OneShotEffect {
KurkeshOnakkeAncientEffect() {
super(Outcome.Benefit);
this.staticText = ", you may pay {R}. If you do, copy that ability. You may choose new targets for the copy.";
}
KurkeshOnakkeAncientEffect(final KurkeshOnakkeAncientEffect effect) {
super(effect);
}
@Override
public KurkeshOnakkeAncientEffect copy() {
return new KurkeshOnakkeAncientEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());