Fix zero-power but boostable creatures overlooked for attack (#10522)#10525
Fix zero-power but boostable creatures overlooked for attack (#10522)#10525CTimmerman wants to merge 1 commit into
Conversation
| } | ||
|
|
||
| if (ComputerUtilCombat.canAttackNextTurn(pCard) | ||
| && (pCard.getNetCombatDamage() > 0 |
There was a problem hiding this comment.
should just move the damageIfUnblocked outside the branch and check that for > 0 instead
then most likely all the logic here becomes redundant...
There was a problem hiding this comment.
With
if (ComputerUtilCombat.canAttackNextTurn(pCard)) {
int damage = ComputerUtilCombat.damageIfUnblocked(pCard, defendingOpponent, null, false);
if (damage > 0
// || canBoostPower
|| "TRUE".equals(pCard.getSVar("HasAttackEffect"))
|| pCard.hasKeyword(Keyword.ANNIHILATOR)
|| pCard.hasKeyword(Keyword.FIREBENDING)
|| pCard.hasKeyword(Keyword.FRENZY)
|| pCard.hasKeyword(Keyword.MELEE)
|| pCard.hasKeyword(Keyword.MYRIAD)
|| pCard.hasKeyword(Keyword.PROVOKE)
// || (computerForces > 0 && pCard.hasKeyword(Keyword.BATTLE_CRY) || pCard.hasKeyword(Keyword.TRAINING))
|| (pCard.hasKeyword(Keyword.DETHRONE) && defendingOpponent == mostLifePlayer)
// || (computerForces == 0 && exaltedCount > 0))
) {
candidateAttackers.add(pCard);
candidateUnblockedDamage += damage;
computerForces++;
}
}Signal Pest attacks on its own without my logic, and i haven't seen pump after attack with 0 power yet. Exalted appears to work.
But getting poked to death by a 1/3 instead of winning with triple (Saga, Rogue, and Horsemanship) unblockable commander damage turns ago while your other creatures block is sad:

Even Lorthos, the Tidemaker didn't attack for some reason:

And the poker is also taking too much time:

Supplying the combat argument instead of null results in Robert wasting mana:

But O'tho did pump after attacking with Charix, so that's good:

UFO and Protege had max power 0 but still attacked, and were blocked, but given the number of opponents it might have been better to keep them as blockers:

There was a problem hiding this comment.
I don't have time to test each of your claims but already the first (Signal Pest) has a different cause so your changes are unrelated and it happens anyway 🤷♂️
There was a problem hiding this comment.
I thought the cause of useless attacks like this one is that if there are no candidateAttackers, all are forced to attack somewhere i can't find anymore at the moment:
Adding debug prints to all returns in declareAttackers, it appears that the combat is calculated multiple times, all of which appear to consider the power 1 in this case for no apparent reason:

Details
PH Robert [{R}: Ogre Menial gets +1/+0 until end of turn.]
PH Firedorn [Crimson Kobolds - Creature 0 / 1]
Go Ignoble Hierarch (244) dmg 1 targetDamage 80 atk fx false rest false
Go Roterothopter (262) dmg 2 targetDamage 80 atk fx false rest false
Go Impetuous Protege (245) dmg 1 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (233) dmg 1 targetDamage 80 atk fx false rest false
Go Turtle-Duck (230) dmg 1 targetDamage 80 atk fx false rest false
Go Locthwain Gargoyle (229) dmg 3 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (232) dmg 1 targetDamage 80 atk fx false rest false
DA final combat Robert is being attacked by:
Impetuous Protege (245)
Roterothopter (262)
Ogre Menial (235)
Crimson Kobolds (233)
Turtle-Duck (230)
Locthwain Gargoyle (229)
agg 4
Go Ignoble Hierarch (244) dmg 1 targetDamage 80 atk fx false rest false
Go Roterothopter (262) dmg 2 targetDamage 80 atk fx false rest false
Go Impetuous Protege (245) dmg 1 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (233) dmg 1 targetDamage 80 atk fx false rest false
Go Turtle-Duck (230) dmg 1 targetDamage 80 atk fx false rest false
Go Locthwain Gargoyle (229) dmg 3 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (232) dmg 1 targetDamage 80 atk fx false rest false
DA final combat Virde is being attacked by:
Locthwain Gargoyle (229)
agg 2
Go Ignoble Hierarch (244) dmg 1 targetDamage 80 atk fx false rest false
Go Roterothopter (262) dmg 2 targetDamage 80 atk fx false rest false
Go Impetuous Protege (245) dmg 1 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (233) dmg 1 targetDamage 80 atk fx false rest false
Go Turtle-Duck (230) dmg 1 targetDamage 80 atk fx false rest false
Go Locthwain Gargoyle (229) dmg 3 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (232) dmg 1 targetDamage 80 atk fx false rest false
DA final combat Robert is being attacked by:
Locthwain Gargoyle (229)
agg 2
PH Firedorn [{4}: Locthwain Gargoyle gets +2/+0 and gains flying until end of turn.]
Go Ignoble Hierarch (244) dmg 1 targetDamage 80 atk fx false rest false
Go Roterothopter (262) dmg 2 targetDamage 80 atk fx false rest false
Go Impetuous Protege (245) dmg 1 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (233) dmg 1 targetDamage 80 atk fx false rest false
Go Turtle-Duck (230) dmg 1 targetDamage 80 atk fx false rest false
Go Locthwain Gargoyle (229) dmg 3 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (232) dmg 1 targetDamage 80 atk fx false rest false
DA final combat Robert is being attacked by:
Impetuous Protege (245)
Locthwain Gargoyle (229)
Roterothopter (262)
Ogre Menial (235)
Crimson Kobolds (233)
Turtle-Duck (230)
agg 4
Go Ignoble Hierarch (244) dmg 1 targetDamage 80 atk fx false rest false
Go Roterothopter (262) dmg 2 targetDamage 80 atk fx false rest false
Go Impetuous Protege (245) dmg 1 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (233) dmg 1 targetDamage 80 atk fx false rest false
Go Turtle-Duck (230) dmg 1 targetDamage 80 atk fx false rest false
Go Locthwain Gargoyle (229) dmg 3 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (232) dmg 1 targetDamage 80 atk fx false rest false
DA final combat Robert is being attacked by:
Turtle-Duck (230)
agg 2
Go Ignoble Hierarch (244) dmg 1 targetDamage 80 atk fx false rest false
Go Roterothopter (262) dmg 2 targetDamage 80 atk fx false rest false
Go Impetuous Protege (245) dmg 1 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (233) dmg 1 targetDamage 80 atk fx false rest false
Go Turtle-Duck (230) dmg 1 targetDamage 80 atk fx false rest false
Go Locthwain Gargoyle (229) dmg 3 targetDamage 80 atk fx false rest false
Go Crimson Kobolds (232) dmg 1 targetDamage 80 atk fx false rest false
DA final combat Robert is being attacked by:
Impetuous Protege (245)
Locthwain Gargoyle (229)
Roterothopter (262)
Ogre Menial (235)
Crimson Kobolds (233)
Turtle-Duck (230)
agg 4
Duty-Bound Dead doesn't appear to attack much on its own, but this fixes #10522:
