[MOC] Implement Conclave Sledge-Captain

This commit is contained in:
theelk801 2023-04-17 17:49:37 -04:00
parent 25636565a9
commit 302e445b90
3 changed files with 87 additions and 1 deletions

View file

@ -0,0 +1,68 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.dynamicvalue.common.SavedDamageValue;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.BackupAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ConclaveSledgeCaptain extends CardImpl {
public ConclaveSledgeCaptain(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}");
this.subtype.add(SubType.ELEPHANT);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Backup 1
BackupAbility backupAbility1 = new BackupAbility(this, 1);
this.addAbility(backupAbility1);
// Backup 1
BackupAbility backupAbility2 = new BackupAbility(this, 1);
this.addAbility(backupAbility2);
// Backup 1
BackupAbility backupAbility3 = new BackupAbility(this, 1);
this.addAbility(backupAbility3);
// Trample
backupAbility1.addAbility(TrampleAbility.getInstance());
backupAbility2.addAbility(TrampleAbility.getInstance(), true);
backupAbility3.addAbility(TrampleAbility.getInstance(), true);
// Whenever this creature deals combat damage to a player, put that many +1/+1 counters on it.
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(
new AddCountersSourceEffect(
CounterType.P1P1.createInstance(),
SavedDamageValue.MANY, false
).setText("put that many +1/+1 counters on it"), false
).setTriggerPhrase("Whenever this creature deals combat damage to a player, ");
backupAbility1.addAbility(ability);
backupAbility2.addAbility(ability, true);
backupAbility3.addAbility(ability, true);
}
private ConclaveSledgeCaptain(final ConclaveSledgeCaptain card) {
super(card);
}
@Override
public ConclaveSledgeCaptain copy() {
return new ConclaveSledgeCaptain(this);
}
}

View file

@ -72,6 +72,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet {
cards.add(new SetCardInfo("Command Tower", 396, Rarity.COMMON, mage.cards.c.CommandTower.class));
cards.add(new SetCardInfo("Commander's Sphere", 352, Rarity.COMMON, mage.cards.c.CommandersSphere.class));
cards.add(new SetCardInfo("Conclave Mentor", 320, Rarity.UNCOMMON, mage.cards.c.ConclaveMentor.class));
cards.add(new SetCardInfo("Conclave Sledge-Captain", 36, Rarity.RARE, mage.cards.c.ConclaveSledgeCaptain.class));
cards.add(new SetCardInfo("Conclave Tribunal", 178, Rarity.UNCOMMON, mage.cards.c.ConclaveTribunal.class));
cards.add(new SetCardInfo("Conjurer's Mantle", 12, Rarity.RARE, mage.cards.c.ConjurersMantle.class));
cards.add(new SetCardInfo("Constable of the Realm", 179, Rarity.UNCOMMON, mage.cards.c.ConstableOfTheRealm.class));

View file

@ -11,6 +11,7 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import mage.watchers.Watcher;
import java.util.ArrayList;
@ -57,11 +58,23 @@ public class BackupAbility extends EntersBattlefieldTriggeredAbility {
}
public void addAbility(Ability ability, Watcher watcher) {
addAbility(ability, watcher, false);
}
public void addAbility(Ability ability, boolean dontAddToCard) {
addAbility(ability, null, dontAddToCard);
}
public void addAbility(Ability ability, Watcher watcher, boolean dontAddToCard) {
if (watcher != null) {
ability.addWatcher(watcher);
}
card.addAbility(ability);
if (!dontAddToCard) {
card.addAbility(ability);
}
abilitiesToAdd.add(ability);
CardUtil.castStream(this.getEffects().stream(), BackupEffect.class)
.forEach(backupEffect -> backupEffect.addAbility(ability));
}
public boolean hasAbilities() {
@ -86,6 +99,10 @@ class BackupEffect extends OneShotEffect {
this.abilitiesToAdd.addAll(effect.abilitiesToAdd);
}
void addAbility(Ability ability) {
this.abilitiesToAdd.add(ability);
}
@Override
public BackupEffect copy() {
return new BackupEffect(this);