mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- The AI will now take the trigger of Godsend into account.
This commit is contained in:
@@ -418,6 +418,12 @@ public class ComputerUtilCombat {
|
|||||||
*/
|
*/
|
||||||
public static int totalDamageOfBlockers(final Card attacker, final List<Card> defenders) {
|
public static int totalDamageOfBlockers(final Card attacker, final List<Card> defenders) {
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
|
|
||||||
|
for (Card equipment : attacker.getEquippedBy()) {
|
||||||
|
if (equipment.getName().equals("Godsend") && !defenders.isEmpty()) {
|
||||||
|
defenders.remove(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (final Card defender : defenders) {
|
for (final Card defender : defenders) {
|
||||||
damage += ComputerUtilCombat.dealsDamageAsBlocker(attacker, defender);
|
damage += ComputerUtilCombat.dealsDamageAsBlocker(attacker, defender);
|
||||||
@@ -1530,6 +1536,12 @@ public class ComputerUtilCombat {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Card equipment : defender.getEquippedBy()) {
|
||||||
|
if (equipment.getName().equals("Godsend")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int flankingMagnitude = 0;
|
int flankingMagnitude = 0;
|
||||||
if (attacker.hasKeyword("Flanking") && !defender.hasKeyword("Flanking")) {
|
if (attacker.hasKeyword("Flanking") && !defender.hasKeyword("Flanking")) {
|
||||||
|
|
||||||
@@ -1555,6 +1567,13 @@ public class ComputerUtilCombat {
|
|||||||
if (checkDestroyAttackerTrigger(attacker, defender) && !attacker.hasKeyword("Indestructible")) {
|
if (checkDestroyAttackerTrigger(attacker, defender) && !attacker.hasKeyword("Indestructible")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Card equipment : attacker.getEquippedBy()) {
|
||||||
|
if (equipment.getName().equals("Godsend")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (attacker.hasKeyword("PreventAllDamageBy Creature.blockingSource")) {
|
if (attacker.hasKeyword("PreventAllDamageBy Creature.blockingSource")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1678,6 +1697,13 @@ public class ComputerUtilCombat {
|
|||||||
public static boolean canDestroyBlocker(Player ai, final Card defender, final Card attacker, final Combat combat,
|
public static boolean canDestroyBlocker(Player ai, final Card defender, final Card attacker, final Combat combat,
|
||||||
final boolean withoutAbilities) {
|
final boolean withoutAbilities) {
|
||||||
final Game game = ai.getGame();
|
final Game game = ai.getGame();
|
||||||
|
|
||||||
|
for (Card equipment : attacker.getEquippedBy()) {
|
||||||
|
if (equipment.getName().equals("Godsend")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int flankingMagnitude = 0;
|
int flankingMagnitude = 0;
|
||||||
if (attacker.hasKeyword("Flanking") && !defender.hasKeyword("Flanking")) {
|
if (attacker.hasKeyword("Flanking") && !defender.hasKeyword("Flanking")) {
|
||||||
|
|
||||||
@@ -1704,6 +1730,12 @@ public class ComputerUtilCombat {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Card equipment : defender.getEquippedBy()) {
|
||||||
|
if (equipment.getName().equals("Godsend")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int defenderDamage = defender.getNetAttack()
|
int defenderDamage = defender.getNetAttack()
|
||||||
+ ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, withoutAbilities);
|
+ ComputerUtilCombat.predictPowerBonusOfBlocker(attacker, defender, withoutAbilities);
|
||||||
int attackerDamage = attacker.getNetAttack()
|
int attackerDamage = attacker.getNetAttack()
|
||||||
|
|||||||
Reference in New Issue
Block a user