[ONE] Implement Bladehold War-Whip (#10022)

This commit is contained in:
Sean Walsh 2023-02-20 21:10:04 -06:00 committed by GitHub
parent d22930cbb0
commit 4f82cc0287
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,56 @@
package mage.cards.b;
import java.util.UUID;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.ForMirrodinAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Outcome;
/**
*
* @author @stwalsh4118
*/
public final class BladeholdWarWhip extends CardImpl {
public BladeholdWarWhip(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{R}{W}");
this.subtype.add(SubType.EQUIPMENT);
// For Mirrodin!
this.addAbility(new ForMirrodinAbility());
// Equip abilities you activate of other Equipment cost {1} less to activate.
Ability ability = new SimpleStaticAbility(
new AbilitiesCostReductionControllerEffect(
EquipAbility.class, "Equip", 1, true
).setText("Equip abilities you activate of other Equipment cost {1} less to activate."));
this.addAbility(ability);
// Equipped creature has double strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DoubleStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)));
// Equip {3}{R}{W}
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{3}{R}{W}"), false));
}
private BladeholdWarWhip(final BladeholdWarWhip card) {
super(card);
}
@Override
public BladeholdWarWhip copy() {
return new BladeholdWarWhip(this);
}
}

View file

@ -43,6 +43,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Black Sun's Twilight", 84, Rarity.RARE, mage.cards.b.BlackSunsTwilight.class)); cards.add(new SetCardInfo("Black Sun's Twilight", 84, Rarity.RARE, mage.cards.b.BlackSunsTwilight.class));
cards.add(new SetCardInfo("Blackcleave Cliffs", 248, Rarity.RARE, mage.cards.b.BlackcleaveCliffs.class)); cards.add(new SetCardInfo("Blackcleave Cliffs", 248, Rarity.RARE, mage.cards.b.BlackcleaveCliffs.class));
cards.add(new SetCardInfo("Bladed Ambassador", 5, Rarity.UNCOMMON, mage.cards.b.BladedAmbassador.class)); cards.add(new SetCardInfo("Bladed Ambassador", 5, Rarity.UNCOMMON, mage.cards.b.BladedAmbassador.class));
cards.add(new SetCardInfo("Bladehold War-Whip", 197, Rarity.UNCOMMON, mage.cards.b.BladeholdWarWhip.class));
cards.add(new SetCardInfo("Blazing Crescendo", 123, Rarity.COMMON, mage.cards.b.BlazingCrescendo.class)); cards.add(new SetCardInfo("Blazing Crescendo", 123, Rarity.COMMON, mage.cards.b.BlazingCrescendo.class));
cards.add(new SetCardInfo("Blightbelly Rat", 85, Rarity.COMMON, mage.cards.b.BlightbellyRat.class)); cards.add(new SetCardInfo("Blightbelly Rat", 85, Rarity.COMMON, mage.cards.b.BlightbellyRat.class));
cards.add(new SetCardInfo("Bloated Contaminator", 159, Rarity.RARE, mage.cards.b.BloatedContaminator.class)); cards.add(new SetCardInfo("Bloated Contaminator", 159, Rarity.RARE, mage.cards.b.BloatedContaminator.class));

View file

@ -15,22 +15,29 @@ public class AbilitiesCostReductionControllerEffect extends CostModificationEffe
private final Class<? extends ActivatedAbility> activatedAbility; private final Class<? extends ActivatedAbility> activatedAbility;
private final int amount; private final int amount;
private final boolean excludeSource;
public AbilitiesCostReductionControllerEffect(Class<? extends ActivatedAbility> activatedAbility, String activatedAbilityName) { public AbilitiesCostReductionControllerEffect(Class<? extends ActivatedAbility> activatedAbility, String activatedAbilityName) {
this(activatedAbility, activatedAbilityName, 1); this(activatedAbility, activatedAbilityName, 1);
} }
public AbilitiesCostReductionControllerEffect(Class<? extends ActivatedAbility> activatedAbility, String activatedAbilityName, int amount) { public AbilitiesCostReductionControllerEffect(Class<? extends ActivatedAbility> activatedAbility, String activatedAbilityName, int amount) {
this(activatedAbility, activatedAbilityName, 1, false);
}
public AbilitiesCostReductionControllerEffect(Class<? extends ActivatedAbility> activatedAbility, String activatedAbilityName, int amount, boolean excludeSource) {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
this.activatedAbility = activatedAbility; this.activatedAbility = activatedAbility;
staticText = activatedAbilityName + " costs you pay cost {" + amount + "} less"; staticText = activatedAbilityName + " costs you pay cost {" + amount + "} less";
this.amount = amount; this.amount = amount;
this.excludeSource = excludeSource;
} }
public AbilitiesCostReductionControllerEffect(AbilitiesCostReductionControllerEffect effect) { public AbilitiesCostReductionControllerEffect(AbilitiesCostReductionControllerEffect effect) {
super(effect); super(effect);
this.activatedAbility = effect.activatedAbility; this.activatedAbility = effect.activatedAbility;
this.amount = effect.amount; this.amount = effect.amount;
this.excludeSource = effect.excludeSource;
} }
@Override @Override
@ -40,6 +47,11 @@ public class AbilitiesCostReductionControllerEffect extends CostModificationEffe
@Override @Override
public boolean apply(Game game, Ability source, Ability abilityToModify) { public boolean apply(Game game, Ability source, Ability abilityToModify) {
if (excludeSource && abilityToModify.getSourceId().equals(source.getSourceId())) {
return false;
}
CardUtil.reduceCost(abilityToModify, amount); CardUtil.reduceCost(abilityToModify, amount);
return true; return true;
} }