mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
[WHO] Implement The Master, Multiplied (#11356)
This commit is contained in:
parent
7c27e0b999
commit
30b1ef5491
6 changed files with 135 additions and 10 deletions
|
|
@ -42,7 +42,7 @@ public final class BattleAngelsOfTyr extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Myriad
|
||||
this.addAbility(new MyriadAbility());
|
||||
this.addAbility(new MyriadAbility(false));
|
||||
|
||||
// Whenever Battle Angels of Tyr deals combat damage to a player, draw a card if that player has more cards in hand than each other player. Then you create a Treasure token if that player controls more lands than each other player. Then you gain 3 life if that player has more life than each other player.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public final class ElturelSurvivors extends CardImpl {
|
|||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Myriad
|
||||
this.addAbility(new MyriadAbility());
|
||||
this.addAbility(new MyriadAbility(false));
|
||||
|
||||
// As long as Elturel Survivors is attacking, it gets +X/+0, where X is the number of lands defending player controls.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostSourceEffect(
|
||||
|
|
|
|||
115
Mage.Sets/src/mage/cards/t/TheMasterMultiplied.java
Normal file
115
Mage.Sets/src/mage/cards/t/TheMasterMultiplied.java
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.common.ruleModifying.LegendRuleDoesntApplyEffect;
|
||||
import mage.abilities.keyword.MyriadAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author PurpleCrowbar
|
||||
*/
|
||||
public final class TheMasterMultiplied extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("creature tokens you control");
|
||||
|
||||
static {
|
||||
filter.add(TokenPredicate.TRUE);
|
||||
}
|
||||
|
||||
public TheMasterMultiplied(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{R}");
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.TIME_LORD, SubType.ROGUE);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Myriad
|
||||
this.addAbility(new MyriadAbility(false));
|
||||
|
||||
// The "legend rule" doesn't apply to creature tokens you control.
|
||||
this.addAbility(new SimpleStaticAbility(new LegendRuleDoesntApplyEffect(filter)));
|
||||
|
||||
// Triggered abilities you control can't cause you to sacrifice or exile creature tokens you control.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TheMasterMultipliedEffect()));
|
||||
}
|
||||
|
||||
private TheMasterMultiplied(final TheMasterMultiplied card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TheMasterMultiplied copy() {
|
||||
return new TheMasterMultiplied(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TheMasterMultipliedEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("creature tokens you control");
|
||||
|
||||
static {
|
||||
filter.add(TokenPredicate.TRUE);
|
||||
}
|
||||
|
||||
public TheMasterMultipliedEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "Triggered abilities you control can't cause you to sacrifice or exile creature tokens you control";
|
||||
}
|
||||
|
||||
private TheMasterMultipliedEffect(final TheMasterMultipliedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TheMasterMultipliedEffect copy() {
|
||||
return new TheMasterMultipliedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.SACRIFICE_PERMANENT
|
||||
|| event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
UUID eventSourceControllerId = game.getControllerId(event.getSourceId());
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
|
||||
StackObject stackObject = game.getStack().getStackObject(event.getSourceId());
|
||||
if (stackObject == null) {
|
||||
return false;
|
||||
}
|
||||
Ability stackAbility = stackObject.getStackAbility();
|
||||
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (!zEvent.getToZone().equals(Zone.EXILED)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return controller != null && permanent != null
|
||||
&& filter.match(permanent, source.getControllerId(), source, game)
|
||||
&& stackAbility instanceof TriggeredAbility
|
||||
&& source.getControllerId().equals(eventSourceControllerId);
|
||||
}
|
||||
}
|
||||
|
|
@ -213,6 +213,9 @@ public final class DoctorWho extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("The Flood of Mars", 45, Rarity.RARE, mage.cards.t.TheFloodOfMars.class));
|
||||
cards.add(new SetCardInfo("The Flux", 86, Rarity.RARE, mage.cards.t.TheFlux.class));
|
||||
cards.add(new SetCardInfo("The Fugitive Doctor", 130, Rarity.RARE, mage.cards.t.TheFugitiveDoctor.class));
|
||||
cards.add(new SetCardInfo("The Master, Multiplied", 146, Rarity.RARE, mage.cards.t.TheMasterMultiplied.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("The Master, Multiplied", 429, Rarity.RARE, mage.cards.t.TheMasterMultiplied.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("The Master, Multiplied", 545, Rarity.RARE, mage.cards.t.TheMasterMultiplied.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("The Ninth Doctor", 148, Rarity.RARE, mage.cards.t.TheNinthDoctor.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("The Ninth Doctor", 432, Rarity.RARE, mage.cards.t.TheNinthDoctor.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("The Ninth Doctor", 560, Rarity.RARE, mage.cards.t.TheNinthDoctor.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -23,12 +23,15 @@ import org.apache.log4j.Logger;
|
|||
public class MyriadAbility extends AttacksTriggeredAbility {
|
||||
|
||||
public MyriadAbility() {
|
||||
super(new MyriadEffect(), false,
|
||||
"myriad <i>(Whenever this creature attacks, for each opponent other than the defending player, "
|
||||
+ "put a token that's a copy of this creature onto the battlefield tapped and attacking "
|
||||
+ "that player or a planeswalker they control. Exile those tokens at the end of combat.)</i>",
|
||||
SetTargetPointer.PLAYER
|
||||
);
|
||||
this(true);
|
||||
}
|
||||
|
||||
public MyriadAbility(boolean showAbilityHint) {
|
||||
super(new MyriadEffect(), false, "myriad" + (showAbilityHint ?
|
||||
" <i>(Whenever this creature attacks, for each opponent other than the defending player, " +
|
||||
"put a token that's a copy of this creature onto the battlefield tapped and attacking " +
|
||||
"that player or a planeswalker they control. Exile those tokens at the end of combat.)</i>" : ""),
|
||||
SetTargetPointer.PLAYER);
|
||||
}
|
||||
|
||||
protected MyriadAbility(final MyriadAbility ability) {
|
||||
|
|
|
|||
|
|
@ -1931,7 +1931,9 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
}
|
||||
boolean successfullyMoved = ZonesHandler.moveCard(zoneChangeInfo, game, source);
|
||||
//20180810 - 701.3d
|
||||
detachAllAttachments(game);
|
||||
if (successfullyMoved) {
|
||||
detachAllAttachments(game);
|
||||
}
|
||||
return successfullyMoved;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1945,7 +1947,9 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
|
||||
boolean successfullyMoved = ZonesHandler.moveCard(zcInfo, game, source);
|
||||
//20180810 - 701.3d
|
||||
detachAllAttachments(game);
|
||||
if (successfullyMoved) {
|
||||
detachAllAttachments(game);
|
||||
}
|
||||
return successfullyMoved;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue