mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
convert Rith, the Awakener to script
This commit is contained in:
@@ -5092,6 +5092,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if (!Property.startsWith("non") && (CardUtil.getColors(this).size() > 1 || isColorless())) return false;
|
||||
} else if (Property.equals("ChosenColor")) {
|
||||
//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;
|
||||
} else if (Property.startsWith("YouCtrl")) {
|
||||
if (!getController().isPlayer(sourceController)) return false;
|
||||
|
||||
@@ -1125,8 +1125,6 @@ public final class GameActionUtil {
|
||||
playerCombatDamage_Spawnwrithe(c);
|
||||
} else if (c.getName().equals("Treva, the Renewer")) {
|
||||
playerCombatDamage_Treva(c);
|
||||
} else if (c.getName().equals("Rith, the Awakener")) {
|
||||
playerCombatDamage_Rith(c);
|
||||
} else if (c.isEnchantedBy("Celestial Mantle")) {
|
||||
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>
|
||||
*
|
||||
|
||||
@@ -623,6 +623,10 @@ public class AbilityFactory_Choose {
|
||||
list = AllZoneUtil.getCardsInGame().getController(AllZone.getHumanPlayer()).getType("Creature");
|
||||
chosen = CardFactoryUtil.getMostProminentColor(list);
|
||||
}
|
||||
if (logic.equals("MostProminentPermanent")) {
|
||||
CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||
chosen = CardFactoryUtil.getMostProminentColor(list);
|
||||
}
|
||||
if (logic.equals("MostProminentAttackers")) {
|
||||
chosen = CardFactoryUtil.getMostProminentColor(new CardList(AllZone.getCombat().getAttackers()));
|
||||
}
|
||||
|
||||
@@ -969,46 +969,6 @@ public class CardFactory_Creatures {
|
||||
}//*************** 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 **************************
|
||||
else if (cardName.equals("Sphinx of Jwar Isle")) {
|
||||
final SpellAbility ability1 = new Ability(card, "0") {
|
||||
|
||||
Reference in New Issue
Block a user