mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge branch 'master' into 'master'
DamageDealAi: fix a crash and logic error for cards like Expansion // Explosion, Chamber Sentry, etc. See merge request core-developers/forge!1830
This commit is contained in:
@@ -276,7 +276,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
final boolean noPrevention = sa.hasParam("NoPrevention");
|
final boolean noPrevention = sa.hasParam("NoPrevention");
|
||||||
for (final Card c : sa.getTargets().getTargetCards()) {
|
for (final Card c : sa.getTargets().getTargetCards()) {
|
||||||
final int adjDamage = ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);
|
final int adjDamage = ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);
|
||||||
if ((adjDamage > actualPay) && (adjDamage <= dmg)) {
|
if (adjDamage < actualPay) {
|
||||||
actualPay = adjDamage;
|
actualPay = adjDamage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -291,7 +291,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
// Check to ensure that we have enough counters to remove per the defined PayX
|
// Check to ensure that we have enough counters to remove per the defined PayX
|
||||||
for (CostPart part : sa.getPayCosts().getCostParts()) {
|
for (CostPart part : sa.getPayCosts().getCostParts()) {
|
||||||
if (part instanceof CostRemoveCounter) {
|
if (part instanceof CostRemoveCounter) {
|
||||||
if (source.getCounters(((CostRemoveCounter) part).counter) < Integer.valueOf(sa.getSVar("PayX"))) {
|
if (source.getCounters(((CostRemoveCounter) part).counter) < Integer.valueOf(source.getSVar("PayX"))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user