mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Added code support for Optional$ True in DB RemoveCounter. Fixed Shed Weakness not being optional.
This commit is contained in:
@@ -71,11 +71,19 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
|
||||
final Game game = card.getGame();
|
||||
final String type = sa.getParam("CounterType");
|
||||
final String num = sa.getParam("CounterNum");
|
||||
|
||||
int cntToRemove = 0;
|
||||
if (!num.equals("All") && !num.equals("Remembered")) {
|
||||
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;
|
||||
|
||||
if (!type.equals("Any") && !type.equals("All")) {
|
||||
|
||||
@@ -2,6 +2,6 @@ Name:Shed Weakness
|
||||
ManaCost:G
|
||||
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.
|
||||
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
|
||||
Oracle:Target creature gets +2/+2 until end of turn. You may remove a -1/-1 counter from it.
|
||||
Reference in New Issue
Block a user