mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Added CostRemoveCounter to payCostDuringAbilityResolve.
- Added Junk Golem by swordshine.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -5189,6 +5189,7 @@ res/cardsfolder/j/juniper_order_advocate.txt svneol=native#text/plain
|
||||
res/cardsfolder/j/juniper_order_druid.txt svneol=native#text/plain
|
||||
res/cardsfolder/j/juniper_order_ranger.txt svneol=native#text/plain
|
||||
res/cardsfolder/j/junk_diver.txt svneol=native#text/plain
|
||||
res/cardsfolder/j/junk_golem.txt -text
|
||||
res/cardsfolder/j/junktroller.txt svneol=native#text/plain
|
||||
res/cardsfolder/j/junkyo_bell.txt -text
|
||||
res/cardsfolder/j/juntu_stakes.txt svneol=native#text/plain
|
||||
|
||||
15
res/cardsfolder/j/junk_golem.txt
Normal file
15
res/cardsfolder/j/junk_golem.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
Name:Junk Golem
|
||||
ManaCost:4
|
||||
Types:Artifact Creature Golem
|
||||
Text:no text
|
||||
PT:0/0
|
||||
K:etbCounter:P1P1:3
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless you remove a +1/+1 counter from it.
|
||||
SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | Defined$ Self | UnlessCost$ SubCounter<1/P1P1> | UnlessPayer$ You
|
||||
A:AB$ PutCounter | Cost$ 1 Discard<1/Card> | CounterType$ P1P1 | CounterNum$ 1 | SpellDescription$ Put a +1/+1 counter on CARDNAME.
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/junk_golem.jpg
|
||||
SetInfo:ODY|Rare|http://magiccards.info/scans/en/od/300.jpg
|
||||
Oracle:Junk Golem enters the battlefield with three +1/+1 counters on it.\nAt the beginning of your upkeep, sacrifice Junk Golem unless you remove a +1/+1 counter from it.\n{1}, Discard a card: Put a +1/+1 counter on Junk Golem.
|
||||
End
|
||||
@@ -38,6 +38,7 @@ import forge.card.cost.CostPart;
|
||||
import forge.card.cost.CostPayLife;
|
||||
import forge.card.cost.CostMana;
|
||||
import forge.card.cost.CostPutCounter;
|
||||
import forge.card.cost.CostRemoveCounter;
|
||||
import forge.card.cost.CostReturn;
|
||||
import forge.card.cost.CostSacrifice;
|
||||
import forge.card.cost.CostUtil;
|
||||
@@ -377,6 +378,7 @@ public final class GameActionUtil {
|
||||
final Command unpaid, SpellAbility sourceAbility) {
|
||||
final Card source = ability.getSourceCard();
|
||||
final ArrayList<CostPart> parts = cost.getCostParts();
|
||||
Player p = Singletons.getControl().getPlayer();
|
||||
ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts());
|
||||
CostPart costPart = null;
|
||||
if (!parts.isEmpty()) {
|
||||
@@ -402,7 +404,6 @@ public final class GameActionUtil {
|
||||
|
||||
final int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||
: AbilityFactory.calculateAmount(source, amountString, sourceAbility);
|
||||
Player p = Singletons.getControl().getPlayer();
|
||||
if (p.canPayLife(amount) && showYesNoDialog(source, "Do you want to pay " + amount + " life?" + orString)) {
|
||||
p.payLife(amount, null);
|
||||
} else {
|
||||
@@ -416,7 +417,6 @@ public final class GameActionUtil {
|
||||
String amountString = part.getAmount();
|
||||
final int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||
: CardFactoryUtil.xCount(source, source.getSVar(amountString));
|
||||
Player p = Singletons.getControl().getPlayer();
|
||||
if (p.canPayLife(amount) && showYesNoDialog(source, "Do you want " + source + " to deal " + amount + " damage to you?")) {
|
||||
p.addDamage(amount, source);
|
||||
} else {
|
||||
@@ -449,8 +449,24 @@ public final class GameActionUtil {
|
||||
remainingParts.remove(part);
|
||||
}
|
||||
|
||||
else if (part instanceof CostRemoveCounter) {
|
||||
String amountString = part.getAmount();
|
||||
CounterType counterType = ((CostRemoveCounter) part).getCounter();
|
||||
int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||
: CardFactoryUtil.xCount(source, source.getSVar(amountString));
|
||||
String plural = amount > 1 ? "s" : "";
|
||||
if (part.canPay(sourceAbility, source, p, cost) &&
|
||||
showYesNoDialog(source, "Do you want to remove " + amount + " " + counterType.getName()
|
||||
+ " counter" + plural + " from " + source + "?")) {
|
||||
source.subtractCounter(counterType, amount);
|
||||
} else {
|
||||
hasPaid = false;
|
||||
break;
|
||||
}
|
||||
remainingParts.remove(part);
|
||||
}
|
||||
|
||||
else if (part instanceof CostExile) {
|
||||
Player p = Singletons.getControl().getPlayer();
|
||||
if ("All".equals(part.getType())) {
|
||||
if (showYesNoDialog(source, "Do you want to exile all cards in your graveyard?")) {
|
||||
List<Card> cards = new ArrayList<Card>(p.getCardsIn(ZoneType.Graveyard));
|
||||
@@ -488,9 +504,7 @@ public final class GameActionUtil {
|
||||
}
|
||||
|
||||
else if (part instanceof CostSacrifice) {
|
||||
|
||||
CostSacrifice sacCost = (CostSacrifice) part;
|
||||
Player p = Singletons.getControl().getPlayer();
|
||||
String valid = sacCost.getType();
|
||||
int amount = Integer.parseInt(sacCost.getAmount());
|
||||
List<Card> list = AbilityFactory.filterListByType(p.getCardsIn(ZoneType.Battlefield), valid, ability);
|
||||
|
||||
Reference in New Issue
Block a user