mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TDM] Implement Kheru Goldkeeper
This commit is contained in:
parent
25067d6e64
commit
06201a768a
5 changed files with 84 additions and 16 deletions
|
|
@ -2,8 +2,6 @@ package mage.cards.a;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.CardsLeaveGraveyardTriggeredAbility;
|
||||
import mage.abilities.condition.common.MyTurnCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -11,6 +9,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -31,10 +30,9 @@ public final class AttunedHunter extends CardImpl {
|
|||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Whenever one or more cards leave your graveyard during your turn, put a +1/+1 counter on this creature.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new CardsLeaveGraveyardTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())),
|
||||
MyTurnCondition.instance, "Whenever one or more cards leave your graveyard " +
|
||||
"during your turn, put a +1/+1 counter on this creature."
|
||||
this.addAbility(new CardsLeaveGraveyardTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance()),
|
||||
StaticFilters.FILTER_CARD_CARDS, true
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
55
Mage.Sets/src/mage/cards/k/KheruGoldkeeper.java
Normal file
55
Mage.Sets/src/mage/cards/k/KheruGoldkeeper.java
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
package mage.cards.k;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.CardsLeaveGraveyardTriggeredAbility;
|
||||
import mage.abilities.common.RenewAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.permanent.token.TreasureToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class KheruGoldkeeper extends CardImpl {
|
||||
|
||||
public KheruGoldkeeper(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}{U}");
|
||||
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Whenever one or more cards leave your graveyard during your turn, create a Treasure token.
|
||||
this.addAbility(new CardsLeaveGraveyardTriggeredAbility(
|
||||
new CreateTokenEffect(new TreasureToken()),
|
||||
StaticFilters.FILTER_CARD_CARDS, true
|
||||
));
|
||||
|
||||
// Renew -- {2}{B}{G}{U}, Exile this card from your graveyard: Put two +1/+1 counters and a flying counter on target creature. Activate only as a sorcery.
|
||||
this.addAbility(new RenewAbility(
|
||||
"{2}{B}{G}{U}",
|
||||
CounterType.P1P1.createInstance(2),
|
||||
CounterType.FLYING.createInstance()
|
||||
));
|
||||
}
|
||||
|
||||
private KheruGoldkeeper(final KheruGoldkeeper card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KheruGoldkeeper copy() {
|
||||
return new KheruGoldkeeper(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,14 +2,13 @@ package mage.cards.t;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CardsLeaveGraveyardTriggeredAbility;
|
||||
import mage.abilities.condition.common.MyTurnCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -19,16 +18,21 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class ThranVigil extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("artifact and/or creature cards");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
CardType.ARTIFACT.getPredicate(),
|
||||
CardType.CREATURE.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
public ThranVigil(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
||||
|
||||
// Whenever one or more artifact and/or creature cards leave your graveyard during your turn, put a +1/+1 counter on target creature you control.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new CardsLeaveGraveyardTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
|
||||
StaticFilters.FILTER_CARD_ARTIFACT_OR_CREATURE
|
||||
), MyTurnCondition.instance, "Whenever one or more artifact and/or creature cards " +
|
||||
"leave your graveyard during your turn, put a +1/+1 counter on target creature you control."
|
||||
Ability ability = new CardsLeaveGraveyardTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), filter, true
|
||||
);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ public final class TarkirDragonstorm extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Jeskai Devotee", 110, Rarity.COMMON, mage.cards.j.JeskaiDevotee.class));
|
||||
cards.add(new SetCardInfo("Jeskai Monument", 244, Rarity.UNCOMMON, mage.cards.j.JeskaiMonument.class));
|
||||
cards.add(new SetCardInfo("Jungle Hollow", 258, Rarity.COMMON, mage.cards.j.JungleHollow.class));
|
||||
cards.add(new SetCardInfo("Kheru Goldkeeper", 199, Rarity.UNCOMMON, mage.cards.k.KheruGoldkeeper.class));
|
||||
cards.add(new SetCardInfo("Kin-Tree Severance", 200, Rarity.UNCOMMON, mage.cards.k.KinTreeSeverance.class));
|
||||
cards.add(new SetCardInfo("Kishla Village", 259, Rarity.RARE, mage.cards.k.KishlaVillage.class));
|
||||
cards.add(new SetCardInfo("Krotiq Nestguard", 148, Rarity.COMMON, mage.cards.k.KrotiqNestguard.class));
|
||||
|
|
|
|||
|
|
@ -18,20 +18,27 @@ import java.util.Objects;
|
|||
public class CardsLeaveGraveyardTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final FilterCard filter;
|
||||
private final boolean yourTurn;
|
||||
|
||||
public CardsLeaveGraveyardTriggeredAbility(Effect effect) {
|
||||
this(effect, StaticFilters.FILTER_CARD_CARDS);
|
||||
}
|
||||
|
||||
public CardsLeaveGraveyardTriggeredAbility(Effect effect, FilterCard filter) {
|
||||
this(effect, filter, false);
|
||||
}
|
||||
|
||||
public CardsLeaveGraveyardTriggeredAbility(Effect effect, FilterCard filter, boolean yourTurn) {
|
||||
super(Zone.BATTLEFIELD, effect, false);
|
||||
this.filter = filter;
|
||||
setTriggerPhrase("Whenever one or more " + filter + " leave your graveyard, ");
|
||||
this.yourTurn = yourTurn;
|
||||
setTriggerPhrase("Whenever one or more " + filter + " leave your graveyard" + (yourTurn ? " during your turn" : "") + ", ");
|
||||
}
|
||||
|
||||
private CardsLeaveGraveyardTriggeredAbility(final CardsLeaveGraveyardTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.filter = ability.filter;
|
||||
this.yourTurn = ability.yourTurn;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -41,6 +48,9 @@ public class CardsLeaveGraveyardTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (yourTurn && !isControlledBy(game.getActivePlayerId())) {
|
||||
return false;
|
||||
}
|
||||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
||||
return zEvent != null
|
||||
&& Zone.GRAVEYARD == zEvent.getFromZone()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue