- Remove remainder of hardcoded Koth Emblem code

This commit is contained in:
Sol
2011-10-29 02:49:49 +00:00
parent 55eb2c0c4e
commit ae32712cf1
3 changed files with 0 additions and 122 deletions

View File

@@ -1223,93 +1223,6 @@ public final class GameActionUtil {
} // execute()
};
/** Constant <code>Koth_Emblem</code>. */
public static Command Koth_Emblem = new Command() {
private static final long serialVersionUID = -3233715310427996429L;
CardList gloriousAnthemList = new CardList();
public void execute() {
CardList list = gloriousAnthemList;
Card crd;
// reset all cards in list - aka "old" cards
for (int i = 0; i < list.size(); i++) {
crd = list.get(i);
SpellAbility[] sas = crd.getSpellAbility();
for (int j = 0; j < sas.length; j++) {
if (sas[j].isKothThirdAbility()) {
crd.removeSpellAbility(sas[j]);
}
}
}
CardList emblem = AllZoneUtil.getCardsIn(Zone.Battlefield);
emblem = emblem.filter(new CardListFilter() {
public boolean addCard(final Card c) {
return c.isEmblem()
&& c.hasKeyword("Mountains you control have 'tap: This land deals 1 damage to target creature or player.'");
}
});
for (int i = 0; i < emblem.size(); i++) {
CardList mountains = emblem.get(i).getController().getCardsIn(Zone.Battlefield);
mountains = mountains.filter(new CardListFilter() {
public boolean addCard(final Card crd) {
return crd.isType("Mountain");
}
});
for (int j = 0; j < mountains.size(); j++) {
final Card c = mountains.get(j);
boolean hasAbility = false;
SpellAbility[] sas = c.getSpellAbility();
for (SpellAbility sa : sas) {
if (sa.isKothThirdAbility()) {
hasAbility = true;
}
}
if (!hasAbility) {
Cost abCost = new Cost("T", c.getName(), true);
Target target = new Target(c, "TgtCP");
final Ability_Activated ability = new Ability_Activated(c, abCost, target) {
private static final long serialVersionUID = -7560349014757367722L;
public void chooseTargetAI() {
CardList list = CardFactoryUtil.AI_getHumanCreature(1, c, true);
list.shuffle();
if (list.isEmpty() || AllZone.getHumanPlayer().getLife() < 5) {
setTargetPlayer(AllZone.getHumanPlayer());
} else {
setTargetCard(list.get(0));
}
}
public void resolve() {
if (getTargetCard() != null) {
if (AllZoneUtil.isCardInPlay(getTargetCard())
&& CardFactoryUtil.canTarget(c, getTargetCard())) {
getTargetCard().addDamage(1, c);
}
} else {
getTargetPlayer().addDamage(1, c);
}
} // resolve()
}; // SpellAbility
ability.setKothThirdAbility(true);
ability.setDescription(abCost + "This land deals 1 damage to target creature or player.");
c.addSpellAbility(ability);
gloriousAnthemList.add(c);
}
}
}
}
};
// Special Conditions
/**
* <p>
@@ -2010,7 +1923,6 @@ public final class GameActionUtil {
commands.put("Elspeth_Emblem", Elspeth_Emblem);
commands.put("Homarid", Homarid);
commands.put("Koth_Emblem", Koth_Emblem);
commands.put("Liu_Bei", Liu_Bei);
commands.put("Muraganda_Petroglyphs", Muraganda_Petroglyphs);

View File

@@ -68,7 +68,6 @@ public abstract class SpellAbility {
private boolean replicate = false;
private boolean xCost = false;
private boolean kickerAbility = false;
private boolean kothThirdAbility = false;
private boolean cycling = false;
private boolean isCharm = false;
private boolean isDelve = false;
@@ -1402,29 +1401,6 @@ public abstract class SpellAbility {
return clone;
}
/**
* <p>
* Setter for the field <code>kothThirdAbility</code>.
* </p>
*
* @param kothThirdAbility
* a boolean.
*/
public void setKothThirdAbility(final boolean kothThirdAbility) {
this.kothThirdAbility = kothThirdAbility;
}
/**
* <p>
* isKothThirdAbility.
* </p>
*
* @return a boolean.
*/
public boolean isKothThirdAbility() {
return kothThirdAbility;
}
/**
* <p>
* Setter for the field <code>trigger</code>.

View File

@@ -711,11 +711,6 @@ public class TriggerHandler {
return sa[0].isKickerAbility();
}
@Override
public boolean isKothThirdAbility() {
return sa[0].isKothThirdAbility();
}
@Override
public boolean isMultiKicker() {
return sa[0].isMultiKicker();
@@ -837,11 +832,6 @@ public class TriggerHandler {
sa[0].setKickerAbility(kab);
}
@Override
public void setKothThirdAbility(final boolean kothThirdAbility) {
sa[0].setKothThirdAbility(kothThirdAbility);
}
@Override
public void setManaCost(final String cost) {
sa[0].setManaCost(cost);