- Made DistributedAsYouChoose available in PutCounter

- Converted Blessings of Nature to DistributeAsYouChoose
This commit is contained in:
moomarc
2013-02-13 17:48:56 +00:00
parent f1a4b2b317
commit 8003bd432c
4 changed files with 18 additions and 6 deletions

View File

@@ -3,10 +3,7 @@ ManaCost:4 G
Types:Sorcery Types:Sorcery
Text:no text Text:no text
K:Miracle:G K:Miracle:G
A:SP$PutCounter | Cost$ 4 G | ValidTgts$ Creature | TgtPrompt$ Select target creature (1) | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ PutCounter2 | SpellDescription$ Distribute four +1+1 counters among any number of target creatures. A:SP$ PutCounter | Cost$ 4 G | ValidTgts$ Creature | TgtPrompt$ Select target creature to distribute counters to | CounterType$ P1P1 | CounterNum$ 4 | TargetMin$ 1 | TargetMax$ 4 | DividedAsYouChoose$ 4 | SpellDescription$ Distribute four +1+1 counters among any number of target creatures.
SVar:PutCounter2:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (2) | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ PutCounter3
SVar:PutCounter3:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (3) | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ PutCounter4
SVar:PutCounter4:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (4) | CounterType$ P1P1 | CounterNum$ 1
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/blessings_of_nature.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/blessings_of_nature.jpg
SetInfo:AVR|Uncommon|http://magiccards.info/scans/en/avr/168.jpg SetInfo:AVR|Uncommon|http://magiccards.info/scans/en/avr/168.jpg

View File

@@ -4,4 +4,7 @@ Types:Instant
Text:no text Text:no text
A:SP$ PreventDamage | Cost$ 1 W | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to prevent damage to | Amount$ 5 | TargetMin$ 1 | TargetMax$ 5 | DividedAsYouChoose$ 5 | SpellDescription$ Prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose. A:SP$ PreventDamage | Cost$ 1 W | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to prevent damage to | Amount$ 5 | TargetMin$ 1 | TargetMax$ 5 | DividedAsYouChoose$ 5 | SpellDescription$ Prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.
SVar:Picture:http://www.wizards.com/global/images/magic/general/remedy.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/remedy.jpg
SetInfo:VIS|Common|http://magiccards.info/scans/en/vi/117.jpg
SetInfo:6ED|Common|http://magiccards.info/scans/en/6e/36.jpg
Oracle:Prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.
End End

View File

@@ -19,10 +19,15 @@ public class CountersPutEffect extends SpellEffect {
protected String getStackDescription(SpellAbility sa) { protected String getStackDescription(SpellAbility sa) {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
final Card card = sa.getSourceCard(); final Card card = sa.getSourceCard();
final boolean dividedAsYouChoose = sa.hasParam("DividedAsYouChoose");
final CounterType cType = CounterType.valueOf(sa.getParam("CounterType")); final CounterType cType = CounterType.valueOf(sa.getParam("CounterType"));
final int amount = AbilityUtils.calculateAmount(card, sa.getParam("CounterNum"), sa); final int amount = AbilityUtils.calculateAmount(card, sa.getParam("CounterNum"), sa);
sb.append("Put "); if (dividedAsYouChoose) {
sb.append("Distribute ");
} else {
sb.append("Put ");
}
if (sa.hasParam("UpTo")) { if (sa.hasParam("UpTo")) {
sb.append("up to "); sb.append("up to ");
} }
@@ -30,7 +35,11 @@ public class CountersPutEffect extends SpellEffect {
if (amount != 1) { if (amount != 1) {
sb.append("s"); sb.append("s");
} }
sb.append(" on "); if (dividedAsYouChoose) {
sb.append(" among ");
} else {
sb.append(" on ");
}
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
final List<Card> tgtCards = tgt != null ? tgt.getTargetCards() : AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa); final List<Card> tgtCards = tgt != null ? tgt.getTargetCards() : AbilityUtils.getDefinedCards(sa.getSourceCard(), sa.getParam("Defined"), sa);
@@ -91,6 +100,7 @@ public class CountersPutEffect extends SpellEffect {
} }
for (final Card tgtCard : tgtCards) { for (final Card tgtCard : tgtCards) {
counterAmount = (sa.getTarget() != null && sa.hasParam("DividedAsYouChoose")) ? sa.getTarget().getDividedValue(tgtCard) : counterAmount;
if ((tgt == null) || tgtCard.canBeTargetedBy(sa)) { if ((tgt == null) || tgtCard.canBeTargetedBy(sa)) {
if (max != -1) { if (max != -1) {
counterAmount = max - tgtCard.getCounters(counterType); counterAmount = max - tgtCard.getCounters(counterType);

View File

@@ -437,6 +437,8 @@ public class TargetSelection {
apiBasedMessage = "Select how much damage to deal to "; apiBasedMessage = "Select how much damage to deal to ";
} else if (sa.getApi().toString().equals("PreventDamage")) { } else if (sa.getApi().toString().equals("PreventDamage")) {
apiBasedMessage = "Select how much damage to prevent to "; apiBasedMessage = "Select how much damage to prevent to ";
} else if (sa.getApi().toString().equals("PutCounter")) {
apiBasedMessage = "Select how many counters to distribute to ";
} }
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append(apiBasedMessage); sb.append(apiBasedMessage);