Skip to content

Wrong comment about AI logic for evolution cards (or bug in AI logic) #172

@oatspear

Description

@oatspear

; if defending Pokémon can KO evolution, lower AI score

In the code block below the referenced comment, the AI calls CheckIfDefendingPokemonCanKnockOut and lowers the score to play the evolution card if this function sets carry - i.e., if the Defending Pokémon can score a Knock Out. However, the comment says "can KO evolution", and this is partially wrong because, while the play area card is temporarily swapped with the evolution for evaluation of attacks, the duel variable for HP is not swapped. Thus, CheckIfDefendingPokemonCanKnockOut checks a KO against the pre-evolution HP, while using the evolution card data for the rest of the damage calculation (Weakness, Resistance, Powers).

So, the intent of this block was good (do not waste an evolution card if it is going to be knocked out), but the implementation seems to be flawed. The AI will lower evolution score if the Basic Pokémon is at risk of being knocked out, even though the evolution might survive it (larger HP pool).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions