mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
convert Defiler of Souls to triggers
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
Name:Defiler of Souls
|
||||
ManaCost:3 B B R
|
||||
Types:Creature Demon
|
||||
Text:At the beginning of each player's upkeep, that player sacrifices a monocolored creature.
|
||||
Text:no text
|
||||
PT:5/5
|
||||
K:Flying
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSacYou | TriggerDescription$ At the beginning of each player's upkeep, that player sacrifices a monocolored creature.
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Opponent | TriggerZones$ Battlefield | Execute$ TrigSacOpp | Secondary$ True | TriggerDescription$ At the beginning of each player's upkeep, that player sacrifices a monocolored creature.
|
||||
SVar:TrigSacYou:AB$ Sacrifice | Cost$ 0 | SacValid$ Creature.MonoColor | Defined$ You | SacMessage$ monocolored creature
|
||||
SVar:TrigSacOpp:AB$ Sacrifice | Cost$ 0 | SacValid$ Creature.MonoColor | Defined$ Opponent | SacMessage$ monocolored creature
|
||||
SVar:Rarity:Mythic
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/defiler_of_souls.jpg
|
||||
SetInfo:ARB|Mythic|http://magiccards.info/scans/en/arb/37.jpg
|
||||
|
||||
@@ -31,7 +31,6 @@ public class GameActionUtil {
|
||||
upkeep_The_Abyss();
|
||||
upkeep_All_Hallows_Eve();
|
||||
upkeep_Mana_Vortex();
|
||||
upkeep_Defiler_of_Souls();
|
||||
upkeep_Yawgmoth_Demon();
|
||||
upkeep_Lord_of_the_Pit();
|
||||
upkeep_Drop_of_Honey();
|
||||
@@ -2691,61 +2690,6 @@ public class GameActionUtil {
|
||||
}
|
||||
}//end for
|
||||
}//All_Hallows_Eve
|
||||
|
||||
private static void upkeep_Defiler_of_Souls() {
|
||||
/*
|
||||
* At the beginning of each player's upkeep, destroy target
|
||||
* nonartifact creature that player controls of his or her
|
||||
* choice. It can't be regenerated.
|
||||
*/
|
||||
final Player player = AllZone.Phase.getPlayerTurn();
|
||||
final CardList defilers = AllZoneUtil.getCardsInPlay("Defiler of Souls");
|
||||
|
||||
for(Card c:defilers) {
|
||||
final Card defiler = c;
|
||||
|
||||
final Ability sacrificeCreature = new Ability(defiler, "") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
if(player.equals(AllZone.HumanPlayer)) {
|
||||
AllZone.InputControl.setInput( new Input() {
|
||||
private static final long serialVersionUID = 8013298767165776609L;
|
||||
public void showMessage() {
|
||||
AllZone.Display.showMessage("Defiler of Souls - Select a monocolored creature to sacrifice");
|
||||
ButtonUtil.disableAll();
|
||||
}
|
||||
public void selectCard(Card selected, PlayerZone zone) {
|
||||
//probably need to restrict by controller also
|
||||
if(selected.isCreature() && CardUtil.getColors(selected).size() == 1 && !selected.isColorless()
|
||||
&& zone.is(Constant.Zone.Battlefield) && zone.getPlayer().equals(AllZone.HumanPlayer)) {
|
||||
AllZone.GameAction.sacrificeDestroy(selected);
|
||||
stop();
|
||||
}
|
||||
}//selectCard()
|
||||
});//Input
|
||||
}
|
||||
else { //computer
|
||||
CardList targets = Defiler_of_Souls_getTargets(player,defiler);
|
||||
Card target = CardFactoryUtil.AI_getWorstCreature(targets);
|
||||
if(null == target) {
|
||||
//must be nothing valid to destroy
|
||||
}
|
||||
else AllZone.GameAction.sacrificeDestroy(target);
|
||||
}
|
||||
}//resolve
|
||||
};//sacrificeCreature
|
||||
sacrificeCreature.setStackDescription("Defiler of Souls - Select a monocolored creature to sacrifice");
|
||||
if(Defiler_of_Souls_getTargets(player,defiler).size() > 0)
|
||||
AllZone.Stack.add(sacrificeCreature);
|
||||
}//end for
|
||||
}//The Abyss
|
||||
|
||||
private static CardList Defiler_of_Souls_getTargets(final Player player, Card card) {
|
||||
CardList creats = AllZoneUtil.getCreaturesInPlay(player);
|
||||
String mono[] = {"Creature.MonoColor"};
|
||||
creats = creats.getValidCards(mono,player,card);
|
||||
return creats;
|
||||
}
|
||||
|
||||
private static void upkeep_Yawgmoth_Demon() {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user