mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Minor change.
This commit is contained in:
parent
87e953f6ba
commit
1c9e7d653d
1 changed files with 5 additions and 9 deletions
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.effects.common.cost;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
@ -39,19 +38,17 @@ import mage.constants.Outcome;
|
|||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class SpellCostReductionSourceEffect extends CostModificationEffectImpl {
|
||||
|
||||
private final int amount;
|
||||
private ManaCosts<ManaCost> manaCostsToReduce = null;
|
||||
private final Condition condition;
|
||||
|
||||
public SpellCostReductionSourceEffect(ManaCosts<ManaCost> manaCostsToReduce, Condition condition) {
|
||||
public SpellCostReductionSourceEffect(ManaCosts<ManaCost> manaCostsToReduce, Condition condition) {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
this.amount = 0;
|
||||
this.manaCostsToReduce = manaCostsToReduce;
|
||||
|
@ -59,14 +56,13 @@ public class SpellCostReductionSourceEffect extends CostModificationEffectImpl {
|
|||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("{this} costs ");
|
||||
for (String manaSymbol :manaCostsToReduce.getSymbols()) {
|
||||
for (String manaSymbol : manaCostsToReduce.getSymbols()) {
|
||||
sb.append(manaSymbol);
|
||||
}
|
||||
sb.append(" less to if ").append(this.condition.toString());
|
||||
this.staticText = sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public SpellCostReductionSourceEffect(int amount, Condition condition) {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
this.amount = amount;
|
||||
|
@ -76,7 +72,7 @@ public class SpellCostReductionSourceEffect extends CostModificationEffectImpl {
|
|||
this.staticText = sb.toString();
|
||||
}
|
||||
|
||||
protected SpellCostReductionSourceEffect(SpellCostReductionSourceEffect effect) {
|
||||
protected SpellCostReductionSourceEffect(final SpellCostReductionSourceEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
this.manaCostsToReduce = effect.manaCostsToReduce;
|
||||
|
@ -85,7 +81,7 @@ public class SpellCostReductionSourceEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
if (manaCostsToReduce != null){
|
||||
if (manaCostsToReduce != null) {
|
||||
CardUtil.adjustCost((SpellAbility) abilityToModify, manaCostsToReduce, false);
|
||||
} else {
|
||||
CardUtil.reduceCost(abilityToModify, this.amount);
|
||||
|
@ -95,7 +91,7 @@ public class SpellCostReductionSourceEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility)) {
|
||||
if (abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility)) {
|
||||
return condition.apply(game, source);
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue