mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
spjspj - Final update to edh Power Level.
This commit is contained in:
parent
a5c677f72a
commit
9caaf0d5be
1 changed files with 27 additions and 3 deletions
|
@ -32,7 +32,9 @@ import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||||
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.keyword.PartnerAbility;
|
import mage.abilities.keyword.PartnerAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.ExpansionSet;
|
import mage.cards.ExpansionSet;
|
||||||
|
@ -262,8 +264,10 @@ public class Commander extends Constructed {
|
||||||
boolean twiceAs = false;
|
boolean twiceAs = false;
|
||||||
boolean unblockable = false;
|
boolean unblockable = false;
|
||||||
boolean undying = false;
|
boolean undying = false;
|
||||||
|
boolean untapTarget = false;
|
||||||
boolean wheneverEnters = false;
|
boolean wheneverEnters = false;
|
||||||
boolean whenCounterThatSpell = false;
|
boolean whenCounterThatSpell = false;
|
||||||
|
boolean xCost = false;
|
||||||
boolean youControlTarget = false;
|
boolean youControlTarget = false;
|
||||||
|
|
||||||
for (String str : card.getRules()) {
|
for (String str : card.getRules()) {
|
||||||
|
@ -313,11 +317,25 @@ public class Commander extends Constructed {
|
||||||
twiceAs |= s.contains("twice that many") || s.contains("twice as much");
|
twiceAs |= s.contains("twice that many") || s.contains("twice as much");
|
||||||
unblockable |= s.contains("can't be blocked");
|
unblockable |= s.contains("can't be blocked");
|
||||||
undying |= s.contains("undying");
|
undying |= s.contains("undying");
|
||||||
|
untapTarget |= s.contains("untap target");
|
||||||
whenCounterThatSpell |= s.contains("when") && s.contains("counter that spell");
|
whenCounterThatSpell |= s.contains("when") && s.contains("counter that spell");
|
||||||
wheneverEnters |= s.contains("when") && s.contains("another") && s.contains("enters");
|
wheneverEnters |= s.contains("when") && s.contains("another") && s.contains("enters");
|
||||||
youControlTarget |= s.contains("you control target");
|
youControlTarget |= s.contains("you control target");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (ManaCost cost : card.getManaCost()) {
|
||||||
|
if (cost.getText().contains("X")) {
|
||||||
|
xCost = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Ability a : card.getAbilities()) {
|
||||||
|
for (ManaCost cost : a.getManaCosts()) {
|
||||||
|
if (cost.getText().contains("X")) {
|
||||||
|
xCost = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (extraTurns) {
|
if (extraTurns) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 7);
|
thisMaxPower = Math.max(thisMaxPower, 7);
|
||||||
}
|
}
|
||||||
|
@ -390,6 +408,9 @@ public class Commander extends Constructed {
|
||||||
if (wheneverEnters) {
|
if (wheneverEnters) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 4);
|
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||||
}
|
}
|
||||||
|
if (xCost) {
|
||||||
|
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||||
|
}
|
||||||
if (youControlTarget) {
|
if (youControlTarget) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 4);
|
thisMaxPower = Math.max(thisMaxPower, 4);
|
||||||
}
|
}
|
||||||
|
@ -438,6 +459,9 @@ public class Commander extends Constructed {
|
||||||
if (sacrifice) {
|
if (sacrifice) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 2);
|
thisMaxPower = Math.max(thisMaxPower, 2);
|
||||||
}
|
}
|
||||||
|
if (untapTarget) {
|
||||||
|
thisMaxPower = Math.max(thisMaxPower, 2);
|
||||||
|
}
|
||||||
if (copy) {
|
if (copy) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 1);
|
thisMaxPower = Math.max(thisMaxPower, 1);
|
||||||
}
|
}
|
||||||
|
@ -603,7 +627,7 @@ public class Commander extends Constructed {
|
||||||
|| cn.equals("worthy cause") || cn.equals("yawgmoth's will")
|
|| cn.equals("worthy cause") || cn.equals("yawgmoth's will")
|
||||||
|| cn.equals("zealous conscripts")) {
|
|| cn.equals("zealous conscripts")) {
|
||||||
thisMaxPower = Math.max(thisMaxPower, 7);
|
thisMaxPower = Math.max(thisMaxPower, 7);
|
||||||
numberInfinitePieces ++;
|
numberInfinitePieces++;
|
||||||
}
|
}
|
||||||
edhPowerLevel += thisMaxPower;
|
edhPowerLevel += thisMaxPower;
|
||||||
}
|
}
|
||||||
|
@ -662,7 +686,7 @@ public class Commander extends Constructed {
|
||||||
}
|
}
|
||||||
|
|
||||||
edhPowerLevel += numberInfinitePieces * 10;
|
edhPowerLevel += numberInfinitePieces * 10;
|
||||||
edhPowerLevel = (int) Math.round(edhPowerLevel / 3.5);
|
edhPowerLevel = (int) Math.round(edhPowerLevel / 4.5);
|
||||||
if (edhPowerLevel > 100) {
|
if (edhPowerLevel > 100) {
|
||||||
edhPowerLevel = 100;
|
edhPowerLevel = 100;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue