convert Rith, the Awakener to script

This commit is contained in:
slapshot5
2011-10-16 19:53:05 +00:00
parent 96f9baa40d
commit d05c569511
5 changed files with 10 additions and 57 deletions

View File

@@ -1,9 +1,13 @@
Name:Rith, the Awakener Name:Rith, the Awakener
ManaCost:3 R G W ManaCost:3 R G W
Types:Legendary Creature Dragon Types:Legendary Creature Dragon
Text:Whenever Rith, the Awakener deals combat damage to a player, you may pay 2 G. If you do, choose a color, then put a 1/1 green Saproling creature token onto the battlefield for each permanent of that color. Text:no text
PT:6/6 PT:6/6
K:Flying K:Flying
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Opponent | CombatDamage$ True | OptionalDecider$ You | Execute$ TrigChoose | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may pay 2 G. If you do, choose a color, then put a 1/1 green Saproling creature token onto the battlefield for each permanent of that color.
SVar:TrigChoose:AB$ ChooseColor | Cost$ 2 G | Defined$ You | AILogic$ MostProminentPermanent | SubAbility$ DBToken
SVar:DBToken:DB$ Token | TokenAmount$ X | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1
SVar:X:Count$Valid Permanent.ChosenColor
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rith_the_awakener.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/rith_the_awakener.jpg
SetInfo:INV|Rare|http://magiccards.info/scans/en/in/267.jpg SetInfo:INV|Rare|http://magiccards.info/scans/en/in/267.jpg

View File

@@ -5092,6 +5092,7 @@ public class Card extends GameEntity implements Comparable<Card> {
if (!Property.startsWith("non") && (CardUtil.getColors(this).size() > 1 || isColorless())) return false; if (!Property.startsWith("non") && (CardUtil.getColors(this).size() > 1 || isColorless())) return false;
} else if (Property.equals("ChosenColor")) { } else if (Property.equals("ChosenColor")) {
//Should this match All chosen colors, or any? Default to first chosen for now until it matters. //Should this match All chosen colors, or any? Default to first chosen for now until it matters.
if (source.getChosenColor().size() == 0) return false;
if (!CardUtil.getColors(this).contains(source.getChosenColor().get(0))) return false; if (!CardUtil.getColors(this).contains(source.getChosenColor().get(0))) return false;
} else if (Property.startsWith("YouCtrl")) { } else if (Property.startsWith("YouCtrl")) {
if (!getController().isPlayer(sourceController)) return false; if (!getController().isPlayer(sourceController)) return false;

View File

@@ -1125,8 +1125,6 @@ public final class GameActionUtil {
playerCombatDamage_Spawnwrithe(c); playerCombatDamage_Spawnwrithe(c);
} else if (c.getName().equals("Treva, the Renewer")) { } else if (c.getName().equals("Treva, the Renewer")) {
playerCombatDamage_Treva(c); playerCombatDamage_Treva(c);
} else if (c.getName().equals("Rith, the Awakener")) {
playerCombatDamage_Rith(c);
} else if (c.isEnchantedBy("Celestial Mantle")) { } else if (c.isEnchantedBy("Celestial Mantle")) {
execute_Celestial_Mantle(c); execute_Celestial_Mantle(c);
} }
@@ -1175,20 +1173,6 @@ public final class GameActionUtil {
} }
/**
* <p>playerCombatDamage_Rith.</p>
*
* @param c a {@link forge.Card} object.
*/
private static void playerCombatDamage_Rith(final Card c) {
SpellAbility[] sa = c.getSpellAbility();
if (c.getController().isHuman()) {
AllZone.getGameAction().playSpellAbility(sa[1]);
} else {
ComputerUtil.playNoStack(sa[1]);
}
}
/** /**
* <p>playerCombatDamage_Whirling_Dervish.</p> * <p>playerCombatDamage_Whirling_Dervish.</p>
* *

View File

@@ -623,6 +623,10 @@ public class AbilityFactory_Choose {
list = AllZoneUtil.getCardsInGame().getController(AllZone.getHumanPlayer()).getType("Creature"); list = AllZoneUtil.getCardsInGame().getController(AllZone.getHumanPlayer()).getType("Creature");
chosen = CardFactoryUtil.getMostProminentColor(list); chosen = CardFactoryUtil.getMostProminentColor(list);
} }
if (logic.equals("MostProminentPermanent")) {
CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield);
chosen = CardFactoryUtil.getMostProminentColor(list);
}
if (logic.equals("MostProminentAttackers")) { if (logic.equals("MostProminentAttackers")) {
chosen = CardFactoryUtil.getMostProminentColor(new CardList(AllZone.getCombat().getAttackers())); chosen = CardFactoryUtil.getMostProminentColor(new CardList(AllZone.getCombat().getAttackers()));
} }

View File

@@ -969,46 +969,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Rith, the Awakener")) {
final Player player = card.getController();
final Ability ability2 = new Ability(card, "2 G") {
@Override
public void resolve() {
int numberTokens = 0;
if (card.getController().isHuman()) {
String choices[] = {"white", "blue", "black", "red", "green"};
Object o = GuiUtils.getChoiceOptional("Select Color: ", choices);
//System.out.println("Color:" + o);
numberTokens = CardFactoryUtil.getNumberOfPermanentsByColor((String) o);
} else {
CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield);
String color = CardFactoryUtil.getMostProminentColor(list);
numberTokens = CardFactoryUtil.getNumberOfPermanentsByColor(color);
}
for (int i = 0; i < numberTokens; i++) {
CardFactoryUtil.makeTokenSaproling(card.getController());
}
}
@Override
public boolean canPlay() {
//this is set to false, since it should only TRIGGER
return false;
}
};// ability2
//card.clearSpellAbility();
card.addSpellAbility(ability2);
StringBuilder sb2 = new StringBuilder();
sb2.append(card.getName()).append(" - ").append(player);
sb2.append(" puts a 1/1 green Saproling creature token onto the battlefield for each permanent of the chosen color");
ability2.setStackDescription(sb2.toString());
}//*************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************
else if (cardName.equals("Sphinx of Jwar Isle")) { else if (cardName.equals("Sphinx of Jwar Isle")) {
final SpellAbility ability1 = new Ability(card, "0") { final SpellAbility ability1 = new Ability(card, "0") {