mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
fix cost reduction not controller specific for [MH3] It That Heralds the End and [MH3] Ral, Leyline Prodify
fix #12503
This commit is contained in:
parent
073637257f
commit
64e08b49b1
7 changed files with 93 additions and 40 deletions
|
|
@ -1,8 +1,5 @@
|
|||
package mage.abilities.effects.common.cost;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
|
|
@ -16,11 +13,18 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Reduce cost of spells from any controller.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
|
||||
|
||||
private static final FilterCard defaultFilter = new FilterCard("Spells");
|
||||
private final FilterCard filter;
|
||||
private final int amount;
|
||||
private final boolean upTo;
|
||||
|
|
@ -28,7 +32,7 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
|
|||
private UUID controllerId;
|
||||
|
||||
public SpellsCostReductionAllEffect(int amount) {
|
||||
this(new FilterCard("Spells"), amount);
|
||||
this(defaultFilter, amount);
|
||||
}
|
||||
|
||||
public SpellsCostReductionAllEffect(FilterCard filter, int amount) {
|
||||
|
|
@ -39,7 +43,10 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
|
|||
this(filter, amount, upTo, false);
|
||||
}
|
||||
|
||||
public SpellsCostReductionAllEffect(FilterCard filter, int amount, boolean upTo, boolean onlyControlled) {
|
||||
/**
|
||||
* Note to devs: If you need onlyControlled at true, use SpellsCostReductionControllerEffect instead.
|
||||
*/
|
||||
protected SpellsCostReductionAllEffect(FilterCard filter, int amount, boolean upTo, boolean onlyControlled) {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
this.filter = filter;
|
||||
this.amount = amount;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package mage.abilities.effects.common.cost;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -20,7 +18,12 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Reduces cost of spell for the controller of the effect.
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class SpellsCostReductionControllerEffect extends CostModificationEffectImpl {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue