* Dinosaur Hunter - Fixed implementation.

This commit is contained in:
LevelX2 2018-03-11 17:16:40 +01:00
parent 16adc9b4ef
commit 2ebc0f2b83

View file

@ -35,7 +35,6 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@ -53,7 +52,7 @@ public class DinosaurHunter extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever Dinosaur Hunter deals combat damage to a Dinosaur, destroy that creature.
// Whenever Dinosaur Hunter deals damage to a Dinosaur, destroy that creature.
this.addAbility(new DinosaurHunterAbility());
}
@ -89,11 +88,10 @@ class DinosaurHunterAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (((DamagedEvent) event).isCombatDamage()
&& event.getSourceId().equals(getSourceId())) {
if (event.getSourceId().equals(getSourceId())) {
Permanent targetPermanet = game.getPermanentOrLKIBattlefield(event.getTargetId());
if (targetPermanet.hasSubtype(SubType.DINOSAUR, game)) {
getEffects().get(0).setTargetPointer(new FixedTarget(targetPermanet, game));
getEffects().setTargetPointer(new FixedTarget(targetPermanet, game));
return true;
}
}
@ -102,6 +100,6 @@ class DinosaurHunterAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever {this} deals combat damage to a Dinosaur, destroy that creature.";
return "Whenever {this} deals damage to a Dinosaur, destroy that creature.";
}
}