[SOM] Fixed Razor Hippogriff not gaining life (fixes
-
-
package mage.cards.r;
import java.util.UUID;
@@ -8,7 +6,6 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
-import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
@@ -16,11 +13,9 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
-import mage.constants.Zone;
import mage.filter.common.FilterArtifactCard;
import mage.game.Game;
import mage.players.Player;
-import mage.target.TargetCard;
import mage.target.common.TargetCardInYourGraveyard;
/**
@@ -29,6 +24,8 @@ import mage.target.common.TargetCardInYourGraveyard;
*/
public final class RazorHippogriff extends CardImpl {
+ private static final FilterArtifactCard filter = new FilterArtifactCard("artifact card from your graveyard");
+
public RazorHippogriff(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
this.subtype.add(SubType.HIPPOGRIFF);
@@ -39,14 +36,13 @@ public final class RazorHippogriff extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect());
- TargetCard target = new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard"));
- ability.addTarget(target);
+ ability.addTarget(new TargetCardInYourGraveyard(filter));
ability.addEffect(new RazorHippogriffGainLifeEffect());
this.addAbility(ability);
}
- public RazorHippogriff (final RazorHippogriff card) {
+ private RazorHippogriff(final RazorHippogriff card) {
super(card);
}
@@ -54,15 +50,16 @@ public final class RazorHippogriff extends CardImpl {
public RazorHippogriff copy() {
return new RazorHippogriff(this);
}
+}
- public final class RazorHippogriffGainLifeEffect extends OneShotEffect {
+class RazorHippogriffGainLifeEffect extends OneShotEffect {
public RazorHippogriffGainLifeEffect() {
super(Outcome.GainLife);
staticText = "you gain life equal to that card's mana value.";
}
- public RazorHippogriffGainLifeEffect(final RazorHippogriffGainLifeEffect effect) {
+ private RazorHippogriffGainLifeEffect(final RazorHippogriffGainLifeEffect effect) {
super(effect);
}
@@ -74,18 +71,11 @@ public final class RazorHippogriff extends CardImpl {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
- if (player != null) {
- Card card = player.getGraveyard().get(source.getFirstTarget(), game);
- if (card == null) {
- card = (Card)game.getLastKnownInformation(source.getFirstTarget(), Zone.GRAVEYARD);
- }
- if (card != null) {
+ Card card = game.getCard(source.getFirstTarget());
+ if (player != null && card != null) {
player.gainLife(card.getManaValue(), game, source);
- }
- }
return true;
}
-
+ return false;
}
-
}
