kwsch / SysBot.NET

sys-botbase client for remote control automation of Nintendo Switch consoles.
https://projectpokemon.org/home/files/file/4207-sysbot-automatic-build/
GNU Affero General Public License v3.0
463 stars 270 forks source link

SpA/SpD/Spe being assigned wrong values on trade #199

Closed bdawg1989 closed 5 months ago

bdawg1989 commented 5 months ago

Latest Sysbot does not assign correct EV values.

Example showdown set:

Azumarill  
Ability: Thick Fat  
Tera Type: Water  
EVs: 252 HP / 4 Atk / 252 SpA  
Quiet Nature  
- Alluring Voice  
- Aqua Jet  
- Aqua Tail  
- Blizzard

Output File:

0184_-Azumarill-_D0BE40EDB533.zip

Assigns SpD instead of SpA

image

I thought it was due to PKHeX not having the values in correct order that showdown expects, but that didn't work either.

    /// <summary>
    /// Retrieves the EVs of the PKM in the order HP, ATK, DEF, SPE, SPA, SPD
    /// </summary>
    /// <param name="value">Span of length 6 to write the EVs to</param>
    public void GetEVs(Span<int> value)
    {
        if (value.Length != 6)
            return;
        value[0] = EV_HP;
        value[1] = EV_ATK;
        value[2] = EV_DEF;
        value[3] = EV_SPE;
        value[4] = EV_SPA;
        value[5] = EV_SPD;
    }

    /// <summary>
    /// Sets the EVs of the PKM in the order HP, ATK, DEF, SPE, SPA, SPD
    /// </summary>
    /// <param name="value">Span of length 6 to read the EVs from</param>
    public void SetEVs(ReadOnlySpan<int> value)
    {
        if (value.Length != 6)
            return;
        EV_HP = value[0];
        EV_ATK = value[1];
        EV_DEF = value[2];
        EV_SPE = value[3];
        EV_SPA = value[4];
        EV_SPD = value[5];
    }
kwsch commented 5 months ago

Not able to replicate with any of the unit tests using this repo's latest commit.

bdawg1989 commented 5 months ago

Ah, I just realized that even though I downloaded the latest sysBOT commit to test, I replaced PKHeX.Core.dll in the nuget package with the latest commits too. If the issue still exists after the next release of PKHeX, I’ll circle back and re-open another issue. Feel free to close this for now.

Edit: Looks like the new pkhex released, so I’ll update and retest to see if showdown sets are still assigning wrong values and report back.

Lusamine commented 5 months ago

Issues are for problems with the current latest commit, not with custom builds or future releases. Closing this since you are using a custom build with a different core. If the issue persists on an unedited release of sysbot after it is updated for the new core, please re-open it.