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

Trainer Party Pools #5731

Open
wants to merge 24 commits into
base: upcoming
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions include/battle_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,44 @@ struct MultiPartnerMenuPokemon
/*0x1D*/ u8 language;
};

#define POOL_SLOT_DISABLED 0xff

#define POOL_TAG_DISABLED 0x1
#define POOL_TAG_UNIQUE 0x2
#define POOL_TAG_2_MAX 0x4
#define POOL_TAG_REQUIRED 0x8

#define POOL_TAG_LEAD 1 << 0
#define POOL_TAG_ACE 1 << 1
#define POOL_TAG_WEATHER_SETTER 1 << 2
#define POOL_TAG_WEATHER_ABUSER 1 << 3
#define POOL_TAG_SUPPORT 1 << 4
#define POOL_TAG_6 1 << 5
#define POOL_TAG_7 1 << 6
#define POOL_TAG_8 1 << 7
#define NUM_TAGS 8

struct PoolRules
{
bool8 speciesClause;
bool8 excludeForms;
bool8 itemClause;
bool8 itemClauseExclusions;
u32 tagLead:4;
u32 tagAce:4;
u32 tagWeatherSetter:4;
u32 tagWeatherAbuser:4;
u32 tagSupport:4;
u32 tag6:4;
u32 tag7:4;
u32 tag8:4;
};

union PoolRuleAccess {
u32 ruleAccess[2];
struct PoolRules poolRules;
};

// defines for the 'DoBounceEffect' function
#define BOUNCE_MON 0x0
#define BOUNCE_HEALTHBOX 0x1
Expand Down Expand Up @@ -88,6 +126,9 @@ void ModifyPersonalityForNature(u32 *personality, u32 newNature);
u32 GeneratePersonalityForGender(u32 gender, u32 species);
void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon *partyEntry);

void UseDoublesPoolRules(void);
void SetDefaultPoolRules(void);

extern struct MultiPartnerMenuPokemon gMultiPartnerParty[MULTI_PARTY_SIZE];

extern const struct SpriteTemplate gUnusedBattleInitSprite;
Expand Down
6 changes: 6 additions & 0 deletions include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,10 @@
#define B_ENEMY_MON_SHADOW_STYLE GEN_3 // In Gen4+, all enemy Pokemon will have a shadow drawn beneath them.
// Currently Gen4+ shadows don't properly work with Trainerslides

#define B_POOL_SETTING_FAST_VERIFICATION FALSE // Skips the pool verification for Trainer Party Pools, relies on the user creating valid pools for all trainers
#define B_POOL_RULE_SPECIES_CLAUSE TRUE // Only pick a single pokemon of a unique NatDex number
#define B_POOL_RULE_EXCLUDE_FORMS TRUE // Exclude different forms from the Species Clause
#define B_POOL_RULE_ITEM_CLAUSE TRUE // Only allow each item to be picked once
#define B_POOL_RULES_USE_ITEM_EXCLUSIONS FALSE // Exclude items listed in poolItemClauseExclusions

#endif // GUARD_CONFIG_BATTLE_H
2 changes: 2 additions & 0 deletions include/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct TrainerMon
u8 padding1:1;
u8 dynamaxLevel:4;
u8 padding2:4;
u32 tags;
};

#define TRAINER_PARTY(partyArray) partyArray, .partySize = ARRAY_COUNT(partyArray)
Expand All @@ -92,6 +93,7 @@ struct Trainer
u8 startingStatus:6; // this trainer starts a battle with a given status. see include/constants/battle.h for values
/*0x1F*/ u8 mugshotColor;
/*0x20*/ u8 partySize;
/*0x21*/ u8 poolSize;
};

struct TrainerClass
Expand Down
Loading