- Added Fearsome Temper

This commit is contained in:
swordshine
2014-02-09 10:36:23 +00:00
parent 72bb290215
commit 453bf76d63
40 changed files with 79 additions and 106 deletions

View File

@@ -78,6 +78,9 @@ public class PumpEffect extends SpellAbilityEffect {
game.getUpkeep().addUntil(sa.getActivatingPlayer(), untilEOT);
} else if (sa.hasParam("UntilHostLeavesPlay")) {
sa.getSourceCard().addLeavesPlayCommand(untilEOT);
} else if (sa.hasParam("UntilHostLeavesPlayOrEOT")) {
sa.getSourceCard().addLeavesPlayCommand(untilEOT);
game.getEndOfTurn().addUntil(untilEOT);
} else if (sa.hasParam("UntilLoseControlOfHost")) {
sa.getSourceCard().addLeavesPlayCommand(untilEOT);
sa.getSourceCard().addChangeControllerCommand(untilEOT);
@@ -200,12 +203,16 @@ public class PumpEffect extends SpellAbilityEffect {
tgts.addAll(tgtCards);
tgts.addAll(tgtPlayers);
if (sa.hasParam("DefinedChosenKW")) {
if (sa.getParam("DefinedChosenKW").equals("Type")) {
final String t = host.getChosenType();
for (int i = 0; i < keywords.size(); i++) {
keywords.set(i, keywords.get(i).replaceAll("ChosenType", t));
}
if (sa.hasParam("DefinedKW")) {
String defined = sa.getParam("DefinedKW");
String replaced = "";
if (defined.equals("ChosenType")) {
replaced = host.getChosenType();
} else if (defined.equals("CardUIDSource")) {
replaced = "CardUID_" + String.valueOf(host.getUniqueNumber());
}
for (int i = 0; i < keywords.size(); i++) {
keywords.set(i, keywords.get(i).replaceAll(defined, replaced));
}
}
if (sa.hasParam("DefinedLandwalk")) {

View File

@@ -49,7 +49,7 @@ public class SacrificeAllEffect extends SpellAbilityEffect {
if (sa.hasParam("Defined")) {
list = new ArrayList<Card>(AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa));
} else {
list = game.getCardsIn(ZoneType.Battlefield);
list = AbilityUtils.filterListByType(game.getCardsIn(ZoneType.Battlefield), valid, sa);
}
final boolean remSacrificed = sa.hasParam("RememberSacrificed");
@@ -57,8 +57,6 @@ public class SacrificeAllEffect extends SpellAbilityEffect {
card.clearRemembered();
}
list = AbilityUtils.filterListByType(list, valid, sa);
for (int i = 0; i < list.size(); i++) {
if (game.getAction().sacrifice(list.get(i), sa) && remSacrificed) {
card.addRemembered(list.get(i));

View File

@@ -1918,13 +1918,11 @@ public class Card extends GameEntity implements Comparable<Card> {
public final String keywordsToText(final ArrayList<String> keywords) {
final StringBuilder sb = new StringBuilder();
final StringBuilder sbLong = new StringBuilder();
final StringBuilder sbMana = new StringBuilder();
for (int i = 0; i < keywords.size(); i++) {
String keyword = keywords.get(i);
if (keyword.startsWith("Permanents don't untap during their controllers' untap steps")
|| keyword.startsWith("PreventAllDamageBy")
|| keyword.startsWith("CantBlock")
|| keyword.startsWith("CantEquip")
|| keyword.startsWith("SpellCantTarget")) {
continue;
@@ -2020,8 +2018,6 @@ public class Card extends GameEntity implements Comparable<Card> {
} else if (keyword.contains("At the beginning of your upkeep, ")
&& keyword.contains(" unless you pay")) {
sbLong.append(keyword.toString()).append("\r\n");
} else if (keyword.toString().contains("tap: add ")) {
sbMana.append(keyword.toString()).append("\r\n");
} else if (keyword.startsWith("Modular") || keyword.startsWith("Soulshift") || keyword.startsWith("Bloodthirst")
|| keyword.startsWith("ETBReplacement") || keyword.startsWith("MayEffectFromOpeningHand")) {
continue;
@@ -2070,6 +2066,14 @@ public class Card extends GameEntity implements Comparable<Card> {
sbLong.append(getTextForKwCantBeBlockedByAmount(keyword));
else
sbLong.append(getTextForKwCantBeBlockedByType(keyword));
} else if (keyword.startsWith("CantBlock")) {
sbLong.append(this.getName()).append(" can't block ");
if (keyword.contains("CardUID")) {
sbLong.append("CardID (").append(Integer.valueOf(keyword.split("CantBlockCardUID_")[1])).append(")");
} else {
final String[] k = keyword.split(":");
sbLong.append(k.length > 1 ? k[1] + ".\r\n" : "");
}
} else if (keyword.equals("Unblockable")) {
sbLong.append(this.getName()).append(" can't be blocked.\r\n");
}
@@ -2090,7 +2094,6 @@ public class Card extends GameEntity implements Comparable<Card> {
sbLong.append("\r\n");
}
sb.append(sbLong);
sb.append(sbMana);
return sb.toString();
}

View File

@@ -600,19 +600,6 @@ public class CombatUtil {
return false;
}
// if (blocker.hasStartOfKeyword("CARDNAME can't block ")) {
// for (final String kw : blocker.getKeyword()) {
// if (kw.startsWith("CARDNAME can't block ")) {
// final String unblockableCard = kw.substring(21);
// final int id = Integer.parseInt(unblockableCard.substring(unblockableCard.lastIndexOf("(") + 1,
// unblockableCard.length() - 1));
// if (attacker.getUniqueNumber() == id) {
// return false;
// }
// }
// }
// }
// rare case:
if (blocker.hasKeyword("Shadow")
&& blocker.hasKeyword("CARDNAME can block creatures with shadow as though they didn't have shadow.")) {
@@ -645,10 +632,18 @@ public class CombatUtil {
if (blocker.hasStartOfKeyword("CantBlock")) {
final int keywordPosition = blocker.getKeywordPosition("CantBlock");
final String parse = blocker.getKeyword().get(keywordPosition).toString();
final String[] k = parse.split(" ", 2);
final String[] restrictions = k[1].split(",");
if (attacker.isValid(restrictions, blocker.getController(), blocker)) {
return false;
if (parse.startsWith("CantBlockCardUID")) {
final String[] k = parse.split("_", 2);
if (attacker.getUniqueNumber() == Integer.parseInt(k[1])) {
return false;
}
} else {
final String[] parse0 = parse.split(":");
final String[] k = parse0[0].split(" ", 2);
final String[] restrictions = k[1].split(",");
if (attacker.isValid(restrictions, blocker.getController(), blocker)) {
return false;
}
}
}