Remove some more references to getOpponent, refactor some cards to support the changes.

This commit is contained in:
elcnesh
2014-07-30 10:50:47 +00:00
parent fb03ed6654
commit 2b3ede060b
11 changed files with 17 additions and 37 deletions

View File

@@ -244,9 +244,6 @@ public final class AbilityFactory {
if (mapParams.containsKey("TargetsFromSingleZone")) { if (mapParams.containsKey("TargetsFromSingleZone")) {
abTgt.setSingleZone(true); abTgt.setSingleZone(true);
} }
if (mapParams.containsKey("TargetsFromDifferentZone")) {
abTgt.setDifferentZone(true);
}
if (mapParams.containsKey("TargetsWithoutSameCreatureType")) { if (mapParams.containsKey("TargetsWithoutSameCreatureType")) {
abTgt.setWithoutSameCreatureType(true); abTgt.setWithoutSameCreatureType(true);
} }

View File

@@ -323,8 +323,8 @@ public class SpellAbilityCondition extends SpellAbilityVariables {
if (this.getLifeTotal().equals("You")) { if (this.getLifeTotal().equals("You")) {
life = activator.getLife(); life = activator.getLife();
} }
if (this.getLifeTotal().equals("Opponent")) { if (this.getLifeTotal().equals("OpponentSmallest")) {
life = activator.getOpponent().getLife(); life = activator.getOpponentsSmallestLifeTotal();
} }
int right = 1; int right = 1;

View File

@@ -354,8 +354,8 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
if (this.getLifeTotal().equals("You")) { if (this.getLifeTotal().equals("You")) {
life = activator.getLife(); life = activator.getLife();
} }
if (this.getLifeTotal().equals("Opponent")) { if (this.getLifeTotal().equals("OpponentSmallest")) {
life = activator.getOpponent().getLife(); life = activator.getOpponentsSmallestLifeTotal();
} }
int right = 1; int right = 1;

View File

@@ -57,7 +57,6 @@ public class TargetRestrictions {
// Additional restrictions that may not fit into Valid // Additional restrictions that may not fit into Valid
private boolean uniqueTargets = false; private boolean uniqueTargets = false;
private boolean singleZone = false; private boolean singleZone = false;
private boolean differentZone = false;
private boolean differentControllers = false; private boolean differentControllers = false;
private boolean sameController = false; private boolean sameController = false;
private boolean withoutSameCreatureType = false; private boolean withoutSameCreatureType = false;
@@ -96,7 +95,6 @@ public class TargetRestrictions {
this.uniqueTargets = target.isUniqueTargets(); this.uniqueTargets = target.isUniqueTargets();
this.singleZone = target.isSingleZone(); this.singleZone = target.isSingleZone();
this.differentControllers = target.isDifferentControllers(); this.differentControllers = target.isDifferentControllers();
this.differentZone = target.isDifferentZone();
this.sameController = target.isSameController(); this.sameController = target.isSameController();
this.withoutSameCreatureType = target.isWithoutSameCreatureType(); this.withoutSameCreatureType = target.isWithoutSameCreatureType();
this.singleTarget = target.isSingleTarget(); this.singleTarget = target.isSingleTarget();
@@ -569,20 +567,6 @@ public class TargetRestrictions {
return clone; return clone;
} }
/**
* @return the differentZone
*/
public boolean isDifferentZone() {
return differentZone;
}
/**
* @param different the differentZone to set
*/
public void setDifferentZone(boolean different) {
this.differentZone = different;
}
/** /**
* @return the randomTarget * @return the randomTarget
*/ */

View File

@@ -3,8 +3,9 @@ ManaCost:4 U
Types:Creature Crab Beast Types:Creature Crab Beast
PT:3/3 PT:3/3
K:Morph:4 U K:Morph:4 U
T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ CrabExchange | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ When CARDNAME is turned face up, you may exchange control of target creature you control and target creature an opponent controls. T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ TrigFaceUp | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ When CARDNAME is turned face up, you may exchange control of target creature you control and target creature an opponent controls.
SVar:CrabExchange:DB$ ExchangeControl | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | TargetsFromDifferentZone$ True | TargetMin$ 2 | TargetMax$ 2 | SpellDescription$ Exchange control of target creature you control and target creature an opponent controls. SVar:TrigFaceUp:AB$ Pump | Cost$ 0 | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ CrabExchange
SVar:CrabExchange:DB$ ExchangeControl | Defined$ ParentTarget | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Choose target creature an opponent controls | SpellDescription$ Exchange control of target creature you control and target creature an opponent controls.
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/chromeshell_crab.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/chromeshell_crab.jpg
Oracle:Morph {4}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)\nWhen Chromeshell Crab is turned face up, you may exchange control of target creature you control and target creature an opponent controls. Oracle:Morph {4}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)\nWhen Chromeshell Crab is turned face up, you may exchange control of target creature you control and target creature an opponent controls.

View File

@@ -1,7 +1,8 @@
Name:Political Trickery Name:Political Trickery
ManaCost:2 U ManaCost:2 U
Types:Sorcery Types:Sorcery
A:SP$ ExchangeControl | Cost$ 2 U | ValidTgts$ Land | TgtPrompt$ Select target land | TargetsFromDifferentZone$ True | TargetMin$ 2 | TargetMax$ 2 | SpellDescription$ Exchange control of target land you control and target land an opponent controls. (This effect lasts indefinitely.) A:SP$ Pump | Cost$ 2 U | ValidTgts$ Land.YouCtrl | TgtPrompt$ Choose target land you control | SubAbility$ DBExchange | SpellDescription$ Exchange control of target land you control and target land an opponent controls. (This effect lasts indefinitely.)
SVar:DBExchange:DB$ ExchangeControl | Defined$ ParentTarget | ValidTgts$ Land.OppCtrl | TgtPrompt$ Choose target land an opponent controls
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/political_trickery.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/political_trickery.jpg
Oracle:Exchange control of target land you control and target land an opponent controls. (This effect lasts indefinitely.) Oracle:Exchange control of target land you control and target land an opponent controls. (This effect lasts indefinitely.)

View File

@@ -1,6 +1,7 @@
Name:Prey Upon Name:Prey Upon
ManaCost:G ManaCost:G
Types:Sorcery Types:Sorcery
A:SP$ Fight | Cost$ G | ValidTgts$ Creature | TgtPrompt$ Select target creature | TargetsFromDifferentZone$ True | TargetMin$ 2 | TargetMax$ 2 | SpellDescription$ Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.) A:SP$ Pump | Cost$ G | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBFight | SpellDescription$ Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.)
SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Choose target creature an opponent controls
SVar:Picture:http://www.wizards.com/global/images/magic/general/prey_upon.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/prey_upon.jpg
Oracle:Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.) Oracle:Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.)

View File

@@ -1,6 +1,7 @@
Name:Triangle of War Name:Triangle of War
ManaCost:1 ManaCost:1
Types:Artifact Types:Artifact
A:AB$ Fight | Cost$ 2 Sac<1/CARDNAME> | ValidTgts$ Creature | TgtPrompt$ Select target creature | TargetsFromDifferentZone$ True | TargetMin$ 2 | TargetMax$ 2 | SpellDescription$ Target creature you control fights target creature an opponent controls. (Each deals damage equal to its power to the other.) A:AB$ Pump | Cost$ 2 Sac<1/CARDNAME> | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBFight | SpellDescription$ Target creature you control fights target creature an opponent controls. (Each deals damage equal to its power to the other.)
SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Choose target creature an opponent controls
SVar:Picture:http://www.wizards.com/global/images/magic/general/triangle_of_war.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/triangle_of_war.jpg
Oracle:{2}, Sacrifice Triangle of War: Target creature you control fights target creature an opponent controls. (Each deals damage equal to its power to the other.) Oracle:{2}, Sacrifice Triangle of War: Target creature you control fights target creature an opponent controls. (Each deals damage equal to its power to the other.)

View File

@@ -3,7 +3,7 @@ ManaCost:B
Types:Creature Vampire Warrior Types:Creature Vampire Warrior
PT:2/2 PT:2/2
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseLife | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you lose 1 life unless an opponent has 10 or less life. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigLoseLife | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you lose 1 life unless an opponent has 10 or less life.
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ You | LifeAmount$ 1 | ConditionLifeTotal$ Opponent | ConditionLifeAmount$ GE11 SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ You | LifeAmount$ 1 | ConditionLifeTotal$ OpponentSmallest | ConditionLifeAmount$ GE11
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/vampire_lacerator.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/vampire_lacerator.jpg
Oracle:At the beginning of your upkeep, you lose 1 life unless an opponent has 10 or less life. Oracle:At the beginning of your upkeep, you lose 1 life unless an opponent has 10 or less life.

View File

@@ -2,8 +2,9 @@ Name:Vedalken Plotter
ManaCost:2 U ManaCost:2 U
Types:Creature Vedalken Wizard Types:Creature Vedalken Wizard
PT:1/1 PT:1/1
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ExchangePlots | TriggerDescription$ When CARDNAME enters the battlefield, exchange control of target land you control and target land an opponent controls. T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigTarget | TriggerDescription$ When CARDNAME enters the battlefield, exchange control of target land you control and target land an opponent controls.
SVar:ExchangePlots:AB$ ExchangeControl | Cost$ 0 | ValidTgts$ Land | TgtPrompt$ Select target land | TargetsFromDifferentZone$ True | TargetMin$ 2 | TargetMax$ 2 | SpellDescription$ Exchange control of target land you control and target land an opponent controls. SVar:TrigTarget:AB$ Pump | Cost$ 0 | ValidTgts$ Land.YouCtrl | TgtPrompt$ Choose target land you control | SubAbility$ DBExchange | SpellDescription$ Exchange control of target land you control and target land an opponent controls.
SVar:DBExchange:DB$ ExchangeControl | Defined$ ParentTarget | ValidTgts$ Land.OppCtrl | TgtPrompt$ Choose target land an opponent controls
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/vedalken_plotter.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/vedalken_plotter.jpg
Oracle:When Vedalken Plotter enters the battlefield, exchange control of target land you control and target land an opponent controls. Oracle:When Vedalken Plotter enters the battlefield, exchange control of target land you control and target land an opponent controls.

View File

@@ -124,12 +124,6 @@ public final class InputSelectTargets extends InputSyncronizedBase {
return false; return false;
} }
// If all cards must be from different zones
if (tgt.isDifferentZone() && lastTarget != null && !card.getController().equals(lastTarget.getController().getOpponent())) {
showMessage(sa.getHostCard() + " - Cannot target this card (not in different zones)");
return false;
}
// If the cards can't share a creature type // If the cards can't share a creature type
if (tgt.isWithoutSameCreatureType() && lastTarget != null && card.sharesCreatureTypeWith(lastTarget)) { if (tgt.isWithoutSameCreatureType() && lastTarget != null && card.sharesCreatureTypeWith(lastTarget)) {
showMessage(sa.getHostCard() + " - Cannot target this card (should not share a creature type)"); showMessage(sa.getHostCard() + " - Cannot target this card (should not share a creature type)");