mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 03:39:54 -08:00
[EMN] Added MeldEffect to Gisela and Hanweir Battlements. Changed Brisela and Hanweir, the Writhing Township to MeldCard. Added missing TapSourceCost to Hanweir Battlements. Added missing ability.addEffect to Chittering Host.
This commit is contained in:
parent
436942ccff
commit
1dfed9b1c8
18 changed files with 1086 additions and 147 deletions
|
|
@ -40,12 +40,15 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.cards.MeldCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentCard;
|
||||
import mage.game.permanent.PermanentMeld;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
|
|
@ -105,7 +108,18 @@ class EerieInterludeEffect extends OneShotEffect {
|
|||
|
||||
Cards cardsToReturn = new CardsImpl();
|
||||
for (Card exiled : toExile) {
|
||||
if (((Permanent) exiled).getZoneChangeCounter(game) == game.getState().getZoneChangeCounter(exiled.getId()) - 1) {
|
||||
if (exiled instanceof PermanentMeld) {
|
||||
MeldCard meldCard = (MeldCard) ((PermanentCard) exiled).getCard();
|
||||
Card topCard = meldCard.getTopHalfCard();
|
||||
Card bottomCard = meldCard.getBottomHalfCard();
|
||||
if (topCard.getZoneChangeCounter(game) == meldCard.getTopLastZoneChangeCounter()) {
|
||||
cardsToReturn.add(topCard);
|
||||
}
|
||||
if (bottomCard.getZoneChangeCounter(game) == meldCard.getBottomLastZoneChangeCounter()) {
|
||||
cardsToReturn.add(bottomCard);
|
||||
}
|
||||
}
|
||||
else if (exiled.getZoneChangeCounter(game) == game.getState().getZoneChangeCounter(exiled.getId()) - 1) {
|
||||
cardsToReturn.add(exiled);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import mage.abilities.keyword.FirstStrikeAbility;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.MeldCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -52,7 +52,7 @@ import mage.game.stack.Spell;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BriselaVoiceOfNightmares extends CardImpl {
|
||||
public class BriselaVoiceOfNightmares extends MeldCard {
|
||||
|
||||
public BriselaVoiceOfNightmares(UUID ownerId) {
|
||||
super(ownerId, 15, "Brisela, Voice of Nightmares", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "");
|
||||
|
|
@ -67,12 +67,16 @@ public class BriselaVoiceOfNightmares extends CardImpl {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// Vigilance
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
|
||||
// Lifelink
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
|
||||
// Your opponents can't cast spells with converted mana cost 3 or less.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BriselaVoiceOfNightmaresCantCastEffect()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
|||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.MeldCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
|
|
@ -46,7 +46,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ChitteringHost extends CardImpl {
|
||||
public class ChitteringHost extends MeldCard {
|
||||
|
||||
public ChitteringHost(UUID ownerId) {
|
||||
super(ownerId, 96, "Chittering Host", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "");
|
||||
|
|
@ -57,18 +57,21 @@ public class ChitteringHost extends CardImpl {
|
|||
this.toughness = new MageInt(6);
|
||||
|
||||
this.nightCard = true; // Meld card
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Menace <i>(This creature can't be blocked except by two or more creatures.
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// When Chittering Host enters the battlefield, other creatures you control get +1/+0 and gain menace until end of turn.
|
||||
Effect effect = new BoostControlledEffect(1, 0, Duration.EndOfTurn, true);
|
||||
effect.setText("other creatures you control get +1/+0");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
|
||||
effect = new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("other creatures"), true);
|
||||
effect.setText("and gain menace until end of turn");
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
public ChitteringHost(final ChitteringHost card) {
|
||||
|
|
|
|||
|
|
@ -29,15 +29,17 @@ package mage.sets.eldritchmoon;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.common.MeldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.MeldEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -56,12 +58,19 @@ public class GiselaTheBrokenBlade extends CardImpl {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// Lifelink
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
|
||||
// At the beginning of your end step, if you both own and control Gisela, the Broken Blade and a creature named Bruna, the Fading Light, exile them, then meld them into Brisela, Voice of Nightmares.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("Meld ability not implemeted yet.")));
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfEndStepTriggeredAbility(new MeldEffect("Bruna, the Fading Light", new BriselaVoiceOfNightmares(ownerId)), TargetController.YOU, false),
|
||||
new MeldCondition("Bruna, the Fading Light"),
|
||||
"At the beginning of combat on your turn, if you both own and control {this} and a creature named Bruna, the Fading Light, exile them, "
|
||||
+ "then meld them into Brisela, Voice of Nightmares."));
|
||||
}
|
||||
|
||||
public GiselaTheBrokenBlade(final GiselaTheBrokenBlade card) {
|
||||
|
|
|
|||
|
|
@ -29,16 +29,18 @@ package mage.sets.eldritchmoon;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.MeldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.MeldEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
* @author emerald000
|
||||
*/
|
||||
public class GrafRats extends CardImpl {
|
||||
|
||||
|
|
@ -50,7 +52,11 @@ public class GrafRats extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// At the beginning of combat on your turn, if you both own and control Graf Rats and a creature named Midnight Scavengers, exile them, then meld them into Chittering Host.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("Meld ability not implemented yet.")));
|
||||
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(new MeldEffect("Midnight Scavengers", new ChitteringHost(ownerId)), TargetController.YOU, false),
|
||||
new MeldCondition("Midnight Scavengers"),
|
||||
"At the beginning of combat on your turn, if you both own and control {this} and a creature named Midnight Scavengers, exile them, then meld them into Chittering Host."));
|
||||
}
|
||||
|
||||
public GrafRats(final GrafRats card) {
|
||||
|
|
|
|||
|
|
@ -30,10 +30,11 @@ package mage.sets.eldritchmoon;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.MeldCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||
import mage.abilities.effects.common.MeldEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
|
|
@ -63,7 +64,11 @@ public class HanweirBattlements extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// {3}{R}{R},{T}: If you both own and control Hanweir Battlements and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("Meld ability not implemeted yet.")));
|
||||
ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new MeldEffect("Hanweir Garrison", new HanweirTheWrithingTownship(ownerId)),
|
||||
new ManaCostsImpl("{3}{R}{R}"), new MeldCondition("Hanweir Garrison"),
|
||||
"{3}{R}{R}, {T}: If you both own and control {this} and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.");
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public HanweirBattlements(final HanweirBattlements card) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.common.AttacksTriggeredAbility;
|
|||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.MeldCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ import mage.constants.Rarity;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class HanweirTheWrithingTownship extends CardImpl {
|
||||
public class HanweirTheWrithingTownship extends MeldCard {
|
||||
|
||||
public HanweirTheWrithingTownship(UUID ownerId) {
|
||||
super(ownerId, 130, "Hanweir, the Writhing Township", Rarity.RARE, new CardType[]{CardType.CREATURE}, "");
|
||||
|
|
@ -56,8 +56,10 @@ public class HanweirTheWrithingTownship extends CardImpl {
|
|||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Whenever Hanweir, the Writhing Township attacks, put two 3/2 colorless Eldrazi Horror creature tokens onto the battlefield tapped and attacking.
|
||||
this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new EldraziHorrorToken(), 2, true, true), false));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.MeldCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -93,7 +94,7 @@ class LongRoadHomeEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getSourceId(), game)) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Long Road Home", source.getSourceId(), game)) {
|
||||
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
|
||||
// only if permanent is in exile (tokens would be stop to exist)
|
||||
if (exile != null && !exile.isEmpty()) {
|
||||
|
|
@ -147,7 +148,14 @@ class LongRoadHomeReturnFromExileEffect extends OneShotEffect {
|
|||
if (card != null && objectToReturn.refersTo(card, game)) {
|
||||
Player owner = game.getPlayer(card.getOwnerId());
|
||||
if (owner != null) {
|
||||
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(objectToReturn), source);
|
||||
if (card instanceof MeldCard) {
|
||||
MeldCard meldCard = (MeldCard) card;
|
||||
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(new MageObjectReference(meldCard.getTopHalfCard(), game)), source);
|
||||
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(new MageObjectReference(meldCard.getBottomHalfCard(), game)), source);
|
||||
}
|
||||
else {
|
||||
game.addEffect(new LongRoadHomeEntersBattlefieldEffect(objectToReturn), source);
|
||||
}
|
||||
owner.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,17 +30,23 @@ package mage.sets.shadowsoverinnistrad;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetForSourceEffect;
|
||||
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.cards.MeldCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
|
@ -60,7 +66,7 @@ public class EssenceFlux extends CardImpl {
|
|||
Effect effect = new ExileTargetForSourceEffect();
|
||||
effect.setApplyEffectsAfter();
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addEffect(new EssenceFluxEffect(false, true));
|
||||
this.getSpellAbility().addEffect(new EssenceFluxEffect());
|
||||
}
|
||||
|
||||
public EssenceFlux(final EssenceFlux card) {
|
||||
|
|
@ -73,14 +79,14 @@ public class EssenceFlux extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class EssenceFluxEffect extends ReturnToBattlefieldUnderOwnerControlTargetEffect {
|
||||
class EssenceFluxEffect extends OneShotEffect {
|
||||
|
||||
public EssenceFluxEffect(boolean tapped, boolean fromExileZone) {
|
||||
super(tapped, fromExileZone);
|
||||
staticText = ", then return that card to the battlefield under its owner's control. If it's a Spirit, put a +1/+1 counter on it";
|
||||
EssenceFluxEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "return that card to the battlefield under its owner's control";
|
||||
}
|
||||
|
||||
public EssenceFluxEffect(final EssenceFluxEffect effect) {
|
||||
EssenceFluxEffect(final EssenceFluxEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -91,22 +97,43 @@ class EssenceFluxEffect extends ReturnToBattlefieldUnderOwnerControlTargetEffect
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = null;
|
||||
UUID exilZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
if (exilZoneId != null) {
|
||||
ExileZone exileZone = game.getExile().getExileZone(exilZoneId);
|
||||
if (exileZone != null && getTargetPointer().getFirst(game, source) != null) {
|
||||
card = exileZone.get(getTargetPointer().getFirst(game, source), game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Cards cardsToBattlefield = new CardsImpl();
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
if (exileZoneId != null) {
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileZoneId);
|
||||
if (exileZone != null) {
|
||||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
if (exileZone.contains(targetId)) {
|
||||
cardsToBattlefield.add(targetId);
|
||||
}
|
||||
else {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null && card instanceof MeldCard) {
|
||||
MeldCard meldCard = (MeldCard) card;
|
||||
Card topCard = meldCard.getTopHalfCard();
|
||||
Card bottomCard = meldCard.getBottomHalfCard();
|
||||
if (topCard.getZoneChangeCounter(game) == meldCard.getTopLastZoneChangeCounter() && exileZone.contains(topCard.getId())) {
|
||||
cardsToBattlefield.add(topCard);
|
||||
}
|
||||
if (bottomCard.getZoneChangeCounter(game) == meldCard.getBottomLastZoneChangeCounter() && exileZone.contains(bottomCard.getId())) {
|
||||
cardsToBattlefield.add(bottomCard);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (super.apply(game, source)) {
|
||||
if (card != null) {
|
||||
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null && permanent.getSubtype().contains("Spirit")) {
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
return effect.apply(game, source);
|
||||
if (!cardsToBattlefield.isEmpty()) {
|
||||
controller.moveCards(cardsToBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
for (UUID cardId : cardsToBattlefield) {
|
||||
Permanent permanent = game.getPermanent(cardId);
|
||||
if (permanent != null && permanent.getSubtype().contains("Spirit")) {
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue