[AFC] Implemented Wand Of Orcus (#8031)

* [AFC] Implemented Wand Of Orcus

* removing unnecessary custom class

* using ZombieToken().putOntoBattlefield
This commit is contained in:
Joseph Zeffiro 2021-07-25 14:34:01 -04:00 committed by GitHub
parent 0e4b304778
commit cc1cc1293d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,97 @@
package mage.cards.w;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility;
import mage.abilities.common.DealsDamageToAPlayerAttachedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.token.ZombieToken;
/**
*
* @author zeffirojoe
*/
public final class WandOfOrcus extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombies you control");
static {
filter.add(SubType.ZOMBIE.getPredicate());
}
public WandOfOrcus(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[] { CardType.ARTIFACT }, "{2}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.EQUIPMENT);
// Whenever equipped creature attacks or blocks, it and Zombies you control gain
// deathtouch until end of turn.
Ability deathTouchAbility = new AttacksOrBlocksEnchantedTriggeredAbility(Zone.BATTLEFIELD,
new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), AttachmentType.EQUIPMENT,
Duration.EndOfTurn));
deathTouchAbility.addEffect(
new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn, filter));
this.addAbility(deathTouchAbility);
// Whenever equipped creature deals combat damage to a player, create that many
// 2/2 black Zombie creature tokens.
this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new WandOfOrcusZombieEffect(), "equipped",
false, true));
// Equip {3}
this.addAbility(new EquipAbility(Outcome.AddAbility, new ManaCostsImpl<>("{3}")));
}
private WandOfOrcus(final WandOfOrcus card) {
super(card);
}
@Override
public WandOfOrcus copy() {
return new WandOfOrcus(this);
}
}
class WandOfOrcusZombieEffect extends OneShotEffect {
public WandOfOrcusZombieEffect() {
super(Outcome.Benefit);
this.staticText = "create that many 2/2 black Zombie creature tokens";
}
public WandOfOrcusZombieEffect(final WandOfOrcusZombieEffect effect) {
super(effect);
}
@Override
public WandOfOrcusZombieEffect copy() {
return new WandOfOrcusZombieEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Integer damage = (Integer) this.getValue("damage");
if (damage != null) {
return new ZombieToken().putOntoBattlefield(damage, game, source, source.getControllerId());
}
return false;
}
}

View file

@ -249,6 +249,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet {
cards.add(new SetCardInfo("Viridian Longbow", 221, Rarity.COMMON, mage.cards.v.ViridianLongbow.class));
cards.add(new SetCardInfo("Vitu-Ghazi, the City-Tree", 272, Rarity.UNCOMMON, mage.cards.v.VituGhaziTheCityTree.class));
cards.add(new SetCardInfo("Wall of Omens", 77, Rarity.UNCOMMON, mage.cards.w.WallOfOmens.class));
cards.add(new SetCardInfo("Wand of Orcus", 28, Rarity.RARE, mage.cards.w.WandOfOrcus.class));
cards.add(new SetCardInfo("Warstorm Surge", 149, Rarity.RARE, mage.cards.w.WarstormSurge.class));
cards.add(new SetCardInfo("Wayfarer's Bauble", 222, Rarity.COMMON, mage.cards.w.WayfarersBauble.class));
cards.add(new SetCardInfo("Wild Growth", 174, Rarity.COMMON, mage.cards.w.WildGrowth.class));