rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
368 stars 1.16k forks source link

Ai should consider Tera Type #5213

Open pkmnsnfrn opened 2 months ago

pkmnsnfrn commented 2 months ago

Description

When making a decision against the Player, the AI should consider:

Discord contact info

Zatsoo

fakuzatsu commented 2 months ago

In addition to this. The AI should consider:

AlexOn1ine commented 2 months ago
Has the enemy Pokémon undergone the Terastal phenomenon? If so, what is its new type?
Could the enemy Pokémon undergo the Terastal phenomenon? If so, what is its new type likely to be?

Both of those are already present. When doing AI calcs and the ai has a tera type it will do it's calculations with the tera typing.

fakuzatsu commented 2 months ago

This isn't regarding using Tera type in calculations. Rather new AI behaviour pertaining to Tera. Somewhat mis-explained in the original post.

Original message has been modified to reflect this.

AlexOn1ine commented 2 months ago

This isn't regarding using Tera type in calculations. Rather new AI behaviour pertaining to Tera. Somewhat mis-explained in the original post.

Original message has been modified to reflect this.

If I (NPC trianer) Tera, will the additional STAB get me a KO?

This is already present in the function AI_CalcDamage

    // Temporarily enable gimmicks for damage calcs if planned
    if (gBattleStruct->gimmick.usableGimmick[battlerAtk] && GetActiveGimmick(battlerAtk) == GIMMICK_NONE
        && !(gBattleStruct->gimmick.usableGimmick[battlerAtk] == GIMMICK_Z_MOVE && !considerZPower))
    {
        // Set Z-Move variables if needed
        if (gBattleStruct->gimmick.usableGimmick[battlerAtk] == GIMMICK_Z_MOVE && IsViableZMove(battlerAtk, move))
            gBattleStruct->zmove.baseMoves[battlerAtk] = move;

        toggledGimmick = TRUE;
        SetActiveGimmick(battlerAtk, gBattleStruct->gimmick.usableGimmick[battlerAtk]);
    }
AlexOn1ine commented 2 months ago

Also small clarification. When I talk about AI calcs I mean calcs that are done before the actual damage calculations.

/Edit: I assume your idea is that based on the AI calculations the AI should decide if it is beneficial to terastal or not. E.g. if it already has a kill don't waste the tera on current mon.