mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- The three following unless costs can now be combined with other unless costs: CostPayLife, CostDamage and CostPutCounter.
- Added Mundungu by swordshine.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -6393,6 +6393,7 @@ res/cardsfolder/m/multani_maro_sorcerer.txt svneol=native#text/plain
|
|||||||
res/cardsfolder/m/multanis_acolyte.txt svneol=native#text/plain
|
res/cardsfolder/m/multanis_acolyte.txt svneol=native#text/plain
|
||||||
res/cardsfolder/m/multanis_decree.txt svneol=native#text/plain
|
res/cardsfolder/m/multanis_decree.txt svneol=native#text/plain
|
||||||
res/cardsfolder/m/multanis_harmony.txt -text svneol=unset#text/plain
|
res/cardsfolder/m/multanis_harmony.txt -text svneol=unset#text/plain
|
||||||
|
res/cardsfolder/m/mundungu.txt -text
|
||||||
res/cardsfolder/m/mungha_wurm.txt svneol=native#text/plain
|
res/cardsfolder/m/mungha_wurm.txt svneol=native#text/plain
|
||||||
res/cardsfolder/m/muraganda_petroglyphs.txt svneol=native#text/plain
|
res/cardsfolder/m/muraganda_petroglyphs.txt svneol=native#text/plain
|
||||||
res/cardsfolder/m/murasa_pyromancer.txt svneol=native#text/plain
|
res/cardsfolder/m/murasa_pyromancer.txt svneol=native#text/plain
|
||||||
|
|||||||
11
res/cardsfolder/m/mundungu.txt
Normal file
11
res/cardsfolder/m/mundungu.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Name:Mundungu
|
||||||
|
ManaCost:1 U B
|
||||||
|
Types:Creature Human Wizard
|
||||||
|
PT:1/1
|
||||||
|
Text:no text
|
||||||
|
A:AB$ Counter | Cost$ T | TargetType$ Spell | TgtPrompt$ Select target spell | ValidTgts$ Card | UnlessCost$ 1 PayLife<1> | SpellDescription$ Counter target spell unless its controller pays 1 and 1 life.
|
||||||
|
SVar:Rarity:Uncommon
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/mundungu.jpg
|
||||||
|
SetInfo:VIS|Uncommon|http://magiccards.info/scans/en/vi/132.jpg
|
||||||
|
Oracle:{T}: Counter target spell unless its controller pays {1} and 1 life.
|
||||||
|
End
|
||||||
@@ -369,9 +369,7 @@ public final class GameActionUtil {
|
|||||||
final Command unpaid, SpellAbility sourceAbility) {
|
final Command unpaid, SpellAbility sourceAbility) {
|
||||||
final Card source = ability.getSourceCard();
|
final Card source = ability.getSourceCard();
|
||||||
final ArrayList<CostPart> parts = cost.getCostParts();
|
final ArrayList<CostPart> parts = cost.getCostParts();
|
||||||
if (parts.size() > 1) {
|
ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts());
|
||||||
throw new RuntimeException("GameActionUtil::payCostDuringAbilityResolve - Too many payment types - " + source);
|
|
||||||
}
|
|
||||||
CostPart costPart = null;
|
CostPart costPart = null;
|
||||||
if (!parts.isEmpty()) {
|
if (!parts.isEmpty()) {
|
||||||
costPart = parts.get(0);
|
costPart = parts.get(0);
|
||||||
@@ -384,40 +382,39 @@ public final class GameActionUtil {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
boolean hasPaid = true;
|
||||||
if (costPart instanceof CostPayLife) {
|
//the three following costs do not need inputs
|
||||||
String amountString = costPart.getAmount();
|
for (CostPart part : parts) {
|
||||||
//CardFactoryUtil.xCount(source, source.getSVar(amountString))
|
if (part instanceof CostPayLife) {
|
||||||
|
String amountString = part.getAmount();
|
||||||
|
|
||||||
final int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
final int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||||
: AbilityFactory.calculateAmount(source, amountString, sourceAbility);
|
: AbilityFactory.calculateAmount(source, amountString, sourceAbility);
|
||||||
Player p = Singletons.getControl().getPlayer();
|
Player p = Singletons.getControl().getPlayer();
|
||||||
if (p.canPayLife(amount) && showYesNoDialog(source, "Do you want to pay " + amount + " life?")) {
|
if (p.canPayLife(amount) && showYesNoDialog(source, "Do you want to pay " + amount + " life?")) {
|
||||||
p.payLife(amount, null);
|
p.payLife(amount, null);
|
||||||
paid.execute();
|
|
||||||
} else {
|
} else {
|
||||||
unpaid.execute();
|
hasPaid = false;
|
||||||
}
|
}
|
||||||
return;
|
remainingParts.remove(part);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (costPart instanceof CostDamage) {
|
else if (part instanceof CostDamage) {
|
||||||
String amountString = costPart.getAmount();
|
String amountString = part.getAmount();
|
||||||
final int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
final int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||||
: CardFactoryUtil.xCount(source, source.getSVar(amountString));
|
: CardFactoryUtil.xCount(source, source.getSVar(amountString));
|
||||||
Player p = Singletons.getControl().getPlayer();
|
Player p = Singletons.getControl().getPlayer();
|
||||||
if (p.canPayLife(amount) && showYesNoDialog(source, "Do you want " + source + " to deal " + amount + " damage to you?")) {
|
if (p.canPayLife(amount) && showYesNoDialog(source, "Do you want " + source + " to deal " + amount + " damage to you?")) {
|
||||||
p.addDamage(amount, source);
|
p.addDamage(amount, source);
|
||||||
paid.execute();
|
|
||||||
} else {
|
} else {
|
||||||
unpaid.execute();
|
hasPaid = false;
|
||||||
}
|
}
|
||||||
return;
|
remainingParts.remove(part);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (costPart instanceof CostPutCounter) {
|
else if (part instanceof CostPutCounter) {
|
||||||
String amountString = costPart.getAmount();
|
String amountString = part.getAmount();
|
||||||
Counters counterType = ((CostPutCounter) costPart).getCounter();
|
Counters counterType = ((CostPutCounter) part).getCounter();
|
||||||
int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
int amount = amountString.matches("[0-9][0-9]?") ? Integer.parseInt(amountString)
|
||||||
: CardFactoryUtil.xCount(source, source.getSVar(amountString));
|
: CardFactoryUtil.xCount(source, source.getSVar(amountString));
|
||||||
String plural = amount > 1 ? "s" : "";
|
String plural = amount > 1 ? "s" : "";
|
||||||
@@ -425,19 +422,32 @@ public final class GameActionUtil {
|
|||||||
+ " counter" + plural + " on " + source + "?")) {
|
+ " counter" + plural + " on " + source + "?")) {
|
||||||
if (source.canHaveCountersPlacedOnIt(counterType)) {
|
if (source.canHaveCountersPlacedOnIt(counterType)) {
|
||||||
source.addCounterFromNonEffect(counterType, amount);
|
source.addCounterFromNonEffect(counterType, amount);
|
||||||
paid.execute();
|
|
||||||
} else {
|
} else {
|
||||||
unpaid.execute();
|
hasPaid = false;
|
||||||
AllZone.getGameLog().add("ResolveStack", "Trying to pay upkeep for " + source + " but it can't have "
|
AllZone.getGameLog().add("ResolveStack", "Trying to pay upkeep for " + source + " but it can't have "
|
||||||
+ counterType.getName() + " counters put on it.", 2);
|
+ counterType.getName() + " counters put on it.", 2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unpaid.execute();
|
hasPaid = false;
|
||||||
}
|
}
|
||||||
|
remainingParts.remove(part);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!hasPaid) {
|
||||||
|
unpaid.execute();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (remainingParts.isEmpty()) {
|
||||||
|
paid.execute();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (remainingParts.size() > 1) {
|
||||||
|
throw new RuntimeException("GameActionUtil::payCostDuringAbilityResolve - Too many payment types - " + source);
|
||||||
|
}
|
||||||
|
costPart = remainingParts.get(0);
|
||||||
|
|
||||||
else if (costPart instanceof CostSacrifice) {
|
//the following costs need inputs and can't be combined at the moment
|
||||||
|
if (costPart instanceof CostSacrifice) {
|
||||||
final boolean bResolving = AllZone.getStack().getResolving();
|
final boolean bResolving = AllZone.getStack().getResolving();
|
||||||
AllZone.getStack().setResolving(false);
|
AllZone.getStack().setResolving(false);
|
||||||
AllZone.getInputControl().setInput(new InputPaySacCost((CostSacrifice) costPart, ability, paid, unpaid));
|
AllZone.getInputControl().setInput(new InputPaySacCost((CostSacrifice) costPart, ability, paid, unpaid));
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ public class AbilityFactoryCounterMagic {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.unlessCost != null && !this.unlessCost.startsWith("Damage")) {
|
if (this.unlessCost != null && !this.unlessCost.endsWith(">")) {
|
||||||
// Is this Usable Mana Sources? Or Total Available Mana?
|
// Is this Usable Mana Sources? Or Total Available Mana?
|
||||||
final int usableManaSources = CardFactoryUtil.getUsableManaSources(ai.getOpponent());
|
final int usableManaSources = CardFactoryUtil.getUsableManaSources(ai.getOpponent());
|
||||||
int toPay = 0;
|
int toPay = 0;
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ public class ComputerUtil {
|
|||||||
|
|
||||||
// Unless Cost gets significant bonus + 10-Payment Amount
|
// Unless Cost gets significant bonus + 10-Payment Amount
|
||||||
final String unless = params.get("UnlessCost");
|
final String unless = params.get("UnlessCost");
|
||||||
if (unless != null && !unless.startsWith("Damage")) {
|
if (unless != null && !unless.endsWith(">")) {
|
||||||
final int amount = AbilityFactory.calculateAmount(source, unless, sa);
|
final int amount = AbilityFactory.calculateAmount(source, unless, sa);
|
||||||
|
|
||||||
final int usableManaSources = CardFactoryUtil.getUsableManaSources(ai.getOpponent());
|
final int usableManaSources = CardFactoryUtil.getUsableManaSources(ai.getOpponent());
|
||||||
|
|||||||
Reference in New Issue
Block a user