From f6ed60305d2c1275ffbcde17ec9cd7d27700a43b Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 18:43:45 +1200 Subject: [PATCH 01/10] Aegislash AI Give AI some idea of when to King's Shield and when not to. --- asm/macros/battle_ai_script.inc | 12 ++++++ data/battle_ai_scripts.s | 24 ++++++++++++ src/battle_ai_script_commands.c | 66 ++++++++++++++++++++++++++++++++- 3 files changed, 101 insertions(+), 1 deletion(-) diff --git a/asm/macros/battle_ai_script.inc b/asm/macros/battle_ai_script.inc index 967fb70eea93..9ba1126b90c0 100644 --- a/asm/macros/battle_ai_script.inc +++ b/asm/macros/battle_ai_script.inc @@ -708,6 +708,18 @@ .4byte \ptr .endm + .macro if_species battler:req, species:req, ptr:req + .byte 0x7D + .byte \battler + .2byte \species + .4byte \ptr + .endm + + .macro if_target_can_go_down ptr:req + .byte 0x7E + .4byte \ptr + .endm + @ useful script macros .macro if_has_physical_move battler:req, ptr:req if_has_move_with_split \battler, SPLIT_PHYSICAL, \ptr diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s index 53655cf01107..de97c68b0523 100644 --- a/data/battle_ai_scripts.s +++ b/data/battle_ai_scripts.s @@ -5,6 +5,7 @@ #include "constants/moves.h" #include "constants/battle_move_effects.h" #include "constants/hold_effects.h" +#include "constants/species.h" #include "constants/pokemon.h" .include "asm/macros/battle_ai_script.inc" @@ -1201,6 +1202,23 @@ AI_FaintWithPriority_ScoreUp: score +10 end +AI_ShouldKingsShield: + if_move MOVE_KINGS_SHIELD, AI_ShouldKingsShield2 + end + +@ Discourage King's Shield if user is Shield form +AI_ShouldKingsShield2: + if_species AI_USER, SPECIES_AEGISLASH_BLADE AI_KingsShieldCheckSpeeds + score -3 + end + +@ Don't shield if you can outspeed and KO foe +AI_KingsShieldCheckSpeeds: + if_target_faster Score_Plus10 + if_target_can_go_down Score_Minus5 + score +10 + end + AI_CheckViability: if_target_is_ally AI_Ret call_if_always_hit AI_CV_AlwaysHit @@ -1210,6 +1228,7 @@ AI_CheckViability: call AI_ChoiceLocked call AI_DiscourageMagicGuard call AI_FaintWithPriority + call AI_ShouldKingsShield if_effect EFFECT_HIT, AI_CV_Hit if_effect EFFECT_SLEEP, AI_CV_Sleep if_effect EFFECT_ABSORB, AI_CV_Absorb @@ -1352,6 +1371,7 @@ AI_CheckViability: if_effect EFFECT_QUIVER_DANCE, AI_CV_BoostSpeedOffense if_effect EFFECT_GEOMANCY, AI_CV_BoostSpeedOffense if_effect EFFECT_COIL, AI_CV_DefenseUp + if_effect EFFECT_DEFOG, AI_CV_Defog end AI_CV_PerishSong: @@ -3663,6 +3683,10 @@ AI_CV_BoostSpeedOffense2: AI_CV_BoostSpeedOffense_End: end +AI_CV_Defog: + if_side_affecting AI_USER, SIDE_STATUS_SPIKES | SIDE_STATUS_STEALTH_ROCK | SIDE_STATUS_TOXIC_SPIKES | SIDE_STATUS_STICKY_WEB, Score_Plus10 + end + AI_TryToFaint: if_target_is_ally AI_Ret if_can_faint AI_TryToFaint_Can diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index ba8c99650b09..40ab1e8ebe18 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -182,6 +182,8 @@ static void Cmd_if_has_move_with_accuracy_lt(void); static void Cmd_if_type_effectiveness_on_ally(void); static void Cmd_if_effect_chance(void); static void Cmd_if_move_priority_greater_than(void); +static void Cmd_if_species(void); +static void Cmd_if_target_can_go_down(void); // ewram EWRAM_DATA const u8 *gAIScriptPtr = NULL; @@ -316,7 +318,9 @@ static const BattleAICmdFunc sBattleAICmdTable[] = Cmd_if_has_move_with_accuracy_lt, // 0x79 Cmd_if_type_effectiveness_on_ally, // 0x7A Cmd_if_effect_chance, // 0x7B - Cmd_if_move_priority_greater_than // 0x7C + Cmd_if_move_priority_greater_than, // 0x7C + Cmd_if_species, // 0x7D + Cmd_if_target_can_go_down, // 0x7E }; static const u16 sDiscouragedPowerfulMoveEffects[] = @@ -2980,3 +2984,63 @@ static void Cmd_if_move_priority_greater_than(void) else gAIScriptPtr += 6; } + +static void Cmd_if_species(void) +{ + const u16 *speciesPtr = (u16 *)(gAIScriptPtr + 2); + + switch (gAIScriptPtr[1]) + { + case AI_USER: + if (gBattleMons[sBattler_AI].species == *speciesPtr) + gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 4); + else + gAIScriptPtr += 8; + break; + case AI_USER_PARTNER: + if (gBattleMons[sBattler_AI ^ BIT_FLANK].hp == 0) + { + gAIScriptPtr += 8; + break; + } + else if (gBattleMons[sBattler_AI ^ BIT_FLANK].species == *speciesPtr) + { + gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 4); + } + else + { + gAIScriptPtr += 8; + } + break; + case AI_TARGET: + case AI_TARGET_PARTNER: + if (gBattleMons[gBattlerTarget].species == *speciesPtr) + gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 4); + else + gAIScriptPtr += 8; + break; + } +} + +// Check if AI mon has means to faint target. +static void Cmd_if_target_can_go_down(void) +{ + s32 i, dmg; + u32 unusable = CheckMoveLimitations(sBattler_AI, 0, 0xFF); + + for (i = 0; i < MAX_MON_MOVES; i++) + { + dmg = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][i]; + // Move can KO and isn't disabled in some way + if (gBattleMons[gBattlerTarget].hp <= dmg && !(unusable & gBitTable[i])) + { + gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); + break; + } + } + + if (i == MAX_MON_MOVES) + gAIScriptPtr += 5; + else + gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); +} From 0ace2ea0f89e6ec75cecc6292e1baeb60897dd4e Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 18:44:45 +1200 Subject: [PATCH 02/10] Buff some trainers Early trainers now need to account for the new incredibly easy EV training method. --- src/data/trainer_parties.h | 79 +++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/src/data/trainer_parties.h b/src/data/trainer_parties.h index 3a3830b86280..934fcbee2b4d 100644 --- a/src/data/trainer_parties.h +++ b/src/data/trainer_parties.h @@ -7886,7 +7886,7 @@ static const struct TrainerMonItemCustomMoves sParty_GruntMeteorFalls[] = { .species = SPECIES_EXCADRILL, .heldItem = ITEM_OCCA_BERRY, .ability = 2, // Mold Breaker - .spread = SPREAD_31_IV_20_EV, + .spread = SPREAD_31_IV_80_EV, .moves = MOVE_DRILL_RUN, MOVE_IRON_HEAD, MOVE_ROCK_SLIDE, MOVE_X_SCISSOR }, { @@ -7894,7 +7894,7 @@ static const struct TrainerMonItemCustomMoves sParty_GruntMeteorFalls[] = { .species = SPECIES_WEEZING, .heldItem = ITEM_SITRUS_BERRY, .ability = 0, // Levitate - .spread = SPREAD_31_IV_20_EV, + .spread = SPREAD_31_IV_80_EV, .moves = MOVE_WILL_O_WISP, MOVE_SLUDGE_BOMB, MOVE_HEAT_WAVE, MOVE_THUNDERBOLT }, { @@ -7902,8 +7902,8 @@ static const struct TrainerMonItemCustomMoves sParty_GruntMeteorFalls[] = { .species = SPECIES_SHIFTRY, .heldItem = ITEM_HEAT_ROCK, .ability = 0, // Chlorophyll - .spread = SPREAD_31_IV_20_EV, - .moves = MOVE_LEAF_BLADE, MOVE_DARK_PULSE, MOVE_AIR_SLASH, MOVE_SUNNY_DAY + .spread = SPREAD_31_IV_80_EV, + .moves = MOVE_ENERGY_BALL, MOVE_DARK_PULSE, MOVE_AIR_SLASH, MOVE_SUNNY_DAY } }; @@ -7913,7 +7913,7 @@ static const struct TrainerMonItemCustomMoves sParty_Courtney_MeteorFalls[] = { .species = SPECIES_NINETALES, .heldItem = ITEM_PASSHO_BERRY, .ability = 2, // Drought - .spread = SPREAD_31_IV_40_EV, + .spread = SPREAD_31_IV_SPATK_SPEED_TIMID, .moves = MOVE_MYSTICAL_FIRE, MOVE_HYPNOSIS, MOVE_SOLAR_BEAM, MOVE_CALM_MIND }, { @@ -7921,7 +7921,7 @@ static const struct TrainerMonItemCustomMoves sParty_Courtney_MeteorFalls[] = { .species = SPECIES_KROOKODILE, .heldItem = ITEM_ASSAULT_VEST, .ability = 0, // Intimidate - .spread = SPREAD_31_IV_40_EV, + .spread = SPREAD_31_IV_HP_ATK_ADAMANT, .moves = MOVE_CRUNCH, MOVE_EARTHQUAKE, MOVE_FIRE_FANG, MOVE_THUNDER_FANG }, { @@ -7941,7 +7941,7 @@ static const struct TrainerMonItemCustomMoves sParty_MayTreeckoMeteorFalls[] = { .heldItem = ITEM_SITRUS_BERRY, .ability = 0, // Blaze .spread = SPREAD_31_IV_ATK_SPEED_JOLLY, - .moves = MOVE_FIRE_PLEDGE, MOVE_BRICK_BREAK, MOVE_SHADOW_CLAW, MOVE_QUICK_ATTACK + .moves = MOVE_BLAZE_KICK, MOVE_SKY_UPPERCUT, MOVE_SHADOW_CLAW, MOVE_QUICK_ATTACK }, { .lvl = 0, @@ -7975,7 +7975,7 @@ static const struct TrainerMonItemCustomMoves sParty_MayTorchicMeteorFalls[] = { .heldItem = ITEM_LIFE_ORB, .ability = 1, // Queenly Majesty .spread = SPREAD_31_IV_ATK_SPEED_JOLLY, - .moves = MOVE_JUMP_KICK, MOVE_TROP_KICK, MOVE_U_TURN, MOVE_AROMATHERAPY + .moves = MOVE_JUMP_KICK, MOVE_TROP_KICK, MOVE_STRENGTH, MOVE_AROMATHERAPY }, { .lvl = 0, @@ -8019,7 +8019,7 @@ static const struct TrainerMonItemCustomMoves sParty_BrendanTreeckoMeteorFalls[] .heldItem = ITEM_SITRUS_BERRY, .ability = 0, // Blaze .spread = SPREAD_31_IV_ATK_SPEED_JOLLY, - .moves = MOVE_FIRE_PLEDGE, MOVE_BRICK_BREAK, MOVE_SHADOW_CLAW, MOVE_QUICK_ATTACK + .moves = MOVE_BLAZE_KICK, MOVE_SKY_UPPERCUT, MOVE_SHADOW_CLAW, MOVE_QUICK_ATTACK }, { .lvl = 0, @@ -8526,7 +8526,7 @@ static const struct TrainerMonItemCustomMoves sParty_TabithaMtChimney[] = { .species = SPECIES_GIGALITH, .ability = 1, // Sand Stream .heldItem = ITEM_PASSHO_BERRY, - .spread = SPREAD_31_IV_40_EV, + .spread = SPREAD_31_IV_HP_SPATK_MODEST, .moves = MOVE_POWER_GEM, MOVE_EARTH_POWER, MOVE_STEALTH_ROCK, MOVE_DISCHARGE }, { @@ -8534,7 +8534,7 @@ static const struct TrainerMonItemCustomMoves sParty_TabithaMtChimney[] = { .species = SPECIES_DARMANITAN, .heldItem = ITEM_LIFE_ORB, .ability = 0, // Sheer Force - .spread = SPREAD_31_IV_40_EV, + .spread = SPREAD_31_IV_ATK_SPEED_JOLLY, .moves = MOVE_FLARE_BLITZ, MOVE_ZEN_HEADBUTT, MOVE_ROCK_SLIDE, MOVE_BITE }, { @@ -8542,7 +8542,7 @@ static const struct TrainerMonItemCustomMoves sParty_TabithaMtChimney[] = { .species = SPECIES_STEELIX, .heldItem = ITEM_LEFTOVERS, .ability = 2, // Sheer Force - .spread = SPREAD_31_IV_40_EV, + .spread = SPREAD_31_IV_HP_SPDEF_CAREFUL, .moves = MOVE_IRON_TAIL, MOVE_EARTHQUAKE, MOVE_ROCK_SLIDE, MOVE_COIL }, { @@ -8550,7 +8550,7 @@ static const struct TrainerMonItemCustomMoves sParty_TabithaMtChimney[] = { .species = SPECIES_GLISCOR, .heldItem = ITEM_TOXIC_ORB, .ability = 2, // Poison Heal - .spread = SPREAD_31_IV_40_EV, + .spread = SPREAD_31_IV_HP_DEF_IMPISH, .moves = MOVE_WING_ATTACK, MOVE_DIG, MOVE_TOXIC, MOVE_PROTECT } }; @@ -8561,14 +8561,14 @@ static const struct TrainerMonItemCustomMoves sParty_MaxieMtChimney[] = { .species = SPECIES_CROBAT, .heldItem = ITEM_ASSAULT_VEST, .ability = 2, // Infiltrator - .spread = SPREAD_31_IV_60_EV, + .spread = SPREAD_31_IV_ATK_SPEED_ADAMANT, .moves = MOVE_BRAVE_BIRD, MOVE_CROSS_POISON, MOVE_CRUNCH, MOVE_U_TURN }, { .lvl = 1, .species = SPECIES_ZWEILOUS, .heldItem = ITEM_CHOICE_SCARF, - .spread = SPREAD_31_IV_60_EV, + .spread = SPREAD_31_IV_ATK_SPEED_JOLLY, .moves = MOVE_OUTRAGE, MOVE_CRUNCH, MOVE_HEAD_SMASH, MOVE_SUPERPOWER }, { @@ -8576,7 +8576,7 @@ static const struct TrainerMonItemCustomMoves sParty_MaxieMtChimney[] = { .species = SPECIES_WEEZING, .heldItem = ITEM_BLACK_SLUDGE, .ability = 0, // Levitate - .spread = SPREAD_31_IV_60_EV, + .spread = SPREAD_31_IV_HP_SPATK_MODEST, .moves = MOVE_VENOSHOCK, MOVE_THUNDERBOLT, MOVE_TOXIC, MOVE_HEAT_WAVE }, { @@ -9334,7 +9334,7 @@ static const struct TrainerMonItemCustomMoves sParty_Flannery1[] = { .species = SPECIES_HOUNDOOM, .heldItem = ITEM_FIRE_GEM, .ability = 1, // Flash Fire - .spread = SPREAD_FLANNERY_MIXED, + .spread = SPREAD_31_IV_SPATK_SPEED_HASTY, .moves = MOVE_OVERHEAT, MOVE_DARK_PULSE, MOVE_SOLAR_BEAM, MOVE_SUCKER_PUNCH }, { @@ -9342,32 +9342,32 @@ static const struct TrainerMonItemCustomMoves sParty_Flannery1[] = { .species = SPECIES_ARCANINE, .heldItem = ITEM_ASSAULT_VEST, .ability = 0, // Intimidate - .spread = SPREAD_FLANNERY_MIXED, - .moves = MOVE_OVERHEAT, MOVE_PLAY_ROUGH, MOVE_CLOSE_COMBAT, MOVE_EXTREME_SPEED + .spread = SPREAD_31_IV_ATK_SPEED_ADAMANT, + .moves = MOVE_FLARE_BLITZ, MOVE_PLAY_ROUGH, MOVE_CLOSE_COMBAT, MOVE_EXTREME_SPEED }, { .lvl = 0, .species = SPECIES_BLAZIKEN, .heldItem = ITEM_WEAKNESS_POLICY, .ability = 2, // Speed Boost - .spread = SPREAD_FLANNERY_MIXED, + .spread = SPREAD_31_IV_ATK_SPEED_NAIVE, .moves = MOVE_OVERHEAT, MOVE_REVERSAL, MOVE_THUNDER_PUNCH, MOVE_ENDURE }, { .lvl = 0, - .species = SPECIES_CHANDELURE, - .heldItem = ITEM_AIR_BALLOON, - .ability = 1, // Flame Body - .spread = SPREAD_FLANNERY_SPECIAL, - .moves = MOVE_MYSTICAL_FIRE, MOVE_SHADOW_BALL, MOVE_ENERGY_BALL, MOVE_WILL_O_WISP + .species = SPECIES_VOLCARONA, + .heldItem = ITEM_CHARTI_BERRY, + .ability = 0, // Flame Body + .spread = SPREAD_31_IV_HP_SPEED_TIMID, + .moves = MOVE_FIERY_DANCE, MOVE_GIGA_DRAIN, MOVE_QUIVER_DANCE, MOVE_ROOST }, { .lvl = 0, .species = SPECIES_TALONFLAME, .heldItem = ITEM_WHITE_HERB, .ability = 2, // Gale Wings - .spread = SPREAD_FLANNERY_MIXED, - .moves = MOVE_OVERHEAT, MOVE_ACROBATICS, MOVE_SOLAR_BEAM, MOVE_STEEL_WING + .spread = SPREAD_31_IV_ATK_SPEED_NAUGHTY, + .moves = MOVE_OVERHEAT, MOVE_BRAVE_BIRD, MOVE_DEFOG, MOVE_U_TURN } }; @@ -19919,7 +19919,7 @@ static const struct TrainerMonItemCustomMoves sParty_Sidney[] = { .heldItem = ITEM_FOCUS_SASH, .ability = 1, // Sand Rush .spread = SPREAD_31_IV_ATK_SPEED_ADAMANT, - .moves = MOVE_KNOCK_OFF, MOVE_NEEDLE_ARM, MOVE_LOW_KICK, MOVE_SWORDS_DANCE + .moves = MOVE_KNOCK_OFF, MOVE_NEEDLE_ARM, MOVE_CLOSE_COMBAT, MOVE_SWORDS_DANCE }, { .lvl = 1, @@ -19935,15 +19935,15 @@ static const struct TrainerMonItemCustomMoves sParty_Sidney[] = { .heldItem = ITEM_LEFTOVERS, .ability = 1, // Overcoat .spread = SPREAD_31_IV_HP_DEF_IMPISH, - .moves = MOVE_KNOCK_OFF, MOVE_BRAVE_BIRD, MOVE_ROOST, MOVE_WHIRLWIND + .moves = MOVE_FOUL_PLAY, MOVE_TOXIC, MOVE_ROOST, MOVE_WHIRLWIND }, { .lvl = 1, - .species = SPECIES_SCRAFTY, - .heldItem = ITEM_ROSELI_BERRY, - .ability = 1, // Moxie + .species = SPECIES_DRAPION, + .heldItem = ITEM_CHOICE_BAND, + .ability = 0, // Sniper .spread = SPREAD_31_IV_ATK_SPEED_JOLLY, - .moves = MOVE_KNOCK_OFF, MOVE_HIGH_JUMP_KICK, MOVE_POISON_JAB, MOVE_DRAGON_DANCE + .moves = MOVE_THROAT_CHOP, MOVE_CROSS_POISON, MOVE_EARTHQUAKE, MOVE_AQUA_TAIL }, { .lvl = 2, @@ -19989,11 +19989,10 @@ static const struct TrainerMonItemCustomMoves sParty_Phoebe[] = { }, { .lvl = 1, - .species = SPECIES_GOURGEIST_SUPER, - .heldItem = ITEM_FLAME_ORB, - .ability = 1, // Flare Boost - .spread = SPREAD_31_IV_HP_SPATK_MODEST, - .moves = MOVE_GIGA_DRAIN, MOVE_SHADOW_BALL, MOVE_MYSTICAL_FIRE, MOVE_MOONBLAST + .species = SPECIES_AEGISLASH, + .heldItem = ITEM_SPELL_TAG, + .spread = SPREAD_31_IV_HP_SPATK_QUIET, + .moves = MOVE_FLASH_CANNON, MOVE_SHADOW_BALL, MOVE_SHADOW_SNEAK, MOVE_KINGS_SHIELD }, { .lvl = 2, @@ -20782,7 +20781,7 @@ static const struct TrainerMonItemCustomMoves sParty_Glacia3[] = { // legendarie .lvl = 1, .species = SPECIES_NINETALES_ALOLAN, .heldItem = ITEM_EXPERT_BELT, - .ability = 0, // Snow Warning + .ability = 2, // Snow Warning .spread = SPREAD_31_IV_SPATK_SPEED_TIMID, .moves = MOVE_BLIZZARD, MOVE_MOONBLAST, MOVE_ENERGY_BALL, MOVE_WATER_PULSE }, @@ -20832,7 +20831,7 @@ static const struct TrainerMonItemCustomMoves sParty_Glacia4[] = { .lvl = 1, .species = SPECIES_NINETALES_ALOLAN, .heldItem = ITEM_FAIRY_GEM, - .ability = 0, // Snow Warning + .ability = 2, // Snow Warning .spread = SPREAD_31_IV_SPATK_SPEED_TIMID, .moves = MOVE_BLIZZARD, MOVE_DAZZLING_GLEAM, MOVE_ENERGY_BALL, MOVE_PROTECT }, From ec092e3dd55259f9a511e83a3261bc50af221992 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 20:42:18 +1200 Subject: [PATCH 03/10] Fix Seviper --- src/data/pokemon/base_stats.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 1b87ebbd71bf..1d4b099bc923 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -9036,9 +9036,15 @@ const struct BaseStats gBaseStats[] = .baseHP = 73, .baseAttack = 100, .baseDefense = 60, - .baseSpeed = 65, .baseSpAttack = 100, .baseSpDefense = 60, + #ifdef REBALANCED_VERSION + .baseSpeed = 100, + .abilities = {ABILITY_SHED_SKIN, ABILITY_MERCILESS, ABILITY_INFILTRATOR}, + #else + .baseSpeed = 65, + .abilities = {ABILITY_SHED_SKIN, ABILITY_SHED_SKIN, ABILITY_INFILTRATOR}, + #endif .type1 = TYPE_POISON, .type2 = TYPE_POISON, .catchRate = 90, @@ -9052,11 +9058,6 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef REBALANCED_VERSION - .abilities = {ABILITY_SHED_SKIN, ABILITY_MERCILESS, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_SHED_SKIN, ABILITY_SHED_SKIN, ABILITY_INFILTRATOR}, - #endif .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, }, From 437c310bdc9faf1555d9a999d8dc71e781c4e240 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 22:04:50 +1200 Subject: [PATCH 04/10] Brawly now after Slateport Player now has to deliver the letter, go to Slateport to fetch Brawly, then battle him. Afterwards they can clear out Team Aqua to progress. --- data/maps/DewfordTown/map.json | 13 +++++++ data/maps/DewfordTown/scripts.inc | 11 ++++++ data/maps/DewfordTown_Gym/scripts.inc | 1 + data/maps/GraniteCave_1F/scripts.inc | 2 +- data/maps/GraniteCave_B1F/scripts.inc | 1 + data/maps/GraniteCave_B2F/scripts.inc | 6 +++- data/maps/SlateportCity/map.json | 13 +++++++ data/maps/SlateportCity/scripts.inc | 36 +++++++++++++++++-- .../scripts.inc | 1 - include/constants/flags.h | 4 +-- 10 files changed, 81 insertions(+), 7 deletions(-) diff --git a/data/maps/DewfordTown/map.json b/data/maps/DewfordTown/map.json index 0b4c21d91ad9..47c8f3ee3188 100644 --- a/data/maps/DewfordTown/map.json +++ b/data/maps/DewfordTown/map.json @@ -94,6 +94,19 @@ "trainer_sight_or_berry_tree_id": "0", "script": "DewfordTown_EventScript_TrendyPhraseBoy", "flag": "0" + }, + { + "graphics_id": "OBJ_EVENT_GFX_MAN_2", + "x": 8, + "y": 18, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_NONE", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "DewfordTown_EventScript_GymGuide", + "flag": "FLAG_HIDE_SLATEPORT_CITY_BRAWLY" } ], "warp_events": [ diff --git a/data/maps/DewfordTown/scripts.inc b/data/maps/DewfordTown/scripts.inc index 51626c2a10ba..bc28a79e72bf 100644 --- a/data/maps/DewfordTown/scripts.inc +++ b/data/maps/DewfordTown/scripts.inc @@ -178,6 +178,10 @@ DewfordTown_EventScript_LandedSlateport:: @ 81E9799 msgbox DewfordTown_Text_BrineyLandedInSlateport, MSGBOX_DEFAULT return +DewfordTown_EventScript_GymGuide:: + msgbox DewfordTown_Text_BrawlyInSlateport, MSGBOX_NPC + end + DewfordTown_Movement_SailToPetalburg: @ 81E97A2 walk_up walk_up @@ -750,3 +754,10 @@ DewfordTown_Text_ReceivedEviolite: .string "Maybe it'll be more useful in the hands\n" .string "of a Pokémon Trainer?\p" .string "It's no good as bait, that's for sure!$" + +DewfordTown_Text_BrawlyInSlateport: + .string "Hey, Champ-to-be!\p" + .string "Brawly, the Gym Leader here, went\n" + .string "to Slateport City and hasn't returned.\p" + .string "If you're after a battle, you'll have\n" + .string "to go find him.$" diff --git a/data/maps/DewfordTown_Gym/scripts.inc b/data/maps/DewfordTown_Gym/scripts.inc index a6e7ceb3a6c3..3e7330b8b7c8 100644 --- a/data/maps/DewfordTown_Gym/scripts.inc +++ b/data/maps/DewfordTown_Gym/scripts.inc @@ -160,6 +160,7 @@ DewfordTown_Gym_EventScript_BrawlyDefeated:: @ 81FC7F7 msgbox DewfordTown_Gym_Text_KnuckleBadgeInfoTakeThis, MSGBOX_DEFAULT setflag FLAG_DEFEATED_DEWFORD_GYM setflag FLAG_BADGE02_GET + setflag FLAG_HIDE_SLATEPORT_CITY_TEAM_AQUA addvar VAR_PETALBURG_GYM_STATE, 1 compare VAR_PETALBURG_GYM_STATE, 6 call_if_eq Common_EventScript_ReadyPetalburgGymForBattle diff --git a/data/maps/GraniteCave_1F/scripts.inc b/data/maps/GraniteCave_1F/scripts.inc index 53eff9a707ee..32824c89a2be 100644 --- a/data/maps/GraniteCave_1F/scripts.inc +++ b/data/maps/GraniteCave_1F/scripts.inc @@ -19,7 +19,7 @@ GraniteCave_1F_EventScript_ReceivedFlash:: @ 822DA8A GraniteCave_1F_Text_GetsDarkAheadHereYouGo: @ 822DA94 .string "Hey, you.\n" - .string "It gets awfully dark ahead.\l" + .string "It gets a little dark ahead.\l" .string "It'll be tough trying to explore.\p" .string "That guy who came by earlier…\n" .string "Steven, I think it was.\p" diff --git a/data/maps/GraniteCave_B1F/scripts.inc b/data/maps/GraniteCave_B1F/scripts.inc index f465b0694bbb..082e116b3221 100644 --- a/data/maps/GraniteCave_B1F/scripts.inc +++ b/data/maps/GraniteCave_B1F/scripts.inc @@ -5,6 +5,7 @@ GraniteCave_B1F_MapScripts:: @ 822DC5E .byte 0 GraniteCave_B1F_SetHoleWarp: @ 822DC6E + setflashradius 4 setstepcallback STEP_CB_CRACKED_FLOOR setholewarp MAP_GRANITE_CAVE_B2F, 255, 0, 0 end diff --git a/data/maps/GraniteCave_B2F/scripts.inc b/data/maps/GraniteCave_B2F/scripts.inc index d8cacbe387b1..e08ab01bceb3 100644 --- a/data/maps/GraniteCave_B2F/scripts.inc +++ b/data/maps/GraniteCave_B2F/scripts.inc @@ -1,3 +1,7 @@ -GraniteCave_B2F_MapScripts:: @ 822DC79 +GraniteCave_B2F_MapScripts:: + map_script MAP_SCRIPT_ON_RESUME, GraniteCave_B2F_SetFlashRadius .byte 0 +GraniteCave_B2F_SetFlashRadius: + setflashradius 4 + end diff --git a/data/maps/SlateportCity/map.json b/data/maps/SlateportCity/map.json index c348d94235fd..1ac3485e9b6d 100644 --- a/data/maps/SlateportCity/map.json +++ b/data/maps/SlateportCity/map.json @@ -536,6 +536,19 @@ "trainer_sight_or_berry_tree_id": "0", "script": "SlateportCity_EventScript_Greta", "flag": "FLAG_SYS_ARENA_SILVER" + }, + { + "graphics_id": "OBJ_EVENT_GFX_BRAWLY", + "x": 19, + "y": 26, + "elevation": 3, + "movement_type": "MOVEMENT_TYPE_FACE_RIGHT", + "movement_range_x": 0, + "movement_range_y": 0, + "trainer_type": "TRAINER_TYPE_NONE", + "trainer_sight_or_berry_tree_id": "0", + "script": "SlateportCity_EventScript_Brawly", + "flag": "FLAG_HIDE_SLATEPORT_CITY_BRAWLY" } ], "warp_events": [ diff --git a/data/maps/SlateportCity/scripts.inc b/data/maps/SlateportCity/scripts.inc index 92c286ef2cab..c084dd6733aa 100644 --- a/data/maps/SlateportCity/scripts.inc +++ b/data/maps/SlateportCity/scripts.inc @@ -18,6 +18,7 @@ .set LOCALID_GRUNT_9, 31 .set LOCALID_GRUNT_11, 33 .set LOCALID_SCOTT, 35 +.set LOCALID_BRAWLY, 40 SlateportCity_MapScripts:: @ 81DCC61 map_script MAP_SCRIPT_ON_TRANSITION, SlateportCity_OnTransition @@ -325,7 +326,7 @@ SlateportCity_EventScript_Man1SternInterview:: @ 81DCF0D SlateportCity_EventScript_Woman1:: @ 81DCF17 lock faceplayer - goto_if_set FLAG_DOCK_REJECTED_DEVON_GOODS, SlateportCity_EventScript_Woman1AquaGone + goto_if_set FLAG_HIDE_SLATEPORT_CITY_TEAM_AQUA, SlateportCity_EventScript_Woman1AquaGone msgbox SlateportCity_Text_WhatsLongLineOverThere, MSGBOX_DEFAULT release end @@ -1013,6 +1014,24 @@ SlateportCity_EventScript_ScottBattleTentScene:: @ 81DD5DC releaseall end +SlateportCity_EventScript_Brawly:: + lockall + msgbox SlateportCity_Text_WhoahLineSoLong, MSGBOX_DEFAULT + waitse + playse SE_PIN + applymovement LOCALID_BRAWLY, Common_Movement_ExclamationMark + waitmovement 0 + applymovement LOCALID_BRAWLY, Common_Movement_Delay48 + waitmovement 0 + faceplayer + msgbox SlateportCity_Text_LookingForBrawly, MSGBOX_DEFAULT + fadescreen FADE_TO_BLACK + closemessage + removeobject LOCALID_BRAWLY + fadescreen FADE_FROM_BLACK + releaseall + end + SlateportCity_Movement_PushPlayerDown: @ 81DD630 lock_facing_direction walk_down @@ -1047,7 +1066,20 @@ SlateportCity_EventScript_BerryCrushRankingsSign:: @ 81DD643 releaseall end -SlateportCity_Text_EnergyGuruSellWhatYouNeed: @ 81DD64A +SlateportCity_Text_WhoahLineSoLong: + .string "Whoah! This line's way too long,\n" + .string "dude! What's the deal?$" + +SlateportCity_Text_LookingForBrawly: + .string "Oh, hey there!\p" + .string "Hmm? You're looking for the\n" + .string "Dewford Gym Leader?\p" + .string "That'd be me, Brawly!\n" + .string "I guess you want a battle, yeah?\p" + .string "Gnarly! I'll head back to the Gym.\n" + .string "You better be ready to make a splash!$" + +SlateportCity_Text_EnergyGuruSellWhatYouNeed: .string "I'm the Energy Guru! I'll go for it and\n" .string "sell you what you need!$" diff --git a/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc b/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc index d273fb7fb96f..633480bc38dd 100644 --- a/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc +++ b/data/maps/SlateportCity_SternsShipyard_1F/scripts.inc @@ -17,7 +17,6 @@ SlateportCity_SternsShipyard_1F_EventScript_Dock:: @ 8207F40 applymovement LOCALID_DOCK, Common_Movement_FaceOriginalDirection waitmovement 0 setflag FLAG_DOCK_REJECTED_DEVON_GOODS - setflag FLAG_HIDE_SLATEPORT_CITY_TEAM_AQUA releaseall end diff --git a/include/constants/flags.h b/include/constants/flags.h index 13bee07ddcdd..18b1209d06b3 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -462,13 +462,13 @@ #define FLAG_PETALBURG_GYM_CHILAN_BERRIES 0x1B1 #define FLAG_ITEM_MT_PYRE_SUMMIT_TM61_WILLOWISP 0x1B2 #define FLAG_MOVE_FORTREE_GYM_ENERGY_ROOT 0x1B3 -#define FLAG_MOVE_TUTOR_TAUGHT_MIMIC 0x1B4 +#define FLAG_MOVE_TUTOR_TAUGHT_MIMIC 0x1B4 // Unused #define FLAG_LILYCOVE_MET_BALL_SWAPPER 0x1B5 #define FLAG_HIDE_MOSSDEEP_CYNTHIA 0x1B6 #define FLAG_RECEIVED_LATI_STONES 0x1B7 #define FLAG_ITEM_DESERT_UNDERPASS_FLYGONITE 0x1B8 #define FLAG_ITEM_SEAFLOOR_CAVERN_KINGDRANITE 0x1B9 -#define FLAG_MOVE_TUTOR_TAUGHT_EXPLOSION 0x1BA // Unused +#define FLAG_HIDE_SLATEPORT_CITY_BRAWLY 0x1BA #define FLAG_DEFEATED_REGIROCK 0x1BB #define FLAG_DEFEATED_REGICE 0x1BC #define FLAG_DEFEATED_REGISTEEL 0x1BD From 03aa8b694fd89c000fa28ea8b9dfa10314e9701d Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 22:06:07 +1200 Subject: [PATCH 05/10] Early Lucky Egg Gift Audino now holds a Lucky Egg, and can be reset for existing saves (or to get two Eggs in new saves). --- data/maps/VerdanturfMeadow/scripts.inc | 2 +- data/scripts/pokemon_center_move_tutor.inc | 26 +++++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/data/maps/VerdanturfMeadow/scripts.inc b/data/maps/VerdanturfMeadow/scripts.inc index 0f5787fc8348..ba937fffde88 100644 --- a/data/maps/VerdanturfMeadow/scripts.inc +++ b/data/maps/VerdanturfMeadow/scripts.inc @@ -9,7 +9,7 @@ VerdanturfMeadow_EventScript_GiftAudino:: setvar VAR_TEMP_1, SPECIES_AUDINO specialvar VAR_RESULT, GetHighestLevelInPlayerParty copyvar VAR_0x800A, VAR_RESULT - givemon SPECIES_AUDINO, VAR_0x800A, ITEM_METRONOME + givemon SPECIES_AUDINO, VAR_0x800A, ITEM_LUCKY_EGG compare VAR_RESULT, 0 goto_if_eq VerdanturfMeadow_EventScript_ReceiveAudinoParty compare VAR_RESULT, 1 diff --git a/data/scripts/pokemon_center_move_tutor.inc b/data/scripts/pokemon_center_move_tutor.inc index b1d414a0ded7..d997a78476fd 100644 --- a/data/scripts/pokemon_center_move_tutor.inc +++ b/data/scripts/pokemon_center_move_tutor.inc @@ -339,12 +339,12 @@ PKMN_Center_EventScript_Exp_Grind:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Event Reset @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ PKMN_Center_EventScript_Event_Reset:: - compare VAR_EVENT_RESET_STATE, 1 + compare VAR_EVENT_RESET_STATE, 2 goto_if_eq PKMN_Center_EventReset_EventScript_AlreadyReset msgbox PKMN_Center_EventResetText_WhatsBrokenThisTime, MSGBOX_YESNO switch VAR_RESULT case NO, PKMN_Center_Move_Tutor_General_Exit - case YES, PKMN_Center_EventReset_EventScript_ResetVarsFlags + case YES, PKMN_Center_EventReset_EventScript_ResetEvents case MULTI_B_PRESSED, PKMN_Center_Move_Tutor_General_Exit releaseall end @@ -354,15 +354,27 @@ PKMN_Center_EventReset_EventScript_AlreadyReset:: releaseall end -PKMN_Center_EventReset_EventScript_ResetVarsFlags:: +PKMN_Center_EventReset_EventScript_ResetEvents:: + compare VAR_EVENT_RESET_STATE, 0 + call_if_eq PKMN_Center_EventReset_EventScript_ResetEvents1 + compare VAR_EVENT_RESET_STATE, 1 + call_if_eq PKMN_Center_EventReset_EventScript_ResetEvents2 + msgbox PKMN_Center_EventReset_Text_Reset, MSGBOX_DEFAULT + releaseall + end + +PKMN_Center_EventReset_EventScript_ResetEvents1:: setvar VAR_LAVARIDGE_LUCY_STATE, 1 clearflag FLAG_HIDE_LAVARIDGE_POKECENTER_LUCY clearflag FLAG_ITEM_MOSSDEEP_CITY_MILOTICITE clearflag FLAG_RECEIVED_TOGEPI_EGG setvar VAR_EVENT_RESET_STATE, 1 - msgbox PKMN_Center_EventReset_Text_Reset, MSGBOX_DEFAULT - releaseall - end + return + +PKMN_Center_EventReset_EventScript_ResetEvents2:: + clearflag FLAG_RECEIVED_AUDINO + setvar VAR_EVENT_RESET_STATE, 2 + return @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Strings @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ -378,6 +390,8 @@ PKMN_Center_EventResetText_WhatsBrokenThisTime: .string "have encountered some buggy events.\p" .string "If needed, I can reset these events\n" .string "so they can be played again.\p" + .string "Each event can only be reset\n" + .string "once per save.\p" .string "Would you like to reset these events?$" PKMN_Center_EventResetText_AlreadyReset: From c54de1adf6c5d06d0ccd84545f806dbb4d1fe802 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 22:45:56 +1200 Subject: [PATCH 06/10] AI burn and paralyze AI now knows to status things that are boosting their stats probably. Also knows to status things if it has Hex. --- data/battle_ai_scripts.s | 62 ++++++++++++++++++++++++++++++-------- src/data/trainer_parties.h | 2 +- src/data/trainers.h | 2 +- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s index de97c68b0523..471fba4d037e 100644 --- a/data/battle_ai_scripts.s +++ b/data/battle_ai_scripts.s @@ -426,8 +426,8 @@ AI_CBM_Defog: goto AI_CBM_EvasionDown AI_CBM_PsychicShift: - if_not_status AI_USER, STATUS1_ANY, Score_Minus10 - if_status AI_TARGET, STATUS1_ANY, Score_Minus10 + if_not_status AI_USER, STATUS1_ANY, Score_Minus30 + if_status AI_TARGET, STATUS1_ANY, Score_Minus30 if_status AI_USER, STATUS1_PARALYSIS, AI_CBM_Paralyze if_status AI_USER, STATUS1_PSN_ANY, AI_CBM_Toxic if_status AI_USER, STATUS1_BURN, AI_CBM_WillOWisp @@ -806,6 +806,7 @@ AI_CBM_Reflect: @ 82DC53A AI_CBM_Paralyze: @ 82DC545 if_type_effectiveness AI_EFFECTIVENESS_x0, Score_Minus30 + call AI_CBM_ParalyzeCheckTWave get_ability AI_TARGET if_equal ABILITY_LIMBER, Score_Minus30 if_status AI_TARGET, STATUS1_ANY, Score_Minus30 @@ -814,6 +815,17 @@ AI_CBM_Paralyze: @ 82DC545 if_side_affecting AI_TARGET, SIDE_STATUS_SAFEGUARD, Score_Minus30 end +AI_CBM_ParalyzeCheckTWave: + if_move MOVE_THUNDER_WAVE AI_CBM_ParalyzeCheckTWaveAbsorbed + end + +AI_CBM_ParalyzeCheckTWaveAbsorbed: + get_ability AI_TARGET + if_equal ABILITY_VOLT_ABSORB, Score_Minus30 + if_equal ABILITY_LIGHTNING_ROD, Score_Minus30 + if_equal ABILITY_MOTOR_DRIVE, Score_Minus30 + end + AI_CBM_Substitute: @ 82DC568 if_status2 AI_USER, STATUS2_SUBSTITUTE, Score_Minus8 if_hp_less_than AI_USER, 26, Score_Minus10 @@ -966,15 +978,16 @@ CheckIfTargetAllyBlocksTorment: end AI_CBM_WillOWisp: @ 82DC6B4 + if_status AI_TARGET, STATUS1_ANY, Score_Minus30 get_ability AI_TARGET - if_equal ABILITY_WATER_VEIL, Score_Minus10 - if_equal ABILITY_WATER_BUBBLE, Score_Minus10 - if_equal ABILITY_FLARE_BOOST, Score_Minus10 - if_equal ABILITY_FLASH_FIRE, Score_Minus10 - if_status AI_TARGET, STATUS1_ANY, Score_Minus10 - if_type AI_TARGET, TYPE_FIRE, Score_Minus10 + if_equal ABILITY_WATER_VEIL, Score_Minus30 + if_equal ABILITY_WATER_BUBBLE, Score_Minus30 + if_equal ABILITY_FLARE_BOOST, Score_Minus30 + if_equal ABILITY_FLASH_FIRE, Score_Minus30 + if_equal ABILITY_MAGIC_GUARD, Score_Minus5 + if_type AI_TARGET, TYPE_FIRE, Score_Minus30 if_type AI_TARGET, TYPE_GRASS, CheckIfFlowerVeilBlocksMove - if_side_affecting AI_TARGET, SIDE_STATUS_SAFEGUARD, Score_Minus10 + if_side_affecting AI_TARGET, SIDE_STATUS_SAFEGUARD, Score_Minus30 end AI_CBM_HelpingHand: @ 82DC6E3 @@ -1372,6 +1385,7 @@ AI_CheckViability: if_effect EFFECT_GEOMANCY, AI_CV_BoostSpeedOffense if_effect EFFECT_COIL, AI_CV_DefenseUp if_effect EFFECT_DEFOG, AI_CV_Defog + if_effect EFFECT_WILL_O_WISP AI_CV_Burn end AI_CV_PerishSong: @@ -2148,6 +2162,14 @@ AI_CV_Heal6: AI_CV_Heal_End: end +AI_EncourageStatusHex: + if_doesnt_have_move_with_effect AI_USER, EFFECT_HEX, AI_EncourageStatusHexEnd + score +2 + if_random_less_than 128, AI_EncourageStatusHexEnd + score +1 +AI_EncourageStatusHexEnd: + end + EncouragePsnVenoshock: if_doesnt_have_move_with_effect AI_USER, EFFECT_VENOSHOCK, EncouragePsnVenoshockEnd score +2 @@ -2162,6 +2184,7 @@ AI_ToxicTrappedTarget: AI_CV_Toxic: call EncouragePsnVenoshock + call AI_EncourageStatusHex call AI_ToxicTrappedTarget AI_CV_LeechSeed: if_user_has_no_attacking_moves AI_CV_Toxic3 @@ -2356,18 +2379,33 @@ AI_CV_Poison_End: end AI_CV_Paralyze: + call AI_EncourageStatusHex + call AI_ParalyzeSweeper if_target_faster AI_CV_Paralyze2 - if_hp_more_than AI_USER, 70, AI_CV_Paralyze_End - score -1 goto AI_CV_Paralyze_End AI_CV_Paralyze2: if_random_less_than 20, AI_CV_Paralyze_End score +3 - AI_CV_Paralyze_End: end +AI_ParalyzeSweeper: + if_stat_level_more_than AI_TARGET, STAT_SPEED, DEFAULT_STAT_STAGE, Score_Plus5 + end + +AI_CV_Burn: + call AI_EncourageStatusHex + call AI_BurnSweeper + if_random_less_than 20, AI_CV_Burn_End + score +3 +AI_CV_Burn_End: + end + +AI_BurnSweeper: + if_stat_level_more_than AI_TARGET, STAT_ATK, DEFAULT_STAT_STAGE, Score_Plus5 + end + AI_CV_VitalThrow: if_target_faster AI_CV_VitalThrow_End if_hp_more_than AI_USER, 60, AI_CV_VitalThrow_End diff --git a/src/data/trainer_parties.h b/src/data/trainer_parties.h index 934fcbee2b4d..e8b106df6c5b 100644 --- a/src/data/trainer_parties.h +++ b/src/data/trainer_parties.h @@ -6720,7 +6720,7 @@ static const struct TrainerMonItemCustomMoves sParty_Wattson1[] = { .species = SPECIES_ROTOM_MOW, .heldItem = ITEM_WHITE_HERB, .spread = SPREAD_WATTSON_SPECIAL, - .moves = MOVE_VOLT_SWITCH, MOVE_LEAF_STORM, MOVE_WILL_O_WISP, MOVE_HEX + .moves = MOVE_VOLT_SWITCH, MOVE_LEAF_STORM, MOVE_TOXIC, MOVE_HEX }, { .lvl = 0, diff --git a/src/data/trainers.h b/src/data/trainers.h index 4910ddba5a8e..c9916082775d 100644 --- a/src/data/trainers.h +++ b/src/data/trainers.h @@ -3746,7 +3746,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("Wattson"), .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Wattson1), .party = {.ItemCustomMoves = sParty_Wattson1}, }, From b18a6fe143088bb5a71b39905978d3437abb83a9 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 23:05:20 +1200 Subject: [PATCH 07/10] Fix potato code :sweet_potato: --- src/battle_ai_script_commands.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 40ab1e8ebe18..56e802ed1e1c 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -3034,7 +3034,6 @@ static void Cmd_if_target_can_go_down(void) // Move can KO and isn't disabled in some way if (gBattleMons[gBattlerTarget].hp <= dmg && !(unusable & gBitTable[i])) { - gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); break; } } From c3288c1e717223ca37d2218084668b5cc394d769 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 23:09:57 +1200 Subject: [PATCH 08/10] Restore old PIE Exp Share Old 100% effect is probably fine in new version. --- data/maps/PetalburgWoods/scripts.inc | 4 ++-- src/battle_script_commands.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/maps/PetalburgWoods/scripts.inc b/data/maps/PetalburgWoods/scripts.inc index 7e6a931fdc5a..1003d36eb722 100644 --- a/data/maps/PetalburgWoods/scripts.inc +++ b/data/maps/PetalburgWoods/scripts.inc @@ -376,10 +376,10 @@ PetalburgWoods_Text_ThatWasAwfullyClose: @ 822E63D PetalburgWoods_Text_TeamAquaAfterSomethingInRustboro: .string "A Pokémon holding that Exp. Share\n" - .string "will get half of the Exp. points from\l" + .string "will get 100% of the Exp. points from\l" .string "battle, even if it didn't participate.\p" .string "Normally they'd only get a quarter of\n" - .string "the Exp. points, so It's quite useful\l" + .string "the Exp. points, so it's quite useful\l" .string "for raising weak Pokémon!\p" .string "Didn't that Team Aqua thug say\n" .string "they were after something in\l" diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a26b1e8abc21..9353e2ef3479 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3842,7 +3842,7 @@ static void Cmd_getexp(void) gBattleMoveDamage += gExpShareExp; } if (holdEffect == HOLD_EFFECT_EXP_SHARE && !(gBattleStruct->sentInPokes & 1)) - gBattleMoveDamage = gExpShareExp * 2; // Determines how much EXP a Pokemon holding an EXP Share receives + gBattleMoveDamage = gExpShareExp * 4; // Determines how much EXP a Pokemon holding an EXP Share receives if (holdEffect == HOLD_EFFECT_LUCKY_EGG) gBattleMoveDamage = (gBattleMoveDamage * 150) / 100; if (holdEffect == HOLD_EFFECT_TRAINING_BAND) From 7a6b4c41e60b855923e382d2b57b8e41945d8317 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 4 Sep 2021 23:36:15 +1200 Subject: [PATCH 09/10] Version 1.4 Remembered to disable debug this time! Also fix some typos. --- include/constants/battle_config.h | 2 +- src/data/text/move_descriptions.h | 6 +++--- src/data/trainer_parties.h | 2 +- src/strings.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index c5fdcd6a25c1..71c39d939129 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -114,6 +114,6 @@ #define B_HIDE_HEALTHBOXES_DURING_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations. #define B_TERRAIN_BG_CHANGE TRUE // If set to TRUE, terrain moves permanently change the default battle background until the effect fades. -#define B_ENABLE_DEBUG TRUE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button. +#define B_ENABLE_DEBUG FALSE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button. #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index 29eb4736d250..f711a9e7254a 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -1137,7 +1137,7 @@ static const u8 sRevengeDescription[] = _( static const u8 sBrickBreakDescription[] = _( "Destroys barriers such as\n" - "REFLECT and causes damage."); + "Reflect and causes damage."); static const u8 sYawnDescription[] = _( "Lulls the foe into yawning,\n" @@ -1633,7 +1633,7 @@ static const u8 sAIR_SLASHDescription[] = _( #ifdef REBALANCED_VERSION static const u8 sX_SCISSORDescription[] = _( - "Cuts likes scissors.\n" + "Cuts like scissors.\n" "High critical-hit ratio."); #else static const u8 sX_SCISSORDescription[] = _( @@ -2386,7 +2386,7 @@ static const u8 sBABYDOLL_EYESDescription[] = _( "before it can move."); static const u8 sNUZZLEDescription[] = _( - "Rubs its cheecks against\n" + "Rubs its cheeks against\n" "the foe, paralyzing it."); static const u8 sINFESTATIONDescription[] = _( diff --git a/src/data/trainer_parties.h b/src/data/trainer_parties.h index e8b106df6c5b..77936efc718f 100644 --- a/src/data/trainer_parties.h +++ b/src/data/trainer_parties.h @@ -2964,7 +2964,7 @@ static const struct TrainerMonItemCustomMoves sParty_Brawly1[] = { { .lvl = -2, .species = SPECIES_LUCARIO, - .heldItem = ITEM_CHESTO_BERRY, + .heldItem = ITEM_LUM_BERRY, .ability = 0, // Steadfast .spread = SPREAD_BRAWLY_ONE_MON, .moves = MOVE_BULLET_PUNCH, MOVE_BULK_UP, MOVE_PAYBACK, MOVE_REVERSAL diff --git a/src/strings.c b/src/strings.c index 877d80284753..31b93d9d8fea 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1667,7 +1667,7 @@ const u8 gText_SavingNormalMode[] = _("Normal Mode"); const u8 gText_SavingHardMode[] = _("Hard Mode"); const u8 gText_SavingChallengeMode[] = _("Challenge Mode"); const u8 gText_SavingInsanityMode[] = _("Insanity Mode"); -const u8 gText_SavingVersionNum[] = _("Ver 1.3.1"); +const u8 gText_SavingVersionNum[] = _("Ver 1.4"); const u8 gText_WirelessCommStatus[] = _("Wireless Communication Status"); const u8 gText_PeopleTrading[] = _("People trading:"); const u8 gText_PeopleBattling[] = _("People battling:"); From 19f0eb921ee51fa2fc5493a7af5c09fef11a3cc0 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 5 Sep 2021 00:07:44 +1200 Subject: [PATCH 10/10] Fix Verdant Meadow header Add non-default theme, make it behave like route and not cave. --- data/maps/VerdanturfMeadow/map.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/maps/VerdanturfMeadow/map.json b/data/maps/VerdanturfMeadow/map.json index 2a2d4085aedc..f6556b4dfe78 100644 --- a/data/maps/VerdanturfMeadow/map.json +++ b/data/maps/VerdanturfMeadow/map.json @@ -2,13 +2,13 @@ "id": "MAP_VERDANTURF_MEADOW", "name": "VerdanturfMeadow", "layout": "LAYOUT_VERDANTURF_MEADOW", - "music": "MUS_ABANDONED_SHIP", + "music": "MUS_RG_SEVII_45", "region_map_section": "MAPSEC_VERDANTURF_MEADOW", "requires_flash": false, "weather": "WEATHER_NONE", - "map_type": "MAP_TYPE_NONE", + "map_type": "MAP_TYPE_ROUTE", "allow_cycling": true, - "allow_escaping": true, + "allow_escaping": false, "allow_running": true, "show_map_name": true, "battle_scene": "MAP_BATTLE_SCENE_NORMAL",