mirror of
https://github.com/correl/mage.git
synced 2025-04-11 17:00:08 -09:00
[MH2] Implemented Murktide Regent (#7887)
This commit is contained in:
parent
4bf1ce9c0e
commit
4a09b2a1ed
2 changed files with 134 additions and 0 deletions
Mage.Sets/src/mage
133
Mage.Sets/src/mage/cards/m/MurktideRegent.java
Normal file
133
Mage.Sets/src/mage/cards/m/MurktideRegent.java
Normal file
|
@ -0,0 +1,133 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.DelveAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class MurktideRegent extends CardImpl {
|
||||
|
||||
public MurktideRegent(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Delve
|
||||
this.addAbility(new DelveAbility());
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Murktide Regent enters the battlefield with a +1/+1 counter on it for each instant and sorcery card exiled with it.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(), MurktideRegentValue.instance, false),
|
||||
"with a +1/+1 counter on it for each instant and sorcery card exiled with it"
|
||||
));
|
||||
|
||||
// Whenever an instant or sorcery card leaves your graveyard, put a +1/+1 counter on Murktide Regent.
|
||||
this.addAbility(new MurktideRegentTriggeredAbility());
|
||||
}
|
||||
|
||||
private MurktideRegent(final MurktideRegent card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MurktideRegent copy() {
|
||||
return new MurktideRegent(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum MurktideRegentValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = 0;
|
||||
Cards delvedCards = (Cards) game.getState().getValue(CardUtil.getCardZoneString("delvedCards", sourceAbility.getSourceId(), game));
|
||||
if (delvedCards != null) {
|
||||
for (UUID cardId : delvedCards) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null && card.isInstantOrSorcery()) {
|
||||
amount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MurktideRegentValue copy() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "instant and sorcery card exiled with it";
|
||||
}
|
||||
}
|
||||
|
||||
class MurktideRegentTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public MurktideRegentTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||
}
|
||||
|
||||
private MurktideRegentTriggeredAbility(final MurktideRegentTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MurktideRegentTriggeredAbility copy() {
|
||||
return new MurktideRegentTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.GRAVEYARD) {
|
||||
Card card = game.getCard(zEvent.getTargetId());
|
||||
return card != null && card.isInstantOrSorcery() && card.getOwnerId().equals(getControllerId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an instant or sorcery card leaves your graveyard, " + super.getRule();
|
||||
}
|
||||
}
|
|
@ -185,6 +185,7 @@ public final class ModernHorizons2 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Monoskelion", 229, Rarity.UNCOMMON, mage.cards.m.Monoskelion.class));
|
||||
cards.add(new SetCardInfo("Mount Velus Manticore", 136, Rarity.COMMON, mage.cards.m.MountVelusManticore.class));
|
||||
cards.add(new SetCardInfo("Mountain", 487, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Murktide Regent", 52, Rarity.MYTHIC, mage.cards.m.MurktideRegent.class));
|
||||
cards.add(new SetCardInfo("Myr Scrapling", 230, Rarity.COMMON, mage.cards.m.MyrScrapling.class));
|
||||
cards.add(new SetCardInfo("Mystic Redaction", 53, Rarity.UNCOMMON, mage.cards.m.MysticRedaction.class));
|
||||
cards.add(new SetCardInfo("Necrogoyf", 93, Rarity.RARE, mage.cards.n.Necrogoyf.class));
|
||||
|
|
Loading…
Add table
Reference in a new issue