Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework multi battle partner data #3234

Closed

Conversation

ShinyDragonHunter
Copy link

@ShinyDragonHunter ShinyDragonHunter commented Aug 15, 2023

Description

This is my first PR so I do apologise if it isn't perfect...

This PR restructures battle partner data so they use their own array separate from gTrainers so a user isn't wasting trainer flags. Generating the party data is handled through a new CreateNPCPartyData function which generates the party based on the party flags given to the array entry with a parameter handling both a partner and a trainer, With partners being able to set their trainer name and trainer id to the party for the summary screen. Partners use the trainerPic field in the data for the back pic whilst trainer still use it for the front pic.

Here's the new array for partners with Steven's vanilla party data remade with it:

const struct Trainer gBattlePartners[] = {
    [PARTNER_NONE] =
    {
        .party = {.NoItemDefaultMoves = NULL},
    },

    [PARTNER_STEVEN] =
    {
        .aiFlags = 0, // TODO: allow partners to use their own AI flags
        .party = EVERYTHING_CUSTOMIZED(sParty_StevenPartner),
        .trainerClass = TRAINER_CLASS_RIVAL,
        .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
        .trainerPic = TRAINER_BACK_PIC_STEVEN,
        .trainerName = _("STEVEN"),
    },
};
static const struct TrainerMonCustomized sParty_StevenPartner[] = {
    {
        .ev = TRAINER_PARTY_EVS(0, 252, 252, 0, 6, 0),
        .iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
        .moves = {MOVE_LIGHT_SCREEN, MOVE_PSYCHIC, MOVE_REFLECT, MOVE_METAL_CLAW},
        .species = SPECIES_METANG,
        .lvl = 42,
        .nature = TRAINER_PARTY_NATURE(NATURE_BRAVE),
    },
    {
        .ev = TRAINER_PARTY_EVS(252, 0, 0, 0, 6, 252),
        .iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
        .moves = {MOVE_TOXIC, MOVE_AERIAL_ACE, MOVE_PROTECT, MOVE_STEEL_WING},
        .species = SPECIES_SKARMORY,
        .lvl = 43,
        .nature = TRAINER_PARTY_NATURE(NATURE_IMPISH),
    },
    {
        .ev = TRAINER_PARTY_EVS(0, 252, 0, 0, 252, 6),
        .iv = TRAINER_PARTY_IVS(31, 31, 31, 31, 31, 31),
        .moves = {MOVE_THUNDER, MOVE_PROTECT, MOVE_SOLAR_BEAM, MOVE_DRAGON_CLAW},
        .species = SPECIES_AGGRON,
        .lvl = 44,
        .nature = TRAINER_PARTY_NATURE(NATURE_ADAMANT),
    }
};

This PR also adds functionality for both trainers and partners for the rival and all a person needs to do is set the rival's name to {RIVAL} and the trainer name in-game will display the name set for the rival. By default, it's set to MAY if male and BRENDAN if female.

Discord contact info

@ShinyDragonHunter ShinyDragonHunter changed the base branch from master to upcoming August 15, 2023 03:41
@ShinyDragonHunter ShinyDragonHunter changed the title Upcoming Rework multi battle partner data Aug 15, 2023
@AsparagusEduardo AsparagusEduardo marked this pull request as ready for review August 15, 2023 11:55
@AsparagusEduardo AsparagusEduardo marked this pull request as draft August 15, 2023 11:56
@AsparagusEduardo AsparagusEduardo marked this pull request as ready for review August 16, 2023 19:13
@AsparagusEduardo AsparagusEduardo marked this pull request as draft August 16, 2023 19:13
Copy link
Collaborator

@AlexOn1ine AlexOn1ine left a comment

Choose a reason for hiding this comment

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

This does clear a lot of redundant code and I do like the idea to use a separate array to not waste flags but I don't see how it makes easier to create multi battles. Could you elaborate it a little bit?

Comment on lines -262 to +266
setvar VAR_0x8004, SPECIAL_BATTLE_STEVEN
setvar VAR_0x8004, SPECIAL_BATTLE_MULTI
setvar VAR_0x8005, 0
trainerbattle_set_trainer_A TRAINER_MAXIE_MOSSDEEP, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand
trainerbattle_set_trainer_B TRAINER_TABITHA_MOSSDEEP, MossdeepCity_SpaceCenter_Text_TabithaDefeat
setmultibattlepartner PARTNER_STEVEN
Copy link
Collaborator

@AlexOn1ine AlexOn1ine Nov 21, 2023

Choose a reason for hiding this comment

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

I know this was a conversation in discord but why does it have to be this convoluted and the macro multi_2_vs_2 can't be used instead?

@Bassoonian
Copy link
Collaborator

Superseded by #3592

@Bassoonian Bassoonian closed this Nov 23, 2023
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.

3 participants