- Added Jeweled Amulet

This commit is contained in:
swordshine
2014-02-18 02:45:28 +00:00
parent b69228e28b
commit 07915701c3
8 changed files with 34 additions and 6 deletions

View File

@@ -1273,6 +1273,11 @@ public class AbilityUtils {
}
}
if (sa.hasParam("RememberCostMana")) {
host.clearRemembered();
host.getRemembered().addAll(sa.getPayingMana());
}
if (sa.hasParam("RememberCostCards")) {
if (sa.getParam("Cost").contains("Exile")) {
final List<Card> paidListExiled = sa.getPaidList("Exiled");

View File

@@ -9,12 +9,15 @@ import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.card.CounterType;
import forge.game.mana.Mana;
import forge.game.player.Player;
import forge.game.spellability.AbilityManaPart;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions;
import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Iterables;
import java.util.List;
public class ManaEffect extends SpellAbilityEffect {
@@ -125,6 +128,13 @@ public class ManaEffect extends SpellAbilityEffect {
}
}
abMana.setExpressChoice(sb.toString().trim());
} else if (type.equals("LastNotedType")) {
Mana manaType = (Mana) Iterables.getFirst(card.getRemembered(), null);
if (manaType == null) {
return;
}
String cs = manaType.toString();
abMana.setExpressChoice(cs);
}
if (abMana.getExpressChoice().isEmpty()) {

View File

@@ -171,7 +171,7 @@ public class ManaPool implements Iterable<Mana> {
paidAbs.add(saPayment); // assumes some part on the mana produced by the ability will get used
for (final Mana mana : abManaPart.getLastManaProduced()) {
if( tryPayCostWithMana(saPaidFor, manaCost, mana) )
saPaidFor.getPayingMana().add(mana);
saPaidFor.getPayingMana().add(0, mana);
}
}
@@ -196,7 +196,7 @@ public class ManaPool implements Iterable<Mana> {
boolean result = manaFound != null && tryPayCostWithMana(saPaidFor, manaCost, manaFound);
if(result)
saPaidFor.getPayingMana().add(manaFound);
saPaidFor.getPayingMana().add(0, manaFound);
return result;
}

View File

@@ -1628,12 +1628,15 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
// Return whether this spell tracks what color mana is spent to cast it for the sake of the effect
public boolean tracksManaSpent() {
if (this.hostCard == null) { return false; }
if (!this.isSpell()) { return false; }
if (this.hostCard.hasKeyword("Sunburst")) {
return true;
}
if (this.hostCard.getRules().getOracleText().contains("was spent to cast")) {
String text = this.hostCard.getRules().getOracleText();
if (this.isSpell() && text.contains("was spent to cast")) {
return true;
}
if (this.isAbility() && text.contains("mana spent to pay")) {
return true;
}
return false;