mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Added Mossbridge Troll
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -7245,6 +7245,7 @@ res/cardsfolder/m/mosquito_guard.txt svneol=native#text/plain
|
||||
res/cardsfolder/m/moss_diamond.txt svneol=native#text/plain
|
||||
res/cardsfolder/m/moss_kami.txt svneol=native#text/plain
|
||||
res/cardsfolder/m/moss_monster.txt svneol=native#text/plain
|
||||
res/cardsfolder/m/mossbridge_troll.txt -text
|
||||
res/cardsfolder/m/mossdog.txt svneol=native#text/plain
|
||||
res/cardsfolder/m/mossfire_egg.txt svneol=native#text/plain
|
||||
res/cardsfolder/m/mossfire_valley.txt svneol=native#text/plain
|
||||
|
||||
9
res/cardsfolder/m/mossbridge_troll.txt
Normal file
9
res/cardsfolder/m/mossbridge_troll.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Name:Mossbridge Troll
|
||||
ManaCost:5 G G
|
||||
Types:Creature Troll
|
||||
PT:5/5
|
||||
K:If CARDNAME would be destroyed, regenerate it.
|
||||
A:AB$ Pump | Cost$ tapXType<Any/Creature.Other+withTotalPowerGE10> | CostDesc$ Tap any number of untapped creatures you control other than CARDNAME with total power 10 or greater: | Defined$ Self | NumAtt$ +20 | NumDef$ +20 | SpellDescription$ CARDNAME gets +20/+20 until end of turn.
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/mossbridge_troll.jpg
|
||||
Oracle:If Mossbridge Troll would be destroyed, regenerate it.\nTap any number of untapped creatures you control other than Mossbridge Troll with total power 10 or greater: Mossbridge Troll gets +20/+20 until end of turn.
|
||||
@@ -281,4 +281,18 @@ public class CardLists {
|
||||
}
|
||||
return tiedForLowest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a List<Card> cardList, return a int TotalPower.
|
||||
*
|
||||
* @param cardList the Card List to be filtered.
|
||||
* @return the total power.
|
||||
*/
|
||||
public static int getTotalPower(Iterable<Card> cardList) {
|
||||
int total =0;
|
||||
for (final Card crd : cardList) {
|
||||
total += crd.getNetAttack();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,9 @@ public class CostTapType extends CostPartWithList {
|
||||
|
||||
if (type.contains("sharesCreatureTypeWith")) {
|
||||
sb.append("two untapped creatures you control that share a creature type");
|
||||
} else if (type.contains("+withTotalPowerGE")) {
|
||||
String num = type.split("+withTotalPowerGE")[1];
|
||||
sb.append("Tap any number of untapped creatures you control other than CARDNAME with total power " + num + "or greater");
|
||||
} else {
|
||||
sb.append(Cost.convertAmountTypeToWords(i, this.getAmount(), "untapped " + desc));
|
||||
sb.append(" you control");
|
||||
@@ -120,6 +123,13 @@ public class CostTapType extends CostPartWithList {
|
||||
sameType = true;
|
||||
type = type.replace("sharesCreatureTypeWith", "");
|
||||
}
|
||||
boolean totalPower = false;
|
||||
String totalP = "";
|
||||
if (type.contains("+withTotalPowerGE")) {
|
||||
totalPower = true;
|
||||
totalP = type.split("withTotalPowerGE")[1];
|
||||
type = type.replace("+withTotalPowerGE" + totalP, "");
|
||||
}
|
||||
|
||||
typeList = CardLists.getValidCards(typeList, type.split(";"), activator, source);
|
||||
|
||||
@@ -142,6 +152,11 @@ public class CostTapType extends CostPartWithList {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (totalPower) {
|
||||
final int i = Integer.parseInt(totalP);
|
||||
return CardLists.getTotalPower(typeList) >= i;
|
||||
}
|
||||
|
||||
final Integer amount = this.convertAmount();
|
||||
if ((typeList.size() == 0) || ((amount != null) && (typeList.size() < amount))) {
|
||||
return false;
|
||||
@@ -170,9 +185,18 @@ public class CostTapType extends CostPartWithList {
|
||||
sameType = true;
|
||||
type = type.replace("sharesCreatureTypeWith", "");
|
||||
}
|
||||
|
||||
boolean totalPower = false;
|
||||
String totalP = "";
|
||||
if (type.contains("+withTotalPowerGE")) {
|
||||
totalPower = true;
|
||||
totalP = type.split("withTotalPowerGE")[1];
|
||||
type = type.replace("+withTotalPowerGE" + totalP, "");
|
||||
}
|
||||
|
||||
typeList = CardLists.getValidCards(typeList, type.split(";"), ability.getActivatingPlayer(), ability.getSourceCard());
|
||||
typeList = CardLists.filter(typeList, Presets.UNTAPPED);
|
||||
if (c == null) {
|
||||
if (c == null && !amount.equals("Any")) {
|
||||
final String sVar = ability.getSVar(amount);
|
||||
// Generalize this
|
||||
if (sVar.equals("XChoice")) {
|
||||
@@ -218,6 +242,21 @@ public class CostTapType extends CostPartWithList {
|
||||
return executePayment(ability, tapped);
|
||||
}
|
||||
|
||||
if (totalPower) {
|
||||
int i = Integer.parseInt(totalP);
|
||||
InputSelectCards inp = new InputSelectCardsFromList(0, typeList.size(), typeList);
|
||||
inp.setMessage("Select a card to tap.");
|
||||
inp.setUnselectAllowed(true);
|
||||
inp.setCancelAllowed(true);
|
||||
Singletons.getControl().getInputQueue().setInputAndWait(inp);
|
||||
|
||||
if (inp.hasCancelled() || CardLists.getTotalPower(inp.getSelected()) < i) {
|
||||
return false;
|
||||
} else {
|
||||
return executePayment(ability, inp.getSelected());
|
||||
}
|
||||
}
|
||||
|
||||
InputSelectCards inp = new InputSelectCardsFromList(c, c, typeList);
|
||||
inp.setMessage("Select a " + getDescriptiveType() + " to tap (%d left)");
|
||||
Singletons.getControl().getInputQueue().setInputAndWait(inp);
|
||||
@@ -246,7 +285,7 @@ public class CostTapType extends CostPartWithList {
|
||||
c = AbilityUtils.calculateAmount(source, amount, ability);
|
||||
}
|
||||
}
|
||||
if (this.getType().contains("sharesCreatureTypeWith")) {
|
||||
if (this.getType().contains("sharesCreatureTypeWith") || this.getType().contains("withTotalPowerGE")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user