mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Simplified flip handling. Flip continiuous effect has now time stamp of time the card flipped so it works with copied cards.
This commit is contained in:
parent
948449ee13
commit
85e90881c1
14 changed files with 33 additions and 112 deletions
|
@ -32,14 +32,10 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
|
@ -80,13 +76,9 @@ public class BudokaPupil extends CardImpl<BudokaPupil> {
|
|||
|
||||
// At the beginning of the end step, if there are two or more ki counters on Budoka Pupil, you may flip it.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect()),
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new IchigaWhoTopplesOaks())),
|
||||
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
|
||||
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it.", true));
|
||||
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new IchigaWhoTopplesOaks()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public BudokaPupil(final BudokaPupil card) {
|
||||
|
|
|
@ -32,15 +32,11 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.CounterUnlessPaysEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
|
@ -79,13 +75,9 @@ public class CallowJushi extends CardImpl<CallowJushi> {
|
|||
|
||||
// At the beginning of the end step, if there are two or more ki counters on Callow Jushi, you may flip it.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect()),
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new JarakuTheInterloper())),
|
||||
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
|
||||
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it.", true));
|
||||
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new JarakuTheInterloper()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public CallowJushi(final CallowJushi card) {
|
||||
|
|
|
@ -32,14 +32,10 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainControlTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
|
@ -79,13 +75,9 @@ public class CunningBandit extends CardImpl<CunningBandit> {
|
|||
|
||||
// At the beginning of the end step, if there are two or more ki counters on Cunning Bandit, you may flip it.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect()),
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new AzamukiTreacheryIncarnate())),
|
||||
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
|
||||
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it.", true));
|
||||
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new AzamukiTreacheryIncarnate()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public CunningBandit(final CunningBandit card) {
|
||||
|
|
|
@ -37,12 +37,9 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.*;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.PreventDamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
|
@ -80,13 +77,10 @@ public class FaithfulSquire extends CardImpl<FaithfulSquire> {
|
|||
|
||||
// At the beginning of the end step, if there are two or more ki counters on Faithful Squire, you may flip it
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect()),
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new KaisoMemoryOfLoyalty())),
|
||||
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
|
||||
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it.", true));
|
||||
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new KaisoMemoryOfLoyalty()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public FaithfulSquire(final FaithfulSquire card) {
|
||||
|
|
|
@ -32,17 +32,12 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.continious.GainControlTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FearAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -81,14 +76,9 @@ public class HiredMuscle extends CardImpl<HiredMuscle> {
|
|||
|
||||
// At the beginning of the end step, if there are two or more ki counters on Hired Muscle, you may flip it.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect()),
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new Scarmaker())),
|
||||
new SourceHasCounterCondition(CounterType.KI, 2, Integer.MAX_VALUE),
|
||||
"At the beginning of the end step, if there are two or more ki counters on {this}, you may flip it.", true));
|
||||
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new Scarmaker()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
public HiredMuscle(final HiredMuscle card) {
|
||||
|
|
|
@ -5,10 +5,7 @@ import mage.ObjectColor;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.ProtectionAbility;
|
||||
|
@ -39,11 +36,11 @@ public class AkkiLavarunner extends CardImpl<AkkiLavarunner> {
|
|||
this.toughness = new MageInt(1);
|
||||
this.flipCard = true;
|
||||
this.flipCardName = "Tok-Tok, Volcano Born";
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
// Whenever Akki Lavarunner deals damage to an opponent, flip it.
|
||||
this.addAbility(new AkkiLavarunnerAbility());
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new TokTokVolcanoBorn()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public AkkiLavarunner(final AkkiLavarunner card) {
|
||||
|
@ -59,7 +56,7 @@ public class AkkiLavarunner extends CardImpl<AkkiLavarunner> {
|
|||
class AkkiLavarunnerAbility extends TriggeredAbilityImpl<AkkiLavarunnerAbility> {
|
||||
|
||||
public AkkiLavarunnerAbility() {
|
||||
super(Zone.BATTLEFIELD, new FlipSourceEffect());
|
||||
super(Zone.BATTLEFIELD, new FlipSourceEffect(new TokTokVolcanoBorn()));
|
||||
}
|
||||
|
||||
public AkkiLavarunnerAbility(final AkkiLavarunnerAbility ability) {
|
||||
|
|
|
@ -34,11 +34,7 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -79,10 +75,7 @@ public class InitiateOfBlood extends CardImpl<InitiateOfBlood> {
|
|||
this.addAbility(ability);
|
||||
|
||||
// When that creature is put into a graveyard this turn, flip Initiate of Blood.
|
||||
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new FlipSourceEffect()));
|
||||
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new GokaTheUnjust()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new FlipSourceEffect(new GokaTheUnjust())));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -34,16 +34,12 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.CardsInHandCondition;
|
||||
import mage.abilities.condition.common.CardsInHandCondition.CountType;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
|
@ -72,12 +68,9 @@ public class JushiApprentice extends CardImpl<JushiApprentice> {
|
|||
// {2}{U}, {tap}: Draw a card. If you have nine or more cards in hand, flip Jushi Apprentice.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), new ManaCostsImpl("{2}{U}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new ConditionalOneShotEffect(new FlipSourceEffect(), new CardsInHandCondition(CountType.MORE_THAN, 8),
|
||||
ability.addEffect(new ConditionalOneShotEffect(new FlipSourceEffect(new TomoyaTheRevealer()), new CardsInHandCondition(CountType.MORE_THAN, 8),
|
||||
"If you have nine or more cards in hand, flip {this}"));
|
||||
this.addAbility(ability);
|
||||
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new TomoyaTheRevealer()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public JushiApprentice(final JushiApprentice card) {
|
||||
|
|
|
@ -76,12 +76,9 @@ public class KitsuneMystic extends CardImpl<KitsuneMystic> {
|
|||
|
||||
// At the beginning of the end step, if Kitsune Mystic is enchanted by two or more Auras, flip it.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect()),
|
||||
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new AutumnTailKitsuneSage())),
|
||||
new EnchantedCondition(2),"At the beginning of the end step, if {this} is enchanted by two or more Auras, flip it.", false
|
||||
));
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new AutumnTailKitsuneSage()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public KitsuneMystic(final KitsuneMystic card) {
|
||||
|
|
|
@ -37,15 +37,11 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.DiscardTargetEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -77,13 +73,10 @@ public class NezumiShortfang extends CardImpl<NezumiShortfang> {
|
|||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetOpponent());
|
||||
ability.addEffect(new ConditionalOneShotEffect(
|
||||
new FlipSourceEffect(),
|
||||
new FlipSourceEffect(new StabwhiskerTheOdious()),
|
||||
new CardsInTargetOpponentHandCondition(CardsInTargetOpponentHandCondition.CountType.FEWER_THAN, 1),
|
||||
"Then if that player has no cards in hand, flip {this}"));
|
||||
this.addAbility(ability);
|
||||
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new StabwhiskerTheOdious()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public NezumiShortfang(final NezumiShortfang card) {
|
||||
|
|
|
@ -37,15 +37,11 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
|
@ -78,13 +74,9 @@ public class OrochiEggwatcher extends CardImpl<OrochiEggwatcher> {
|
|||
Ability ability;
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken()),new ManaCostsImpl("{2}{G}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new ConditionalOneShotEffect(new FlipSourceEffect(),
|
||||
ability.addEffect(new ConditionalOneShotEffect(new FlipSourceEffect(new ShidakoBroodmistress()),
|
||||
new ControlsPermanentCondition(new FilterControlledCreaturePermanent(),ControlsPermanentCondition.CountType.MORE_THAN, 9),"If you control ten or more creatures, flip {this}"));
|
||||
this.addAbility(ability);
|
||||
|
||||
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new ShidakoBroodmistress()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public OrochiEggwatcher(final OrochiEggwatcher card) {
|
||||
|
|
|
@ -29,12 +29,8 @@ package mage.sets.championsofkamigawa;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.StateTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -69,11 +65,6 @@ public class StudentOfElements extends CardImpl<StudentOfElements> {
|
|||
|
||||
// When Student of Elements has flying, flip it.
|
||||
this.addAbility(new StudentOfElementsHasFlyingAbility());
|
||||
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new TobitaMasterOfWinds()), FlippedCondition.getInstance(), ""));
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
public StudentOfElements(final StudentOfElements card) {
|
||||
|
@ -89,7 +80,7 @@ public class StudentOfElements extends CardImpl<StudentOfElements> {
|
|||
class StudentOfElementsHasFlyingAbility extends StateTriggeredAbility<StudentOfElementsHasFlyingAbility> {
|
||||
|
||||
public StudentOfElementsHasFlyingAbility() {
|
||||
super(Zone.BATTLEFIELD, new FlipSourceEffect());
|
||||
super(Zone.BATTLEFIELD, new FlipSourceEffect(new TobitaMasterOfWinds()));
|
||||
}
|
||||
|
||||
public StudentOfElementsHasFlyingAbility(final StudentOfElementsHasFlyingAbility ability) {
|
||||
|
|
|
@ -34,10 +34,7 @@ import mage.abilities.common.CantBlockAbility;
|
|||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.CopyTokenEffect;
|
||||
import mage.abilities.effects.common.FlipSourceEffect;
|
||||
import mage.abilities.effects.common.continious.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
|
@ -73,11 +70,7 @@ public class HomuraHumanAscendant extends CardImpl<HomuraHumanAscendant> {
|
|||
// Homura, Human Ascendant can't block.
|
||||
this.addAbility(new CantBlockAbility());
|
||||
// When Homura dies, return it to the battlefield flipped.
|
||||
this.addAbility(new DiesTriggeredAbility(new FlipSourceEffect()));
|
||||
|
||||
Ability flipAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new HomurasEssence2()), FlippedCondition.getInstance(), "{this} becomes Homura's Essence"));
|
||||
flipAbility.setRuleVisible(false);
|
||||
this.addAbility(flipAbility);
|
||||
this.addAbility(new DiesTriggeredAbility(new FlipSourceEffect(new HomurasEssence2())));
|
||||
}
|
||||
|
||||
public HomuraHumanAscendant(final HomuraHumanAscendant card) {
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.FlippedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -12,20 +16,28 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class FlipSourceEffect extends OneShotEffect<FlipSourceEffect> {
|
||||
|
||||
public FlipSourceEffect() {
|
||||
private final Token flipToken;
|
||||
|
||||
public FlipSourceEffect(Token flipToken) {
|
||||
super(Outcome.BecomeCreature);
|
||||
this.flipToken = flipToken;
|
||||
staticText = "flip it";
|
||||
}
|
||||
|
||||
public FlipSourceEffect(final FlipSourceEffect effect) {
|
||||
super(effect);
|
||||
this.flipToken = effect.flipToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent p = game.getPermanent(source.getSourceId());
|
||||
if (p != null) {
|
||||
return p.flip(game);
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (permanent.flip(game)) {
|
||||
ContinuousEffect effect = new ConditionalContinousEffect(new CopyTokenEffect(flipToken), FlippedCondition.getInstance(), "");
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue