EDH Power updates

This commit is contained in:
spjspj 2017-05-16 23:14:33 +10:00
parent 71fad444c1
commit 3cb7424dfd
2 changed files with 26 additions and 6 deletions

View file

@ -45,6 +45,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
boolean buyback = false;
boolean cascade = false;
boolean cantBe = false;
boolean cantUntap = false;
boolean copy = false;
boolean costLessEach = false;
boolean createToken = false;
@ -94,6 +95,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
boolean whenCounterThatSpell = false;
boolean xCost = false;
boolean youControlTarget = false;
boolean yourOpponentsControl = false;
for (String str : card.getRules()) {
String s = str.toLowerCase();
@ -101,6 +103,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
anyNumberOfTarget |= s.contains("any number");
buyback |= s.contains("buyback");
cantBe |= s.contains("can't be");
cantUntap |= s.contains("can't untap");
cascade |= s.contains("cascade");
copy |= s.contains("copy");
costLessEach |= s.contains("cost") || s.contains("less") || s.contains("each");
@ -151,6 +154,7 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
whenCounterThatSpell |= s.contains("when") && s.contains("counter that spell");
wheneverEnters |= s.contains("when") && s.contains("another") && s.contains("enters");
youControlTarget |= s.contains("you control target");
yourOpponentsControl |= s.contains("your opponents control");
}
if (extraTurns) {
@ -165,6 +169,9 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
if (annihilator) {
thisMaxPower = Math.max(thisMaxPower, 5);
}
if (cantUntap) {
thisMaxPower = Math.max(thisMaxPower, 5);
}
if (costLessEach) {
thisMaxPower = Math.max(thisMaxPower, 5);
}
@ -222,6 +229,9 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
if (returnFromYourGY) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
if (sacrifice) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
if (skip) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
@ -243,6 +253,9 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
if (youControlTarget) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
if (yourOpponentsControl) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
if (anyNumberOfTarget) {
thisMaxPower = Math.max(thisMaxPower, 3);
}
@ -285,9 +298,6 @@ public class CardViewEDHPowerLevelComparator implements Comparator<CardView> {
if (sliver) {
thisMaxPower = Math.max(thisMaxPower, 2);
}
if (sacrifice) {
thisMaxPower = Math.max(thisMaxPower, 2);
}
if (untapTarget) {
thisMaxPower = Math.max(thisMaxPower, 2);
}

View file

@ -221,6 +221,7 @@ public class Commander extends Constructed {
boolean buyback = false;
boolean cascade = false;
boolean cantBe = false;
boolean cantUntap = false;
boolean copy = false;
boolean costLessEach = false;
boolean createToken = false;
@ -270,12 +271,14 @@ public class Commander extends Constructed {
boolean whenCounterThatSpell = false;
boolean xCost = false;
boolean youControlTarget = false;
boolean yourOpponentsControl = false;
for (String str : card.getRules()) {
String s = str.toLowerCase();
annihilator |= s.contains("annihilator");
anyNumberOfTarget |= s.contains("any number");
buyback |= s.contains("buyback");
cantUntap |= s.contains("can't untap") || s.contains("don't untap");
cantBe |= s.contains("can't be");
cascade |= s.contains("cascade");
copy |= s.contains("copy");
@ -327,6 +330,7 @@ public class Commander extends Constructed {
whenCounterThatSpell |= s.contains("when") && s.contains("counter that spell");
wheneverEnters |= s.contains("when") && s.contains("another") && s.contains("enters");
youControlTarget |= s.contains("you control target");
yourOpponentsControl |= s.contains("your opponents control");
}
for (ManaCost cost : card.getManaCost()) {
@ -354,6 +358,9 @@ public class Commander extends Constructed {
if (annihilator) {
thisMaxPower = Math.max(thisMaxPower, 5);
}
if (cantUntap) {
thisMaxPower = Math.max(thisMaxPower, 5);
}
if (costLessEach) {
thisMaxPower = Math.max(thisMaxPower, 5);
}
@ -411,6 +418,9 @@ public class Commander extends Constructed {
if (returnFromYourGY) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
if (sacrifice) {
thisMaxPower = Math.max(thisMaxPower, 2);
}
if (skip) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
@ -432,6 +442,9 @@ public class Commander extends Constructed {
if (youControlTarget) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
if (yourOpponentsControl) {
thisMaxPower = Math.max(thisMaxPower, 4);
}
if (anyNumberOfTarget) {
thisMaxPower = Math.max(thisMaxPower, 3);
}
@ -474,9 +487,6 @@ public class Commander extends Constructed {
if (sliver) {
thisMaxPower = Math.max(thisMaxPower, 2);
}
if (sacrifice) {
thisMaxPower = Math.max(thisMaxPower, 2);
}
if (untapTarget) {
thisMaxPower = Math.max(thisMaxPower, 2);
}