mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Convert Kinsbaile Borderguard to script
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
Name:Kinsbaile Borderguard
|
||||
ManaCost:1 W W
|
||||
Types:Creature Kithkin Soldier
|
||||
Text:CARDNAME enters the battlefield with a +1/+1 counter on it for each other Kithkin you control.\r\nWhen CARDNAME is put into a graveyard from the battlefield, put a 1/1 white Kithkin Soldier creature token onto the battlefield for each counter on it.
|
||||
PT:1/1
|
||||
K:etbCounter:P1P1:X:no condition:CARDNAME enters the battlefield with a +1/+1 counter on it for each other Kithkin you control.
|
||||
SVar:X:Count$Valid Kithkin.YouCtrl+Other
|
||||
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigToken | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME dies, put a 1/1 white Kithkin Soldier creature token onto the battlefield for each counter on it.
|
||||
SVar:TrigToken:DB$ Token | TokenAmount$ Y | TokenName$ Kithkin Soldier | TokenTypes$ Creature,Kithkin,Soldier | TokenOwner$ TriggeredCardController | TokenColors$ White | TokenPower$ 1 | TokenToughness$ 1 | References$ Y
|
||||
SVar:Y:TriggeredCard$CardCounters.ALL
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/kinsbaile_borderguard.jpg
|
||||
Oracle:Kinsbaile Borderguard enters the battlefield with a +1/+1 counter on it for each other Kithkin you control.\nWhen Kinsbaile Borderguard dies, put a 1/1 white Kithkin Soldier creature token onto the battlefield for each counter on it.
|
||||
|
||||
@@ -299,79 +299,6 @@ public class CardFactoryCreatures {
|
||||
card.addSpellAbility(ability);
|
||||
}
|
||||
|
||||
private static void getCard_KinsbaileBorderguard(final Card card) {
|
||||
final SpellAbility ability = new Ability(card, ManaCost.ZERO) {
|
||||
@Override
|
||||
public void resolve() {
|
||||
card.addCounter(CounterType.P1P1, this.countKithkin(), true);
|
||||
} // resolve()
|
||||
|
||||
public int countKithkin() {
|
||||
final List<Card> kithkin =
|
||||
CardLists.filter(card.getController().getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
|
||||
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
return (c.isType("Kithkin")) && !c.equals(card);
|
||||
}
|
||||
|
||||
});
|
||||
return kithkin.size();
|
||||
|
||||
}
|
||||
};
|
||||
final Command intoPlay = new Command() {
|
||||
private static final long serialVersionUID = -7067218066522935060L;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Kinsbaile Borderguard enters the battlefield with a ");
|
||||
sb.append("+1/+1 counter on it for each other Kithkin you control.");
|
||||
ability.setStackDescription(sb.toString());
|
||||
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(ability);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
final SpellAbility ability2 = new Ability(card, ManaCost.ZERO) {
|
||||
@Override
|
||||
public void resolve() {
|
||||
int n = card.sumAllCounters();
|
||||
for (int i = 0; i < n; i++) {
|
||||
for(Card tok : this.makeToken()) {
|
||||
Singletons.getModel().getGame().getAction().moveToPlay(tok);
|
||||
}
|
||||
}
|
||||
if (n > 0)
|
||||
Singletons.getModel().getGame().getEvents().post(new TokenCreatedEvent());
|
||||
} // resolve()
|
||||
|
||||
public List<Card> makeToken() {
|
||||
return CardFactory.makeToken("Kithkin Soldier", CardToken.makeTokenFileName("W", 1, 1, "Kithkin Soldier"),
|
||||
card.getController(), "W", new String[] { "Creature", "Kithkin", "Soldier" }, 1, 1, new String[] { "" });
|
||||
}
|
||||
};
|
||||
|
||||
final Command destroy = new Command() {
|
||||
private static final long serialVersionUID = 304026662487997331L;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("When Kinsbaile Borderguard is put into a graveyard ");
|
||||
sb.append("from play, put a 1/1 white Kithkin Soldier creature ");
|
||||
sb.append("token onto the battlefield for each counter on it.");
|
||||
ability2.setStackDescription(sb.toString());
|
||||
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(ability2);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
card.addDestroyCommand(destroy);
|
||||
}
|
||||
|
||||
private static void getCard_SurturedGhoul(final Card card) {
|
||||
final Command intoPlay = new Command() {
|
||||
private static final long serialVersionUID = -75234586897814L;
|
||||
@@ -509,8 +436,6 @@ public class CardFactoryCreatures {
|
||||
getCard_SphinxJwar(card);
|
||||
} else if (cardName.equals("Master of the Wild Hunt")) {
|
||||
getCard_MasterOfTheWildHunt(card);
|
||||
} else if (cardName.equals("Kinsbaile Borderguard")) {
|
||||
getCard_KinsbaileBorderguard(card);
|
||||
} else if (cardName.equals("Sutured Ghoul")) {
|
||||
getCard_SurturedGhoul(card);
|
||||
} else if (cardName.equals("Phyrexian Dreadnought")) {
|
||||
|
||||
@@ -1420,7 +1420,20 @@ public class CardFactoryUtil {
|
||||
|
||||
if (sq[0].contains("CardNumColors")) return doXMath(CardUtil.getColors(c).size(), m, c);
|
||||
if (sq[0].contains("ChosenNumber")) return doXMath(c.getChosenNumber(), m, c);
|
||||
if (sq[0].contains("CardCounters")) return doXMath(c.getCounters(CounterType.getType(sq[1])), m, c);
|
||||
if (sq[0].contains("CardCounters")) {
|
||||
// CardCounters.ALL to be used for Kinsbaile Borderguard and anything that cares about all counters
|
||||
int count = 0;
|
||||
if (sq[1].equals("ALL")) {
|
||||
for(Integer i : c.getCounters().values()) {
|
||||
if (i != null && i > 0) {
|
||||
count += i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
count = c.getCounters(CounterType.getType(sq[1]));
|
||||
}
|
||||
return doXMath(count, m, c);
|
||||
}
|
||||
|
||||
// Count$TotalCounters.<counterType>_<valid>
|
||||
if (sq[0].contains("TotalCounters")) {
|
||||
|
||||
Reference in New Issue
Block a user