Fix bad Max PPs for Gen1/2

This commit is contained in:
Lorenzooone 2023-07-16 02:30:11 +02:00
parent 5f6927b0ad
commit d230e487c1
3 changed files with 6 additions and 4 deletions

View File

@ -156,6 +156,7 @@
#define GEN2_EGG 253
#define GEN2_NO_MON 255
#define GEN12_MAX_MOVE_PP 40
#define CELEBI_AGATE_OT_ID 31121

View File

@ -39,7 +39,7 @@ static u16 applied_ball;
static u8 egg_met_location;
static u8 first_set_egg_met_location;
const struct version_t version = { .main_version = 1, .sub_version = 1, .revision_version = 10, .revision_letter = CONSOLE_LETTER};
const struct version_t version = { .main_version = 1, .sub_version = 1, .revision_version = 11, .revision_letter = CONSOLE_LETTER};
const u8* egg_valid_met_locations[NUMBER_OF_GAMES+FIRST_VERSION_ID] = {valid_egg_locations_rs_bin, valid_egg_locations_rs_bin, valid_egg_locations_rs_bin, valid_egg_locations_e_bin, valid_egg_locations_frlg_bin, valid_egg_locations_frlg_bin};
void set_default_settings() {

View File

@ -205,9 +205,10 @@ u8 convert_moves_of_gen3(struct gen3_mon_attacks* attacks, u8 pp_bonuses, u8* mo
if(!found) {
u8 bonus_pp = (pp_bonuses>>(2*i))&3;
u8 base_pp = get_pp_of_move(move, bonus_pp, last_valid_move);
// Limit the PP to its maximum of 61
if(base_pp > 61)
base_pp = 61;
// Limit the PP to the real maximum
u8 max_gen12_move_pps = GEN12_MAX_MOVE_PP + (((GEN12_MAX_MOVE_PP / 5) - 1) * bonus_pp);
if(base_pp >= max_gen12_move_pps)
base_pp = max_gen12_move_pps;
base_pp |= (bonus_pp << 6);
pps[used_slots] = base_pp;
moves[used_slots++] = move;