merged r15946-r15965 from the Trunk into CloneFix branch

This commit is contained in:
ArsenalNut
2012-06-23 22:47:19 +00:00
21 changed files with 11087 additions and 10904 deletions

1
.gitattributes vendored
View File

@@ -1121,6 +1121,7 @@ res/cardsfolder/b/brass_talon_chimera.txt svneol=native#text/plain
res/cardsfolder/b/brassclaw_orcs.txt svneol=native#text/plain res/cardsfolder/b/brassclaw_orcs.txt svneol=native#text/plain
res/cardsfolder/b/bravado.txt svneol=native#text/plain res/cardsfolder/b/bravado.txt svneol=native#text/plain
res/cardsfolder/b/brave_the_elements.txt svneol=native#text/plain res/cardsfolder/b/brave_the_elements.txt svneol=native#text/plain
res/cardsfolder/b/brawl.txt -text
res/cardsfolder/b/brawn.txt svneol=native#text/plain res/cardsfolder/b/brawn.txt svneol=native#text/plain
res/cardsfolder/b/breach.txt svneol=native#text/plain res/cardsfolder/b/breach.txt svneol=native#text/plain
res/cardsfolder/b/break_asunder.txt svneol=native#text/plain res/cardsfolder/b/break_asunder.txt svneol=native#text/plain

View File

@@ -97,6 +97,25 @@ Fixes/Features:
- CheckStyle. - CheckStyle.
- CheckStyle. - CheckStyle.
- Added the recent commit logs to changes.txt. Preparing for the snapshot build release. - Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
- Fixed continuous static abilities.
- merged r15910-r15940 from the Trunk into CloneFix branch
- CheckStyle.
- Abilitystealers besides Havengul Lich had the wrong "Affected" parameter.
- merged r15940-r15946 from the Trunk into CloneFix branch
- Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
- Commented out one redundant version of copySpellontoStack.
- Fixed pumpMandatoryTarget not checking shroud, etc.
- Updated all-prices.txt.
- Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
- Prevented some SpellCast triggers from crashing when Fireball (and similar hardcoded cards) is cast (they still won't trigger correctly because of missing info).
- Fixed The Abyss and similar cards.
- Fixed Targeting for Sudden Disappearance.
- Fixed Heartwood Storyteller.
- Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
- CheckStyle.
- Fixed stolen Doubling Cube ability only doubling white mana.
- Fixed Doubling Cube not doubling colorless mana.
- Added the recent commit logs to changes.txt. Preparing for the snapshot build release.
Many people helped with this version. A special thank you goes out to them. (Attempted to list names alphabetically): Many people helped with this version. A special thank you goes out to them. (Attempted to list names alphabetically):
@@ -106,19 +125,31 @@ Many people helped with this version. A special thank you goes out to them. (Att
Added cards to the M13 branch and these are not yet available in the snapshot builds: Added cards to the M13 branch and these are not yet available in the snapshot builds:
Archaeomancer
Captain's Call
Murder
Warclamp Mastiff
Ajani's Sunstriker Ajani's Sunstriker
Archaeomancer
Attended Knight Attended Knight
Bond Beetle Bond Beetle
Captain's Call
Cathedral of War
Cower in Fear
Crippling Blight
Crusader of Odric Crusader of Odric
Duskmantle Prowler
Duty-Bound Dead
Faerie Invaders Faerie Invaders
Guardian Lions Guardian Lions
Harbor Bandit
Hydrosurge
Knight of Glory Knight of Glory
Liliana of the Dark Realms
Mind Sculpt
Murder
Rhox Faithmender Rhox Faithmender
Sublime Archangel Sublime Archangel
Talrand's Invocation
Tricks of the Trade
Warclamp Mastiff
Watercourser
Added many cards, including: Added many cards, including:
@@ -128,6 +159,9 @@ Experiment Kraj
Myr Welder Myr Welder
Necrotic Ooze Necrotic Ooze
Havengul Lich Havengul Lich
Bulwark
Cabal Interrogator
Brawl
end end

View File

@@ -0,0 +1,13 @@
Name:Brawl
ManaCost:3 R R
Types:Instant
Text:no text
A:SP$ AnimateAll | Cost$ 3 R R | ValidCards$ Creature | Abilities$ ThrowPunch | sVars$ BrawlX | SpellDescription$ Until end of turn, all creatures gain "T: This creature deals damage equal to its power to target creature."
SVar:ThrowPunch:AB$ DealDamage | Cost$ T | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ BrawlX | References$ BrawlX | SpellDescription$ This creature deals damage equal to its power to target creature.
SVar:BrawlX:Count$CardPower
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/brawl.jpg
SetInfo:MMQ|Rare|http://magiccards.info/scans/en/mm/178.jpg
Oracle:Until end of turn, all creatures gain "{T}: This creature deals damage equal to its power to target creature."
End

View File

@@ -6,12 +6,14 @@ A:AB$ Mana | Cost$ 3 T | Produced$ W | Amount$ A | SubAbility$ ManaBlue | Refere
SVar:ManaBlue:DB$Mana | Produced$ U | Amount$ B | SubAbility$ ManaBlack | References$ B SVar:ManaBlue:DB$Mana | Produced$ U | Amount$ B | SubAbility$ ManaBlack | References$ B
SVar:ManaBlack:DB$Mana | Produced$ B | Amount$ C | SubAbility$ ManaRed | References$ C SVar:ManaBlack:DB$Mana | Produced$ B | Amount$ C | SubAbility$ ManaRed | References$ C
SVar:ManaRed:DB$Mana | Produced$ R | Amount$ D | SubAbility$ ManaGreen | References$ D SVar:ManaRed:DB$Mana | Produced$ R | Amount$ D | SubAbility$ ManaGreen | References$ D
SVar:ManaGreen:DB$Mana | Produced$ G | Amount$ E | References$ E SVar:ManaGreen:DB$Mana | Produced$ G | Amount$ E | SubAbility$ ManaColorless | References$ E
SVar:ManaColorless:DB$Mana | Produced$ 1 | Amount$ F | References$ F
SVar:A:Count$ManaPool:white SVar:A:Count$ManaPool:white
SVar:B:Count$ManaPool:blue SVar:B:Count$ManaPool:blue
SVar:C:Count$ManaPool:black SVar:C:Count$ManaPool:black
SVar:D:Count$ManaPool:red SVar:D:Count$ManaPool:red
SVar:E:Count$ManaPool:green SVar:E:Count$ManaPool:green
SVar:F:Count$ManaPool:colorless
#AI doesn't have a mana pool #AI doesn't have a mana pool
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare

View File

@@ -3,8 +3,8 @@ ManaCost:1 G G
Types:Creature Treefolk Types:Creature Treefolk
Text:no text Text:no text
PT:2/3 PT:2/3
T:Mode$ SpellCast | TriggerZones$ Battlefield | ValidCard$ Spell.nonCreature | ValidActivatingPlayer$ Opponent | Execute$ TrigDrawYou | OptionalDecider$ You |TriggerDescription$ Whenever a player casts a noncreature spell, each of that player's opponents may draw a card. T:Mode$ SpellCast | TriggerZones$ Battlefield | ValidCard$ Card.nonCreature | ValidActivatingPlayer$ Opponent | Execute$ TrigDrawYou | OptionalDecider$ You |TriggerDescription$ Whenever a player casts a noncreature spell, each of that player's opponents may draw a card.
T:Mode$ SpellCast | TriggerZones$ Battlefield | ValidCard$ Spell.nonCreature | ValidActivatingPlayer$ You | Execute$ TrigDrawOpp | OptionalDecider$ Opponent |TriggerDescription$ Whenever a player casts a noncreature spell, each of that player's opponents may draw a card. | Secondary$ True T:Mode$ SpellCast | TriggerZones$ Battlefield | ValidCard$ Card.nonCreature | ValidActivatingPlayer$ You | Execute$ TrigDrawOpp | OptionalDecider$ Opponent |TriggerDescription$ Whenever a player casts a noncreature spell, each of that player's opponents may draw a card. | Secondary$ True
SVar:TrigDrawYou:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1 SVar:TrigDrawYou:AB$ Draw | Cost$ 0 | Defined$ You | NumCards$ 1
SVar:TrigDrawOpp:AB$ Draw | Cost$ 0 | Defined$ Opponent | NumCards$ 1 SVar:TrigDrawOpp:AB$ Draw | Cost$ 0 | Defined$ Opponent | NumCards$ 1
SVar:Rarity:Rare SVar:Rarity:Rare

View File

@@ -5,7 +5,7 @@ Text:no text
A:SP$ ChangeZoneAll | Cost$ 5 W | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Player | TgtPrompt$ Select target player | ChangeType$ Permanent.nonLand | RememberChanged$ True | ForgetOtherRemembered$ True | SubAbility$ DelTrig | IsCurse$ True | SpellDescription$ Exile all nonland permanents target player controls. Return the exiled cards to the battlefield under their owners control at the beginning of the next end step. A:SP$ ChangeZoneAll | Cost$ 5 W | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Player | TgtPrompt$ Select target player | ChangeType$ Permanent.nonLand | RememberChanged$ True | ForgetOtherRemembered$ True | SubAbility$ DelTrig | IsCurse$ True | SpellDescription$ Exile all nonland permanents target player controls. Return the exiled cards to the battlefield under their owners control at the beginning of the next end step.
SVar:DelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturn | TriggerDescription$ Return exiled permanents to the battlefield. SVar:DelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturn | TriggerDescription$ Return exiled permanents to the battlefield.
SVar:TrigReturn:DB$ChangeZoneAll | Origin$ Exile | Destination$ Battlefield | ChangeType$ Card.IsRemembered SVar:TrigReturn:DB$ChangeZoneAll | Origin$ Exile | Destination$ Battlefield | ChangeType$ Card.IsRemembered
SVar:PlayMain1:TRUE SVar:RemAIDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sudden_disappearance.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/sudden_disappearance.jpg
SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/23.jpg SetInfo:DKA|Rare|http://magiccards.info/scans/en/dka/23.jpg

View File

@@ -1,10 +1,16 @@
Name:Yawgmoth Demon Name:Yawgmoth Demon
ManaCost:4 B B ManaCost:4 B B
Types:Creature Demon Types:Creature Demon
Text:At the beginning of your upkeep, you may sacrifice an artifact. If you don't, tap Yawgmoth Demon and it deals 2 damage to you. Text:no text
PT:6/6 PT:6/6
K:Flying K:Flying
K:First Strike K:First Strike
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigElderSpawnSacrifice | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may sacrifice an artifact. If you don't, tap CARDNAME and it deals 2 damage to you.
SVar:TrigElderSpawnSacrifice:AB$ Sacrifice | Cost$ 0 | SacValid$ Artifact | Optional$ True | RememberSacrificed$ True | SubAbility$ DBElderSpawnSacrificeMe
SVar:DBElderSpawnSacrificeMe:DB$ Tap | Defined$ Self | ConditionDefined$ Remembered | ConditionPresent$ Artifact | ConditionCompare$ EQ0 | SubAbility$ DBElderSpawnDamage
SVar:DBElderSpawnDamage:DB$ DealDamage | Defined$ You | NumDmg$ 2 | ConditionDefined$ Remembered | ConditionPresent$ Artifact | ConditionCompare$ EQ0 | SubAbility$ DBElderSpawnCleanup
SVar:DBElderSpawnCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:RemAIDeck:True
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/yawgmoth_demon.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/yawgmoth_demon.jpg

File diff suppressed because it is too large Load Diff

View File

@@ -2383,11 +2383,11 @@ public final class AbilityFactoryChangeZone {
humanType = AbilityFactory.filterListByType(humanType, params.get("ChangeType"), sa); humanType = AbilityFactory.filterListByType(humanType, params.get("ChangeType"), sa);
CardList computerType = AllZone.getComputerPlayer().getCardsIn(origin); CardList computerType = AllZone.getComputerPlayer().getCardsIn(origin);
computerType = AbilityFactory.filterListByType(computerType, params.get("ChangeType"), sa); computerType = AbilityFactory.filterListByType(computerType, params.get("ChangeType"), sa);
final Target tgt = sa.getTarget();
// TODO improve restrictions on when the AI would want to use this // TODO improve restrictions on when the AI would want to use this
// spBounceAll has some AI we can compare to. // spBounceAll has some AI we can compare to.
if (origin.equals(ZoneType.Hand) || origin.equals(ZoneType.Library)) { if (origin.equals(ZoneType.Hand) || origin.equals(ZoneType.Library)) {
final Target tgt = sa.getTarget();
if (tgt != null) { if (tgt != null) {
if (AllZone.getHumanPlayer().getCardsIn(ZoneType.Hand).isEmpty() if (AllZone.getHumanPlayer().getCardsIn(ZoneType.Hand).isEmpty()
|| !AllZone.getHumanPlayer().canBeTargetedBy(sa)) { || !AllZone.getHumanPlayer().canBeTargetedBy(sa)) {
@@ -2403,6 +2403,15 @@ public final class AbilityFactoryChangeZone {
// occur // occur
// if only creatures are affected evaluate both lists and pass only // if only creatures are affected evaluate both lists and pass only
// if human creatures are more valuable // if human creatures are more valuable
if (tgt != null) {
if (AllZone.getHumanPlayer().getCardsIn(ZoneType.Hand).isEmpty()
|| !AllZone.getHumanPlayer().canBeTargetedBy(sa)) {
return false;
}
tgt.resetTargets();
tgt.addTarget(AllZone.getHumanPlayer());
computerType.clear();
}
if ((humanType.getNotType("Creature").size() == 0) && (computerType.getNotType("Creature").size() == 0)) { if ((humanType.getNotType("Creature").size() == 0) && (computerType.getNotType("Creature").size() == 0)) {
if ((CardFactoryUtil.evaluateCreatureList(computerType) + 200) >= CardFactoryUtil if ((CardFactoryUtil.evaluateCreatureList(computerType) + 200) >= CardFactoryUtil
.evaluateCreatureList(humanType)) { .evaluateCreatureList(humanType)) {
@@ -2420,7 +2429,6 @@ public final class AbilityFactoryChangeZone {
return false; return false;
} }
} else if (origin.equals(ZoneType.Graveyard)) { } else if (origin.equals(ZoneType.Graveyard)) {
final Target tgt = sa.getTarget();
if (tgt != null) { if (tgt != null) {
if (AllZone.getHumanPlayer().getCardsIn(ZoneType.Graveyard).isEmpty() if (AllZone.getHumanPlayer().getCardsIn(ZoneType.Graveyard).isEmpty()
|| !AllZone.getHumanPlayer().canBeTargetedBy(sa)) { || !AllZone.getHumanPlayer().canBeTargetedBy(sa)) {

View File

@@ -67,9 +67,13 @@ public class AbilityFactoryMana {
*/ */
public static SpellAbility createAbilityMana(final AbilityFactory abilityFactory, final String produced) { public static SpellAbility createAbilityMana(final AbilityFactory abilityFactory, final String produced) {
final String restrictions = abilityFactory.getMapParams().get("RestrictValid"); final String restrictions = abilityFactory.getMapParams().get("RestrictValid");
final AbilityMana abMana = new AbilityMana(abilityFactory.getHostCard(), abilityFactory.getAbCost(), produced, restrictions) { class abFactoryMana extends AbilityMana {
private static final long serialVersionUID = -1933592438783630254L; private static final long serialVersionUID = -1933592438783630254L;
public abFactoryMana(Card ca,Cost co, String s, String s2) {
super(ca,co,s,s2);
}
private final AbilityFactory af = abilityFactory; private final AbilityFactory af = abilityFactory;
@Override @Override
@@ -92,7 +96,15 @@ public class AbilityFactoryMana {
public String getManaProduced() { public String getManaProduced() {
return manaGenerated(this, this.af, this); return manaGenerated(this, this.af, this);
} }
};
@Override
public AbilityActivated getCopy() {
AbilityActivated res = new abFactoryMana(getSourceCard(), getPayCosts(), this.getOrigProduced(), getManaRestrictions());
CardFactoryUtil.copySpellAbility(this, res);
return res;
}
}
final AbilityMana abMana = new abFactoryMana(abilityFactory.getHostCard(), abilityFactory.getAbCost(), produced, restrictions);
return abMana; return abMana;
} }
@@ -172,6 +184,7 @@ public class AbilityFactoryMana {
AbilitySub res = new DrawbackMana(getSourceCard(), AbilitySub res = new DrawbackMana(getSourceCard(),
getTarget() == null ? null : new Target(getTarget())); getTarget() == null ? null : new Target(getTarget()));
CardFactoryUtil.copySpellAbility(this, res); CardFactoryUtil.copySpellAbility(this, res);
((DrawbackMana)res).setTmp((AbilityMana)tmpMana.getCopy());
return res; return res;
} }
@@ -180,7 +193,7 @@ public class AbilityFactoryMana {
private final AbilityFactory af = abilityFactory; private final AbilityFactory af = abilityFactory;
// To get the mana to resolve properly, we need the spell to contain an AbilityMana // To get the mana to resolve properly, we need the spell to contain an AbilityMana
private final Cost tmp = new Cost(abilityFactory.getHostCard(), "0", false); private final Cost tmp = new Cost(abilityFactory.getHostCard(), "0", false);
private final AbilityMana tmpMana = new AbilityMana(abilityFactory.getHostCard(), this.tmp, produced, restrictions) { private AbilityMana tmpMana = new AbilityMana(abilityFactory.getHostCard(), this.tmp, produced, restrictions) {
private static final long serialVersionUID = 1454043766057140491L; private static final long serialVersionUID = 1454043766057140491L;
@Override @Override
@@ -191,6 +204,10 @@ public class AbilityFactoryMana {
}; };
public void setTmp(AbilityMana newTmp) {
tmpMana = newTmp;
}
@Override @Override
public String getStackDescription() { public String getStackDescription() {
// when getStackDesc is called, just build exactly what is // when getStackDesc is called, just build exactly what is
@@ -477,9 +494,13 @@ public class AbilityFactoryMana {
* @return a {@link forge.card.spellability.SpellAbility} object. * @return a {@link forge.card.spellability.SpellAbility} object.
*/ */
public static SpellAbility createAbilityManaReflected(final AbilityFactory abilityFactory, final String produced) { public static SpellAbility createAbilityManaReflected(final AbilityFactory abilityFactory, final String produced) {
final AbilityMana abMana = new AbilityMana(abilityFactory.getHostCard(), abilityFactory.getAbCost(), produced) { class abFactoryReflectedMana extends AbilityMana {
private static final long serialVersionUID = -1933592438783630254L; private static final long serialVersionUID = -1933592438783630254L;
public abFactoryReflectedMana(Card ca,Cost co,String s) {
super(ca,co,s);
}
private final AbilityFactory af = abilityFactory; private final AbilityFactory af = abilityFactory;
@Override @Override
@@ -498,7 +519,15 @@ public class AbilityFactoryMana {
return false; return false;
} }
}; @Override
public AbilityActivated getCopy() {
AbilityActivated res = new abFactoryReflectedMana(getSourceCard(), getPayCosts(), getManaProduced() );
CardFactoryUtil.copySpellAbility(this, res);
((AbilityMana)res).setReflectedMana(true);
return res;
}
}
final AbilityMana abMana = new abFactoryReflectedMana(abilityFactory.getHostCard(), abilityFactory.getAbCost(), produced);
abMana.setReflectedMana(true); abMana.setReflectedMana(true);
return abMana; return abMana;
} }

View File

@@ -888,6 +888,7 @@ public class AbilityFactoryPump {
CardList list = AllZoneUtil.getCardsIn(ZoneType.Battlefield); CardList list = AllZoneUtil.getCardsIn(ZoneType.Battlefield);
final Target tgt = sa.getTarget(); final Target tgt = sa.getTarget();
list = list.getValidCards(tgt.getValidTgts(), sa.getActivatingPlayer(), sa.getSourceCard()); list = list.getValidCards(tgt.getValidTgts(), sa.getActivatingPlayer(), sa.getSourceCard());
list = list.getTargetableCards(sa);
if (list.size() < tgt.getMinTargets(sa.getSourceCard(), sa)) { if (list.size() < tgt.getMinTargets(sa.getSourceCard(), sa)) {
tgt.resetTargets(); tgt.resetTargets();

View File

@@ -282,7 +282,7 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
* @param bCopyDetails * @param bCopyDetails
* a boolean. * a boolean.
*/ */
@Override /*@Override
public final void copySpellontoStack(final Card source, final Card original, final boolean bCopyDetails) { public final void copySpellontoStack(final Card source, final Card original, final boolean bCopyDetails) {
final SpellAbility[] sas = original.getSpellAbility(); final SpellAbility[] sas = original.getSpellAbility();
SpellAbility sa = null; SpellAbility sa = null;
@@ -360,7 +360,7 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
} else if (copySA.canPlayAI()) { } else if (copySA.canPlayAI()) {
ComputerUtil.playStackFree(copySA); ComputerUtil.playStackFree(copySA);
} }
} }*/
/** /**
* <p> * <p>

View File

@@ -87,7 +87,7 @@ public interface CardFactoryInterface extends Iterable<Card> {
* @param bCopyDetails * @param bCopyDetails
* a boolean. * a boolean.
*/ */
void copySpellontoStack(Card source, Card original, boolean bCopyDetails); //void copySpellontoStack(Card source, Card original, boolean bCopyDetails);
/** /**
* <p> * <p>

View File

@@ -927,7 +927,7 @@ public class CardFactorySorceries {
this.printCardTargets(); this.printCardTargets();
Log.debug("Fireball", "Fireball - player targets: "); Log.debug("Fireball", "Fireball - player targets: ");
this.printPlayerTargets(); this.printPlayerTargets();
if (card.getController().isComputer()) { if (this.getActivatingPlayer().isComputer()) {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append(cardName).append(" - Computer causes "); sb.append(cardName).append(" - Computer causes ");
sb.append(damage).append(" to:\n\n"); sb.append(damage).append(" to:\n\n");

View File

@@ -153,7 +153,7 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
public AbilityMana(final Card sourceCard, final Cost cost, final String produced, final int num, final String restrictions) { public AbilityMana(final Card sourceCard, final Cost cost, final String produced, final int num, final String restrictions) {
super(sourceCard, cost, null); super(sourceCard, cost, null);
this.origProduced = produced; origProduced = produced;
this.amount = num; this.amount = num;
if (restrictions != null) { if (restrictions != null) {
this.manaRestrictions = restrictions; this.manaRestrictions = restrictions;
@@ -258,7 +258,7 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
else { else {
try { try {
// if baseMana is an integer(colorless), just multiply amount and baseMana // if baseMana is an integer(colorless), just multiply amount and baseMana
int base = Integer.parseInt(this.origProduced); int base = Integer.parseInt(this.getOrigProduced());
sb.append(base * this.amount); sb.append(base * this.amount);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
for (int i = 0; i < this.amount; i++) { for (int i = 0; i < this.amount; i++) {
@@ -356,13 +356,13 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public final String mana() { public final String mana() {
if (this.origProduced.contains("Chosen")) { if (this.getOrigProduced().contains("Chosen")) {
if (this.getSourceCard() != null && !this.getSourceCard().getChosenColor().isEmpty()) { if (this.getSourceCard() != null && !this.getSourceCard().getChosenColor().isEmpty()) {
return InputPayManaCostUtil.getShortColorString(this.getSourceCard() return InputPayManaCostUtil.getShortColorString(this.getSourceCard()
.getChosenColor().get(0)); .getChosenColor().get(0));
} }
} }
return this.origProduced; return this.getOrigProduced();
} }
/** /**
@@ -374,7 +374,7 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
* a {@link java.lang.String} object. * a {@link java.lang.String} object.
*/ */
public final void setMana(final String s) { public final void setMana(final String s) {
this.origProduced = s; origProduced = s;
} }
/** /**
@@ -473,7 +473,7 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
* @return a boolean. * @return a boolean.
*/ */
public boolean isAnyMana() { public boolean isAnyMana() {
return this.origProduced.contains("Any"); return this.getOrigProduced().contains("Any");
} }
/** /**
@@ -490,14 +490,14 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
return true; return true;
} }
if (this.origProduced.contains("Chosen")) { if (this.getOrigProduced().contains("Chosen")) {
if (this.getSourceCard() != null && !this.getSourceCard().getChosenColor().isEmpty() if (this.getSourceCard() != null && !this.getSourceCard().getChosenColor().isEmpty()
&& InputPayManaCostUtil.getShortColorString(this.getSourceCard().getChosenColor().get(0)) && InputPayManaCostUtil.getShortColorString(this.getSourceCard().getChosenColor().get(0))
.contains(s)) { .contains(s)) {
return true; return true;
} }
} }
return this.origProduced.contains(s); return this.getOrigProduced().contains(s);
} }
/** /**
@@ -508,8 +508,8 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
* @return a boolean. * @return a boolean.
*/ */
public final boolean isBasic() { public final boolean isBasic() {
if (this.origProduced.length() != 1 && !this.origProduced.contains("Any") if (this.getOrigProduced().length() != 1 && !this.getOrigProduced().contains("Any")
&& !this.origProduced.contains("Chosen")) { && !this.getOrigProduced().contains("Chosen")) {
return false; return false;
} }
@@ -600,5 +600,12 @@ public class AbilityMana extends AbilityActivated implements java.io.Serializabl
return (41 * (41 + this.getType().hashCode())); return (41 * (41 + this.getType().hashCode()));
} }
/**
* @return the origProduced
*/
public String getOrigProduced() {
return origProduced;
}
} // end class AbilityMana } // end class AbilityMana

View File

@@ -1636,9 +1636,14 @@ public abstract class SpellAbility {
* @return a boolean. * @return a boolean.
*/ */
public final boolean canTarget(final GameEntity entity) { public final boolean canTarget(final GameEntity entity) {
if (this.getTarget() == null) {
if (entity.canBeTargetedBy(this)) {
return true;
}
return false;
}
if (entity.isValid(this.getTarget().getValidTgts(), this.getActivatingPlayer(), this.getSourceCard()) if (entity.isValid(this.getTarget().getValidTgts(), this.getActivatingPlayer(), this.getSourceCard())
&& (this.getTarget() == null || !this.getTarget().isUniqueTargets() && (!this.getTarget().isUniqueTargets() || !TargetSelection.getUniqueTargets(this).contains(entity))
|| !TargetSelection.getUniqueTargets(this).contains(entity))
&& entity.canBeTargetedBy(this)) { && entity.canBeTargetedBy(this)) {
return true; return true;
} }

View File

@@ -288,7 +288,7 @@ public class TriggerHandler {
// This is done to allow the list of triggers to be modified while // This is done to allow the list of triggers to be modified while
// triggers are running. // triggers are running.
final ArrayList<Trigger> delayedTriggersWorkingCopy = new ArrayList<Trigger>(this.delayedTriggers); final ArrayList<Trigger> delayedTriggersWorkingCopy = new ArrayList<Trigger>(this.delayedTriggers);
CardList allCards = AllZoneUtil.getCardsIn(ZoneType.StaticAbilitiesSourceZones); CardList allCards = AllZoneUtil.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES);
boolean checkStatics = false; boolean checkStatics = false;
// Static triggers // Static triggers
@@ -305,7 +305,7 @@ public class TriggerHandler {
} }
// AP // AP
allCards = playerAP.getCardsIn(ZoneType.StaticAbilitiesSourceZones); allCards = playerAP.getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES);
allCards.addAll(AllZoneUtil.getCardsIn(ZoneType.Stack).getController(playerAP)); allCards.addAll(AllZoneUtil.getCardsIn(ZoneType.Stack).getController(playerAP));
if (runParams.containsKey("Destination") && runParams.containsKey("Card")) { if (runParams.containsKey("Destination") && runParams.containsKey("Card")) {
String type = (String) runParams.get("Destination"); String type = (String) runParams.get("Destination");
@@ -330,7 +330,7 @@ public class TriggerHandler {
} }
// NAP // NAP
allCards = playerAP.getOpponent().getCardsIn(ZoneType.StaticAbilitiesSourceZones); allCards = playerAP.getOpponent().getCardsIn(ZoneType.STATIC_ABILITIES_SOURCE_ZONES);
allCards.addAll(AllZoneUtil.getCardsIn(ZoneType.Stack).getController(playerAP.getOpponent())); allCards.addAll(AllZoneUtil.getCardsIn(ZoneType.Stack).getController(playerAP.getOpponent()));
for (final Card c : allCards) { for (final Card c : allCards) {
for (final Trigger t : c.getTriggers()) { for (final Trigger t : c.getTriggers()) {

View File

@@ -86,7 +86,7 @@ public class TriggerSpellAbilityCast extends Trigger {
} }
if (this.getMapParams().containsKey("ValidActivatingPlayer")) { if (this.getMapParams().containsKey("ValidActivatingPlayer")) {
if (!matchesValid(si.getActivatingPlayer(), this.getMapParams().get("ValidActivatingPlayer") if (si == null || !matchesValid(si.getActivatingPlayer(), this.getMapParams().get("ValidActivatingPlayer")
.split(","), this.getHostCard())) { .split(","), this.getHostCard())) {
return false; return false;
} }

View File

@@ -80,7 +80,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
Upkeep.upkeepEcho(); Upkeep.upkeepEcho();
Upkeep.upkeepTheAbyss(); Upkeep.upkeepTheAbyss();
Upkeep.upkeepYawgmothDemon(); //Upkeep.upkeepYawgmothDemon();
Upkeep.upkeepDropOfHoney(); Upkeep.upkeepDropOfHoney();
Upkeep.upkeepDemonicHordes(); Upkeep.upkeepDemonicHordes();
Upkeep.upkeepTangleWire(); Upkeep.upkeepTangleWire();
@@ -533,8 +533,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append(abyss.getName()).append(" - destroy a nonartifact creature of your choice."); sb.append(abyss.getName()).append(" - destroy a nonartifact creature of your choice.");
sacrificeCreature.setStackDescription(sb.toString()); sacrificeCreature.setStackDescription(sb.toString());
AllZone.getStack().addSimultaneousStackEntry(sacrificeCreature); AllZone.getStack().addAndUnfreeze(sacrificeCreature);
} // end for } // end for
} // The Abyss } // The Abyss
@@ -543,12 +542,12 @@ public class Upkeep extends Phase implements java.io.Serializable {
* upkeepYawgmothDemon. * upkeepYawgmothDemon.
* </p> * </p>
*/ */
private static void upkeepYawgmothDemon() { /*private static void upkeepYawgmothDemon() {
/* /*
* At the beginning of your upkeep, you may sacrifice an artifact. If * At the beginning of your upkeep, you may sacrifice an artifact. If
* you don't, tap Yawgmoth Demon and it deals 2 damage to you. * you don't, tap Yawgmoth Demon and it deals 2 damage to you.
*/ */
final Player player = Singletons.getModel().getGameState().getPhaseHandler().getPlayerTurn(); /*final Player player = Singletons.getModel().getGameState().getPhaseHandler().getPlayerTurn();
final CardList cards = player.getCardsIn(ZoneType.Battlefield, "Yawgmoth Demon"); final CardList cards = player.getCardsIn(ZoneType.Battlefield, "Yawgmoth Demon");
for (int i = 0; i < cards.size(); i++) { for (int i = 0; i < cards.size(); i++) {
@@ -611,7 +610,7 @@ public class Upkeep extends Phase implements java.io.Serializable {
AllZone.getStack().addSimultaneousStackEntry(sacrificeArtifact); AllZone.getStack().addSimultaneousStackEntry(sacrificeArtifact);
} // end for } // end for
} }*/
/** /**
* <p> * <p>

View File

@@ -665,7 +665,7 @@ public class MagicStack extends MyObservable {
@Override @Override
public void execute() { public void execute() {
for (int i = 0; i < sp.getSourceCard().getReplicateMagnitude(); i++) { for (int i = 0; i < sp.getSourceCard().getReplicateMagnitude(); i++) {
AllZone.getCardFactory().copySpellontoStack(sp.getSourceCard(), sp.getSourceCard(), false); AllZone.getCardFactory().copySpellontoStack(sp.getSourceCard(), sp.getSourceCard(), sp, false);
} }
} }
}; };

View File

@@ -33,7 +33,7 @@ public enum ZoneType {
/** Ante. */ /** Ante. */
Ante(false); Ante(false);
public static final ZoneType[] StaticAbilitiesSourceZones = new ZoneType[]{Battlefield, Graveyard, Exile/*, Hand*/}; public static final ZoneType[] STATIC_ABILITIES_SOURCE_ZONES = new ZoneType[]{Battlefield, Graveyard, Exile/*, Hand*/};
private final boolean holdsHiddenInfo; private final boolean holdsHiddenInfo;
private ZoneType(boolean holdsHidden) { private ZoneType(boolean holdsHidden) {