Fix several card abilities incorrectly implemented as intervening-if abilities when they weren't

This commit is contained in:
Alex W. Jackson 2022-09-09 04:47:07 -04:00
parent ec3573a786
commit 076c55f1ea
12 changed files with 128 additions and 142 deletions

View file

@ -1,10 +1,11 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.hint.common.RaidHint;
import mage.cards.CardImpl;
@ -17,7 +18,7 @@ import mage.watchers.common.PlayerAttackedWatcher;
import java.util.UUID;
/**
* @author LevelX2
* @author awjackson
*/
public final class BellowingSaddlebrute extends CardImpl {
@ -28,14 +29,15 @@ public final class BellowingSaddlebrute extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(5);
// Raid - When Bellowing Saddlebrute enters the battlefield, you lose 4 life unless you attacked with a creature this turn
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(4)),
new InvertCondition(RaidCondition.instance),
"When {this} enters the battlefield, you lose 4 life unless you attacked this turn.")
.setAbilityWord(AbilityWord.RAID)
.addHint(RaidHint.instance),
new PlayerAttackedWatcher());
// Raid - When Bellowing Saddlebrute enters the battlefield, you lose 4 life unless you attacked this turn
Ability ability = new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(
new LoseLifeSourceControllerEffect(4),
new InvertCondition(RaidCondition.instance),
"you lose 4 life unless you attacked this turn"
));
ability.setAbilityWord(AbilityWord.RAID);
ability.addHint(RaidHint.instance);
this.addAbility(ability, new PlayerAttackedWatcher());
}
private BellowingSaddlebrute(final BellowingSaddlebrute card) {

View file

@ -6,7 +6,7 @@ import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.ControllerAttackedThisTurnCondition;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
@ -14,6 +14,7 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.hint.common.RaidHint;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -24,7 +25,7 @@ import mage.constants.Outcome;
import mage.constants.SubType;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.watchers.common.PlayerAttackedWatcher;
/**
*
@ -53,10 +54,13 @@ public final class CuriousObsession extends CardImpl {
this.addAbility(ability);
// At the beginning of your end step, if you didn't attack with a creature this turn sacrifice Curious Obsession.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfYourEndStepTriggeredAbility(new SacrificeSourceEffect(), false),
new InvertCondition(ControllerAttackedThisTurnCondition.instance),
"At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."), new AttackedThisTurnWatcher());
new InvertCondition(RaidCondition.instance),
"At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."
);
ability.addHint(RaidHint.instance);
this.addAbility(ability, new PlayerAttackedWatcher());
}
private CuriousObsession(final CuriousObsession card) {

View file

@ -1,14 +1,15 @@
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.AttackedThisTurnSourceCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -21,21 +22,27 @@ import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
* @author LoneFox
* @author awjackson
*
*/
public final class ErgRaiders extends CardImpl {
public ErgRaiders(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WARRIOR);
this.subtype.add(SubType.HUMAN, SubType.WARRIOR);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// At the beginning of your end step, if Erg Raiders didn't attack this turn, Erg Raiders deals 2 damage to you unless it came under your control this turn.
TriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(new BeginningOfEndStepTriggeredAbility(new DamageControllerEffect(2), TargetController.YOU, false),
new ErgRaidersCondition(), "At the beginning of your end step, if {this} didn't attack this turn, {this} deals 2 damage to you unless it came under your control this turn.");
Effect effect = new ConditionalOneShotEffect(
new DamageControllerEffect(2),
ErgRaidersCondition.instance,
"{this} deals 2 damage to you unless it came under your control this turn"
);
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(effect, TargetController.YOU, false),
new InvertCondition(AttackedThisTurnSourceCondition.instance),
"At the beginning of your end step, if {this} didn't attack this turn, {this} deals 2 damage to you unless it came under your control this turn.");
ability.addWatcher(new AttackedThisTurnWatcher());
this.addAbility(ability);
}
@ -50,13 +57,12 @@ public final class ErgRaiders extends CardImpl {
}
}
class ErgRaidersCondition implements Condition {
enum ErgRaidersCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
Permanent raiders = game.getPermanentOrLKIBattlefield(source.getSourceId());
AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class);
// wasControlledFromStartOfControllerTurn should be checked during resolution I guess, but shouldn't be relevant
return raiders != null &&raiders.wasControlledFromStartOfControllerTurn() && watcher != null && !watcher.getAttackedThisTurnCreatures().contains(new MageObjectReference(raiders, game));
Permanent raiders = source.getSourcePermanentOrLKI(game);
return raiders != null && raiders.wasControlledFromStartOfControllerTurn();
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -8,26 +7,21 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author jeffwadsworth
* @author awjackson
*/
public final class RingOfEvosIsle extends CardImpl {
@ -42,12 +36,15 @@ public final class RingOfEvosIsle extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// {2}: Equipped creature gains hexproof until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT, Duration.EndOfTurn), new GenericManaCost(2)));
this.addAbility(new SimpleActivatedAbility(new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT, Duration.EndOfTurn), new GenericManaCost(2)));
// At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's blue.
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false);
ConditionalInterveningIfTriggeredAbility ability2 = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's blue.");
this.addAbility(ability2);
Effect effect = new ConditionalOneShotEffect(
new AddPlusOneCountersAttachedEffect(1),
new AttachedToMatchesFilterCondition(filter),
"put a +1/+1 counter on equipped creature if it's blue"
);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
import mage.abilities.keyword.EquipAbility;
@ -21,7 +21,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author jeffwadsworth
* @author awjackson
*/
public final class RingOfKalonia extends CardImpl {
@ -36,12 +36,15 @@ public final class RingOfKalonia extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature has trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT)));
// At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's green.
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false);
ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's green");
this.addAbility(ability);
Effect effect = new ConditionalOneShotEffect(
new AddPlusOneCountersAttachedEffect(1),
new AttachedToMatchesFilterCondition(filter),
"put a +1/+1 counter on equipped creature if it's green"
);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
import mage.abilities.keyword.EquipAbility;
@ -21,7 +21,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author jeffwadsworth
* @author awjackson
*/
public final class RingOfThune extends CardImpl {
@ -36,12 +36,15 @@ public final class RingOfThune extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature has vigilance.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT)));
// At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white.
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false);
ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white.");
this.addAbility(ability);
Effect effect = new ConditionalOneShotEffect(
new AddPlusOneCountersAttachedEffect(1),
new AttachedToMatchesFilterCondition(filter),
"put a +1/+1 counter on equipped creature if it's white"
);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
import mage.abilities.keyword.EquipAbility;
@ -21,7 +21,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author jeffwadsworth
* @author awjackson
*/
public final class RingOfValkas extends CardImpl {
@ -36,12 +36,15 @@ public final class RingOfValkas extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature has haste.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT)));
// At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's red.
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false);
ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's red.");
this.addAbility(ability);
Effect effect = new ConditionalOneShotEffect(
new AddPlusOneCountersAttachedEffect(1),
new AttachedToMatchesFilterCondition(filter),
"put a +1/+1 counter on equipped creature if it's red"
);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.common.AttachedToMatchesFilterCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.RegenerateAttachedEffect;
import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
import mage.abilities.keyword.EquipAbility;
@ -20,7 +20,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author jeffwadsworth
* @author awjackson
*/
public final class RingOfXathrid extends CardImpl {
@ -35,12 +35,15 @@ public final class RingOfXathrid extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// {2}: Regenerate equipped creature.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.EQUIPMENT), new GenericManaCost(2)));
this.addAbility(new SimpleActivatedAbility(new RegenerateAttachedEffect(AttachmentType.EQUIPMENT), new GenericManaCost(2)));
// At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's black.
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false);
ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's black");
this.addAbility(ability);
Effect effect = new ConditionalOneShotEffect(
new AddPlusOneCountersAttachedEffect(1),
new AttachedToMatchesFilterCondition(filter),
"put a +1/+1 counter on equipped creature if it's black"
);
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1)));

View file

@ -6,13 +6,14 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.ControllerAttackedThisTurnCondition;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.hint.common.RaidHint;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
@ -25,7 +26,7 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.watchers.common.PlayerAttackedWatcher;
/**
*
@ -53,10 +54,13 @@ public final class SeeRed extends CardImpl {
this.addAbility(ability);
// At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice See Red.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
ability = new ConditionalInterveningIfTriggeredAbility(
new BeginningOfYourEndStepTriggeredAbility(new SacrificeSourceEffect(), false),
new InvertCondition(ControllerAttackedThisTurnCondition.instance),
"At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."), new AttackedThisTurnWatcher());
new InvertCondition(RaidCondition.instance),
"At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."
);
ability.addHint(RaidHint.instance);
this.addAbility(ability, new PlayerAttackedWatcher());
}
private SeeRed(final SeeRed card) {

View file

@ -1,10 +1,11 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.condition.common.AttackedThisTurnCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.condition.common.RaidCondition;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.hint.common.RaidHint;
import mage.abilities.keyword.PartnerWithAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -13,7 +14,7 @@ import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.game.permanent.token.HumanSoldierToken;
import mage.watchers.common.AttackedThisTurnWatcher;
import mage.watchers.common.PlayerAttackedWatcher;
import java.util.UUID;
@ -35,13 +36,14 @@ public final class TrynnChampionOfFreedom extends CardImpl {
this.addAbility(new PartnerWithAbility("Silvar, Devourer of the Free"));
// At the beginning of your end step, if you attacked this turn, create a 1/1 white Human Soldier creature token.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(
new CreateTokenEffect(new HumanSoldierToken()),
TargetController.YOU, false
), AttackedThisTurnCondition.instance, "At the beginning of your end step, " +
"if you attacked this turn, create a 1/1 white Human Soldier creature token."
), new AttackedThisTurnWatcher());
Ability ability = new BeginningOfEndStepTriggeredAbility(
new CreateTokenEffect(new HumanSoldierToken()),
TargetController.YOU,
RaidCondition.instance,
false
);
ability.addHint(RaidHint.instance);
this.addAbility(ability, new PlayerAttackedWatcher());
}
private TrynnChampionOfFreedom(final TrynnChampionOfFreedom card) {

View file

@ -1,20 +0,0 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
* @author LevelX2
*/
public enum AttackedThisTurnCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class);
return watcher != null && !watcher.getAttackedThisTurnCreatures().isEmpty();
}
}

View file

@ -1,21 +0,0 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
* @author LevelX2
*/
public enum ControllerAttackedThisTurnCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class);
return source.isControlledBy(game.getActivePlayerId()) && watcher != null && !watcher.getAttackedThisTurnCreatures().isEmpty();
}
}