[VOC] Implemented Breath of the Sleepless

This commit is contained in:
Evan Kranzler 2021-11-17 20:55:11 -05:00
parent b83bbc000f
commit 1aa1d71a96
8 changed files with 113 additions and 14 deletions

View file

@ -0,0 +1,58 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.condition.common.OpponentsTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashAllEffect;
import mage.abilities.hint.common.OpponentsTurnHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BreathOfTheSleepless extends CardImpl {
private static final FilterCard filter = new FilterCard("Spirit spells");
static {
filter.add(SubType.SPIRIT.getPredicate());
}
public BreathOfTheSleepless(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
// You may cast Spirit spells as though they had flash.
this.addAbility(new SimpleStaticAbility(
new CastAsThoughItHadFlashAllEffect(Duration.WhileOnBattlefield, filter)
));
// Whenever you cast a creature spell during an opponent's turn, tap up to one target creature.
Ability ability = new ConditionalTriggeredAbility(new SpellCastControllerTriggeredAbility(
new TapTargetEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false
), OpponentsTurnCondition.instance, "Whenever you cast a creature spell " +
"during an opponent's turn, tap up to one target creature.");
ability.addTarget(new TargetCreaturePermanent(0, 1));
this.addAbility(ability.addHint(OpponentsTurnHint.instance));
}
private BreathOfTheSleepless(final BreathOfTheSleepless card) {
super(card);
}
@Override
public BreathOfTheSleepless copy() {
return new BreathOfTheSleepless(this);
}
}

View file

@ -2,10 +2,10 @@ package mage.cards.b;
import mage.MageInt;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.condition.common.NotMyTurnCondition;
import mage.abilities.condition.common.OpponentsTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.hint.common.NotMyTurnHint;
import mage.abilities.hint.common.OpponentsTurnHint;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -35,9 +35,9 @@ public final class BrinebornCutthroat extends CardImpl {
this.addAbility(new ConditionalTriggeredAbility(
new SpellCastControllerTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false
), NotMyTurnCondition.instance, "Whenever you cast a spell during an opponent's turn, " +
), OpponentsTurnCondition.instance, "Whenever you cast a spell during an opponent's turn, " +
"put a +1/+1 counter on {this}."
).addHint(NotMyTurnHint.instance)); // TODO: replace to opponent's turn condition (team mode support in future)
).addHint(OpponentsTurnHint.instance));
}
private BrinebornCutthroat(final BrinebornCutthroat card) {

View file

@ -38,6 +38,7 @@ public final class CrimsonVowCommander extends ExpansionSet {
cards.add(new SetCardInfo("Bloodsworn Steward", 144, Rarity.RARE, mage.cards.b.BloodswornSteward.class));
cards.add(new SetCardInfo("Bloodtracker", 122, Rarity.RARE, mage.cards.b.Bloodtracker.class));
cards.add(new SetCardInfo("Boreas Charger", 79, Rarity.RARE, mage.cards.b.BoreasCharger.class));
cards.add(new SetCardInfo("Breath of the Sleepless", 11, Rarity.RARE, mage.cards.b.BreathOfTheSleepless.class));
cards.add(new SetCardInfo("Butcher of Malakir", 123, Rarity.RARE, mage.cards.b.ButcherOfMalakir.class));
cards.add(new SetCardInfo("Bygone Bishop", 80, Rarity.RARE, mage.cards.b.BygoneBishop.class));
cards.add(new SetCardInfo("Champion of Dusk", 124, Rarity.RARE, mage.cards.c.ChampionOfDusk.class));

View file

@ -1,22 +1,15 @@
package mage.abilities.condition.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
public enum NotMyTurnCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
UUID activePlayerId = game.getActivePlayerId();
if (activePlayerId != null) {
return !activePlayerId.equals(source.getControllerId());
}
return false;
return source.isControlledBy(game.getActivePlayerId());
}
@Override

View file

@ -0,0 +1,22 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum OpponentsTurnCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return game.getOpponents(source.getControllerId()).contains(game.getActivePlayerId());
}
@Override
public String toString() {
return "if it's an opponent's turn";
}
}

View file

@ -12,7 +12,7 @@ import mage.game.Game;
public enum MyTurnHint implements Hint {
instance;
private static final ConditionHint hint = new ConditionHint(MyTurnCondition.instance, "It's my turn");
private static final ConditionHint hint = new ConditionHint(MyTurnCondition.instance, "It's your turn");
@Override
public String getText(Game game, Ability ability) {

View file

@ -12,7 +12,7 @@ import mage.game.Game;
public enum NotMyTurnHint implements Hint {
instance;
private static final ConditionHint hint = new ConditionHint(NotMyTurnCondition.instance, "It's not my turn");
private static final ConditionHint hint = new ConditionHint(NotMyTurnCondition.instance, "It's not your turn");
@Override
public String getText(Game game, Ability ability) {

View file

@ -0,0 +1,25 @@
package mage.abilities.hint.common;
import mage.abilities.Ability;
import mage.abilities.condition.common.OpponentsTurnCondition;
import mage.abilities.hint.ConditionHint;
import mage.abilities.hint.Hint;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum OpponentsTurnHint implements Hint {
instance;
private static final ConditionHint hint = new ConditionHint(OpponentsTurnCondition.instance, "It's an opponent's turn");
@Override
public String getText(Game game, Ability ability) {
return hint.getText(game, ability);
}
@Override
public Hint copy() {
return instance;
}
}