mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 05:52:06 -08:00
* Fixed alternate casting costs of shoal spells (e.g. Blazing Shoal).
This commit is contained in:
parent
22fccea168
commit
3c7b414ee6
8 changed files with 49 additions and 85 deletions
|
|
@ -146,7 +146,9 @@ public class AlternativeCostSourceAbility extends StaticAbility<AlternativeCostS
|
|||
if (condition != null) {
|
||||
sb.append(condition.toString());
|
||||
sb.append(", rather than pay {source}'s mana cost, ");
|
||||
}
|
||||
} else {
|
||||
sb.append("You may ");
|
||||
}
|
||||
int numberCosts = 0;
|
||||
String remarkText = "";
|
||||
for (AlternativeCost2 alternativeCost: alternateCosts) {
|
||||
|
|
|
|||
|
|
@ -27,11 +27,8 @@
|
|||
*/
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import java.util.List;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.AlternativeCost;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.common.ExileFromHandCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -51,18 +48,13 @@ public class ExileFromHandCostCardConvertedMana implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
for (AlternativeCost aCost: (List<AlternativeCost>) sourceAbility.getAlternativeCosts()) {
|
||||
if (aCost.isPaid()) {
|
||||
for (int x=0; x < ((Costs) aCost).size(); x++) {
|
||||
Cost cost = (Cost) ((Costs) aCost).get(x);
|
||||
if (cost instanceof ExileFromHandCost) {
|
||||
int xValue = 0;
|
||||
for (Card card : ((ExileFromHandCost) cost).getCards()) {
|
||||
xValue += card.getManaCost().convertedManaCost();
|
||||
}
|
||||
return xValue;
|
||||
}
|
||||
for (Cost cost: sourceAbility.getCosts()) {
|
||||
if (cost.isPaid() && cost instanceof ExileFromHandCost) {
|
||||
int xValue = 0;
|
||||
for (Card card : ((ExileFromHandCost) cost).getCards()) {
|
||||
xValue += card.getManaCost().convertedManaCost();
|
||||
}
|
||||
return xValue;
|
||||
}
|
||||
}
|
||||
return sourceAbility.getManaCostsToPay().getX();
|
||||
|
|
@ -82,4 +74,4 @@ public class ExileFromHandCostCardConvertedMana implements DynamicValue {
|
|||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,20 +27,19 @@
|
|||
*/
|
||||
package mage.abilities.effects.common.continious;
|
||||
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
|
|
@ -62,6 +61,9 @@ public class BoostTargetEffect extends ContinuousEffectImpl<BoostTargetEffect> {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param power
|
||||
* @param toughness
|
||||
* @param duration
|
||||
* @param lockedIn if true, power and toughness will be calculated only once, when the ability resolves
|
||||
*/
|
||||
public BoostTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration, boolean lockedIn) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue