convert Dark Depths to script with a real trigger

This commit is contained in:
slapshot5
2011-11-20 20:36:25 +00:00
parent 9d6f34694c
commit a8d59a2e0c
2 changed files with 7 additions and 76 deletions

View File

@@ -1,7 +1,12 @@
Name:Dark Depths
ManaCost:no cost
Types:Legendary Snow Land
Text:Dark Depths enters the battlefield with ten ice counters on it.\r\nWhen Dark Depths has no ice counters on it, sacrifice it. If you do, put an indestructible legendary 20/20 black Avatar creature token with flying named Marit Lage onto the battlefield.
Text:no text
K:etbCounter:ICE:10
A:AB$ RemoveCounter | Cost$ 3 | CounterType$ ICE | CounterNum$ 1 | SpellDescription$ Remove an ice counter from CARDNAME.
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Card.Self+counters_EQ0_ICE | Execute$ TrigSac | TriggerDescription$ When Dark Depths has no ice counters on it, sacrifice it. If you do, put a legendary 20/20 black Avatar creature token with flying and "This creature is indestructible" named Marit Lage onto the battlefield.
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self | SubAbility$ DBToken
SVar:DBToken:DB$Token | TokenAmount$ 1 | TokenName$ Marit Lage | TokenTypes$ Creature,Avatar,Legendary | TokenOwner$ You | TokenColors$ Black | TokenPower$ 20 | TokenToughness$ 20 | TokenKeywords$ Flying<>Indestructible
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/dark_depths.jpg
SetInfo:CSP|Rare|http://magiccards.info/scans/en/cs/145.jpg

View File

@@ -113,81 +113,7 @@ class CardFactoryLands {
}
});
} // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Dark Depths")) {
card.addComesIntoPlayCommand(CardFactoryUtil.entersBattleFieldWithCounters(card, Counters.ICE, 10));
final SpellAbility ability = new Ability(card, "3") {
@Override
public boolean canPlay() {
for (int i = 0; i < AllZone.getStack().size(); i++) {
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) {
return false;
}
}
if ((card.getCounters(Counters.ICE) > 0) && AllZoneUtil.isCardInPlay(card) && super.canPlay()) {
return true;
} else {
return false;
}
}
@Override
public boolean canPlayAI() {
final String phase = AllZone.getPhase().getPhase();
return phase.equals(Constant.Phase.MAIN2) && super.canPlayAI();
}
@Override
public void resolve() {
card.subtractCounter(Counters.ICE, 1);
if (card.getCounters(Counters.ICE) == 0) {
CardFactoryUtil.makeToken("Marit Lage", "B 20 20 Marit Lage", card.getController(), "B",
new String[] { "Legendary", "Creature", "Avatar" }, 20, 20, new String[] { "Flying",
"Indestructible" });
AllZone.getGameAction().sacrifice(card);
}
}
};
final SpellAbility sacrifice = new Ability(card, "0") {
// TODO - this should probably be a state effect
@Override
public boolean canPlay() {
return (card.getCounters(Counters.ICE) == 0) && AllZoneUtil.isCardInPlay(card) && super.canPlay();
}
@Override
public boolean canPlayAI() {
return this.canPlay() && super.canPlayAI();
}
@Override
public void resolve() {
if (card.getCounters(Counters.ICE) == 0) {
CardFactoryUtil.makeToken("Marit Lage", "B 20 20 Marit Lage", card.getController(), "B",
new String[] { "Legendary", "Creature", "Avatar" }, 20, 20, new String[] { "Flying",
"Indestructible" });
}
AllZone.getGameAction().sacrifice(card);
}
};
ability.setDescription("3: remove an Ice Counter.");
final StringBuilder sb = new StringBuilder();
sb.append(card.getName()).append(" - remove an ice counter.");
ability.setStackDescription(sb.toString());
card.addSpellAbility(ability);
final StringBuilder sbSac = new StringBuilder();
sbSac.append("Sacrifice ").append(card.getName());
sacrifice.setStackDescription(sbSac.toString());
card.addSpellAbility(sacrifice);
} // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Novijen, Heart of Progress")) {
card.clearSpellKeepManaAbility();