mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Convert Goblin Charbelcher to script
This commit is contained in:
@@ -2,6 +2,13 @@ Name:Goblin Charbelcher
|
|||||||
ManaCost:4
|
ManaCost:4
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
Text:no text
|
Text:no text
|
||||||
|
A:AB$ DigUntil | Cost$ 3 T | Valid$ Land | ValidDescription$ land | RememberRevealed$ True | RevealedDestination$ Library | RevealedLibraryPosition$ -1 | SubAbility$ DBBelch | SpellDescription$ Reveal cards from the top of your library until you reveal a land card. CARDNAME deals damage equal to the number of nonland cards revealed this way to target creature or player. If the revealed land card was a Mountain, CARDNAME deals double that damage instead. Put the revealed cards on the bottom of your library in any order. | StackDescription$ SpellDescription
|
||||||
|
SVar:DBBelch:DB$ DealDamage | Tgt$ CP | NumDmg$ X | ConditionCheckSVar$ FoundMountain | ConditionSVarCompare$ EQ0 | SubAbility$ DBDoubleBelch | StackDescription$ None
|
||||||
|
SVar:DBDoubleBelch:DB$ DealDamage | Defined$ Targeted | NumDmg$ DoubleX | SubAbility$ DBCleanup | ConditionCheckSVar$ FoundMountain | ConditionSVarCompare$ EQ1 | StackDescription$ None
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
SVar:X:Remembered$Valid Card.nonLand
|
||||||
|
SVar:DoubleX:Remembered$Valid Card.nonLand/Times.2
|
||||||
|
SVar:FoundMountain:Remembered$Valid Card.Mountain
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_charbelcher.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_charbelcher.jpg
|
||||||
SetInfo:MRD|Rare|http://magiccards.info/scans/en/mi/176.jpg
|
SetInfo:MRD|Rare|http://magiccards.info/scans/en/mi/176.jpg
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ public class DigUntilEffect extends SpellEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Use getOrderChoices before this moveTo call for the Human
|
||||||
final Iterator<Card> itr = revealed.iterator();
|
final Iterator<Card> itr = revealed.iterator();
|
||||||
while (itr.hasNext()) {
|
while (itr.hasNext()) {
|
||||||
final Card c = itr.next();
|
final Card c = itr.next();
|
||||||
|
|||||||
@@ -149,91 +149,6 @@ class CardFactoryArtifacts {
|
|||||||
|
|
||||||
} // *************** END ************ END **************************
|
} // *************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
// *************** START *********** START **************************
|
|
||||||
else if (cardName.equals("Goblin Charbelcher")) {
|
|
||||||
final Cost abCost = new Cost(card, "3 T", true);
|
|
||||||
class AbilityGoblinCharbelcher extends AbilityActivated {
|
|
||||||
public AbilityGoblinCharbelcher(final Card ca, final Cost co, final Target t) {
|
|
||||||
super(ca, co, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AbilityActivated getCopy() {
|
|
||||||
AbilityActivated res = new AbilityGoblinCharbelcher(getSourceCard(),
|
|
||||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
|
||||||
CardFactoryUtil.copySpellAbility(this, res);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -840041589720758423L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canPlayAI() {
|
|
||||||
this.getTarget().resetTargets();
|
|
||||||
final List<Card> libList = getActivatingPlayer().getCardsIn(ZoneType.Library);
|
|
||||||
return !libList.isEmpty() && ComputerUtil.targetHumanAI(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
final List<Card> topOfLibrary = card.getController().getCardsIn(ZoneType.Library);
|
|
||||||
final List<Card> revealed = new ArrayList<Card>();
|
|
||||||
|
|
||||||
if (topOfLibrary.size() == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int damage = 0;
|
|
||||||
int count = 0;
|
|
||||||
Card c = null;
|
|
||||||
Card crd;
|
|
||||||
while (c == null) {
|
|
||||||
revealed.add(topOfLibrary.get(count));
|
|
||||||
crd = topOfLibrary.get(count++);
|
|
||||||
if (crd.isLand() || (count == topOfLibrary.size())) {
|
|
||||||
c = crd;
|
|
||||||
damage = count;
|
|
||||||
if (crd.isLand()) {
|
|
||||||
damage--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (crd.isType("Mountain")) {
|
|
||||||
damage *= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // while
|
|
||||||
GuiChoose.oneOrNone("Revealed cards:", revealed);
|
|
||||||
for (final Card revealedCard : revealed) {
|
|
||||||
Singletons.getModel().getGame().getAction().moveToBottomOfLibrary(revealedCard);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getTargetCard() != null) {
|
|
||||||
if (this.getTargetCard().isInPlay()
|
|
||||||
&& this.getTargetCard().canBeTargetedBy(this)) {
|
|
||||||
this.getTargetCard().addDamage(damage, card);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.getTargetPlayer().addDamage(damage, card);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final AbilityActivated ability = new AbilityGoblinCharbelcher(card, abCost, new Target(card, "TgtCP"));
|
|
||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append(abCost);
|
|
||||||
sb.append("Reveal cards from the top of your library until you reveal a land card. ");
|
|
||||||
sb.append("Goblin Charbelcher deals damage equal to the number of nonland cards revealed ");
|
|
||||||
sb.append("this way to target creature or player. If the revealed land card was a ");
|
|
||||||
sb.append("Mountain, Goblin Charbelcher deals double that damage instead. Put the ");
|
|
||||||
sb.append("revealed cards on the bottom of your library in any order.");
|
|
||||||
ability.setDescription(sb.toString());
|
|
||||||
|
|
||||||
card.addSpellAbility(ability);
|
|
||||||
} // *************** END ************ END **************************
|
|
||||||
|
|
||||||
// *************** START *********** START **************************
|
// *************** START *********** START **************************
|
||||||
else if (cardName.equals("Grindstone")) {
|
else if (cardName.equals("Grindstone")) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user