- Converted Sarpadian Empires, Vol. VII

This commit is contained in:
moomarc
2012-12-06 06:40:23 +00:00
parent f8c58227c8
commit aae163f7a3
5 changed files with 68 additions and 113 deletions

View File

@@ -2,6 +2,14 @@ Name:Sarpadian Empires, Vol. VII
ManaCost:3 ManaCost:3
Types:Artifact Types:Artifact
Text:no text Text:no text
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseColor | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInGame
# Went for MostProminentInGame logic to give the AI a possible out for situations where it might be locked down based on its colors
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Citizen | TokenTypes$ Creature,Citizen | TokenOwner$ You | TokenColors$ white | TokenPower$ 1 | TokenToughness$ 1 | ConditionChosenColor$ white | SubAbility$ ChoseBlue | SpellDescription$ Put a 1/1 creature token of the chosen color and type onto the battlefield.
SVar:ChoseBlue:DB$ Token | TokenAmount$ 1 | TokenName$ Camarid | TokenTypes$ Creature,Camarid | TokenOwner$ You | TokenColors$ blue | TokenPower$ 1 | TokenToughness$ 1 | ConditionChosenColor$ blue | SubAbility$ ChoseBlack
SVar:ChoseBlack:DB$ Token | TokenAmount$ 1 | TokenName$ Thrull | TokenTypes$ Creature,Thrull | TokenOwner$ You | TokenColors$ black | TokenPower$ 1 | TokenToughness$ 1 | ConditionChosenColor$ black | SubAbility$ ChoseRed
SVar:ChoseRed:DB$ Token | TokenAmount$ 1 | TokenName$ Goblin | TokenTypes$ Creature,Goblin | TokenOwner$ You | TokenColors$ red | TokenPower$ 1 | TokenToughness$ 1 | ConditionChosenColor$ red | SubAbility$ ChoseGreen
SVar:ChoseGreen:DB$ Token | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ green | TokenPower$ 1 | TokenToughness$ 1 | ConditionChosenColor$ green
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sarpadian_empires_vol_vii.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/sarpadian_empires_vol_vii.jpg
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/263.jpg SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/263.jpg

View File

@@ -39,118 +39,8 @@ class CardFactoryArtifacts {
*/ */
public static void buildCard(final Card card, final String cardName) { public static void buildCard(final Card card, final String cardName) {
if (cardName.equals("Sarpadian Empires, Vol. VII")) {
final String[] choices = { "Citizen", "Camarid", "Thrull", "Goblin", "Saproling" };
final Player player = card.getController();
class SarpadianEmpiresVolVIIETB extends Ability {
public SarpadianEmpiresVolVIIETB(final Card c, final String s) {
super(c, s);
}
@Override
public void resolve() {
String type = "";
String imageName = "";
String color = "";
if (player.isComputer()) {
type = "Thrull";
imageName = "B 1 1 Thrull";
color = "B";
} else if (player.isHuman()) {
final Object q = GuiChoose.oneOrNone("Select type of creature", choices);
if (q != null) {
if (q.equals("Citizen")) {
type = "Citizen";
imageName = "W 1 1 Citizen";
color = "W";
} else if (q.equals("Camarid")) {
type = "Camarid";
imageName = "U 1 1 Camarid";
color = "U";
} else if (q.equals("Thrull")) {
type = "Thrull";
imageName = "B 1 1 Thrull";
color = "B";
} else if (q.equals("Goblin")) {
type = "Goblin";
imageName = "R 1 1 Goblin";
color = "R";
} else if (q.equals("Saproling")) {
type = "Saproling";
imageName = "G 1 1 Saproling";
color = "G";
}
}
}
getSourceCard().setChosenType(type);
final String t = type;
final String in = imageName;
final String col = color;
// card.setChosenType(input[0]);
class AbilitySarpadianEmpiresVolVII extends AbilityActivated {
private static final long serialVersionUID = -2114111483117171609L;
public AbilitySarpadianEmpiresVolVII(Card ca, Cost co, Target t) {
super(ca, co, t);
}
@Override
public AbilityActivated getCopy() {
AbilityActivated res = new AbilitySarpadianEmpiresVolVII(getSourceCard(),
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
CardFactoryUtil.copySpellAbility(this, res);
return res;
}
@Override
public void resolve() {
CardFactoryUtil.makeToken(t, in, getSourceCard().getController(), col, new String[] { "Creature", t },
1, 1, new String[] { "" });
}
}
final Cost a1Cost = new Cost(getSourceCard(), "3 T", true);
final AbilityActivated a1 = new AbilitySarpadianEmpiresVolVII(card, a1Cost, null);
final StringBuilder sb = new StringBuilder();
sb.append(card.getName()).append(" - ").append(card.getController());
sb.append(" puts a 1/1 ").append(t).append(" token onto the battlefield");
a1.setStackDescription(sb.toString());
card.addSpellAbility(a1);
}
} // ability
final SpellAbility ability = new SarpadianEmpiresVolVIIETB(card, "0");
final Command intoPlay = new Command() {
private static final long serialVersionUID = 7202704600935499188L;
@Override
public void execute() {
final StringBuilder sb = new StringBuilder();
sb.append("As Sarpadian Empires, Vol. VII enters the battlefield, ");
sb.append("choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.");
ability.setStackDescription(sb.toString());
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(ability);
}
};
final StringBuilder sb = new StringBuilder();
sb.append("As Sarpadian Empires, Vol. VII enters the battlefield, ");
sb.append("choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.\r\n");
sb.append("3, Tap: Put a 1/1 creature token of the chosen color and type onto the battlefield.\r\n");
sb.append(card.getText()); // In the slight chance that there may be
// a need to add a note to this card.
card.setText(sb.toString());
card.addComesIntoPlayCommand(intoPlay);
} // *************** END ************ END **************************
// *************** START *********** START ************************** // *************** START *********** START **************************
else if (cardName.equals("Grindstone")) { if (cardName.equals("Grindstone")) {
class AbilityGrindstone extends AbilityActivated { class AbilityGrindstone extends AbilityActivated {
public AbilityGrindstone(final Card ca, final Cost co, final Target t) { public AbilityGrindstone(final Card ca, final Cost co, final Target t) {

View File

@@ -114,6 +114,10 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
this.setActivateCardsInHand(Integer.parseInt(params.get("ConditionCardsInHand"))); this.setActivateCardsInHand(Integer.parseInt(params.get("ConditionCardsInHand")));
} }
if (params.containsKey("ConditionChosenColor")) {
this.setColorToCheck(params.get("ConditionChosenColor"));
}
// Condition version of IsPresent stuff // Condition version of IsPresent stuff
if (params.containsKey("ConditionPresent")) { if (params.containsKey("ConditionPresent")) {
this.setIsPresent(params.get("ConditionPresent")); this.setIsPresent(params.get("ConditionPresent"));
@@ -250,6 +254,12 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
} }
} }
if (this.getColorToCheck() != null) {
if (!sa.getSourceCard().getChosenColor().contains(this.getColorToCheck())) {
return false;
}
}
if (this.getIsPresent() != null) { if (this.getIsPresent() != null) {
List<Card> list = new ArrayList<Card>(); List<Card> list = new ArrayList<Card>();
if (this.getPresentDefined() != null) { if (this.getPresentDefined() != null) {

View File

@@ -134,6 +134,10 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
this.setActivateCardsInHand(Integer.parseInt(params.get("ActivationCardsInHand"))); this.setActivateCardsInHand(Integer.parseInt(params.get("ActivationCardsInHand")));
} }
if (params.containsKey("ActivationChosenColor")) {
this.setColorToCheck(params.get("ActivationChosenColor"));
}
if (params.containsKey("Planeswalker")) { if (params.containsKey("Planeswalker")) {
this.setPlaneswalker(true); this.setPlaneswalker(true);
this.setSorcerySpeed(true); this.setSorcerySpeed(true);
@@ -325,6 +329,12 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
return false; return false;
} }
} }
if (this.getColorToCheck() != null) {
if (!sa.getSourceCard().getChosenColor().contains(this.getColorToCheck())) {
return false;
}
}
if (this.isHellbent()) { if (this.isHellbent()) {
if (!activator.hasHellbent()) { if (!activator.hasHellbent()) {
return false; return false;
@@ -416,6 +426,16 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
} }
if (this.getsVarToCheck() != null) {
final int svarValue = AbilityFactory.calculateAmount(sa.getSourceCard(), this.getsVarToCheck(), sa);
final int operandValue = AbilityFactory.calculateAmount(sa.getSourceCard(), this.getsVarOperand(), sa);
if (!Expressions.compare(svarValue, this.getsVarOperator(), operandValue)) {
return false;
}
}
return true; return true;
} // canPlay() } // canPlay()

View File

@@ -65,6 +65,7 @@ public class SpellAbilityVariables {
this.numberTurnActivations = sav.getNumberTurnActivations(); this.numberTurnActivations = sav.getNumberTurnActivations();
this.activationNumberSacrifice = sav.getActivationNumberSacrifice(); this.activationNumberSacrifice = sav.getActivationNumberSacrifice();
this.cardsInHand = sav.getCardsInHand(); this.cardsInHand = sav.getCardsInHand();
this.chosenColors = sav.getColorToCheck();
this.threshold = sav.isThreshold(); this.threshold = sav.isThreshold();
this.metalcraft = sav.isThreshold(); this.metalcraft = sav.isThreshold();
this.hellbent = sav.isHellbent(); this.hellbent = sav.isHellbent();
@@ -179,6 +180,9 @@ public class SpellAbilityVariables {
/** The not all m12 empires. */ /** The not all m12 empires. */
private boolean notAllM12Empires = false; private boolean notAllM12Empires = false;
/** The chosen colors string. */
private String chosenColors = null;
/** /**
* <p> * <p>
* Setter for the field <code>notAllM12Empires</code>. * Setter for the field <code>notAllM12Empires</code>.
@@ -444,7 +448,7 @@ public class SpellAbilityVariables {
* Setter for the field <code>phases</code>. * Setter for the field <code>phases</code>.
* </p> * </p>
* *
* @param phasesString * @param phases
* a {@link java.lang.String} object. * a {@link java.lang.String} object.
*/ */
public final void setPhases(final List<PhaseType> phases) { public final void setPhases(final List<PhaseType> phases) {
@@ -508,7 +512,7 @@ public class SpellAbilityVariables {
} }
/** /**
* @param kicked0 the kicked to set * @param kicked the kicked to set
*/ */
public void setKicked(boolean kicked) { public void setKicked(boolean kicked) {
this.kicked = kicked; this.kicked = kicked;
@@ -943,4 +947,27 @@ public class SpellAbilityVariables {
this.opponentOnly = opponentOnly; this.opponentOnly = opponentOnly;
} }
/**
* <p>
* Setter for the field <code>ColorToCheck</code>.
* </p>
*
* @param s
* a {@link java.lang.String} object.
*/
public final void setColorToCheck(final String s) {
this.chosenColors = s;
}
/**
* <p>
* Getter for the field <code>ColorToCheck</code>.
* </p>
*
* @return the String, chosenColors.
*/
public final String getColorToCheck() {
return this.chosenColors;
}
} // end class SpellAbilityVariables } // end class SpellAbilityVariables