forked from External/mage
[NEO] Implemented Malicious Malfunction
This commit is contained in:
parent
7e0980a3fa
commit
0f1a0cbd31
2 changed files with 85 additions and 0 deletions
84
Mage.Sets/src/mage/cards/m/MaliciousMalfunction.java
Normal file
84
Mage.Sets/src/mage/cards/m/MaliciousMalfunction.java
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class MaliciousMalfunction extends CardImpl {
|
||||
|
||||
public MaliciousMalfunction(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}");
|
||||
|
||||
// All creatures get -2/-2 until end of turn. If a creature would die this turn, exile it instead.
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn));
|
||||
this.getSpellAbility().addEffect(new MaliciousMalfunctionReplacementEffect());
|
||||
}
|
||||
|
||||
private MaliciousMalfunction(final MaliciousMalfunction card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaliciousMalfunction copy() {
|
||||
return new MaliciousMalfunction(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MaliciousMalfunctionReplacementEffect extends ReplacementEffectImpl {
|
||||
|
||||
public MaliciousMalfunctionReplacementEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Exile);
|
||||
this.staticText = "If a creature would die this turn, exile it instead";
|
||||
}
|
||||
|
||||
private MaliciousMalfunctionReplacementEffect(final MaliciousMalfunctionReplacementEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaliciousMalfunctionReplacementEffect copy() {
|
||||
return new MaliciousMalfunctionReplacementEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
return player.moveCards(permanent, Zone.EXILED, source, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
return zEvent.getTarget() != null
|
||||
&& zEvent.getTarget().isCreature(game)
|
||||
&& zEvent.isDiesEvent();
|
||||
}
|
||||
}
|
||||
|
|
@ -79,6 +79,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Life of Toshiro Umezawa", 108, Rarity.UNCOMMON, mage.cards.l.LifeOfToshiroUmezawa.class));
|
||||
cards.add(new SetCardInfo("Lion Sash", 26, Rarity.RARE, mage.cards.l.LionSash.class));
|
||||
cards.add(new SetCardInfo("Lizard Blades", 153, Rarity.RARE, mage.cards.l.LizardBlades.class));
|
||||
cards.add(new SetCardInfo("Malicious Malfunction", 110, Rarity.UNCOMMON, mage.cards.m.MaliciousMalfunction.class));
|
||||
cards.add(new SetCardInfo("Memory of Toshiro", 108, Rarity.UNCOMMON, mage.cards.m.MemoryOfToshiro.class));
|
||||
cards.add(new SetCardInfo("Michiko's Reign of Truth", 29, Rarity.UNCOMMON, mage.cards.m.MichikosReignOfTruth.class));
|
||||
cards.add(new SetCardInfo("Moon-Circuit Hacker", 67, Rarity.COMMON, mage.cards.m.MoonCircuitHacker.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue