mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[NEO] Implemented Fable of the Mirror Breaker / Reflection of Kiki-Jiki
This commit is contained in:
parent
e2ad74cb75
commit
76a1187c8e
5 changed files with 198 additions and 11 deletions
|
|
@ -5,12 +5,10 @@ import mage.ObjectColor;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.EffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
|
|
@ -20,7 +18,6 @@ import mage.counters.CounterType;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.EmptyToken;
|
||||
import mage.game.turn.Step;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
import mage.util.CardUtil;
|
||||
|
|
@ -354,27 +351,39 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
this.number = number;
|
||||
}
|
||||
|
||||
public void sacrificeTokensCreatedAtNextEndStep(Game game, Ability source) {
|
||||
this.removeTokensCreatedAtEndOf(game, source, PhaseStep.END_TURN, false);
|
||||
}
|
||||
|
||||
public void exileTokensCreatedAtNextEndStep(Game game, Ability source) {
|
||||
this.exileTokensCreatedAtEndOf(game, source, PhaseStep.END_TURN);
|
||||
this.removeTokensCreatedAtEndOf(game, source, PhaseStep.END_TURN, true);
|
||||
}
|
||||
|
||||
public void sacrificeTokensCreatedAtEndOfCombat(Game game, Ability source) {
|
||||
this.removeTokensCreatedAtEndOf(game, source, PhaseStep.END_COMBAT, false);
|
||||
}
|
||||
|
||||
public void exileTokensCreatedAtEndOfCombat(Game game, Ability source) {
|
||||
this.exileTokensCreatedAtEndOf(game, source, PhaseStep.END_COMBAT);
|
||||
this.removeTokensCreatedAtEndOf(game, source, PhaseStep.END_COMBAT, true);
|
||||
}
|
||||
|
||||
private void exileTokensCreatedAtEndOf(Game game, Ability source, PhaseStep phaseStepToExileCards) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
|
||||
exileEffect.setText("exile the token copies");
|
||||
exileEffect.setTargetPointer(new FixedTargets(addedTokenPermanents, game));
|
||||
private void removeTokensCreatedAtEndOf(Game game, Ability source, PhaseStep phaseStepToExileCards, boolean exile) {
|
||||
Effect effect;
|
||||
if (exile) {
|
||||
effect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD).setText("exile the token copies");
|
||||
} else {
|
||||
effect = new SacrificeTargetEffect("sacrifice the token copies");
|
||||
}
|
||||
effect.setTargetPointer(new FixedTargets(addedTokenPermanents, game));
|
||||
|
||||
DelayedTriggeredAbility exileAbility;
|
||||
|
||||
switch (phaseStepToExileCards) {
|
||||
case END_TURN:
|
||||
exileAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
|
||||
exileAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
|
||||
break;
|
||||
case END_COMBAT:
|
||||
exileAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect);
|
||||
exileAbility = new AtTheEndOfCombatDelayedTriggeredAbility(effect);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class FableOfTheMirrorBreakerToken extends TokenImpl {
|
||||
|
||||
public FableOfTheMirrorBreakerToken() {
|
||||
super("Goblin Shaman Token", "2/2 red Goblin Shaman creature token with \"Whenever this creature attacks, create a Treasure token.\"");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
subtype.add(SubType.GOBLIN);
|
||||
subtype.add(SubType.SHAMAN);
|
||||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new TreasureToken())).setTriggerPhrase("Whenever this creature attacks, "));
|
||||
}
|
||||
|
||||
private FableOfTheMirrorBreakerToken(final FableOfTheMirrorBreakerToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FableOfTheMirrorBreakerToken copy() {
|
||||
return new FableOfTheMirrorBreakerToken(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue