refacted SourceTappedCondition to use a single enum

This commit is contained in:
Evan Kranzler 2022-02-02 21:35:20 -05:00
parent d54fdb71b1
commit 25f47bde63
47 changed files with 61 additions and 64 deletions

View file

@ -29,7 +29,7 @@ public final class AshnodsBattleGear extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}, {tap}: Target creature you control gets +2/-2 for as long as Ashnod's Battle Gear remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(2, -2, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(2, -2, Duration.Custom), SourceTappedCondition.TAPPED,
"target creature you control gets +2/-2 for as long as {this} remains tapped"), new ManaCostsImpl("{2}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent());

View file

@ -39,7 +39,7 @@ public final class BottomlessVault extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// At the beginning of your upkeep, if Bottomless Vault is tapped, put a storage counter on it.
OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance());
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it");
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.TAPPED, "if {this} is tapped, put a storage counter on it");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false));
// {tap}, Remove any number of storage counters from Bottomless Vault: Add {B} for each storage counter removed this way.
Ability ability = new DynamicManaAbility(

View file

@ -51,7 +51,7 @@ public final class CallousOppressor extends CardImpl {
// {T}: Gain control of target creature that isn't of the chosen type for as long as Callous Oppressor remains tapped.
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.OneUse),
SourceTappedCondition.instance,
SourceTappedCondition.TAPPED,
"Gain control of target creature for as long as {this} remains tapped");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(new CallousOppressorFilter()));

View file

@ -33,7 +33,7 @@ public final class CastleRaptors extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// As long as Castle Raptors is untapped, it gets +0/+2.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield), new InvertCondition(SourceTappedCondition.instance),
new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield), SourceTappedCondition.UNTAPPED,
"As long as {this} is untapped, it gets +0/+2.")));
}

View file

@ -42,7 +42,7 @@ public final class DragonlordOjutai extends CardImpl {
// Dragonlord Ojutai has hexproof as long as it's untapped.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"{this} has hexproof as long as it's untapped")));
// Whenever Dragonlord Ojutai deals combat damage to a player, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.

View file

@ -39,7 +39,7 @@ public final class DwarvenHold extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// At the beginning of your upkeep, if Dwarven Hold is tapped, put a storage counter on it.
OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance());
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it");
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.TAPPED, "if {this} is tapped, put a storage counter on it");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false));
// {tap}, Remove any number of storage counters from Dwarven Hold: Add {R} for each storage counter removed this way.
Ability ability = new DynamicManaAbility(

View file

@ -30,7 +30,7 @@ public final class Endoskeleton extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}, {tap}: Target creature gets +0/+3 for as long as Endoskeleton remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(0, 3, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(0, 3, Duration.Custom), SourceTappedCondition.TAPPED,
"target creature gets +0/+3 for as long as {this} remains tapped"), new ManaCostsImpl("{2}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());

View file

@ -44,10 +44,10 @@ public final class EvergloveCourier extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}{G}, {tap}: Target Elf creature gets +2/+2 and has trample for as long as Everglove Courier remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.TAPPED,
"target Elf creature gets +2/+2"), new ManaCostsImpl("{2}{G}"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(),
Duration.Custom), SourceTappedCondition.instance,"and has trample for as long as {this} remains tapped"));
Duration.Custom), SourceTappedCondition.TAPPED,"and has trample for as long as {this} remains tapped"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);

View file

@ -44,10 +44,10 @@ public final class FlamestickCourier extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}{R}, {tap}: Target Goblin creature gets +2/+2 and has haste for as long as Flamestick Courier remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.TAPPED,
"target Goblin creature gets +2/+2"), new ManaCostsImpl("{2}{R}"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(),
Duration.Custom), SourceTappedCondition.instance,"and has haste for as long as {this} remains tapped"));
Duration.Custom), SourceTappedCondition.TAPPED,"and has haste for as long as {this} remains tapped"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);

View file

@ -30,7 +30,7 @@ public final class FlowstoneArmor extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {3}, {tap}: Target creature gets +1/-1 for as long as Flowstone Armor remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(1, -1, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(1, -1, Duration.Custom), SourceTappedCondition.TAPPED,
"target creature gets +1/-1 for as long as {this} remains tapped"), new ManaCostsImpl("{3}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());

View file

@ -44,10 +44,10 @@ public final class FrightshroudCourier extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}{B}, {tap}: Target Zombie creature gets +2/+2 and has fear for as long as Frightshroud Courier remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.TAPPED,
"target Zombie creature gets +2/+2"), new ManaCostsImpl("{2}{B}"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(FearAbility.getInstance(),
Duration.Custom), SourceTappedCondition.instance,"and has fear for as long as {this} remains tapped"));
Duration.Custom), SourceTappedCondition.TAPPED,"and has fear for as long as {this} remains tapped"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);

View file

@ -34,7 +34,7 @@ public final class FuturistOperative extends CardImpl {
// As long as Futurist Operative is tapped, it's a Human Citizen with base power and toughness 1/1 and can't be blocked.
Ability ability = new SimpleStaticAbility(new FuturistOperativeEffect());
ability.addEffect(new ConditionalRestrictionEffect(
new CantBeBlockedSourceEffect(), SourceTappedCondition.instance, "and can't be blocked"
new CantBeBlockedSourceEffect(), SourceTappedCondition.TAPPED, "and can't be blocked"
));
this.addAbility(ability);

View file

@ -45,10 +45,10 @@ public final class GhosthelmCourier extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}{U}, {tap}: Target Wizard creature gets +2/+2 and has shroud for as long as Ghosthelm Courier remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.TAPPED,
"target Wizard creature gets +2/+2"), new ManaCostsImpl("{2}{U}"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(ShroudAbility.getInstance(),
Duration.Custom), SourceTappedCondition.instance,"and has shroud for as long as {this} remains tapped"));
Duration.Custom), SourceTappedCondition.TAPPED,"and has shroud for as long as {this} remains tapped"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);

View file

@ -31,7 +31,7 @@ public final class GiantTortoise extends CardImpl {
// Giant Tortoise gets +0/+3 as long as it's untapped.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(0,3, Duration.WhileOnBattlefield),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"{this} gets +0/+3 as long as it's untapped")));
}

View file

@ -44,7 +44,7 @@ public final class GiantsAmulet extends CardImpl {
new GainAbilitySourceEffect(
HexproofAbility.getInstance(),
Duration.WhileOnBattlefield
), new InvertCondition(SourceTappedCondition.instance),
), SourceTappedCondition.UNTAPPED,
"{this} has hexproof as long as it's untapped"
)), AttachmentType.EQUIPMENT
).setText("and has \"This creature has hexproof as long as it's untapped.\""));

View file

@ -49,7 +49,7 @@ public final class GuardianBeast extends CardImpl {
// As long as Guardian Beast is untapped, noncreature artifacts you control can't be enchanted, they're indestructible, and other players can't gain control of them.
// This effect doesn't remove Auras already attached to those artifacts.
Effect effect = new ConditionalContinuousEffect(new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"As long as Guardian Beast is untapped, noncreature artifacts you control can't be enchanted, they're indestructible");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
ability.addEffect(new GuardianBeastConditionalEffect(this.getId()));

View file

@ -34,7 +34,7 @@ public final class HelmOfPossession extends CardImpl {
// {2}, {tap}, Sacrifice a creature: Gain control of target creature for as long as you control Helm of Possession and Helm of Possession remains tapped.
Ability ability = new SimpleActivatedAbility(new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.instance,
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.TAPPED,
"gain control of target creature for as long as you control {this} and {this} remains tapped"
), new GenericManaCost(2));
ability.addCost(new TapSourceCost());

View file

@ -45,7 +45,7 @@ public final class HivisOfTheScale extends CardImpl {
// {tap}: Gain control of target Dragon for as long as you control Hivis and Hivis remains tapped.
Ability ability = new SimpleActivatedAbility(new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.instance,
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.TAPPED,
"gain control of target Dragon for as long as you control {this} and {this} remains tapped"
), new TapSourceCost());
ability.addTarget(new TargetPermanent(filterDragon));

View file

@ -39,7 +39,7 @@ public final class HollowTrees extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// At the beginning of your upkeep, if Hollow Trees is tapped, put a storage counter on it.
OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance());
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it");
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.TAPPED, "if {this} is tapped, put a storage counter on it");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false));
// {tap}, Remove any number of storage counters from Hollow Trees: Add {G} for each storage counter removed this way.
Ability ability = new DynamicManaAbility(

View file

@ -39,7 +39,7 @@ public final class IcatianStore extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// At the beginning of your upkeep, if Icatian Store is tapped, put a storage counter on it.
OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance());
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it");
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.TAPPED, "if {this} is tapped, put a storage counter on it");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false));
// {tap}, Remove any number of storage counters from Icatian Store: Add {W} for each storage counter removed this way.
Ability ability = new DynamicManaAbility(

View file

@ -40,7 +40,7 @@ public final class IymrithDesertDoom extends CardImpl {
// Iymrith, Desert Doom has ward {4} as long as it's untapped.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(new WardAbility(new GenericManaCost(4)), Duration.WhileOnBattlefield),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"{this} has ward {4} as long as it's untapped"
)));

View file

@ -39,7 +39,7 @@ public final class Johan extends CardImpl {
// At the beginning of combat on your turn, you may have Johan gain "Johan can't attack" until end of combat. If you do, attacking doesn't cause creatures you control to tap this combat if Johan is untapped.
Condition condition = new CompoundCondition("if {this} is untapped",
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
SourceOnBattlefieldCondition.instance);
Ability ability = new BeginningOfCombatTriggeredAbility(new CantAttackSourceEffect(Duration.EndOfCombat).setText("you may have {this} gain \"{this} can't attack\" until end of combat"), TargetController.YOU, true);
ability.addEffect(new ConditionalContinuousEffect(

View file

@ -42,7 +42,7 @@ public final class JuniperOrderAdvocate extends CardImpl {
// As long as Juniper Order Advocate is untapped, green creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"As long as {this} is untapped, green creatures you control get +1/+1.")));
}

View file

@ -41,7 +41,7 @@ public final class ManaVault extends CardImpl {
// At the beginning of your draw step, if Mana Vault is tapped, it deals 1 damage to you.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfDrawTriggeredAbility(Zone.BATTLEFIELD, new DamageControllerEffect(1), TargetController.YOU, false),
SourceTappedCondition.instance,
SourceTappedCondition.TAPPED,
"At the beginning of your draw step, if {this} is tapped, it deals 1 damage to you."));
// {tap}: Add {C}{C}{C}.
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(3), new TapSourceCost()));

View file

@ -35,7 +35,7 @@ public final class MartyrsOfKorlis extends CardImpl {
// As long as Martyrs of Korlis is untapped, all damage that would be dealt to you by artifacts is dealt to Martyrs of Korlis instead.
Effect effect = new ConditionalReplacementEffect(
new RedirectArtifactDamageFromPlayerToSourceEffect(Duration.WhileOnBattlefield),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
null);
effect.setText("{this} redirects artifact damage from controller as long as it's untapped");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

View file

@ -41,7 +41,7 @@ public final class MirriWeatherlightDuelist extends CardImpl {
// As long as Mirri, Weatherlight Duelist is tapped, no more than one creature can attack you each combat.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new MirriWeatherlightDuelistAttackRestrictionEffect(1), SourceTappedCondition.instance,
new MirriWeatherlightDuelistAttackRestrictionEffect(1), SourceTappedCondition.TAPPED,
"As long as {this} is tapped, no more than one creature can attack you each combat."));
this.addAbility(ability);
}

View file

@ -48,7 +48,7 @@ public final class OldManOfTheSea extends CardImpl {
FilterCreaturePermanent controllableCreatures = new FilterCreaturePermanent("creature with power less than or equal to Old Man of the Sea's power");
controllableCreatures.add(new PowerLowerEqualSourcePredicate(this.getId()));
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(
new OldManOfTheSeaGainControlTargetEffect(Duration.Custom, true), new CompoundCondition(SourceTappedCondition.instance, new SourcePowerGreaterEqualTargetCondition()),
new OldManOfTheSeaGainControlTargetEffect(Duration.Custom, true), new CompoundCondition(SourceTappedCondition.TAPPED, new SourcePowerGreaterEqualTargetCondition()),
"Gain control of target creature with power less than or equal to {this}'s power for as long as {this} remains tapped and that creature's power remains less than or equal to {this}'s power");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(controllableCreatures));

View file

@ -34,7 +34,7 @@ public final class ParadiseDruid extends CardImpl {
new GainAbilitySourceEffect(
HexproofAbility.getInstance(),
Duration.WhileOnBattlefield
), new InvertCondition(SourceTappedCondition.instance),
), SourceTappedCondition.UNTAPPED,
"{this} has hexproof as long as it's untapped"
)));

View file

@ -45,10 +45,10 @@ public final class PearlspearCourier extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}{W}, {tap}: Target Soldier creature gets +2/+2 and has vigilance for as long as Pearlspear Courier remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.TAPPED,
"target Soldier creature gets +2/+2"), new ManaCostsImpl("{2}{W}"));
ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(),
Duration.Custom), SourceTappedCondition.instance,"and has vigilance for as long as {this} remains tapped"));
Duration.Custom), SourceTappedCondition.TAPPED,"and has vigilance for as long as {this} remains tapped"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);

View file

@ -75,7 +75,7 @@ class PreacherEffect extends OneShotEffect {
Permanent targetPermanent = game.getPermanent(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && sourcePermanent != null && targetPermanent != null) {
SourceTappedCondition sourceTappedCondition = SourceTappedCondition.instance;
SourceTappedCondition sourceTappedCondition = SourceTappedCondition.TAPPED;
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.Custom),
sourceTappedCondition,

View file

@ -55,7 +55,7 @@ public final class PristineAngel extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new ConditionalContinuousEffect(
new GainAbilitySourceEffect(new ProtectionAbility(filter), Duration.WhileOnBattlefield),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"As long as {this} is untapped, it has protection from artifacts and from all colors")));
// Whenever you cast a spell, you may untap Pristine Angel.
this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), true));

View file

@ -1,23 +1,21 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.SourceTappedCondition;
import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class ReveilleSquad extends CardImpl {
@ -76,7 +74,7 @@ class ReveilleSquadTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkInterveningIfClause(Game game) {
return new InvertCondition(SourceTappedCondition.instance).apply(game, this);
return SourceTappedCondition.UNTAPPED.apply(game, this);
}
@Override

View file

@ -36,7 +36,7 @@ public final class RubiniaSoulsinger extends CardImpl {
// {tap}: Gain control of target creature for as long as you control Rubinia and Rubinia remains tapped.
Ability ability = new SimpleActivatedAbility(new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.instance,
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.TAPPED,
"gain control of target creature for as long as you control {this} and {this} remains tapped"
), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());

View file

@ -39,7 +39,7 @@ public final class SandSilos extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// At the beginning of your upkeep, if Sand Silos is tapped, put a storage counter on it.
OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance());
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it");
Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.TAPPED, "if {this} is tapped, put a storage counter on it");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false));
// {tap}, Remove any number of storage counters from Sand Silos: Add {U} for each storage counter removed this way.
Ability ability = new DynamicManaAbility(

View file

@ -57,7 +57,7 @@ public final class Seasinger extends CardImpl {
// {tap}: Gain control of target creature whose controller controls an Island for as long as you control Seasinger and Seasinger remains tapped.
Ability ability = new SimpleActivatedAbility(new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.instance,
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.TAPPED,
"gain control of target creature whose controller controls " +
"an Island for as long as you control {this} and {this} remains tapped"
), new TapSourceCost());

View file

@ -40,7 +40,7 @@ public final class SpectralGuardian extends CardImpl {
// As long as Spectral Guardian is untapped, noncreature artifacts have shroud.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new GainAbilityAllEffect(ShroudAbility.getInstance(), Duration.WhileOnBattlefield, filter, false),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"as long as {this} is untapped, noncreature artifacts have shroud.")));
}

View file

@ -30,7 +30,7 @@ public final class SpiritShield extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}, {tap}: Target creature gets +0/+2 for as long as Spirit Shield remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(0, 2, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(0, 2, Duration.Custom), SourceTappedCondition.TAPPED,
"target creature gets +0/+2 for as long as {this} remains tapped"), new ManaCostsImpl("{2}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());

View file

@ -30,7 +30,7 @@ public final class TawnossWeaponry extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {2}, {tap}: Target creature gets +1/+1 for as long as Tawnos's Weaponry remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(1, 1, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(1, 1, Duration.Custom), SourceTappedCondition.TAPPED,
"target creature gets +1/+1 for as long as {this} remains tapped"), new ManaCostsImpl("{2}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());

View file

@ -38,7 +38,7 @@ public final class UWing extends CardImpl {
// As long as U-Wing is tapped, it gets +1/+0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield),
SourceTappedCondition.instance,
SourceTappedCondition.TAPPED,
"As long as {this} is tapped, it gets +1/+0")));
// As long as U-Wing is untapped, it gets +0/+1.

View file

@ -44,7 +44,7 @@ public final class VedalkenShackles extends CardImpl {
// {2}, {tap}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped.
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.Custom), SourceTappedCondition.instance,
new GainControlTargetEffect(Duration.Custom), SourceTappedCondition.TAPPED,
"Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2));
ability.addCost(new TapSourceCost());

View file

@ -38,7 +38,7 @@ public final class VeteranBodyguard extends CardImpl {
// As long as Veteran Bodyguard is untapped, all damage that would be dealt to you by unblocked creatures is dealt to Veteran Bodyguard instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalPreventionEffect(
new VeteranBodyguardEffect(),
new InvertCondition(SourceTappedCondition.instance),
SourceTappedCondition.UNTAPPED,
"As long as {this} is untapped, all damage that would be dealt to you by unblocked creatures is dealt to {this} instead."
)));
}

View file

@ -44,7 +44,7 @@ public final class VoodooDoll extends CardImpl {
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(
new DestroySourceEffect(), TargetController.YOU, false
), new InvertCondition(SourceTappedCondition.instance), "At the beginning of your end step, " +
), SourceTappedCondition.UNTAPPED, "At the beginning of your end step, " +
"if {this} is untapped, destroy {this} and it deals damage to you equal to the number of pin counters on it."
);
ability.addEffect(new DamageControllerEffect(new CountersSourceCount(CounterType.PIN)));

View file

@ -36,7 +36,7 @@ public final class Watchdog extends CardImpl {
addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BlocksIfAbleSourceEffect(Duration.WhileOnBattlefield)));
// As long as Watchdog is untapped, all creatures attacking you get -1/-0.
addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostAllEffect(-1, 0, Duration.WhileOnBattlefield, new WatchdogFilter(), false), new InvertCondition(SourceTappedCondition.instance), "As long as {this} is untapped, all creatures attacking you get -1/-0")));
new BoostAllEffect(-1, 0, Duration.WhileOnBattlefield, new WatchdogFilter(), false), SourceTappedCondition.UNTAPPED, "As long as {this} is untapped, all creatures attacking you get -1/-0")));
}
private Watchdog(final Watchdog card) {

View file

@ -41,7 +41,7 @@ public final class WillowSatyr extends CardImpl {
// {tap}: Gain control of target legendary creature for as long as you control Willow Satyr and Willow Satyr remains tapped.
Ability ability = new SimpleActivatedAbility(new ConditionalContinuousEffect(
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.instance,
new GainControlTargetEffect(Duration.WhileControlled), SourceTappedCondition.TAPPED,
"Gain control of target legendary creature for as long as you control {this} and {this} remains tapped"
), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));

View file

@ -30,7 +30,7 @@ public final class ZelyonSword extends CardImpl {
this.addAbility(new SkipUntapOptionalAbility());
// {3}, {tap}: Target creature gets +2/+0 for as long as Zelyon Sword remains tapped.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BoostTargetEffect(2, 0, Duration.Custom), SourceTappedCondition.instance,
new BoostTargetEffect(2, 0, Duration.Custom), SourceTappedCondition.TAPPED,
"target creature gets +2/+0 for as long as {this} remains tapped"), new ManaCostsImpl("{3}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());

View file

@ -1,5 +1,3 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
@ -8,21 +6,22 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public enum SourceTappedCondition implements Condition {
TAPPED(true),
UNTAPPED(false);
private final boolean tapped;
instance;
SourceTappedCondition(boolean tapped) {
this.tapped = tapped;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
if (permanent != null) {
return permanent.isTapped();
}
return false;
return permanent != null && permanent.isTapped() == tapped;
}
}

View file

@ -17,7 +17,7 @@ import mage.game.events.GameEvent;
public class DontUntapAsLongAsSourceTappedEffect extends ConditionalContinuousRuleModifyingEffect {
public DontUntapAsLongAsSourceTappedEffect() {
super(new DontUntapInControllersUntapStepTargetEffect(Duration.Custom), SourceTappedCondition.instance);
super(new DontUntapInControllersUntapStepTargetEffect(Duration.Custom), SourceTappedCondition.TAPPED);
staticText = "It doesn't untap during its controller's untap step for as long as {this} remains tapped.";
}