- Changed SubCounter to be consistent with other abCosts

- Changed Discard to be consistent with other abCosts
- Discard second parameter is now:  Hand, Random, Any, or a <ValidType>
- Added Skyshroud Vampire
This commit is contained in:
jendave
2011-08-06 07:20:11 +00:00
parent 5a6a00293f
commit 70d888282a
10 changed files with 41 additions and 31 deletions

1
.gitattributes vendored
View File

@@ -3188,6 +3188,7 @@ res/cardsfolder/skyshroud_forest.txt -text svneol=native#text/plain
res/cardsfolder/skyshroud_sentinel.txt -text svneol=native#text/plain
res/cardsfolder/skyshroud_troll.txt -text svneol=native#text/plain
res/cardsfolder/skyshroud_troopers.txt -text svneol=native#text/plain
res/cardsfolder/skyshroud_vampire.txt -text svneol=native#text/plain
res/cardsfolder/skywatcher_adept.txt -text svneol=native#text/plain
res/cardsfolder/slagwurm_armor.txt -text svneol=native#text/plain
res/cardsfolder/slate_of_ancestry.txt -text svneol=native#text/plain

View File

@@ -4,7 +4,7 @@ Types:Creature Zombie Beast
Text:no text
PT:3/3
K:WheneverKeyword:PermanentIntoGraveyard:Type/Creature:Play:+1+1 Counters/1:Self:ASAP:Yes_No:Initiator - Other than Self:Whenever another creature is put into a graveyard from the battlefield, you may put a +1/+1 counter on Deathbringer Thoctar.
K:abDamageTgtCP 0 SubCounter<P1P1/1>:1
K:abDamageTgtCP SubCounter<1/P1P1>:1
K:SVar:Rarity:Rare
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/deathbringer_thoctar.jpg
End

View File

@@ -3,7 +3,7 @@ ManaCost:R
Types:Creature Human Spellshaper
Text:no text
PT:1/1
K:abDamageTgtCP R T Discard<1,Any>:1
K:abDamageTgtCP R T Discard<1/Any>:1
K:SVar:Rarity:Common
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/kris_mage.jpg
K:SVar:RemAIDeck:True

View File

@@ -0,0 +1,10 @@
Name:Skyshroud Vampire
ManaCost:3 B B
Types:Creature Vampire
Text:no text
PT:3/3
K:Flying
K:abPump Discard<1/Creature>:+2/+2
K:SVar:Rarity:Uncommon
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/skyshroud_vampire.jpg
End

View File

@@ -2,7 +2,7 @@ Name:Stormbind
ManaCost:1 R G
Types:Enchantment
Text:no text
K:abDamageTgtCP 2 Discard<1,Random>:2
K:abDamageTgtCP 2 Discard<1/Random>:2
K:SVar:Rarity:Rare
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/stormbind.jpg
K:SVar:RemAIDeck:True

View File

@@ -4,7 +4,7 @@ Types:Artifact Creature Construct
Text:no text
PT:1/1
K:etbCounter:P1P1:3
K:abDamageTgtCP 0 SubCounter<P1P1/1>:1
K:abDamageTgtCP SubCounter<1/P1P1>:1
K:SVar:RemAIDeck:True
K:SVar:Rarity:Rare
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/triskelion.jpg

View File

@@ -53,7 +53,7 @@ public class Ability_Cost {
name = cardName;
if(parse.contains("SubCounter<")) {
// SubCounter<CounterType/NumCounters>
// SubCounter<NumCounters/CounterType>
subtractCounterCost = true;
int counterPos = parse.indexOf("SubCounter<");
int endPos = parse.indexOf(">", counterPos);
@@ -63,9 +63,9 @@ public class Ability_Cost {
str = str.replace("SubCounter<", "");
str = str.replace(">", "");
String[] strSplit = str.split("/");
// convert strSplit[0] to Counter.something
counterType = Counters.valueOf(strSplit[0]);
counterAmount = Integer.parseInt(strSplit[1]);
counterAmount = Integer.parseInt(strSplit[0]);
counterType = Counters.valueOf(strSplit[1]);
}
if(parse.contains("PayLife<")) {
@@ -83,7 +83,7 @@ public class Ability_Cost {
}
if (parse.contains("Discard<")){
// Discard<NumCards,DiscardType>
// Discard<NumCards/DiscardType>
discardCost = true;
int startPos = parse.indexOf("Discard<");
int endPos = parse.indexOf(">", startPos);
@@ -93,7 +93,7 @@ public class Ability_Cost {
str = str.replace("Discard<", "");
str = str.replace(">", "");
String[] splitStr = str.split(",");
String[] splitStr = str.split("/", 2);
discardAmount = Integer.parseInt(splitStr[0]);
discardType = splitStr[1];
@@ -258,9 +258,9 @@ public class Ability_Cost {
}
else{
cost.append(discardAmount);
int type = discardType.indexOf("/");
if (type != -1)
cost.append(discardType.substring(type + 1)).append(" ");
if (!discardType.equals("Any") && !discardType.equals("Random")){
cost.append(" ").append(discardType);
}
cost.append(" card");
if (discardAmount > 1)
cost.append("s");

View File

@@ -4753,7 +4753,7 @@ public class CardFactory implements NewConstants {
String parse = card.getKeyword().get(spike).toString();
card.removeIntrinsicKeyword(parse);
final Ability_Cost cost = new Ability_Cost("2 SubCounter<P1P1/1>", card.getName(), true);
final Ability_Cost cost = new Ability_Cost("2 SubCounter<1/P1P1>", card.getName(), true);
final Target tgt = new Target("TgtC");
final int m = Integer.parseInt(parse.substring(6));

View File

@@ -253,9 +253,8 @@ public class ComputerUtil
// this will always work
}
else{
int type = discType.indexOf("/");
if (type != -1){
String validType[] = discType.substring(type+1).split(",");
if (!discType.equals("Any") && !discType.equals("Random")){
String validType[] = discType.split(",");
handList = handList.getValidCards(validType);
}
if (discAmount > handList.size()){

View File

@@ -78,9 +78,8 @@ public class Cost_Payment {
// this will always work
}
else{
int type = discType.indexOf("/");
if (type != -1){
String validType[] = discType.substring(type+1).split(",");
if (!discType.equals("Any") && !discType.equals("Random")){
String validType[] = discType.split(",");
handList = handList.getValidCards(validType);
}
if (discAmount > handList.size()){
@@ -186,12 +185,11 @@ public class Cost_Payment {
payDiscard = true;
}
else{
int type = discType.indexOf("/");
if (type != -1){
String validType[] = discType.substring(type+1).split(",");
if (!discType.equals("Any")){
String validType[] = discType.split(",");
handList = handList.getValidCards(validType);
}
changeInput.stopSetNext(input_discardCost(discAmount, handList, ability, this));
changeInput.stopSetNext(input_discardCost(discAmount, discType, handList, ability, this));
return false;
}
}
@@ -298,13 +296,12 @@ public class Cost_Payment {
AllZone.GameAction.discardRandom(card.getController(), discAmount, ability);
}
else{
int type = discType.indexOf("/");
if (type != -1){
String validType[] = discType.substring(type+1).split(",");
if (!discType.equals("Any")){
String validType[] = discType.split(",");
AllZone.GameAction.AI_discardNumType(discAmount, validType, ability);
}
else{
AllZone.GameAction.AI_discardNumUnless(discAmount, ability);
AllZone.GameAction.AI_discardNum(discAmount, ability);
}
}
}
@@ -316,7 +313,7 @@ public class Cost_Payment {
AllZone.Stack.add(ability);
}
public static Input input_discardCost(final int nCards, final CardList handList, SpellAbility sa, final Cost_Payment payment) {
public static Input input_discardCost(final int nCards, final String discType, final CardList handList, SpellAbility sa, final Cost_Payment payment) {
final SpellAbility sp = sa;
Input target = new Input() {
private static final long serialVersionUID = -329993322080934435L;
@@ -326,8 +323,11 @@ public class Cost_Payment {
@Override
public void showMessage() {
if (AllZone.Human_Hand.getCards().length == 0) stop();
AllZone.Display.showMessage("Select a card to discard");
StringBuilder type = new StringBuilder("");
if (!discType.equals("Any")){
type.append(" ").append(discType);
}
AllZone.Display.showMessage("Select a"+ type.toString() + " card to discard");
ButtonUtil.enableOnlyCancel();
}