add Time Bomb (from Ice Age)

This commit is contained in:
jendave
2011-08-06 09:52:23 +00:00
parent 2132e38a66
commit 7c69d64e8e
3 changed files with 58 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -4399,6 +4399,7 @@ res/cardsfolder/timberland_ruins.txt -text svneol=native#text/plain
res/cardsfolder/timbermare.txt -text svneol=native#text/plain
res/cardsfolder/timbermaw_larva.txt -text svneol=native#text/plain
res/cardsfolder/timberwatch_elf.txt -text svneol=native#text/plain
res/cardsfolder/time_bomb.txt -text svneol=native#text/plain
res/cardsfolder/time_ebb.txt -text svneol=native#text/plain
res/cardsfolder/time_elemental.txt -text svneol=native#text/plain
res/cardsfolder/time_of_heroes.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,8 @@
Name:Time Bomb
ManaCost:4
Types:Artifact
Text:1, Tap, Sacrifice Time Bomb: Time Bomb deals damage equal to the number of time counters on it to each creature and each player.
K:WheneverKeyword:BeginningOfUpkeep:No_Initiator:Play:CustomCounter.TIME/1:Self:ASAP:No_Condition:ControllerUpkeep:At the beginning of your upkeep, put a time counter on CARDNAME.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/time_bomb.jpg
End

View File

@@ -11617,6 +11617,55 @@ public class CardFactory implements NewConstants {
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Time Bomb")){
/*
* 1, Tap, Sacrifice Time Bomb: Time Bomb deals damage equal
* to the number of time counters on it to each creature and
* each player.
*/
Ability_Cost abCost = new Ability_Cost("1 T Sac<1/CARDNAME>", cardName, true);
final Ability_Activated spell = new Ability_Activated(card, abCost, null) {
private static final long serialVersionUID = 7550743617522146304L;
public void resolve() {
int damage = card.getCounters(Counters.TIME);
CardList all = AllZoneUtil.getCreaturesInPlay();
for(Card c:all) c.addDamage(damage, card);
AllZone.HumanPlayer.addDamage(damage, card);
AllZone.ComputerPlayer.addDamage(damage, card);
}
public boolean canPlayAI() {
final int damage = card.getCounters(Counters.TIME);
if (AllZone.HumanPlayer.getLife() <= damage) return true;
CardListFilter filter = new CardListFilter(){
public boolean addCard(Card c)
{
return c.isCreature() && CardFactoryUtil.canDamage(card, c) && damage >= (c.getNetDefense() + c.getDamage());
}
};
CardList human = AllZoneUtil.getPlayerCardsInPlay(AllZone.HumanPlayer);
human = human.filter(filter);
CardList comp = AllZoneUtil.getPlayerCardsInPlay(AllZone.ComputerPlayer);
comp = comp.filter(filter);
return human.size() > (comp.size() + 2) && AllZone.ComputerPlayer.getLife() > damage + 3;
}
};
StringBuilder sbStack = new StringBuilder();
sbStack.append(card).append(" - deals X damage to each creature and each player.");
spell.setStackDescription(sbStack.toString());
card.addSpellAbility(spell);
}//*************** END ************ END **************************
return postFactoryKeywords(card);
}//getCard2