mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
updated the Addendum condition to take into account whether a spell was actually cast
This commit is contained in:
parent
fd709bcd28
commit
53720149c6
8 changed files with 26 additions and 21 deletions
|
@ -2,7 +2,7 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.common.MyMainPhaseCondition;
|
||||
import mage.abilities.condition.common.AddendumCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DrawDiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -24,7 +24,7 @@ public final class CarefulConsideration extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new DrawDiscardTargetEffect(4,2),
|
||||
new DrawDiscardTargetEffect(4,3),
|
||||
MyMainPhaseCondition.instance,
|
||||
AddendumCondition.instance,
|
||||
"Target player draws four cards, then discards three cards. If you cast this spell during your main phase, instead that player draws four cards, then discards two cards"));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.condition.common.MyMainPhaseCondition;
|
||||
import mage.abilities.condition.common.AddendumCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardAllEffect;
|
||||
import mage.abilities.effects.common.ExileSpellEffect;
|
||||
|
@ -38,7 +38,7 @@ public final class EmergencyPowers extends CardImpl {
|
|||
// Addendum — If you cast this spell during your main phase, you may put a permanent card with converted mana cost 7 or less from your hand onto the battlefield.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new PutCardFromHandOntoBattlefieldEffect(filter),
|
||||
MyMainPhaseCondition.instance,
|
||||
AddendumCondition.instance,
|
||||
"<br><i>Addendum</i> — " +
|
||||
"If you cast this spell during your main phase, " +
|
||||
"you may put a permanent card with converted mana cost 7 or less " +
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.common.MyMainPhaseCondition;
|
||||
import mage.abilities.condition.common.AddendumCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -23,7 +23,7 @@ public final class HauntingHymn extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new DiscardTargetEffect(4),
|
||||
new DiscardTargetEffect(2),
|
||||
MyMainPhaseCondition.instance,
|
||||
AddendumCondition.instance,
|
||||
"Target player discards two cards. If you cast this spell during your main phase, that player discards four cards instead"));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package mage.cards.m;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.MyMainPhaseCondition;
|
||||
import mage.abilities.condition.common.AddendumCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -25,7 +25,7 @@ public final class MightOfOldKrosa extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(
|
||||
new BoostTargetEffect(4,4, Duration.EndOfTurn),
|
||||
new BoostTargetEffect(2, 2, Duration.EndOfTurn),
|
||||
new LockedInCondition(MyMainPhaseCondition.instance),
|
||||
new LockedInCondition(AddendumCondition.instance),
|
||||
"Target creature gets +2/+2 until end of turn. If you cast this spell during your main phase, that creature gets +4/+4 until end of turn instead"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.MyMainPhaseCondition;
|
||||
import mage.abilities.condition.common.AddendumCondition;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
@ -59,7 +59,7 @@ class PrecognitivePerceptionEffect extends OneShotEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
if (MyMainPhaseCondition.instance.apply(game, source)) {
|
||||
if (AddendumCondition.instance.apply(game, source)) {
|
||||
controller.scry(3, source, game);
|
||||
}
|
||||
controller.drawCards(3, game);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.condition.common.MyMainPhaseCondition;
|
||||
import mage.abilities.condition.common.AddendumCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
|
@ -24,7 +24,7 @@ public final class SphinxsInsight extends CardImpl {
|
|||
|
||||
// Addendum — If you cast this spell during your main phase, you gain 2 life.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new GainLifeEffect(2), MyMainPhaseCondition.instance,
|
||||
new GainLifeEffect(2), AddendumCondition.instance,
|
||||
"<br><i>Addendum</i> — If you cast this spell during your main phase, you gain 2 life."
|
||||
));
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.common.MyMainPhaseCondition;
|
||||
import mage.abilities.condition.common.AddendumCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DamageEverythingEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -22,7 +22,7 @@ public final class SulfurousBlast extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new DamageEverythingEffect(3),
|
||||
new DamageEverythingEffect(2),
|
||||
MyMainPhaseCondition.instance,
|
||||
AddendumCondition.instance,
|
||||
"Sulfurous Blast deals 2 damage to each creature and each player. If you cast this spell during your main phase, Sulfurous Blast deals 3 damage to each creature and each player instead"));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +1,31 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public enum MyMainPhaseCondition implements Condition {
|
||||
public enum AddendumCondition implements Condition {
|
||||
|
||||
instance;
|
||||
private static final Set<TurnPhase> turnPhases = EnumSet.of(TurnPhase.PRECOMBAT_MAIN, TurnPhase.POSTCOMBAT_MAIN);
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.isActivePlayer(source.getControllerId()) &&
|
||||
turnPhases.contains(game.getTurn().getPhase().getType());
|
||||
if (!game.isActivePlayer(source.getControllerId()) ||
|
||||
!turnPhases.contains(game.getTurn().getPhase().getType())) {
|
||||
return false;
|
||||
}
|
||||
Spell spell = game.getSpell(source.getSourceId());
|
||||
return spell != null && !spell.isCopy();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue