add Crown of Empires, Scepter of Empires and Throne of Empires (from Magic 2012)

This commit is contained in:
slapshot5
2011-10-16 18:54:38 +00:00
parent 120e81ff16
commit a2be681878
7 changed files with 103 additions and 0 deletions

View File

@@ -3167,6 +3167,17 @@ public class CardFactoryUtil {
return doXMath(Integer.parseInt(sq[2]), m, c); // not Main Phase
}
}
//Count$M12Empires.<numIf>.<numIfNot>
if (sq[0].contains("AllM12Empires")) {
boolean has = AllZoneUtil.isCardInPlay("Crown of Empires", c.getController());
has &= AllZoneUtil.isCardInPlay("Scepter of Empires", c.getController());
has &= AllZoneUtil.isCardInPlay("Throne of Empires", c.getController());
if (has)
return doXMath(Integer.parseInt(sq[1]), m, c);
else
return doXMath(Integer.parseInt(sq[2]), m, c);
}
// Count$ThisTurnEntered <ZoneDestination> <ZoneOrigin> <Valid>
// or

View File

@@ -82,6 +82,11 @@ public class SpellAbility_Condition extends SpellAbility_Variables {
setPhases(phases);
}
if(params.containsKey("ConditionAllM12Empires"))
setAllM12Empires(true);
if(params.containsKey("ConditionNotAllM12Empires"))
setNotAllM12Empires(true);
if (params.containsKey("ConditionCardsInHand")) {
setActivateCardsInHand(Integer.parseInt(params.get("ConditionCardsInHand")));
@@ -187,6 +192,21 @@ public class SpellAbility_Condition extends SpellAbility_Variables {
return false;
}
}
if(allM12Empires) {
Player p = sa.getSourceCard().getController();
boolean has = AllZoneUtil.isCardInPlay("Crown of Empires", p);
has &= AllZoneUtil.isCardInPlay("Scepter of Empires", p);
has &= AllZoneUtil.isCardInPlay("Throne of Empires", p);
if(!has) return false;
}
if(notAllM12Empires) {
Player p = sa.getSourceCard().getController();
boolean has = AllZoneUtil.isCardInPlay("Crown of Empires", p);
has &= AllZoneUtil.isCardInPlay("Scepter of Empires", p);
has &= AllZoneUtil.isCardInPlay("Throne of Empires", p);
if(has) return false;
}
if (nCardsInHand != -1) {
// Can handle Library of Alexandria, or Hellbent

View File

@@ -58,6 +58,45 @@ public class SpellAbility_Variables {
protected boolean pwAbility = false;
protected boolean allM12Empires = false;
protected boolean notAllM12Empires = false;
/**
* <p>Setter for the field <code>notAllM12Empires</code>.</p>
*
* @param b a boolean
*/
public void setNotAllM12Empires(boolean b) {
notAllM12Empires = b;
}
/**
* <p>Getter for the field <code>notAllM12Empires</code>.</p>
*
* @return a boolean
*/
public boolean getNotAllM12Empires() {
return notAllM12Empires;
}
/**
* <p>Setter for the field <code>allM12Empires</code>.</p>
*
* @param b a boolean
*/
public void setAllM12Empires(boolean b) {
allM12Empires = b;
}
/**
* <p>Getter for the field <code>allM12Empires</code>.</p>
*
* @return a boolean
*/
public boolean getAllM12Empires() {
return allM12Empires;
}
/**
* <p>Setter for the field <code>manaSpent</code>.</p>
*