- Added AI support for Divide counters.

- Card conversions by marc.
This commit is contained in:
Sloth
2013-05-02 15:21:36 +00:00
parent 21c8c49154
commit 5dce0ab172
4 changed files with 18 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
Name:Elven Rite
ManaCost:1 G
Types:Sorcery
A:SP$ PutCounter | Cost$ 1 G | ValidTgts$ Creature | TgtPrompt$ Select target creature (1) | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBPutCounter | SpellDescription$ Distribute two +1/+1 counters among one or two target creatures.
SVar:DBPutCounter:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (2) | CounterType$ P1P1 | CounterNum$ 1
A:SP$ PutCounter | Cost$ 1 G | ValidTgts$ Creature | TgtPrompt$ Select target creature to distribute counters to | CounterType$ P1P1 | CounterNum$ 2 | TargetMin$ 1 | TargetMax$ 2 | DividedAsYouChoose$ 2 | SpellDescription$ Distribute two +1/+1 counters among one or two target creatures.
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/elven_rite.jpg
Oracle:Distribute two +1/+1 counters among one or two target creatures.
SetInfo:STH Uncommon

View File

@@ -4,11 +4,7 @@ Types:Legendary Creature Dragon Spirit
PT:5/5
K:Flying
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigPutCounter | OptionalDecider$ TriggeredCardController | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield, you may distribute five +1/+1 counters among any number of target creatures.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature (1) | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ PutCounter2
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 | SubAbility$ PutCounter5
SVar:PutCounter5:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (5) | CounterType$ P1P1 | CounterNum$ 1
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to distribute counters to | CounterType$ P1P1 | CounterNum$ 5 | TargetMin$ 1 | TargetMax$ 5 | DividedAsYouChoose$ 5
SVar:Picture:http://www.wizards.com/global/images/magic/general/jugan_the_rising_star.jpg
Oracle:Flying\nWhen Jugan, the Rising Star dies, you may distribute five +1/+1 counters among any number of target creatures.
SetInfo:CHK Rare

View File

@@ -3,9 +3,8 @@ ManaCost:5 G G
Types:Creature Elf Warrior
PT:2/2
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPutCounter | TriggerDescription$ When CARDNAME enters the battlefield, distribute three +1/+1 counters among one, two, or three target creatures.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ PutCounter2
SVar:PutCounter2:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ PutCounter3
SVar:PutCounter3:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ P1P1 | CounterNum$ 1
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature to distribute counters to | CounterType$ P1P1 | CounterNum$ 3 | TargetMin$ 1 | TargetMax$ 3 | DividedAsYouChoose$ 3
SVar:RemAIDeck:True
SVar:PlayMain1:TRUE
SVar:Picture:http://www.wizards.com/global/images/magic/general/wurmskin_forger.jpg
Oracle:When Wurmskin Forger enters the battlefield, distribute three +1/+1 counters among one, two, or three target creatures.

View File

@@ -38,6 +38,7 @@ public class CountersPutAi extends SpellAbilityAi {
Card choice = null;
final String type = sa.getParam("CounterType");
final String amountStr = sa.getParam("CounterNum");
final boolean divided = sa.hasParam("DividedAsYouChoose");
final Player player = sa.isCurse() ? ai.getOpponent() : ai;
@@ -128,7 +129,11 @@ public class CountersPutAi extends SpellAbilityAi {
// TODO is this good enough? for up to amounts?
break;
}
} else if (divided) {
abTgt.addDividedAllocation(choice, amount);
break;
}
list.remove(choice);
abTgt.addTarget(choice);
}
@@ -171,6 +176,7 @@ public class CountersPutAi extends SpellAbilityAi {
Card choice = null;
final String type = sa.getParam("CounterType");
final String amountStr = sa.getParam("CounterNum");
final boolean divided = sa.hasParam("DividedAsYouChoose");
final int amount = AbilityUtils.calculateAmount(sa.getSourceCard(), amountStr, sa);
final Player player = sa.isCurse() ? ai.getOpponent() : ai;
@@ -217,6 +223,9 @@ public class CountersPutAi extends SpellAbilityAi {
// TODO is this good enough? for up to amounts?
break;
}
} else if (divided) {
abTgt.addDividedAllocation(choice, amount);
break;
}
list.remove(choice);
abTgt.addTarget(choice);
@@ -237,6 +246,7 @@ public class CountersPutAi extends SpellAbilityAi {
final Player player = isCurse ? ai.getOpponent() : ai;
final String type = sa.getParam("CounterType");
final String amountStr = sa.getParam("CounterNum");
final boolean divided = sa.hasParam("DividedAsYouChoose");
final int amount = AbilityUtils.calculateAmount(sa.getSourceCard(), amountStr, sa);
if (abTgt == null) {
@@ -294,6 +304,9 @@ public class CountersPutAi extends SpellAbilityAi {
choice = ComputerUtilCard.getRandomCard(list);
}
}
if (choice != null && divided) {
abTgt.addDividedAllocation(choice, amount);
}
}
// TODO - I think choice can be null here. Is that ok for