[OTJ] Implement Wrangler of the Damned

This commit is contained in:
Susucre 2024-03-29 21:35:13 +01:00
parent b0f283c6f5
commit 93457c24ca
3 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,49 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.condition.common.HaventCastSpellFromHandThisTurnCondition;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.permanent.token.Spirit22Token;
import java.util.UUID;
/**
* @author Susucr
*/
public final class WranglerOfTheDamned extends CardImpl {
public WranglerOfTheDamned(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(1);
this.toughness = new MageInt(4);
// Flash
this.addAbility(FlashAbility.getInstance());
// At the beginning of your end step, if you haven't cast a spell from your hand this turn, create a 2/2 white Spirit creature token with flying.
this.addAbility(new BeginningOfEndStepTriggeredAbility(
Zone.BATTLEFIELD, new CreateTokenEffect(new Spirit22Token()),
TargetController.YOU, HaventCastSpellFromHandThisTurnCondition.instance, false
).addHint(HaventCastSpellFromHandThisTurnCondition.hint));
}
private WranglerOfTheDamned(final WranglerOfTheDamned card) {
super(card);
}
@Override
public WranglerOfTheDamned copy() {
return new WranglerOfTheDamned(this);
}
}

View file

@ -124,6 +124,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet {
cards.add(new SetCardInfo("Vial Smasher, Gleeful Grenadier", 235, Rarity.UNCOMMON, mage.cards.v.VialSmasherGleefulGrenadier.class));
cards.add(new SetCardInfo("Visage Bandit", 76, Rarity.UNCOMMON, mage.cards.v.VisageBandit.class));
cards.add(new SetCardInfo("Vraska Joins Up", 236, Rarity.RARE, mage.cards.v.VraskaJoinsUp.class));
cards.add(new SetCardInfo("Wrangler of the Damned", 238, Rarity.UNCOMMON, mage.cards.w.WranglerOfTheDamned.class));
cards.removeIf(setCardInfo -> unfinished.contains(setCardInfo.getName())); // remove when mechanic is implemented
}

View file

@ -0,0 +1,35 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.abilities.hint.ConditionHint;
import mage.abilities.hint.Hint;
import mage.constants.Zone;
import mage.game.Game;
import mage.watchers.common.SpellsCastWatcher;
import java.util.Objects;
/**
* @author Susucr
*/
public enum HaventCastSpellFromHandThisTurnCondition implements Condition {
instance;
public static final Hint hint = new ConditionHint(instance, "No cast from hand this turn", null, "Have cast from hand this turn", null, true);
@Override
public boolean apply(Game game, Ability source) {
return game.getState()
.getWatcher(SpellsCastWatcher.class)
.getSpellsCastThisTurn(source.getControllerId())
.stream()
.filter(Objects::nonNull)
.noneMatch(spell -> Zone.HAND.equals(spell.getFromZone()));
}
@Override
public String toString() {
return "if you haven't cast a spell from hand this turn";
}
}