mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
convert Shapeshifter to script
This commit is contained in:
@@ -1,8 +1,14 @@
|
|||||||
Name:Shapeshifter
|
Name:Shapeshifter
|
||||||
ManaCost:6
|
ManaCost:6
|
||||||
Types:Artifact Creature Shapeshifter
|
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-*
|
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:Rarity:Uncommon
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/shapeshifter.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/shapeshifter.jpg
|
||||||
SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/398.jpg
|
SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/398.jpg
|
||||||
|
|||||||
@@ -94,8 +94,6 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
upkeep_Ceta_Sanctuary();
|
upkeep_Ceta_Sanctuary();
|
||||||
upkeep_Tangle_Wire();
|
upkeep_Tangle_Wire();
|
||||||
|
|
||||||
|
|
||||||
upkeep_Shapeshifter();
|
|
||||||
upkeep_Vesuvan_Doppelganger_Keyword();
|
upkeep_Vesuvan_Doppelganger_Keyword();
|
||||||
|
|
||||||
//Kinship cards
|
//Kinship cards
|
||||||
@@ -2306,45 +2304,10 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
|
|
||||||
if (damage > 0) {
|
if (damage > 0) {
|
||||||
AllZone.getStack().addSimultaneousStackEntry(ability);
|
AllZone.getStack().addSimultaneousStackEntry(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
} // for
|
} // for
|
||||||
} // upkeep_Power_Surge()
|
} // 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>
|
* <p>upkeep_Vesuvan_Doppelganger_Keyword.</p>
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3125,6 +3125,10 @@ public class CardFactoryUtil {
|
|||||||
if (sq[0].contains("CardManaCost")) {
|
if (sq[0].contains("CardManaCost")) {
|
||||||
return doXMath(CardUtil.getConvertedManaCost(c), m, c);
|
return doXMath(CardUtil.getConvertedManaCost(c), m, c);
|
||||||
}
|
}
|
||||||
|
// Count$ChosenNumber
|
||||||
|
if (sq[0].contains("ChosenNumber")) {
|
||||||
|
return doXMath(c.getChosenNumber(), m, c);
|
||||||
|
}
|
||||||
// Count$CardCounters.<counterType>
|
// Count$CardCounters.<counterType>
|
||||||
if (sq[0].contains("CardCounters")) {
|
if (sq[0].contains("CardCounters")) {
|
||||||
return doXMath(c.getCounters(Counters.getType(sq[1])), m, c);
|
return doXMath(c.getCounters(Counters.getType(sq[1])), m, c);
|
||||||
|
|||||||
@@ -2019,35 +2019,6 @@ public class CardFactory_Creatures {
|
|||||||
}//*************** END ************ END **************************
|
}//*************** 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 **************************
|
//*************** START *********** START **************************
|
||||||
else if (cardName.equals("Metalworker")) {
|
else if (cardName.equals("Metalworker")) {
|
||||||
final Cost abCost = new Cost("T", card.getName(), true);
|
final Cost abCost = new Cost("T", card.getName(), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user