Skip to content

Fix zero-power but boostable creatures overlooked for attack (#10522)#10525

Draft
CTimmerman wants to merge 1 commit into
Card-Forge:masterfrom
CTimmerman:#10522-zero-power-attacks
Draft

Fix zero-power but boostable creatures overlooked for attack (#10522)#10525
CTimmerman wants to merge 1 commit into
Card-Forge:masterfrom
CTimmerman:#10522-zero-power-attacks

Conversation

@CTimmerman
Copy link
Copy Markdown
Contributor

@CTimmerman CTimmerman commented Apr 25, 2026

Duty-Bound Dead doesn't appear to attack much on its own, but this fixes #10522:
image

}

if (ComputerUtilCombat.canAttackNextTurn(pCard)
&& (pCard.getNetCombatDamage() > 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just move the damageIfUnblocked outside the branch and check that for > 0 instead
then most likely all the logic here becomes redundant...

Copy link
Copy Markdown
Contributor Author

@CTimmerman CTimmerman Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Image

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:
image
Even Lorthos, the Tidemaker didn't attack for some reason:
image
And the poker is also taking too much time:
image

Supplying the combat argument instead of null results in Robert wasting mana:
image
But O'tho did pump after attacking with Charix, so that's good:
image
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:
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤷‍♂️

Copy link
Copy Markdown
Contributor Author

@CTimmerman CTimmerman Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

image

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:
image

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

@CTimmerman CTimmerman marked this pull request as draft May 7, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zero-power but boostable creatures overlooked for attack

2 participants