[40K] Implemented Acolyte Hybrid

This commit is contained in:
Evan Kranzler 2022-09-22 08:48:34 -04:00
parent 28137cedeb
commit 4b7b79009d
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,77 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetArtifactPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AcolyteHybrid extends CardImpl {
public AcolyteHybrid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.subtype.add(SubType.TYRANID);
this.subtype.add(SubType.HUMAN);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Heavy Rock Cutter -- Whenever Acolyte Hybrid attacks, destroy up to one target artifact. If an artifact is destroyed this way, its controller draws a card.
Ability ability = new AttacksTriggeredAbility(new AcolyteHybridEffect());
ability.addTarget(new TargetArtifactPermanent(0, 1));
this.addAbility(ability.withFlavorWord("Heavy Rock Cutter"));
}
private AcolyteHybrid(final AcolyteHybrid card) {
super(card);
}
@Override
public AcolyteHybrid copy() {
return new AcolyteHybrid(this);
}
}
class AcolyteHybridEffect extends OneShotEffect {
AcolyteHybridEffect() {
super(Outcome.Benefit);
staticText = "destroy up to one target artifact. " +
"If an artifact is destroyed this way, its controller draws a card";
}
private AcolyteHybridEffect(final AcolyteHybridEffect effect) {
super(effect);
}
@Override
public AcolyteHybridEffect copy() {
return new AcolyteHybridEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null || !permanent.destroy(source, game)) {
return false;
}
Player player = game.getPlayer(permanent.getControllerId());
if (player != null) {
player.drawCards(1, source, game);
}
return true;
}
}

View file

@ -28,6 +28,7 @@ public final class Warhammer40000 extends ExpansionSet {
cards.add(new SetCardInfo("Abaddon the Despoiler", 2, Rarity.MYTHIC, mage.cards.a.AbaddonTheDespoiler.class));
cards.add(new SetCardInfo("Aberrant", 86, Rarity.UNCOMMON, mage.cards.a.Aberrant.class));
cards.add(new SetCardInfo("Abundance", 210, Rarity.RARE, mage.cards.a.Abundance.class));
cards.add(new SetCardInfo("Acolyte Hybrid", 70, Rarity.UNCOMMON, mage.cards.a.AcolyteHybrid.class));
cards.add(new SetCardInfo("Aetherize", 191, Rarity.UNCOMMON, mage.cards.a.Aetherize.class));
cards.add(new SetCardInfo("Arcane Sanctum", 264, Rarity.UNCOMMON, mage.cards.a.ArcaneSanctum.class));
cards.add(new SetCardInfo("Arcane Signet", 227, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));