- Made some cards ready for multiplayer

- minor style cleanup
This commit is contained in:
moomarc
2013-04-05 08:42:48 +00:00
parent 67bff88772
commit 010c7672ba
5 changed files with 27 additions and 28 deletions

View File

@@ -2,7 +2,7 @@ Name:Havoc
ManaCost:1 R ManaCost:1 R
Types:Enchantment Types:Enchantment
T:Mode$ SpellCast | ValidCard$ Card.White | ValidActivatingPlayer$ Opponent | TriggerZones$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ Whenever an opponent casts a white spell, he or she loses 2 life. T:Mode$ SpellCast | ValidCard$ Card.White | ValidActivatingPlayer$ Opponent | TriggerZones$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ Whenever an opponent casts a white spell, he or she loses 2 life.
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ Opponent | LifeAmount$ 2 SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ TriggeredActivator | LifeAmount$ 2
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/havoc.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/havoc.jpg
Oracle:Whenever an opponent casts a white spell, he or she loses 2 life. Oracle:Whenever an opponent casts a white spell, he or she loses 2 life.

View File

@@ -2,10 +2,9 @@ Name:Heartless Hidetsugu
ManaCost:3 R R ManaCost:3 R R
Types:Legendary Creature Ogre Shaman Types:Legendary Creature Ogre Shaman
PT:4/3 PT:4/3
A:AB$ DealDamage | Cost$ T | Defined$ Opponent | NumDmg$ XOpp | SubAbility$ DBDealDamage | References$ XOpp | SpellDescription$ CARDNAME deals damage to each player equal to half that player's life total, rounded down. A:AB$ RepeatEach | Cost$ T | RepeatPlayers$ Player | RepeatSubAbility$ DBDealDamage | SpellDescription$ CARDNAME deals damage to each player equal to half that player's life total, rounded down.
SVar:DBDealDamage:DB$DealDamage | Cost$ 0 | Defined$ You | NumDmg$ XYou | References$ XYou SVar:DBDealDamage:DB$ DealDamage | Defined$ Remembered | NumDmg$ HeartlessX | References$ HeartlessX
SVar:XOpp:Count$OppLifeTotal/HalfDown SVar:HeartlessX:PlayerCountRemembered$LifeTotal/HalfDown
SVar:XYou:Count$YourLifeTotal/HalfDown
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/heartless_hidetsugu.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/heartless_hidetsugu.jpg
Oracle:{T}: Heartless Hidetsugu deals damage to each player equal to half that player's life total, rounded down. Oracle:{T}: Heartless Hidetsugu deals damage to each player equal to half that player's life total, rounded down.

View File

@@ -1,12 +1,9 @@
Name:Impatience Name:Impatience
ManaCost:2 R ManaCost:2 R
Types:Enchantment Types:Enchantment
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | CheckSVar$ YouCast | SVarCompare$ EQ0 | Execute$ TrigDamageYou | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's end step, if that player didn't cast a spell this turn, CARDNAME deals 2 damage to him or her. T:Mode$ Phase | Phase$ End of Turn | CheckSVar$ TrigCast | SVarCompare$ EQ0 | Execute$ ImpatientDamage | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's end step, if that player didn't cast a spell this turn, CARDNAME deals 2 damage to him or her.
SVar:TrigDamageYou:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 2 SVar:ImpatientDamage:AB$ DealDamage | Cost$ 0 | Defined$ TriggeredPlayer | NumDmg$ 2
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ Opponent | CheckSVar$ OppCast | SVarCompare$ EQ0 | Execute$ TrigDamageOpp | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ At the beginning of each player's end step, if that player didn't cast a spell this turn, CARDNAME deals 2 damage to him or her. SVar:TrigCast:Count$ThisTurnCast_Card.ActivePlayerCtrl
SVar:TrigDamageOpp:AB$ DealDamage | Cost$ 0 | Defined$ Opponent | NumDmg$ 2
SVar:YouCast:Count$ThisTurnCast_Card.YouCtrl
SVar:OppCast:Count$ThisTurnCast_Card.YouDontCtrl
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/impatience.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/impatience.jpg
Oracle:At the beginning of each player's end step, if that player didn't cast a spell this turn, Impatience deals 2 damage to him or her. Oracle:At the beginning of each player's end step, if that player didn't cast a spell this turn, Impatience deals 2 damage to him or her.

View File

@@ -4,7 +4,7 @@ Types:Creature Merfolk Wizard
PT:2/1 PT:2/1
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigKinship | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Kinship - At the beginning of your upkeep, you may look at the top card of your library. If it shares a creature type with CARDNAME, you may reveal it. If you do, each opponent puts the top three cards of his or her library into his or her graveyard. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigKinship | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Kinship - At the beginning of your upkeep, you may look at the top card of your library. If it shares a creature type with CARDNAME, you may reveal it. If you do, each opponent puts the top three cards of his or her library into his or her graveyard.
SVar:TrigKinship:DB$ PeekAndReveal | PeekAmount$ 1 | RevealValid$ Card.sharesCreatureTypeWith | RevealOptional$ True | RememberRevealed$ True | SubAbility$ DBMill SVar:TrigKinship:DB$ PeekAndReveal | PeekAmount$ 1 | RevealValid$ Card.sharesCreatureTypeWith | RevealOptional$ True | RememberRevealed$ True | SubAbility$ DBMill
SVar:DBMill:DB$ Mill | NumCards$ 3 | Defined$ Opponent | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ EQ1 | SubAbility$ DBCleanup SVar:DBMill:DB$ Mill | NumCards$ 3 | Defined$ Player.Opponent | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ EQ1 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Picture:http://www.wizards.com/global/images/magic/general/ink_dissolver.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/ink_dissolver.jpg
Oracle:Kinship - At the beginning of your upkeep, you may look at the top card of your library. If it shares a creature type with Ink Dissolver, you may reveal it. If you do, each opponent puts the top three cards of his or her library into his or her graveyard. Oracle:Kinship - At the beginning of your upkeep, you may look at the top card of your library. If it shares a creature type with Ink Dissolver, you may reveal it. If you do, each opponent puts the top three cards of his or her library into his or her graveyard.

View File

@@ -291,18 +291,17 @@ public class AbilityUtils {
*/ */
public static int calculateAmount(final Card card, String amount, final SpellAbility ability) { public static int calculateAmount(final Card card, String amount, final SpellAbility ability) {
// return empty strings and constants // return empty strings and constants
if (StringUtils.isBlank(amount)) return 0; if (StringUtils.isBlank(amount)) { return 0; }
final boolean startsWithPlus = amount.charAt(0) == '+'; final boolean startsWithPlus = amount.charAt(0) == '+';
if(startsWithPlus) amount = amount.substring(1); if (startsWithPlus) { amount = amount.substring(1); }
// Strip and save sign for calculations // Strip and save sign for calculations
boolean startsWithMinus = amount.charAt(0) == '-'; boolean startsWithMinus = amount.charAt(0) == '-';
int multiplier = startsWithMinus ? -1 : 1; int multiplier = startsWithMinus ? -1 : 1;
if(startsWithMinus) if (startsWithMinus) { amount = amount.substring(1); }
amount = amount.substring(1);
// return result soon for plain numbers // return result soon for plain numbers
if (StringUtils.isNumeric(amount)) return Integer.parseInt(amount) * multiplier; if (StringUtils.isNumeric(amount)) { return Integer.parseInt(amount) * multiplier; }
// These are some special cases - who is implementing them? // These are some special cases - who is implementing them?
if (amount.equals("ChosenX") || amount.equals("ChosenY")) { if (amount.equals("ChosenX") || amount.equals("ChosenY")) {
@@ -320,7 +319,7 @@ public class AbilityUtils {
svarval = ability.getSVar(amount); svarval = ability.getSVar(amount);
} }
if (StringUtils.isBlank(svarval)) { if (StringUtils.isBlank(svarval)) {
if( ability != null) { if (ability != null) {
System.err.printf("SVar '%s' not found in ability, fallback to Card (%s). Ability is (%s)%n", amount, card.getName(), ability); System.err.printf("SVar '%s' not found in ability, fallback to Card (%s). Ability is (%s)%n", amount, card.getName(), ability);
} }
svarval = card.getSVar(amount); svarval = card.getSVar(amount);
@@ -333,21 +332,25 @@ public class AbilityUtils {
} }
// Handle numeric constant coming in svar value // Handle numeric constant coming in svar value
if( StringUtils.isNumeric(svarval) ) if (StringUtils.isNumeric(svarval)) {
return multiplier * Integer.parseInt(svarval); return multiplier * Integer.parseInt(svarval);
}
// Parse Object$Property string // Parse Object$Property string
final String[] calcX = svarval.split("\\$"); final String[] calcX = svarval.split("\\$");
// Incorrect parses mean zero. // Incorrect parses mean zero.
if ((calcX.length == 1) || calcX[1].equals("none")) if ((calcX.length == 1) || calcX[1].equals("none")) {
return 0; return 0;
}
if (calcX[0].startsWith("Count")) if (calcX[0].startsWith("Count")) {
return AbilityUtils.xCount(card, calcX[1], ability) * multiplier; return AbilityUtils.xCount(card, calcX[1], ability) * multiplier;
}
if (calcX[0].startsWith("Number")) if (calcX[0].startsWith("Number")) {
return CardFactoryUtil.xCount(card, svarval) * multiplier; return CardFactoryUtil.xCount(card, svarval) * multiplier;
}
if (calcX[0].startsWith("SVar")) { if (calcX[0].startsWith("SVar")) {
final String[] l = calcX[1].split("/"); final String[] l = calcX[1].split("/");