convert Shapeshifter to script

This commit is contained in:
slapshot5
2011-10-02 06:48:30 +00:00
parent 66a82cd1d5
commit 5f7b762899
4 changed files with 11 additions and 67 deletions

View File

@@ -1,8 +1,14 @@
Name:Shapeshifter
ManaCost:6
Types:Artifact Creature Shapeshifter
Text:As Shapeshifter enters the battlefield, choose a number between 0 and 7.\r\nAt the beginning of your upkeep, you may choose a number between 0 and 7.\r\nShapeshifter's power is equal to the last chosen number and its toughness is equal to 7 minus that number.
Text:no text
PT:*/7-*
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseNumber | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose a number between 0 and 7.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ ChooseNumber | TriggerDescription$ At the beginning of your upkeep, you may choose a number between 0 and 7.
SVar:ChooseNumber:AB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ 7
S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ Y | Description$ CARDNAME's power is equal to the last chosen number and its toughness is equal to 7 minus that number.
SVar:X:Count$ChosenNumber
SVar:Y:Number$7/Minus.X
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/shapeshifter.jpg
SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/398.jpg

View File

@@ -94,8 +94,6 @@ public class Upkeep implements java.io.Serializable {
upkeep_Ceta_Sanctuary();
upkeep_Tangle_Wire();
upkeep_Shapeshifter();
upkeep_Vesuvan_Doppelganger_Keyword();
//Kinship cards
@@ -2306,45 +2304,10 @@ public class Upkeep implements java.io.Serializable {
if (damage > 0) {
AllZone.getStack().addSimultaneousStackEntry(ability);
}
} // for
} // upkeep_Power_Surge()
/**
* <p>upkeep_Shapeshifter.</p>
*/
private static void upkeep_Shapeshifter() {
final Player player = AllZone.getPhase().getPlayerTurn();
CardList list = player.getCardsIn(Zone.Battlefield, "Shapeshifter");
list = list.filter(CardListFilter.nonToken);
for (final Card c : list) {
SpellAbility ability = new Ability(c, "0") {
@Override
public void resolve() {
int num = 0;
if (player.isHuman()) {
String[] choices = new String[7];
for (int j = 0; j < 7; j++) {
choices[j] = "" + j;
}
String answer = (String) (GuiUtils.getChoiceOptional(c.getName() + " - Choose a number", choices));
num = Integer.parseInt(answer);
} else {
num = 3;
}
c.setBaseAttack(num);
c.setBaseDefense(7 - num);
}
};
ability.setStackDescription(c.getName() + " - choose a new number");
AllZone.getStack().addSimultaneousStackEntry(ability);
} //foreach(Card)
} //upkeep_Shapeshifter
/**
* <p>upkeep_Vesuvan_Doppelganger_Keyword.</p>
*/

View File

@@ -3125,6 +3125,10 @@ public class CardFactoryUtil {
if (sq[0].contains("CardManaCost")) {
return doXMath(CardUtil.getConvertedManaCost(c), m, c);
}
// Count$ChosenNumber
if (sq[0].contains("ChosenNumber")) {
return doXMath(c.getChosenNumber(), m, c);
}
// Count$CardCounters.<counterType>
if (sq[0].contains("CardCounters")) {
return doXMath(c.getCounters(Counters.getType(sq[1])), m, c);

View File

@@ -2019,35 +2019,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Shapeshifter")) {
Command intoPlay = new Command() {
private static final long serialVersionUID = 5447692676152380940L;
public void execute() {
if (!card.isToken()) { //ugly hack to get around tokens created by Crib Swap
int num = 0;
if (card.getController().isHuman()) {
String[] choices = new String[7];
for (int j = 0; j < 7; j++) {
choices[j] = "" + j;
}
String answer = (String) (GuiUtils.getChoiceOptional(
card.getName() + " - Choose a number", choices));
num = Integer.parseInt(answer);
} else {
num = 3;
}
card.setBaseAttack(num);
card.setBaseDefense(7 - num);
}
}
};
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Metalworker")) {
final Cost abCost = new Cost("T", card.getName(), true);