From 3a5ca6f8f0b4fd345cf134a04b37361f8f2f776f Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Wed, 20 Dec 2023 16:33:45 +0000 Subject: [PATCH 01/24] Small test runner improvements (#3761) * u16 for FunctionTest PARAMETRIZE * Speed up CB2_TestRunner * Use DACS to handle illegal instructions DACS is available in mgba from https://github.com/mgba-emu/mgba/commit/44e074a15e9651481f7f652ac006a7c9d58cbeb9 This is not 0.10.2, but will presumably be available in the next release. Alternatively, a GBA BIOS could be used. --------- Co-authored-by: DizzyEggg Co-authored-by: Bassoonian --- Makefile | 2 +- include/test/test.h | 4 ++-- ld_script_test.ld | 6 ++++++ test/species.c | 2 ++ test/test_runner.c | 27 +++++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index db883cb60c..d899015225 100644 --- a/Makefile +++ b/Makefile @@ -495,7 +495,7 @@ $(OBJ_DIR)/ld_script_test.ld: $(LD_SCRIPT_TEST) $(LD_SCRIPT_DEPS) $(TESTELF): $(OBJ_DIR)/ld_script_test.ld $(OBJS) $(TEST_OBJS) libagbsyscall tools check-tools @echo "cd $(OBJ_DIR) && $(LD) -T ld_script_test.ld -o ../../$@ " @cd $(OBJ_DIR) && $(LD) $(TESTLDFLAGS) -T ld_script_test.ld -o ../../$@ $(OBJS_REL) $(TEST_OBJS_REL) $(LIB) - $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent + $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) -d0 --silent $(PATCHELF) $(TESTELF) gTestRunnerArgv "$(TESTS)\0" ifeq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) diff --git a/include/test/test.h b/include/test/test.h index e9c920bd0b..918d00399b 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -59,8 +59,8 @@ extern const struct TestRunner gAssumptionsRunner; struct FunctionTestRunnerState { - u8 parameters; - u8 runParameter; + u16 parameters; + u16 runParameter; }; extern const struct TestRunner gFunctionTestRunner; diff --git a/ld_script_test.ld b/ld_script_test.ld index b86302f8cb..49a0ec35b0 100644 --- a/ld_script_test.ld +++ b/ld_script_test.ld @@ -109,6 +109,12 @@ SECTIONS { __rom_end = .; + dacs 0x9FFC000 : + ALIGN(4) + { + test/*.o(.dacs); + } > ROM =0 + /* DWARF debug sections. Symbols in the DWARF debugging sections are relative to the beginning of the section so we begin them at 0. */ diff --git a/test/species.c b/test/species.c index 9ea20638c8..d412dd005a 100644 --- a/test/species.c +++ b/test/species.c @@ -34,6 +34,8 @@ TEST("Form change tables contain only forms in the form species ID table") for (i = 0; formChangeTable[i].method != FORM_CHANGE_TERMINATOR; i++) { + if (formChangeTable[i].targetSpecies == SPECIES_NONE) + continue; for (j = 0; formSpeciesIdTable[j] != FORM_SPECIES_END; j++) { if (formChangeTable[i].targetSpecies == formSpeciesIdTable[j]) diff --git a/test/test_runner.c b/test/test_runner.c index 93d859654a..5ca397cd6c 100644 --- a/test/test_runner.c +++ b/test/test_runner.c @@ -106,6 +106,8 @@ static u32 AssignCostToRunner(void) void CB2_TestRunner(void) { +top: + switch (gTestRunnerState.state) { case STATE_INIT: @@ -361,6 +363,9 @@ void CB2_TestRunner(void) MgbaExit_(gTestRunnerState.exitCode); break; } + + if (gMain.callback2 == CB2_TestRunner) + goto top; } void Test_ExpectedResult(enum TestResult result) @@ -652,3 +657,25 @@ static s32 MgbaVPrintf_(const char *fmt, va_list va) } return i; } + +/* Entry point for the Debugging and Control System. Handles illegal + * instructions, which are typically caused by branching to an invalid + * address. */ +__attribute__((naked, section(".dacs"), target("arm"))) +void DACSEntry(void) +{ + asm(".arm\n\ + ldr r0, =(DACSHandle + 1)\n\ + bx r0\n"); +} + +#define DACS_LR (*(vu32 *)0x3007FEC) + +void DACSHandle(void) +{ + if (gTestRunnerState.state == STATE_RUN_TEST) + gTestRunnerState.state = STATE_REPORT_RESULT; + gTestRunnerState.result = TEST_RESULT_CRASH; + ReinitCallbacks(); + DACS_LR = ((uintptr_t)JumpToAgbMainLoop & ~1) + 4; +} From fcdc515be2d60436853f649d6c2d6163d3052111 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Thu, 21 Dec 2023 13:17:05 +0100 Subject: [PATCH 02/24] Fix rain dance/sunny day not blending opponent sprite (#3785) --- data/battle_anim_scripts.s | 98 ++++++++++++++++----------------- include/constants/battle_anim.h | 3 + 2 files changed, 52 insertions(+), 49 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index e101540851..d9e7df63b6 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -5389,11 +5389,11 @@ Move_FOUL_PLAY: createsprite gFoulPlayImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_VITAL_THROW SOUND_PAN_TARGET - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x3, 0xa, 0x0, 0x0 + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x3, 0xa, 0x0, 0x0 createsprite gFoulPlayRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x100, 0x0 delay 0x8 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x3, 0xa, 0x0, 0x0 + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x3, 0xa, 0x0, 0x0 createsprite gFoulPlayRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x100, 0x0 waitforvisualfinish clearmonbg ANIM_TARGET @@ -10404,7 +10404,7 @@ Move_LIGHT_OF_RUIN:: delay 0x10 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x0, 0x7FFF waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS, 0x1, 0x0, 0x0, 0x0 + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS_2, 0x1, 0x0, 0x0, 0x0 waitforvisualfinish end LightOfRuinBeam: @@ -11142,7 +11142,7 @@ SolarBladeUnleash: loadspritegfx ANIM_TAG_SUNLIGHT @sun rays monbg ANIM_ATTACKER setalpha 13, 3 - createvisualtask AnimTask_BlendBattleAnimPal 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 0, 6, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal 10, (F_PAL_BG | F_PAL_BATTLERS_2), 1, 0, 6, 0x7fff waitforvisualfinish playsewithpan SE_M_SWORDS_DANCE, SOUND_PAN_ATTACKER createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 16, 6, 1, 4 @@ -11159,7 +11159,7 @@ SolarBladeUnleash: delay 0x2 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 12, 1 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 6, 0, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal 10, (F_PAL_BG | F_PAL_BATTLERS_2), 1, 6, 0, 0x7fff waitforvisualfinish call UnsetPsychicBg clearmonbg ANIM_ATTACKER @@ -15384,7 +15384,7 @@ Move_SILK_TRAP:: Move_SNOWSCAPE:: loadspritegfx ANIM_TAG_SNOWFLAKES playsewithpan SE_M_GUST, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 2, 0, 4, RGB(11, 18, 22) + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 2, 0, 4, RGB(11, 18, 22) waitforvisualfinish createvisualtask AnimTask_CreateSnowflakes, 2, 0, 3, 120 createvisualtask AnimTask_CreateSnowflakes, 2, 0, 3, 120 @@ -15393,7 +15393,7 @@ Move_SNOWSCAPE:: playsewithpan SE_M_GUST2, SOUND_PAN_ATTACKER delay 30 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 2, 4, 0, RGB(11, 18, 22) + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 2, 4, 0, RGB(11, 18, 22) waitforvisualfinish end @@ -15555,7 +15555,7 @@ Move_DRAGON_ENERGY:: createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 4, 0, 11, RGB(31, 28, 31) @;Pinkish White waitforvisualfinish playsewithpan SE_M_DETECT, SOUND_PAN_TARGET - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x1, 0x10, 0x0, 0x2C5E @;Regidrago Reddish Reddish, Purple + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x1, 0x10, 0x0, 0x2C5E @;Regidrago Reddish Reddish, Purple createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, -120, 0, 0, 1 @;Slide off off, screen waitforvisualfinish playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_TARGET @@ -16093,7 +16093,7 @@ Move_CHLOROBLAST:: createvisualtask AnimTask_AllBattlersVisible, 0xA, clearmonbg ANIM_DEF_PARTNER waitbgfadein - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x0, 0x0, 0x0 @;From Black + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x2, 0x0, 0x0, 0x0 @;From Black end ChloroblastShot: createsprite gSpriteTemplate_ChloroblastShot, ANIM_TARGET, 2, 0, 0, 0x19 @@ -16461,7 +16461,7 @@ Move_CEASELESS_EDGE:: createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x0, 0x5 waitforvisualfinish createvisualtask AnimTask_AllBattlersVisible, 0xA, - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x1, 0x10, 0x0, 0x7FFF @;From White + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x1, 0x10, 0x0, 0x7FFF @;From White waitforvisualfinish end @@ -21839,14 +21839,14 @@ Move_DRAGON_RAGE: Move_RAIN_DANCE: loadspritegfx ANIM_TAG_RAIN_DROPS playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 2, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 120 createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 120 delay 120 delay 30 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 2, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 2, 4, 0, RGB_BLACK waitforvisualfinish end @@ -23279,7 +23279,7 @@ Move_SUNNY_DAY: loadspritegfx ANIM_TAG_SUNLIGHT monbg ANIM_ATK_PARTNER setalpha 13, 3 - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 0, 6, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 1, 0, 6, RGB_WHITE waitforvisualfinish panse_adjustnone SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0 call SunnyDayLightRay @@ -23287,7 +23287,7 @@ Move_SUNNY_DAY: call SunnyDayLightRay call SunnyDayLightRay waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 6, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 1, 6, 0, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -23503,9 +23503,9 @@ Move_HAZE: playsewithpan SE_M_HAZE, 0 createvisualtask AnimTask_HazeScrollingFog, 5 delay 30 - createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS, 2, 0, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS_2, 2, 0, 16, RGB_BLACK delay 90 - createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS, 1, 16, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS_2, 1, 16, 0, RGB_BLACK end Move_FIRE_PUNCH: @@ -24850,7 +24850,7 @@ Move_MORNING_SUN: loadspritegfx ANIM_TAG_BLUE_STAR createvisualtask AnimTask_MorningSunLightBeam, 5 delay 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 8, 0, 12, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 8, 0, 12, RGB_WHITE delay 14 call MorningSunStar call MorningSunStar @@ -24867,7 +24867,7 @@ Move_MORNING_SUN: call MorningSunStar call MorningSunStar call MorningSunStar - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 3, 12, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 3, 12, 0, RGB_WHITE waitforvisualfinish waitsound call HealingEffect @@ -27172,13 +27172,13 @@ General_Rain: RainDrops: loadspritegfx ANIM_TAG_RAIN_DROPS playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 2, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 60 createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 60 delay 50 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 2, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 2, 4, 0, RGB_BLACK waitforvisualfinish return @@ -27627,14 +27627,14 @@ General_Rainbow:: call RainDrops delay 30 loadspritegfx ANIM_TAG_SUNLIGHT - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 0, 6, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 1, 0, 6, RGB_WHITE waitforvisualfinish panse_adjustnone SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0 call SunnyDayLightRay call SunnyDayLightRay call SunnyDayLightRay waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 6, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_BATTLERS_2), 1, 6, 0, RGB_WHITE waitforvisualfinish delay 30 fadetobg BG_RAINBOW @@ -28807,7 +28807,7 @@ FinishCorkscrewCrash: call CorkscrewCrashSprayRocks delay 0x6 call CorkscrewCrashSprayRocks - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x2, 0x0, 0x10, 0x7fff waitforvisualfinish delay 0x10 call ResetFromWhiteScreen @@ -28890,7 +28890,7 @@ FinishInfernoOverdrive: call InfernoOverdriveExplosion delay 0x6 call InfernoOverdriveExplosion - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x1, 0x0, 0x10, 0x001b @ red bg pal + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x1, 0x0, 0x10, 0x001b @ red bg pal delay 0x6 call InfernoOverdriveExplosion waitforvisualfinish @@ -29249,7 +29249,7 @@ BloomDoomPetalBlast: ResetFromGreenScreen: createvisualtask AnimTask_AllBattlersInvisible, 0xA waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS, 0x2, 0x0, 0x0, 0x33ED @Everything from green + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS_2, 0x2, 0x0, 0x0, 0x33ED @Everything from green restorebg waitbgfadeout setarg 0x7 0xffff @@ -29873,7 +29873,7 @@ DevastatingDrakeUniversalEnding: waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x10, 0x0, 0x40c0 @ fade from purple waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS, 0x2, 0x0, 0x0, 0x0 @ reset all colours + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS_2, 0x2, 0x0, 0x0, 0x0 @ reset all colours waitforvisualfinish createvisualtask AnimTask_AllBattlersVisible, 0xA waitforvisualfinish @@ -30066,7 +30066,7 @@ Move_BLACK_HOLE_ECLIPSE:: unloadspritegfx ANIM_TAG_BLACK_BALL_2 loadspritegfx ANIM_TAG_EXPLOSION_2 call BlackHoleEclipseExplosion - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x1, 0x0, 0x10, 0x7fff @ bg to white pal + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x1, 0x0, 0x10, 0x7fff @ bg to white pal call BlackHoleEclipseExplosion waitforvisualfinish delay 0x18 @@ -30097,7 +30097,7 @@ BlackHoleEclipseExplosion: ResetFromWhiteScreen: createvisualtask AnimTask_AllBattlersInvisible, 0xA waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS, 0x2, 0x0, 0x0, 0x7FFF @everything from white + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS_2, 0x2, 0x0, 0x0, 0x7FFF @everything from white restorebg waitbgfadeout setarg 0x7 0xffff @@ -30416,10 +30416,10 @@ CatastropikaFinish: call CatastropikaThundering call CatastropikaThundering call CatastropikaThundering - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x4, 0x0, 0x10, 0x7fff @ bg to white + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x4, 0x0, 0x10, 0x7fff @ bg to white call CatastropikaThundering waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x4, 0x10, 0x0, 0x7fff @ bg to white + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x4, 0x10, 0x0, 0x7fff @ bg to white createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x0, 0x10 @fix tgt position waitforvisualfinish createvisualtask AnimTask_AllBattlersVisible, 0xA @@ -30623,11 +30623,11 @@ Move_10000000_VOLT_THUNDERBOLT:: @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x37, 0x2c, 0x40, 0x28, 0x1, 0x8003 @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x37, 0x2c, 0x80, 0x28, 0x0, 0x8003 @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x00, 0x37, 0x2c, SOUND_PAN_ATTACKER, 0x28, 0x2, 0x8003 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x2, 0x0, 0x10, 0x7fff call TenMillionVoltThunderboltSparkGeyser waitforvisualfinish delay 0x10 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x3, 0x10, 0x0, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x3, 0x10, 0x0, 0x7fff waitforvisualfinish createvisualtask AnimTask_AllBattlersVisible, 0xA waitforvisualfinish @@ -30843,10 +30843,10 @@ StokedSparksurferSparkGeyser: Move_EXTREME_EVOBOOST:: loadspritegfx ANIM_TAG_LEER @leer - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x3, 0x0, 0x10, 0x0000 + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x3, 0x0, 0x10, 0x0000 waitforvisualfinish createvisualtask AnimTask_AllBattlersInvisible, 0xA - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS, 3, 0, 0, 0 @Remove fading on everyone + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS_2, 3, 0, 0, 0 @Remove fading on everyone waitforvisualfinish playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER createsprite gLeerSpriteTemplate, ANIM_ATTACKER, 2, 0x18, 0xfff4 @@ -31055,7 +31055,7 @@ PulverizingPancakeFinish: delay 0x5 loadspritegfx ANIM_TAG_EXPLOSION @explosion call PulverizingPancakeExplosion - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x0, 0x10, 0x7fff @ everything goes white + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x2, 0x0, 0x10, 0x7fff @ everything goes white call PulverizingPancakeExplosion waitforvisualfinish call ResetFromWhiteScreen @@ -31148,7 +31148,7 @@ GenesisSupernovaFinish: unloadspritegfx ANIM_TAG_METEOR @superpower call GenesisSupernovaBubbleExplosion call GenesisSupernovaBubbleExplosion - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x3, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x3, 0x0, 0x10, 0x7fff call GenesisSupernovaBubbleExplosion waitforvisualfinish delay 0x10 @@ -31631,7 +31631,7 @@ Move_MALICIOUS_MOONSAULT:: call MaliciousMoonsaultExplosion delay 0x6 call MaliciousMoonsaultExplosion - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x1, 0x0, 0x10, 0x001b @ fade all to red + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x1, 0x0, 0x10, 0x001b @ fade all to red delay 0x6 call MaliciousMoonsaultExplosion createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x0, 0x10 @@ -31954,10 +31954,10 @@ SplinteredStormshardsByPlayer: call SplinteredStormshardsExplosionOpponent call SplinteredStormshardsExplosionOpponent SplinteredStormshardsEnd: - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x4, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x4, 0x0, 0x10, 0x7fff call SplinteredStormshardsBrownExplode waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x4, 0x10, 0x0, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x4, 0x10, 0x0, 0x7fff waitforvisualfinish createvisualtask AnimTask_AllBattlersVisible, 0xA waitforvisualfinish @@ -32203,7 +32203,7 @@ Move_LETS_SNUGGLE_FOREVER:: delay 0x8 call LetsSnuggleForeverTears waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x0, 0x10, 0x0000 + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x2, 0x0, 0x10, 0x0000 waitforvisualfinish loadspritegfx ANIM_TAG_SPARKLE_4 @detect playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER @@ -32405,7 +32405,7 @@ ClangorousSoulblazeOnPlayer: createsprite gExplosionSpriteTemplate, ANIM_ATTACKER, 3, 0x60, 0xffe0, ANIM_ATTACKER, 0x1 call ClangorousSoulblazePulse_2 delay 0x5 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x4, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x4, 0x0, 0x10, 0x7fff playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER createsprite gExplosionSpriteTemplate, ANIM_ATTACKER, 3, 0x65, 0xfff0, ANIM_ATTACKER, 0x1 call ClangorousSoulblazePulse_3 @@ -32476,7 +32476,7 @@ ClangorousSoulblazeOnOpponent: createsprite gExplosionSpriteTemplate, ANIM_TARGET, 3, 0x60, 0x45, ANIM_ATTACKER, 0x1 call ClangorousSoulblazePulse_2 delay 0x5 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x4, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x4, 0x0, 0x10, 0x7fff playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER createsprite gExplosionSpriteTemplate, ANIM_TARGET, 3, 0x65, 0x35, ANIM_ATTACKER, 0x1 call ClangorousSoulblazePulse_3 @@ -32630,7 +32630,7 @@ Move_GUARDIAN_OF_ALOLA:: call GuardianOfAlolaRockGeyser call GuardianOfAlolaRockGeyser call GuardianOfAlolaRocksTarget - createvisualtask AnimTask_BlendBattleAnimPal, 0x2, (F_PAL_BG | F_PAL_BATTLERS), 0x3, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0x2, (F_PAL_BG | F_PAL_BATTLERS_2), 0x3, 0x0, 0x10, 0x7fff call GuardianOfAlolaRockGeyser call GuardianOfAlolaRockGeyser call GuardianOfAlolaRockGeyser @@ -32801,7 +32801,7 @@ SearingSunrazeSmashImpact: call SearingSunrazeSmashInferno call SearingSunrazeSmashInferno call SearingSunrazeSmashInferno - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x4, 0x0, 0x10, 0x001b @full red + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x4, 0x0, 0x10, 0x001b @full red call SearingSunrazeSmashInferno call SearingSunrazeSmashInferno call SearingSunrazeSmashInferno @@ -32881,7 +32881,7 @@ SearingSunrazeSmashCharge: ResetFromRedScreen: createvisualtask AnimTask_AllBattlersInvisible, 0xA waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS, 0x2, 0x0, 0x0, 0x1B @Everything from red + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS_2, 0x2, 0x0, 0x0, 0x1B @Everything from red restorebg waitbgfadeout setarg 0x7 0xffff @@ -33011,7 +33011,7 @@ MenacingMoonrazeMaelstromFinish: createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 76, 1 call MenacingMoonrazeMaelstromExplosion call MenacingMoonrazeMaelstromExplosion - createvisualtask AnimTask_BlendBattleAnimPal, 0x2, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendBattleAnimPal, 0x2, (F_PAL_BG | F_PAL_BATTLERS_2), 0x2, 0x0, 0x10, 0x7fff call MenacingMoonrazeMaelstromExplosion waitforvisualfinish call ResetFromWhiteScreen @@ -33158,7 +33158,7 @@ Move_LIGHT_THAT_BURNS_THE_SKY:: clearmonbg ANIM_TARGET waitforvisualfinish delay 0x10 - createvisualtask AnimTask_BlendBattleAnimPal, 0x2, (F_PAL_BG | F_PAL_BATTLERS), 0x0, 0x10, 0x0, 0x43FF + createvisualtask AnimTask_BlendBattleAnimPal, 0x2, (F_PAL_BG | F_PAL_BATTLERS_2), 0x0, 0x10, 0x0, 0x43FF restorebg waitbgfadeout end @@ -33360,9 +33360,9 @@ Move_SOUL_STEALING_7_STAR_STRIKE:: waitforvisualfinish blendoff restorebg - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x10, 0x0, 0x0 @everything from black + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS_2), 0x2, 0x10, 0x0, 0x0 @everything from black waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS, 0x2, 0x0, 0x0, 0x0 + createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BATTLERS_2, 0x2, 0x0, 0x0, 0x0 waitforvisualfinish createvisualtask AnimTask_AllBattlersVisible, 0xA waitforvisualfinish diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 76e68b2457..ddd7b37843 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -642,5 +642,8 @@ #define F_PAL_ADJACENT (F_PAL_DEF_SIDE | F_PAL_ATK_PARTNER) #define F_PAL_ALL_BUT_DEF (F_PAL_ATK_SIDE | F_PAL_DEF_PARTNER) #define F_PAL_ALL_BUT_ATK_PARTNER (F_PAL_ATTACKER | F_PAL_DEF_SIDE) +// The below are only used by AnimTask_BlendBattleAnimPal to get battler sprite palettes by position rather than by role. +// It's redundant with F_PAL_BATTLERS, because they're only ever used together to refer to all the battlers at once. +#define F_PAL_BATTLERS_2 (1 << 7 | 1 << 8 | 1 << 9 | 1 << 10) #endif // GUARD_CONSTANTS_BATTLE_ANIM_H From cd0b4db09b579a348ca64441ffded80f70520e54 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Thu, 21 Dec 2023 14:07:54 +0100 Subject: [PATCH 03/24] same lists for healing moves (#3787) Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- include/battle_ai_util.h | 2 +- src/battle_ai_main.c | 2 +- src/battle_ai_util.c | 25 +++---------------------- src/battle_dome.c | 10 +++++----- src/battle_main.c | 2 +- 5 files changed, 11 insertions(+), 30 deletions(-) diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 9b30d103e4..9835265109 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -119,7 +119,7 @@ bool32 ShouldSetSnow(u32 battler, u32 ability, u32 holdEffect); bool32 ShouldSetRain(u32 battlerAtk, u32 ability, u32 holdEffect); bool32 ShouldSetSun(u32 battlerAtk, u32 atkAbility, u32 holdEffect); bool32 HasSleepMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef); -bool32 IsHealingMoveEffect(u32 effect); +bool32 IsHealingMove(u32 move); bool32 HasHealingEffect(u32 battler); bool32 IsTrappingMoveEffect(u32 effect); bool32 HasTrappingMoveEffect(u32 battler); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 4f7d04438b..d2e3816872 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -4715,7 +4715,7 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score ADJUST_SCORE(3); break; case EFFECT_HEAL_BLOCK: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMoveEffect(gBattleMoves[predictedMove].effect)) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMove(predictedMove)) ADJUST_SCORE(3); // Try to cancel healing move else if (HasHealingEffect(battlerDef) || aiData->holdEffects[battlerDef] == HOLD_EFFECT_LEFTOVERS || (aiData->holdEffects[battlerDef] == HOLD_EFFECT_BLACK_SLUDGE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON))) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 967d31bc07..71f3aa7d27 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2017,28 +2017,9 @@ bool32 HasSleepMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef) return FALSE; } -bool32 IsHealingMoveEffect(u32 effect) +bool32 IsHealingMove(u32 move) { - switch (effect) - { - case EFFECT_RESTORE_HP: - case EFFECT_MORNING_SUN: - case EFFECT_SYNTHESIS: - case EFFECT_MOONLIGHT: - case EFFECT_SOFTBOILED: - case EFFECT_ROOST: - case EFFECT_SWALLOW: - case EFFECT_WISH: - case EFFECT_HEALING_WISH: - case EFFECT_HEAL_PULSE: - case EFFECT_REST: - case EFFECT_JUNGLE_HEALING: - case EFFECT_ABSORB: - case EFFECT_DREAM_EATER: - return TRUE; - default: - return FALSE; - } + return gBattleMoves[move].healBlockBanned; } bool32 HasHealingEffect(u32 battlerId) @@ -2048,7 +2029,7 @@ bool32 HasHealingEffect(u32 battlerId) for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && IsHealingMoveEffect(gBattleMoves[moves[i]].effect)) + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && IsHealingMove(moves[i])) return TRUE; } diff --git a/src/battle_dome.c b/src/battle_dome.c index 05b8ebec4a..f4563666fc 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3928,12 +3928,12 @@ static u8 Task_GetInfoCardInput(u8 taskId) #undef tUsingAlternateSlot -static bool32 IsDomeHealingMoveEffect(u32 effect) +static bool32 IsDomeHealingMove(u32 move) { - if (IsHealingMoveEffect(effect)) + if (IsHealingMove(move)) return TRUE; // Check extra effects not considered plain healing by AI - switch(effect) + switch (gBattleMoves[move].effect) { case EFFECT_INGRAIN: case EFFECT_REFRESH: @@ -4343,7 +4343,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) move = gSaveBlock2Ptr->frontier.domePlayerPartyData[i].moves[j]; else move = gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].moves[j]; - + switch (k) { case MOVE_POINTS_COMBO: @@ -4359,7 +4359,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) allocatedArray[k] = IsDomeRareMove(move) ? 1 : 0; break; case MOVE_POINTS_HEAL: - allocatedArray[k] = IsDomeHealingMoveEffect(gBattleMoves[move].effect) ? 1 : 0; + allocatedArray[k] = IsDomeHealingMove(move) ? 1 : 0; break; case MOVE_POINTS_RISKY: allocatedArray[k] = IsDomeRiskyMoveEffect(gBattleMoves[move].effect) ? 1 : 0; diff --git a/src/battle_main.c b/src/battle_main.c index a6eb17c130..1216d8dd37 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4687,7 +4687,7 @@ s8 GetMovePriority(u32 battler, u16 move) { priority++; } - else if (ability == ABILITY_TRIAGE && IsHealingMoveEffect(gBattleMoves[move].effect)) + else if (ability == ABILITY_TRIAGE && IsHealingMove(move)) priority += 3; if (gProtectStructs[battler].quash) From 96cb4d382311e1a127549d5ee30f72a7c33bc669 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 21 Dec 2023 16:06:12 -0300 Subject: [PATCH 04/24] Added last CannotUseItemsInBattle tests (#3789) * Added missing CannotUseItemsInBattle tests * Removed individual assumptions for the EFFECT_ITEM_ESCAPE tests and added a single global one * Added assumption for the move-related EFFECT_ITEM_ESCAPE test * Moved the Mean Look assumption for consistency with other tests and to be extra safe --- test/battle/item_effect/escape.c | 50 ++++++++++++++++++++++++++++ test/battle/item_effect/restore_pp.c | 2 ++ test/battle/item_effect/revive.c | 2 ++ test/battle/item_effect/throw_ball.c | 7 ++++ 4 files changed, 61 insertions(+) create mode 100644 test/battle/item_effect/escape.c create mode 100644 test/battle/item_effect/throw_ball.c diff --git a/test/battle/item_effect/escape.c b/test/battle/item_effect/escape.c new file mode 100644 index 0000000000..0947a4ff9a --- /dev/null +++ b/test/battle/item_effect/escape.c @@ -0,0 +1,50 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gItems[ITEM_POKE_TOY].battleUsage == EFFECT_ITEM_ESCAPE); +} + +WILD_BATTLE_TEST("Poke Toy lets the player escape from a wild battle") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { USE_ITEM(player, ITEM_POKE_TOY); } + } SCENE { + MESSAGE("{PLAY_SE SE_FLEE}Got away safely!\p"); + } +} + +WILD_BATTLE_TEST("Poke Toy lets the player escape from a wild battle even if a move forbid them to") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_MEAN_LOOK].effect == EFFECT_MEAN_LOOK); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_MEAN_LOOK); } + TURN { USE_ITEM(player, ITEM_POKE_TOY); } + } SCENE { + // Turn 1 + MESSAGE("Wild Wobbuffet used Mean Look!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MEAN_LOOK, opponent); + MESSAGE("Wobbuffet can't escape now!"); + // Turn 2 + MESSAGE("{PLAY_SE SE_FLEE}Got away safely!\p"); + } +} + +WILD_BATTLE_TEST("Poke Toy lets the player escape from a wild battle even if an ability forbid them to") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_DIGLETT) { Ability(ABILITY_ARENA_TRAP); } + } WHEN { + TURN { USE_ITEM(player, ITEM_POKE_TOY); } + } SCENE { + MESSAGE("{PLAY_SE SE_FLEE}Got away safely!\p"); + } +} diff --git a/test/battle/item_effect/restore_pp.c b/test/battle/item_effect/restore_pp.c index e998ef3d98..ef621ca0f2 100644 --- a/test/battle/item_effect/restore_pp.c +++ b/test/battle/item_effect/restore_pp.c @@ -64,3 +64,5 @@ SINGLE_BATTLE_TEST("Max Elixir restores the PP of all of a battler's moves fully EXPECT_EQ(player->pp[3], 40); } } + +TO_DO_BATTLE_TEST("Ether won't work if the selected move has all its PP") diff --git a/test/battle/item_effect/revive.c b/test/battle/item_effect/revive.c index 2be2ac4a61..45c57322e8 100644 --- a/test/battle/item_effect/revive.c +++ b/test/battle/item_effect/revive.c @@ -72,3 +72,5 @@ SINGLE_BATTLE_TEST("Max Honey restores a fainted battler's HP fully") EXPECT_EQ(player->hp, 200); } } + +TO_DO_BATTLE_TEST("Revive won't restore a battler's HP if it hasn't fainted") diff --git a/test/battle/item_effect/throw_ball.c b/test/battle/item_effect/throw_ball.c new file mode 100644 index 0000000000..17ba01db50 --- /dev/null +++ b/test/battle/item_effect/throw_ball.c @@ -0,0 +1,7 @@ +#include "global.h" +#include "test/battle.h" + +TO_DO_BATTLE_TEST("Poke Balls can't be thrown when there's 2 opposing wild battlers") +TO_DO_BATTLE_TEST("Poke Balls can't be thrown when there's no space in the Pokemon Storage System") +TO_DO_BATTLE_TEST("Poke Balls can't be thrown when an opposing wild battler is in a semi-invulnerable state") +TO_DO_BATTLE_TEST("Poke Balls can't be thrown when B_FLAG_NO_CATCHING is set") From c9e9b4906a5fd4329ccfc8101bd93c7c60994392 Mon Sep 17 00:00:00 2001 From: ravepossum <145081120+ravepossum@users.noreply.github.com> Date: Fri, 22 Dec 2023 03:43:22 -0500 Subject: [PATCH 05/24] Make overworld weather-based terrain effects use B_MSG_TERRAIN_SET constants for intro text (#3793) Co-authored-by: ravepossum --- src/battle_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index cda38dc988..287c8e2c40 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4276,7 +4276,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 { // overworld weather started rain, so just do electric terrain anim gFieldStatuses = (STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_ELECTRIC; BattleScriptPushCursorAndCallback(BattleScript_OverworldTerrain); effect++; } @@ -4285,7 +4285,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !(gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) { gFieldStatuses = (STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TERRAIN_SET_MISTY; BattleScriptPushCursorAndCallback(BattleScript_OverworldTerrain); effect++; } From 91741cb60f20c052bf3f40c20114d9d579c7f85c Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 22 Dec 2023 11:26:43 +0100 Subject: [PATCH 06/24] fix debug menu toggling first flag (#3796) --- src/debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index 1ed438598b..a298e31b0e 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1437,6 +1437,7 @@ static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId) PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Flags[input]) != NULL) { + Debug_RedrawListMenu(taskId); func(taskId); // Remove TRUE/FALSE window for functions that haven't been assigned flags @@ -1446,8 +1447,6 @@ static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId) RemoveWindow(gTasks[taskId].tSubWindowId); Free(sDebugMenuListData); } - else - Debug_RedrawListMenu(taskId); } } else if (JOY_NEW(B_BUTTON)) From 38d67d90511edf0e7b760852859e8c6e58f04573 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Fri, 22 Dec 2023 10:24:46 -0500 Subject: [PATCH 07/24] fix exp gain when defeating two opponents at once (#3798) Co-authored-by: ghoulslash --- src/battle_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index 287c8e2c40..35fce2986f 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3338,7 +3338,8 @@ bool32 HandleFaintedMonActions(void) && gCurrentTurnActionNumber != gBattlersCount) { gAbsentBattlerFlags |= gBitTable[gBattlerFainted]; - return FALSE; + if (gBattleStruct->faintedActionsState != 1) + return FALSE; } break; case 3: From 5651bea82bfb4ff5792082652a66749e8088a725 Mon Sep 17 00:00:00 2001 From: Philipp AUER Date: Fri, 22 Dec 2023 23:24:12 +0100 Subject: [PATCH 08/24] [battle_controller_player.c] refactor and fix buffer overread (#3792) Co-authored-by: sbird --- src/battle_controller_player.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 43e84f1bff..b8ee5e0583 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -225,16 +225,16 @@ static u16 GetPrevBall(u16 ballId) return gBagPockets[BALLS_POCKET].itemSlots[i].itemId; } -static u16 GetNextBall(u16 ballId) +static u32 GetNextBall(u32 ballId) { - u16 ballNext = 0; + u32 ballNext = ITEM_NONE; s32 i; CompactItemsInBagPocket(&gBagPockets[BALLS_POCKET]); - for (i = 0; i < gBagPockets[BALLS_POCKET].capacity; i++) + for (i = 1; i < gBagPockets[BALLS_POCKET].capacity; i++) { - if (ballId == gBagPockets[BALLS_POCKET].itemSlots[i].itemId) + if (ballId == gBagPockets[BALLS_POCKET].itemSlots[i-1].itemId) { - ballNext = gBagPockets[BALLS_POCKET].itemSlots[i+1].itemId; + ballNext = gBagPockets[BALLS_POCKET].itemSlots[i].itemId; break; } } From fd45b383b18fe6134f16dc84614acd0f810fff8b Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Fri, 22 Dec 2023 23:38:57 +0100 Subject: [PATCH 09/24] Fix Photon Geyser (#3803) Co-authored-by: Bassoonian --- src/battle_script_commands.c | 1 + src/data/battle_moves.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e2705433ca..7ac373b154 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6111,6 +6111,7 @@ static void Cmd_moveend(void) gBattleStruct->zmove.effect = EFFECT_HIT; gBattleStruct->hitSwitchTargetFailed = FALSE; gBattleStruct->isAtkCancelerForCalledMove = FALSE; + gBattleStruct->swapDamageCategory = FALSE; gBattleStruct->enduredDamage = 0; gBattleScripting.moveendState++; break; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 6710af8e39..49f5a87847 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11728,7 +11728,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, + .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, From 61e63654709e977f8e48698d66244059786467ef Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sat, 23 Dec 2023 12:31:40 +0100 Subject: [PATCH 10/24] Fixes Photon Geyeser category + minor AI calc fixes (#3807) --- asm/macros/battle_script.inc | 8 +-- data/battle_scripts_1.s | 24 +-------- include/constants/battle_script_commands.h | 61 +++++++++++----------- src/battle_ai_util.c | 8 ++- src/battle_script_commands.c | 13 ++--- test/battle/move_effect/photon_geyser.c | 51 ++++++++++++++++++ 6 files changed, 100 insertions(+), 65 deletions(-) create mode 100644 test/battle/move_effect/photon_geyser.c diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index de509588bc..dd5d10296d 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1556,6 +1556,10 @@ callnative BS_TryTriggerStatusForm .endm + .macro setphotongeysercategory + callnative BS_SetPhotonGeyserCategory + .endm + @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES @@ -2124,10 +2128,6 @@ .4byte \failInstr .endm - .macro photongeysercheck battler:req - various \battler, VARIOUS_PHOTON_GEYSER_CHECK - .endm - .macro shellsidearmcheck various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 28dcc6842c..2202adb2e8 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1182,28 +1182,8 @@ BattleScript_EffectShellSideArm: goto BattleScript_EffectHit BattleScript_EffectPhotonGeyser: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - photongeysercheck BS_ATTACKER - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG - seteffectwithchance - tryfaintmon BS_TARGET - goto BattleScript_MoveEnd + setphotongeysercategory + goto BattleScript_EffectHit BattleScript_EffectAuraWheel: @ Aura Wheel can only be used by Morpeko jumpifspecies BS_ATTACKER, SPECIES_MORPEKO_FULL_BELLY, BattleScript_EffectSpeedUpHit diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 4899d37036..95632f09c7 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -210,37 +210,36 @@ #define VARIOUS_JUMP_IF_WEATHER_AFFECTED 118 #define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 119 #define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 120 -#define VARIOUS_PHOTON_GEYSER_CHECK 121 -#define VARIOUS_SHELL_SIDE_ARM_CHECK 122 -#define VARIOUS_TRY_NO_RETREAT 123 -#define VARIOUS_TRY_TAR_SHOT 124 -#define VARIOUS_CAN_TAR_SHOT_WORK 125 -#define VARIOUS_CHECK_POLTERGEIST 126 -#define VARIOUS_CUT_1_3_HP_RAISE_STATS 127 -#define VARIOUS_TRY_END_NEUTRALIZING_GAS 128 -#define VARIOUS_JUMP_IF_UNDER_200 129 -#define VARIOUS_SET_SKY_DROP 130 -#define VARIOUS_CLEAR_SKY_DROP 131 -#define VARIOUS_SKY_DROP_YAWN 132 -#define VARIOUS_JUMP_IF_HOLD_EFFECT 133 -#define VARIOUS_CURE_CERTAIN_STATUSES 134 -#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 135 -#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 136 -#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 137 -#define VARIOUS_SAVE_BATTLER_ITEM 138 -#define VARIOUS_RESTORE_BATTLER_ITEM 139 -#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 140 -#define VARIOUS_SET_BEAK_BLAST 141 -#define VARIOUS_SWAP_SIDE_STATUSES 142 -#define VARIOUS_SWAP_STATS 143 -#define VARIOUS_TEATIME_INVUL 144 -#define VARIOUS_TEATIME_TARGETS 145 -#define VARIOUS_TRY_WIND_RIDER_POWER 146 -#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 147 -#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 148 -#define VARIOUS_STORE_HEALING_WISH 149 -#define VARIOUS_HIT_SWITCH_TARGET_FAILED 150 -#define VARIOUS_TRY_REVIVAL_BLESSING 151 +#define VARIOUS_SHELL_SIDE_ARM_CHECK 121 +#define VARIOUS_TRY_NO_RETREAT 122 +#define VARIOUS_TRY_TAR_SHOT 123 +#define VARIOUS_CAN_TAR_SHOT_WORK 124 +#define VARIOUS_CHECK_POLTERGEIST 125 +#define VARIOUS_CUT_1_3_HP_RAISE_STATS 126 +#define VARIOUS_TRY_END_NEUTRALIZING_GAS 127 +#define VARIOUS_JUMP_IF_UNDER_200 128 +#define VARIOUS_SET_SKY_DROP 129 +#define VARIOUS_CLEAR_SKY_DROP 130 +#define VARIOUS_SKY_DROP_YAWN 131 +#define VARIOUS_JUMP_IF_HOLD_EFFECT 132 +#define VARIOUS_CURE_CERTAIN_STATUSES 133 +#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 134 +#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 135 +#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 136 +#define VARIOUS_SAVE_BATTLER_ITEM 137 +#define VARIOUS_RESTORE_BATTLER_ITEM 138 +#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 139 +#define VARIOUS_SET_BEAK_BLAST 140 +#define VARIOUS_SWAP_SIDE_STATUSES 141 +#define VARIOUS_SWAP_STATS 142 +#define VARIOUS_TEATIME_INVUL 143 +#define VARIOUS_TEATIME_TARGETS 144 +#define VARIOUS_TRY_WIND_RIDER_POWER 145 +#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 146 +#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 147 +#define VARIOUS_STORE_HEALING_WISH 148 +#define VARIOUS_HIT_SWITCH_TARGET_FAILED 149 +#define VARIOUS_TRY_REVIVAL_BLESSING 150 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 71f3aa7d27..37abe521a9 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -709,11 +709,14 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes gBattleStruct->zmove.baseMoves[battlerAtk] = move; gBattleStruct->zmove.active = TRUE; } + else if (gBattleMoves[move].effect == EFFECT_PHOTON_GEYSER) + gBattleStruct->swapDamageCategory = (GetSplitBasedOnStats(gBattlerAttacker) == SPLIT_PHYSICAL); + + if (gBattleMoves[move].effect == EFFECT_NATURE_POWER) + move = GetNaturePowerMove(); gBattleStruct->dynamicMoveType = 0; - if (move == MOVE_NATURE_POWER) - move = GetNaturePowerMove(); SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); @@ -825,6 +828,7 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes // convert multiper to AI_EFFECTIVENESS_xX *typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier); + gBattleStruct->swapDamageCategory = FALSE; gBattleStruct->zmove.active = FALSE; gBattleStruct->zmove.baseMoves[battlerAtk] = MOVE_NONE; return dmg; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7ac373b154..7450f573dc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10218,12 +10218,6 @@ static void Cmd_various(void) gBattlescriptCurrInstr = cmd->nextInstr; return; } - case VARIOUS_PHOTON_GEYSER_CHECK: - { - VARIOUS_ARGS(); - gBattleStruct->swapDamageCategory = (GetSplitBasedOnStats(battler) == SPLIT_SPECIAL); - break; - } case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment { VARIOUS_ARGS(); @@ -16509,3 +16503,10 @@ void BS_TryTriggerStatusForm(void) } gBattlescriptCurrInstr = cmd->nextInstr; } + +void BS_SetPhotonGeyserCategory(void) +{ + NATIVE_ARGS(); + gBattleStruct->swapDamageCategory = (GetSplitBasedOnStats(gBattlerAttacker) == SPLIT_PHYSICAL); + gBattlescriptCurrInstr = cmd->nextInstr; +} diff --git a/test/battle/move_effect/photon_geyser.c b/test/battle/move_effect/photon_geyser.c new file mode 100644 index 0000000000..4171264a1a --- /dev/null +++ b/test/battle/move_effect/photon_geyser.c @@ -0,0 +1,51 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_PHOTON_GEYSER].effect == EFFECT_PHOTON_GEYSER); +} + +SINGLE_BATTLE_TEST("Photon Geyser can be mirror coated if it is a special move") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Attack(100); SpAttack(110); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PHOTON_GEYSER); MOVE(opponent, MOVE_MIRROR_COAT); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PHOTON_GEYSER, player); + HP_BAR(opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MIRROR_COAT, opponent); + HP_BAR(player); + } +} + +SINGLE_BATTLE_TEST("Photon Geyser can be countered if it is a physcal move") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Attack(110); SpAttack(100); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PHOTON_GEYSER); MOVE(opponent, MOVE_COUNTER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PHOTON_GEYSER, player); + HP_BAR(opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_COUNTER, opponent); + HP_BAR(player); + } +} + +SINGLE_BATTLE_TEST("Photon Geyser ignores ignorable Abilities like Battle Armor") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_LAPRAS) { Ability(ABILITY_SHELL_ARMOR); } + } WHEN { + TURN { MOVE(player, MOVE_PHOTON_GEYSER, criticalHit: TRUE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PHOTON_GEYSER, player, ); + HP_BAR(opponent); + MESSAGE("A critical hit!"); + } +} From d2235a36578dfbfe3a8c13a9cdc94a7d66770f6e Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Sat, 23 Dec 2023 12:43:46 +0100 Subject: [PATCH 11/24] Depreciate agbcc and clarify gcc version usage in install instructions. (#3788) * Depreciate agbcc in install instructions. * Clarify that Ubuntu 22.04 ships with GCC v10. * Also clarify v13 usage on remote repos. * Typo. * Use Edu's reworded note from the Team Aqua discord. https://discord.com/channels/976252009114140682/1023424424713650196/1187462445762101278 --- INSTALL.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index f82649d7e2..0498b468ea 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -89,6 +89,7 @@ Some tips before proceeding: > If the above command does not work, try the above command but replacing `apt` with `apt-get`. + This will install GCC v10 on Ubuntu 22.04. pokeemerald-expansion works with GCC v10, but remote repositories and the RHH Team use GCC v13 for stricter error-checking. If you want to upgrade from v10 to v13, also follow the devkitpro install instructions. ### Choosing where to store pokeemerald (WSL1) WSL has its own file system that's not natively accessible from Windows, but Windows files *are* accessible from WSL. So you're going to want to store pokeemerald within Windows. @@ -408,6 +409,8 @@ If this works, then proceed to [Installation](#installation). Otherwise, ask for > Where *\* is the path of the folder [where you chose to store pokeemerald](#Choosing-where-to-store-pokeemerald-WSL1). Then run the `git clone` command again. +
+ Depreciated; installing agbcc is optional since 1.7.0. 2. Install agbcc into pokeemerald. The commands to run depend on certain conditions. **You should only follow one of the listed instructions**: - If agbcc has **not been built before** in the folder where you chose to store pokeemerald, run the following commands to build and install it into pokeemerald: @@ -445,6 +448,7 @@ If this works, then proceed to [Installation](#installation). Otherwise, ask for ```bash cd .. ``` +
Now you're ready to [build **pokeemerald**](#build-pokeemerald) ## Build pokeemerald From 37f19ed39e462eebbefec8f8f0d21dcc10b6c19f Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Sat, 23 Dec 2023 10:34:52 -0600 Subject: [PATCH 12/24] Fix Maushold-3 and Maushold-4 icons being swapped (#3809) --- graphics/pokemon/maushold/four/icon.png | Bin 424 -> 373 bytes graphics/pokemon/maushold/icon.png | Bin 373 -> 424 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/graphics/pokemon/maushold/four/icon.png b/graphics/pokemon/maushold/four/icon.png index 728aca58a1c573be2e9de5008b075d5209caa0d9..97c2d708268e363ee99f827f9e611e2b93330ccc 100755 GIT binary patch delta 299 zcmZ3%{FP~f1SbbG0|SFkK3f5|>NzPzuP+gs!&No0r{z$@WNvkJHiqeMV(RZqUnckPT&={9%NBiH z=MJbYoXmG%9lze+<%VZtH5n&fwP#m-^hE6cV@(UoWx46!S}R!HwO*fl(^{Jt(RFNU zIQO^B502EmujjT|(6stVidFb2;qOOV1ZP1_ zK>z@;j|==^1(6{?e*t1kM??UK1szBL007KML_t(|oZXU53c^4Pg?oe03n+~H4)*OQ z_rFGS0E^jAOzGI*tXv49+2!MrpT`@9uN7Gb6zi)1$eo}#uu$o|m=QQY%79`%Bs7^a zu&l>A12d*<>vNsUjZMK*8>A&~EpV3xlDFb>`LYAL0jQ|LZ_9omRdM+SQX5*OcymW? zYgO|koZ~c7BxIfA9shT(XOrU{HM25~r^A<;lGqgis6bXfHmvk_J8S9H)t{+<%E!>> vgZg|>pO4|~d<59?!B+%m`6yw@hx73OOV1ZP1_ zK>z@;j|==^1(6{?e*t1kM??UK1szBL007KML_t(|oZXU53c^4Pg?oe03n+~H4)*OQ z_rFGS0E^jAOzGI*tXv49+2!MrpT`@9uN7Gb6zi)1$eo}#uu$o|m=QQY%79`%Bs7^a zu&l>A12d*<>vNsUjZMK*8>A&~EpV3xlDFb>`LYAL0jQ|LZ_9omRdM+SQX5*OcymW? zYgO|koZ~c7BxIfA9shT(XOrU{HM25~r^A<;lGqgis6bXfHmvk_J8S9H)t{+<%E!>> vgZg|>pO4|~d<59?!B+%m`6yw@hx73O3f5|>NzPzuP+gs!&No0r{z$@WNvkJHiqeMV(RZqUnckPT&={9%NBiH z=MJbYoXmG%9lze+<%VZtH5n&fwP#m-^hE6cV@(UoWx46!S}R!HwO*fl(^{Jt(RFNU zIQO^B502EmujjT|(6stVidFb2;qO Date: Sun, 24 Dec 2023 17:19:59 -0500 Subject: [PATCH 13/24] fix cotton down overwriting gBattlerAttacker (#3783) Co-authored-by: ghoulslash Co-authored-by: Bassoonian --- data/battle_scripts_1.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 2202adb2e8..bffc79a303 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8016,6 +8016,7 @@ BattleScript_IllusionOff:: return BattleScript_CottonDownActivates:: + copybyte sSAVED_BATTLER, gBattlerAttacker showabilitypopup BS_TARGET pause B_WAIT_TIME_LONG destroyabilitypopup @@ -8040,6 +8041,7 @@ BattleScript_CottonDownLoopIncrement: jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_CottonDownLoop BattleScript_CottonDownReturn: swapattackerwithtarget + copybyte gBattlerAttacker, sSAVED_BATTLER return BattleScript_AnticipationActivates:: From c47a20a446f71e16d7a0eaaf7919e6b2870af8dc Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Mon, 25 Dec 2023 01:14:01 +0100 Subject: [PATCH 14/24] Fix gem boost description + test (#3817) --- include/config/item.h | 2 +- test/battle/hold_effect/gems.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/config/item.h b/include/config/item.h index 195a78e457..119d79a14f 100644 --- a/include/config/item.h +++ b/include/config/item.h @@ -10,7 +10,7 @@ #define I_VITAMIN_EV_CAP GEN_LATEST // In Gen8+, the Vitamins no longer have a cap of 100 EV per stat. #define I_BERRY_EV_JUMP GEN_LATEST // In Gen4 only, EV-lowering Berries lower a stat's EV to 100 if it is above 100. #define I_GRISEOUS_ORB_FORM_CHANGE GEN_LATEST // In Gen9+, the Griseous Orb no longer changes Giratina's form when held. -#define I_GEM_BOOST_POWER GEN_LATEST // In Gen5+, the Gem boost power was reduced from 50% to 30%. +#define I_GEM_BOOST_POWER GEN_LATEST // In Gen6+, the Gem boost power was reduced from 50% to 30%. #define I_USE_EVO_HELD_ITEMS_FROM_BAG FALSE // If TRUE, items such as Razor Claw or Electirizer will be usable from the bag to evolve a Pokémon just like in LA. #define I_TYPE_BOOST_POWER GEN_LATEST // In Gen4+, all regular type boosting held items had their power increased from 10% to 20%. eg. Charcoal #define I_SELL_VALUE_FRACTION GEN_LATEST // In Gen9+, items sell for 1/4 of their value instead of 1/2. diff --git a/test/battle/hold_effect/gems.c b/test/battle/hold_effect/gems.c index c98718313d..c4ef15a0f1 100644 --- a/test/battle/hold_effect/gems.c +++ b/test/battle/hold_effect/gems.c @@ -32,7 +32,7 @@ SINGLE_BATTLE_TEST("Gem boost is only applied once") s16 normalHit; GIVEN { - ASSUME(I_GEM_BOOST_POWER >= GEN_5); + ASSUME(I_GEM_BOOST_POWER >= GEN_6); PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMAL_GEM); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { From 45da55eb140a702ec8575271de7dc41d22896529 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:18:52 +0100 Subject: [PATCH 15/24] Fixes Minior form change and likely other forms (#3822) * Fixes Minior form change and likely other forms * new fix --------- Co-authored-by: Bassoonian --- src/battle_util.c | 3 +++ test/battle/ability/shields_down.c | 34 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 test/battle/ability/shields_down.c diff --git a/src/battle_util.c b/src/battle_util.c index 35fce2986f..ff8a7f5dc8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4701,6 +4701,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 case ABILITY_SHIELDS_DOWN: if (TryBattleFormChange(battler, FORM_CHANGE_BATTLE_HP_PERCENT)) { + gBattlerAttacker = battler; BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); effect++; } @@ -4984,6 +4985,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 case ABILITY_POWER_CONSTRUCT: if (TryBattleFormChange(battler, FORM_CHANGE_BATTLE_HP_PERCENT)) { + gBattlerAttacker = battler; BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); effect++; } @@ -5005,6 +5007,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 case ABILITY_HUNGER_SWITCH: if (TryBattleFormChange(battler, FORM_CHANGE_BATTLE_TURN_END)) { + gBattlerAttacker = battler; BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup); effect++; } diff --git a/test/battle/ability/shields_down.c b/test/battle/ability/shields_down.c new file mode 100644 index 0000000000..d0149e13f9 --- /dev/null +++ b/test/battle/ability/shields_down.c @@ -0,0 +1,34 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Minior Meteor transforms into Minior Core on switch-in if it has 1/2 or less health") +{ + GIVEN { + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_MINIOR_METEOR) { Ability(ABILITY_SHIELDS_DOWN); HP(1); } + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); SEND_OUT(opponent, 1); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_SHIELDS_DOWN); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponent); + } THEN { + EXPECT_EQ(opponent->species, SPECIES_MINIOR_CORE); + } +} + +SINGLE_BATTLE_TEST("Minior Core transforms into Minior Meteor on switch-in if it more then 1/2 health") +{ + GIVEN { + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_MINIOR_CORE) { Ability(ABILITY_SHIELDS_DOWN); } + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); SEND_OUT(opponent, 1); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_SHIELDS_DOWN); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponent); + } THEN { + EXPECT_EQ(opponent->species, SPECIES_MINIOR_METEOR); + } +} From 3bae98f768650623ef701867ec94c5490ec56a0f Mon Sep 17 00:00:00 2001 From: Gabriel Cowley Date: Tue, 26 Dec 2023 09:16:16 +0000 Subject: [PATCH 16/24] Fix P_FAMILY if blocks for Regigigas and Giratina (#3823) --- src/data/pokemon_graphics/front_pic_anims.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/pokemon_graphics/front_pic_anims.h b/src/data/pokemon_graphics/front_pic_anims.h index 92c8c7729c..75cb52732c 100644 --- a/src/data/pokemon_graphics/front_pic_anims.h +++ b/src/data/pokemon_graphics/front_pic_anims.h @@ -6127,7 +6127,9 @@ static const union AnimCmd sAnim_Regigigas_1[] = ANIMCMD_FRAME(0, 5), ANIMCMD_END, }; +#endif //P_FAMILY_REGIGIGAS +#if P_FAMILY_GIRATINA static const union AnimCmd sAnim_GiratinaAltered_1[] = { ANIMCMD_FRAME(0, 12), @@ -6145,7 +6147,7 @@ static const union AnimCmd sAnim_GiratinaOrigin_1[] = ANIMCMD_FRAME(0, 10), ANIMCMD_END, }; -#endif //P_FAMILY_REGIGIGAS +#endif //P_FAMILY_GIRATINA #if P_FAMILY_CRESSELIA static const union AnimCmd sAnim_Cresselia_1[] = From 41ff985bb6c052ec00611e953250afa695e94055 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Wed, 27 Dec 2023 12:15:16 +0100 Subject: [PATCH 17/24] PCG fix (#3830) --- src/overworld.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/overworld.c b/src/overworld.c index 09e242b217..238e21d8d5 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -414,6 +414,8 @@ void Overworld_ResetStateAfterDigEscRope(void) FlagClear(B_SMART_WILD_AI_FLAG); FlagClear(B_FLAG_NO_BAG_USE); FlagClear(B_FLAG_NO_CATCHING); + FlagClear(B_FLAG_DYNAMAX_BATTLE); + FlagClear(B_FLAG_SKY_BATTLE); } #endif From fde3fc0a521ad0ce57a548920e27d9532e84629b Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 28 Dec 2023 16:57:29 +0100 Subject: [PATCH 18/24] Metronome move fix (#3852) * Draft Indigo Disk move data * Add basic defines (flags, targets and priority missing) * Update move flags * Temper Flare is Stomping Tantrum * Fix failing tests * Disable Burning Bulwark for now --- data/battle_anim_scripts.s | 45 ++++-- include/config/battle.h | 1 + include/constants/moves.h | 32 ++-- include/pokemon.h | 1 + src/battle_script_commands.c | 4 +- src/data/battle_moves.h | 255 +++++++++++++++++++++++++++++- src/data/contest_moves.h | 30 ++++ src/data/text/move_descriptions.h | 63 ++++++++ src/data/text/move_names.h | 30 ++++ test/battle/ai_check_viability.c | 8 +- 10 files changed, 428 insertions(+), 41 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index d9e7df63b6..70e3018094 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -860,21 +860,21 @@ gBattleAnims_Moves:: .4byte Move_MATCHA_GOTCHA .4byte Move_SYRUP_BOMB .4byte Move_IVY_CUDGEL - .4byte Move_833 - .4byte Move_834 - .4byte Move_835 - .4byte Move_836 - .4byte Move_837 - .4byte Move_838 - .4byte Move_839 - .4byte Move_840 - .4byte Move_841 - .4byte Move_842 - .4byte Move_843 - .4byte Move_844 - .4byte Move_845 - .4byte Move_846 - .4byte Move_847 + .4byte Move_ELECTRO_SHOT + .4byte Move_TERA_STARSTORM + .4byte Move_FICKLE_BEAM + .4byte Move_BURNING_BULWARK + .4byte Move_THUNDERCLAP + .4byte Move_MIGHTY_CLEAVE + .4byte Move_TACHYON_CUTTER + .4byte Move_HARD_PRESS + .4byte Move_DRAGON_CHEER + .4byte Move_ALLURING_VOICE + .4byte Move_TEMPER_FLARE + .4byte Move_SUPERCELL_SLAM + .4byte Move_PSYCHIC_NOISE + .4byte Move_UPPER_HAND + .4byte Move_MALIGNANT_CHAIN @@@@ Z MOVES .4byte Move_BREAKNECK_BLITZ .4byte Move_ALL_OUT_PUMMELING @@ -16972,6 +16972,21 @@ Move_HYDRO_STEAM:: Move_BLOOD_MOON:: Move_MATCHA_GOTCHA:: Move_IVY_CUDGEL:: +Move_ELECTRO_SHOT:: +Move_TERA_STARSTORM:: +Move_FICKLE_BEAM:: +Move_BURNING_BULWARK:: +Move_THUNDERCLAP:: +Move_MIGHTY_CLEAVE:: +Move_TACHYON_CUTTER:: +Move_HARD_PRESS:: +Move_DRAGON_CHEER:: +Move_ALLURING_VOICE:: +Move_TEMPER_FLARE:: +Move_SUPERCELL_SLAM:: +Move_PSYCHIC_NOISE:: +Move_UPPER_HAND:: +Move_MALIGNANT_CHAIN:: end @to do @@@@@@@@@@@@@@@@@@@@@@@ GEN 1-3 @@@@@@@@@@@@@@@@@@@@@@@ diff --git a/include/config/battle.h b/include/config/battle.h index 90c8728dde..9dde3bb0fe 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -111,6 +111,7 @@ #define B_WIDE_GUARD GEN_LATEST // In Gen5 only, Quick Guard has a chance to fail if used consecutively. #define B_QUICK_GUARD GEN_LATEST // In Gen5 only, Wide Guard has a chance to fail if used consecutively. #define B_IMPRISON GEN_LATEST // In Gen5+, Imprison doesn't fail if opposing pokemon don't have any moves the user knows. +#define B_SKETCH_BANS GEN_LATEST // In Gen9+, Sketch is unable to copy more moves than in previous generations. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/include/constants/moves.h b/include/constants/moves.h index a8fcb01654..b7ded3d513 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -886,25 +886,27 @@ #define MOVE_MAGICAL_TORQUE 826 #define MOVE_PSYBLADE 827 #define MOVE_HYDRO_STEAM 828 +// The Teal Mask Moves #define MOVE_BLOOD_MOON 829 #define MOVE_MATCHA_GOTCHA 830 #define MOVE_SYRUP_BOMB 831 #define MOVE_IVY_CUDGEL 832 -#define MOVE_833 833 -#define MOVE_834 834 -#define MOVE_835 835 -#define MOVE_836 836 -#define MOVE_837 837 -#define MOVE_838 838 -#define MOVE_839 839 -#define MOVE_840 840 -#define MOVE_841 841 -#define MOVE_842 842 -#define MOVE_843 843 -#define MOVE_844 844 -#define MOVE_845 845 -#define MOVE_846 846 -#define MOVE_847 847 +// The Indigo Disk Moves +#define MOVE_ELECTRO_SHOT 833 +#define MOVE_TERA_STARSTORM 834 +#define MOVE_FICKLE_BEAM 835 +#define MOVE_BURNING_BULWARK 836 +#define MOVE_THUNDERCLAP 837 +#define MOVE_MIGHTY_CLEAVE 838 +#define MOVE_TACHYON_CUTTER 839 +#define MOVE_HARD_PRESS 840 +#define MOVE_DRAGON_CHEER 841 +#define MOVE_ALLURING_VOICE 842 +#define MOVE_TEMPER_FLARE 843 +#define MOVE_SUPERCELL_SLAM 844 +#define MOVE_PSYCHIC_NOISE 845 +#define MOVE_UPPER_HAND 846 +#define MOVE_MALIGNANT_CHAIN 847 #define MOVES_COUNT_GEN9 848 diff --git a/include/pokemon.h b/include/pokemon.h index dbf4c41c3b..4bfdd4b117 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -461,6 +461,7 @@ struct BattleMove u32 encoreBanned:1; u32 parentalBondBanned:1; u32 skyBattleBanned:1; + u32 sketchBanned:1; }; #define SPINDA_SPOT_WIDTH 16 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7450f573dc..0bcde61666 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12650,10 +12650,8 @@ static void Cmd_copymovepermanently(void) gChosenMove = MOVE_UNAVAILABLE; if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) - && gLastPrintedMoves[gBattlerTarget] != MOVE_STRUGGLE - && gLastPrintedMoves[gBattlerTarget] != MOVE_NONE && gLastPrintedMoves[gBattlerTarget] != MOVE_UNAVAILABLE - && gLastPrintedMoves[gBattlerTarget] != MOVE_SKETCH) + && !gBattleMoves[gLastPrintedMoves[gBattlerTarget]].sketchBanned) { s32 i; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 49f5a87847..1fb2923c53 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -13,6 +13,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .split = SPLIT_PHYSICAL, .metronomeBanned = TRUE, .mirrorMoveBanned = TRUE, + .sketchBanned = TRUE, }, [MOVE_POUND] = @@ -2951,6 +2952,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + .sketchBanned = TRUE, }, [MOVE_SKETCH] = @@ -2975,6 +2977,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + .sketchBanned = TRUE, }, [MOVE_TRIPLE_KICK] = @@ -3176,6 +3179,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .highCritRatio = TRUE, + .windMove = TRUE, }, [MOVE_COTTON_SPORE] = @@ -5290,7 +5294,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_LUSTER_PURGE] = { .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, - .power = 70, + .power = (B_UPDATED_MOVE_DATA >= GEN_9) ? 95 : 70, .type = TYPE_PSYCHIC, .accuracy = 100, .pp = 5, @@ -5305,7 +5309,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_MIST_BALL] = { .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, - .power = 70, + .power = (B_UPDATED_MOVE_DATA >= GEN_9) ? 95 : 70, .type = TYPE_PSYCHIC, .accuracy = 100, .pp = 5, @@ -8191,6 +8195,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .split = SPLIT_STATUS, .zMoveEffect = Z_EFFECT_RESET_STATS, .magicCoatAffected = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_SEED_FLARE] = @@ -10849,6 +10854,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .ignoresProtect = TRUE, .ignoresSubstitute = TRUE, .metronomeBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_SHORE_UP] = @@ -13758,6 +13764,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .ignoresProtect = TRUE, .mirrorMoveBanned = TRUE, .metronomeBanned = TRUE, + .healBlockBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_SALT_CURE] = @@ -14179,7 +14187,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, .slicingMove = TRUE, - .healBlockBanned = B_EXTRAPOLATED_MOVE_FLAGS, + .healBlockBanned = TRUE, }, [MOVE_DOUBLE_SHOCK] = @@ -14268,6 +14276,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_WICKED_TORQUE] = @@ -14292,6 +14301,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_NOXIOUS_TORQUE] = @@ -14316,6 +14326,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_COMBAT_TORQUE] = @@ -14340,6 +14351,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_MAGICAL_TORQUE] = @@ -14364,6 +14376,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), }, [MOVE_PSYBLADE] = @@ -14426,7 +14439,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .zMoveEffect = Z_EFFECT_NONE, .thawsUser = TRUE, .metronomeBanned = TRUE, - .healBlockBanned = B_EXTRAPOLATED_MOVE_FLAGS, + .healBlockBanned = TRUE, }, [MOVE_SYRUP_BOMB] = @@ -14462,6 +14475,240 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .metronomeBanned = TRUE, }, + [MOVE_ELECTRO_SHOT] = + { + .effect = EFFECT_PLACEHOLDER, //EFFECT_ELECTRO_SHOT + .power = 130, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + //.sheerForceBoost = TRUE, (uncomment when effect is implemented, otherwise it breaks the Sheer Force Test) + }, + + [MOVE_TERA_STARSTORM] = + { + .effect = EFFECT_PLACEHOLDER, //EFFECT_TERA_STARSTORM + .power = 120, + .type = TYPE_NORMAL, // Stellar type if used by Terapagos-Stellar + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, // MOVE_TARGET_BOTH if used by Terapagos-Stellar + .priority = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + .assistBanned = TRUE, + .copycatBanned = TRUE, + .mimicBanned = TRUE, + .sketchBanned = (B_SKETCH_BANS >= GEN_9), + }, + + [MOVE_FICKLE_BEAM] = + { + .effect = EFFECT_PLACEHOLDER, //EFFECT_FICKLE_BEAM + .power = 80, + .type = TYPE_DRAGON, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + }, + + [MOVE_BURNING_BULWARK] = + { + .effect = EFFECT_PLACEHOLDER, // EFFECT_PROTECT with effects + .power = 0, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 4, + .split = SPLIT_STATUS, + .zMoveEffect = Z_EFFECT_DEF_UP_1, + .protectionMove = TRUE, + .ignoresProtect = TRUE, + .mirrorMoveBanned = TRUE, + .metronomeBanned = TRUE, + .copycatBanned = TRUE, + .assistBanned = TRUE, + }, + + [MOVE_THUNDERCLAP] = + { + .effect = EFFECT_SUCKER_PUNCH, + .power = 70, + .type = TYPE_ELECTRIC, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 1, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + }, + + [MOVE_MIGHTY_CLEAVE] = + { + .effect = EFFECT_FEINT, + .power = 95, + .type = TYPE_ROCK, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, + .makesContact = TRUE, + .slicingMove = TRUE, + }, + + [MOVE_TACHYON_CUTTER] = + { + .effect = EFFECT_HIT, + .power = 50, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + .strikeCount = 2, + .slicingMove = TRUE, + }, + + [MOVE_HARD_PRESS] = + { + .effect = EFFECT_WRING_OUT, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, + .makesContact = TRUE, + }, + + [MOVE_DRAGON_CHEER] = + { + .effect = EFFECT_PLACEHOLDER, //EFFECT_DRAGON_CHEER + .power = 0, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_ALLY, + .priority = 0, + .split = SPLIT_STATUS, + .zMoveEffect = Z_EFFECT_NONE, + .ignoresSubstitute = TRUE, + }, + + [MOVE_ALLURING_VOICE] = + { + .effect = EFFECT_PLACEHOLDER, //EFFECT_ALLURING_VOICE + .power = 80, + .type = TYPE_FAIRY, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + .soundMove = TRUE, + .ignoresSubstitute = TRUE, + }, + + [MOVE_TEMPER_FLARE] = + { + .effect = EFFECT_STOMPING_TANTRUM, + .power = 75, + .type = TYPE_FIRE, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, + .makesContact = TRUE, + }, + + [MOVE_SUPERCELL_SLAM] = + { + .effect = EFFECT_RECOIL_IF_MISS, + .power = 100, + .type = TYPE_ELECTRIC, + .accuracy = 95, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, + .makesContact = TRUE, + }, + + [MOVE_PSYCHIC_NOISE] = + { + .effect = EFFECT_PLACEHOLDER, //EFFECT_PSYCHIC_NOISE + .power = 75, + .type = TYPE_PSYCHIC, + .accuracy = 100, + .pp = 10, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + .soundMove = TRUE, + .ignoresSubstitute = TRUE, + }, + + [MOVE_UPPER_HAND] = + { + .effect = EFFECT_PLACEHOLDER, //EFFECT_UPPER_HAND + .power = 65, + .type = TYPE_FIGHTING, + .accuracy = 100, + .pp = 15, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 3, + .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, + .makesContact = TRUE, + }, + + [MOVE_MALIGNANT_CHAIN] = + { + .effect = EFFECT_POISON_FANG, + .power = 100, + .type = TYPE_POISON, + .accuracy = 100, + .pp = 5, + .secondaryEffectChance = 50, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, + }, + // Z-Moves [MOVE_BREAKNECK_BLITZ] = { diff --git a/src/data/contest_moves.h b/src/data/contest_moves.h index 6084091683..8167f25104 100644 --- a/src/data/contest_moves.h +++ b/src/data/contest_moves.h @@ -6074,6 +6074,36 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = [MOVE_SYRUP_BOMB] = {0}, // TODO [MOVE_IVY_CUDGEL] = {0}, // TODO + + [MOVE_ELECTRO_SHOT] = {0}, // TODO + + [MOVE_TERA_STARSTORM] = {0}, // TODO + + [MOVE_FICKLE_BEAM] = {0}, // TODO + + [MOVE_BURNING_BULWARK] = {0}, // TODO + + [MOVE_THUNDERCLAP] = {0}, // TODO + + [MOVE_MIGHTY_CLEAVE] = {0}, // TODO + + [MOVE_TACHYON_CUTTER] = {0}, // TODO + + [MOVE_HARD_PRESS] = {0}, // TODO + + [MOVE_DRAGON_CHEER] = {0}, // TODO + + [MOVE_ALLURING_VOICE] = {0}, // TODO + + [MOVE_TEMPER_FLARE] = {0}, // TODO + + [MOVE_SUPERCELL_SLAM] = {0}, // TODO + + [MOVE_PSYCHIC_NOISE] = {0}, // TODO + + [MOVE_UPPER_HAND] = {0}, // TODO + + [MOVE_MALIGNANT_CHAIN] = {0}, // TODO }; const struct ContestEffect gContestEffects[] = diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index c321a844b1..4aa7293036 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -3284,6 +3284,54 @@ static const u8 sIvyCudgelDescription[] = _( "Type changes with held mask.\n" "High critical-hit ratio."); +static const u8 sElectroShotDescription[] = _( + "Absorbs electricity in one turn,\n" + "then attacks next turn."); + +static const u8 sTeraStarstormDescription[] = _( + "Damages all opponents if user is\n" + "Stellar form Terapagos."); + +static const u8 sFickleBeamDescription[] = _( + "Shoots a beam of light. Sometimes\n" + "twice as strong."); + +static const u8 sBurningBulwarkDescription[] = _( + "Evades attack, and burns\n" + "the foe if struck."); + +static const u8 sTachyonCutterDescription[] = _( + "Launches particle blades at\n" + "the target. Strikes twice."); + +static const u8 sDragonCheerDescription[] = _( + "Increases allies' critical hit\n" + "ration, especially if Dragons."); + +static const u8 sAlluringVoiceDescription[] = _( + "Confuses the target if their\n" + "stats were boosted this turn."); + +static const u8 sTemperFlareDescription[] = _( + "A desperation attack. Power\n" + "doubles if last move failed."); + +static const u8 sSupercellSlamDescription[] = _( + "An electrified slam. If it\n" + "misses, the user is hurt."); + +static const u8 sPsychicNoiseDescription[] = _( + "Unpleasant sound waves that\n" + "damage and prevent healing."); + +static const u8 sUpperHandDescription[] = _( + "Makes the target flinch if\n" + "readying a priority move."); + +static const u8 sMalignantChainDescription[] = _( + "A corrosive chain attack\n" + "that may badly poison."); + const u8 gNotDoneYetDescription[] = _( "This move can't be used. Its\n" "effect is in development."); @@ -4127,4 +4175,19 @@ const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] = [MOVE_MATCHA_GOTCHA - 1] = sMatchaGotchaDescription, [MOVE_SYRUP_BOMB - 1] = sSyrupBombDescription, [MOVE_IVY_CUDGEL - 1] = sIvyCudgelDescription, + [MOVE_ELECTRO_SHOT - 1] = sElectroShotDescription, + [MOVE_TERA_STARSTORM - 1] = sTeraStarstormDescription, + [MOVE_FICKLE_BEAM - 1] = sFickleBeamDescription, + [MOVE_BURNING_BULWARK - 1] = sBurningBulwarkDescription, + [MOVE_THUNDERCLAP - 1] = sSuckerPunchDescription, + [MOVE_MIGHTY_CLEAVE - 1] = sFeintDescription, + [MOVE_TACHYON_CUTTER - 1] = sTachyonCutterDescription, + [MOVE_HARD_PRESS - 1] = sWringOutDescription, + [MOVE_DRAGON_CHEER - 1] = sDragonCheerDescription, + [MOVE_ALLURING_VOICE - 1] = sAlluringVoiceDescription, + [MOVE_TEMPER_FLARE - 1] = sTemperFlareDescription, + [MOVE_SUPERCELL_SLAM - 1] = sSupercellSlamDescription, + [MOVE_PSYCHIC_NOISE - 1] = sPsychicNoiseDescription, + [MOVE_UPPER_HAND - 1] = sUpperHandDescription, + [MOVE_MALIGNANT_CHAIN - 1] = sMalignantChainDescription, }; diff --git a/src/data/text/move_names.h b/src/data/text/move_names.h index 01d613751e..f69b1f96a7 100644 --- a/src/data/text/move_names.h +++ b/src/data/text/move_names.h @@ -835,6 +835,21 @@ const u8 gMoveNames[MOVES_COUNT_DYNAMAX][MOVE_NAME_LENGTH + 1] = [MOVE_MATCHA_GOTCHA] = _("Matcha Gotcha"), [MOVE_SYRUP_BOMB] = _("Syrup Bomb"), [MOVE_IVY_CUDGEL] = _("Ivy Cudgel"), + [MOVE_ELECTRO_SHOT] = _("Electro Shot"), + [MOVE_TERA_STARSTORM] = _("Tera Starstorm"), + [MOVE_FICKLE_BEAM] = _("Fickle Beam"), + [MOVE_BURNING_BULWARK] = _("Burning Bulwark"), + [MOVE_THUNDERCLAP] = _("Thunderclap"), + [MOVE_MIGHTY_CLEAVE] = _("Mighty Cleave"), + [MOVE_TACHYON_CUTTER] = _("Tachyon Cutter"), + [MOVE_HARD_PRESS] = _("Hard Press"), + [MOVE_DRAGON_CHEER] = _("Dragon Cheer"), + [MOVE_ALLURING_VOICE] = _("Alluring Voice"), + [MOVE_TEMPER_FLARE] = _("Temper Flare"), + [MOVE_SUPERCELL_SLAM] = _("Supercell Slam"), + [MOVE_PSYCHIC_NOISE] = _("Psychic Noise"), + [MOVE_UPPER_HAND] = _("Upper Hand"), + [MOVE_MALIGNANT_CHAIN] = _("Malignant Chain"), // Max Moves [MOVE_MAX_GUARD] = _("Max Guard"), [MOVE_MAX_STRIKE] = _("Max Strike"), @@ -1727,6 +1742,21 @@ const u8 gMoveNames[MOVES_COUNT_DYNAMAX][MOVE_NAME_LENGTH + 1] = [MOVE_MATCHA_GOTCHA] = _("MatchaGotcha"), [MOVE_SYRUP_BOMB] = _("Syrup Bomb"), [MOVE_IVY_CUDGEL] = _("Ivy Cudgel"), + [MOVE_ELECTRO_SHOT] = _("Electro Shot"), + [MOVE_TERA_STARSTORM] = _("TeraStarstrm"), + [MOVE_FICKLE_BEAM] = _("Fickle Beam"), + [MOVE_BURNING_BULWARK] = _("BurnngBulwrk"), + [MOVE_THUNDERCLAP] = _("Thunderclap"), + [MOVE_MIGHTY_CLEAVE] = _("MightyCleave"), + [MOVE_TACHYON_CUTTER] = _("TachyonCuttr"), + [MOVE_HARD_PRESS] = _("Hard Press"), + [MOVE_DRAGON_CHEER] = _("Dragon Cheer"), + [MOVE_ALLURING_VOICE] = _("AllurngVoice"), + [MOVE_TEMPER_FLARE] = _("Temper Flare"), + [MOVE_SUPERCELL_SLAM] = _("SuprcellSlam"), + [MOVE_PSYCHIC_NOISE] = _("PsychicNoise"), + [MOVE_UPPER_HAND] = _("Upper Hand"), + [MOVE_MALIGNANT_CHAIN] = _("MalignntChan"), // Max Moves [MOVE_MAX_GUARD] = _("M-Guard"), [MOVE_MAX_STRIKE] = _("M-Strike"), diff --git a/test/battle/ai_check_viability.c b/test/battle/ai_check_viability.c index 4666eca7cb..2f229e3aca 100644 --- a/test/battle/ai_check_viability.c +++ b/test/battle/ai_check_viability.c @@ -177,15 +177,15 @@ AI_SINGLE_BATTLE_TEST("AI chooses moves with secondary effect that have a 100% c AI_LOG; ASSUME(gBattleMoves[MOVE_SHADOW_BALL].effect == EFFECT_SPECIAL_DEFENSE_DOWN_HIT); ASSUME(gBattleMoves[MOVE_SHADOW_BALL].secondaryEffectChance == 20); - ASSUME(gBattleMoves[MOVE_LUSTER_PURGE].effect == EFFECT_SPECIAL_DEFENSE_DOWN_HIT); - ASSUME(gBattleMoves[MOVE_LUSTER_PURGE].secondaryEffectChance == 50); + ASSUME(gBattleMoves[MOVE_OCTAZOOKA].effect == EFFECT_ACCURACY_DOWN_HIT); + ASSUME(gBattleMoves[MOVE_OCTAZOOKA].secondaryEffectChance == 50); AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT); PLAYER(SPECIES_REGICE); - OPPONENT(SPECIES_REGIROCK) { Ability(ability); Moves(MOVE_SHADOW_BALL, MOVE_LUSTER_PURGE); } + OPPONENT(SPECIES_REGIROCK) { Ability(ability); Moves(MOVE_SHADOW_BALL, MOVE_OCTAZOOKA); } } WHEN { if (ability == ABILITY_NONE) TURN { EXPECT_MOVE(opponent, MOVE_SHADOW_BALL); } else - TURN { EXPECT_MOVES(opponent, MOVE_LUSTER_PURGE); } + TURN { EXPECT_MOVES(opponent, MOVE_OCTAZOOKA); } } } From d3f971f0e8c91f169f3825d2ad676aad644e1825 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 28 Dec 2023 23:50:21 +0100 Subject: [PATCH 19/24] Version 1.7.1 (#3855) --- .../ISSUE_TEMPLATE/01_battle_engine_bugs.yaml | 3 +- .../ISSUE_TEMPLATE/02_battle_ai_issues.yaml | 3 +- .github/ISSUE_TEMPLATE/04_other_errors.yaml | 3 +- CHANGELOG.md | 4 +- README.md | 4 +- docs/changelogs/1.7.1.md | 63 +++++++++++++++++++ include/constants/expansion.h | 4 +- 7 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 docs/changelogs/1.7.1.md diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml index 109c4a5930..bc9b624f1d 100644 --- a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml +++ b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml @@ -23,8 +23,9 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.0 (Default) + - 1.7.1 (Default) - upcoming (Edge) + - 1.7.0 - 1.6.2 - 1.6.1 - 1.6.0 diff --git a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml index 74e13a0a35..512a433eff 100644 --- a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml +++ b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml @@ -23,8 +23,9 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.0 (Default) + - 1.7.1 (Default) - upcoming (Edge) + - 1.7.0 - 1.6.2 - 1.6.1 - 1.6.0 diff --git a/.github/ISSUE_TEMPLATE/04_other_errors.yaml b/.github/ISSUE_TEMPLATE/04_other_errors.yaml index c449e8b648..77d9a217de 100644 --- a/.github/ISSUE_TEMPLATE/04_other_errors.yaml +++ b/.github/ISSUE_TEMPLATE/04_other_errors.yaml @@ -23,8 +23,9 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.0 (Default) + - 1.7.1 (Default) - upcoming (Edge) + - 1.7.0 - 1.6.2 - 1.6.1 - 1.6.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b56aca136..c18fb7de37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Pokeemerald-Expansion Changelogs +## [Version 1.7.1](docs/changelogs/1.7.1.md) - Bugfix Release + ## [Version 1.7.0](docs/changelogs/1.7.0.md) - Feature Release -## [Version 1.6.2](docs/changelogs/1.6.2.md) - Bugfix release +## [Version 1.6.2](docs/changelogs/1.6.2.md) - Bugfix Release diff --git a/README.md b/README.md index 7eda2621c3..6e3f2e1d33 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ pokeemerald-expansion is a decomp hack base project based off pret's [pokeemeral If you use pokeemerald-expansion in your hack, please add RHH (Rom Hacking Hideout) to your credits list. Optionally, you can list the version used, so it can help players know what features to expect. You can phrase it as the following: ``` -Based off RHH's pokeemerald-expansion v1.7.0 https://github.com/rh-hideout/pokeemerald-expansion/ +Based off RHH's pokeemerald-expansion v1.7.1 https://github.com/rh-hideout/pokeemerald-expansion/ ``` ## What features are included? @@ -166,7 +166,7 @@ With this, you'll get the latest version of pokeemerald-expansion, plus a couple ## **How do I update my version of pokeemerald-expansion?** - If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`. -- Once you have your remote set up, run the command `git pull RHH expansion/1.7.0`. +- Once you have your remote set up, run the command `git pull RHH expansion/1.7.1`. ### Please consider crediting the entire [list of contributors](https://github.com/rh-hideout/pokeemerald-expansion/wiki/Credits) in your project, as they have all worked hard to develop this project :) diff --git a/docs/changelogs/1.7.1.md b/docs/changelogs/1.7.1.md new file mode 100644 index 0000000000..c30c77512f --- /dev/null +++ b/docs/changelogs/1.7.1.md @@ -0,0 +1,63 @@ +# Version 1.7.1 + +```md +## How to update +- If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`. +- Once you have your remote set up, run the command `git pull RHH expansion/1.7.1`. +``` + +## 🧬 General 🧬 +### Changed +* Deprecate agbcc and clarify gcc version usage in install instructions. by @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/3788 +### Fixed +* Fix Update Message Saying 1.6.2 by @kaicardenas2 in https://github.com/rh-hideout/pokeemerald-expansion/pull/3759 +* Fix exp gain when defeating two opponents at once by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/3798 +* Fix debug menu toggling first flag by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3796 + +## 🐉 Pokémon 🐉 +### Fixed +* Fix Maushold-3 and Maushold-4 icons being swapped by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3809 +* Fixes Minior form change and likely other forms by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3822 +* Fix P_FAMILY #if blocks for Regigigas and Giratina in front_pic_anims.h by @gabrielcowley in https://github.com/rh-hideout/pokeemerald-expansion/pull/3823 + +## 🤹 Moves 🤹 +### Added +* Adds data for The Indigo Disk moves by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3852 + * Many moves still have placeholder effects. +### Fixed +* Fix Telekinesis not working by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3763 +* Fix Ion Deluge interaction with Volt Absorb andLightning Rod by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3764 +* Fix Max Moves animations by @GraionDilach in https://github.com/rh-hideout/pokeemerald-expansion/pull/3769 +* Fix Cotton Down overwriting gBattlerAttacker by @ghoulslash in https://github.com/rh-hideout/pokeemerald-expansion/pull/3783 +* Fix Photon Geyser by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3803 and https://github.com/rh-hideout/pokeemerald-expansion/pull/3807 +* Fix Metronome crash by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3852 + +## 🎭 Abilities 🎭 +### Fixed +* Fix Ice Face ignoring move effects by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3755 +* Fix Frisk ability pop-up showing wrong battler by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3762 +* Prankster tests + fixes by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3766 + +## 🧶 Items 🧶 +### Fixed +* Fixes Item Metronome damage by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/3767 +* Fix gem boost description + test by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3817 + +## 🧹 Cleanup 🧹 +* Clear BattleScripting struct at the battle start by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3776 +* Fix Rain Dance and Sunny Day not blending opponent sprite by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3785 +* Same lists for healing moves by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/3787 +* [battle_controller_player.c] refactor and fix buffer overread by @SBird1337 in https://github.com/rh-hideout/pokeemerald-expansion/pull/3792 +* Make overworld weather-based terrain setting effects use B_MSG_TERRAIN_SET constants for intro text by @ravepossum in https://github.com/rh-hideout/pokeemerald-expansion/pull/3793 +* Clear Sky Battle & Dynamax flags upon whiteout by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/3830 + +## 🧪 Test Runner 🧪 +### Added +* Small test runner improvements by @mrgriffin in https://github.com/rh-hideout/pokeemerald-expansion/pull/3761 +* EXPECT_MUL_EQ thresholds are always at least ±1 by @kittenchilly in https://github.com/rh-hideout/pokeemerald-expansion/pull/3768 +* Added last CannotUseItemsInBattle tests by @LOuroboros in https://github.com/rh-hideout/pokeemerald-expansion/pull/3789 + +## New Contributors +* @kaicardenas2 made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/3759 + +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.7.0...expansion/1.7.1 diff --git a/include/constants/expansion.h b/include/constants/expansion.h index 872e5bbd34..71072b9999 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -3,10 +3,10 @@ #define EXPANSION_VERSION_MAJOR 1 #define EXPANSION_VERSION_MINOR 7 -#define EXPANSION_VERSION_PATCH 0 +#define EXPANSION_VERSION_PATCH 1 // FALSE if this this version of Expansion is not a tagged commit, i.e. // it contains unreleased changes. -#define EXPANSION_TAGGED_RELEASE FALSE +#define EXPANSION_TAGGED_RELEASE TRUE #endif From 0a40cd15d160b9cfc2863114c7a7c113dcfd116a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 28 Dec 2023 19:54:06 -0300 Subject: [PATCH 20/24] Non-tagged release --- include/constants/expansion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/expansion.h b/include/constants/expansion.h index 71072b9999..020a76664c 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -7,6 +7,6 @@ // FALSE if this this version of Expansion is not a tagged commit, i.e. // it contains unreleased changes. -#define EXPANSION_TAGGED_RELEASE TRUE +#define EXPANSION_TAGGED_RELEASE FALSE #endif From bc4d4d21e4e4937bfc6f6ea2d1fa20f427058b36 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 29 Dec 2023 00:33:18 +0100 Subject: [PATCH 21/24] Fix 3851 (#3857) --- include/config/battle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index 9dde3bb0fe..a003b8f5d8 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -108,8 +108,8 @@ #define B_STOCKPILE_RAISES_DEFS GEN_LATEST // In Gen4+, Stockpile also raises Defense and Sp. Defense stats. Once Spit Up / Swallow is used, these stat changes are lost. #define B_TRANSFORM_SHINY GEN_LATEST // In Gen4+, Transform will copy the shiny state of the opponent instead of maintaining its own shiny state. #define B_TRANSFORM_FORM_CHANGES GEN_LATEST // In Gen5+, Transformed Pokemon cannot change forms. -#define B_WIDE_GUARD GEN_LATEST // In Gen5 only, Quick Guard has a chance to fail if used consecutively. -#define B_QUICK_GUARD GEN_LATEST // In Gen5 only, Wide Guard has a chance to fail if used consecutively. +#define B_WIDE_GUARD GEN_LATEST // In Gen5 only, Wide Guard has a chance to fail if used consecutively. +#define B_QUICK_GUARD GEN_LATEST // In Gen5 only, Quick Guard has a chance to fail if used consecutively. #define B_IMPRISON GEN_LATEST // In Gen5+, Imprison doesn't fail if opposing pokemon don't have any moves the user knows. #define B_SKETCH_BANS GEN_LATEST // In Gen9+, Sketch is unable to copy more moves than in previous generations. From 604b823ffda13b441b9b43d932af0eab526a2bba Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 29 Dec 2023 13:39:54 +0100 Subject: [PATCH 22/24] Missing Strength sap tests (#3860) * add missing strength sap tests * a --------- Co-authored-by: Bassoonian --- data/battle_scripts_1.s | 13 +++ src/battle_message.c | 2 +- test/battle/move_effect/strength_sap.c | 139 +++++++++++++++++++++++++ 3 files changed, 153 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index bffc79a303..13a269dadd 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1613,15 +1613,28 @@ BattleScript_StrengthSapTryHp: attackanimation waitanimation BattleScript_StrengthSapHp: + jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_StrengthSapManipulateDmg jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_MoveEnd jumpiffullhp BS_ATTACKER, BattleScript_MoveEnd +BattleScript_StrengthSapManipulateDmg: manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_StrengthSapLiquidOoze healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNENERGYDRAINED waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_StrengthSapLiquidOoze: + call BattleScript_AbilityPopUpTarget + manipulatedamage DMG_CHANGE_SIGN + setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB_OOZE + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + printfromtable gAbsorbDrainStringIds + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_ATTACKER + goto BattleScript_MoveEnd BattleScript_StrengthSapMustLower: statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_MoveEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_MoveEnd diff --git a/src/battle_message.c b/src/battle_message.c index d8dbceab24..d7ab067eeb 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -304,7 +304,7 @@ static const u8 sText_PkmnsXPreventsYLoss[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} static const u8 sText_PkmnsXInfatuatedY[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}\ninfatuated {B_ATK_NAME_WITH_PREFIX}!"); static const u8 sText_PkmnsXMadeYIneffective[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}\nmade {B_CURRENT_MOVE} ineffective!"); static const u8 sText_PkmnsXCuredYProblem[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!"); -static const u8 sText_ItSuckedLiquidOoze[] = _("It sucked up the\nLIQUID OOZE!"); +static const u8 sText_ItSuckedLiquidOoze[] = _("It sucked up the\nliquid ooze!"); static const u8 sText_PkmnTransformed[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} transformed!"); static const u8 sText_PkmnsXTookAttack[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY}\ntook the attack!"); const u8 gText_PkmnsXPreventsSwitching[] = _("{B_BUFF1}'s {B_LAST_ABILITY}\nprevents switching!\p"); diff --git a/test/battle/move_effect/strength_sap.c b/test/battle/move_effect/strength_sap.c index c549e4c332..d8e0b6e74b 100644 --- a/test/battle/move_effect/strength_sap.c +++ b/test/battle/move_effect/strength_sap.c @@ -57,3 +57,142 @@ SINGLE_BATTLE_TEST("Strength Sap works exactly the same when attacker is behind EXPECT_EQ(results[i].hp * -1, atkStat); } } + +// This test checks all stat stages from -6 to +6. +SINGLE_BATTLE_TEST("Strength Sap lowers Attack by 1 and restores HP based on target's Attack Stat and stat Change", s16 hp) +{ + s32 j = 0, statStage = 0; + + for (j = 0; j <= MAX_STAT_STAGE; j++) { + if (j == DEFAULT_STAT_STAGE - 1) { continue; } // Ignore -6, because Strength Sap won't work otherwise + PARAMETRIZE{ statStage = j; } + } + + GIVEN { + ASSUME(gBattleMoves[MOVE_WORK_UP].effect == EFFECT_ATTACK_SPATK_UP); + ASSUME(gBattleMoves[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + PLAYER(SPECIES_WOBBUFFET) { HP(50); } + OPPONENT(SPECIES_WOBBUFFET) { Attack(60); } + } WHEN { + if (statStage > DEFAULT_STAT_STAGE) { // + + for (j = statStage; j > DEFAULT_STAT_STAGE; j--) { + TURN { MOVE(opponent, MOVE_HOWL); } + } + } else if (statStage < DEFAULT_STAT_STAGE) { // - + for (j = statStage; j < DEFAULT_STAT_STAGE - 1; j++) { // - 1 because Strength Sap always lowers Attack + TURN { MOVE(player, MOVE_GROWL); } + } + } + TURN { MOVE(player, MOVE_STRENGTH_SAP); } + } SCENE { + if (statStage > DEFAULT_STAT_STAGE) { // + + for (j = statStage; j > DEFAULT_STAT_STAGE; j--) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HOWL, opponent); + } + } else if (statStage < DEFAULT_STAT_STAGE) { // - + for (j = statStage; j < DEFAULT_STAT_STAGE - 1; j++) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_GROWL, player); + } + } + MESSAGE("Wobbuffet used Strength Sap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STRENGTH_SAP, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Wobbuffet's Attack fell!"); + HP_BAR(player, captureDamage: &results[i].hp); + MESSAGE("Foe Wobbuffet had its energy drained!"); + } THEN { + if (statStage < DEFAULT_STAT_STAGE) { + EXPECT_EQ(results[i].hp * -1, (60 * gStatStageRatios[statStage + 1][0] / gStatStageRatios[statStage + 1][1])); + } else { + EXPECT_EQ(results[i].hp * -1, (60 * gStatStageRatios[statStage][0] / gStatStageRatios[statStage][1])); + } + } FINALLY { + // This makes sure gStatStageRatios works correctly and the lower the attack stage the lower hp obtained. + for (j = 0; j < MAX_STAT_STAGE - 1; j++) { + EXPECT_GT(abs(results[j + 1].hp), abs(results[j].hp)); + } + } +} + +SINGLE_BATTLE_TEST("Strength Sap fails if target is at -6 Atk") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_CHARM].effect == EFFECT_ATTACK_DOWN_2); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_CHARM); } + TURN { MOVE(player, MOVE_CHARM); } + TURN { MOVE(player, MOVE_CHARM); } + TURN { MOVE(player, MOVE_STRENGTH_SAP); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CHARM, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CHARM, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CHARM, player); + MESSAGE("Wobbuffet used Strength Sap!"); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STRENGTH_SAP, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Wobbuffet's Attack fell!"); + HP_BAR(player); + MESSAGE("Foe Wobbuffet had its energy drained!"); + } + MESSAGE("Foe Wobbuffet's Attack won't go lower!"); + } +} + +SINGLE_BATTLE_TEST("Strength Sap restores more HP if Big Root is held", s16 hp) +{ + u32 item; + + PARAMETRIZE { item = ITEM_NONE; } + PARAMETRIZE { item = ITEM_BIG_ROOT; } + + GIVEN { + ASSUME(gItems[ITEM_BIG_ROOT].holdEffect == HOLD_EFFECT_BIG_ROOT); + PLAYER(SPECIES_WOBBUFFET) { HP(200); Item(item); } + OPPONENT(SPECIES_WOBBUFFET) { Attack(100); } + } WHEN { + TURN { MOVE(player, MOVE_STRENGTH_SAP); } + } SCENE { + MESSAGE("Wobbuffet used Strength Sap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STRENGTH_SAP, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Wobbuffet's Attack fell!"); + HP_BAR(player, captureDamage: &results[i].hp); + MESSAGE("Foe Wobbuffet had its energy drained!"); + } FINALLY { + EXPECT_GT(abs(results[1].hp), abs(results[0].hp)); + } +} + +SINGLE_BATTLE_TEST("Strength Sap makes attacker lose HP if target's ability is Liquid Ooze") +{ + s16 lostHp; + s32 atkStat; + + PARAMETRIZE { atkStat = 100; } + PARAMETRIZE { atkStat = 490; } // Checks that attacker can faint with no problems. + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Attack(atkStat); Ability(ABILITY_LIQUID_OOZE); } + } WHEN { + TURN { MOVE(player, MOVE_STRENGTH_SAP); if (atkStat == 490) { SEND_OUT(player, 1); } } + } SCENE { + MESSAGE("Wobbuffet used Strength Sap!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STRENGTH_SAP, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Wobbuffet's Attack fell!"); + ABILITY_POPUP(opponent, ABILITY_LIQUID_OOZE); + HP_BAR(player, captureDamage: &lostHp); + MESSAGE("It sucked up the liquid ooze!"); + if (atkStat >= 490) { + MESSAGE("Wobbuffet fainted!"); + MESSAGE("Go! Wobbuffet!"); + } + } THEN { + EXPECT_EQ(lostHp, atkStat); + } +} From ecba468a96fc6517f46b5c78213f3e24bceaf5e4 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Fri, 29 Dec 2023 08:03:42 -0600 Subject: [PATCH 23/24] Fix item effect for SV evolution items (#3858) Co-authored-by: Bassoonian --- src/data/pokemon/item_effects.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/pokemon/item_effects.h b/src/data/pokemon/item_effects.h index 2c7401059e..e129d9505a 100644 --- a/src/data/pokemon/item_effects.h +++ b/src/data/pokemon/item_effects.h @@ -626,6 +626,9 @@ const u8 *const gItemEffectTable[ITEMS_COUNT] = [ITEM_BLACK_AUGURITE] = gItemEffect_EvoItem, [ITEM_LINKING_CORD] = gItemEffect_EvoItem, [ITEM_PEAT_BLOCK] = gItemEffect_EvoItem, + [ITEM_SYRUPY_APPLE] = gItemEffect_EvoItem, + [ITEM_UNREMARKABLE_TEACUP] = gItemEffect_EvoItem, + [ITEM_MASTERPIECE_TEACUP] = gItemEffect_EvoItem, // Berries [ITEM_CHERI_BERRY] = gItemEffect_CheriBerry, From 245026353d79469c4bd91a4755705da125be54c8 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 29 Dec 2023 19:59:14 +0100 Subject: [PATCH 24/24] Remove leftover TID placeholder move defines (#3864) --- data/battle_anim_scripts.s | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 70e3018094..0611dee786 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -16993,21 +16993,6 @@ Move_MALIGNANT_CHAIN:: Move_NONE: Move_MIRROR_MOVE: Move_POUND: -Move_833: -Move_834: -Move_835: -Move_836: -Move_837: -Move_838: -Move_839: -Move_840: -Move_841: -Move_842: -Move_843: -Move_844: -Move_845: -Move_846: -Move_847: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_TARGET setalpha 12, 8