fix up Sutured Ghoul so compy won't play it with no creatures in Graveyard. Fixed to display */* for P/T while not in play.

This commit is contained in:
jendave
2011-08-06 13:30:19 +00:00
parent c39cc19bdc
commit 52b3d12714
2 changed files with 71 additions and 72 deletions

View File

@@ -2,7 +2,7 @@ Name:Sutured Ghoul
ManaCost:4 B B B
Types:Creature Zombie
Text:As Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard.\r\nSutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness.
PT:1/1
PT:*/*
K:Trample
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sutured_ghoul.jpg

View File

@@ -15544,10 +15544,7 @@ public class CardFactory_Creatures {
@Override
public boolean canPlayAI() {
//get all creatures
CardList list = new CardList();
list.addAll(AllZone.Human_Battlefield.getCards());
list.addAll(AllZone.Computer_Battlefield.getCards());
list = list.getType("Creature");
CardList list = AllZoneUtil.getCreaturesInPlay();
return 0 < list.size();
}
@@ -15895,72 +15892,74 @@ public class CardFactory_Creatures {
//*************** START *********** START **************************
else if(cardName.equals("Sutured Ghoul")) {
final int[] numCreatures = new int[1];
final int[] sumPower = new int[1];
final int[] sumToughness = new int[1];
//final String player = card.getController();
final int[] numCreatures = new int[1];
final int[] sumPower = new int[1];
final int[] sumToughness = new int[1];
Command intoPlay = new Command() {
private static final long serialVersionUID = -75234586897814L;
Command intoPlay = new Command() {
private static final long serialVersionUID = -75234586897814L;
public void execute() {
int intermSumPower,intermSumToughness;
intermSumPower = intermSumToughness = 0;
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
CardList creats = new CardList(grave.getCards());
creats = creats.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isCreature() && !c.equals(card);
}
});
public void execute() {
int intermSumPower,intermSumToughness;
intermSumPower = intermSumToughness = 0;
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
CardList creats = new CardList(grave.getCards());
creats = creats.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isCreature() && !c.equals(card);
}
});
if(card.getController().equals(AllZone.HumanPlayer)) {
if (creats.size() > 0)
{
List<Card> selection = AllZone.Display.getChoicesOptional("Select creatures to sacrifice", creats.toArray());
//System.out.println("Creats size: " + creats.size());
numCreatures[0] = selection.size();
for(int m = 0; m < selection.size(); m++) {
intermSumPower += selection.get(m).getBaseAttack();
intermSumToughness += selection.get(m).getBaseDefense();
AllZone.GameAction.exile(selection.get(m));
}
}
if(card.getController().equals(AllZone.HumanPlayer)) {
if (creats.size() > 0)
{
List<Card> selection = AllZone.Display.getChoicesOptional("Select creatures to sacrifice", creats.toArray());
}//human
else {
int count = 0;
for(int i = 0; i < creats.size(); i++) {
Card c = creats.get(i);
if(c.getNetAttack() <= 2 && c.getNetDefense() <= 3) {
intermSumPower += c.getBaseAttack();
intermSumToughness += c.getBaseDefense();
AllZone.GameAction.exile(c);
count++;
}
//is this needed?
AllZone.Computer_Battlefield.updateObservers();
}
numCreatures[0] = count;
}
sumPower[0] = intermSumPower;
sumToughness[0] = intermSumToughness;
card.setBaseAttack(sumPower[0]);
card.setBaseDefense(sumToughness[0]);
}
};
numCreatures[0] = selection.size();
for(int m = 0; m < selection.size(); m++) {
intermSumPower += selection.get(m).getBaseAttack();
intermSumToughness += selection.get(m).getBaseDefense();
AllZone.GameAction.exile(selection.get(m));
}
}
card.clearSpellAbility();
card.addComesIntoPlayCommand(intoPlay);
card.addSpellAbility(new Spell_Permanent(card) {
private static final long serialVersionUID = 304885517082977723L;
}//human
else {
int count = 0;
for(int i = 0; i < creats.size(); i++) {
Card c = creats.get(i);
if(c.getNetAttack() <= 2 && c.getNetDefense() <= 3) {
intermSumPower += c.getBaseAttack();
intermSumToughness += c.getBaseDefense();
AllZone.GameAction.exile(c);
count++;
}
//is this needed?
AllZone.Computer_Battlefield.updateObservers();
}
numCreatures[0] = count;
}
sumPower[0] = intermSumPower;
sumToughness[0] = intermSumToughness;
card.setBaseAttack(sumPower[0]);
card.setBaseDefense(sumToughness[0]);
//AllZone.Stack.add(suture);
}
};
//suture.setStackDescription(card.getName() + " - has power equal to the sum of the power of all exiled creatures and toughness equal to the sum of their toughness.");
//suture.setDescription("When Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard. Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness.");
//card.addSpellAbility(suture);
card.addComesIntoPlayCommand(intoPlay);
//card.addSpellAbility(CardFactoryUtil.ability_Devour(card, magnitude));
}//*************** END ************ END **************************
@Override
public boolean canPlayAI() {
//get all creatures
CardList list = AllZoneUtil.getPlayerGraveyard(AllZone.ComputerPlayer);
list = list.filter(AllZoneUtil.creatures);
return 0 < list.size();
}
});
}//*************** END ************ END **************************
//*************** START *********** START **************************