mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Improved AI handling of "You may have CARDNAME assign its combat damage as though it weren't blocked.".
This commit is contained in:
@@ -1063,7 +1063,8 @@ public class CombatUtil {
|
||||
|
||||
final CardList blockers = combat.getBlockers(attacker);
|
||||
|
||||
if (blockers.size() == 0) {
|
||||
if (blockers.size() == 0 || attacker.hasKeyword("You may have CARDNAME assign its combat damage " +
|
||||
"as though it weren't blocked.")) {
|
||||
unblocked.add(attacker);
|
||||
} else if (attacker.hasKeyword("Trample")
|
||||
&& (CombatUtil.getAttack(attacker) > CombatUtil.totalShieldDamage(attacker, blockers))) {
|
||||
@@ -1103,7 +1104,8 @@ public class CombatUtil {
|
||||
|
||||
final CardList blockers = combat.getBlockers(attacker);
|
||||
|
||||
if (blockers.size() == 0) {
|
||||
if (blockers.size() == 0 || attacker.hasKeyword("You may have CARDNAME assign its combat damage" +
|
||||
" as though it weren't blocked.")) {
|
||||
unblocked.add(attacker);
|
||||
} else if (attacker.hasKeyword("Trample")
|
||||
&& (CombatUtil.getAttack(attacker) > CombatUtil.totalShieldDamage(attacker, blockers))) {
|
||||
|
||||
@@ -339,7 +339,7 @@ public class ComputerUtilBlock {
|
||||
killingBlockers = ComputerUtilBlock.getKillingBlockers(attacker, safeBlockers, combat);
|
||||
if (killingBlockers.size() > 0) {
|
||||
blocker = CardFactoryUtil.getWorstCreatureAI(killingBlockers);
|
||||
} else {
|
||||
} else if (!attacker.hasKeyword("You may have CARDNAME assign its combat damage as though it weren't blocked.")) {
|
||||
blocker = CardFactoryUtil.getWorstCreatureAI(safeBlockers);
|
||||
ComputerUtilBlock.getBlockedButUnkilled().add(attacker);
|
||||
}
|
||||
@@ -548,7 +548,8 @@ public class ComputerUtilBlock {
|
||||
|
||||
for (final Card attacker : ComputerUtilBlock.getAttackersLeft()) {
|
||||
|
||||
if (attacker.hasKeyword("CARDNAME can't be blocked except by two or more creatures.")) {
|
||||
if (attacker.hasKeyword("CARDNAME can't be blocked except by two or more creatures.")
|
||||
|| attacker.hasKeyword("You may have CARDNAME assign its combat damage as though it weren't blocked.")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -594,8 +595,9 @@ public class ComputerUtilBlock {
|
||||
|
||||
for (final Card attacker : tramplingAttackers) {
|
||||
|
||||
if (attacker.hasKeyword("CARDNAME can't be blocked except by two or more creatures.")
|
||||
&& !combat.isBlocked(attacker)) {
|
||||
if ((attacker.hasKeyword("CARDNAME can't be blocked except by two or more creatures.")
|
||||
&& !combat.isBlocked(attacker))
|
||||
|| attacker.hasKeyword("You may have CARDNAME assign its combat damage as though it weren't blocked.")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -445,6 +445,9 @@ public class CardFactoryUtil {
|
||||
if (c.hasKeyword("Unblockable")) {
|
||||
value += power * 10;
|
||||
}
|
||||
if (c.hasKeyword("You may have CARDNAME assign its combat damage as though it weren't blocked.")) {
|
||||
value += power * 6;
|
||||
}
|
||||
if (c.hasKeyword("Fear")) {
|
||||
value += power * 6;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user