mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Rename Attack/Defense to Power/Toughness for consistency
This commit is contained in:
@@ -193,7 +193,7 @@ public class AiAttackController {
|
|||||||
public final boolean isEffectiveAttacker(final Player ai, final Card attacker, final Combat combat) {
|
public final boolean isEffectiveAttacker(final Player ai, final Card attacker, final Combat combat) {
|
||||||
|
|
||||||
// if the attacker will die when attacking don't attack
|
// if the attacker will die when attacking don't attack
|
||||||
if ((attacker.getNetDefense() + ComputerUtilCombat.predictToughnessBonusOfAttacker(attacker, null, combat, true)) <= 0) {
|
if ((attacker.getNetToughness() + ComputerUtilCombat.predictToughnessBonusOfAttacker(attacker, null, combat, true)) <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,14 +316,14 @@ public class AiAttackController {
|
|||||||
//
|
//
|
||||||
// total attack = biggest creature + exalted, *2 if Rafiq is in
|
// total attack = biggest creature + exalted, *2 if Rafiq is in
|
||||||
// play
|
// play
|
||||||
int humanBaseAttack = this.getAttack(this.oppList.get(0)) + humanExaltedBonus;
|
int humanBasePower = this.getAttack(this.oppList.get(0)) + humanExaltedBonus;
|
||||||
if (nFinestHours > 0) {
|
if (nFinestHours > 0) {
|
||||||
// For Finest Hour, one creature could attack and get the
|
// For Finest Hour, one creature could attack and get the
|
||||||
// bonus TWICE
|
// bonus TWICE
|
||||||
humanBaseAttack = humanBaseAttack + humanExaltedBonus;
|
humanBasePower = humanBasePower + humanExaltedBonus;
|
||||||
}
|
}
|
||||||
final int totalExaltedAttack = opp.isCardInPlay("Rafiq of the Many") ? 2 * humanBaseAttack
|
final int totalExaltedAttack = opp.isCardInPlay("Rafiq of the Many") ? 2 * humanBasePower
|
||||||
: humanBaseAttack;
|
: humanBasePower;
|
||||||
if (ai.getLife() - 3 <= totalExaltedAttack) {
|
if (ai.getLife() - 3 <= totalExaltedAttack) {
|
||||||
// We will lose if there is an Exalted attack -- keep one
|
// We will lose if there is an Exalted attack -- keep one
|
||||||
// blocker
|
// blocker
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public class AiBlockController {
|
|||||||
|| ComputerUtilCombat.canDestroyBlocker(ai, blocker, other, combat, false)) {
|
|| ComputerUtilCombat.canDestroyBlocker(ai, blocker, other, combat, false)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int damageNext = other.getNetAttack();
|
int damageNext = other.getNetPower();
|
||||||
if (other.hasKeyword("Trample")) {
|
if (other.hasKeyword("Trample")) {
|
||||||
damageNext -= blocker.getLethalDamage();
|
damageNext -= blocker.getLethalDamage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1165,7 +1165,7 @@ public class AiController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (card.isCreature() && (card.getNetDefense() <= 0) && !card.hasStartOfKeyword("etbCounter")
|
if (card.isCreature() && (card.getNetToughness() <= 0) && !card.hasStartOfKeyword("etbCounter")
|
||||||
&& mana.countX() == 0 && !card.hasETBTrigger()
|
&& mana.countX() == 0 && !card.hasETBTrigger()
|
||||||
&& !card.hasETBReplacement()) {
|
&& !card.hasETBReplacement()) {
|
||||||
return AiPlayDecision.WouldBecomeZeroToughnessCreature;
|
return AiPlayDecision.WouldBecomeZeroToughnessCreature;
|
||||||
|
|||||||
@@ -487,8 +487,8 @@ public class ComputerUtil {
|
|||||||
remaining = CardLists.filter(remaining, new Predicate<Card>() {
|
remaining = CardLists.filter(remaining, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
if ((c.getCMC() <= 1 && c.getNetAttack() < 3)
|
if ((c.getCMC() <= 1 && c.getNetPower() < 3)
|
||||||
|| c.getNetAttack() + c.getNetDefense() <= 3) {
|
|| c.getNetPower() + c.getNetToughness() <= 3) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -693,7 +693,7 @@ public class ComputerUtil {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (buffedcard.hasKeyword("Evolve")) {
|
if (buffedcard.hasKeyword("Evolve")) {
|
||||||
if (buffedcard.getNetAttack() < card.getNetAttack() || buffedcard.getNetDefense() < card.getNetDefense()) {
|
if (buffedcard.getNetPower() < card.getNetPower() || buffedcard.getNetToughness() < card.getNetToughness()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1155,13 +1155,13 @@ public class ComputerUtil {
|
|||||||
for (final Object o : objects) {
|
for (final Object o : objects) {
|
||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
final Card c = (Card) o;
|
final Card c = (Card) o;
|
||||||
final boolean canRemove = (c.getNetDefense() <= dmg)
|
final boolean canRemove = (c.getNetToughness() <= dmg)
|
||||||
|| (!c.hasKeyword("Indestructible") && c.getShieldCount() == 0 && (dmg >= ComputerUtilCombat.getDamageToKill(c)));
|
|| (!c.hasKeyword("Indestructible") && c.getShieldCount() == 0 && (dmg >= ComputerUtilCombat.getDamageToKill(c)));
|
||||||
if (!canRemove) {
|
if (!canRemove) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll) {
|
if (saviourApi == ApiType.Pump || saviourApi == ApiType.PumpAll) {
|
||||||
final boolean cantSave = c.getNetDefense() + defense <= dmg
|
final boolean cantSave = c.getNetToughness() + defense <= dmg
|
||||||
|| (!c.hasKeyword("Indestructible") && c.getShieldCount() == 0 && !grantIndestructible
|
|| (!c.hasKeyword("Indestructible") && c.getShieldCount() == 0 && !grantIndestructible
|
||||||
&& (dmg >= defense + ComputerUtilCombat.getDamageToKill(c)));
|
&& (dmg >= defense + ComputerUtilCombat.getDamageToKill(c)));
|
||||||
if (cantSave && (tgt == null || !grantShroud)) {
|
if (cantSave && (tgt == null || !grantShroud)) {
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ public class ComputerUtilCard {
|
|||||||
value = 80; // tokens should be worth less than actual cards
|
value = 80; // tokens should be worth less than actual cards
|
||||||
}
|
}
|
||||||
int power = c.getNetCombatDamage();
|
int power = c.getNetCombatDamage();
|
||||||
final int toughness = c.getNetDefense();
|
final int toughness = c.getNetToughness();
|
||||||
for (String keyword : c.getKeywords()) {
|
for (String keyword : c.getKeywords()) {
|
||||||
if (keyword.equals("Prevent all combat damage that would be dealt by CARDNAME.")
|
if (keyword.equals("Prevent all combat damage that would be dealt by CARDNAME.")
|
||||||
|| keyword.equals("Prevent all damage that would be dealt by CARDNAME.")
|
|| keyword.equals("Prevent all damage that would be dealt by CARDNAME.")
|
||||||
@@ -948,7 +948,7 @@ public class ComputerUtilCard {
|
|||||||
if (sa.getDescription().contains("would die, exile it instead")) {
|
if (sa.getDescription().contains("would die, exile it instead")) {
|
||||||
destination = ZoneType.Exile;
|
destination = ZoneType.Exile;
|
||||||
}
|
}
|
||||||
valueBurn = 1.0f * c.getNetDefense() / dmg;
|
valueBurn = 1.0f * c.getNetToughness() / dmg;
|
||||||
valueBurn *= valueBurn;
|
valueBurn *= valueBurn;
|
||||||
if (sa.getTargetRestrictions().canTgtPlayer()) {
|
if (sa.getTargetRestrictions().canTgtPlayer()) {
|
||||||
valueBurn /= 2; //preserve option to burn to the face
|
valueBurn /= 2; //preserve option to burn to the face
|
||||||
@@ -1079,7 +1079,7 @@ public class ComputerUtilCard {
|
|||||||
} else {
|
} else {
|
||||||
att = AbilityUtils.calculateAmount(c, addP, stAb);
|
att = AbilityUtils.calculateAmount(c, addP, stAb);
|
||||||
}
|
}
|
||||||
vCard.addTempAttackBoost(att);
|
vCard.addTempPowerBoost(att);
|
||||||
}
|
}
|
||||||
if (params.containsKey("AddToughness")) {
|
if (params.containsKey("AddToughness")) {
|
||||||
String addT = params.get("AddToughness");
|
String addT = params.get("AddToughness");
|
||||||
@@ -1089,7 +1089,7 @@ public class ComputerUtilCard {
|
|||||||
} else {
|
} else {
|
||||||
def = AbilityUtils.calculateAmount(c, addT, stAb);
|
def = AbilityUtils.calculateAmount(c, addT, stAb);
|
||||||
}
|
}
|
||||||
vCard.addTempDefenseBoost(def);
|
vCard.addTempToughnessBoost(def);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -497,10 +497,10 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
||||||
|
|
||||||
if (flankingMagnitude >= defender.getNetDefense()) {
|
if (flankingMagnitude >= defender.getNetToughness()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((flankingMagnitude >= (defender.getNetDefense() - defender.getDamage()))
|
if ((flankingMagnitude >= (defender.getNetToughness() - defender.getDamage()))
|
||||||
&& !defender.hasKeyword("Indestructible")) {
|
&& !defender.hasKeyword("Indestructible")) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -510,9 +510,9 @@ public class ComputerUtilCombat {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int defenderDamage = defender.getNetAttack() + ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, true);
|
int defenderDamage = defender.getNetPower() + ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, true);
|
||||||
if (game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
if (game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
||||||
defenderDamage = defender.getNetDefense() + ComputerUtilCombat.predictToughnessBonusOfBlocker(attacker, defender, true);
|
defenderDamage = defender.getNetToughness() + ComputerUtilCombat.predictToughnessBonusOfBlocker(attacker, defender, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// consider static Damage Prevention
|
// consider static Damage Prevention
|
||||||
@@ -564,10 +564,10 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
||||||
|
|
||||||
if (flankingMagnitude >= defender.getNetDefense()) {
|
if (flankingMagnitude >= defender.getNetToughness()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((flankingMagnitude >= (defender.getNetDefense() - defender.getDamage()))
|
if ((flankingMagnitude >= (defender.getNetToughness() - defender.getDamage()))
|
||||||
&& !defender.hasKeyword("Indestructible")) {
|
&& !defender.hasKeyword("Indestructible")) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -779,9 +779,9 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
// Serene Master switches power with attacker
|
// Serene Master switches power with attacker
|
||||||
if (blocker.getName().equals("Serene Master")) {
|
if (blocker.getName().equals("Serene Master")) {
|
||||||
power += attacker.getNetAttack() - blocker.getNetAttack();
|
power += attacker.getNetPower() - blocker.getNetPower();
|
||||||
} else if (blocker.getName().equals("Shape Stealer")) {
|
} else if (blocker.getName().equals("Shape Stealer")) {
|
||||||
power += attacker.getNetAttack() - blocker.getNetAttack();
|
power += attacker.getNetPower() - blocker.getNetPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the attacker has first strike and wither the blocker will deal
|
// if the attacker has first strike and wither the blocker will deal
|
||||||
@@ -940,7 +940,7 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (blocker.getName().equals("Shape Stealer")) {
|
if (blocker.getName().equals("Shape Stealer")) {
|
||||||
toughness += attacker.getNetDefense() - blocker.getNetDefense();
|
toughness += attacker.getNetToughness() - blocker.getNetToughness();
|
||||||
}
|
}
|
||||||
|
|
||||||
toughness += blocker.getKeywordMagnitude("Bushido");
|
toughness += blocker.getKeywordMagnitude("Bushido");
|
||||||
@@ -1088,9 +1088,9 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
// Serene Master switches power with attacker
|
// Serene Master switches power with attacker
|
||||||
if (blocker!= null && blocker.getName().equals("Serene Master")) {
|
if (blocker!= null && blocker.getName().equals("Serene Master")) {
|
||||||
power += blocker.getNetAttack() - attacker.getNetAttack();
|
power += blocker.getNetPower() - attacker.getNetPower();
|
||||||
} else if (blocker != null && attacker.getName().equals("Shape Stealer")) {
|
} else if (blocker != null && attacker.getName().equals("Shape Stealer")) {
|
||||||
power += blocker.getNetAttack() - attacker.getNetAttack();
|
power += blocker.getNetPower() - attacker.getNetPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Game game = attacker.getGame();
|
final Game game = attacker.getGame();
|
||||||
@@ -1270,7 +1270,7 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (blocker != null && attacker.getName().equals("Shape Stealer")) {
|
if (blocker != null && attacker.getName().equals("Shape Stealer")) {
|
||||||
toughness += blocker.getNetDefense() - attacker.getNetDefense();
|
toughness += blocker.getNetToughness() - attacker.getNetToughness();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Game game = attacker.getGame();
|
final Game game = attacker.getGame();
|
||||||
@@ -1583,10 +1583,10 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
||||||
|
|
||||||
if (flankingMagnitude >= defender.getNetDefense()) {
|
if (flankingMagnitude >= defender.getNetToughness()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((flankingMagnitude >= (defender.getNetDefense() - defender.getDamage()))
|
if ((flankingMagnitude >= (defender.getNetToughness() - defender.getDamage()))
|
||||||
&& !defender.hasKeyword("Indestructible")) {
|
&& !defender.hasKeyword("Indestructible")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1616,14 +1616,14 @@ public class ComputerUtilCombat {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int defenderDamage = defender.getNetAttack()
|
int defenderDamage = defender.getNetPower()
|
||||||
+ ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, withoutAbilities);
|
+ ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, withoutAbilities);
|
||||||
int attackerDamage = attacker.getNetAttack()
|
int attackerDamage = attacker.getNetPower()
|
||||||
+ ComputerUtilCombat.predictPowerBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
+ ComputerUtilCombat.predictPowerBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
||||||
if (ai.getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
if (ai.getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
||||||
defenderDamage = defender.getNetDefense()
|
defenderDamage = defender.getNetToughness()
|
||||||
+ ComputerUtilCombat.predictToughnessBonusOfBlocker(attacker, defender, withoutAbilities);
|
+ ComputerUtilCombat.predictToughnessBonusOfBlocker(attacker, defender, withoutAbilities);
|
||||||
attackerDamage = attacker.getNetDefense()
|
attackerDamage = attacker.getNetToughness()
|
||||||
+ ComputerUtilCombat.predictToughnessBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
+ ComputerUtilCombat.predictToughnessBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1749,7 +1749,7 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
flankingMagnitude = attacker.getAmountOfKeyword("Flanking");
|
||||||
|
|
||||||
if (flankingMagnitude >= defender.getNetDefense()) {
|
if (flankingMagnitude >= defender.getNetToughness()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((flankingMagnitude >= ComputerUtilCombat.getDamageToKill(defender)) && !defender.hasKeyword("Indestructible")) {
|
if ((flankingMagnitude >= ComputerUtilCombat.getDamageToKill(defender)) && !defender.hasKeyword("Indestructible")) {
|
||||||
@@ -1778,14 +1778,14 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int defenderDamage = defender.getNetAttack()
|
int defenderDamage = defender.getNetPower()
|
||||||
+ ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, withoutAbilities);
|
+ ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, withoutAbilities);
|
||||||
int attackerDamage = attacker.getNetAttack()
|
int attackerDamage = attacker.getNetPower()
|
||||||
+ ComputerUtilCombat.predictPowerBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
+ ComputerUtilCombat.predictPowerBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
||||||
if (game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
if (game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
||||||
defenderDamage = defender.getNetDefense()
|
defenderDamage = defender.getNetToughness()
|
||||||
+ ComputerUtilCombat.predictToughnessBonusOfBlocker(attacker, defender, withoutAbilities);
|
+ ComputerUtilCombat.predictToughnessBonusOfBlocker(attacker, defender, withoutAbilities);
|
||||||
attackerDamage = attacker.getNetDefense()
|
attackerDamage = attacker.getNetToughness()
|
||||||
+ ComputerUtilCombat.predictToughnessBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
+ ComputerUtilCombat.predictToughnessBonusOfAttacker(attacker, defender, combat, withoutAbilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -452,7 +452,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
// Don't enchant creatures that can survive
|
// Don't enchant creatures that can survive
|
||||||
if (!c.canBeDestroyed() || c.getNetCombatDamage() < c.getNetDefense() || c.isEnchantedBy("Guilty Conscience")) {
|
if (!c.canBeDestroyed() || c.getNetCombatDamage() < c.getNetToughness() || c.isEnchantedBy("Guilty Conscience")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -590,7 +590,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.getNetDefense() <= Math.abs(tgh);
|
return c.getNetToughness() <= Math.abs(tgh);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -616,7 +616,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
prefList = CardLists.filter(prefList, new Predicate<Card>() {
|
prefList = CardLists.filter(prefList, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return ComputerUtil.canAttackNextTurn(c) && c.getNetAttack() > 0;
|
return ComputerUtil.canAttackNextTurn(c) && c.getNetPower() > 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -953,7 +953,7 @@ public class AttachAi extends SpellAbilityAi {
|
|||||||
if (!c.isCreature()) {
|
if (!c.isCreature()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return ComputerUtil.canAttackNextTurn(c) && powerBonus + c.getNetAttack() > 0;
|
return ComputerUtil.canAttackNextTurn(c) && powerBonus + c.getNetPower() > 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public abstract class CountersAi {
|
|||||||
final List<Card> killable = CardLists.filter(list, new Predicate<Card>() {
|
final List<Card> killable = CardLists.filter(list, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return c.getNetDefense() <= amount;
|
return c.getNetToughness() <= amount;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (killable.size() > 0) {
|
if (killable.size() > 0) {
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
@Override
|
@Override
|
||||||
public boolean apply(Card c) {
|
public boolean apply(Card c) {
|
||||||
return CombatUtil.canBlock(source, c, !isHaste)
|
return CombatUtil.canBlock(source, c, !isHaste)
|
||||||
&& (c.getNetDefense() > source.getNetAttack() + tributeAmount || c.hasKeyword("DeathTouch"));
|
&& (c.getNetToughness() > source.getNetPower() + tributeAmount || c.hasKeyword("DeathTouch"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!threatening.isEmpty()) {
|
if (!threatening.isEmpty()) {
|
||||||
@@ -454,7 +454,7 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
List<Card> canBlock = CardLists.filter(creats, new Predicate<Card>() {
|
List<Card> canBlock = CardLists.filter(creats, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Card c) {
|
public boolean apply(Card c) {
|
||||||
return CombatUtil.canBlock(source, c) && (c.getNetDefense() > source.getNetAttack() || c.hasKeyword("DeathTouch"));
|
return CombatUtil.canBlock(source, c) && (c.getNetToughness() > source.getNetPower() || c.hasKeyword("DeathTouch"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!canBlock.isEmpty()) {
|
if (!canBlock.isEmpty()) {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class CountersPutAllAi extends SpellAbilityAi {
|
|||||||
final List<Card> killable = CardLists.filter(hList, new Predicate<Card>() {
|
final List<Card> killable = CardLists.filter(hList, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return c.getNetDefense() <= amount;
|
return c.getNetToughness() <= amount;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!(killable.size() > 2)) {
|
if (!(killable.size() > 2)) {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
} else if ("WildHunt".equals(logic)) {
|
} else if ("WildHunt".equals(logic)) {
|
||||||
// This dummy ability will just deal 0 damage, but holds the logic for the AI for Master of Wild Hunt
|
// This dummy ability will just deal 0 damage, but holds the logic for the AI for Master of Wild Hunt
|
||||||
List<Card> wolves = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), "Creature.Wolf+untapped+YouCtrl+Other", ai, source);
|
List<Card> wolves = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), "Creature.Wolf+untapped+YouCtrl+Other", ai, source);
|
||||||
dmg = Aggregates.sum(wolves, CardPredicates.Accessors.fnGetNetAttack);
|
dmg = Aggregates.sum(wolves, CardPredicates.Accessors.fnGetNetPower);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dmg <= 0) {
|
if (dmg <= 0) {
|
||||||
@@ -295,7 +295,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
dmg -= assignedDamage;
|
dmg -= assignedDamage;
|
||||||
}
|
}
|
||||||
if (!source.hasProtectionFrom(humanCreature)) {
|
if (!source.hasProtectionFrom(humanCreature)) {
|
||||||
dmgTaken += humanCreature.getNetAttack();
|
dmgTaken += humanCreature.getNetPower();
|
||||||
}
|
}
|
||||||
if (dmg == 0) {
|
if (dmg == 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ public class FightAi extends SpellAbilityAi {
|
|||||||
if (sa.hasParam("Defined")) {
|
if (sa.hasParam("Defined")) {
|
||||||
Card fighter1 = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa).get(0);
|
Card fighter1 = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa).get(0);
|
||||||
for (Card humanCreature : humCreatures) {
|
for (Card humanCreature : humCreatures) {
|
||||||
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= fighter1.getNetAttack()
|
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= fighter1.getNetPower()
|
||||||
&& humanCreature.getNetAttack() < ComputerUtilCombat.getDamageToKill(fighter1)) {
|
&& humanCreature.getNetPower() < ComputerUtilCombat.getDamageToKill(fighter1)) {
|
||||||
// todo: check min/max targets; see if we picked the best matchup
|
// todo: check min/max targets; see if we picked the best matchup
|
||||||
sa.getTargets().add(humanCreature);
|
sa.getTargets().add(humanCreature);
|
||||||
return true;
|
return true;
|
||||||
@@ -53,8 +53,8 @@ public class FightAi extends SpellAbilityAi {
|
|||||||
if (!(humCreatures.isEmpty() && aiCreatures.isEmpty())) {
|
if (!(humCreatures.isEmpty() && aiCreatures.isEmpty())) {
|
||||||
for (Card humanCreature : humCreatures) {
|
for (Card humanCreature : humCreatures) {
|
||||||
for (Card aiCreature : aiCreatures) {
|
for (Card aiCreature : aiCreatures) {
|
||||||
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= aiCreature.getNetAttack()
|
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= aiCreature.getNetPower()
|
||||||
&& humanCreature.getNetAttack() < ComputerUtilCombat.getDamageToKill(aiCreature)) {
|
&& humanCreature.getNetPower() < ComputerUtilCombat.getDamageToKill(aiCreature)) {
|
||||||
// todo: check min/max targets; see if we picked the best matchup
|
// todo: check min/max targets; see if we picked the best matchup
|
||||||
sa.getTargets().add(humanCreature);
|
sa.getTargets().add(humanCreature);
|
||||||
sa.getTargets().add(aiCreature);
|
sa.getTargets().add(aiCreature);
|
||||||
@@ -78,8 +78,8 @@ public class FightAi extends SpellAbilityAi {
|
|||||||
&& creature1.sharesCreatureTypeWith(creature2)) {
|
&& creature1.sharesCreatureTypeWith(creature2)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ComputerUtilCombat.getDamageToKill(creature1) <= creature2.getNetAttack()
|
if (ComputerUtilCombat.getDamageToKill(creature1) <= creature2.getNetPower()
|
||||||
&& creature1.getNetAttack() >= ComputerUtilCombat.getDamageToKill(creature2)) {
|
&& creature1.getNetPower() >= ComputerUtilCombat.getDamageToKill(creature2)) {
|
||||||
// todo: check min/max targets; see if we picked the best matchup
|
// todo: check min/max targets; see if we picked the best matchup
|
||||||
sa.getTargets().add(creature1);
|
sa.getTargets().add(creature1);
|
||||||
sa.getTargets().add(creature2);
|
sa.getTargets().add(creature2);
|
||||||
@@ -110,14 +110,14 @@ public class FightAi extends SpellAbilityAi {
|
|||||||
if (sa.hasParam("Defined")) {
|
if (sa.hasParam("Defined")) {
|
||||||
Card aiCreature = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa).get(0);
|
Card aiCreature = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa).get(0);
|
||||||
for (Card humanCreature : humCreatures) {
|
for (Card humanCreature : humCreatures) {
|
||||||
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= aiCreature.getNetAttack()
|
if (ComputerUtilCombat.getDamageToKill(humanCreature) <= aiCreature.getNetPower()
|
||||||
&& ComputerUtilCard.evaluateCreature(humanCreature) > ComputerUtilCard.evaluateCreature(aiCreature)) {
|
&& ComputerUtilCard.evaluateCreature(humanCreature) > ComputerUtilCard.evaluateCreature(aiCreature)) {
|
||||||
sa.getTargets().add(humanCreature);
|
sa.getTargets().add(humanCreature);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Card humanCreature : humCreatures) {
|
for (Card humanCreature : humCreatures) {
|
||||||
if (ComputerUtilCombat.getDamageToKill(aiCreature) > humanCreature.getNetAttack()) {
|
if (ComputerUtilCombat.getDamageToKill(aiCreature) > humanCreature.getNetPower()) {
|
||||||
sa.getTargets().add(humanCreature);
|
sa.getTargets().add(humanCreature);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ public class FightAi extends SpellAbilityAi {
|
|||||||
|| opponent.getShieldCount() > 0 || ComputerUtil.canRegenerate(opponent.getController(), opponent)) {
|
|| opponent.getShieldCount() > 0 || ComputerUtil.canRegenerate(opponent.getController(), opponent)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (fighter.hasKeyword("Deathtouch") || ComputerUtilCombat.getDamageToKill(opponent) <= fighter.getNetAttack() + pumpAttack) {
|
if (fighter.hasKeyword("Deathtouch") || ComputerUtilCombat.getDamageToKill(opponent) <= fighter.getNetPower() + pumpAttack) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -515,10 +515,10 @@ public class PumpAi extends PumpAiBase {
|
|||||||
if ((sa.getTargetRestrictions() == null) || !sa.getTargetRestrictions().doesTarget()) {
|
if ((sa.getTargetRestrictions() == null) || !sa.getTargetRestrictions().doesTarget()) {
|
||||||
if (source.isCreature()) {
|
if (source.isCreature()) {
|
||||||
if (!source.hasKeyword("Indestructible")
|
if (!source.hasKeyword("Indestructible")
|
||||||
&& ((source.getNetDefense() + defense) <= source.getDamage())) {
|
&& ((source.getNetToughness() + defense) <= source.getDamage())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((source.getNetDefense() + defense) <= 0) {
|
if ((source.getNetToughness() + defense) <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ public abstract class PumpAiBase extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (keyword.equals("Persist")) {
|
} else if (keyword.equals("Persist")) {
|
||||||
if (card.getBaseDefense() <= 1 || card.hasKeyword("Undying")) {
|
if (card.getBaseToughness() <= 1 || card.hasKeyword("Undying")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (keyword.equals("Islandwalk")) {
|
} else if (keyword.equals("Islandwalk")) {
|
||||||
@@ -436,7 +436,7 @@ public abstract class PumpAiBase extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((c.getNetDefense() + defense) <= 0) {
|
if ((c.getNetToughness() + defense) <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ public abstract class PumpAiBase extends SpellAbilityAi {
|
|||||||
if (CardLists.filter(oppCreatures, CardPredicates.possibleBlockers(pumped)).isEmpty()) {
|
if (CardLists.filter(oppCreatures, CardPredicates.possibleBlockers(pumped)).isEmpty()) {
|
||||||
threat *= 2;
|
threat *= 2;
|
||||||
}
|
}
|
||||||
if (c.getNetAttack() == 0 && c == sa.getHostCard() && attack > 0 ) {
|
if (c.getNetPower() == 0 && c == sa.getHostCard() && attack > 0 ) {
|
||||||
threat *= 4; //over-value self +attack for 0 power creatures which may be pumped further after attacking
|
threat *= 4; //over-value self +attack for 0 power creatures which may be pumped further after attacking
|
||||||
}
|
}
|
||||||
chance += threat;
|
chance += threat;
|
||||||
@@ -669,7 +669,7 @@ public abstract class PumpAiBase extends SpellAbilityAi {
|
|||||||
list = CardLists.filter(list, new Predicate<Card>() {
|
list = CardLists.filter(list, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
if (c.getNetDefense() <= -defense) {
|
if (c.getNetToughness() <= -defense) {
|
||||||
return true; // can kill indestructible creatures
|
return true; // can kill indestructible creatures
|
||||||
}
|
}
|
||||||
return ((ComputerUtilCombat.getDamageToKill(c) <= -defense) && !c.hasKeyword("Indestructible"));
|
return ((ComputerUtilCombat.getDamageToKill(c) <= -defense) && !c.hasKeyword("Indestructible"));
|
||||||
@@ -695,11 +695,11 @@ public abstract class PumpAiBase extends SpellAbilityAi {
|
|||||||
if (combat == null || !combat.isAttacking(c)) {
|
if (combat == null || !combat.isAttacking(c)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (c.getNetAttack() > 0 && ai.getLife() < 5) {
|
if (c.getNetPower() > 0 && ai.getLife() < 5) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//Don't waste a -7/-0 spell on a 1/1 creature
|
//Don't waste a -7/-0 spell on a 1/1 creature
|
||||||
if (c.getNetAttack() + attack > -2 || c.getNetAttack() > 3) {
|
if (c.getNetPower() + attack > -2 || c.getNetPower() > 3) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -753,8 +753,8 @@ public abstract class PumpAiBase extends SpellAbilityAi {
|
|||||||
kws.add(kw);
|
kws.add(kw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pumped.addTempAttackBoost(c.getTempAttackBoost() + a);
|
pumped.addTempPowerBoost(c.getTempPowerBoost() + a);
|
||||||
pumped.addTempDefenseBoost(c.getTempDefenseBoost() + d);
|
pumped.addTempToughnessBoost(c.getTempToughnessBoost() + d);
|
||||||
pumped.addChangedCardKeywords(kws, new ArrayList<String>(), false, timestamp);
|
pumped.addChangedCardKeywords(kws, new ArrayList<String>(), false, timestamp);
|
||||||
Set<CounterType> types = c.getCounters().keySet();
|
Set<CounterType> types = c.getCounters().keySet();
|
||||||
for(CounterType ct : types) {
|
for(CounterType ct : types) {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class PumpAllAi extends PumpAiBase {
|
|||||||
comp = CardLists.filter(comp, new Predicate<Card>() {
|
comp = CardLists.filter(comp, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
if (c.getNetDefense() <= -defense) {
|
if (c.getNetToughness() <= -defense) {
|
||||||
return true; // can kill indestructible creatures
|
return true; // can kill indestructible creatures
|
||||||
}
|
}
|
||||||
return ((ComputerUtilCombat.getDamageToKill(c) <= -defense) && !c.hasKeyword("Indestructible"));
|
return ((ComputerUtilCombat.getDamageToKill(c) <= -defense) && !c.hasKeyword("Indestructible"));
|
||||||
@@ -76,7 +76,7 @@ public class PumpAllAi extends PumpAiBase {
|
|||||||
human = CardLists.filter(human, new Predicate<Card>() {
|
human = CardLists.filter(human, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
if (c.getNetDefense() <= -defense) {
|
if (c.getNetToughness() <= -defense) {
|
||||||
return true; // can kill indestructible creatures
|
return true; // can kill indestructible creatures
|
||||||
}
|
}
|
||||||
return ((ComputerUtilCombat.getDamageToKill(c) <= -defense) && !c.hasKeyword("Indestructible"));
|
return ((ComputerUtilCombat.getDamageToKill(c) <= -defense) && !c.hasKeyword("Indestructible"));
|
||||||
@@ -95,12 +95,12 @@ public class PumpAllAi extends PumpAiBase {
|
|||||||
if (combat == null || !combat.isAttacking(c)) {
|
if (combat == null || !combat.isAttacking(c)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
totalPower += Math.min(c.getNetAttack(), power * -1);
|
totalPower += Math.min(c.getNetPower(), power * -1);
|
||||||
if (phase == PhaseType.COMBAT_DECLARE_BLOCKERS && combat.isUnblocked(c)) {
|
if (phase == PhaseType.COMBAT_DECLARE_BLOCKERS && combat.isUnblocked(c)) {
|
||||||
if (ComputerUtilCombat.lifeInDanger(sa.getActivatingPlayer(), combat)) {
|
if (ComputerUtilCombat.lifeInDanger(sa.getActivatingPlayer(), combat)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
totalPower += Math.min(c.getNetAttack(), power * -1);
|
totalPower += Math.min(c.getNetPower(), power * -1);
|
||||||
}
|
}
|
||||||
if (totalPower >= power * -2) {
|
if (totalPower >= power * -2) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class StoreSVarAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (ComputerUtil.waitForBlocking(sa) || ai.getLife() + 1 >= source.getNetDefense()
|
else if (ComputerUtil.waitForBlocking(sa) || ai.getLife() + 1 >= source.getNetToughness()
|
||||||
|| (ai.getLife() > 5 && !ComputerUtilCombat.lifeInSeriousDanger(ai, ai.getGame().getCombat()))) {
|
|| (ai.getLife() > 5 && !ComputerUtilCombat.lifeInSeriousDanger(ai, ai.getGame().getCombat()))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -684,12 +684,12 @@ public class GameAction {
|
|||||||
for (Card c : game.getCardsIn(ZoneType.Battlefield)) {
|
for (Card c : game.getCardsIn(ZoneType.Battlefield)) {
|
||||||
if (c.isCreature()) {
|
if (c.isCreature()) {
|
||||||
// Rule 704.5f - Put into grave (no regeneration) for toughness <= 0
|
// Rule 704.5f - Put into grave (no regeneration) for toughness <= 0
|
||||||
if (c.getNetDefense() <= 0) {
|
if (c.getNetToughness() <= 0) {
|
||||||
noRegCreats.add(c);
|
noRegCreats.add(c);
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
} else if (c.hasKeyword("CARDNAME can't be destroyed by lethal damage unless lethal damage dealt by a single source is marked on it.")) {
|
} else if (c.hasKeyword("CARDNAME can't be destroyed by lethal damage unless lethal damage dealt by a single source is marked on it.")) {
|
||||||
for (final Integer dmg : c.getReceivedDamageFromThisTurn().values()) {
|
for (final Integer dmg : c.getReceivedDamageFromThisTurn().values()) {
|
||||||
if (c.getNetDefense() <= dmg.intValue()) {
|
if (c.getNetToughness() <= dmg.intValue()) {
|
||||||
desCreats.add(c);
|
desCreats.add(c);
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
break;
|
break;
|
||||||
@@ -697,7 +697,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Rule 704.5g - Destroy due to lethal damage
|
// Rule 704.5g - Destroy due to lethal damage
|
||||||
else if (c.getNetDefense() <= c.getDamage()) {
|
else if (c.getNetToughness() <= c.getDamage()) {
|
||||||
desCreats.add(c);
|
desCreats.add(c);
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
}
|
}
|
||||||
@@ -1112,7 +1112,7 @@ public class GameAction {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.canBeShielded() && (!c.isCreature() || c.getNetDefense() > 0)
|
if (c.canBeShielded() && (!c.isCreature() || c.getNetToughness() > 0)
|
||||||
&& (c.getShieldCount() > 0 || c.hasKeyword("If CARDNAME would be destroyed, regenerate it."))) {
|
&& (c.getShieldCount() > 0 || c.hasKeyword("If CARDNAME would be destroyed, regenerate it."))) {
|
||||||
c.subtractShield(c.getController().getController().chooseRegenerationShield(c));
|
c.subtractShield(c.getController().getController().chooseRegenerationShield(c));
|
||||||
c.setDamage(0);
|
c.setDamage(0);
|
||||||
|
|||||||
@@ -201,8 +201,8 @@ public class StaticEffects {
|
|||||||
if (addT.startsWith("AffectedX")) {
|
if (addT.startsWith("AffectedX")) {
|
||||||
toughnessBonus = se.getXMapValue(affectedCard);
|
toughnessBonus = se.getXMapValue(affectedCard);
|
||||||
}
|
}
|
||||||
affectedCard.addSemiPermanentAttackBoost(powerBonus * -1);
|
affectedCard.addSemiPermanentPowerBoost(powerBonus * -1);
|
||||||
affectedCard.addSemiPermanentDefenseBoost(toughnessBonus * -1);
|
affectedCard.addSemiPermanentToughnessBoost(toughnessBonus * -1);
|
||||||
|
|
||||||
// remove keywords
|
// remove keywords
|
||||||
// TODO regular keywords currently don't try to use keyword multiplier
|
// TODO regular keywords currently don't try to use keyword multiplier
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ public class CloneEffect extends SpellAbilityEffect {
|
|||||||
} catch (final NumberFormatException e) {
|
} catch (final NumberFormatException e) {
|
||||||
power = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs));
|
power = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs));
|
||||||
}
|
}
|
||||||
tgtCard.setBaseAttack(power);
|
tgtCard.setBasePower(power);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set toughness of clone
|
// set toughness of clone
|
||||||
@@ -279,7 +279,7 @@ public class CloneEffect extends SpellAbilityEffect {
|
|||||||
} catch (final NumberFormatException e) {
|
} catch (final NumberFormatException e) {
|
||||||
toughness = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs));
|
toughness = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs));
|
||||||
}
|
}
|
||||||
tgtCard.setBaseDefense(toughness);
|
tgtCard.setBaseToughness(toughness);
|
||||||
}
|
}
|
||||||
|
|
||||||
// colors to be added or changed to
|
// colors to be added or changed to
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ public class FightEffect extends SpellAbilityEffect {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dmg2 = fighters.get(1).getNetAttack();
|
int dmg2 = fighters.get(1).getNetPower();
|
||||||
fighters.get(1).addDamage(fighters.get(0).getNetAttack(), fighters.get(0));
|
fighters.get(1).addDamage(fighters.get(0).getNetPower(), fighters.get(0));
|
||||||
fighters.get(0).addDamage(dmg2, fighters.get(1));
|
fighters.get(0).addDamage(dmg2, fighters.get(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ public class PermanentCreatureEffect extends SpellAbilityEffect {
|
|||||||
public String getStackDescription(final SpellAbility sa) {
|
public String getStackDescription(final SpellAbility sa) {
|
||||||
final Card sourceCard = sa.getHostCard();
|
final Card sourceCard = sa.getHostCard();
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append(sourceCard.getName()).append(" - Creature ").append(sourceCard.getNetAttack());
|
sb.append(sourceCard.getName()).append(" - Creature ").append(sourceCard.getNetPower());
|
||||||
sb.append(" / ").append(sourceCard.getNetDefense());
|
sb.append(" / ").append(sourceCard.getNetToughness());
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ public class PowerExchangeEffect extends SpellAbilityEffect {
|
|||||||
if (!c1.isInPlay() || !c2.isInPlay()) {
|
if (!c1.isInPlay() || !c2.isInPlay()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int power1 = c1.getNetAttack();
|
final int power1 = c1.getNetPower();
|
||||||
final int power2 = c2.getNetAttack();
|
final int power2 = c2.getNetPower();
|
||||||
|
|
||||||
c1.addTempAttackBoost(power2 - power1);
|
c1.addTempPowerBoost(power2 - power1);
|
||||||
c2.addTempAttackBoost(power1 - power2);
|
c2.addTempPowerBoost(power1 - power2);
|
||||||
|
|
||||||
game.fireEvent(new GameEventCardStatsChanged(c1));
|
game.fireEvent(new GameEventCardStatsChanged(c1));
|
||||||
game.fireEvent(new GameEventCardStatsChanged(c2));
|
game.fireEvent(new GameEventCardStatsChanged(c2));
|
||||||
@@ -69,8 +69,8 @@ public class PowerExchangeEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
c1.addTempAttackBoost(power1 - power2);
|
c1.addTempPowerBoost(power1 - power2);
|
||||||
c2.addTempAttackBoost(power2 - power1);
|
c2.addTempPowerBoost(power2 - power1);
|
||||||
game.fireEvent(new GameEventCardStatsChanged(c1));
|
game.fireEvent(new GameEventCardStatsChanged(c1));
|
||||||
game.fireEvent(new GameEventCardStatsChanged(c2));
|
game.fireEvent(new GameEventCardStatsChanged(c2));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ public class PumpAllEffect extends SpellAbilityEffect {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgtC.addTempAttackBoost(a);
|
tgtC.addTempPowerBoost(a);
|
||||||
tgtC.addTempDefenseBoost(d);
|
tgtC.addTempToughnessBoost(d);
|
||||||
tgtC.addChangedCardKeywords(kws, new ArrayList<String>(), false, timestamp);
|
tgtC.addChangedCardKeywords(kws, new ArrayList<String>(), false, timestamp);
|
||||||
|
|
||||||
for (String kw : hiddenkws) {
|
for (String kw : hiddenkws) {
|
||||||
@@ -75,8 +75,8 @@ public class PumpAllEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
tgtC.addTempAttackBoost(-1 * a);
|
tgtC.addTempPowerBoost(-1 * a);
|
||||||
tgtC.addTempDefenseBoost(-1 * d);
|
tgtC.addTempToughnessBoost(-1 * d);
|
||||||
tgtC.removeChangedCardKeywords(timestamp);
|
tgtC.removeChangedCardKeywords(timestamp);
|
||||||
|
|
||||||
for (String kw : hiddenkws) {
|
for (String kw : hiddenkws) {
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applyTo.addTempAttackBoost(a);
|
applyTo.addTempPowerBoost(a);
|
||||||
applyTo.addTempDefenseBoost(d);
|
applyTo.addTempToughnessBoost(d);
|
||||||
applyTo.addChangedCardKeywords(kws, new ArrayList<String>(), false, timestamp);
|
applyTo.addChangedCardKeywords(kws, new ArrayList<String>(), false, timestamp);
|
||||||
|
|
||||||
if (!sa.hasParam("Permanent")) {
|
if (!sa.hasParam("Permanent")) {
|
||||||
@@ -58,8 +58,8 @@ public class PumpEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
applyTo.addTempAttackBoost(-1 * a);
|
applyTo.addTempPowerBoost(-1 * a);
|
||||||
applyTo.addTempDefenseBoost(-1 * d);
|
applyTo.addTempToughnessBoost(-1 * d);
|
||||||
|
|
||||||
if (keywords.size() > 0) {
|
if (keywords.size() > 0) {
|
||||||
for (String kw : keywords) {
|
for (String kw : keywords) {
|
||||||
|
|||||||
@@ -191,8 +191,8 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
// stack of set power/toughness
|
// stack of set power/toughness
|
||||||
private ArrayList<CardPowerToughness> newPT = new ArrayList<CardPowerToughness>();
|
private ArrayList<CardPowerToughness> newPT = new ArrayList<CardPowerToughness>();
|
||||||
private int baseLoyalty = 0;
|
private int baseLoyalty = 0;
|
||||||
private String baseAttackString = null;
|
private String basePowerString = null;
|
||||||
private String baseDefenseString = null;
|
private String baseToughnessString = null;
|
||||||
|
|
||||||
private int damage;
|
private int damage;
|
||||||
|
|
||||||
@@ -202,11 +202,11 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
|
|
||||||
private int turnInZone;
|
private int turnInZone;
|
||||||
|
|
||||||
private int tempAttackBoost = 0;
|
private int tempPowerBoost = 0;
|
||||||
private int tempDefenseBoost = 0;
|
private int tempToughnessBoost = 0;
|
||||||
|
|
||||||
private int semiPermanentAttackBoost = 0;
|
private int semiPermanentPowerBoost = 0;
|
||||||
private int semiPermanentDefenseBoost = 0;
|
private int semiPermanentToughnessBoost = 0;
|
||||||
|
|
||||||
private int xManaCostPaid = 0;
|
private int xManaCostPaid = 0;
|
||||||
private Map<String, Integer> xManaCostPaidByColor;
|
private Map<String, Integer> xManaCostPaidByColor;
|
||||||
@@ -2404,39 +2404,39 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// values that are printed on card
|
// values that are printed on card
|
||||||
public final int getBaseAttack() {
|
public final int getBasePower() {
|
||||||
return currentState.getBaseAttack();
|
return currentState.getBasePower();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getBaseDefense() {
|
public final int getBaseToughness() {
|
||||||
return currentState.getBaseDefense();
|
return currentState.getBaseToughness();
|
||||||
}
|
}
|
||||||
|
|
||||||
// values that are printed on card
|
// values that are printed on card
|
||||||
public final void setBaseAttack(final int n) {
|
public final void setBasePower(final int n) {
|
||||||
currentState.setBaseAttack(n);
|
currentState.setBasePower(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setBaseDefense(final int n) {
|
public final void setBaseToughness(final int n) {
|
||||||
currentState.setBaseDefense(n);
|
currentState.setBaseToughness(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
// values that are printed on card
|
// values that are printed on card
|
||||||
public final String getBaseAttackString() {
|
public final String getBasePowerString() {
|
||||||
return (null == baseAttackString) ? "" + getBaseAttack() : baseAttackString;
|
return (null == basePowerString) ? "" + getBasePower() : basePowerString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String getBaseDefenseString() {
|
public final String getBaseToughnessString() {
|
||||||
return (null == baseDefenseString) ? "" + getBaseDefense() : baseDefenseString;
|
return (null == baseToughnessString) ? "" + getBaseToughness() : baseToughnessString;
|
||||||
}
|
}
|
||||||
|
|
||||||
// values that are printed on card
|
// values that are printed on card
|
||||||
public final void setBaseAttackString(final String s) {
|
public final void setBasePowerString(final String s) {
|
||||||
baseAttackString = s;
|
basePowerString = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setBaseDefenseString(final String s) {
|
public final void setBaseToughnessString(final String s) {
|
||||||
baseDefenseString = s;
|
baseToughnessString = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getSetPower() {
|
public final int getSetPower() {
|
||||||
@@ -2504,7 +2504,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final int getCurrentPower() {
|
public final int getCurrentPower() {
|
||||||
int total = getBaseAttack();
|
int total = getBasePower();
|
||||||
final int setPower = getSetPower();
|
final int setPower = getSetPower();
|
||||||
if (setPower != -1) {
|
if (setPower != -1) {
|
||||||
total = setPower;
|
total = setPower;
|
||||||
@@ -2513,7 +2513,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final int getUnswitchedPower() {
|
public final int getUnswitchedPower() {
|
||||||
return getCurrentPower() + getTempAttackBoost() + getSemiPermanentAttackBoost() + getPowerBonusFromCounters();
|
return getCurrentPower() + getTempPowerBoost() + getSemiPermanentPowerBoost() + getPowerBonusFromCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getPowerBonusFromCounters() {
|
public final int getPowerBonusFromCounters() {
|
||||||
@@ -2522,7 +2522,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
- 2 * getCounters(CounterType.M2M2) - getCounters(CounterType.M1M0) + 2 * getCounters(CounterType.P2P0);
|
- 2 * getCounters(CounterType.M2M2) - getCounters(CounterType.M1M0) + 2 * getCounters(CounterType.P2P0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getNetAttack() {
|
public final int getNetPower() {
|
||||||
if (getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2 != 0) {
|
if (getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2 != 0) {
|
||||||
return getUnswitchedToughness();
|
return getUnswitchedToughness();
|
||||||
}
|
}
|
||||||
@@ -2530,7 +2530,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final int getCurrentToughness() {
|
public final int getCurrentToughness() {
|
||||||
int total = getBaseDefense();
|
int total = getBaseToughness();
|
||||||
final int setToughness = getSetToughness();
|
final int setToughness = getSetToughness();
|
||||||
if (setToughness != -1) {
|
if (setToughness != -1) {
|
||||||
total = setToughness;
|
total = setToughness;
|
||||||
@@ -2539,7 +2539,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final int getUnswitchedToughness() {
|
public final int getUnswitchedToughness() {
|
||||||
return getCurrentToughness() + getTempDefenseBoost() + getSemiPermanentDefenseBoost() + getToughnessBonusFromCounters();
|
return getCurrentToughness() + getTempToughnessBoost() + getSemiPermanentToughnessBoost() + getToughnessBonusFromCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getToughnessBonusFromCounters() {
|
public final int getToughnessBonusFromCounters() {
|
||||||
@@ -2549,7 +2549,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
+ 2 * getCounters(CounterType.P0P2);
|
+ 2 * getCounters(CounterType.P0P2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getNetDefense() {
|
public final int getNetToughness() {
|
||||||
if (getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2 != 0) {
|
if (getAmountOfKeyword("CARDNAME's power and toughness are switched") % 2 != 0) {
|
||||||
return getUnswitchedPower();
|
return getUnswitchedPower();
|
||||||
}
|
}
|
||||||
@@ -2563,9 +2563,9 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
if (getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.toughnessAssignsDamage)) {
|
||||||
return getNetDefense();
|
return getNetToughness();
|
||||||
}
|
}
|
||||||
return getNetAttack();
|
return getNetPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int multiKickerMagnitude = 0;
|
private int multiKickerMagnitude = 0;
|
||||||
@@ -2585,56 +2585,56 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
public final int getPseudoKickerMagnitude() { return pseudoKickerMagnitude; }
|
public final int getPseudoKickerMagnitude() { return pseudoKickerMagnitude; }
|
||||||
|
|
||||||
// for cards like Giant Growth, etc.
|
// for cards like Giant Growth, etc.
|
||||||
public final int getTempAttackBoost() {
|
public final int getTempPowerBoost() {
|
||||||
return tempAttackBoost;
|
return tempPowerBoost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getTempDefenseBoost() {
|
public final int getTempToughnessBoost() {
|
||||||
return tempDefenseBoost;
|
return tempToughnessBoost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void addTempAttackBoost(final int n) {
|
public final void addTempPowerBoost(final int n) {
|
||||||
if (n == 0) { return; }
|
if (n == 0) { return; }
|
||||||
tempAttackBoost += n;
|
tempPowerBoost += n;
|
||||||
currentState.getView().updatePower(this);
|
currentState.getView().updatePower(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void addTempDefenseBoost(final int n) {
|
public final void addTempToughnessBoost(final int n) {
|
||||||
if (n == 0) { return; }
|
if (n == 0) { return; }
|
||||||
tempDefenseBoost += n;
|
tempToughnessBoost += n;
|
||||||
currentState.getView().updateToughness(this);
|
currentState.getView().updateToughness(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for cards like Glorious Anthem, etc.
|
// for cards like Glorious Anthem, etc.
|
||||||
public final int getSemiPermanentAttackBoost() {
|
public final int getSemiPermanentPowerBoost() {
|
||||||
return semiPermanentAttackBoost;
|
return semiPermanentPowerBoost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getSemiPermanentDefenseBoost() {
|
public final int getSemiPermanentToughnessBoost() {
|
||||||
return semiPermanentDefenseBoost;
|
return semiPermanentToughnessBoost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void addSemiPermanentAttackBoost(final int n) {
|
public final void addSemiPermanentPowerBoost(final int n) {
|
||||||
if (n == 0) { return; }
|
if (n == 0) { return; }
|
||||||
semiPermanentAttackBoost += n;
|
semiPermanentPowerBoost += n;
|
||||||
currentState.getView().updatePower(this);
|
currentState.getView().updatePower(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void addSemiPermanentDefenseBoost(final int n) {
|
public final void addSemiPermanentToughnessBoost(final int n) {
|
||||||
if (n == 0) { return; }
|
if (n == 0) { return; }
|
||||||
semiPermanentDefenseBoost += n;
|
semiPermanentToughnessBoost += n;
|
||||||
currentState.getView().updateToughness(this);
|
currentState.getView().updateToughness(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setSemiPermanentAttackBoost(final int n) {
|
public final void setSemiPermanentPowerBoost(final int n) {
|
||||||
if (semiPermanentAttackBoost == n) { return; }
|
if (semiPermanentPowerBoost == n) { return; }
|
||||||
semiPermanentAttackBoost = n;
|
semiPermanentPowerBoost = n;
|
||||||
currentState.getView().updatePower(this);
|
currentState.getView().updatePower(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setSemiPermanentDefenseBoost(final int n) {
|
public final void setSemiPermanentToughnessBoost(final int n) {
|
||||||
if (semiPermanentDefenseBoost == n) { return; }
|
if (semiPermanentToughnessBoost == n) { return; }
|
||||||
semiPermanentDefenseBoost = n;
|
semiPermanentToughnessBoost = n;
|
||||||
currentState.getView().updateToughness(this);
|
currentState.getView().updateToughness(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4474,28 +4474,28 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (final Card crd : cards) {
|
for (final Card crd : cards) {
|
||||||
if (crd.getNetAttack() > getNetAttack()) {
|
if (crd.getNetPower() > getNetPower()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("yardGreatestPower")) {
|
} else if (property.startsWith("yardGreatestPower")) {
|
||||||
final CardCollectionView cards = CardLists.filter(sourceController.getCardsIn(ZoneType.Graveyard), Presets.CREATURES);
|
final CardCollectionView cards = CardLists.filter(sourceController.getCardsIn(ZoneType.Graveyard), Presets.CREATURES);
|
||||||
for (final Card crd : cards) {
|
for (final Card crd : cards) {
|
||||||
if (crd.getNetAttack() > getNetAttack()) {
|
if (crd.getNetPower() > getNetPower()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("leastPower")) {
|
} else if (property.startsWith("leastPower")) {
|
||||||
final CardCollectionView cards = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
final CardCollectionView cards = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
||||||
for (final Card crd : cards) {
|
for (final Card crd : cards) {
|
||||||
if (crd.getNetAttack() < getNetAttack()) {
|
if (crd.getNetPower() < getNetPower()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("leastToughness")) {
|
} else if (property.startsWith("leastToughness")) {
|
||||||
final CardCollectionView cards = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
final CardCollectionView cards = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
||||||
for (final Card crd : cards) {
|
for (final Card crd : cards) {
|
||||||
if (crd.getNetDefense() < getNetDefense()) {
|
if (crd.getNetToughness() < getNetToughness()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4615,10 +4615,10 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
|
|
||||||
if (property.startsWith("power")) {
|
if (property.startsWith("power")) {
|
||||||
rhs = property.substring(7);
|
rhs = property.substring(7);
|
||||||
y = getNetAttack();
|
y = getNetPower();
|
||||||
} else if (property.startsWith("toughness")) {
|
} else if (property.startsWith("toughness")) {
|
||||||
rhs = property.substring(11);
|
rhs = property.substring(11);
|
||||||
y = getNetDefense();
|
y = getNetToughness();
|
||||||
} else if (property.startsWith("cmc")) {
|
} else if (property.startsWith("cmc")) {
|
||||||
rhs = property.substring(5);
|
rhs = property.substring(5);
|
||||||
if (isSplitCard() && getCurrentStateName() == CardStateName.Original) {
|
if (isSplitCard() && getCurrentStateName() == CardStateName.Original) {
|
||||||
@@ -4629,7 +4629,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
} else if (property.startsWith("totalPT")) {
|
} else if (property.startsWith("totalPT")) {
|
||||||
rhs = property.substring(10);
|
rhs = property.substring(10);
|
||||||
y = getNetAttack() + getNetDefense();
|
y = getNetPower() + getNetToughness();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
x = Integer.parseInt(rhs);
|
x = Integer.parseInt(rhs);
|
||||||
@@ -5103,7 +5103,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
|
|
||||||
// this is the minimal damage a trampling creature has to assign to a blocker
|
// this is the minimal damage a trampling creature has to assign to a blocker
|
||||||
public final int getLethalDamage() {
|
public final int getLethalDamage() {
|
||||||
return getNetDefense() - getDamage() - getTotalAssignedDamage();
|
return getNetToughness() - getDamage() - getTotalAssignedDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getDamage() {
|
public final int getDamage() {
|
||||||
@@ -5801,7 +5801,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final boolean canBeDestroyed() {
|
public final boolean canBeDestroyed() {
|
||||||
return isInPlay() && (!hasKeyword("Indestructible") || (isCreature() && getNetDefense() <= 0));
|
return isInPlay() && (!hasKeyword("Indestructible") || (isCreature() && getNetToughness() <= 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -423,12 +423,12 @@ public class CardFactory {
|
|||||||
c.setColor(ccc);
|
c.setColor(ccc);
|
||||||
|
|
||||||
if ( face.getIntPower() >= 0 ) {
|
if ( face.getIntPower() >= 0 ) {
|
||||||
c.setBaseAttack(face.getIntPower());
|
c.setBasePower(face.getIntPower());
|
||||||
c.setBaseAttackString(face.getPower());
|
c.setBasePowerString(face.getPower());
|
||||||
}
|
}
|
||||||
if ( face.getIntToughness() >= 0 ) {
|
if ( face.getIntToughness() >= 0 ) {
|
||||||
c.setBaseDefense(face.getIntToughness());
|
c.setBaseToughness(face.getIntToughness());
|
||||||
c.setBaseDefenseString(face.getToughness());
|
c.setBaseToughnessString(face.getToughness());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,8 +555,8 @@ public class CardFactory {
|
|||||||
public static void copyState(final Card from, final CardStateName fromState, final Card to, final CardStateName toState) {
|
public static void copyState(final Card from, final CardStateName fromState, final Card to, final CardStateName toState) {
|
||||||
// copy characteristics not associated with a state
|
// copy characteristics not associated with a state
|
||||||
to.setBaseLoyalty(from.getBaseLoyalty());
|
to.setBaseLoyalty(from.getBaseLoyalty());
|
||||||
to.setBaseAttackString(from.getBaseAttackString());
|
to.setBasePowerString(from.getBasePowerString());
|
||||||
to.setBaseDefenseString(from.getBaseDefenseString());
|
to.setBaseToughnessString(from.getBaseToughnessString());
|
||||||
to.setText(from.getSpellText());
|
to.setText(from.getSpellText());
|
||||||
|
|
||||||
// get CardCharacteristics for desired state
|
// get CardCharacteristics for desired state
|
||||||
@@ -617,7 +617,7 @@ public class CardFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<Card> makeToken(final String name, final String imageName, final Player controller,
|
public static List<Card> makeToken(final String name, final String imageName, final Player controller,
|
||||||
final String manaCost, final String[] types, final int baseAttack, final int baseDefense,
|
final String manaCost, final String[] types, final int basePower, final int baseToughness,
|
||||||
final String[] intrinsicKeywords) {
|
final String[] intrinsicKeywords) {
|
||||||
final List<Card> list = new ArrayList<Card>();
|
final List<Card> list = new ArrayList<Card>();
|
||||||
final Card c = new Card(controller.getGame().nextCardId());
|
final Card c = new Card(controller.getGame().nextCardId());
|
||||||
@@ -633,8 +633,8 @@ public class CardFactory {
|
|||||||
c.addType(t);
|
c.addType(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.setBaseAttack(baseAttack);
|
c.setBasePower(basePower);
|
||||||
c.setBaseDefense(baseDefense);
|
c.setBaseToughness(baseToughness);
|
||||||
|
|
||||||
final int multiplier = controller.getTokenDoublersMagnitude();
|
final int multiplier = controller.getTokenDoublersMagnitude();
|
||||||
for (int i = 0; i < multiplier; i++) {
|
for (int i = 0; i < multiplier; i++) {
|
||||||
|
|||||||
@@ -891,8 +891,8 @@ public class CardFactoryUtil {
|
|||||||
CardCollection list = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c);
|
CardCollection list = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c);
|
||||||
int highest = 0;
|
int highest = 0;
|
||||||
for (final Card crd : list) {
|
for (final Card crd : list) {
|
||||||
if (crd.getNetAttack() > highest) {
|
if (crd.getNetPower() > highest) {
|
||||||
highest = crd.getNetAttack();
|
highest = crd.getNetPower();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return highest;
|
return highest;
|
||||||
@@ -904,8 +904,8 @@ public class CardFactoryUtil {
|
|||||||
CardCollection list = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c);
|
CardCollection list = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c);
|
||||||
int highest = 0;
|
int highest = 0;
|
||||||
for (final Card crd : list) {
|
for (final Card crd : list) {
|
||||||
if (crd.getNetDefense() > highest) {
|
if (crd.getNetToughness() > highest) {
|
||||||
highest = crd.getNetDefense();
|
highest = crd.getNetToughness();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return highest;
|
return highest;
|
||||||
@@ -1224,13 +1224,13 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sq[0].contains("CardPower")) {
|
if (sq[0].contains("CardPower")) {
|
||||||
return doXMath(c.getNetAttack(), m, c);
|
return doXMath(c.getNetPower(), m, c);
|
||||||
}
|
}
|
||||||
if (sq[0].contains("CardToughness")) {
|
if (sq[0].contains("CardToughness")) {
|
||||||
return doXMath(c.getNetDefense(), m, c);
|
return doXMath(c.getNetToughness(), m, c);
|
||||||
}
|
}
|
||||||
if (sq[0].contains("CardSumPT")) {
|
if (sq[0].contains("CardSumPT")) {
|
||||||
return doXMath((c.getNetAttack() + c.getNetDefense()), m, c);
|
return doXMath((c.getNetPower() + c.getNetToughness()), m, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count$SumPower_valid
|
// Count$SumPower_valid
|
||||||
@@ -1238,7 +1238,7 @@ public class CardFactoryUtil {
|
|||||||
final String[] restrictions = l[0].split("_");
|
final String[] restrictions = l[0].split("_");
|
||||||
final String[] rest = restrictions[1].split(",");
|
final String[] rest = restrictions[1].split(",");
|
||||||
CardCollection filteredCards = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c);
|
CardCollection filteredCards = CardLists.getValidCards(cc.getGame().getCardsIn(ZoneType.Battlefield), rest, cc, c);
|
||||||
return doXMath(Aggregates.sum(filteredCards, CardPredicates.Accessors.fnGetNetAttack), m, c);
|
return doXMath(Aggregates.sum(filteredCards, CardPredicates.Accessors.fnGetNetPower), m, c);
|
||||||
}
|
}
|
||||||
// Count$CardManaCost
|
// Count$CardManaCost
|
||||||
if (sq[0].contains("CardManaCost")) {
|
if (sq[0].contains("CardManaCost")) {
|
||||||
@@ -1977,7 +1977,7 @@ public class CardFactoryUtil {
|
|||||||
int neededDamage = -1;
|
int neededDamage = -1;
|
||||||
|
|
||||||
if ((target != null)) {
|
if ((target != null)) {
|
||||||
neededDamage = target.getNetDefense() - target.getDamage();
|
neededDamage = target.getNetToughness() - target.getDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
return neededDamage;
|
return neededDamage;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class CardLists {
|
|||||||
return CardLists.filter(in, new Predicate<Card>() {
|
return CardLists.filter(in, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Card c) {
|
public boolean apply(Card c) {
|
||||||
return c.getNetDefense() <= atLeastToughness;
|
return c.getNetToughness() <= atLeastToughness;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ public class CardLists {
|
|||||||
public static final Comparator<Card> ToughnessComparator = new Comparator<Card>() {
|
public static final Comparator<Card> ToughnessComparator = new Comparator<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(final Card a, final Card b) {
|
public int compare(final Card a, final Card b) {
|
||||||
return a.getNetDefense() - b.getNetDefense();
|
return a.getNetToughness() - b.getNetToughness();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
public static final Comparator<Card> PowerComparator = new Comparator<Card>() {
|
public static final Comparator<Card> PowerComparator = new Comparator<Card>() {
|
||||||
@@ -291,7 +291,7 @@ public class CardLists {
|
|||||||
public static int getTotalPower(Iterable<Card> cardList) {
|
public static int getTotalPower(Iterable<Card> cardList) {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for (final Card crd : cardList) {
|
for (final Card crd : cardList) {
|
||||||
total += crd.getNetAttack();
|
total += crd.getNetPower();
|
||||||
}
|
}
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -355,14 +355,14 @@ public final class CardPredicates {
|
|||||||
public static final Function<Card, Integer> fnGetDefense = new Function<Card, Integer>() {
|
public static final Function<Card, Integer> fnGetDefense = new Function<Card, Integer>() {
|
||||||
@Override
|
@Override
|
||||||
public Integer apply(Card a) {
|
public Integer apply(Card a) {
|
||||||
return a.getNetDefense();
|
return a.getNetToughness();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final Function<Card, Integer> fnGetNetAttack = new Function<Card, Integer>() {
|
public static final Function<Card, Integer> fnGetNetPower = new Function<Card, Integer>() {
|
||||||
@Override
|
@Override
|
||||||
public Integer apply(Card a) {
|
public Integer apply(Card a) {
|
||||||
return a.getNetAttack();
|
return a.getNetPower();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public class CardState {
|
|||||||
private ManaCost manaCost = ManaCost.NO_COST;
|
private ManaCost manaCost = ManaCost.NO_COST;
|
||||||
private List<CardColor> cardColor = new ArrayList<CardColor>();
|
private List<CardColor> cardColor = new ArrayList<CardColor>();
|
||||||
private String oracleText = "";
|
private String oracleText = "";
|
||||||
private int baseAttack = 0;
|
private int basePower = 0;
|
||||||
private int baseDefense = 0;
|
private int baseToughness = 0;
|
||||||
private List<String> intrinsicKeywords = new ArrayList<String>();
|
private List<String> intrinsicKeywords = new ArrayList<String>();
|
||||||
private final FCollection<SpellAbility> nonManaAbilities = new FCollection<SpellAbility>();
|
private final FCollection<SpellAbility> nonManaAbilities = new FCollection<SpellAbility>();
|
||||||
private final FCollection<SpellAbility> manaAbilities = new FCollection<SpellAbility>();
|
private final FCollection<SpellAbility> manaAbilities = new FCollection<SpellAbility>();
|
||||||
@@ -146,21 +146,21 @@ public class CardState {
|
|||||||
view.updateOracleText(this);
|
view.updateOracleText(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getBaseAttack() {
|
public final int getBasePower() {
|
||||||
return baseAttack;
|
return basePower;
|
||||||
}
|
}
|
||||||
public final void setBaseAttack(final int baseAttack0) {
|
public final void setBasePower(final int basePower0) {
|
||||||
if (baseAttack == baseAttack0) { return; }
|
if (basePower == basePower0) { return; }
|
||||||
baseAttack = baseAttack0;
|
basePower = basePower0;
|
||||||
view.updatePower(this);
|
view.updatePower(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getBaseDefense() {
|
public final int getBaseToughness() {
|
||||||
return baseDefense;
|
return baseToughness;
|
||||||
}
|
}
|
||||||
public final void setBaseDefense(final int baseDefense0) {
|
public final void setBaseToughness(final int baseToughness0) {
|
||||||
if (baseDefense == baseDefense0) { return; }
|
if (baseToughness == baseToughness0) { return; }
|
||||||
baseDefense = baseDefense0;
|
baseToughness = baseToughness0;
|
||||||
view.updateToughness(this);
|
view.updateToughness(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,8 +370,8 @@ public class CardState {
|
|||||||
setType(source.type);
|
setType(source.type);
|
||||||
setManaCost(source.getManaCost());
|
setManaCost(source.getManaCost());
|
||||||
setCardColor(source.getCardColor());
|
setCardColor(source.getCardColor());
|
||||||
setBaseAttack(source.getBaseAttack());
|
setBasePower(source.getBasePower());
|
||||||
setBaseDefense(source.getBaseDefense());
|
setBaseToughness(source.getBaseToughness());
|
||||||
intrinsicKeywords = new ArrayList<String>(source.intrinsicKeywords);
|
intrinsicKeywords = new ArrayList<String>(source.intrinsicKeywords);
|
||||||
unparsedAbilities = new ArrayList<String>(source.unparsedAbilities);
|
unparsedAbilities = new ArrayList<String>(source.unparsedAbilities);
|
||||||
staticAbilityStrings = new ArrayList<String>(source.staticAbilityStrings);
|
staticAbilityStrings = new ArrayList<String>(source.staticAbilityStrings);
|
||||||
|
|||||||
@@ -230,8 +230,8 @@ public final class CardUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// lock in the current P/T without bonus from counters
|
// lock in the current P/T without bonus from counters
|
||||||
newCopy.setBaseAttack(in.getCurrentPower() + in.getTempAttackBoost() + in.getSemiPermanentAttackBoost());
|
newCopy.setBasePower(in.getCurrentPower() + in.getTempPowerBoost() + in.getSemiPermanentPowerBoost());
|
||||||
newCopy.setBaseDefense(in.getCurrentToughness() + in.getTempDefenseBoost() + in.getSemiPermanentDefenseBoost());
|
newCopy.setBaseToughness(in.getCurrentToughness() + in.getTempToughnessBoost() + in.getSemiPermanentToughnessBoost());
|
||||||
|
|
||||||
newCopy.setCounters(in.getCounters());
|
newCopy.setCounters(in.getCounters());
|
||||||
newCopy.setExtrinsicKeyword(in.getExtrinsicKeyword());
|
newCopy.setExtrinsicKeyword(in.getExtrinsicKeyword());
|
||||||
@@ -286,8 +286,8 @@ public final class CardUtil {
|
|||||||
type.add("Creature");
|
type.add("Creature");
|
||||||
|
|
||||||
final CardState ret = new CardState(c.getView().createAlternateState(CardStateName.FaceDown));
|
final CardState ret = new CardState(c.getView().createAlternateState(CardStateName.FaceDown));
|
||||||
ret.setBaseAttack(2);
|
ret.setBasePower(2);
|
||||||
ret.setBaseDefense(2);
|
ret.setBaseToughness(2);
|
||||||
|
|
||||||
ret.setName("");
|
ret.setName("");
|
||||||
ret.setType(type);
|
ret.setType(type);
|
||||||
|
|||||||
@@ -638,7 +638,7 @@ public class CardView extends GameEntityView {
|
|||||||
return get(TrackableProperty.Power);
|
return get(TrackableProperty.Power);
|
||||||
}
|
}
|
||||||
void updatePower(Card c) {
|
void updatePower(Card c) {
|
||||||
set(TrackableProperty.Power, c.getNetAttack());
|
set(TrackableProperty.Power, c.getNetPower());
|
||||||
}
|
}
|
||||||
void updatePower(CardState c) {
|
void updatePower(CardState c) {
|
||||||
if (CardView.this.getCurrentState() == this) {
|
if (CardView.this.getCurrentState() == this) {
|
||||||
@@ -648,14 +648,14 @@ public class CardView extends GameEntityView {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set(TrackableProperty.Power, c.getBaseAttack());
|
set(TrackableProperty.Power, c.getBasePower());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getToughness() {
|
public int getToughness() {
|
||||||
return get(TrackableProperty.Toughness);
|
return get(TrackableProperty.Toughness);
|
||||||
}
|
}
|
||||||
void updateToughness(Card c) {
|
void updateToughness(Card c) {
|
||||||
set(TrackableProperty.Toughness, c.getNetDefense());
|
set(TrackableProperty.Toughness, c.getNetToughness());
|
||||||
}
|
}
|
||||||
void updateToughness(CardState c) {
|
void updateToughness(CardState c) {
|
||||||
if (CardView.this.getCurrentState() == this) {
|
if (CardView.this.getCurrentState() == this) {
|
||||||
@@ -665,7 +665,7 @@ public class CardView extends GameEntityView {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set(TrackableProperty.Toughness, c.getBaseDefense());
|
set(TrackableProperty.Toughness, c.getBaseToughness());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLoyalty() {
|
public int getLoyalty() {
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ public class CombatUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attacker.hasKeyword("Creatures with power less than CARDNAME's power can't block it.") && attacker.getNetAttack() > blocker.getNetAttack()) {
|
if (attacker.hasKeyword("Creatures with power less than CARDNAME's power can't block it.") && attacker.getNetPower() > blocker.getNetPower()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ public class GameEventCardStatsChanged extends GameEvent {
|
|||||||
if ( null == card )
|
if ( null == card )
|
||||||
return "Card state changes: (empty list)";
|
return "Card state changes: (empty list)";
|
||||||
if( cards.size() == 1)
|
if( cards.size() == 1)
|
||||||
return String.format("Card state changes: %s (%s) %d/%d", card.getName(), StringUtils.join(card.getType(), ' '), card.getNetAttack(), card.getNetDefense() );
|
return String.format("Card state changes: %s (%s) %d/%d", card.getName(), StringUtils.join(card.getType(), ' '), card.getNetPower(), card.getNetToughness() );
|
||||||
else
|
else
|
||||||
return String.format("Card state changes: %s (%s) %d/%d and %d more", card.getName(), StringUtils.join(card.getType(), ' '), card.getNetAttack(), card.getNetDefense(), cards.size() - 1 );
|
return String.format("Card state changes: %s (%s) %d/%d and %d more", card.getName(), StringUtils.join(card.getType(), ' '), card.getNetPower(), card.getNetToughness(), cards.size() - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1636,7 +1636,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
|||||||
final CardCollectionView ferocious = CardLists.filter(list, new Predicate<Card>() {
|
final CardCollectionView ferocious = CardLists.filter(list, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return c.getNetAttack() > 3;
|
return c.getNetPower() > 3;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return !ferocious.isEmpty();
|
return !ferocious.isEmpty();
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
}
|
}
|
||||||
switch (related) {
|
switch (related) {
|
||||||
case "LEPower" :
|
case "LEPower" :
|
||||||
return c.getNetAttack() <= parentTarget.getNetAttack();
|
return c.getNetPower() <= parentTarget.getNetPower();
|
||||||
case "LECMC" :
|
case "LECMC" :
|
||||||
return c.getCMC() <= parentTarget.getCMC();
|
return c.getCMC() <= parentTarget.getCMC();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public class SpellPermanent extends Spell {
|
|||||||
|
|
||||||
if (sourceCard.isCreature()) {
|
if (sourceCard.isCreature()) {
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append(sourceCard.getName()).append(" - Creature ").append(sourceCard.getNetAttack());
|
sb.append(sourceCard.getName()).append(" - Creature ").append(sourceCard.getNetPower());
|
||||||
sb.append(" / ").append(sourceCard.getNetDefense());
|
sb.append(" / ").append(sourceCard.getNetToughness());
|
||||||
this.setStackDescription(sb.toString());
|
this.setStackDescription(sb.toString());
|
||||||
} else {
|
} else {
|
||||||
this.setStackDescription(sourceCard.getName());
|
this.setStackDescription(sourceCard.getName());
|
||||||
|
|||||||
@@ -396,10 +396,10 @@ public class StaticAbilityContinuous {
|
|||||||
// set P/T
|
// set P/T
|
||||||
if (params.containsKey("CharacteristicDefining")) {
|
if (params.containsKey("CharacteristicDefining")) {
|
||||||
if (setPower != -1) {
|
if (setPower != -1) {
|
||||||
affectedCard.setBaseAttack(setPower);
|
affectedCard.setBasePower(setPower);
|
||||||
}
|
}
|
||||||
if (setToughness != -1) {
|
if (setToughness != -1) {
|
||||||
affectedCard.setBaseDefense(setToughness);
|
affectedCard.setBaseToughness(setToughness);
|
||||||
}
|
}
|
||||||
} else // non CharacteristicDefining
|
} else // non CharacteristicDefining
|
||||||
if ((setPower != -1) || (setToughness != -1)) {
|
if ((setPower != -1) || (setToughness != -1)) {
|
||||||
@@ -421,8 +421,8 @@ public class StaticAbilityContinuous {
|
|||||||
toughnessBonus = CardFactoryUtil.xCount(affectedCard, AbilityUtils.getSVar(stAb, addT));
|
toughnessBonus = CardFactoryUtil.xCount(affectedCard, AbilityUtils.getSVar(stAb, addT));
|
||||||
se.addXMapValue(affectedCard, toughnessBonus);
|
se.addXMapValue(affectedCard, toughnessBonus);
|
||||||
}
|
}
|
||||||
affectedCard.addSemiPermanentAttackBoost(powerBonus);
|
affectedCard.addSemiPermanentPowerBoost(powerBonus);
|
||||||
affectedCard.addSemiPermanentDefenseBoost(toughnessBonus);
|
affectedCard.addSemiPermanentToughnessBoost(toughnessBonus);
|
||||||
|
|
||||||
// add keywords
|
// add keywords
|
||||||
// TODO regular keywords currently don't try to use keyword multiplier
|
// TODO regular keywords currently don't try to use keyword multiplier
|
||||||
|
|||||||
@@ -270,8 +270,8 @@ public abstract class Trigger extends TriggerReplacementBase {
|
|||||||
// sb.append(this.getHostCard().getName());
|
// sb.append(this.getHostCard().getName());
|
||||||
// throw new RuntimeException(sb.toString());
|
// throw new RuntimeException(sb.toString());
|
||||||
}
|
}
|
||||||
if (moved.getNetAttack() <= this.getHostCard().getNetAttack()
|
if (moved.getNetPower() <= this.getHostCard().getNetPower()
|
||||||
&& moved.getNetDefense() <= this.getHostCard().getNetDefense()) {
|
&& moved.getNetToughness() <= this.getHostCard().getNetToughness()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class TriggerAttackerBlockedByCreature extends Trigger {
|
|||||||
if (this.mapParams.containsKey("ValidCard")) {
|
if (this.mapParams.containsKey("ValidCard")) {
|
||||||
final String validCard = this.mapParams.get("ValidCard");
|
final String validCard = this.mapParams.get("ValidCard");
|
||||||
if (validCard.equals("LessPowerThanBlocker")) {
|
if (validCard.equals("LessPowerThanBlocker")) {
|
||||||
if (attacker.getNetAttack() >= blocker.getNetAttack()) {
|
if (attacker.getNetPower() >= blocker.getNetPower()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!matchesValid(attacker, validCard.split(","), this.getHostCard())) {
|
} else if (!matchesValid(attacker, validCard.split(","), this.getHostCard())) {
|
||||||
@@ -73,7 +73,7 @@ public class TriggerAttackerBlockedByCreature extends Trigger {
|
|||||||
if (this.mapParams.containsKey("ValidBlocker")) {
|
if (this.mapParams.containsKey("ValidBlocker")) {
|
||||||
final String validBlocker = this.mapParams.get("ValidBlocker");
|
final String validBlocker = this.mapParams.get("ValidBlocker");
|
||||||
if (validBlocker.equals("LessPowerThanAttacker")) {
|
if (validBlocker.equals("LessPowerThanAttacker")) {
|
||||||
if (blocker.getNetAttack() >= attacker.getNetAttack()) {
|
if (blocker.getNetPower() >= attacker.getNetPower()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!matchesValid(blocker, validBlocker.split(","), this.getHostCard())) {
|
} else if (!matchesValid(blocker, validBlocker.split(","), this.getHostCard())) {
|
||||||
|
|||||||
@@ -232,8 +232,8 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
|| panel.getCard().isCopiedSpell()
|
|| panel.getCard().isCopiedSpell()
|
||||||
|| !panel.getCard().getCounters().equals(firstPanel.getCard().getCounters())
|
|| !panel.getCard().getCounters().equals(firstPanel.getCard().getCounters())
|
||||||
|| (panel.getCard().isSick() != firstPanel.getCard().isSick())
|
|| (panel.getCard().isSick() != firstPanel.getCard().isSick())
|
||||||
|| (panel.getCard().getNetAttack() != firstPanel.getCard().getNetAttack())
|
|| (panel.getCard().getNetPower() != firstPanel.getCard().getNetPower())
|
||||||
|| (panel.getCard().getNetDefense() != firstPanel.getCard().getNetDefense())
|
|| (panel.getCard().getNetToughness() != firstPanel.getCard().getNetToughness())
|
||||||
|| (stack.size() == creatureStackMax)) {
|
|| (stack.size() == creatureStackMax)) {
|
||||||
// If this creature has attachments or the stack is full,
|
// If this creature has attachments or the stack is full,
|
||||||
// put it to the right.
|
// put it to the right.
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ public class RunTest {
|
|||||||
this.check("2.2", c.isType("Elf"));
|
this.check("2.2", c.isType("Elf"));
|
||||||
this.check("2.3", c.isType("Warrior"));
|
this.check("2.3", c.isType("Warrior"));
|
||||||
this.check("3", c.getText().equals(""));
|
this.check("3", c.getText().equals(""));
|
||||||
this.check("4", c.getNetAttack() == 2);
|
this.check("4", c.getNetPower() == 2);
|
||||||
this.check("5", c.getNetDefense() == 3);
|
this.check("5", c.getNetToughness() == 3);
|
||||||
this.check("6", c.getKeyword().isEmpty());
|
this.check("6", c.getKeyword().isEmpty());
|
||||||
|
|
||||||
c = cf.getCard("Shock", null);
|
c = cf.getCard("Shock", null);
|
||||||
|
|||||||
Reference in New Issue
Block a user