[Y22] Implemented Soulstealer Axe

This commit is contained in:
Evan Kranzler 2022-03-01 17:55:19 -05:00
parent 07043c393c
commit a7fa431d19
3 changed files with 83 additions and 1 deletions

View file

@ -0,0 +1,81 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ManaValuePredicate;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SoulstealerAxe extends CardImpl {
public SoulstealerAxe(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature has trample.
this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(
TrampleAbility.getInstance(), AttachmentType.EQUIPMENT
)));
// Whenever equipped creature deals combat damage to a player, seek a card with mana value equal to that damage.
this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(
new SoulstealerAxeEffect(), "equipped", false
));
// Equip {2}
this.addAbility(new EquipAbility(2));
}
private SoulstealerAxe(final SoulstealerAxe card) {
super(card);
}
@Override
public SoulstealerAxe copy() {
return new SoulstealerAxe(this);
}
}
class SoulstealerAxeEffect extends OneShotEffect {
SoulstealerAxeEffect() {
super(Outcome.Benefit);
staticText = "seek a card with mana value equal to that damage";
}
private SoulstealerAxeEffect(final SoulstealerAxeEffect effect) {
super(effect);
}
@Override
public SoulstealerAxeEffect copy() {
return new SoulstealerAxeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
int damage = (Integer) getValue("damage");
FilterCard filter = new FilterCard();
filter.add(new ManaValuePredicate(ComparisonType.EQUAL_TO, damage));
return player.seekCard(filter, source, game);
}
}

View file

@ -23,6 +23,7 @@ public final class AlchemyInnistrad extends ExpansionSet {
cards.add(new SetCardInfo("Cursebound Witch", 24, Rarity.UNCOMMON, mage.cards.c.CurseboundWitch.class));
cards.add(new SetCardInfo("Faithful Disciple", 7, Rarity.UNCOMMON, mage.cards.f.FaithfulDisciple.class));
cards.add(new SetCardInfo("Key to the Archive", 59, Rarity.RARE, mage.cards.k.KeyToTheArchive.class));
cards.add(new SetCardInfo("Soulstealer Axe", 60, Rarity.UNCOMMON, mage.cards.s.SoulstealerAxe.class));
cards.add(new SetCardInfo("Tireless Angler", 23, Rarity.RARE, mage.cards.t.TirelessAngler.class));
}
}

View file

@ -77,8 +77,8 @@ public class DealsDamageToAPlayerAttachedTriggeredAbility extends TriggeredAbili
|| p == null || !p.getAttachments().contains(this.getSourceId())) {
return false;
}
getEffects().setValue("damage", event.getAmount());
if (setFixedTargetPointer) {
getEffects().setValue("damage", event.getAmount());
getEffects().setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;