- Added the optional parameter "TargetsFromDifferentZone" (allows only targets with different controllers).

- Added Prey Upon.
This commit is contained in:
Sloth
2012-03-02 20:16:54 +00:00
parent 2ff4686328
commit 0cc4a1c471
5 changed files with 34 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -6659,6 +6659,7 @@ res/cardsfolder/p/presence_of_gond.txt svneol=native#text/plain
res/cardsfolder/p/presence_of_the_master.txt svneol=native#text/plain
res/cardsfolder/p/presence_of_the_wise.txt svneol=native#text/plain
res/cardsfolder/p/pretenders_claim.txt svneol=native#text/plain
res/cardsfolder/p/prey_upon.txt -text
res/cardsfolder/p/preys_vengeance.txt -text
res/cardsfolder/p/price_of_progress.txt svneol=native#text/plain
res/cardsfolder/p/prickly_boggart.txt svneol=native#text/plain

View File

@@ -0,0 +1,11 @@
Name:Prey Upon
ManaCost:G
Types:Sorcery
Text:no text
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.)
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/prey_upon.jpg
SetInfo:ISD|Common|http://magiccards.info/scans/en/isd/200.jpg
Oracle:Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.)
End

View File

@@ -416,6 +416,9 @@ public class AbilityFactory {
if (this.mapParams.containsKey("TargetsFromSingleZone")) {
this.abTgt.setSingleZone(true);
}
if (this.mapParams.containsKey("TargetsFromDifferentZone")) {
this.abTgt.setDifferentZone(true);
}
}
this.hasSubAb = this.mapParams.containsKey("SubAbility");

View File

@@ -44,6 +44,7 @@ public class Target {
private Card srcCard;
private boolean uniqueTargets = false;
private boolean singleZone = false;
private boolean differentZone = false;
private TargetChoices choice = null;
/**
@@ -771,4 +772,18 @@ public class Target {
}
return clone;
}
/**
* @return the differentZone
*/
public boolean isDifferentZone() {
return differentZone;
}
/**
* @param different the differentZone to set
*/
public void setDifferentZone(boolean different) {
this.differentZone = different;
}
}

View File

@@ -285,6 +285,10 @@ public class TargetSelection {
if (tgt.isSingleZone() && !targeted.isEmpty()) {
choices = choices.getController(targeted.get(0).getController());
}
// If all cards must be from different zones
if (tgt.isDifferentZone() && !targeted.isEmpty()) {
choices = choices.getController(targeted.get(0).getController().getOpponent());
}
if (zone.contains(Constant.Zone.Battlefield)) {
AllZone.getInputControl().setInput(this.inputTargetSpecific(choices, true, mandatory, objects));