[FIN] Implement Cactuar

This commit is contained in:
theelk801 2025-05-26 13:40:44 -04:00
parent 1553ec0bf7
commit 1375d31dde
14 changed files with 66 additions and 19 deletions

View file

@ -0,0 +1,45 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.condition.common.SourceEnteredThisTurnCondition;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Cactuar extends CardImpl {
public Cactuar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
this.subtype.add(SubType.PLANT);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Trample
this.addAbility(TrampleAbility.getInstance());
// At the beginning of your end step, if this creature didn't enter the battlefield this turn, return it to its owner's hand.
this.addAbility(new BeginningOfEndStepTriggeredAbility(
new ReturnToHandSourceEffect(true)
.setText("return it to its owner's hand")
).withInterveningIf(SourceEnteredThisTurnCondition.DIDNT));
}
private Cactuar(final Cactuar card) {
super(card);
}
@Override
public Cactuar copy() {
return new Cactuar(this);
}
}

View file

@ -32,7 +32,7 @@ public final class CrewCaptain extends CardImpl {
// Crew Captain has indestructible as long as it entered the battlefield this turn.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), SourceEnteredThisTurnCondition.instance,
new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), SourceEnteredThisTurnCondition.DID,
"{this} has indestructible as long as it entered the battlefield this turn"
)));
}

View file

@ -38,7 +38,7 @@ public final class DrownyardBehemoth extends CardImpl {
// Drownyard Behemoth has hexproof as long as it entered the battlefield this turn.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield),
SourceEnteredThisTurnCondition.instance, "{this} has hexproof as long as it entered the battlefield this turn"
SourceEnteredThisTurnCondition.DID, "{this} has hexproof as long as it entered the battlefield this turn"
)));
}

View file

@ -15,7 +15,6 @@ import mage.constants.CardType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import mage.target.common.TargetControlledPermanent;
/**
*
@ -42,7 +41,7 @@ public final class FungusElemental extends CardImpl {
Zone.BATTLEFIELD,
new AddCountersSourceEffect(CounterType.P2P2.createInstance()),
new ManaCostsImpl<>("{G}"),
SourceEnteredThisTurnCondition.instance
SourceEnteredThisTurnCondition.DID
);
ability.addCost(new SacrificeTargetCost(filter));
this.addAbility(ability);

View file

@ -36,7 +36,7 @@ public final class HixusPrisonWarden extends CardImpl {
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DealsDamageToYouAllTriggeredAbility(
StaticFilters.FILTER_PERMANENT_CREATURE, new ExileUntilSourceLeavesEffect(), true
).setTriggerPhrase("Whenever a creature deals combat damage to you, if {this} entered the battlefield this turn, "),
SourceEnteredThisTurnCondition.instance, null
SourceEnteredThisTurnCondition.DID, null
));
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
public final class KaitoShizuki extends CardImpl {
private static final Hint hint = new ConditionHint(
SourceEnteredThisTurnCondition.instance, "This permanent entered the battlefield this turn"
SourceEnteredThisTurnCondition.DID, "This permanent entered the battlefield this turn"
);
private static final Condition condition = new InvertCondition(RaidCondition.instance);
@ -45,7 +45,7 @@ public final class KaitoShizuki extends CardImpl {
// At the beginning of your end step, if Kaito Shizuki entered the battlefield this turn, he phases out.
this.addAbility(new BeginningOfEndStepTriggeredAbility(
TargetController.YOU, new PhaseOutSourceEffect().setText("he phases out"),
false, SourceEnteredThisTurnCondition.instance
false, SourceEnteredThisTurnCondition.DID
).addHint(hint));
// +1: Draw a card. Then discard a card unless you attacked this turn.

View file

@ -49,7 +49,7 @@ public final class KeldonStrikeTeam extends CardImpl {
new GainAbilityControlledEffect(
HasteAbility.getInstance(), Duration.WhileOnBattlefield,
StaticFilters.FILTER_CONTROLLED_CREATURE
), SourceEnteredThisTurnCondition.instance, "as long as {this} " +
), SourceEnteredThisTurnCondition.DID, "as long as {this} " +
"entered the battlefield this turn, creatures you control have haste"
)));
}

View file

@ -34,7 +34,7 @@ public final class Mirrex extends CardImpl {
// {T}: Add one mana of any color. Activate only if Mirrex entered the battlefield this turn.
this.addAbility(new ActivateIfConditionManaAbility(
Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(),
new TapSourceCost(), SourceEnteredThisTurnCondition.instance
new TapSourceCost(), SourceEnteredThisTurnCondition.DID
));
// {3}, {T}: Create a 1/1 colorless Phyrexian Mite artifact creature token with toxic 1 and "This creature can't block."

View file

@ -22,7 +22,7 @@ import java.util.UUID;
*/
public final class MoonCircuitHacker extends CardImpl {
private static final Condition condition = new InvertCondition(SourceEnteredThisTurnCondition.instance);
private static final Condition condition = new InvertCondition(SourceEnteredThisTurnCondition.DID);
public MoonCircuitHacker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{U}");

View file

@ -42,7 +42,7 @@ public final class ShardmagesRescue extends CardImpl {
// As long as Shardmage's Rescue entered this turn, enchanted creature has hexproof.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.AURA),
SourceEnteredThisTurnCondition.instance,
SourceEnteredThisTurnCondition.DID,
"as long as {this} entered this turn, enchanted creature has hexproof"
)));

View file

@ -49,7 +49,7 @@ public final class ThrastaTempestsRoar extends CardImpl {
// Thrasta has hexproof as long as it entered the battlefield this turn.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield),
SourceEnteredThisTurnCondition.instance, "{this} has hexproof as long as it entered the battlefield this turn"
SourceEnteredThisTurnCondition.DID, "{this} has hexproof as long as it entered the battlefield this turn"
)));
}

View file

@ -57,7 +57,7 @@ public final class ZurgoAndOjutai extends CardImpl {
// Zurgo and Ojutai has hexproof as long as it entered the battlefield this turn.
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield),
SourceEnteredThisTurnCondition.instance, "{this} has hexproof as long as it entered the battlefield this turn"
SourceEnteredThisTurnCondition.DID, "{this} has hexproof as long as it entered the battlefield this turn"
)));
// Whenever one or more Dragons you control deal combat damage to a player or battle, 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. You may return one of those Dragons to its owner's hand.

View file

@ -76,6 +76,7 @@ public final class FinalFantasy extends ExpansionSet {
cards.add(new SetCardInfo("Braska's Final Aeon", 448, Rarity.RARE, mage.cards.b.BraskasFinalAeon.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Buster Sword", 255, Rarity.MYTHIC, mage.cards.b.BusterSword.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Buster Sword", 351, Rarity.MYTHIC, mage.cards.b.BusterSword.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Cactuar", 177, Rarity.UNCOMMON, mage.cards.c.Cactuar.class));
cards.add(new SetCardInfo("Capital City", 274, Rarity.UNCOMMON, mage.cards.c.CapitalCity.class));
cards.add(new SetCardInfo("Cargo Ship", 47, Rarity.UNCOMMON, mage.cards.c.CargoShip.class));
cards.add(new SetCardInfo("Cecil, Dark Knight", 380, Rarity.RARE, mage.cards.c.CecilDarkKnight.class, NON_FULL_USE_VARIOUS));

View file

@ -1,4 +1,3 @@
package mage.abilities.condition.common;
import mage.abilities.Ability;
@ -9,20 +8,23 @@ import mage.game.permanent.Permanent;
/**
* @author xenohedron
*/
public enum SourceEnteredThisTurnCondition implements Condition {
DID(true),
DIDNT(false);
private final boolean flag;
instance;
SourceEnteredThisTurnCondition(boolean flag) {
this.flag = flag;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentOrLKI(game);
return permanent != null && permanent.getTurnsOnBattlefield() == 0;
return permanent != null && (permanent.getTurnsOnBattlefield() == 0) == flag;
}
@Override
public String toString() {
return "{this} entered the battlefield this turn";
return "{this} " + (flag ? "entered" : "didn't enter") + " the battlefield this turn";
}
}