[FIN] Implement Buster Sword

This commit is contained in:
theelk801 2025-05-17 08:18:06 -04:00
parent c1dfa892b7
commit c939bb38dc
2 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,85 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageEquippedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BusterSword extends CardImpl {
public BusterSword(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +3/+2.
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(3, 2)));
// Whenever equipped creature deals combat damage to a player, draw a card, then you may cast a spell from your hand with mana value less than or equal to that damage without paying its mana cost.
Ability ability = new DealsCombatDamageEquippedTriggeredAbility(new DrawCardTargetEffect(1));
ability.addEffect(new BusterSwordEffect());
this.addAbility(ability);
// Equip {2}
this.addAbility(new EquipAbility(2));
}
private BusterSword(final BusterSword card) {
super(card);
}
@Override
public BusterSword copy() {
return new BusterSword(this);
}
}
class BusterSwordEffect extends OneShotEffect {
BusterSwordEffect() {
super(Outcome.Benefit);
staticText = ", then you may cast a spell from your hand with mana value " +
"less than or equal to that damage without paying its mana cost";
}
private BusterSwordEffect(final BusterSwordEffect effect) {
super(effect);
}
@Override
public BusterSwordEffect copy() {
return new BusterSwordEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null || player.getHand().isEmpty()) {
return false;
}
int damage = (Integer) getValue("damage");
FilterCard filter = new FilterCard();
filter.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, damage + 1));
return CardUtil.castSpellWithAttributesForFree(player, source, game, new CardsImpl(player.getHand()), filter);
}
}

View file

@ -46,6 +46,8 @@ public final class FinalFantasy extends ExpansionSet {
cards.add(new SetCardInfo("Braska's Final Aeon", 104, Rarity.RARE, mage.cards.b.BraskasFinalAeon.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Braska's Final Aeon", 363, Rarity.RARE, mage.cards.b.BraskasFinalAeon.class, NON_FULL_USE_VARIOUS));
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("Capital City", 274, Rarity.UNCOMMON, mage.cards.c.CapitalCity.class));
cards.add(new SetCardInfo("Cecil, Dark Knight", 380, Rarity.RARE, mage.cards.c.CecilDarkKnight.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Cecil, Dark Knight", 445, Rarity.RARE, mage.cards.c.CecilDarkKnight.class, NON_FULL_USE_VARIOUS));