mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
parent
83d37a7f35
commit
a30c2f4a8b
1 changed files with 31 additions and 41 deletions
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
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,24 +24,25 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
*/
|
||||
public final class RazorHippogriff extends CardImpl {
|
||||
|
||||
public RazorHippogriff (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}");
|
||||
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);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
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,38 +50,32 @@ public final class RazorHippogriff extends CardImpl {
|
|||
public RazorHippogriff copy() {
|
||||
return new RazorHippogriff(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final 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) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RazorHippogriffGainLifeEffect copy() {
|
||||
return new RazorHippogriffGainLifeEffect(this);
|
||||
}
|
||||
|
||||
@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) {
|
||||
player.gainLife(card.getManaValue(), game, source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
class RazorHippogriffGainLifeEffect extends OneShotEffect {
|
||||
|
||||
public RazorHippogriffGainLifeEffect() {
|
||||
super(Outcome.GainLife);
|
||||
staticText = "you gain life equal to that card's mana value.";
|
||||
}
|
||||
|
||||
private RazorHippogriffGainLifeEffect(final RazorHippogriffGainLifeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RazorHippogriffGainLifeEffect copy() {
|
||||
return new RazorHippogriffGainLifeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(source.getFirstTarget());
|
||||
if (player != null && card != null) {
|
||||
player.gainLife(card.getManaValue(), game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue