- Adding some code to support for Falkenrath Gorger

This commit is contained in:
Sol
2016-04-12 14:34:00 +00:00
parent 4401041c5a
commit 4c0c085e1f
3 changed files with 15 additions and 3 deletions

View File

@@ -684,7 +684,7 @@ public class AbilityUtils {
* a card type
* @param sa
* a SpellAbility
* @return a {@link forge.game.CardCollectionView} object.
* @return a {@link forge.game.card.CardCollectionView} object.
*/
public static CardCollectionView filterListByType(final CardCollectionView list, String type, final SpellAbility sa) {
if (type == null) {
@@ -1099,6 +1099,7 @@ public class AbilityUtils {
players.add(sa.getActivatingPlayer());
}
else if (defined.equals("Opponent")) {
//players.addAll(sa.getActivatingPlayer().getOpponents());
players.add(sa.getActivatingPlayer().getOpponent());
}
else {

View File

@@ -217,7 +217,13 @@ public class PlayEffect extends SpellAbilityEffect {
if (noManaCost) {
tgtSA = tgtSA.copyWithNoManaCost();
} else if (sa.hasParam("PlayMadness")) {
final Cost abCost = new Cost(sa.getParam("PlayMadness"), false);
Cost abCost;
if ("ManaCost".equals(sa.getParam("PlayMadness"))) {
abCost = new Cost(source.getManaCost(), false);
} else {
abCost = new Cost(sa.getParam("PlayMadness"), false);
}
tgtSA = tgtSA.copyWithDefinedCost(abCost);
tgtSA.getHostCard().setMadness(true);
}

View File

@@ -1294,7 +1294,12 @@ public class Card extends GameEntity implements Comparable<Card> {
sbLong.append(keyword.replace(":", " ")).append("\r\n");
} else if (keyword.startsWith("Madness")) {
String[] parts = keyword.split(":");
// If no colon exists in Madness keyword, it must have been granted and assumed the cost from host
if (parts.length < 2) {
sbLong.append(parts[0]).append(" ").append(this.getManaCost()).append("\r\n");
} else {
sbLong.append(parts[0]).append(" ").append(ManaCostParser.parse(parts[1])).append("\r\n");
}
} else if (keyword.startsWith("Devour")) {
final String[] parts = keyword.split(":");
final String extra = parts.length > 2 ? parts[2] : "";