mirror of
https://github.com/correl/mage.git
synced 2025-01-13 11:01:58 +00:00
Implement Rite of Harmony
This commit is contained in:
parent
1739c96a53
commit
f8314d298c
2 changed files with 88 additions and 0 deletions
87
Mage.Sets/src/mage/cards/r/RiteOfHarmony.java
Normal file
87
Mage.Sets/src/mage/cards/r/RiteOfHarmony.java
Normal file
|
@ -0,0 +1,87 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ciaccona007
|
||||
*/
|
||||
public final class RiteOfHarmony extends CardImpl {
|
||||
|
||||
public RiteOfHarmony(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}{W}");
|
||||
|
||||
|
||||
// Whenever a creature or enchantment enters the battlefield under your control this turn, draw a card.
|
||||
getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new RiteOfHarmonyTriggeredAbility()));
|
||||
|
||||
// Flashback {2}{G}{W}
|
||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}{W}"), TimingRule.INSTANT));
|
||||
|
||||
}
|
||||
|
||||
private RiteOfHarmony(final RiteOfHarmony card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RiteOfHarmony copy() {
|
||||
return new RiteOfHarmony(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RiteOfHarmonyTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature or enchantment");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.ENCHANTMENT.getPredicate()));
|
||||
}
|
||||
|
||||
public RiteOfHarmonyTriggeredAbility() {
|
||||
super(new DrawCardSourceControllerEffect(1), Duration.EndOfTurn, false);
|
||||
optional = false;
|
||||
}
|
||||
|
||||
public RiteOfHarmonyTriggeredAbility(RiteOfHarmonyTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
UUID targetId = event.getTargetId();
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
return filter.match(permanent, getSourceId(), getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RiteOfHarmonyTriggeredAbility copy() {
|
||||
return new RiteOfHarmonyTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature or enchantment enters the battlefield under your control this turn, draw a card.";
|
||||
}
|
||||
}
|
|
@ -56,6 +56,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Pithing Needle", 257, Rarity.RARE, mage.cards.p.PithingNeedle.class));
|
||||
cards.add(new SetCardInfo("Plains", 268, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Play with Fire", 154, Rarity.UNCOMMON, mage.cards.p.PlayWithFire.class));
|
||||
cards.add(new SetCardInfo("Rite of Harmony", 236, Rarity.RARE, mage.cards.r.RiteOfHarmony.class));
|
||||
cards.add(new SetCardInfo("Rockfall Vale", 266, Rarity.RARE, mage.cards.r.RockfallVale.class));
|
||||
cards.add(new SetCardInfo("Secrets of the Key", 73, Rarity.COMMON, mage.cards.s.SecretsOfTheKey.class));
|
||||
cards.add(new SetCardInfo("Shipwreck Marsh", 267, Rarity.RARE, mage.cards.s.ShipwreckMarsh.class));
|
||||
|
|
Loading…
Reference in a new issue