Added Alpha Brawl.

- DamageAll can now set the damage source with DamageSource param
- EachDamage now handles Remembered defined cards
- DamageAll and EachDamage support StackDescription param now
This commit is contained in:
moomarc
2012-04-04 08:38:51 +00:00
parent 185ee93be7
commit 880bfb1728
3 changed files with 72 additions and 14 deletions

1
.gitattributes vendored
View File

@@ -200,6 +200,7 @@ res/cardsfolder/a/alloy_myr.txt svneol=native#text/plain
res/cardsfolder/a/alluring_scent.txt svneol=native#text/plain
res/cardsfolder/a/alluring_siren.txt svneol=native#text/plain
res/cardsfolder/a/alms.txt -text
res/cardsfolder/a/alpha_brawl.txt -text
res/cardsfolder/a/alpha_kavu.txt svneol=native#text/plain
res/cardsfolder/a/alpha_myr.txt svneol=native#text/plain
res/cardsfolder/a/alpha_status.txt -text

View File

@@ -0,0 +1,17 @@
Name:Alpha Brawl
ManaCost:6 R R
Types:Sorcery
Text:no text
A:SP$ Pump | Cost$ 6 R R | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Select target creature an opponent controls | RememberTargets$ True | StackDescription$ None | SubAbility$ AlphaAttack | SpellDescription$ Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature.
SVar:AlphaAttack:DB$DamageAll | ValidCards$ Creature.YouDontCtrl+IsNotRemembered | DamageSource$ Targeted | NumDmg$ Y | SubAbility$ SucksToBeAlpha | StackDescription$ Targeted creature deals damage equal to its power to each other creature that player controls,
SVar:SucksToBeAlpha:DB$ EachDamage | ValidCards$ Creature.YouDontCtrl+IsNotRemembered | ValidDescription$ of those creatures | NumDmg$ X | DamageDesc$ damage equal to its power | DefinedCards$ Remembered | SubAbility$ DBCleanup | StackDescription$ then each of those creatures deals damage equal to its power to that creature
#NumDmg isn't really used here. It is left for clarity. The AF pulls Damage straight from "X" hardcoded.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$CardPower
SVar:Y:Remembered$CardPower
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/alpha_brawl.jpg
SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/82.jpg
Oracle:Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature.
End

View File

@@ -996,7 +996,26 @@ public class AbilityFactoryDealDamage {
}
final int dmg = this.getNumDamage(sa);
sb.append(name).append(" - Deals " + dmg + " damage to " + desc);
if (!(sa instanceof AbilitySub)) {
sb.append(name).append(" -");
}
sb.append(" ");
if (params.containsKey("StackDescription")) {
sb.append(params.get("StackDescription"));
} else {
final ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(sa.getSourceCard(), af.getMapParams()
.get("DamageSource"), sa);
final Card source = definedSources.get(0);
if (source != sa.getSourceCard()) {
sb.append(source.toString()).append(" deals");
} else {
sb.append("Deals");
}
sb.append(" ").append(dmg).append(" damage to ").append(desc);
}
final AbilitySub abSub = sa.getSubAbility();
if (abSub != null) {
@@ -1226,7 +1245,9 @@ public class AbilityFactoryDealDamage {
*/
private void damageAllResolve(final AbilityFactory af, final SpellAbility sa) {
final HashMap<String, String> params = af.getMapParams();
final Card card = sa.getSourceCard();
final ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(sa.getSourceCard(),
params.get("DamageSource"), sa);
final Card card = definedSources.get(0);
final int dmg = this.getNumDamage(sa);
@@ -1426,13 +1447,17 @@ public class AbilityFactoryDealDamage {
dmg += this.getNumDamage(sa) + " damage";
}
sb.append("Each ").append(desc).append(" deals ").append(dmg).append(" to ");
for (final Player p : tgtPlayers) {
sb.append(p);
}
if (params.containsKey("DefinedCards")) {
if (params.get("DefinedCards").equals("Self")) {
sb.append(" itself");
if (params.containsKey("StackDescription")) {
sb.append(params.get("StackDescription"));
} else {
sb.append("Each ").append(desc).append(" deals ").append(dmg).append(" to ");
for (final Player p : tgtPlayers) {
sb.append(p);
}
if (params.containsKey("DefinedCards")) {
if (params.get("DefinedCards").equals("Self")) {
sb.append(" itself");
}
}
}
sb.append(".");
@@ -1506,11 +1531,26 @@ public class AbilityFactoryDealDamage {
}
}
if (params.containsKey("DefinedCards") && params.get("DefinedCards").equals("Self")) {
for (final Card source : sources) {
final int dmg = CardFactoryUtil.xCount(source, card.getSVar("X"));
// System.out.println(source+" deals "+dmg+" damage to "+source);
source.addDamage(dmg, source);
if (params.containsKey("DefinedCards")) {
if (params.get("DefinedCards").equals("Self")) {
for (final Card source : sources) {
final int dmg = CardFactoryUtil.xCount(source, card.getSVar("X"));
// System.out.println(source+" deals "+dmg+" damage to "+source);
source.addDamage(dmg, source);
}
}
if (params.get("DefinedCards").equals("Remembered")) {
for (final Card source : sources) {
final int dmg = CardFactoryUtil.xCount(source, card.getSVar("X"));
Card rememberedcard;
for (final Object o : sa.getSourceCard().getRemembered()) {
if (o instanceof Card) {
rememberedcard = (Card) o;
// System.out.println(source + " deals " + dmg + " damage to " + rememberedcard);
rememberedcard.addDamage(dmg, source);
}
}
}
}
}
}