mirror of
https://github.com/correl/mage.git
synced 2025-01-12 03:00:13 +00:00
Implement GildedGoose
This commit is contained in:
parent
69f7ae624b
commit
00dedb359a
1 changed files with 71 additions and 0 deletions
71
Mage.Sets/src/mage/cards/GildedGoose.java
Normal file
71
Mage.Sets/src/mage/cards/GildedGoose.java
Normal file
|
@ -0,0 +1,71 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.abilities.mana.AnyColorManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.permanent.token.custom.FoodToken;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jmharmon
|
||||
*/
|
||||
|
||||
public final class GildedGoose extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Food");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.FOOD));
|
||||
}
|
||||
|
||||
public GildedGoose(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
|
||||
this.subtype.add(SubType.BIRD);
|
||||
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Gilded Goose enters the battlefield, create a Food token. (It’s an artifact with “{2}, {T}, Sacrifice this artifact: You gain 3 life.”)
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new FoodToken()), false));
|
||||
|
||||
// {1}{G}, {T}: Create a Food token.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new FoodToken()), new ManaCostsImpl("{1}{G}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
||||
// {T}, Sacrifice a Food: Add one mana of any color.
|
||||
ActivatedManaAbilityImpl ability1 = new AnyColorManaAbility(new TapSourceCost());
|
||||
ability1.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability1);
|
||||
}
|
||||
|
||||
public GildedGoose(final GildedGoose card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GildedGoose copy() {
|
||||
return new GildedGoose(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue