- Added code support for Optional$ True in DB RemoveCounter. Fixed Shed Weakness not being optional.

This commit is contained in:
Agetian
2017-05-11 04:51:06 +00:00
parent d1f930fca2
commit 1cf3d9c975
2 changed files with 9 additions and 1 deletions

View File

@@ -71,11 +71,19 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
final Game game = card.getGame(); final Game game = card.getGame();
final String type = sa.getParam("CounterType"); final String type = sa.getParam("CounterType");
final String num = sa.getParam("CounterNum"); final String num = sa.getParam("CounterNum");
int cntToRemove = 0; int cntToRemove = 0;
if (!num.equals("All") && !num.equals("Remembered")) { if (!num.equals("All") && !num.equals("Remembered")) {
cntToRemove = AbilityUtils.calculateAmount(sa.getHostCard(), num, sa); cntToRemove = AbilityUtils.calculateAmount(sa.getHostCard(), num, sa);
} }
if (sa.hasParam("Optional")) {
String ctrs = cntToRemove > 1 ? "counters" : num.equals("All") ? "all counters" : "a counter";
if (!sa.getActivatingPlayer().getController().confirmAction(sa, null, "Remove " + ctrs + "?")) {
return;
}
}
CounterType counterType = null; CounterType counterType = null;
if (!type.equals("Any") && !type.equals("All")) { if (!type.equals("Any") && !type.equals("All")) {

View File

@@ -2,6 +2,6 @@ Name:Shed Weakness
ManaCost:G ManaCost:G
Types:Instant Types:Instant
A:SP$ Pump | Cost$ G | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ +2 | NumDef$ +2 | SubAbility$ DBRemoveCounter | SpellDescription$ Target creature gets +2/+2 until end of turn. You may remove a -1/-1 counter from it. A:SP$ Pump | Cost$ G | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ +2 | NumDef$ +2 | SubAbility$ DBRemoveCounter | SpellDescription$ Target creature gets +2/+2 until end of turn. You may remove a -1/-1 counter from it.
SVar:DBRemoveCounter:DB$RemoveCounter | Defined$ Targeted | OptionalDecider$ You | CounterType$ M1M1 | CounterNum$ 1 SVar:DBRemoveCounter:DB$RemoveCounter | Defined$ Targeted | Optional$ True | CounterType$ M1M1 | CounterNum$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/shed_weakness.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/shed_weakness.jpg
Oracle:Target creature gets +2/+2 until end of turn. You may remove a -1/-1 counter from it. Oracle:Target creature gets +2/+2 until end of turn. You may remove a -1/-1 counter from it.