forked from External/mage
[SPM] Implement Rent Is Due
This commit is contained in:
parent
e22055b697
commit
9e54ac477e
3 changed files with 60 additions and 1 deletions
52
Mage.Sets/src/mage/cards/r/RentIsDue.java
Normal file
52
Mage.Sets/src/mage/cards/r/RentIsDue.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.abilities.costs.common.TapTargetCost;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RentIsDue extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter
|
||||
= new FilterControlledPermanent("untapped creatures and/or Treasures you control");
|
||||
|
||||
static {
|
||||
filter.add(TappedPredicate.UNTAPPED);
|
||||
filter.add(Predicates.or(
|
||||
CardType.CREATURE.getPredicate(),
|
||||
SubType.TREASURE.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
public RentIsDue(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}");
|
||||
|
||||
// At the beginning of your end step, you may tap two untapped creatures and/or Treasures you control. If you do, draw a card. Otherwise, sacrifice this enchantment.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new DoIfCostPaid(
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
new SacrificeSourceEffect(), new TapTargetCost(2, filter)
|
||||
).setOtherwiseText("Otherwise")));
|
||||
}
|
||||
|
||||
private RentIsDue(final RentIsDue card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RentIsDue copy() {
|
||||
return new RentIsDue(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -103,6 +103,7 @@ public final class MarvelsSpiderMan extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Radioactive Spider", 213, Rarity.RARE, mage.cards.r.RadioactiveSpider.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Radioactive Spider", 285, Rarity.RARE, mage.cards.r.RadioactiveSpider.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Raging Goblinoids", 85, Rarity.UNCOMMON, mage.cards.r.RagingGoblinoids.class));
|
||||
cards.add(new SetCardInfo("Rent Is Due", 11, Rarity.RARE, mage.cards.r.RentIsDue.class));
|
||||
cards.add(new SetCardInfo("Rhino, Barreling Brute", 140, Rarity.UNCOMMON, mage.cards.r.RhinoBarrelingBrute.class));
|
||||
cards.add(new SetCardInfo("Risky Research", 62, Rarity.COMMON, mage.cards.r.RiskyResearch.class));
|
||||
cards.add(new SetCardInfo("Romantic Rendezvous", 86, Rarity.COMMON, mage.cards.r.RomanticRendezvous.class));
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public class DoIfCostPaid extends OneShotEffect {
|
|||
|
||||
protected final Effects executingEffects;
|
||||
protected final Effects otherwiseEffects;
|
||||
protected String otherwiseText = "If you don't";
|
||||
protected final Cost cost;
|
||||
private final String chooseUseText;
|
||||
private final boolean optional;
|
||||
|
|
@ -79,6 +80,11 @@ public class DoIfCostPaid extends OneShotEffect {
|
|||
return this;
|
||||
}
|
||||
|
||||
public DoIfCostPaid setOtherwiseText(String otherwiseText) {
|
||||
this.otherwiseText = otherwiseText;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow to add additional info in pay dialog, so user can split it in diff use cases to remember by right click
|
||||
* Example: ignore untap payment for already untapped permanent like Mana Vault
|
||||
|
|
@ -178,7 +184,7 @@ public class DoIfCostPaid extends OneShotEffect {
|
|||
return (optional ? "you may " : "")
|
||||
+ CardUtil.addCostVerb(cost.getText()) + "."
|
||||
+ (!executingEffects.isEmpty() ? " If you do, " + executingEffects.getText(mode) : "")
|
||||
+ (!otherwiseEffects.isEmpty() ? " If you don't, " + otherwiseEffects.getText(mode) : "");
|
||||
+ (!otherwiseEffects.isEmpty() ? " " + otherwiseText + ", " + otherwiseEffects.getText(mode) : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue