From 88575795199f65b4554a39019dd34a032518ac07 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 20 Jul 2020 12:20:25 -0600 Subject: [PATCH 001/133] add stair warps --- include/constants/metatile_behaviors.h | 8 +- include/field_screen_effect.h | 2 + include/global.fieldmap.h | 1 + include/metatile_behavior.h | 5 + src/field_control_avatar.c | 28 +++- src/field_player_avatar.c | 8 + src/field_screen_effect.c | 211 +++++++++++++++++++++++++ src/metatile_behavior.c | 48 +++++- src/overworld.c | 4 + 9 files changed, 302 insertions(+), 13 deletions(-) diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffcaa..59ed97d079 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -236,10 +236,10 @@ #define MB_WIRELESS_BOX_RESULTS 0xE8 #define MB_TRAINER_HILL_TIMER 0xE9 #define MB_SKY_PILLAR_CLOSED_DOOR 0xEA -#define MB_UNUSED_EB 0xEB -#define MB_UNUSED_EC 0xEC -#define MB_UNUSED_ED 0xED -#define MB_UNUSED_EE 0xEE +#define MB_UP_RIGHT_STAIR_WARP 0xEB +#define MB_UP_LEFT_STAIR_WARP 0xEC +#define MB_DOWN_RIGHT_STAIR_WARP 0xED +#define MB_DOWN_LEFT_STAIR_WARP 0xEE #define MB_UNUSED_EF 0xEF #endif // GUARD_METATILE_BEHAVIORS diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h index e05e30378a..0f97bdc3f3 100644 --- a/include/field_screen_effect.h +++ b/include/field_screen_effect.h @@ -40,5 +40,7 @@ void FadeOutOrbEffect(void); void sub_80B05B4(void); void WriteFlashScanlineEffectBuffer(u8 flashLevel); bool8 IsPlayerStandingStill(void); +void DoStairWarp(u16 metatileBehavior, u16 delay); +bool8 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection); #endif // GUARD_FIELD_SCREEN_EFFECT_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 59610f9adb..a3ef192b77 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -283,6 +283,7 @@ enum COLLISION_ISOLATED_HORIZONTAL_RAIL, COLLISION_VERTICAL_RAIL, COLLISION_HORIZONTAL_RAIL, + COLLISION_STAIR_WARP, }; // player running states diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index b5dae6de09..a801d8b27b 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -145,5 +145,10 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); +bool8 MetatileBehavior_IsDirectionalUpRightStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalUpLeftStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalDownRightStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalDownLeftStairWarp(u8 metatileBehavior); +bool8 MetatileBehavior_IsDirectionalStairWarp(u8 metatileBehavior); #endif // GUARD_METATILE_BEHAVIOR diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index e41b5a69a5..a5beff0930 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -689,13 +689,31 @@ static bool8 CheckStandardWildEncounter(u16 metatileBehavior) static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction) { s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); + u16 delay; - if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE && warpEventId != -1) + if (warpEventId != -1) { - StoreInitialPlayerAvatarState(); - SetupWarp(&gMapHeader, warpEventId, position); - DoWarp(); - return TRUE; + if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE) + { + StoreInitialPlayerAvatarState(); + SetupWarp(&gMapHeader, warpEventId, position); + DoWarp(); + return TRUE; + } + else if (IsDirectionalStairWarpMetatileBehavior(metatileBehavior, direction) == TRUE) + { + delay = 0; + if (gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE)) + { + SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT); + delay = 12; + } + + StoreInitialPlayerAvatarState(); + SetupWarp(&gMapHeader, warpEventId, position); + DoStairWarp(metatileBehavior, delay); + return TRUE; + } } return FALSE; } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index f5f6e99f7d..dae437d629 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -6,6 +6,7 @@ #include "field_camera.h" #include "field_effect.h" #include "field_effect_helpers.h" +#include "field_screen_effect.h" #include "field_player_avatar.h" #include "fieldmap.h" #include "menu.h" @@ -625,6 +626,10 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) PlayerNotOnBikeCollideWithFarawayIslandMew(direction); return; } + else if (collision == COLLISION_STAIR_WARP) + { + PlayerFaceDirection(direction); + } else { u8 adjustedCollision = collision - COLLISION_STOP_SURFING; @@ -661,6 +666,9 @@ static u8 CheckForPlayerAvatarCollision(u8 direction) x = playerObjEvent->currentCoords.x; y = playerObjEvent->currentCoords.y; + if (IsDirectionalStairWarpMetatileBehavior(MapGridGetMetatileBehaviorAt(x, y), direction)) + return COLLISION_STAIR_WARP; + MoveCoords(direction, &x, &y); return CheckForObjectEventCollision(playerObjEvent, x, y, direction, MapGridGetMetatileBehaviorAt(x, y)); } diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 53057fc31d..6d9269915e 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -49,6 +49,7 @@ static void task0A_mpl_807E31C(u8 taskId); static void Task_WarpAndLoadMap(u8 taskId); static void Task_DoDoorWarp(u8 taskId); static void Task_EnableScriptAfterMusicFade(u8 taskId); +static void Task_ExitStairs(u8 taskId); // const static const u16 sFlashLevelPixelRadii[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 }; @@ -266,6 +267,8 @@ static void SetUpWarpExitTask(void) behavior = MapGridGetMetatileBehaviorAt(x, y); if (MetatileBehavior_IsDoor(behavior) == TRUE) func = Task_ExitDoor; + else if (MetatileBehavior_IsDirectionalStairWarp(behavior) == TRUE) + func = Task_ExitStairs; else if (MetatileBehavior_IsNonAnimDoor(behavior) == TRUE) func = Task_ExitNonAnimDoor; else @@ -1267,3 +1270,211 @@ static void Task_EnableScriptAfterMusicFade(u8 taskId) EnableBothScriptContexts(); } } + +//stair warps +static void GetStairsMovementDirection(u8 a0, s16 *a1, s16 *a2) +{ + if (MetatileBehavior_IsDirectionalUpRightStairWarp(a0)) + { + *a1 = 16; + *a2 = -10; + } + else if (MetatileBehavior_IsDirectionalUpLeftStairWarp(a0)) + { + *a1 = -17; + *a2 = -10; + } + else if (MetatileBehavior_IsDirectionalDownRightStairWarp(a0)) + { + *a1 = 17; + *a2 = 3; + } + else if (MetatileBehavior_IsDirectionalDownLeftStairWarp(a0)) + { + *a1 = -17; + *a2 = 3; + } + else + { + *a1 = 0; + *a2 = 0; + } +} + +static bool8 WaitStairExitMovementFinished(s16 *a0, s16 *a1, s16 *a2, s16 *a3, s16 *a4) +{ + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + if (*a4 != 0) + { + *a2 += *a0; + *a3 += *a1; + sprite->pos2.x = *a2 >> 5; + sprite->pos2.y = *a3 >> 5; + (*a4)--; + return TRUE; + } + else + { + sprite->pos2.x = 0; + sprite->pos2.y = 0; + return FALSE; + } +} + +static void ExitStairsMovement(s16 *a0, s16 *a1, s16 *a2, s16 *a3, s16 *a4) +{ + s16 x, y; + u8 behavior; + s32 r1; + struct Sprite *sprite; + + PlayerGetDestCoords(&x, &y); + behavior = MapGridGetMetatileBehaviorAt(x, y); + if (MetatileBehavior_IsDirectionalDownRightStairWarp(behavior) || MetatileBehavior_IsDirectionalUpRightStairWarp(behavior)) + r1 = 3; + else + r1 = 4; + + ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceSlowMovementAction(r1)); + GetStairsMovementDirection(behavior, a0, a1); + *a2 = *a0 * 16; + *a3 = *a1 * 16; + *a4 = 16; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->pos2.x = *a2 >> 5; + sprite->pos2.y = *a3 >> 5; + *a0 *= -1; + *a1 *= -1; +} + +static void Task_ExitStairs(u8 taskId) +{ + s16 * data = gTasks[taskId].data; + switch (data[0]) + { + default: + if (WaitForWeatherFadeIn() == TRUE) + { + CameraObjectReset1(); + ScriptContext2_Disable(); + DestroyTask(taskId); + } + break; + case 0: + Overworld_PlaySpecialMapMusic(); + WarpFadeInScreen(); + ScriptContext2_Enable(); + ExitStairsMovement(&data[1], &data[2], &data[3], &data[4], &data[5]); + data[0]++; + break; + case 1: + if (!WaitStairExitMovementFinished(&data[1], &data[2], &data[3], &data[4], &data[5])) + data[0]++; + break; + } +} + +bool8 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection) +{ + switch (playerDirection) + { + case DIR_WEST: + if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) + return TRUE; + break; + case DIR_EAST: + if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) + return TRUE; + break; + } + return FALSE; +} + +static void ForceStairsMovement(u16 a0, s16 *a1, s16 *a2) +{ + ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); + GetStairsMovementDirection(a0, a1, a2); +} + +static void UpdateStairsMovement(s16 a0, s16 a1, s16 *a2, s16 *a3, s16 *a4) +{ + struct Sprite *playerSpr = &gSprites[gPlayerAvatar.spriteId]; + struct ObjectEvent *playerObj = &gObjectEvents[gPlayerAvatar.objectEventId]; + + if (a1 > 0 || *a4 > 6) + *a3 += a1; + + *a2 += a0; + (*a4)++; + playerSpr->pos2.x = *a2 >> 5; + playerSpr->pos2.y = *a3 >> 5; + if (playerObj->heldMovementFinished) + ObjectEventForceSetHeldMovement(playerObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); +} + +static void Task_StairWarp(u8 taskId) +{ + s16 * data = gTasks[taskId].data; + struct ObjectEvent *playerObj = &gObjectEvents[gPlayerAvatar.objectEventId]; + struct Sprite *playerSpr = &gSprites[gPlayerAvatar.spriteId]; + + switch (data[0]) + { + case 0: + ScriptContext2_Enable(); + FreezeObjectEvents(); + CameraObjectReset2(); + data[0]++; + break; + case 1: + if (!ObjectEventIsMovementOverridden(playerObj) || ObjectEventClearHeldMovementIfFinished(playerObj)) + { + if (data[15] != 0) + data[15]--; + else + { + TryFadeOutOldMapMusic(); + PlayRainStoppingSoundEffect(); + playerSpr->oam.priority = 1; + ForceStairsMovement(data[1], &data[2], &data[3]); + PlaySE(SE_KAIDAN); + data[0]++; + } + } + break; + case 2: + UpdateStairsMovement(data[2], data[3], &data[4], &data[5], &data[6]); + data[15]++; + if (data[15] >= 12) + { + WarpFadeOutScreen(); + data[0]++; + } + break; + case 3: + UpdateStairsMovement(data[2], data[3], &data[4], &data[5], &data[6]); + if (!PaletteFadeActive() && BGMusicStopped()) + data[0]++; + break; + default: + gFieldCallback = FieldCB_DefaultWarpExit; + WarpIntoMap(); + SetMainCallback2(CB2_LoadMap); + DestroyTask(taskId); + break; + } +} + +void DoStairWarp(u16 metatileBehavior, u16 delay) +{ + u8 taskId = CreateTask(Task_StairWarp, 10); + gTasks[taskId].data[1] = metatileBehavior; + gTasks[taskId].data[15] = delay; + Task_StairWarp(taskId); +} + diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 435ad72336..782a49e36c 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -245,10 +245,10 @@ static const u8 sTileBitAttributes[] = [MB_WIRELESS_BOX_RESULTS] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_TRAINER_HILL_TIMER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_SKY_PILLAR_CLOSED_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_EB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_EC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_ED] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_EE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_UP_RIGHT_STAIR_WARP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_UP_LEFT_STAIR_WARP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_DOWN_RIGHT_STAIR_WARP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_DOWN_LEFT_STAIR_WARP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_UNUSED_EF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), }; @@ -1488,3 +1488,43 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) else return FALSE; } + +bool8 MetatileBehavior_IsDirectionalUpRightStairWarp(u8 metatileBehavior) +{ + if(metatileBehavior == MB_UP_RIGHT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalUpLeftStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_UP_LEFT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalDownRightStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_DOWN_RIGHT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalDownLeftStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior == MB_DOWN_LEFT_STAIR_WARP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsDirectionalStairWarp(u8 metatileBehavior) +{ + if (metatileBehavior >= MB_UP_RIGHT_STAIR_WARP && metatileBehavior <= MB_DOWN_LEFT_STAIR_WARP) + return TRUE; + else + return FALSE; +} diff --git a/src/overworld.c b/src/overworld.c index ea0d633bcf..dcf30af89f 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -962,6 +962,10 @@ static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStr return DIR_EAST; else if (MetatileBehavior_IsEastArrowWarp(metatileBehavior) == TRUE) return DIR_WEST; + else if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior) == TRUE || MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior) == TRUE) + return DIR_WEST; + else if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior) == TRUE || MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior) == TRUE) + return DIR_EAST; else if ((playerStruct->transitionFlags == PLAYER_AVATAR_FLAG_UNDERWATER && transitionFlags == PLAYER_AVATAR_FLAG_SURFING) || (playerStruct->transitionFlags == PLAYER_AVATAR_FLAG_SURFING && transitionFlags == PLAYER_AVATAR_FLAG_UNDERWATER )) return playerStruct->direction; From 11828238685cac8b2056902d50399fd082905141 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 23 Sep 2020 13:46:04 -0600 Subject: [PATCH 002/133] update stair warp SE --- src/field_screen_effect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index eccf9dc9d6..7c47075141 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1444,7 +1444,7 @@ static void Task_StairWarp(u8 taskId) PlayRainStoppingSoundEffect(); playerSpr->oam.priority = 1; ForceStairsMovement(data[1], &data[2], &data[3]); - PlaySE(SE_KAIDAN); + PlaySE(SE_EXIT); data[0]++; } } From dfce7f15489de5e94d9476dc76e33e2b60672130 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 1 Apr 2021 09:45:17 -0600 Subject: [PATCH 003/133] add auto read signposts --- data/event_scripts.s | 4 + .../primary/general/metatile_attributes.bin | Bin 1024 -> 1024 bytes include/constants/metatile_behaviors.h | 2 +- include/event_scripts.h | 2 + include/field_control_avatar.h | 1 + include/field_message_box.h | 2 + include/metatile_behavior.h | 1 + include/script.h | 8 ++ include/text_window.h | 1 + src/field_control_avatar.c | 124 +++++++++++++++++- src/field_message_box.c | 10 +- src/metatile_behavior.c | 8 +- src/overworld.c | 1 + src/scrcmd.c | 2 + src/script.c | 35 +++++ src/text_window.c | 9 ++ 16 files changed, 206 insertions(+), 4 deletions(-) diff --git a/data/event_scripts.s b/data/event_scripts.s index 8039be6876..886c55f71c 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -690,6 +690,10 @@ EventScript_BackupMrBrineyLocation:: @ 8271E95 .include "data/scripts/rival_graphics.inc" .include "data/scripts/set_gym_trainers.inc" +EventScript_CancelMessageBox:: + release + end + Common_EventScript_ShowBagIsFull:: @ 8272054 msgbox gText_TooBadBagIsFull, MSGBOX_DEFAULT release diff --git a/data/tilesets/primary/general/metatile_attributes.bin b/data/tilesets/primary/general/metatile_attributes.bin index d9cd29016d792fb568494dbf2f820100081a14f8..af9326451d561c4103afe500c5ae8c7656092fc6 100644 GIT binary patch delta 21 ZcmZqRXy9OH00Y^H?D~wd8_iEL0{|lp1I_>d delta 21 YcmZqRXy9OHfPjhY`iu-4%}+7|03liflmGw# diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffcaa..cd2f70fe0f 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -30,7 +30,7 @@ #define MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2 0x1A #define MB_STAIRS_OUTSIDE_ABANDONED_SHIP 0x1B #define MB_SHOAL_CAVE_ENTRANCE 0x1C -#define MB_UNUSED_1D 0x1D +#define MB_SIGNPOST 0x1D #define MB_UNUSED_1E 0x1E #define MB_UNUSED_1F 0x1F #define MB_ICE 0x20 diff --git a/include/event_scripts.h b/include/event_scripts.h index 79ef0ea142..eff980f138 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -610,4 +610,6 @@ extern const u8 EventScript_TradeCenter_Chair0[]; extern const u8 EventScript_ConfirmLeaveTradeRoom[]; extern const u8 EventScript_TerminateLink[]; +extern const u8 EventScript_CancelMessageBox[]; + #endif // GUARD_EVENT_SCRIPTS_H diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index 17e5afb63e..e6c90e8e5b 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -40,5 +40,6 @@ u8 TrySetDiveWarp(void); const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatileBehavior, u8 direction); u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position); void ClearPoisonStepCounter(void); +void FieldInput_HandleCancelSignpost(struct FieldInput *input); #endif // GUARD_FIELDCONTROLAVATAR_H diff --git a/include/field_message_box.h b/include/field_message_box.h index 34b3324e72..eed6c7a9c0 100644 --- a/include/field_message_box.h +++ b/include/field_message_box.h @@ -19,4 +19,6 @@ u8 GetFieldMessageBoxMode(void); void StopFieldMessage(void); void InitFieldMessageBox(void); +extern u8 gWalkAwayFromSignInhibitTimer; + #endif // GUARD_FIELD_MESSAGE_BOX_H diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index d4bd9e6832..886422e63e 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -145,5 +145,6 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); +bool8 MetatileBehavior_IsSignpost(u8 mb); #endif // GUARD_METATILE_BEHAVIOR diff --git a/include/script.h b/include/script.h index 63f6f5aef9..92309eb653 100644 --- a/include/script.h +++ b/include/script.h @@ -62,4 +62,12 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize); // srccmd.h void SetMovingNpcId(u16 npcId); +// auto read signs +void SetWalkingIntoSignVars(void); +void MsgSetSignPost(void); +void ResetFacingNpcOrSignPostVars(void); +bool32 IsMsgSignPost(void); +bool32 CanWalkAwayToCancelMsgBox(void); +void ClearMsgBoxCancelableState(void); + #endif // GUARD_SCRIPT_H diff --git a/include/text_window.h b/include/text_window.h index 7bdcacd17c..d6bf83e0b3 100644 --- a/include/text_window.h +++ b/include/text_window.h @@ -23,5 +23,6 @@ void rbox_fill_rectangle(u8 windowId); const u16 *GetTextWindowPalette(u8 id); const u16 *GetOverworldTextboxPalettePtr(void); void sub_8098C6C(u8 bg, u16 destOffset, u8 palOffset); +void LoadSignPostWindowFrameGfx(void); #endif // GUARD_TEXT_WINDOW_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 6ec280fd0d..16e334f429 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -9,6 +9,7 @@ #include "event_scripts.h" #include "fieldmap.h" #include "field_control_avatar.h" +#include "field_message_box.h" #include "field_player_avatar.h" #include "field_poison.h" #include "field_screen_effect.h" @@ -41,6 +42,13 @@ static EWRAM_DATA u16 sPreviousPlayerMetatileBehavior = 0; u8 gSelectedObjectEvent; +#define SIGNPOST_POKECENTER 0 +#define SIGNPOST_POKEMART 1 +#define SIGNPOST_INDIGO_1 2 +#define SIGNPOST_INDIGO_2 3 +#define SIGNPOST_SCRIPTED 240 +#define SIGNPOST_NA 255 + static void GetPlayerPosition(struct MapPosition *); static void GetInFrontOfPlayerPosition(struct MapPosition *); static u16 GetPlayerCurMetatileBehavior(int); @@ -69,6 +77,10 @@ static bool8 TryStartMiscWalkingScripts(u16); static bool8 TryStartStepCountScript(u16); static void UpdateFriendshipStepCounter(void); static bool8 UpdatePoisonStepCounter(void); +static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition * position, u16 metatileBehavior, u8 playerDirection); +static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection); +static u8 GetFacingSignpostType(u16 metatileBehvaior, u8 direction); +static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition * position); void FieldClearPlayerInput(struct FieldInput *input) { @@ -140,7 +152,8 @@ int ProcessPlayerFieldInput(struct FieldInput *input) gSpecialVar_LastTalked = 0; gSelectedObjectEvent = 0; - + + ResetFacingNpcOrSignPostVars(); playerDirection = GetPlayerFacingDirection(); GetPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); @@ -160,6 +173,20 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (TryStartStepBasedScript(&position, metatileBehavior, playerDirection) == TRUE) return TRUE; } + + if (input->checkStandardWildEncounter) + { + if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) + { + GetInFrontOfPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + GetPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + } + } + if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileBehavior) == TRUE) return TRUE; if (input->heldDirection && input->dpadDirection == playerDirection) @@ -170,6 +197,13 @@ int ProcessPlayerFieldInput(struct FieldInput *input) GetInFrontOfPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + + if (input->heldDirection && input->dpadDirection == playerDirection) + { + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + } + if (input->pressedAButton && TryStartInteractionScript(&position, metatileBehavior, playerDirection) == TRUE) return TRUE; @@ -1005,3 +1039,91 @@ int SetCableClubWarp(void) SetupWarp(&gMapHeader, GetWarpEventAtMapPosition(&gMapHeader, &position), &position); return 0; } + +// auto read signposts +// signposts +static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 metatileBehavior, u8 playerDirection) +{ + u8 signpostType; + const u8 *script; + + if (JOY_HELD(DPAD_LEFT | DPAD_RIGHT)) + return FALSE; + if (playerDirection != DIR_NORTH) + return FALSE; + + switch (GetFacingSignpostType(metatileBehavior, playerDirection)) + { + /* leaving this commented out for examples of custom signpost types + case SIGNPOST_POKECENTER: + SetUpWalkIntoSignScript(EventScript_PokecenterSign, playerDirection); + return TRUE; + case SIGNPOST_POKEMART: + SetUpWalkIntoSignScript(EventScript_PokemartSign, playerDirection); + return TRUE;*/ + case SIGNPOST_SCRIPTED: + script = GetSignpostScriptAtMapPosition(position); + if (script == NULL) + return FALSE; + SetUpWalkIntoSignScript(script, playerDirection); + return TRUE; + default: + return FALSE; + } +} + +static u8 GetFacingSignpostType(u16 metatileBehavior, u8 playerDirection) +{ + /*if (MetatileBehavior_IsPlayerFacingPokemonCenterSign(metatileBehavior, playerDirection) == TRUE) + return SIGNPOST_POKECENTER; + if (MetatileBehavior_IsPlayerFacingPokeMartSign(metatileBehavior, playerDirection) == TRUE) + return SIGNPOST_POKEMART;*/ + + if (MetatileBehavior_IsSignpost(metatileBehavior) == TRUE) + return SIGNPOST_SCRIPTED; + + return SIGNPOST_NA; +} + +static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection) +{ + gSpecialVar_Facing = playerDirection; + ScriptContext1_SetupScript(script); + SetWalkingIntoSignVars(); + MsgSetSignPost(); +} + +static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) +{ + const struct BgEvent *event = GetBackgroundEventAtPosition(&gMapHeader, position->x - 7, position->y - 7, position->height); + if (event == NULL) + return NULL; + if (event->bgUnion.script != NULL) + return event->bgUnion.script; + return EventScript_TestSignpostMsg; +} + +void FieldInput_HandleCancelSignpost(struct FieldInput *input) +{ + if (ScriptContext1_IsScriptSetUp() == TRUE) + { + if (gWalkAwayFromSignInhibitTimer != 0) + { + gWalkAwayFromSignInhibitTimer--; + } + else if (CanWalkAwayToCancelMsgBox() == TRUE) + { + //ClearMsgBoxCancelableState(); + if (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection) + { + ScriptContext1_SetupScript(EventScript_CancelMessageBox); + ScriptContext2_Enable(); + } + else if (input->pressedStartButton) + { + ScriptContext1_SetupScript(EventScript_CancelMessageBox); + ScriptContext2_Enable(); + } + } + } +} diff --git a/src/field_message_box.c b/src/field_message_box.c index 69d470b84e..9bb1bd52c4 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -5,8 +5,11 @@ #include "text.h" #include "match_call.h" #include "field_message_box.h" +#include "text_window.h" +#include "script.h" static EWRAM_DATA u8 sFieldMessageBoxMode = 0; +EWRAM_DATA u8 gWalkAwayFromSignInhibitTimer = 0; static void ExpandStringAndStartDrawFieldMessage(const u8*, bool32); static void StartDrawFieldMessage(void); @@ -29,7 +32,12 @@ static void Task_DrawFieldMessage(u8 taskId) switch (task->tState) { case 0: - LoadMessageBoxAndBorderGfx(); + if (IsMsgSignPost()) + LoadSignPostWindowFrameGfx(); + else + LoadMessageBoxAndBorderGfx(); + task->tState++; + break; task->tState++; break; case 1: diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 2a9304a4d8..4656e94b0f 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -39,7 +39,7 @@ static const u8 sTileBitAttributes[] = [MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_SHOAL_CAVE_ENTRANCE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_UNUSED_1D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIGNPOST] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_UNUSED_1E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_UNUSED_1F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_ICE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), @@ -1495,3 +1495,9 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) else return FALSE; } + +bool8 MetatileBehavior_IsSignpost(u8 mb) +{ + return (mb == MB_SIGNPOST); +} + diff --git a/src/overworld.c b/src/overworld.c index 9d5e40fb37..7082eb078c 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1422,6 +1422,7 @@ static void DoCB1_Overworld(u16 newKeys, u16 heldKeys) UpdatePlayerAvatarTransitionState(); FieldClearPlayerInput(&inputStruct); FieldGetPlayerInput(&inputStruct, newKeys, heldKeys); + FieldInput_HandleCancelSignpost(&inputStruct); if (!ScriptContext2_IsEnabled()) { if (ProcessPlayerFieldInput(&inputStruct) == 1) diff --git a/src/scrcmd.c b/src/scrcmd.c index 7dc02b6a8f..710a58c246 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1248,6 +1248,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); + ClearMsgBoxCancelableState(); return FALSE; } @@ -1262,6 +1263,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); + ClearMsgBoxCancelableState(); return FALSE; } diff --git a/src/script.c b/src/script.c index 726c065439..977298f833 100644 --- a/src/script.c +++ b/src/script.c @@ -3,6 +3,7 @@ #include "event_data.h" #include "mevent.h" #include "util.h" +#include "field_message_box.h" #include "constants/map_scripts.h" #define RAM_SCRIPT_MAGIC 51 @@ -19,6 +20,8 @@ static u8 sScriptContext1Status; static struct ScriptContext sScriptContext1; static struct ScriptContext sScriptContext2; static bool8 sScriptContext2Enabled; +static u8 sMsgIsSignPost; +static u8 sMsgBoxIsCancelable; extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTableEnd[]; @@ -444,3 +447,35 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize) scriptSize = sizeof(gSaveBlock1Ptr->ramScript.data.script); InitRamScript(script, scriptSize, 0xFF, 0xFF, 0xFF); } + +// auto read signposts +void SetWalkingIntoSignVars(void) +{ + gWalkAwayFromSignInhibitTimer = 6; + sMsgBoxIsCancelable = TRUE; +} + +bool32 IsMsgSignPost(void) +{ + return sMsgIsSignPost; +} + +void ResetFacingNpcOrSignPostVars(void) +{ + sMsgIsSignPost = FALSE; +} + +void MsgSetSignPost(void) +{ + sMsgIsSignPost = TRUE; +} + +void ClearMsgBoxCancelableState(void) +{ + sMsgBoxIsCancelable = FALSE; +} + +bool32 CanWalkAwayToCancelMsgBox(void) +{ + return sMsgBoxIsCancelable; +} diff --git a/src/text_window.c b/src/text_window.c index 864bd08316..7d59ce2d35 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -5,6 +5,7 @@ #include "palette.h" #include "bg.h" #include "graphics.h" +#include "menu.h" // const rom data const u8 gTextWindowFrame1_Gfx[] = INCBIN_U8("graphics/text_window/1.4bpp"); @@ -195,3 +196,11 @@ void sub_8098C6C(u8 bg, u16 destOffset, u8 palOffset) LoadBgTiles(bg, sWindowFrames[gSaveBlock2Ptr->optionsWindowFrameType].tiles, 0x120, destOffset); LoadPalette(GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->pal, palOffset, 0x20); } + +void LoadSignPostWindowFrameGfx(void) +{ + // TODO signpost msgbox frames + //LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUnknown_8470B0C, 0x260, destOffset); + //LoadPalette(GetWindowFrameTilesPal(1), palIdx, 32); + LoadMessageBoxAndBorderGfx(); +} From 33dfa321b04420e8b213408dde0afbf07a647587 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 31 May 2020 23:16:15 -0600 Subject: [PATCH 004/133] init branch --- include/constants/metatile_behaviors.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffcaa..7fe10a7d20 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -236,10 +236,14 @@ #define MB_WIRELESS_BOX_RESULTS 0xE8 #define MB_TRAINER_HILL_TIMER 0xE9 #define MB_SKY_PILLAR_CLOSED_DOOR 0xEA -#define MB_UNUSED_EB 0xEB -#define MB_UNUSED_EC 0xEC -#define MB_UNUSED_ED 0xED -#define MB_UNUSED_EE 0xEE -#define MB_UNUSED_EF 0xEF + +//sideways stairs +#define MB_SIDEWAYS_STAIRS_0 0xEB +#define MB_SIDEWAYS_STAIRS_1 0xEC +#define MB_SIDEWAYS_STAIRS_2 0xED +#define MB_SIDEWAYS_STAIRS_3 0xEE +#define MB_SIDEWAYS_STAIRS_4 0xEF +#define MB_SIDEWAYS_STAIRS_5 0xF0 + #endif // GUARD_METATILE_BEHAVIORS From 31e9f97d52d4b82b9e75b4a86c699ea57d463fdf Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 3 Jun 2020 14:23:28 -0600 Subject: [PATCH 005/133] cherry pick 4eb7fcc261934c0f9f10985761cd3e7b7abf0dab --- include/constants/event_object_movement.h | 24 + include/constants/metatile_behaviors.h | 19 +- include/event_object_movement.h | 12 + include/field_player_avatar.h | 10 + include/global.fieldmap.h | 5 + include/metatile_behavior.h | 4 + src/bike.c | 75 ++- .../movement_action_func_tables.h | 156 +++++++ src/event_object_movement.c | 441 ++++++++++++++++-- src/field_player_avatar.c | 198 +++++++- src/metatile_behavior.c | 30 +- 11 files changed, 909 insertions(+), 65 deletions(-) diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 2236500810..9bd3e87c6c 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H #define GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H +#define SLOW_MOVEMENT_ON_STAIRS TRUE // change to false to keep emerald's normal movement speed on outdoor stairs + #define MOVEMENT_TYPE_NONE 0x0 #define MOVEMENT_TYPE_LOOK_AROUND 0x1 #define MOVEMENT_TYPE_WANDER_AROUND 0x2 @@ -241,6 +243,28 @@ #define MOVEMENT_ACTION_FIGURE_8 0x9B #define MOVEMENT_ACTION_FLY_UP 0x9C #define MOVEMENT_ACTION_FLY_DOWN 0x9D +// slow running (for stairs) +#define MOVEMENT_ACTION_RUN_DOWN_SLOW 0x9E +#define MOVEMENT_ACTION_RUN_UP_SLOW 0x9F +#define MOVEMENT_ACTION_RUN_LEFT_SLOW 0xA0 +#define MOVEMENT_ACTION_RUN_RIGHT_SLOW 0xA1 +// sideways stairs - walking +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT 0xA2 +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT 0xA3 +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT 0xA4 +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT 0xA5 +// sideways stairs - running +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING 0xA6 +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING 0xA7 +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING 0xA8 +#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING 0xA9 +// sideways stairs - acro bike +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT 0xAA +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT 0xAB +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT 0xAC +#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT 0xAD +//sideways stairs - mach bike + #define MOVEMENT_ACTION_STEP_END 0xFE diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 7fe10a7d20..ef79f0b6d3 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -74,9 +74,9 @@ #define MB_SLIDE_NORTH 0x46 #define MB_SLIDE_SOUTH 0x47 #define MB_TRICK_HOUSE_PUZZLE_8_FLOOR 0x48 -#define MB_UNUSED_49 0x49 -#define MB_UNUSED_4A 0x4A -#define MB_UNUSED_4B 0x4B +#define MB_SIDEWAYS_STAIRS_RIGHT 0x49 +#define MB_SIDEWAYS_STAIRS_LEFT 0x4A +#define MB_ROCK_STAIRS 0x4B #define MB_UNUSED_4C 0x4C #define MB_UNUSED_4D 0x4D #define MB_UNUSED_4E 0x4E @@ -236,14 +236,11 @@ #define MB_WIRELESS_BOX_RESULTS 0xE8 #define MB_TRAINER_HILL_TIMER 0xE9 #define MB_SKY_PILLAR_CLOSED_DOOR 0xEA - -//sideways stairs -#define MB_SIDEWAYS_STAIRS_0 0xEB -#define MB_SIDEWAYS_STAIRS_1 0xEC -#define MB_SIDEWAYS_STAIRS_2 0xED -#define MB_SIDEWAYS_STAIRS_3 0xEE -#define MB_SIDEWAYS_STAIRS_4 0xEF -#define MB_SIDEWAYS_STAIRS_5 0xF0 +#define MB_UNUSED_EB 0xEB +#define MB_UNUSED_EC 0xEC +#define MB_UNUSED_ED 0xED +#define MB_UNUSED_EE 0xEE +#define MB_UNUSED_EF 0xEF #endif // GUARD_METATILE_BEHAVIORS diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 1e754dcd93..e8f8df1a4b 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -428,4 +428,16 @@ void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId); void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum); bool32 IsObjectEventSpriteAnimating(u8 objectEventId); +// run slow +u8 GetPlayerRunSlowMovementAction(u32); +//sideways stairs +u8 GetSidewaysStairsToRightDirection(s16, s16, u8); +u8 GetSidewaysStairsToLeftDirection(s16, s16, u8); +u8 GetDiagonalRightStairsMovement(u32); +u8 GetDiagonalLeftStairsMovement(u32); +u8 GetDiagonalRightStairsRunningMovement(u32); +u8 GetDiagonalLeftStairsRunningMovement(u32); +u8 GetDiagonalLeftAcroBikeMovement(u32); +u8 GetDiagonalRightAcroBikeMovement(u32); + #endif //GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index c30ce0b6fb..3177a887ce 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -64,5 +64,15 @@ bool32 IsPlayerSpinExitActive(void); void SetPlayerInvisibility(bool8 invisible); u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); void StartFishing(u8 rod); +bool32 PlayerIsMovingOnRockStairs(u8 direction); +//sideways stairs +u8 GetRightStairsDirection(u8 direction); +u8 GetLeftStairsDirection(u8 direction); +void PlayerSidewaysStairsToRight(u8 direction); +void PlayerSidewaysStairsToLeft(u8 direction); +void PlayerSidewaysStairsToRightRunning(u8 direction); +void PlayerSidewaysStairsToLeftRunning(u8 direction); +void PlayerSidewaysStairsToAcroBikeLeft(u8 direction); +void PlayerSidewaysStairsToAcroBikeRight(u8 direction); #endif // GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index c4d7be35da..baedb9bf37 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -278,6 +278,11 @@ enum COLLISION_ISOLATED_HORIZONTAL_RAIL, COLLISION_VERTICAL_RAIL, COLLISION_HORIZONTAL_RAIL, + //sideways_stairs + COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING, + COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING, + COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_RUNNING, + COLLISION_SIDEWAYS_STAIRS_TO_LEFT_RUNNING, }; // player running states diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index d4bd9e6832..f5781a3371 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -145,5 +145,9 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); +bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior); +//sideways stairs +bool8 MetatileBehavior_IsSidewaysStairsRight(u8); +bool8 MetatileBehavior_IsSidewaysStairsLeft(u8); #endif // GUARD_METATILE_BEHAVIOR diff --git a/src/bike.c b/src/bike.c index bbcda989c9..18dbda6ba3 100644 --- a/src/bike.c +++ b/src/bike.c @@ -179,6 +179,9 @@ static u8 GetMachBikeTransition(u8 *dirTraveling) // the difference between face direction and turn direction is that one changes direction while the other does the animation of turning as well as changing direction. static void MachBikeTransition_FaceDirection(u8 direction) { + //if (direction > DIR_EAST) + // direction -= DIR_EAST; + PlayerFaceDirection(direction); Bike_SetBikeStill(); } @@ -187,6 +190,9 @@ static void MachBikeTransition_TurnDirection(u8 direction) { struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + //if (direction > DIR_EAST) + // direction -= DIR_EAST; + if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior)) { PlayerTurnInPlace(direction); @@ -194,6 +200,9 @@ static void MachBikeTransition_TurnDirection(u8 direction) } else { + //if (playerObjEvent->facingDirection > DIR_EAST) + // playerObjEvent->facingDirection -= DIR_EAST; + MachBikeTransition_FaceDirection(playerObjEvent->facingDirection); } } @@ -231,9 +240,28 @@ static void MachBikeTransition_TrySpeedUp(u8 direction) PlayerOnBikeCollide(direction); } } + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + { + gPlayerAvatar.bikeFrameCounter = 0; + gPlayerAvatar.bikeSpeed = SPEED_STANDING; + PlayerGoSpeed2(GetLeftStairsDirection(direction)); + //PlayerSidewaysStairsToAcroBikeLeft(direction); + return; + } + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + { + gPlayerAvatar.bikeFrameCounter = 0; + gPlayerAvatar.bikeSpeed = SPEED_STANDING; + //PlayerSidewaysStairsToAcroBikeRight(direction); + PlayerGoSpeed2(GetRightStairsDirection(direction)); + return; + } else { - // we did not hit anything that can slow us down, so perform the advancement callback depending on the bikeFrameCounter and try to increase the mach bike's speed. + // to do: this sometimes crashes based on the metatile behaviours (eg. holding up while traveling down sideways stairs to sw) + if (PlayerIsMovingOnRockStairs(direction)) + gPlayerAvatar.bikeFrameCounter--; + sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction); gPlayerAvatar.bikeSpeed = gPlayerAvatar.bikeFrameCounter + (gPlayerAvatar.bikeFrameCounter >> 1); // same as dividing by 2, but compiler is insistent on >> 1 if (gPlayerAvatar.bikeFrameCounter < 2) // do not go faster than the last element in the mach bike array @@ -268,6 +296,18 @@ static void MachBikeTransition_TrySlowDown(u8 direction) } else { + /* + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + { + return PlayerGoSpeed2(GetLeftStairsDirection(direction)); + //return PlayerSidewaysStairsToLeftMachBike(direction); + } + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + { + return PlayerGoSpeed2(GetRightStairsDirection(direction)); + //return PlayerSidewaysStairsToRightMachBike(direction); + }*/ + sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction); } } @@ -563,7 +603,27 @@ static void AcroBikeTransition_Moving(u8 direction) } else { - PlayerRideWaterCurrent(direction); + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + return PlayerGoSpeed2(GetRightStairsDirection(direction)); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + return PlayerGoSpeed2(GetLeftStairsDirection(direction)); + + if (PlayerIsMovingOnRockStairs(direction)) + PlayerGoSpeed2(direction); + else + PlayerRideWaterCurrent(direction); + + /* works, but might be better to keep rock stairs to up/down for mach bike + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + direction = GetRightStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + direction = GetLeftStairsDirection(direction); + + if (PlayerIsMovingOnRockStairs(direction)) + PlayerGoSpeed2(direction); + else + PlayerRideWaterCurrent(direction); + */ } } @@ -632,6 +692,11 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction) else { derp: + /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + direction = GetLeftStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + direction = GetRightStairsDirection(direction); + */ PlayerMovingHoppingWheelie(direction); } } @@ -699,6 +764,12 @@ static void AcroBikeTransition_WheelieMoving(u8 direction) } return; } + + /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + direction = GetLeftStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + direction = GetRightStairsDirection(direction);*/ + PlayerWheelieMove(direction); gPlayerAvatar.runningState = MOVING; } diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 8cf7d1699f..cc1b522159 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -261,6 +261,26 @@ u8 MovementAction_FlyUp_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_Fly_Finish(struct ObjectEvent *, struct Sprite *); u8 MovementAction_FlyDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_FlyDown_Step1(struct ObjectEvent *, struct Sprite *); +//slow running +u8 MovementActionFunc_RunSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); +u8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite); +//sideways stairs +u8 MovementAction_WalkStairDiagonalUpLeft_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkStairDiagonalUpRight_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkStairDiagonalDownLeft_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_WalkStairDiagonalDownRight_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_RunStairDiagonalUpLeft_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_RunStairDiagonalUpRight_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_RunStairDiagonalDownLeft_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_RunStairDiagonalDownRight_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_RunStairDiagonal_Step1(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_AcroBikeDiagonalUpLeft_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_AcroBikeDiagonalDownLeft_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_AcroBikeDiagonalUpRight_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_AcroBikeDiagonalDownRight_Step0(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FaceUp[])(struct ObjectEvent *, struct Sprite *); @@ -420,6 +440,24 @@ u8 (*const gMovementActionFuncs_DestroyExtraTaskIfAtTop[])(struct ObjectEvent *, u8 (*const gMovementActionFuncs_Figure8[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FlyUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FlyDown[])(struct ObjectEvent *, struct Sprite *); +//run slow +u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Sprite *); +//sideways stairs +u8 (*const gMovementActionFuncs_WalkStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_WalkStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_RunStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *); u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) = { [MOVEMENT_ACTION_FACE_DOWN] = gMovementActionFuncs_FaceDown, @@ -580,6 +618,24 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) [MOVEMENT_ACTION_FIGURE_8] = gMovementActionFuncs_Figure8, [MOVEMENT_ACTION_FLY_UP] = gMovementActionFuncs_FlyUp, [MOVEMENT_ACTION_FLY_DOWN] = gMovementActionFuncs_FlyDown, + //run slow + [MOVEMENT_ACTION_RUN_DOWN_SLOW] = gMovementActionFuncs_RunDownSlow, + [MOVEMENT_ACTION_RUN_UP_SLOW] = gMovementActionFuncs_RunUpSlow, + [MOVEMENT_ACTION_RUN_LEFT_SLOW] = gMovementActionFuncs_RunLeftSlow, + [MOVEMENT_ACTION_RUN_RIGHT_SLOW] = gMovementActionFuncs_RunRightSlow, + //sideways stairs + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT] = gMovementActionFuncs_WalkStairDiagonalUpLeft, + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT] = gMovementActionFuncs_WalkStairDiagonalUpRight, + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT] = gMovementActionFuncs_WalkStairDiagonalDownLeft, + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT] = gMovementActionFuncs_WalkStairDiagonalDownRight, + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING] = gMovementActionFuncs_RunStairDiagonalUpLeft, + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING] = gMovementActionFuncs_RunStairDiagonalUpRight, + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING] = gMovementActionFuncs_RunStairDiagonalDownLeft, + [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING] = gMovementActionFuncs_RunStairDiagonalDownRight, + [MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT] = gMovementActionFuncs_AcroBikeDiagonalUpLeft, + [MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT] = gMovementActionFuncs_AcroBikeDiagonalUpRight, + [MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT] = gMovementActionFuncs_AcroBikeDiagonalDownLeft, + [MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT] = gMovementActionFuncs_AcroBikeDiagonalDownRight, }; u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *) = { @@ -1511,3 +1567,103 @@ u8 (*const gMovementActionFuncs_DestroyExtraTaskIfAtTop[])(struct ObjectEvent *, MovementAction_DestroyExtraTaskIfAtTop_Step0, MovementAction_Finish, }; + +//slow running +u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowDown_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowUp_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowLeft_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Sprite *) = { + MovementActionFunc_RunSlowRight_Step0, + MovementActionFunc_RunSlow_Step1, + MovementAction_PauseSpriteAnim, +}; + +//sideways stairs +u8 (*const gMovementActionFuncs_WalkStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkStairDiagonalUpLeft_Step0, + MovementAction_WalkSlowDiagonalUpLeft_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_WalkStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkStairDiagonalUpRight_Step0, + MovementAction_WalkSlowDiagonalUpRight_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_WalkStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkStairDiagonalDownLeft_Step0, + MovementAction_WalkSlowDiagonalDownLeft_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_WalkStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_WalkStairDiagonalDownRight_Step0, + MovementAction_WalkSlowDiagonalDownRight_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_RunStairDiagonalUpLeft_Step0, + MovementAction_RunStairDiagonal_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_RunStairDiagonalUpRight_Step0, + MovementAction_RunStairDiagonal_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_RunStairDiagonalDownLeft_Step0, + MovementAction_RunStairDiagonal_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_RunStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_RunStairDiagonalDownRight_Step0, + MovementAction_RunStairDiagonal_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_AcroBikeDiagonalUpLeft_Step0, + MovementAction_RideWaterCurrentLeft_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_AcroBikeDiagonalDownLeft_Step0, + MovementAction_RideWaterCurrentLeft_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_AcroBikeDiagonalUpRight_Step0, + MovementAction_RideWaterCurrentRight_Step1, + MovementAction_PauseSpriteAnim, +}; + +u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_AcroBikeDiagonalDownRight_Step0, + MovementAction_RideWaterCurrentRight_Step1, + MovementAction_PauseSpriteAnim, +}; + + diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 1a7d08db27..edbc20acb9 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -841,6 +841,18 @@ const u8 gRunningDirectionAnimNums[] = { [DIR_NORTHEAST] = 21, }; +const u8 gStairsRunningDirectionAnimNums[] = { + [DIR_NONE] = 20, + [DIR_SOUTH] = 20, + [DIR_NORTH] = 21, + [DIR_WEST] = 22, + [DIR_EAST] = 23, + [DIR_SOUTHWEST] = 22, + [DIR_SOUTHEAST] = 23, + [DIR_NORTHWEST] = 22, + [DIR_NORTHEAST] = 23, +}; + const u8 gTrainerFacingDirectionMovementTypes[] = { [DIR_NONE] = MOVEMENT_TYPE_FACE_DOWN, [DIR_SOUTH] = MOVEMENT_TYPE_FACE_DOWN, @@ -876,50 +888,78 @@ static const struct Coords16 sDirectionToVectors[] = { {-1, 1}, { 1, 1}, {-1, -1}, - { 1, -1} + { 1, -1}, + {-2, 1}, + { 2, 1}, + {-2, -1}, + { 2, -1} }; const u8 gFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_FACE_DOWN, - MOVEMENT_ACTION_FACE_DOWN, - MOVEMENT_ACTION_FACE_UP, - MOVEMENT_ACTION_FACE_LEFT, - MOVEMENT_ACTION_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_FACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_FACE_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_FACE_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_FACE_RIGHT }; const u8 gWalkSlowMovementActions[] = { - MOVEMENT_ACTION_WALK_SLOW_DOWN, - MOVEMENT_ACTION_WALK_SLOW_DOWN, - MOVEMENT_ACTION_WALK_SLOW_UP, - MOVEMENT_ACTION_WALK_SLOW_LEFT, - MOVEMENT_ACTION_WALK_SLOW_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_SLOW_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_SLOW_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_SLOW_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT }; const u8 gWalkNormalMovementActions[] = { - MOVEMENT_ACTION_WALK_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_NORMAL_UP, - MOVEMENT_ACTION_WALK_NORMAL_LEFT, - MOVEMENT_ACTION_WALK_NORMAL_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_NORMAL_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_NORMAL_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_NORMAL_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT }; const u8 gWalkFastMovementActions[] = { - MOVEMENT_ACTION_WALK_FAST_DOWN, - MOVEMENT_ACTION_WALK_FAST_DOWN, - MOVEMENT_ACTION_WALK_FAST_UP, - MOVEMENT_ACTION_WALK_FAST_LEFT, - MOVEMENT_ACTION_WALK_FAST_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_FAST_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_FAST_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_FAST_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_FAST_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_FAST_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT, }; const u8 gRideWaterCurrentMovementActions[] = { - MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, - MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP, + [DIR_WEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT }; const u8 gWalkFastestMovementActions[] = { - MOVEMENT_ACTION_WALK_FASTEST_DOWN, - MOVEMENT_ACTION_WALK_FASTEST_DOWN, - MOVEMENT_ACTION_WALK_FASTEST_UP, - MOVEMENT_ACTION_WALK_FASTEST_LEFT, - MOVEMENT_ACTION_WALK_FASTEST_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_FASTEST_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_FASTEST_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_FASTEST_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_FASTEST_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_FASTEST_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT }; const u8 gSlideMovementActions[] = { MOVEMENT_ACTION_SLIDE_DOWN, @@ -999,11 +1039,11 @@ const u8 gWalkInPlaceFastestMovementActions[] = { MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT, }; const u8 gAcroWheelieFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, }; const u8 gAcroPopWheelieFaceDirectionMovementActions[] = { MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, @@ -1027,11 +1067,15 @@ const u8 gAcroWheelieHopFaceDirectionMovementActions[] = { MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, }; const u8 gAcroWheelieHopDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + /*[DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT*/ }; const u8 gAcroWheelieJumpDirectionMovementActions[] = { MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, @@ -1068,6 +1112,59 @@ const u8 gAcroEndWheelieMoveDirectionMovementActions[] = { MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, }; +// run slow +const u8 gRunSlowMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_SOUTH] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, + [DIR_WEST] = MOVEMENT_ACTION_RUN_LEFT_SLOW, + [DIR_EAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, +}; + +// sideways stairs +const u8 gDiagonalStairRightMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_RIGHT, + [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT, +}; +const u8 gDiagonalStairLeftMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_LEFT, + [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT, +}; +const u8 gDiagonalStairRightRunningMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_RIGHT, + [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING, + [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING, +}; +const u8 gDiagonalStairLeftRunningMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_LEFT, + [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING, + [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING, +}; +const u8 gDiagonalStairLeftAcroBikeMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, + [DIR_SOUTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, + [DIR_NORTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, + [DIR_WEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, + +}; +const u8 gDiagonalStairRightAcroBikeMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, + [DIR_SOUTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, + [DIR_NORTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, + [DIR_WEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT, +}; const u8 gOppositeDirections[] = { DIR_NORTH, @@ -5058,12 +5155,21 @@ u8 name(u32 idx)\ u8 animIds[sizeof(table)];\ direction = idx;\ memcpy(animIds, (table), sizeof(table));\ - if (direction > DIR_EAST) direction = 0;\ + if (direction > sizeof(table)) direction = 0;\ return animIds[direction];\ } +//sideways stairs +dirn_to_anim(GetDiagonalRightStairsMovement, gDiagonalStairRightMovementActions); +dirn_to_anim(GetDiagonalLeftStairsMovement, gDiagonalStairLeftMovementActions); +dirn_to_anim(GetDiagonalRightStairsRunningMovement, gDiagonalStairRightRunningMovementActions); +dirn_to_anim(GetDiagonalLeftStairsRunningMovement, gDiagonalStairLeftRunningMovementActions); +dirn_to_anim(GetDiagonalLeftAcroBikeMovement, gDiagonalStairLeftAcroBikeMovementActions); +dirn_to_anim(GetDiagonalRightAcroBikeMovement, gDiagonalStairRightAcroBikeMovementActions); + dirn_to_anim(GetFaceDirectionMovementAction, gFaceDirectionMovementActions); dirn_to_anim(GetWalkSlowMovementAction, gWalkSlowMovementActions); +dirn_to_anim(GetPlayerRunSlowMovementAction, gRunSlowMovementActions); dirn_to_anim(GetWalkNormalMovementAction, gWalkNormalMovementActions); dirn_to_anim(GetWalkFastMovementAction, gWalkFastMovementActions); dirn_to_anim(GetRideWaterCurrentMovementAction, gRideWaterCurrentMovementActions); @@ -9044,3 +9150,254 @@ u8 MovementAction_Fly_Finish(struct ObjectEvent *objectEvent, struct Sprite *spr { return TRUE; } + +// running slow +static void StartSlowRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) +{ + sub_8093AF0(objectEvent, sprite, direction); + npc_apply_anim_looping(objectEvent, sprite, GetRunningDirectionAnimNum(objectEvent->facingDirection)); +} + +#define tDirection data[3] +#define tDelay data[4] +#define tStepNo data[5] +static bool8 obj_npc_ministep_slow(struct Sprite *sprite) +{ + if ((++sprite->tDelay) & 1) + { + Step1(sprite, sprite->tDirection); + sprite->tStepNo++; + } + else + { + Step2(sprite, sprite->tDirection); + sprite->tStepNo += 2; + } + + if (sprite->tStepNo > 15) + return TRUE; + else + return FALSE; +} +static bool8 npc_obj_ministep_stop_on_arrival_slow(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + if (obj_npc_ministep_slow(sprite)) + { + ShiftStillObjectEventCoords(objectEvent); + objectEvent->triggerGroundEffectsOnStop = TRUE; + sprite->animPaused = TRUE; + return TRUE; + } + return FALSE; +} + + +bool8 MovementActionFunc_RunSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTH); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + StartSlowRunningAnim(objectEvent, sprite, DIR_NORTH); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + StartSlowRunningAnim(objectEvent, sprite, DIR_WEST); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + StartSlowRunningAnim(objectEvent, sprite, DIR_EAST); + return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); +} + +bool8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival_slow(objectEvent, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +//sideways stairs +u8 GetSidewaysStairsToRightDirection(s16 x, s16 y, u8 z) +{ + static bool8 (*const direction[])(u8) = { + MetatileBehavior_IsWalkSouth, + MetatileBehavior_IsWalkNorth, + MetatileBehavior_IsSidewaysStairsRight, + MetatileBehavior_IsSidewaysStairsRight, + }; + + u8 b; + u8 index = z; + + if (index == 0) + return 0; + else if (index > 4) + index -= 4; + + index--; + b = MapGridGetMetatileBehaviorAt(x, y); + + if (direction[index](b) == 1) + return index + 1; + + return 0; +} + +u8 GetSidewaysStairsToLeftDirection(s16 x, s16 y, u8 z) +{ + static bool8 (*const direction[])(u8) = { + MetatileBehavior_IsWalkSouth, + MetatileBehavior_IsWalkNorth, + MetatileBehavior_IsSidewaysStairsLeft, + MetatileBehavior_IsSidewaysStairsLeft, + }; + + u8 b; + u8 index = z; + + if (index == 0) + return 0; + else if (index > 4) + index -= 4; + + index--; + b = MapGridGetMetatileBehaviorAt(x, y); + + if (direction[index](b) == 1) + return index + 1; + + return 0; +} + +bool8 MovementAction_WalkStairDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_WEST; + objectEvent->facingDirectionLocked = TRUE; + sub_8093B60(objectEvent, sprite, DIR_NORTHWEST); + return MovementAction_WalkSlowDiagonalUpLeft_Step1(objectEvent, sprite); +} + +bool8 MovementAction_WalkStairDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_EAST; + objectEvent->facingDirectionLocked = TRUE; + sub_8093B60(objectEvent, sprite, DIR_NORTHEAST); + return MovementAction_WalkSlowDiagonalUpRight_Step1(objectEvent, sprite); +} + +bool8 MovementAction_WalkStairDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_WEST; + objectEvent->facingDirectionLocked = TRUE; + sub_8093B60(objectEvent, sprite, DIR_SOUTHWEST); + return MovementAction_WalkSlowDiagonalDownLeft_Step1(objectEvent, sprite); +} + +bool8 MovementAction_WalkStairDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_EAST; + objectEvent->facingDirectionLocked = TRUE; + sub_8093B60(objectEvent, sprite, DIR_SOUTHEAST); + return MovementAction_WalkSlowDiagonalDownRight_Step1(objectEvent, sprite); +} + +bool8 MovementAction_RunStairDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_WEST; + objectEvent->facingDirectionLocked = TRUE; + StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHWEST); + return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); +} + +bool8 MovementAction_RunStairDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_EAST; + objectEvent->facingDirectionLocked = TRUE; + StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHEAST); + return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); +} + +bool8 MovementAction_RunStairDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_WEST; + objectEvent->facingDirectionLocked = TRUE; + StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHWEST); + return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); +} + +bool8 MovementAction_RunStairDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_EAST; + objectEvent->facingDirectionLocked = TRUE; + StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHEAST); + return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); +} + +bool8 MovementAction_RunStairDiagonal_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + { + sprite->data[2] = 2; + return TRUE; + } + return FALSE; +} + +bool8 MovementAction_AcroBikeDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_WEST; + objectEvent->facingDirectionLocked = TRUE; + #if SLOW_MOVEMENT_ON_STAIRS + do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 0); + #else + do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 2); + #endif + return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); +} + +bool8 MovementAction_AcroBikeDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_WEST; + objectEvent->facingDirectionLocked = TRUE; + #if SLOW_MOVEMENT_ON_STAIRS + do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 0); + #else + do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 2); + #endif + return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); +} + +bool8 MovementAction_AcroBikeDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_EAST; + objectEvent->facingDirectionLocked = TRUE; + #if SLOW_MOVEMENT_ON_STAIRS + do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 0); + #else + do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 2); + #endif + return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); +} + +bool8 MovementAction_AcroBikeDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + objectEvent->facingDirection = DIR_EAST; + objectEvent->facingDirectionLocked = TRUE; + #if SLOW_MOVEMENT_ON_STAIRS + do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 0); + #else + do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 2); + #endif + return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); +} + diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 4f85ad628b..0a98f3dc7c 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -44,6 +44,8 @@ static void MovePlayerAvatarUsingKeypadInput(u8, u16, u16); static void PlayerAllowForcedMovementIfMovingSameDirection(); static bool8 TryDoMetatileBehaviorForcedMovement(); static u8 GetForcedMovementByMetatileBehavior(); +static bool8 IsSidewaysStairToRight(s16, s16, u8); +static bool8 IsSidewaysStairToLeft(s16, s16, u8); static bool8 ForcedMovement_None(void); static bool8 ForcedMovement_Slip(void); @@ -90,6 +92,8 @@ static bool8 sub_808B618(void); static bool8 PlayerIsAnimActive(void); static bool8 PlayerCheckIfAnimFinishedOrInactive(void); +static void PlayerGoSlow(u8 direction); +static void PlayerRunSlow(u8 direction); static void PlayerRun(u8); static void PlayerNotOnBikeCollide(u8); static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8); @@ -407,7 +411,7 @@ static u8 GetForcedMovementByMetatileBehavior(void) { u8 metatileBehavior = gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior; - for (i = 0; i < 18; i++) + for (i = 0; i < NELEMS(sForcedMovementTestFuncs); i++) { if (sForcedMovementTestFuncs[i](metatileBehavior)) return i + 1; @@ -607,7 +611,7 @@ static void PlayerNotOnBikeTurningInPlace(u8 direction, u16 heldKeys) static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) { u8 collision = CheckForPlayerAvatarCollision(direction); - + if (collision) { if (collision == COLLISION_LEDGE_JUMP) @@ -620,6 +624,26 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) PlayerNotOnBikeCollideWithFarawayIslandMew(direction); return; } + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + { + PlayerSidewaysStairsToRight(direction); + return; + } + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + { + PlayerSidewaysStairsToLeft(direction); + return; + } + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_RUNNING) + { + PlayerSidewaysStairsToRightRunning(direction); + return; + } + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_RUNNING) + { + PlayerSidewaysStairsToLeftRunning(direction); + return; + } else { u8 adjustedCollision = collision - COLLISION_STOP_SURFING; @@ -628,10 +652,10 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) return; } } - + if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) { - // speed 2 is fast, same speed as running + // speed 2 is fast, same speed as running PlayerGoSpeed2(direction); return; } @@ -639,16 +663,65 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_UNDERWATER) && (heldKeys & B_BUTTON) && FlagGet(FLAG_SYS_B_DASH) && IsRunningDisallowed(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior) == 0) { - PlayerRun(direction); + if (PlayerIsMovingOnRockStairs(direction)) + PlayerRunSlow(direction); + else + PlayerRun(direction); + gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH; return; } else { - PlayerGoSpeed1(direction); + if (PlayerIsMovingOnRockStairs(direction)) + PlayerGoSlow(direction); + else + PlayerGoSpeed1(direction); } } +bool32 PlayerIsMovingOnRockStairs(u8 direction) +{ + #if SLOW_MOVEMENT_ON_STAIRS + struct ObjectEvent *objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + s16 x = objectEvent->currentCoords.x; + s16 y = objectEvent->currentCoords.y; + + switch (direction) + { + case DIR_NORTH: + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + case DIR_SOUTH: + MoveCoords(DIR_SOUTH, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + /* + case DIR_WEST: + MoveCoords(DIR_WEST, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + case DIR_EAST: + MoveCoords(DIR_EAST, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + case DIR_SOUTHWEST: + MoveCoords(DIR_SOUTHWEST, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + case DIR_SOUTHEAST: + MoveCoords(DIR_SOUTHEAST, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + case DIR_NORTHWEST: + MoveCoords(DIR_NORTHWEST, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + case DIR_NORTHEAST: + MoveCoords(DIR_NORTHEAST, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); + */ + default: + return FALSE; + } + #else + return FALSE + #endif +} + static u8 CheckForPlayerAvatarCollision(u8 direction) { s16 x, y; @@ -656,6 +729,7 @@ static u8 CheckForPlayerAvatarCollision(u8 direction) x = playerObjEvent->currentCoords.x; y = playerObjEvent->currentCoords.y; + MoveCoords(direction, &x, &y); return CheckForObjectEventCollision(playerObjEvent, x, y, direction, MapGridGetMetatileBehaviorAt(x, y)); } @@ -691,7 +765,26 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u return COLLISION_ROTATING_GATE; CheckAcroBikeCollision(x, y, metatileBehavior, &collision); } - return collision; + + if (collision != COLLISION_IMPASSABLE) + { + if (IsSidewaysStairToRight(x, y, direction)) + { + if (gMain.heldKeys & B_BUTTON) + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_RUNNING; + else + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING; + } + else if (IsSidewaysStairToLeft(x, y, direction)) + { + if (gMain.heldKeys & B_BUTTON) + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT_RUNNING; + else + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING; + } + } + + return collision; } static u8 sub_808B164(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior) @@ -953,6 +1046,16 @@ void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement) } } +// slow +static void PlayerGoSlow(u8 direction) +{ + PlayerSetAnimId(GetWalkSlowMovementAction(direction), 2); +} +static void PlayerRunSlow(u8 direction) +{ + PlayerSetAnimId(GetPlayerRunSlowMovementAction(direction), 2); +} + // normal speed (1 speed) void PlayerGoSpeed1(u8 a) { @@ -965,6 +1068,7 @@ void PlayerGoSpeed2(u8 a) PlayerSetAnimId(GetWalkFastMovementAction(a), 2); } +// acro bike speed void PlayerRideWaterCurrent(u8 a) { PlayerSetAnimId(GetRideWaterCurrentMovementAction(a), 2); @@ -2215,3 +2319,83 @@ static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *delayTimer) *delayTimer = 0; return sSpinDirections[object->facingDirection]; } + +//sideways stairs +static bool8 IsSidewaysStairToRight(s16 x, s16 y, u8 z) +{ + if (GetSidewaysStairsToRightDirection(x, y, z) != 0) + return TRUE; + else + return FALSE; +} + +static bool8 IsSidewaysStairToLeft(s16 x, s16 y, u8 z) +{ + if (GetSidewaysStairsToLeftDirection(x, y, z) != 0) + return TRUE; + else + return FALSE; +} + +u8 GetRightStairsDirection(u8 direction) +{ + switch (direction) + { + case DIR_WEST: + return DIR_SOUTHWEST; + case DIR_EAST: + return DIR_NORTHEAST; + default: + if (direction > DIR_EAST) + direction -= DIR_EAST; + + return direction; + } +} + +u8 GetLeftStairsDirection(u8 direction) +{ + switch (direction) + { + case DIR_WEST: + return DIR_NORTHWEST; + case DIR_EAST: + return DIR_SOUTHEAST; + default: + if (direction > DIR_EAST) + direction -= DIR_EAST; + + return direction; + } +} + +void PlayerSidewaysStairsToRight(u8 direction) +{ + PlayerSetAnimId(GetDiagonalRightStairsMovement(direction), 8); +} + +void PlayerSidewaysStairsToLeft(u8 direction) +{ + PlayerSetAnimId(GetDiagonalLeftStairsMovement(direction), 8); +} + +void PlayerSidewaysStairsToRightRunning(u8 direction) +{ + PlayerSetAnimId(GetDiagonalRightStairsRunningMovement(direction), 8); +} + +void PlayerSidewaysStairsToLeftRunning(u8 direction) +{ + PlayerSetAnimId(GetDiagonalLeftStairsRunningMovement(direction), 8); +} + +void PlayerSidewaysStairsToAcroBikeLeft(u8 direction) +{ + PlayerSetAnimId(GetDiagonalLeftAcroBikeMovement(direction), 8); +} + +void PlayerSidewaysStairsToAcroBikeRight(u8 direction) +{ + PlayerSetAnimId(GetDiagonalRightAcroBikeMovement(direction), 8); +} + diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 2a9304a4d8..fa773a3b7e 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -83,9 +83,9 @@ static const u8 sTileBitAttributes[] = [MB_SLIDE_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_SLIDE_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_UNUSED_49] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_UNUSED_4A] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_UNUSED_4B] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_RIGHT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_LEFT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_ROCK_STAIRS] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_UNUSED_4C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_UNUSED_4D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_UNUSED_4E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), @@ -1495,3 +1495,27 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) else return FALSE; } + +bool8 MetatileBehavior_IsSidewaysStairsRight(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeft(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior) +{ + if (metatileBehavior == MB_ROCK_STAIRS) // || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT) + return TRUE; + else + return FALSE; +} From e4674ccd03d351e70571ec805729e5b8639ec31c Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 4 Jun 2020 20:30:27 -0600 Subject: [PATCH 006/133] fully working walk/run/mach bike/acro bike regular movement --- include/constants/event_object_movement.h | 3 - include/constants/global.h | 2 + include/constants/metatile_behaviors.h | 14 +-- include/field_player_avatar.h | 12 +- include/global.fieldmap.h | 6 +- include/metatile_behavior.h | 10 +- src/bike.c | 51 +++++---- src/event_object_movement.c | 86 ++++++++------- src/field_player_avatar.c | 127 +++++++++++++--------- src/metatile_behavior.c | 72 ++++++++++-- 10 files changed, 234 insertions(+), 149 deletions(-) diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 9bd3e87c6c..5172e12d51 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -1,8 +1,6 @@ #ifndef GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H #define GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H -#define SLOW_MOVEMENT_ON_STAIRS TRUE // change to false to keep emerald's normal movement speed on outdoor stairs - #define MOVEMENT_TYPE_NONE 0x0 #define MOVEMENT_TYPE_LOOK_AROUND 0x1 #define MOVEMENT_TYPE_WANDER_AROUND 0x2 @@ -265,7 +263,6 @@ #define MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT 0xAD //sideways stairs - mach bike - #define MOVEMENT_ACTION_STEP_END 0xFE #endif // GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H diff --git a/include/constants/global.h b/include/constants/global.h index 213ccca5b5..4a3f0618a8 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -118,4 +118,6 @@ #define DIR_NORTHWEST 7 #define DIR_NORTHEAST 8 +#define SLOW_MOVEMENT_ON_STAIRS TRUE // change to false to keep emerald's normal movement speed on outdoor stairs + #endif // GUARD_CONSTANTS_GLOBAL_H diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index ef79f0b6d3..07e0553800 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -74,13 +74,13 @@ #define MB_SLIDE_NORTH 0x46 #define MB_SLIDE_SOUTH 0x47 #define MB_TRICK_HOUSE_PUZZLE_8_FLOOR 0x48 -#define MB_SIDEWAYS_STAIRS_RIGHT 0x49 -#define MB_SIDEWAYS_STAIRS_LEFT 0x4A -#define MB_ROCK_STAIRS 0x4B -#define MB_UNUSED_4C 0x4C -#define MB_UNUSED_4D 0x4D -#define MB_UNUSED_4E 0x4E -#define MB_UNUSED_4F 0x4F +#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE 0x49 +#define MB_SIDEWAYS_STAIRS_LEFT_SIDE 0x4A +#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP 0x4B +#define MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP 0x4C +#define MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM 0x4D +#define MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM 0x4E +#define MB_ROCK_STAIRS 0x4F #define MB_EASTWARD_CURRENT 0x50 #define MB_WESTWARD_CURRENT 0x51 #define MB_NORTHWARD_CURRENT 0x52 diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 3177a887ce..d7b04d40ff 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -66,12 +66,12 @@ u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); void StartFishing(u8 rod); bool32 PlayerIsMovingOnRockStairs(u8 direction); //sideways stairs -u8 GetRightStairsDirection(u8 direction); -u8 GetLeftStairsDirection(u8 direction); -void PlayerSidewaysStairsToRight(u8 direction); -void PlayerSidewaysStairsToLeft(u8 direction); -void PlayerSidewaysStairsToRightRunning(u8 direction); -void PlayerSidewaysStairsToLeftRunning(u8 direction); +u8 GetRightSideStairsDirection(u8 direction); +u8 GetLeftSideStairsDirection(u8 direction); +void PlayerSidewaysStairsRightSide(u8 direction); +void PlayerSidewaysStairsLeftSide(u8 direction); +void PlayerSidewaysStairsRightSideRunning(u8 direction); +void PlayerSidewaysStairsLeftSideRunning(u8 direction); void PlayerSidewaysStairsToAcroBikeLeft(u8 direction); void PlayerSidewaysStairsToAcroBikeRight(u8 direction); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index baedb9bf37..a4c486c960 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -279,10 +279,8 @@ enum COLLISION_VERTICAL_RAIL, COLLISION_HORIZONTAL_RAIL, //sideways_stairs - COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING, - COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING, - COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_RUNNING, - COLLISION_SIDEWAYS_STAIRS_TO_LEFT_RUNNING, + COLLISION_SIDEWAYS_STAIRS_TO_RIGHT, + COLLISION_SIDEWAYS_STAIRS_TO_LEFT }; // player running states diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index f5781a3371..715f9ef127 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -147,7 +147,13 @@ bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior); //sideways stairs -bool8 MetatileBehavior_IsSidewaysStairsRight(u8); -bool8 MetatileBehavior_IsSidewaysStairsLeft(u8); +bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8); +bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8); +bool8 MetatileBehavior_IsSidewaysStairsRightSideTop(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsLeftSideTop(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsRightSideBottom(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsLeftSideBottom(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsRightSideAny(u8 metatileBehavior); +bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior); #endif // GUARD_METATILE_BEHAVIOR diff --git a/src/bike.c b/src/bike.c index 18dbda6ba3..a26451778e 100644 --- a/src/bike.c +++ b/src/bike.c @@ -240,25 +240,24 @@ static void MachBikeTransition_TrySpeedUp(u8 direction) PlayerOnBikeCollide(direction); } } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) { gPlayerAvatar.bikeFrameCounter = 0; gPlayerAvatar.bikeSpeed = SPEED_STANDING; - PlayerGoSpeed2(GetLeftStairsDirection(direction)); + PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); //PlayerSidewaysStairsToAcroBikeLeft(direction); return; } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) { gPlayerAvatar.bikeFrameCounter = 0; gPlayerAvatar.bikeSpeed = SPEED_STANDING; //PlayerSidewaysStairsToAcroBikeRight(direction); - PlayerGoSpeed2(GetRightStairsDirection(direction)); + PlayerGoSpeed2(GetRightSideStairsDirection(direction)); return; } else { - // to do: this sometimes crashes based on the metatile behaviours (eg. holding up while traveling down sideways stairs to sw) if (PlayerIsMovingOnRockStairs(direction)) gPlayerAvatar.bikeFrameCounter--; @@ -296,15 +295,14 @@ static void MachBikeTransition_TrySlowDown(u8 direction) } else { - /* - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) { - return PlayerGoSpeed2(GetLeftStairsDirection(direction)); + return PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); //return PlayerSidewaysStairsToLeftMachBike(direction); } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) { - return PlayerGoSpeed2(GetRightStairsDirection(direction)); + return PlayerGoSpeed2(GetRightSideStairsDirection(direction)); //return PlayerSidewaysStairsToRightMachBike(direction); }*/ @@ -315,6 +313,7 @@ static void MachBikeTransition_TrySlowDown(u8 direction) // the acro bike requires the input handler to be executed before the transition can. static void MovePlayerOnAcroBike(u8 newDirection, u16 newKeys, u16 heldKeys) { + sAcroBikeTransitions[CheckMovementInputAcroBike(&newDirection, newKeys, heldKeys)](newDirection); } @@ -603,10 +602,10 @@ static void AcroBikeTransition_Moving(u8 direction) } else { - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) - return PlayerGoSpeed2(GetRightStairsDirection(direction)); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) - return PlayerGoSpeed2(GetLeftStairsDirection(direction)); + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) + return PlayerGoSpeed2(GetRightSideStairsDirection(direction)); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + return PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); if (PlayerIsMovingOnRockStairs(direction)) PlayerGoSpeed2(direction); @@ -614,10 +613,10 @@ static void AcroBikeTransition_Moving(u8 direction) PlayerRideWaterCurrent(direction); /* works, but might be better to keep rock stairs to up/down for mach bike - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) - direction = GetRightStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) - direction = GetLeftStairsDirection(direction); + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) + direction = GetRightSideStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + direction = GetLeftSideStairsDirection(direction); if (PlayerIsMovingOnRockStairs(direction)) PlayerGoSpeed2(direction); @@ -692,10 +691,10 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction) else { derp: - /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) - direction = GetLeftStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) - direction = GetRightStairsDirection(direction); + /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + direction = GetLeftSideStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) + direction = GetRightSideStairsDirection(direction); */ PlayerMovingHoppingWheelie(direction); } @@ -765,10 +764,10 @@ static void AcroBikeTransition_WheelieMoving(u8 direction) return; } - /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) - direction = GetLeftStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) - direction = GetRightStairsDirection(direction);*/ + /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + direction = GetLeftSideStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) + direction = GetRightSideStairsDirection(direction);*/ PlayerWheelieMove(direction); gPlayerAvatar.runningState = MOVING; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index edbc20acb9..f6bc55f398 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1122,34 +1122,34 @@ const u8 gRunSlowMovementActions[] = { }; // sideways stairs -const u8 gDiagonalStairRightMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_RIGHT, - [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, +const u8 gDiagonalStairLeftSideMovementActions[] = { //movement actions for stairs on left side of a wall (southwest and northeast) + [DIR_NONE] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT, }; -const u8 gDiagonalStairLeftMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_LEFT, - [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, +const u8 gDiagonalStairRightSideMovementActions[] = { //movement actions for stairs on right side of a wall (southeast and northwest) + [DIR_NONE] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_SLOW_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT, }; -const u8 gDiagonalStairRightRunningMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_RIGHT, - [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, - [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING, - [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING, -}; -const u8 gDiagonalStairLeftRunningMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_JUMP_2_LEFT, - [DIR_SOUTH] = MOVEMENT_ACTION_JUMP_2_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_JUMP_2_UP, +const u8 gDiagonalStairRightSideRunningMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_SOUTH] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING, }; +const u8 gDiagonalStairLeftSideRunningMovementActions[] = { + [DIR_NONE] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_SOUTH] = MOVEMENT_ACTION_RUN_DOWN_SLOW, + [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, + [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING, + [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING, +}; const u8 gDiagonalStairLeftAcroBikeMovementActions[] = { [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, [DIR_SOUTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, @@ -5160,10 +5160,10 @@ u8 name(u32 idx)\ } //sideways stairs -dirn_to_anim(GetDiagonalRightStairsMovement, gDiagonalStairRightMovementActions); -dirn_to_anim(GetDiagonalLeftStairsMovement, gDiagonalStairLeftMovementActions); -dirn_to_anim(GetDiagonalRightStairsRunningMovement, gDiagonalStairRightRunningMovementActions); -dirn_to_anim(GetDiagonalLeftStairsRunningMovement, gDiagonalStairLeftRunningMovementActions); +dirn_to_anim(GetDiagonalRightStairsMovement, gDiagonalStairRightSideMovementActions); +dirn_to_anim(GetDiagonalLeftStairsMovement, gDiagonalStairLeftSideMovementActions); +dirn_to_anim(GetDiagonalRightStairsRunningMovement, gDiagonalStairRightSideRunningMovementActions); +dirn_to_anim(GetDiagonalLeftStairsRunningMovement, gDiagonalStairLeftSideRunningMovementActions); dirn_to_anim(GetDiagonalLeftAcroBikeMovement, gDiagonalStairLeftAcroBikeMovementActions); dirn_to_anim(GetDiagonalRightAcroBikeMovement, gDiagonalStairRightAcroBikeMovementActions); @@ -9227,57 +9227,63 @@ bool8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct S } //sideways stairs +/* u8 GetSidewaysStairsToRightDirection(s16 x, s16 y, u8 z) { - static bool8 (*const direction[])(u8) = { + static bool8 (*const sRightStairsBehaviors[])(u8) = { MetatileBehavior_IsWalkSouth, MetatileBehavior_IsWalkNorth, MetatileBehavior_IsSidewaysStairsRight, MetatileBehavior_IsSidewaysStairsRight, }; - u8 b; + u8 metatileBehavior; u8 index = z; - if (index == 0) - return 0; - else if (index > 4) - index -= 4; + if (index == DIR_NONE) + return DIR_NONE; + else if (index > DIR_EAST) + index -= DIR_EAST; index--; - b = MapGridGetMetatileBehaviorAt(x, y); - - if (direction[index](b) == 1) + metatileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if (MetatileBehavior_IsEastBlocked(metatileBehavior)) + return DIR_NONE; + + if (sRightStairsBehaviors[index](metatileBehavior)) return index + 1; - return 0; + return DIR_NONE; } u8 GetSidewaysStairsToLeftDirection(s16 x, s16 y, u8 z) { - static bool8 (*const direction[])(u8) = { + static bool8 (*const sLeftStairsBehaviors[])(u8) = { MetatileBehavior_IsWalkSouth, MetatileBehavior_IsWalkNorth, MetatileBehavior_IsSidewaysStairsLeft, MetatileBehavior_IsSidewaysStairsLeft, }; - u8 b; + u8 metatileBehavior; u8 index = z; - if (index == 0) - return 0; + if (index == DIR_NONE) + return DIR_NONE; else if (index > 4) index -= 4; index--; - b = MapGridGetMetatileBehaviorAt(x, y); + metatileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if (MetatileBehavior_IsWestBlocked(metatileBehavior)) + return DIR_NONE; - if (direction[index](b) == 1) + if (sLeftStairsBehaviors[index](metatileBehavior) == 1) return index + 1; - return 0; + return DIR_NONE; } +*/ bool8 MovementAction_WalkStairDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 0a98f3dc7c..cec876555c 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -624,24 +624,20 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) PlayerNotOnBikeCollideWithFarawayIslandMew(direction); return; } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING) + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) { - PlayerSidewaysStairsToRight(direction); + if (heldKeys & B_BUTTON && FlagGet(FLAG_SYS_B_DASH)) + PlayerSidewaysStairsRightSideRunning(direction); + else + PlayerSidewaysStairsRightSide(direction); return; } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING) + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) { - PlayerSidewaysStairsToLeft(direction); - return; - } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_RUNNING) - { - PlayerSidewaysStairsToRightRunning(direction); - return; - } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT_RUNNING) - { - PlayerSidewaysStairsToLeftRunning(direction); + if (heldKeys & B_BUTTON && FlagGet(FLAG_SYS_B_DASH)) + return PlayerSidewaysStairsLeftSideRunning(direction); + else + return PlayerSidewaysStairsLeftSide(direction); return; } else @@ -748,6 +744,8 @@ static u8 sub_808B028(u8 direction) u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior) { u8 collision = GetCollisionAtCoords(objectEvent, x, y, direction); + u8 currentBehavior = MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y); + if (collision == COLLISION_ELEVATION_MISMATCH && CanStopSurfing(x, y, direction)) return COLLISION_STOP_SURFING; @@ -766,25 +764,50 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u CheckAcroBikeCollision(x, y, metatileBehavior, &collision); } - if (collision != COLLISION_IMPASSABLE) + //sideways stairs logic + if (MetatileBehavior_IsSidewaysStairsLeftSideTop(metatileBehavior) && direction == DIR_EAST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move + else if (MetatileBehavior_IsSidewaysStairsRightSideTop(metatileBehavior) && direction == DIR_WEST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move + else if (MetatileBehavior_IsSidewaysStairsRightSideBottom(metatileBehavior) && (direction == DIR_EAST || direction == DIR_SOUTH)) + return COLLISION_IMPASSABLE; + else if (MetatileBehavior_IsSidewaysStairsLeftSideBottom(metatileBehavior) && (direction == DIR_WEST || direction == DIR_SOUTH)) + return COLLISION_IMPASSABLE; + + if (MetatileBehavior_IsSidewaysStairsLeftSide(metatileBehavior)) { - if (IsSidewaysStairToRight(x, y, direction)) - { - if (gMain.heldKeys & B_BUTTON) - return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_RUNNING; - else - return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT_WALKING; - } - else if (IsSidewaysStairToLeft(x, y, direction)) - { - if (gMain.heldKeys & B_BUTTON) - return COLLISION_SIDEWAYS_STAIRS_TO_LEFT_RUNNING; - else - return COLLISION_SIDEWAYS_STAIRS_TO_LEFT_WALKING; - } + //moving ONTO left side stair + if (direction == DIR_WEST && currentBehavior != metatileBehavior) + return collision; //moving onto top part of left-stair going left, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; // move diagonally + } + else if (MetatileBehavior_IsSidewaysStairsRightSide(metatileBehavior)) + { + //moving ONTO right side stair + if (direction == DIR_EAST && currentBehavior != metatileBehavior) + return collision; //moving onto top part of right-stair going right, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; + } + else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currentBehavior)) + { + //moving OFF of any left side stair + if (direction == DIR_WEST && metatileBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; //moving off of left stairs onto non-stair -> move diagonal + else + return collision; //moving off of left side stair to east -> move east + } + else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currentBehavior)) + { + //moving OFF of any right side stair + if (direction == DIR_EAST && metatileBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; //moving off right stair onto non-stair -> move diagonal + else + return collision; } - return collision; + return collision; } static u8 sub_808B164(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior) @@ -2321,6 +2344,7 @@ static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *delayTimer) } //sideways stairs +/* static bool8 IsSidewaysStairToRight(s16 x, s16 y, u8 z) { if (GetSidewaysStairsToRightDirection(x, y, z) != 0) @@ -2336,24 +2360,9 @@ static bool8 IsSidewaysStairToLeft(s16 x, s16 y, u8 z) else return FALSE; } +*/ -u8 GetRightStairsDirection(u8 direction) -{ - switch (direction) - { - case DIR_WEST: - return DIR_SOUTHWEST; - case DIR_EAST: - return DIR_NORTHEAST; - default: - if (direction > DIR_EAST) - direction -= DIR_EAST; - - return direction; - } -} - -u8 GetLeftStairsDirection(u8 direction) +u8 GetRightSideStairsDirection(u8 direction) { switch (direction) { @@ -2365,26 +2374,42 @@ u8 GetLeftStairsDirection(u8 direction) if (direction > DIR_EAST) direction -= DIR_EAST; + return direction; + } +} + +u8 GetLeftSideStairsDirection(u8 direction) +{ + switch (direction) + { + case DIR_WEST: + return DIR_SOUTHWEST; + case DIR_EAST: + return DIR_NORTHEAST; + default: + if (direction > DIR_EAST) + direction -= DIR_EAST; + return direction; } } -void PlayerSidewaysStairsToRight(u8 direction) +void PlayerSidewaysStairsRightSide(u8 direction) { PlayerSetAnimId(GetDiagonalRightStairsMovement(direction), 8); } -void PlayerSidewaysStairsToLeft(u8 direction) +void PlayerSidewaysStairsLeftSide(u8 direction) { PlayerSetAnimId(GetDiagonalLeftStairsMovement(direction), 8); } -void PlayerSidewaysStairsToRightRunning(u8 direction) +void PlayerSidewaysStairsRightSideRunning(u8 direction) { PlayerSetAnimId(GetDiagonalRightStairsRunningMovement(direction), 8); } -void PlayerSidewaysStairsToLeftRunning(u8 direction) +void PlayerSidewaysStairsLeftSideRunning(u8 direction) { PlayerSetAnimId(GetDiagonalLeftStairsRunningMovement(direction), 8); } diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index fa773a3b7e..f490d25931 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -83,13 +83,13 @@ static const u8 sTileBitAttributes[] = [MB_SLIDE_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_SLIDE_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE), - [MB_SIDEWAYS_STAIRS_RIGHT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_SIDEWAYS_STAIRS_LEFT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_LEFT_SIDE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_ROCK_STAIRS] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_4C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_4D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_4E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_UNUSED_4F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), [MB_EASTWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE), [MB_WESTWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE), [MB_NORTHWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE), @@ -1496,17 +1496,69 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) return FALSE; } -bool8 MetatileBehavior_IsSidewaysStairsRight(u8 metatileBehavior) +bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8 metatileBehavior) { - if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT) + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM) return TRUE; else return FALSE; } -bool8 MetatileBehavior_IsSidewaysStairsLeft(u8 metatileBehavior) +bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8 metatileBehavior) { - if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT) + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsRightSideTop(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeftSideTop(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsRightSideBottom(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeftSideBottom(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsRightSideAny(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE + || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM + || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP) + return TRUE; + else + return FALSE; +} + +bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior) +{ + if (metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE + || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM + || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP) return TRUE; else return FALSE; From 228b76e136e162655bc27f0713cb9968599093f4 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 4 Jun 2020 22:56:25 -0600 Subject: [PATCH 007/133] finish conditional slow stairs movement, clean up code a bit --- include/event_object_movement.h | 3 +- include/field_player_avatar.h | 2 - src/bike.c | 107 +++--- .../movement_action_func_tables.h | 24 +- src/event_object_movement.c | 346 +++++++++--------- src/field_player_avatar.c | 51 +-- src/metatile_behavior.c | 2 +- 7 files changed, 251 insertions(+), 284 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index e8f8df1a4b..84c89a85d3 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -437,7 +437,6 @@ u8 GetDiagonalRightStairsMovement(u32); u8 GetDiagonalLeftStairsMovement(u32); u8 GetDiagonalRightStairsRunningMovement(u32); u8 GetDiagonalLeftStairsRunningMovement(u32); -u8 GetDiagonalLeftAcroBikeMovement(u32); -u8 GetDiagonalRightAcroBikeMovement(u32); +extern u8 gSidewaysStairsDirection; #endif //GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index d7b04d40ff..f9cdfa838d 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -72,7 +72,5 @@ void PlayerSidewaysStairsRightSide(u8 direction); void PlayerSidewaysStairsLeftSide(u8 direction); void PlayerSidewaysStairsRightSideRunning(u8 direction); void PlayerSidewaysStairsLeftSideRunning(u8 direction); -void PlayerSidewaysStairsToAcroBikeLeft(u8 direction); -void PlayerSidewaysStairsToAcroBikeRight(u8 direction); #endif // GUARD_FIELD_PLAYER_AVATAR_H diff --git a/src/bike.c b/src/bike.c index a26451778e..a21dcb33e1 100644 --- a/src/bike.c +++ b/src/bike.c @@ -178,10 +178,7 @@ static u8 GetMachBikeTransition(u8 *dirTraveling) // the difference between face direction and turn direction is that one changes direction while the other does the animation of turning as well as changing direction. static void MachBikeTransition_FaceDirection(u8 direction) -{ - //if (direction > DIR_EAST) - // direction -= DIR_EAST; - +{ PlayerFaceDirection(direction); Bike_SetBikeStill(); } @@ -190,19 +187,13 @@ static void MachBikeTransition_TurnDirection(u8 direction) { struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; - //if (direction > DIR_EAST) - // direction -= DIR_EAST; - if (CanBikeFaceDirOnMetatile(direction, playerObjEvent->currentMetatileBehavior)) { PlayerTurnInPlace(direction); Bike_SetBikeStill(); } else - { - //if (playerObjEvent->facingDirection > DIR_EAST) - // playerObjEvent->facingDirection -= DIR_EAST; - + { MachBikeTransition_FaceDirection(playerObjEvent->facingDirection); } } @@ -242,19 +233,33 @@ static void MachBikeTransition_TrySpeedUp(u8 direction) } else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) { - gPlayerAvatar.bikeFrameCounter = 0; - gPlayerAvatar.bikeSpeed = SPEED_STANDING; - PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); - //PlayerSidewaysStairsToAcroBikeLeft(direction); - return; + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + gPlayerAvatar.bikeFrameCounter = 0; + gPlayerAvatar.bikeSpeed = SPEED_STANDING; + PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); + return; + #else + gPlayerAvatar.bikeFrameCounter = 2; + gPlayerAvatar.bikeSpeed = SPEED_STANDING; + PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); + return; + #endif + } else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) { - gPlayerAvatar.bikeFrameCounter = 0; - gPlayerAvatar.bikeSpeed = SPEED_STANDING; - //PlayerSidewaysStairsToAcroBikeRight(direction); - PlayerGoSpeed2(GetRightSideStairsDirection(direction)); - return; + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + gPlayerAvatar.bikeFrameCounter = 0; + gPlayerAvatar.bikeSpeed = SPEED_STANDING; + PlayerGoSpeed2(GetRightSideStairsDirection(direction)); + return; + #else + gPlayerAvatar.bikeFrameCounter = 2; + gPlayerAvatar.bikeSpeed = SPEED_STANDING; + PlayerGoSpeed2(GetRightSideStairsDirection(direction)); + return; + #endif + } else { @@ -295,16 +300,12 @@ static void MachBikeTransition_TrySlowDown(u8 direction) } else { - /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - { - return PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); - //return PlayerSidewaysStairsToLeftMachBike(direction); - } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - { - return PlayerGoSpeed2(GetRightSideStairsDirection(direction)); - //return PlayerSidewaysStairsToRightMachBike(direction); - }*/ + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + return PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) + return PlayerGoSpeed2(GetRightSideStairsDirection(direction)); + #endif sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction); } @@ -313,12 +314,13 @@ static void MachBikeTransition_TrySlowDown(u8 direction) // the acro bike requires the input handler to be executed before the transition can. static void MovePlayerOnAcroBike(u8 newDirection, u16 newKeys, u16 heldKeys) { - + gSidewaysStairsDirection = newDirection; sAcroBikeTransitions[CheckMovementInputAcroBike(&newDirection, newKeys, heldKeys)](newDirection); } static u8 CheckMovementInputAcroBike(u8 *newDirection, u16 newKeys, u16 heldKeys) { + gSidewaysStairsDirection = *newDirection; return sAcroBikeInputHandlers[gPlayerAvatar.acroBikeState](newDirection, newKeys, heldKeys); } @@ -407,6 +409,8 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16 struct ObjectEvent *playerObjEvent; direction = GetPlayerMovementDirection(); + gSidewaysStairsDirection = direction; + playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; gPlayerAvatar.runningState = NOT_MOVING; @@ -611,18 +615,6 @@ static void AcroBikeTransition_Moving(u8 direction) PlayerGoSpeed2(direction); else PlayerRideWaterCurrent(direction); - - /* works, but might be better to keep rock stairs to up/down for mach bike - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - direction = GetRightSideStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - direction = GetLeftSideStairsDirection(direction); - - if (PlayerIsMovingOnRockStairs(direction)) - PlayerGoSpeed2(direction); - else - PlayerRideWaterCurrent(direction); - */ } } @@ -691,11 +683,11 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction) else { derp: - /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - direction = GetLeftSideStairsDirection(direction); + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - direction = GetRightSideStairsDirection(direction); - */ + gSidewaysStairsDirection = GetRightSideStairsDirection(direction); + PlayerMovingHoppingWheelie(direction); } } @@ -764,10 +756,10 @@ static void AcroBikeTransition_WheelieMoving(u8 direction) return; } - /*if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - direction = GetLeftSideStairsDirection(direction); + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - direction = GetRightSideStairsDirection(direction);*/ + gSidewaysStairsDirection = GetRightSideStairsDirection(direction); PlayerWheelieMove(direction); gPlayerAvatar.runningState = MOVING; @@ -803,6 +795,12 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction) } return; } + + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) + gSidewaysStairsDirection = GetRightSideStairsDirection(direction); + PlayerPopWheelieWhileMoving(direction); gPlayerAvatar.runningState = MOVING; } @@ -826,6 +824,12 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction) PlayerEndWheelie(direction); return; } + + if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) + gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); + else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) + gSidewaysStairsDirection = GetRightSideStairsDirection(direction); + PlayerEndWheelieWhileMoving(direction); } @@ -1086,6 +1090,7 @@ void Bike_UpdateBikeCounterSpeed(u8 counter) static void Bike_SetBikeStill(void) { + gSidewaysStairsDirection = gObjectEvents[gPlayerAvatar.objectEventId].facingDirection; gPlayerAvatar.bikeFrameCounter = 0; gPlayerAvatar.bikeSpeed = SPEED_STANDING; } diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index cc1b522159..30c1fac2aa 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -1596,25 +1596,41 @@ u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Spr //sideways stairs u8 (*const gMovementActionFuncs_WalkStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { MovementAction_WalkStairDiagonalUpLeft_Step0, - MovementAction_WalkSlowDiagonalUpLeft_Step1, + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + MovementAction_WalkSlowDiagonalUpLeft_Step1, + #else + MovementAction_WalkNormalDiagonalUpLeft_Step1, + #endif MovementAction_PauseSpriteAnim, }; u8 (*const gMovementActionFuncs_WalkStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *) = { MovementAction_WalkStairDiagonalUpRight_Step0, - MovementAction_WalkSlowDiagonalUpRight_Step1, + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + MovementAction_WalkSlowDiagonalUpRight_Step1, + #else + MovementAction_WalkNormalDiagonalUpRight_Step1, + #endif MovementAction_PauseSpriteAnim, }; u8 (*const gMovementActionFuncs_WalkStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *) = { MovementAction_WalkStairDiagonalDownLeft_Step0, - MovementAction_WalkSlowDiagonalDownLeft_Step1, + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + MovementAction_WalkSlowDiagonalDownLeft_Step1, + #else + MovementAction_WalkNormalDiagonalDownLeft_Step1, + #endif MovementAction_PauseSpriteAnim, }; u8 (*const gMovementActionFuncs_WalkStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *) = { MovementAction_WalkStairDiagonalDownRight_Step0, - MovementAction_WalkSlowDiagonalDownRight_Step1, + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + MovementAction_WalkSlowDiagonalDownRight_Step1, + #else + MovementAction_WalkNormalDiagonalDownRight_Step1, + #endif MovementAction_PauseSpriteAnim, }; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index f6bc55f398..70970c80bc 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -57,6 +57,7 @@ static u8 setup##_callback(struct ObjectEvent *objectEvent, struct Sprite *sprit EWRAM_DATA u8 sCurrentReflectionType = 0; EWRAM_DATA u16 sCurrentSpecialObjectPaletteTag = 0; EWRAM_DATA struct LockedAnimObjectEvents *gLockedAnimObjectEvents = {0}; +EWRAM_DATA u8 gSidewaysStairsDirection = 0; static void MoveCoordsInDirection(u32, s16 *, s16 *, s16, s16); static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *, struct Sprite *); @@ -681,10 +682,10 @@ const u8 gFaceDirectionAnimNums[] = { [DIR_NORTH] = 1, [DIR_WEST] = 2, [DIR_EAST] = 3, - [DIR_SOUTHWEST] = 0, - [DIR_SOUTHEAST] = 0, - [DIR_NORTHWEST] = 1, - [DIR_NORTHEAST] = 1, + [DIR_SOUTHWEST] = 2, //0, + [DIR_SOUTHEAST] = 3, //0, + [DIR_NORTHWEST] = 2, //1, + [DIR_NORTHEAST] = 3, //1, }; const u8 gMoveDirectionAnimNums[] = { [DIR_NONE] = 4, @@ -747,10 +748,10 @@ const u8 gAcroWheelieDirectionAnimNums[] = { [DIR_NORTH] = 21, [DIR_WEST] = 22, [DIR_EAST] = 23, - [DIR_SOUTHWEST] = 20, - [DIR_SOUTHEAST] = 20, - [DIR_NORTHWEST] = 21, - [DIR_NORTHEAST] = 21, + [DIR_SOUTHWEST] = 22, //20, + [DIR_SOUTHEAST] = 23, //20, + [DIR_NORTHWEST] = 22, //21, + [DIR_NORTHEAST] = 23, //21, }; const u8 gUnrefAnimNums_08375633[] = { [DIR_NONE] = 24, @@ -769,10 +770,10 @@ const u8 gAcroEndWheelieDirectionAnimNums[] = { [DIR_NORTH] = 29, [DIR_WEST] = 30, [DIR_EAST] = 31, - [DIR_SOUTHWEST] = 28, - [DIR_SOUTHEAST] = 28, - [DIR_NORTHWEST] = 29, - [DIR_NORTHEAST] = 29, + [DIR_SOUTHWEST] = 30, //28, + [DIR_SOUTHEAST] = 31, //28, + [DIR_NORTHWEST] = 30, //29, + [DIR_NORTHEAST] = 31, //29, }; const u8 gAcroUnusedActionDirectionAnimNums[] = { [DIR_NONE] = 32, @@ -791,10 +792,10 @@ const u8 gAcroWheeliePedalDirectionAnimNums[] = { [DIR_NORTH] = 37, [DIR_WEST] = 38, [DIR_EAST] = 39, - [DIR_SOUTHWEST] = 36, - [DIR_SOUTHEAST] = 36, - [DIR_NORTHWEST] = 37, - [DIR_NORTHEAST] = 37, + [DIR_SOUTHWEST] = 38, //36, + [DIR_SOUTHEAST] = 39, //36, + [DIR_NORTHWEST] = 38, //37, + [DIR_NORTHEAST] = 39, //37, }; const u8 gFishingDirectionAnimNums[] = { [DIR_NONE] = 0, @@ -1044,27 +1045,43 @@ const u8 gAcroWheelieFaceDirectionMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP, [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT }; const u8 gAcroPopWheelieFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT, }; const u8 gAcroEndWheelieFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, - MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT, }; const u8 gAcroWheelieHopFaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT, }; const u8 gAcroWheelieHopDirectionMovementActions[] = { [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN, @@ -1072,45 +1089,65 @@ const u8 gAcroWheelieHopDirectionMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP, [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, - /*[DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, - [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT, - [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT*/ + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT, }; const u8 gAcroWheelieJumpDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT, }; const u8 gAcroWheelieInPlaceDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT, }; const u8 gAcroPopWheelieMoveDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, - MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT, }; const u8 gAcroWheelieMoveDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, - MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT, }; const u8 gAcroEndWheelieMoveDirectionMovementActions[] = { - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, - MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP, + [DIR_WEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, }; // run slow const u8 gRunSlowMovementActions[] = { @@ -1150,21 +1187,6 @@ const u8 gDiagonalStairLeftSideRunningMovementActions[] = { [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING, }; -const u8 gDiagonalStairLeftAcroBikeMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, - [DIR_SOUTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, - [DIR_NORTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, - [DIR_WEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, - [DIR_EAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, - -}; -const u8 gDiagonalStairRightAcroBikeMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, - [DIR_SOUTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, - [DIR_NORTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, - [DIR_WEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, - [DIR_EAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT, -}; const u8 gOppositeDirections[] = { DIR_NORTH, @@ -5164,8 +5186,6 @@ dirn_to_anim(GetDiagonalRightStairsMovement, gDiagonalStairRightSideMovementActi dirn_to_anim(GetDiagonalLeftStairsMovement, gDiagonalStairLeftSideMovementActions); dirn_to_anim(GetDiagonalRightStairsRunningMovement, gDiagonalStairRightSideRunningMovementActions); dirn_to_anim(GetDiagonalLeftStairsRunningMovement, gDiagonalStairLeftSideRunningMovementActions); -dirn_to_anim(GetDiagonalLeftAcroBikeMovement, gDiagonalStairLeftAcroBikeMovementActions); -dirn_to_anim(GetDiagonalRightAcroBikeMovement, gDiagonalStairRightAcroBikeMovementActions); dirn_to_anim(GetFaceDirectionMovementAction, gFaceDirectionMovementActions); dirn_to_anim(GetWalkSlowMovementAction, gWalkSlowMovementActions); @@ -7123,7 +7143,7 @@ bool8 MovementAction_AcroWheelieHopFaceRight_Step1(struct ObjectEvent *objectEve bool8 MovementAction_AcroWheelieHopDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_SOUTH, 1, 1); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); return MovementAction_AcroWheelieHopDown_Step1(objectEvent, sprite); } @@ -7140,7 +7160,7 @@ bool8 MovementAction_AcroWheelieHopDown_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_AcroWheelieHopUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_NORTH, 1, 1); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); return MovementAction_AcroWheelieHopUp_Step1(objectEvent, sprite); } @@ -7157,7 +7177,7 @@ bool8 MovementAction_AcroWheelieHopUp_Step1(struct ObjectEvent *objectEvent, str bool8 MovementAction_AcroWheelieHopLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_WEST, 1, 1); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); return MovementAction_AcroWheelieHopLeft_Step1(objectEvent, sprite); } @@ -7174,7 +7194,7 @@ bool8 MovementAction_AcroWheelieHopLeft_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_AcroWheelieHopRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_EAST, 1, 1); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); return MovementAction_AcroWheelieHopRight_Step1(objectEvent, sprite); } @@ -7191,7 +7211,7 @@ bool8 MovementAction_AcroWheelieHopRight_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_SOUTH, 2, 0); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); return MovementAction_AcroWheelieJumpDown_Step1(objectEvent, sprite); } @@ -7208,7 +7228,7 @@ bool8 MovementAction_AcroWheelieJumpDown_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_NORTH, 2, 0); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); return MovementAction_AcroWheelieJumpUp_Step1(objectEvent, sprite); } @@ -7225,7 +7245,7 @@ bool8 MovementAction_AcroWheelieJumpUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieJumpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_WEST, 2, 0); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); return MovementAction_AcroWheelieJumpLeft_Step1(objectEvent, sprite); } @@ -7242,7 +7262,7 @@ bool8 MovementAction_AcroWheelieJumpLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_EAST, 2, 0); + sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); return MovementAction_AcroWheelieJumpRight_Step1(objectEvent, sprite); } @@ -7259,25 +7279,25 @@ bool8 MovementAction_AcroWheelieJumpRight_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieInPlaceDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_SOUTH, GetAcroWheeliePedalDirectionAnimNum(DIR_SOUTH), 8); + sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_NORTH, GetAcroWheeliePedalDirectionAnimNum(DIR_NORTH), 8); + sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_WEST, GetAcroWheeliePedalDirectionAnimNum(DIR_WEST), 8); + sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_EAST, GetAcroWheeliePedalDirectionAnimNum(DIR_EAST), 8); + sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } @@ -7290,7 +7310,7 @@ void sub_80960C8(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroPopWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_SOUTH, 1); + sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroPopWheelieMoveDown_Step1(objectEvent, sprite); } @@ -7306,7 +7326,7 @@ bool8 MovementAction_AcroPopWheelieMoveDown_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroPopWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_NORTH, 1); + sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroPopWheelieMoveUp_Step1(objectEvent, sprite); } @@ -7322,7 +7342,7 @@ bool8 MovementAction_AcroPopWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroPopWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_WEST, 1); + sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroPopWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -7338,7 +7358,7 @@ bool8 MovementAction_AcroPopWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroPopWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_EAST, 1); + sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroPopWheelieMoveRight_Step1(objectEvent, sprite); } @@ -7360,7 +7380,7 @@ void sub_8096200(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_SOUTH, 1); + sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroWheelieMoveDown_Step1(objectEvent, sprite); } @@ -7376,7 +7396,7 @@ bool8 MovementAction_AcroWheelieMoveDown_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_NORTH, 1); + sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroWheelieMoveUp_Step1(objectEvent, sprite); } @@ -7392,7 +7412,7 @@ bool8 MovementAction_AcroWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_WEST, 1); + sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -7408,7 +7428,7 @@ bool8 MovementAction_AcroWheelieMoveLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_EAST, 1); + sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroWheelieMoveRight_Step1(objectEvent, sprite); } @@ -7431,7 +7451,7 @@ void sub_8096330(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroEndWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_SOUTH, 1); + sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroEndWheelieMoveDown_Step1(objectEvent, sprite); } @@ -7447,7 +7467,7 @@ bool8 MovementAction_AcroEndWheelieMoveDown_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroEndWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_NORTH, 1); + sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroEndWheelieMoveUp_Step1(objectEvent, sprite); } @@ -7463,7 +7483,7 @@ bool8 MovementAction_AcroEndWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroEndWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_WEST, 1); + sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroEndWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -7479,7 +7499,7 @@ bool8 MovementAction_AcroEndWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroEndWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_EAST, 1); + sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); return MovementAction_AcroEndWheelieMoveRight_Step1(objectEvent, sprite); } @@ -9227,101 +9247,67 @@ bool8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct S } //sideways stairs -/* -u8 GetSidewaysStairsToRightDirection(s16 x, s16 y, u8 z) -{ - static bool8 (*const sRightStairsBehaviors[])(u8) = { - MetatileBehavior_IsWalkSouth, - MetatileBehavior_IsWalkNorth, - MetatileBehavior_IsSidewaysStairsRight, - MetatileBehavior_IsSidewaysStairsRight, - }; - - u8 metatileBehavior; - u8 index = z; - - if (index == DIR_NONE) - return DIR_NONE; - else if (index > DIR_EAST) - index -= DIR_EAST; - - index--; - metatileBehavior = MapGridGetMetatileBehaviorAt(x, y); - if (MetatileBehavior_IsEastBlocked(metatileBehavior)) - return DIR_NONE; - - if (sRightStairsBehaviors[index](metatileBehavior)) - return index + 1; - - return DIR_NONE; -} - -u8 GetSidewaysStairsToLeftDirection(s16 x, s16 y, u8 z) -{ - static bool8 (*const sLeftStairsBehaviors[])(u8) = { - MetatileBehavior_IsWalkSouth, - MetatileBehavior_IsWalkNorth, - MetatileBehavior_IsSidewaysStairsLeft, - MetatileBehavior_IsSidewaysStairsLeft, - }; - - u8 metatileBehavior; - u8 index = z; - - if (index == DIR_NONE) - return DIR_NONE; - else if (index > 4) - index -= 4; - - index--; - metatileBehavior = MapGridGetMetatileBehaviorAt(x, y); - if (MetatileBehavior_IsWestBlocked(metatileBehavior)) - return DIR_NONE; - - if (sLeftStairsBehaviors[index](metatileBehavior) == 1) - return index + 1; - - return DIR_NONE; -} -*/ - bool8 MovementAction_WalkStairDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->facingDirection = DIR_WEST; objectEvent->facingDirectionLocked = TRUE; - sub_8093B60(objectEvent, sprite, DIR_NORTHWEST); - return MovementAction_WalkSlowDiagonalUpLeft_Step1(objectEvent, sprite); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + sub_8093B60(objectEvent, sprite, DIR_NORTHWEST); + return MovementAction_WalkSlowDiagonalUpLeft_Step1(objectEvent, sprite); + #else + do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 0); + return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); + #endif } bool8 MovementAction_WalkStairDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->facingDirection = DIR_EAST; objectEvent->facingDirectionLocked = TRUE; - sub_8093B60(objectEvent, sprite, DIR_NORTHEAST); - return MovementAction_WalkSlowDiagonalUpRight_Step1(objectEvent, sprite); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + sub_8093B60(objectEvent, sprite, DIR_NORTHEAST); + return MovementAction_WalkSlowDiagonalUpRight_Step1(objectEvent, sprite); + #else + do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 0); + return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); + #endif } bool8 MovementAction_WalkStairDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->facingDirection = DIR_WEST; objectEvent->facingDirectionLocked = TRUE; - sub_8093B60(objectEvent, sprite, DIR_SOUTHWEST); - return MovementAction_WalkSlowDiagonalDownLeft_Step1(objectEvent, sprite); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + sub_8093B60(objectEvent, sprite, DIR_SOUTHWEST); + return MovementAction_WalkSlowDiagonalDownLeft_Step1(objectEvent, sprite); + #else + do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 0); + return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); + #endif } bool8 MovementAction_WalkStairDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->facingDirection = DIR_EAST; objectEvent->facingDirectionLocked = TRUE; - sub_8093B60(objectEvent, sprite, DIR_SOUTHEAST); - return MovementAction_WalkSlowDiagonalDownRight_Step1(objectEvent, sprite); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + sub_8093B60(objectEvent, sprite, DIR_SOUTHEAST); + return MovementAction_WalkSlowDiagonalDownRight_Step1(objectEvent, sprite); + #else + do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 0); + return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); + #endif } bool8 MovementAction_RunStairDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->facingDirection = DIR_WEST; objectEvent->facingDirectionLocked = TRUE; - StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHWEST); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHWEST); + #else + StartRunningAnim(objectEvent, sprite, DIR_NORTHWEST); + #endif return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); } @@ -9329,7 +9315,11 @@ bool8 MovementAction_RunStairDiagonalUpRight_Step0(struct ObjectEvent *objectEve { objectEvent->facingDirection = DIR_EAST; objectEvent->facingDirectionLocked = TRUE; - StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHEAST); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHEAST); + #else + StartRunningAnim(objectEvent, sprite, DIR_NORTHEAST); + #endif return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); } @@ -9337,7 +9327,11 @@ bool8 MovementAction_RunStairDiagonalDownLeft_Step0(struct ObjectEvent *objectEv { objectEvent->facingDirection = DIR_WEST; objectEvent->facingDirectionLocked = TRUE; - StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHWEST); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHWEST); + #else + StartRunningAnim(objectEvent, sprite, DIR_SOUTHWEST); + #endif return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); } @@ -9345,7 +9339,11 @@ bool8 MovementAction_RunStairDiagonalDownRight_Step0(struct ObjectEvent *objectE { objectEvent->facingDirection = DIR_EAST; objectEvent->facingDirectionLocked = TRUE; - StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHEAST); + #if SLOW_MOVEMENT_ON_STAIRS == TRUE + StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHEAST); + #else + StartRunningAnim(objectEvent, sprite, DIR_SOUTHEAST); + #endif return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); } @@ -9363,7 +9361,7 @@ bool8 MovementAction_AcroBikeDiagonalUpLeft_Step0(struct ObjectEvent *objectEven { objectEvent->facingDirection = DIR_WEST; objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS + #if SLOW_MOVEMENT_ON_STAIRS == TRUE do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 0); #else do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 2); @@ -9375,7 +9373,7 @@ bool8 MovementAction_AcroBikeDiagonalDownLeft_Step0(struct ObjectEvent *objectEv { objectEvent->facingDirection = DIR_WEST; objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS + #if SLOW_MOVEMENT_ON_STAIRS == TRUE do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 0); #else do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 2); @@ -9387,7 +9385,7 @@ bool8 MovementAction_AcroBikeDiagonalUpRight_Step0(struct ObjectEvent *objectEve { objectEvent->facingDirection = DIR_EAST; objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS + #if SLOW_MOVEMENT_ON_STAIRS == TRUE do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 0); #else do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 2); @@ -9399,7 +9397,7 @@ bool8 MovementAction_AcroBikeDiagonalDownRight_Step0(struct ObjectEvent *objectE { objectEvent->facingDirection = DIR_EAST; objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS + #if SLOW_MOVEMENT_ON_STAIRS == TRUE do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 0); #else do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 2); diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index cec876555c..b130021912 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -690,31 +690,11 @@ bool32 PlayerIsMovingOnRockStairs(u8 direction) case DIR_SOUTH: MoveCoords(DIR_SOUTH, &x, &y); return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - /* - case DIR_WEST: - MoveCoords(DIR_WEST, &x, &y); - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - case DIR_EAST: - MoveCoords(DIR_EAST, &x, &y); - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - case DIR_SOUTHWEST: - MoveCoords(DIR_SOUTHWEST, &x, &y); - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - case DIR_SOUTHEAST: - MoveCoords(DIR_SOUTHEAST, &x, &y); - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - case DIR_NORTHWEST: - MoveCoords(DIR_NORTHWEST, &x, &y); - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - case DIR_NORTHEAST: - MoveCoords(DIR_NORTHEAST, &x, &y); - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - */ default: return FALSE; } #else - return FALSE + return FALSE; #endif } @@ -2344,24 +2324,6 @@ static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *delayTimer) } //sideways stairs -/* -static bool8 IsSidewaysStairToRight(s16 x, s16 y, u8 z) -{ - if (GetSidewaysStairsToRightDirection(x, y, z) != 0) - return TRUE; - else - return FALSE; -} - -static bool8 IsSidewaysStairToLeft(s16 x, s16 y, u8 z) -{ - if (GetSidewaysStairsToLeftDirection(x, y, z) != 0) - return TRUE; - else - return FALSE; -} -*/ - u8 GetRightSideStairsDirection(u8 direction) { switch (direction) @@ -2413,14 +2375,3 @@ void PlayerSidewaysStairsLeftSideRunning(u8 direction) { PlayerSetAnimId(GetDiagonalLeftStairsRunningMovement(direction), 8); } - -void PlayerSidewaysStairsToAcroBikeLeft(u8 direction) -{ - PlayerSetAnimId(GetDiagonalLeftAcroBikeMovement(direction), 8); -} - -void PlayerSidewaysStairsToAcroBikeRight(u8 direction) -{ - PlayerSetAnimId(GetDiagonalRightAcroBikeMovement(direction), 8); -} - diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index f490d25931..86e4ec98b3 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1566,7 +1566,7 @@ bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior) bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior) { - if (metatileBehavior == MB_ROCK_STAIRS) // || metatileBehavior == MB_SIDEWAYS_STAIRS_LEFT || metatileBehavior == MB_SIDEWAYS_STAIRS_RIGHT) + if (metatileBehavior == MB_ROCK_STAIRS) return TRUE; else return FALSE; From 492683eeb6367d86bc84d2040828cbd0de065dd1 Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 6 Jun 2020 13:19:17 -0600 Subject: [PATCH 008/133] fix stairs north dir bug --- src/field_player_avatar.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index b130021912..e156774d42 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -753,6 +753,9 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u return COLLISION_IMPASSABLE; else if (MetatileBehavior_IsSidewaysStairsLeftSideBottom(metatileBehavior) && (direction == DIR_WEST || direction == DIR_SOUTH)) return COLLISION_IMPASSABLE; + else if ((MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) + && direction == DIR_NORTH && collision == COLLISION_NONE) + return COLLISION_IMPASSABLE; //trying to move north off of top-most tile onto same level doesn't work if (MetatileBehavior_IsSidewaysStairsLeftSide(metatileBehavior)) { From 7d4545c088e9d181c763dc23a2d9223f0a0d160e Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 7 Jun 2020 07:13:47 -0600 Subject: [PATCH 009/133] fix same-level movement on stairs --- src/event_object_movement.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 70970c80bc..5ce8a8e986 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1160,30 +1160,30 @@ const u8 gRunSlowMovementActions[] = { // sideways stairs const u8 gDiagonalStairLeftSideMovementActions[] = { //movement actions for stairs on left side of a wall (southwest and northeast) - [DIR_NONE] = MOVEMENT_ACTION_WALK_SLOW_DOWN, - [DIR_SOUTH] = MOVEMENT_ACTION_WALK_SLOW_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, + [DIR_NONE] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_NORMAL_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT, }; const u8 gDiagonalStairRightSideMovementActions[] = { //movement actions for stairs on right side of a wall (southeast and northwest) - [DIR_NONE] = MOVEMENT_ACTION_WALK_SLOW_DOWN, - [DIR_SOUTH] = MOVEMENT_ACTION_WALK_SLOW_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, + [DIR_NONE] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_NORMAL_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT, }; const u8 gDiagonalStairRightSideRunningMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_RUN_DOWN_SLOW, - [DIR_SOUTH] = MOVEMENT_ACTION_RUN_DOWN_SLOW, - [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, + [DIR_NONE] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_PLAYER_RUN_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING, }; const u8 gDiagonalStairLeftSideRunningMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_RUN_DOWN_SLOW, - [DIR_SOUTH] = MOVEMENT_ACTION_RUN_DOWN_SLOW, - [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, + [DIR_NONE] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_PLAYER_RUN_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING, [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING, }; From 3f94abf03d7b63bcd4a8332a7833759f8c72fe35 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 7 Jun 2020 07:37:39 -0600 Subject: [PATCH 010/133] fix collision freezing --- src/event_object_movement.c | 22 +++++++++++ src/field_player_avatar.c | 75 ++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 42 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 5ce8a8e986..9e02edfef4 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4873,6 +4873,28 @@ static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; + u8 currentBehavior = MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y); + u8 nextBehavior = MapGridGetMetatileBehaviorAt(x, y); + + //sideways stairs checks + if (MetatileBehavior_IsSidewaysStairsLeftSideTop(nextBehavior) && dir == DIR_EAST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from regular ground -> nope + else if (MetatileBehavior_IsSidewaysStairsRightSideTop(nextBehavior) && dir == DIR_WEST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from regular ground -> nope + else if (MetatileBehavior_IsSidewaysStairsRightSideBottom(nextBehavior) && (dir == DIR_EAST || dir == DIR_SOUTH)) + return COLLISION_IMPASSABLE; //moving into right-side bottom edge from regular ground -> nah + else if (MetatileBehavior_IsSidewaysStairsLeftSideBottom(nextBehavior) && (dir == DIR_WEST || dir == DIR_SOUTH)) + return COLLISION_IMPASSABLE; //moving onto left-side bottom edge from regular ground -> nah + else if ((MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) + && dir == DIR_NORTH) + return COLLISION_IMPASSABLE; //trying to move north off of top-most tile onto same level doesn't work + else if (!(MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) + && dir == DIR_SOUTH && (MetatileBehavior_IsSidewaysStairsLeftSideTop(nextBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(nextBehavior))) + return COLLISION_IMPASSABLE; //trying to move south onto top stair tile at same level from non-stair -> no + else if (!(MetatileBehavior_IsSidewaysStairsLeftSideBottom(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideBottom(currentBehavior)) + && dir == DIR_NORTH && (MetatileBehavior_IsSidewaysStairsLeftSideBottom(nextBehavior) || MetatileBehavior_IsSidewaysStairsRightSideBottom(nextBehavior))) + return COLLISION_IMPASSABLE; //trying to move north onto top stair tile at same level from non-stair -> no + if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) return COLLISION_OUTSIDE_RANGE; else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction)) diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index e156774d42..dd52e3a612 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -745,49 +745,40 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u } //sideways stairs logic - if (MetatileBehavior_IsSidewaysStairsLeftSideTop(metatileBehavior) && direction == DIR_EAST) - return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move - else if (MetatileBehavior_IsSidewaysStairsRightSideTop(metatileBehavior) && direction == DIR_WEST) - return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move - else if (MetatileBehavior_IsSidewaysStairsRightSideBottom(metatileBehavior) && (direction == DIR_EAST || direction == DIR_SOUTH)) - return COLLISION_IMPASSABLE; - else if (MetatileBehavior_IsSidewaysStairsLeftSideBottom(metatileBehavior) && (direction == DIR_WEST || direction == DIR_SOUTH)) - return COLLISION_IMPASSABLE; - else if ((MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) - && direction == DIR_NORTH && collision == COLLISION_NONE) - return COLLISION_IMPASSABLE; //trying to move north off of top-most tile onto same level doesn't work - - if (MetatileBehavior_IsSidewaysStairsLeftSide(metatileBehavior)) + if (direction == DIR_WEST || direction == DIR_EAST) { - //moving ONTO left side stair - if (direction == DIR_WEST && currentBehavior != metatileBehavior) - return collision; //moving onto top part of left-stair going left, so no diagonal - else - return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; // move diagonally - } - else if (MetatileBehavior_IsSidewaysStairsRightSide(metatileBehavior)) - { - //moving ONTO right side stair - if (direction == DIR_EAST && currentBehavior != metatileBehavior) - return collision; //moving onto top part of right-stair going right, so no diagonal - else - return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; - } - else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currentBehavior)) - { - //moving OFF of any left side stair - if (direction == DIR_WEST && metatileBehavior != currentBehavior) - return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; //moving off of left stairs onto non-stair -> move diagonal - else - return collision; //moving off of left side stair to east -> move east - } - else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currentBehavior)) - { - //moving OFF of any right side stair - if (direction == DIR_EAST && metatileBehavior != currentBehavior) - return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; //moving off right stair onto non-stair -> move diagonal - else - return collision; + if (MetatileBehavior_IsSidewaysStairsLeftSide(metatileBehavior)) + { + //moving ONTO left side stair + if (direction == DIR_WEST && currentBehavior != metatileBehavior) + return collision; //moving onto top part of left-stair going left, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; // move diagonally + } + else if (MetatileBehavior_IsSidewaysStairsRightSide(metatileBehavior)) + { + //moving ONTO right side stair + if (direction == DIR_EAST && currentBehavior != metatileBehavior) + return collision; //moving onto top part of right-stair going right, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; + } + else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currentBehavior)) + { + //moving OFF of any left side stair + if (direction == DIR_WEST && metatileBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; //moving off of left stairs onto non-stair -> move diagonal + else + return collision; //moving off of left side stair to east -> move east + } + else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currentBehavior)) + { + //moving OFF of any right side stair + if (direction == DIR_EAST && metatileBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; //moving off right stair onto non-stair -> move diagonal + else + return collision; + } } return collision; From d3d29d7cb565aeb39952c4b4c0945cabb4d304c9 Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 19 Jun 2020 23:40:12 -0600 Subject: [PATCH 011/133] cherry pick 0cccbfd0ba608287d5f2b642ea613d9674cd919d --- include/constants/event_object_movement.h | 18 +- include/constants/global.h | 2 - include/event_object_movement.h | 16 +- include/field_player_avatar.h | 4 - include/global.fieldmap.h | 3 +- include/metatile_behavior.h | 1 - src/bike.c | 95 +-- .../movement_action_func_tables.h | 130 ---- src/event_object_movement.c | 693 +++++++++--------- src/field_control_avatar.c | 46 +- src/field_player_avatar.c | 127 +--- src/metatile_behavior.c | 7 - 12 files changed, 451 insertions(+), 691 deletions(-) diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 5172e12d51..7a02b2b976 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -241,27 +241,11 @@ #define MOVEMENT_ACTION_FIGURE_8 0x9B #define MOVEMENT_ACTION_FLY_UP 0x9C #define MOVEMENT_ACTION_FLY_DOWN 0x9D -// slow running (for stairs) +// slow running #define MOVEMENT_ACTION_RUN_DOWN_SLOW 0x9E #define MOVEMENT_ACTION_RUN_UP_SLOW 0x9F #define MOVEMENT_ACTION_RUN_LEFT_SLOW 0xA0 #define MOVEMENT_ACTION_RUN_RIGHT_SLOW 0xA1 -// sideways stairs - walking -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT 0xA2 -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT 0xA3 -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT 0xA4 -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT 0xA5 -// sideways stairs - running -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING 0xA6 -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING 0xA7 -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING 0xA8 -#define MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING 0xA9 -// sideways stairs - acro bike -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT 0xAA -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT 0xAB -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT 0xAC -#define MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT 0xAD -//sideways stairs - mach bike #define MOVEMENT_ACTION_STEP_END 0xFE diff --git a/include/constants/global.h b/include/constants/global.h index 4a3f0618a8..213ccca5b5 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -118,6 +118,4 @@ #define DIR_NORTHWEST 7 #define DIR_NORTHEAST 8 -#define SLOW_MOVEMENT_ON_STAIRS TRUE // change to false to keep emerald's normal movement speed on outdoor stairs - #endif // GUARD_CONSTANTS_GLOBAL_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 84c89a85d3..61e7c5d6c2 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -82,6 +82,7 @@ bool8 TryGetObjectEventIdByLocalIdAndMap(u8, u8, u8, u8 *); u8 GetObjectEventIdByXY(s16, s16); void SetObjectEventDirection(struct ObjectEvent *, u8); u8 GetFirstInactiveObjectEventId(void); +void RemoveObjectEvent(struct ObjectEvent *objectEvent); void RemoveObjectEventByLocalIdAndMap(u8, u8, u8); void LoadPlayerObjectReflectionPalette(u16, u8); void LoadSpecialObjectReflectionPalette(u16, u8); @@ -125,6 +126,7 @@ u8 GetWalkInPlaceFastMovementAction(u32); u8 GetWalkInPlaceNormalMovementAction(u32); u8 GetWalkInPlaceSlowMovementAction(u32); u8 GetCollisionAtCoords(struct ObjectEvent *, s16, s16, u32); +u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction); void MoveCoords(u8, s16 *, s16 *); bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *); u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *); @@ -205,6 +207,8 @@ void CameraObjectReset2(void); u8 GetObjectEventBerryTreeId(u8 objectEventId); void SetBerryTreeJustPicked(u8 mapId, u8 mapNumber, u8 mapGroup); bool8 IsBerryTreeSparkling(u8, u8, u8); +struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup); +u8 TrySpawnObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY); void MovementType_None(struct Sprite *); void MovementType_LookAround(struct Sprite *); @@ -422,21 +426,23 @@ u8 MovementType_RunInPlace_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *); + void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible); bool32 IsObjectEventSpriteInvisible(u8 objectEventId); void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId); void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum); bool32 IsObjectEventSpriteAnimating(u8 objectEventId); +// NEW +u16 GetMiniStepCount(u8 speed); +void RunMiniStep(struct Sprite *sprite, u8 speed, u8 currentFrame); +bool8 PlayerIsUnderWaterfall(struct ObjectEvent *objectEvent); + // run slow u8 GetPlayerRunSlowMovementAction(u32); //sideways stairs u8 GetSidewaysStairsToRightDirection(s16, s16, u8); u8 GetSidewaysStairsToLeftDirection(s16, s16, u8); -u8 GetDiagonalRightStairsMovement(u32); -u8 GetDiagonalLeftStairsMovement(u32); -u8 GetDiagonalRightStairsRunningMovement(u32); -u8 GetDiagonalLeftStairsRunningMovement(u32); -extern u8 gSidewaysStairsDirection; +u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 currentBehavior, u8 nextBehavior, u8 collision); #endif //GUARD_EVENT_OBJECT_MOVEMENT_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index f9cdfa838d..0f53e0b28d 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -68,9 +68,5 @@ bool32 PlayerIsMovingOnRockStairs(u8 direction); //sideways stairs u8 GetRightSideStairsDirection(u8 direction); u8 GetLeftSideStairsDirection(u8 direction); -void PlayerSidewaysStairsRightSide(u8 direction); -void PlayerSidewaysStairsLeftSide(u8 direction); -void PlayerSidewaysStairsRightSideRunning(u8 direction); -void PlayerSidewaysStairsLeftSideRunning(u8 direction); #endif // GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index a4c486c960..234bf9f914 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -205,7 +205,8 @@ struct ObjectEvent /*0x1D*/ u8 trainerRange_berryTreeId; /*0x1E*/ u8 currentMetatileBehavior; /*0x1F*/ u8 previousMetatileBehavior; - /*0x20*/ u8 previousMovementDirection; + /*0x20*/ u8 previousMovementDirection:4; + u8 directionOverwrite:4; /*0x21*/ u8 directionSequenceIndex; /*0x22*/ u8 playerCopyableMovement; /*size = 0x24*/ diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 715f9ef127..128978cae6 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -145,7 +145,6 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); -bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior); //sideways stairs bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8); bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8); diff --git a/src/bike.c b/src/bike.c index a21dcb33e1..1fe5b58b43 100644 --- a/src/bike.c +++ b/src/bike.c @@ -142,6 +142,19 @@ static u8 GetMachBikeTransition(u8 *dirTraveling) { // if the dir updated before this function, get the relevent new direction to check later. u8 direction = GetPlayerMovementDirection(); + + // fix direction when moving on sideways stairs + switch (direction) + { + case DIR_SOUTHWEST: + case DIR_NORTHWEST: + direction = DIR_WEST; + break; + case DIR_SOUTHEAST: + case DIR_NORTHEAST: + direction = DIR_EAST; + break; + } // is the player standing still? if (*dirTraveling == 0) @@ -178,7 +191,7 @@ static u8 GetMachBikeTransition(u8 *dirTraveling) // the difference between face direction and turn direction is that one changes direction while the other does the animation of turning as well as changing direction. static void MachBikeTransition_FaceDirection(u8 direction) -{ +{ PlayerFaceDirection(direction); Bike_SetBikeStill(); } @@ -231,41 +244,8 @@ static void MachBikeTransition_TrySpeedUp(u8 direction) PlayerOnBikeCollide(direction); } } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - { - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - gPlayerAvatar.bikeFrameCounter = 0; - gPlayerAvatar.bikeSpeed = SPEED_STANDING; - PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); - return; - #else - gPlayerAvatar.bikeFrameCounter = 2; - gPlayerAvatar.bikeSpeed = SPEED_STANDING; - PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); - return; - #endif - - } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - { - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - gPlayerAvatar.bikeFrameCounter = 0; - gPlayerAvatar.bikeSpeed = SPEED_STANDING; - PlayerGoSpeed2(GetRightSideStairsDirection(direction)); - return; - #else - gPlayerAvatar.bikeFrameCounter = 2; - gPlayerAvatar.bikeSpeed = SPEED_STANDING; - PlayerGoSpeed2(GetRightSideStairsDirection(direction)); - return; - #endif - - } else { - if (PlayerIsMovingOnRockStairs(direction)) - gPlayerAvatar.bikeFrameCounter--; - sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction); gPlayerAvatar.bikeSpeed = gPlayerAvatar.bikeFrameCounter + (gPlayerAvatar.bikeFrameCounter >> 1); // same as dividing by 2, but compiler is insistent on >> 1 if (gPlayerAvatar.bikeFrameCounter < 2) // do not go faster than the last element in the mach bike array @@ -300,13 +280,6 @@ static void MachBikeTransition_TrySlowDown(u8 direction) } else { - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - return PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - return PlayerGoSpeed2(GetRightSideStairsDirection(direction)); - #endif - sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction); } } @@ -314,13 +287,11 @@ static void MachBikeTransition_TrySlowDown(u8 direction) // the acro bike requires the input handler to be executed before the transition can. static void MovePlayerOnAcroBike(u8 newDirection, u16 newKeys, u16 heldKeys) { - gSidewaysStairsDirection = newDirection; sAcroBikeTransitions[CheckMovementInputAcroBike(&newDirection, newKeys, heldKeys)](newDirection); } static u8 CheckMovementInputAcroBike(u8 *newDirection, u16 newKeys, u16 heldKeys) { - gSidewaysStairsDirection = *newDirection; return sAcroBikeInputHandlers[gPlayerAvatar.acroBikeState](newDirection, newKeys, heldKeys); } @@ -409,7 +380,7 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16 struct ObjectEvent *playerObjEvent; direction = GetPlayerMovementDirection(); - gSidewaysStairsDirection = direction; + //gSidewaysStairsDirection = direction; playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; gPlayerAvatar.runningState = NOT_MOVING; @@ -606,15 +577,7 @@ static void AcroBikeTransition_Moving(u8 direction) } else { - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - return PlayerGoSpeed2(GetRightSideStairsDirection(direction)); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - return PlayerGoSpeed2(GetLeftSideStairsDirection(direction)); - - if (PlayerIsMovingOnRockStairs(direction)) - PlayerGoSpeed2(direction); - else - PlayerRideWaterCurrent(direction); + PlayerRideWaterCurrent(direction); } } @@ -683,11 +646,6 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction) else { derp: - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - gSidewaysStairsDirection = GetRightSideStairsDirection(direction); - PlayerMovingHoppingWheelie(direction); } } @@ -756,11 +714,6 @@ static void AcroBikeTransition_WheelieMoving(u8 direction) return; } - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - gSidewaysStairsDirection = GetRightSideStairsDirection(direction); - PlayerWheelieMove(direction); gPlayerAvatar.runningState = MOVING; } @@ -795,12 +748,7 @@ static void AcroBikeTransition_WheelieRisingMoving(u8 direction) } return; } - - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - gSidewaysStairsDirection = GetRightSideStairsDirection(direction); - + PlayerPopWheelieWhileMoving(direction); gPlayerAvatar.runningState = MOVING; } @@ -824,12 +772,7 @@ static void AcroBikeTransition_WheelieLoweringMoving(u8 direction) PlayerEndWheelie(direction); return; } - - if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - gSidewaysStairsDirection = GetLeftSideStairsDirection(direction); - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - gSidewaysStairsDirection = GetRightSideStairsDirection(direction); - + PlayerEndWheelieWhileMoving(direction); } @@ -1090,7 +1033,7 @@ void Bike_UpdateBikeCounterSpeed(u8 counter) static void Bike_SetBikeStill(void) { - gSidewaysStairsDirection = gObjectEvents[gPlayerAvatar.objectEventId].facingDirection; + //gSidewaysStairsDirection = gObjectEvents[gPlayerAvatar.objectEventId].facingDirection; gPlayerAvatar.bikeFrameCounter = 0; gPlayerAvatar.bikeSpeed = SPEED_STANDING; } diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 30c1fac2aa..ffc0611a1d 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -267,20 +267,6 @@ u8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sp u8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); u8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); u8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite); -//sideways stairs -u8 MovementAction_WalkStairDiagonalUpLeft_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkStairDiagonalUpRight_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkStairDiagonalDownLeft_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_WalkStairDiagonalDownRight_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_RunStairDiagonalUpLeft_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_RunStairDiagonalUpRight_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_RunStairDiagonalDownLeft_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_RunStairDiagonalDownRight_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_RunStairDiagonal_Step1(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_AcroBikeDiagonalUpLeft_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_AcroBikeDiagonalDownLeft_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_AcroBikeDiagonalUpRight_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_AcroBikeDiagonalDownRight_Step0(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FaceUp[])(struct ObjectEvent *, struct Sprite *); @@ -445,19 +431,6 @@ u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Spri u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Sprite *); -//sideways stairs -u8 (*const gMovementActionFuncs_WalkStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_WalkStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_WalkStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_WalkStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_RunStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_RunStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_RunStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_RunStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *); u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) = { [MOVEMENT_ACTION_FACE_DOWN] = gMovementActionFuncs_FaceDown, @@ -623,19 +596,6 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) [MOVEMENT_ACTION_RUN_UP_SLOW] = gMovementActionFuncs_RunUpSlow, [MOVEMENT_ACTION_RUN_LEFT_SLOW] = gMovementActionFuncs_RunLeftSlow, [MOVEMENT_ACTION_RUN_RIGHT_SLOW] = gMovementActionFuncs_RunRightSlow, - //sideways stairs - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT] = gMovementActionFuncs_WalkStairDiagonalUpLeft, - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT] = gMovementActionFuncs_WalkStairDiagonalUpRight, - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT] = gMovementActionFuncs_WalkStairDiagonalDownLeft, - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT] = gMovementActionFuncs_WalkStairDiagonalDownRight, - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING] = gMovementActionFuncs_RunStairDiagonalUpLeft, - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING] = gMovementActionFuncs_RunStairDiagonalUpRight, - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING] = gMovementActionFuncs_RunStairDiagonalDownLeft, - [MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING] = gMovementActionFuncs_RunStairDiagonalDownRight, - [MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT] = gMovementActionFuncs_AcroBikeDiagonalUpLeft, - [MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT] = gMovementActionFuncs_AcroBikeDiagonalUpRight, - [MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT] = gMovementActionFuncs_AcroBikeDiagonalDownLeft, - [MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT] = gMovementActionFuncs_AcroBikeDiagonalDownRight, }; u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *) = { @@ -1593,93 +1553,3 @@ u8 (*const gMovementActionFuncs_RunRightSlow[])(struct ObjectEvent *, struct Spr MovementAction_PauseSpriteAnim, }; -//sideways stairs -u8 (*const gMovementActionFuncs_WalkStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkStairDiagonalUpLeft_Step0, - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - MovementAction_WalkSlowDiagonalUpLeft_Step1, - #else - MovementAction_WalkNormalDiagonalUpLeft_Step1, - #endif - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_WalkStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkStairDiagonalUpRight_Step0, - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - MovementAction_WalkSlowDiagonalUpRight_Step1, - #else - MovementAction_WalkNormalDiagonalUpRight_Step1, - #endif - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_WalkStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkStairDiagonalDownLeft_Step0, - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - MovementAction_WalkSlowDiagonalDownLeft_Step1, - #else - MovementAction_WalkNormalDiagonalDownLeft_Step1, - #endif - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_WalkStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_WalkStairDiagonalDownRight_Step0, - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - MovementAction_WalkSlowDiagonalDownRight_Step1, - #else - MovementAction_WalkNormalDiagonalDownRight_Step1, - #endif - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_RunStairDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_RunStairDiagonalUpLeft_Step0, - MovementAction_RunStairDiagonal_Step1, - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_RunStairDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_RunStairDiagonalUpRight_Step0, - MovementAction_RunStairDiagonal_Step1, - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_RunStairDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_RunStairDiagonalDownLeft_Step0, - MovementAction_RunStairDiagonal_Step1, - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_RunStairDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_RunStairDiagonalDownRight_Step0, - MovementAction_RunStairDiagonal_Step1, - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpLeft[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_AcroBikeDiagonalUpLeft_Step0, - MovementAction_RideWaterCurrentLeft_Step1, - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_AcroBikeDiagonalDownLeft_Step0, - MovementAction_RideWaterCurrentLeft_Step1, - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_AcroBikeDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_AcroBikeDiagonalUpRight_Step0, - MovementAction_RideWaterCurrentRight_Step1, - MovementAction_PauseSpriteAnim, -}; - -u8 (*const gMovementActionFuncs_AcroBikeDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_AcroBikeDiagonalDownRight_Step0, - MovementAction_RideWaterCurrentRight_Step1, - MovementAction_PauseSpriteAnim, -}; - - diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 9e02edfef4..ebfc902ca3 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -22,11 +22,13 @@ #include "trainer_see.h" #include "trainer_hill.h" #include "util.h" +#include "follow_me.h" #include "constants/event_object_movement.h" #include "constants/event_objects.h" #include "constants/field_effects.h" #include "constants/items.h" #include "constants/mauville_old_man.h" +#include "constants/metatile_behaviors.h" #include "constants/trainer_types.h" #include "constants/union_room.h" @@ -57,13 +59,11 @@ static u8 setup##_callback(struct ObjectEvent *objectEvent, struct Sprite *sprit EWRAM_DATA u8 sCurrentReflectionType = 0; EWRAM_DATA u16 sCurrentSpecialObjectPaletteTag = 0; EWRAM_DATA struct LockedAnimObjectEvents *gLockedAnimObjectEvents = {0}; -EWRAM_DATA u8 gSidewaysStairsDirection = 0; static void MoveCoordsInDirection(u32, s16 *, s16 *, s16, s16); static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *, struct Sprite *); static void SetMovementDelay(struct Sprite *, s16); static bool8 WaitForMovementDelay(struct Sprite *); -static u8 GetCollisionInDirection(struct ObjectEvent *, u8); static u32 state_to_direction(u8, u32, u32); static void TryEnableObjectEventAnim(struct ObjectEvent *, struct Sprite *); static void ObjectEventExecHeldMovementAction(struct ObjectEvent *, struct Sprite *); @@ -113,7 +113,7 @@ static u16 GetObjectEventFlagIdByObjectEventId(u8); static void UpdateObjectEventVisibility(struct ObjectEvent *, struct Sprite *); static void MakeObjectTemplateFromObjectEventTemplate(struct ObjectEventTemplate *, struct SpriteTemplate *, const struct SubspriteTable **); static void GetObjectEventMovingCameraOffset(s16 *, s16 *); -static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8); +//static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8); static void LoadObjectEventPalette(u16); static void RemoveObjectEventIfOutsideView(struct ObjectEvent *); static void sub_808E1B8(u8, s16, s16); @@ -135,6 +135,9 @@ static void InitSpriteForFigure8Anim(struct Sprite *sprite); static bool8 AnimateSpriteInFigure8(struct Sprite *sprite); static void UpdateObjectEventSprite(struct Sprite *); +static void StartSlowRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction); +static bool8 npc_obj_ministep_stop_on_arrival_slow(struct ObjectEvent *objectEvent, struct Sprite *sprite); + const u8 gReflectionEffectPaletteMap[] = {1, 1, 6, 7, 8, 9, 6, 7, 8, 9, 11, 11, 0, 0, 0, 0}; const struct SpriteTemplate gCameraSpriteTemplate = {0, 0xFFFF, &gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, ObjectCB_CameraObject}; @@ -693,10 +696,10 @@ const u8 gMoveDirectionAnimNums[] = { [DIR_NORTH] = 5, [DIR_WEST] = 6, [DIR_EAST] = 7, - [DIR_SOUTHWEST] = 4, - [DIR_SOUTHEAST] = 4, - [DIR_NORTHWEST] = 5, - [DIR_NORTHEAST] = 5, + [DIR_SOUTHWEST] = 6, + [DIR_SOUTHEAST] = 7, + [DIR_NORTHWEST] = 6, + [DIR_NORTHEAST] = 7, }; const u8 gMoveDirectionFastAnimNums[] = { [DIR_NONE] = 8, @@ -704,10 +707,10 @@ const u8 gMoveDirectionFastAnimNums[] = { [DIR_NORTH] = 9, [DIR_WEST] = 10, [DIR_EAST] = 11, - [DIR_SOUTHWEST] = 8, - [DIR_SOUTHEAST] = 8, - [DIR_NORTHWEST] = 9, - [DIR_NORTHEAST] = 9, + [DIR_SOUTHWEST] = 10, + [DIR_SOUTHEAST] = 11, + [DIR_NORTHWEST] = 10, + [DIR_NORTHEAST] = 11, }; const u8 gMoveDirectionFasterAnimNums[] = { [DIR_NONE] = 12, @@ -715,10 +718,10 @@ const u8 gMoveDirectionFasterAnimNums[] = { [DIR_NORTH] = 13, [DIR_WEST] = 14, [DIR_EAST] = 15, - [DIR_SOUTHWEST] = 12, - [DIR_SOUTHEAST] = 12, - [DIR_NORTHWEST] = 13, - [DIR_NORTHEAST] = 13, + [DIR_SOUTHWEST] = 14, + [DIR_SOUTHEAST] = 15, + [DIR_NORTHWEST] = 14, + [DIR_NORTHEAST] = 15, }; const u8 gMoveDirectionFastestAnimNums[] = { [DIR_NONE] = 16, @@ -726,10 +729,10 @@ const u8 gMoveDirectionFastestAnimNums[] = { [DIR_NORTH] = 17, [DIR_WEST] = 18, [DIR_EAST] = 19, - [DIR_SOUTHWEST] = 16, - [DIR_SOUTHEAST] = 16, - [DIR_NORTHWEST] = 17, - [DIR_NORTHEAST] = 17, + [DIR_SOUTHWEST] = 18, + [DIR_SOUTHEAST] = 19, + [DIR_NORTHWEST] = 18, + [DIR_NORTHEAST] = 19, }; const u8 gJumpSpecialDirectionAnimNums[] = { // used for jumping onto surf mon [DIR_NONE] = 20, @@ -831,18 +834,6 @@ const u8 gFishingBiteDirectionAnimNums[] = { [DIR_NORTHEAST] = 9, }; const u8 gRunningDirectionAnimNums[] = { - [DIR_NONE] = 20, - [DIR_SOUTH] = 20, - [DIR_NORTH] = 21, - [DIR_WEST] = 22, - [DIR_EAST] = 23, - [DIR_SOUTHWEST] = 20, - [DIR_SOUTHEAST] = 20, - [DIR_NORTHWEST] = 21, - [DIR_NORTHEAST] = 21, -}; - -const u8 gStairsRunningDirectionAnimNums[] = { [DIR_NONE] = 20, [DIR_SOUTH] = 20, [DIR_NORTH] = 21, @@ -913,10 +904,6 @@ const u8 gWalkSlowMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_WALK_SLOW_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_SLOW_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_SLOW_RIGHT, - [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT, - [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT, - [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_LEFT, - [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT }; const u8 gWalkNormalMovementActions[] = { [DIR_NONE] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, @@ -924,10 +911,6 @@ const u8 gWalkNormalMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_WALK_NORMAL_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_NORMAL_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_NORMAL_RIGHT, - [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT, - [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT, - [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT, - [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT }; const u8 gWalkFastMovementActions[] = { [DIR_NONE] = MOVEMENT_ACTION_WALK_FAST_DOWN, @@ -935,10 +918,6 @@ const u8 gWalkFastMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_WALK_FAST_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_FAST_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_FAST_RIGHT, - [DIR_SOUTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, - [DIR_SOUTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, - [DIR_NORTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, - [DIR_NORTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT, }; const u8 gRideWaterCurrentMovementActions[] = { [DIR_NONE] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN, @@ -946,10 +925,6 @@ const u8 gRideWaterCurrentMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP, [DIR_WEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT, [DIR_EAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT, - [DIR_SOUTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, - [DIR_SOUTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, - [DIR_NORTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, - [DIR_NORTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT }; const u8 gWalkFastestMovementActions[] = { [DIR_NONE] = MOVEMENT_ACTION_WALK_FASTEST_DOWN, @@ -957,24 +932,20 @@ const u8 gWalkFastestMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_WALK_FASTEST_UP, [DIR_WEST] = MOVEMENT_ACTION_WALK_FASTEST_LEFT, [DIR_EAST] = MOVEMENT_ACTION_WALK_FASTEST_RIGHT, - [DIR_SOUTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_LEFT, - [DIR_SOUTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN_RIGHT, - [DIR_NORTHWEST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_LEFT, - [DIR_NORTHEAST] = MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP_RIGHT }; const u8 gSlideMovementActions[] = { - MOVEMENT_ACTION_SLIDE_DOWN, - MOVEMENT_ACTION_SLIDE_DOWN, - MOVEMENT_ACTION_SLIDE_UP, - MOVEMENT_ACTION_SLIDE_LEFT, - MOVEMENT_ACTION_SLIDE_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_SLIDE_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_SLIDE_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_SLIDE_UP, + [DIR_WEST] = MOVEMENT_ACTION_SLIDE_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_SLIDE_RIGHT, }; const u8 gPlayerRunMovementActions[] = { - MOVEMENT_ACTION_PLAYER_RUN_DOWN, - MOVEMENT_ACTION_PLAYER_RUN_DOWN, - MOVEMENT_ACTION_PLAYER_RUN_UP, - MOVEMENT_ACTION_PLAYER_RUN_LEFT, - MOVEMENT_ACTION_PLAYER_RUN_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_PLAYER_RUN_UP, + [DIR_WEST] = MOVEMENT_ACTION_PLAYER_RUN_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_PLAYER_RUN_RIGHT, }; const u8 gJump2MovementActions[] = { MOVEMENT_ACTION_JUMP_2_DOWN, @@ -1012,32 +983,48 @@ const u8 gJumpSpecialMovementActions[] = { MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT, }; const u8 gWalkInPlaceSlowMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT }; const u8 gWalkInPlaceNormalMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT }; const u8 gWalkInPlaceFastMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT }; const u8 gWalkInPlaceFastestMovementActions[] = { - MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_UP, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_LEFT, - MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT, + [DIR_NONE] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN, + [DIR_SOUTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_DOWN, + [DIR_NORTH] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_UP, + [DIR_WEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_LEFT, + [DIR_EAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_LEFT, + [DIR_NORTHWEST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_LEFT, + [DIR_NORTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_WALK_IN_PLACE_FASTEST_RIGHT }; const u8 gAcroWheelieFaceDirectionMovementActions[] = { [DIR_NONE] = MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN, @@ -1158,36 +1145,6 @@ const u8 gRunSlowMovementActions[] = { [DIR_EAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, }; -// sideways stairs -const u8 gDiagonalStairLeftSideMovementActions[] = { //movement actions for stairs on left side of a wall (southwest and northeast) - [DIR_NONE] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, - [DIR_SOUTH] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_WALK_NORMAL_UP, - [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT, - [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT, -}; -const u8 gDiagonalStairRightSideMovementActions[] = { //movement actions for stairs on right side of a wall (southeast and northwest) - [DIR_NONE] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, - [DIR_SOUTH] = MOVEMENT_ACTION_WALK_NORMAL_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_WALK_NORMAL_UP, - [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT, - [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT, -}; -const u8 gDiagonalStairRightSideRunningMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, - [DIR_SOUTH] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_PLAYER_RUN_UP, - [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_LEFT_RUNNING, - [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_RIGHT_RUNNING, -}; -const u8 gDiagonalStairLeftSideRunningMovementActions[] = { - [DIR_NONE] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, - [DIR_SOUTH] = MOVEMENT_ACTION_PLAYER_RUN_DOWN, - [DIR_NORTH] = MOVEMENT_ACTION_PLAYER_RUN_UP, - [DIR_WEST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_DOWN_LEFT_RUNNING, - [DIR_EAST] = MOVEMENT_ACTION_WALK_STAIRS_DIAGONAL_UP_RIGHT_RUNNING, -}; - const u8 gOppositeDirections[] = { DIR_NORTH, DIR_SOUTH, @@ -1271,10 +1228,11 @@ u8 GetFirstInactiveObjectEventId(void) u8 GetObjectEventIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroupId) { - if (localId < OBJ_EVENT_ID_PLAYER) - { + if (localId == 0xFE) + return GetFollowerObjectId(); + else if (localId < OBJ_EVENT_ID_PLAYER) return GetObjectEventIdByLocalIdAndMapInternal(localId, mapNum, mapGroupId); - } + return GetObjectEventIdByLocalId(localId); } @@ -1430,7 +1388,7 @@ static bool8 GetAvailableObjectEventId(u16 localId, u8 mapNum, u8 mapGroup, u8 * return FALSE; } -static void RemoveObjectEvent(struct ObjectEvent *objectEvent) +void RemoveObjectEvent(struct ObjectEvent *objectEvent) { objectEvent->active = FALSE; RemoveObjectEventInternal(objectEvent); @@ -1525,7 +1483,7 @@ static u8 TrySetupObjectEventSprite(struct ObjectEventTemplate *objectEventTempl return objectEventId; } -static u8 TrySpawnObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) +u8 TrySpawnObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) { u8 objectEventId; struct SpriteTemplate spriteTemplate; @@ -2457,7 +2415,10 @@ void SetObjectEventDirection(struct ObjectEvent *objectEvent, u8 direction) static const u8 *GetObjectEventScriptPointerByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup) { - return GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup)->script; + if (GetFollowerLocalId() == 0 || GetFollowerLocalId() != localId) + return GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup)->script; + else + return GetFollowerScriptPointer(); } const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId) @@ -2516,7 +2477,7 @@ u8 GetObjectEventBerryTreeId(u8 objectEventId) return gObjectEvents[objectEventId].trainerRange_berryTreeId; } -static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup) +struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup) { struct ObjectEventTemplate *templates; const struct MapHeader *mapHeader; @@ -4860,7 +4821,7 @@ u8 GetTrainerFacingDirectionMovementType(u8 direction) return gTrainerFacingDirectionMovementTypes[direction]; } -static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) +u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) { s16 x; s16 y; @@ -4870,11 +4831,101 @@ static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) return GetCollisionAtCoords(objectEvent, x, y, direction); } +u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 currentBehavior, u8 nextBehavior, u8 collision) +{ + if ((dir == DIR_SOUTH || dir == DIR_NORTH) && collision != COLLISION_NONE) + return collision; + + if (MetatileBehavior_IsSidewaysStairsLeftSide(nextBehavior)) + { + //moving ONTO left side stair + if (dir == DIR_WEST && currentBehavior != nextBehavior) + return collision; //moving onto top part of left-stair going left, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; // move diagonally + } + else if (MetatileBehavior_IsSidewaysStairsRightSide(nextBehavior)) + { + //moving ONTO right side stair + if (dir == DIR_EAST && currentBehavior != nextBehavior) + return collision; //moving onto top part of right-stair going right, so no diagonal + else + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; + } + else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currentBehavior)) + { + //moving OFF of any left side stair + if (dir == DIR_WEST && nextBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; //moving off of left stairs onto non-stair -> move diagonal + else + return collision; //moving off of left side stair to east -> move east + } + else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currentBehavior)) + { + //moving OFF of any right side stair + if (dir == DIR_EAST && nextBehavior != currentBehavior) + return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; //moving off right stair onto non-stair -> move diagonal + else + return collision; + } + + return collision; +} + +static u8 GetVanillaCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) +{ + if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) + return COLLISION_OUTSIDE_RANGE; + else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction)) + return COLLISION_IMPASSABLE; + else if (objectEvent->trackedByCamera && !CanCameraMoveInDirection(direction)) + return COLLISION_IMPASSABLE; + else if (IsZCoordMismatchAt(objectEvent->currentElevation, x, y)) + return COLLISION_ELEVATION_MISMATCH; + else if (DoesObjectCollideWithObjectAt(objectEvent, x, y)) + return COLLISION_OBJECT_EVENT; + + return COLLISION_NONE; +} + +static bool8 ObjectEventOnLeftSideStair(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) +{ + switch (direction) + { + case DIR_EAST: + MoveCoords(DIR_NORTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + case DIR_WEST: + MoveCoords(DIR_SOUTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + default: + return FALSE; //north/south taken care of in GetVanillaCollision + } +} + +static bool8 ObjectEventOnRightSideStair(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) +{ + switch (direction) + { + case DIR_EAST: + MoveCoords(DIR_SOUTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + case DIR_WEST: + MoveCoords(DIR_NORTH, &x, &y); + return DoesObjectCollideWithObjectAt(objectEvent, x, y); + default: + return FALSE; //north/south taken care of in GetVanillaCollision + } +} + u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { u8 direction = dir; u8 currentBehavior = MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y); u8 nextBehavior = MapGridGetMetatileBehaviorAt(x, y); + u8 collision; + + objectEvent->directionOverwrite = DIR_NONE; //sideways stairs checks if (MetatileBehavior_IsSidewaysStairsLeftSideTop(nextBehavior) && dir == DIR_EAST) @@ -4895,17 +4946,26 @@ u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) && dir == DIR_NORTH && (MetatileBehavior_IsSidewaysStairsLeftSideBottom(nextBehavior) || MetatileBehavior_IsSidewaysStairsRightSideBottom(nextBehavior))) return COLLISION_IMPASSABLE; //trying to move north onto top stair tile at same level from non-stair -> no - if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y)) - return COLLISION_OUTSIDE_RANGE; - else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction)) - return COLLISION_IMPASSABLE; - else if (objectEvent->trackedByCamera && !CanCameraMoveInDirection(direction)) - return COLLISION_IMPASSABLE; - else if (IsZCoordMismatchAt(objectEvent->currentElevation, x, y)) - return COLLISION_ELEVATION_MISMATCH; - else if (DoesObjectCollideWithObjectAt(objectEvent, x, y)) - return COLLISION_OBJECT_EVENT; - return COLLISION_NONE; + // regular checks + collision = GetVanillaCollision(objectEvent, x, y, dir); + + //sideways stairs checks + collision = GetSidewaysStairsCollision(objectEvent, dir, currentBehavior, nextBehavior, collision); + switch (collision) + { + case COLLISION_SIDEWAYS_STAIRS_TO_LEFT: + if (ObjectEventOnLeftSideStair(objectEvent, x, y, dir)) + return COLLISION_OBJECT_EVENT; + objectEvent->directionOverwrite = GetLeftSideStairsDirection(dir); + return COLLISION_NONE; + case COLLISION_SIDEWAYS_STAIRS_TO_RIGHT: + if (ObjectEventOnRightSideStair(objectEvent, x, y, dir)) + return COLLISION_OBJECT_EVENT; + objectEvent->directionOverwrite = GetRightSideStairsDirection(dir); + return COLLISION_NONE; + } + + return collision; } u8 GetCollisionFlagsAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction) @@ -4969,8 +5029,9 @@ static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *objectEvent, s16 for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { curObject = &gObjectEvents[i]; - if (curObject->active && curObject != objectEvent) - { + if (curObject->active && curObject != objectEvent && !FollowMe_IsCollisionExempt(curObject, objectEvent)) + { + // check for collision if curObject is active, not the object in question, and not exempt from collisions if ((curObject->currentCoords.x == x && curObject->currentCoords.y == y) || (curObject->previousCoords.x == x && curObject->previousCoords.y == y)) { if (AreZCoordsCompatible(objectEvent->currentElevation, curObject->currentElevation)) @@ -5124,6 +5185,9 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementAct objectEvent->heldMovementActive = TRUE; objectEvent->heldMovementFinished = FALSE; gSprites[objectEvent->spriteId].data[2] = 0; + + FollowMe(objectEvent, movementActionId, FALSE); + return FALSE; } @@ -5203,12 +5267,6 @@ u8 name(u32 idx)\ return animIds[direction];\ } -//sideways stairs -dirn_to_anim(GetDiagonalRightStairsMovement, gDiagonalStairRightSideMovementActions); -dirn_to_anim(GetDiagonalLeftStairsMovement, gDiagonalStairLeftSideMovementActions); -dirn_to_anim(GetDiagonalRightStairsRunningMovement, gDiagonalStairRightSideRunningMovementActions); -dirn_to_anim(GetDiagonalLeftStairsRunningMovement, gDiagonalStairLeftSideRunningMovementActions); - dirn_to_anim(GetFaceDirectionMovementAction, gFaceDirectionMovementActions); dirn_to_anim(GetWalkSlowMovementAction, gWalkSlowMovementActions); dirn_to_anim(GetPlayerRunSlowMovementAction, gRunSlowMovementActions); @@ -5514,7 +5572,10 @@ bool8 MovementAction_WalkSlowUp_Step1(struct ObjectEvent *objectEvent, struct Sp bool8 MovementAction_WalkSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_WEST); + if (objectEvent->directionOverwrite) + sub_8093B60(objectEvent, sprite, objectEvent->directionOverwrite); + else + sub_8093B60(objectEvent, sprite, DIR_WEST); return MovementAction_WalkSlowLeft_Step1(objectEvent, sprite); } @@ -5530,7 +5591,10 @@ bool8 MovementAction_WalkSlowLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_EAST); + if (objectEvent->directionOverwrite) + sub_8093B60(objectEvent, sprite, objectEvent->directionOverwrite); + else + sub_8093B60(objectEvent, sprite, DIR_EAST); return MovementAction_WalkSlowRight_Step1(objectEvent, sprite); } @@ -5642,7 +5706,10 @@ bool8 MovementAction_WalkNormalUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkNormalLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 0); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 0); + else + do_go_anim(objectEvent, sprite, DIR_WEST, 0); return MovementAction_WalkNormalLeft_Step1(objectEvent, sprite); } @@ -5658,7 +5725,10 @@ bool8 MovementAction_WalkNormalLeft_Step1(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkNormalRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 0); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 0); + else + do_go_anim(objectEvent, sprite, DIR_EAST, 0); return MovementAction_WalkNormalRight_Step1(objectEvent, sprite); } @@ -5917,7 +5987,10 @@ bool8 MovementAction_WalkFastUp_Step1(struct ObjectEvent *objectEvent, struct Sp bool8 MovementAction_WalkFastLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 1); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + do_go_anim(objectEvent, sprite, DIR_WEST, 1); return MovementAction_WalkFastLeft_Step1(objectEvent, sprite); } @@ -5933,7 +6006,10 @@ bool8 MovementAction_WalkFastLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkFastRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 1); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + do_go_anim(objectEvent, sprite, DIR_EAST, 1); return MovementAction_WalkFastRight_Step1(objectEvent, sprite); } @@ -6063,13 +6139,19 @@ bool8 MovementAction_WalkInPlaceFastestUp_Step0(struct ObjectEvent *objectEvent, bool8 MovementAction_WalkInPlaceFastestLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_WEST, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); + if (objectEvent->directionOverwrite) + sub_8094554(objectEvent, sprite, objectEvent->directionOverwrite, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); + else + sub_8094554(objectEvent, sprite, DIR_WEST, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastestRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_EAST, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); + if (objectEvent->directionOverwrite) + sub_8094554(objectEvent, sprite, objectEvent->directionOverwrite, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); + else + sub_8094554(objectEvent, sprite, DIR_EAST, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } @@ -6107,7 +6189,10 @@ bool8 MovementAction_RideWaterCurrentUp_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_RideWaterCurrentLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 2); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 2); + else + do_go_anim(objectEvent, sprite, DIR_WEST, 2); return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); } @@ -6123,7 +6208,10 @@ bool8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 2); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 2); + else + do_go_anim(objectEvent, sprite, DIR_EAST, 2); return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); } @@ -6171,7 +6259,10 @@ bool8 MovementAction_WalkFastestUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkFastestLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 3); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 3); + else + do_go_anim(objectEvent, sprite, DIR_WEST, 3); return MovementAction_WalkFastestLeft_Step1(objectEvent, sprite); } @@ -6187,7 +6278,10 @@ bool8 MovementAction_WalkFastestLeft_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_WalkFastestRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 3); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 3); + else + do_go_anim(objectEvent, sprite, DIR_EAST, 3); return MovementAction_WalkFastestRight_Step1(objectEvent, sprite); } @@ -6235,7 +6329,10 @@ bool8 MovementAction_SlideUp_Step1(struct ObjectEvent *objectEvent, struct Sprit bool8 MovementAction_SlideLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 4); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 4); + else + do_go_anim(objectEvent, sprite, DIR_WEST, 4); return MovementAction_SlideLeft_Step1(objectEvent, sprite); } @@ -6251,7 +6348,10 @@ bool8 MovementAction_SlideLeft_Step1(struct ObjectEvent *objectEvent, struct Spr bool8 MovementAction_SlideRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 4); + if (objectEvent->directionOverwrite) + do_go_anim(objectEvent, sprite, objectEvent->directionOverwrite, 4); + else + do_go_anim(objectEvent, sprite, DIR_EAST, 4); return MovementAction_SlideRight_Step1(objectEvent, sprite); } @@ -6299,7 +6399,10 @@ bool8 MovementAction_PlayerRunUp_Step1(struct ObjectEvent *objectEvent, struct S bool8 MovementAction_PlayerRunLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - StartRunningAnim(objectEvent, sprite, DIR_WEST); + if (objectEvent->directionOverwrite) + StartRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartRunningAnim(objectEvent, sprite, DIR_WEST); return MovementAction_PlayerRunLeft_Step1(objectEvent, sprite); } @@ -6315,7 +6418,10 @@ bool8 MovementAction_PlayerRunLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_PlayerRunRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - StartRunningAnim(objectEvent, sprite, DIR_EAST); + if (objectEvent->directionOverwrite) + StartRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartRunningAnim(objectEvent, sprite, DIR_EAST); return MovementAction_PlayerRunRight_Step1(objectEvent, sprite); } @@ -7165,7 +7271,7 @@ bool8 MovementAction_AcroWheelieHopFaceRight_Step1(struct ObjectEvent *objectEve bool8 MovementAction_AcroWheelieHopDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); + sub_8095B84(objectEvent, sprite, DIR_SOUTH, 1, 1); return MovementAction_AcroWheelieHopDown_Step1(objectEvent, sprite); } @@ -7182,7 +7288,7 @@ bool8 MovementAction_AcroWheelieHopDown_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_AcroWheelieHopUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); + sub_8095B84(objectEvent, sprite, DIR_NORTH, 1, 1); return MovementAction_AcroWheelieHopUp_Step1(objectEvent, sprite); } @@ -7199,7 +7305,10 @@ bool8 MovementAction_AcroWheelieHopUp_Step1(struct ObjectEvent *objectEvent, str bool8 MovementAction_AcroWheelieHopLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); + if (objectEvent->directionOverwrite) + sub_8095B84(objectEvent, sprite, objectEvent->directionOverwrite, 1, 1); + else + sub_8095B84(objectEvent, sprite, DIR_WEST, 1, 1); return MovementAction_AcroWheelieHopLeft_Step1(objectEvent, sprite); } @@ -7216,7 +7325,10 @@ bool8 MovementAction_AcroWheelieHopLeft_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_AcroWheelieHopRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 1, 1); + if (objectEvent->directionOverwrite) + sub_8095B84(objectEvent, sprite, objectEvent->directionOverwrite, 1, 1); + else + sub_8095B84(objectEvent, sprite, DIR_EAST, 1, 1); return MovementAction_AcroWheelieHopRight_Step1(objectEvent, sprite); } @@ -7233,7 +7345,7 @@ bool8 MovementAction_AcroWheelieHopRight_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); + sub_8095B84(objectEvent, sprite, DIR_SOUTH, 2, 0); return MovementAction_AcroWheelieJumpDown_Step1(objectEvent, sprite); } @@ -7250,7 +7362,7 @@ bool8 MovementAction_AcroWheelieJumpDown_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); + sub_8095B84(objectEvent, sprite, DIR_NORTH, 2, 0); return MovementAction_AcroWheelieJumpUp_Step1(objectEvent, sprite); } @@ -7267,7 +7379,10 @@ bool8 MovementAction_AcroWheelieJumpUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieJumpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); + if (objectEvent->directionOverwrite) + sub_8095B84(objectEvent, sprite, objectEvent->directionOverwrite, 2, 0); + else + sub_8095B84(objectEvent, sprite, DIR_WEST, 2, 0); return MovementAction_AcroWheelieJumpLeft_Step1(objectEvent, sprite); } @@ -7284,7 +7399,10 @@ bool8 MovementAction_AcroWheelieJumpLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, gSidewaysStairsDirection, 2, 0); + if (objectEvent->directionOverwrite) + sub_8095B84(objectEvent, sprite, objectEvent->directionOverwrite, 2, 0); + else + sub_8095B84(objectEvent, sprite, DIR_EAST, 2, 0); return MovementAction_AcroWheelieJumpRight_Step1(objectEvent, sprite); } @@ -7301,25 +7419,31 @@ bool8 MovementAction_AcroWheelieJumpRight_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieInPlaceDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); + sub_8094554(objectEvent, sprite, DIR_SOUTH, GetAcroWheeliePedalDirectionAnimNum(DIR_SOUTH), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); + sub_8094554(objectEvent, sprite, DIR_NORTH, GetAcroWheeliePedalDirectionAnimNum(DIR_NORTH), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); + if (objectEvent->directionOverwrite) + sub_8094554(objectEvent, sprite, objectEvent->directionOverwrite, GetAcroWheeliePedalDirectionAnimNum(objectEvent->directionOverwrite), 8); + else + sub_8094554(objectEvent, sprite, DIR_WEST, GetAcroWheeliePedalDirectionAnimNum(DIR_WEST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, gSidewaysStairsDirection, GetAcroWheeliePedalDirectionAnimNum(gSidewaysStairsDirection), 8); + if (objectEvent->directionOverwrite) + sub_8094554(objectEvent, sprite, objectEvent->directionOverwrite, GetAcroWheeliePedalDirectionAnimNum(objectEvent->directionOverwrite), 8); + else + sub_8094554(objectEvent, sprite, DIR_EAST, GetAcroWheeliePedalDirectionAnimNum(DIR_EAST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } @@ -7332,7 +7456,7 @@ void sub_80960C8(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroPopWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); + sub_80960C8(objectEvent, sprite, DIR_SOUTH, 1); return MovementAction_AcroPopWheelieMoveDown_Step1(objectEvent, sprite); } @@ -7348,7 +7472,7 @@ bool8 MovementAction_AcroPopWheelieMoveDown_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroPopWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); + sub_80960C8(objectEvent, sprite, DIR_NORTH, 1); return MovementAction_AcroPopWheelieMoveUp_Step1(objectEvent, sprite); } @@ -7364,7 +7488,10 @@ bool8 MovementAction_AcroPopWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroPopWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); + if (objectEvent->directionOverwrite) + sub_80960C8(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + sub_80960C8(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroPopWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -7380,7 +7507,10 @@ bool8 MovementAction_AcroPopWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroPopWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, gSidewaysStairsDirection, 1); + if (objectEvent->directionOverwrite) + sub_80960C8(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + sub_80960C8(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroPopWheelieMoveRight_Step1(objectEvent, sprite); } @@ -7402,7 +7532,7 @@ void sub_8096200(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); + sub_8096200(objectEvent, sprite, DIR_SOUTH, 1); return MovementAction_AcroWheelieMoveDown_Step1(objectEvent, sprite); } @@ -7418,7 +7548,7 @@ bool8 MovementAction_AcroWheelieMoveDown_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); + sub_8096200(objectEvent, sprite, DIR_NORTH, 1); return MovementAction_AcroWheelieMoveUp_Step1(objectEvent, sprite); } @@ -7434,7 +7564,10 @@ bool8 MovementAction_AcroWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); + if (objectEvent->directionOverwrite) + sub_8096200(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + sub_8096200(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -7450,7 +7583,10 @@ bool8 MovementAction_AcroWheelieMoveLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, gSidewaysStairsDirection, 1); + if (objectEvent->directionOverwrite) + sub_8096200(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + sub_8096200(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroWheelieMoveRight_Step1(objectEvent, sprite); } @@ -7473,7 +7609,7 @@ void sub_8096330(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroEndWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); + sub_8096330(objectEvent, sprite, DIR_SOUTH, 1); return MovementAction_AcroEndWheelieMoveDown_Step1(objectEvent, sprite); } @@ -7489,7 +7625,7 @@ bool8 MovementAction_AcroEndWheelieMoveDown_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroEndWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); + sub_8096330(objectEvent, sprite, DIR_NORTH, 1); return MovementAction_AcroEndWheelieMoveUp_Step1(objectEvent, sprite); } @@ -7505,7 +7641,10 @@ bool8 MovementAction_AcroEndWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroEndWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); + if (objectEvent->directionOverwrite) + sub_8096330(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + sub_8096330(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroEndWheelieMoveLeft_Step1(objectEvent, sprite); } @@ -7521,7 +7660,10 @@ bool8 MovementAction_AcroEndWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroEndWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, gSidewaysStairsDirection, 1); + if (objectEvent->directionOverwrite) + sub_8096330(objectEvent, sprite, objectEvent->directionOverwrite, 1); + else + sub_8096330(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroEndWheelieMoveRight_Step1(objectEvent, sprite); } @@ -9193,6 +9335,31 @@ u8 MovementAction_Fly_Finish(struct ObjectEvent *objectEvent, struct Sprite *spr return TRUE; } +// NEW +u16 GetMiniStepCount(u8 speed) +{ + return (u16)gUnknown_0850E768[speed]; +} + +void RunMiniStep(struct Sprite *sprite, u8 speed, u8 currentFrame) +{ + gUnknown_0850E754[speed][currentFrame](sprite, sprite->data[3]); +} + +bool8 PlayerIsUnderWaterfall(struct ObjectEvent *objectEvent) +{ + s16 x; + s16 y; + + x = objectEvent->currentCoords.x; + y = objectEvent->currentCoords.y; + MoveCoordsInDirection(DIR_NORTH, &x, &y, 0, 1); + if (MetatileBehavior_IsWaterfall(MapGridGetMetatileBehaviorAt(x, y))) + return TRUE; + + return FALSE; +} + // running slow static void StartSlowRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { @@ -9248,13 +9415,19 @@ bool8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct bool8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - StartSlowRunningAnim(objectEvent, sprite, DIR_WEST); + if (objectEvent->directionOverwrite) + StartSlowRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartSlowRunningAnim(objectEvent, sprite, DIR_WEST); return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); } bool8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - StartSlowRunningAnim(objectEvent, sprite, DIR_EAST); + if (objectEvent->directionOverwrite) + StartSlowRunningAnim(objectEvent, sprite, objectEvent->directionOverwrite); + else + StartSlowRunningAnim(objectEvent, sprite, DIR_EAST); return MovementActionFunc_RunSlow_Step1(objectEvent, sprite); } @@ -9267,163 +9440,3 @@ bool8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct S } return FALSE; } - -//sideways stairs -bool8 MovementAction_WalkStairDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_WEST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - sub_8093B60(objectEvent, sprite, DIR_NORTHWEST); - return MovementAction_WalkSlowDiagonalUpLeft_Step1(objectEvent, sprite); - #else - do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 0); - return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); - #endif -} - -bool8 MovementAction_WalkStairDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_EAST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - sub_8093B60(objectEvent, sprite, DIR_NORTHEAST); - return MovementAction_WalkSlowDiagonalUpRight_Step1(objectEvent, sprite); - #else - do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 0); - return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); - #endif -} - -bool8 MovementAction_WalkStairDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_WEST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - sub_8093B60(objectEvent, sprite, DIR_SOUTHWEST); - return MovementAction_WalkSlowDiagonalDownLeft_Step1(objectEvent, sprite); - #else - do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 0); - return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); - #endif -} - -bool8 MovementAction_WalkStairDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_EAST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - sub_8093B60(objectEvent, sprite, DIR_SOUTHEAST); - return MovementAction_WalkSlowDiagonalDownRight_Step1(objectEvent, sprite); - #else - do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 0); - return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); - #endif -} - -bool8 MovementAction_RunStairDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_WEST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHWEST); - #else - StartRunningAnim(objectEvent, sprite, DIR_NORTHWEST); - #endif - return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); -} - -bool8 MovementAction_RunStairDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_EAST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - StartSlowRunningAnim(objectEvent, sprite, DIR_NORTHEAST); - #else - StartRunningAnim(objectEvent, sprite, DIR_NORTHEAST); - #endif - return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); -} - -bool8 MovementAction_RunStairDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_WEST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHWEST); - #else - StartRunningAnim(objectEvent, sprite, DIR_SOUTHWEST); - #endif - return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); -} - -bool8 MovementAction_RunStairDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_EAST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTHEAST); - #else - StartRunningAnim(objectEvent, sprite, DIR_SOUTHEAST); - #endif - return MovementAction_RunStairDiagonal_Step1(objectEvent, sprite); -} - -bool8 MovementAction_RunStairDiagonal_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) - { - sprite->data[2] = 2; - return TRUE; - } - return FALSE; -} - -bool8 MovementAction_AcroBikeDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_WEST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 0); - #else - do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 2); - #endif - return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); -} - -bool8 MovementAction_AcroBikeDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_WEST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 0); - #else - do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 2); - #endif - return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); -} - -bool8 MovementAction_AcroBikeDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_EAST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 0); - #else - do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 2); - #endif - return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); -} - -bool8 MovementAction_AcroBikeDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - objectEvent->facingDirection = DIR_EAST; - objectEvent->facingDirectionLocked = TRUE; - #if SLOW_MOVEMENT_ON_STAIRS == TRUE - do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 0); - #else - do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 2); - #endif - return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); -} - diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 6ec280fd0d..f0a7f708f8 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -28,6 +28,7 @@ #include "trainer_see.h" #include "trainer_hill.h" #include "wild_encounter.h" +#include "follow_me.h" #include "constants/event_bg.h" #include "constants/event_objects.h" #include "constants/field_poison.h" @@ -288,8 +289,39 @@ static const u8 *GetInteractedObjectEventScript(struct MapPosition *position, u8 { u8 objectEventId; const u8 *script; - - objectEventId = GetObjectEventIdByXYZ(position->x, position->y, position->height); + s16 currX = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.x; + s16 currY = gObjectEvents[gPlayerAvatar.objectEventId].currentCoords.y; + u8 currBehavior = MapGridGetMetatileBehaviorAt(currX, currY); + + switch (direction) + { + case DIR_EAST: + if (MetatileBehavior_IsSidewaysStairsLeftSideAny(metatileBehavior)) + // sideways stairs left-side to your right -> check northeast + objectEventId = GetObjectEventIdByXYZ(currX + 1, currY - 1, position->height); + else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currBehavior)) + // on top of right-side stairs -> check southeast + objectEventId = GetObjectEventIdByXYZ(currX + 1, currY + 1, position->height); + else + // check in front of player + objectEventId = GetObjectEventIdByXYZ(position->x, position->y, position->height); + break; + case DIR_WEST: + if (MetatileBehavior_IsSidewaysStairsRightSideAny(metatileBehavior)) + // facing sideways stairs right side -> check northwest + objectEventId = GetObjectEventIdByXYZ(currX - 1, currY - 1, position->height); + else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currBehavior)) + // on top of left-side stairs -> check southwest + objectEventId = GetObjectEventIdByXYZ(currX - 1, currY + 1, position->height); + else + // check in front of player + objectEventId = GetObjectEventIdByXYZ(position->x, position->y, position->height); + break; + default: + objectEventId = GetObjectEventIdByXYZ(position->x, position->y, position->height); + break; + } + if (objectEventId == OBJECT_EVENTS_COUNT || gObjectEvents[objectEventId].localId == OBJ_EVENT_ID_PLAYER) { if (MetatileBehavior_IsCounter(metatileBehavior) != TRUE) @@ -448,10 +480,10 @@ static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 me static const u8 *GetInteractedWaterScript(struct MapPosition *unused1, u8 metatileBehavior, u8 direction) { - if (FlagGet(FLAG_BADGE05_GET) == TRUE && PartyHasMonWithSurf() == TRUE && IsPlayerFacingSurfableFishableWater() == TRUE) + if (FlagGet(FLAG_BADGE05_GET) == TRUE && PartyHasMonWithSurf() == TRUE && IsPlayerFacingSurfableFishableWater() == TRUE && CheckFollowerFlag(FOLLOWER_FLAG_CAN_SURF)) return EventScript_UseSurf; - if (MetatileBehavior_IsWaterfall(metatileBehavior) == TRUE) + if (MetatileBehavior_IsWaterfall(metatileBehavior) == TRUE && CheckFollowerFlag(FOLLOWER_FLAG_CAN_WATERFALL)) { if (FlagGet(FLAG_BADGE08_GET) == TRUE && IsPlayerSurfingNorth() == TRUE) return EventScript_UseWaterfall; @@ -463,6 +495,9 @@ static const u8 *GetInteractedWaterScript(struct MapPosition *unused1, u8 metati static bool32 TrySetupDiveDownScript(void) { + if (!CheckFollowerFlag(FOLLOWER_FLAG_CAN_DIVE)) + return FALSE; + if (FlagGet(FLAG_BADGE07_GET) && TrySetDiveWarp() == 2) { ScriptContext1_SetupScript(EventScript_UseDive); @@ -473,6 +508,9 @@ static bool32 TrySetupDiveDownScript(void) static bool32 TrySetupDiveEmergeScript(void) { + if (!CheckFollowerFlag(FOLLOWER_FLAG_CAN_DIVE)) + return FALSE; + if (FlagGet(FLAG_BADGE07_GET) && gMapHeader.mapType == MAP_TYPE_UNDERWATER && TrySetDiveWarp() == 1) { ScriptContext1_SetupScript(EventScript_UseDiveUnderwater); diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index dd52e3a612..f74b4f5a98 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -20,6 +20,7 @@ #include "strings.h" #include "task.h" #include "tv.h" +#include "follow_me.h" #include "wild_encounter.h" #include "constants/abilities.h" #include "constants/event_objects.h" @@ -624,22 +625,6 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) PlayerNotOnBikeCollideWithFarawayIslandMew(direction); return; } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_RIGHT) - { - if (heldKeys & B_BUTTON && FlagGet(FLAG_SYS_B_DASH)) - PlayerSidewaysStairsRightSideRunning(direction); - else - PlayerSidewaysStairsRightSide(direction); - return; - } - else if (collision == COLLISION_SIDEWAYS_STAIRS_TO_LEFT) - { - if (heldKeys & B_BUTTON && FlagGet(FLAG_SYS_B_DASH)) - return PlayerSidewaysStairsLeftSideRunning(direction); - else - return PlayerSidewaysStairsLeftSide(direction); - return; - } else { u8 adjustedCollision = collision - COLLISION_STOP_SURFING; @@ -659,45 +644,16 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_UNDERWATER) && (heldKeys & B_BUTTON) && FlagGet(FLAG_SYS_B_DASH) && IsRunningDisallowed(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior) == 0) { - if (PlayerIsMovingOnRockStairs(direction)) - PlayerRunSlow(direction); - else - PlayerRun(direction); - + PlayerRun(direction); gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH; return; } else { - if (PlayerIsMovingOnRockStairs(direction)) - PlayerGoSlow(direction); - else - PlayerGoSpeed1(direction); + PlayerGoSpeed1(direction); } } -bool32 PlayerIsMovingOnRockStairs(u8 direction) -{ - #if SLOW_MOVEMENT_ON_STAIRS - struct ObjectEvent *objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; - s16 x = objectEvent->currentCoords.x; - s16 y = objectEvent->currentCoords.y; - - switch (direction) - { - case DIR_NORTH: - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - case DIR_SOUTH: - MoveCoords(DIR_SOUTH, &x, &y); - return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x, y)); - default: - return FALSE; - } - #else - return FALSE; - #endif -} - static u8 CheckForPlayerAvatarCollision(u8 direction) { s16 x, y; @@ -745,42 +701,20 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u } //sideways stairs logic - if (direction == DIR_WEST || direction == DIR_EAST) - { - if (MetatileBehavior_IsSidewaysStairsLeftSide(metatileBehavior)) - { - //moving ONTO left side stair - if (direction == DIR_WEST && currentBehavior != metatileBehavior) - return collision; //moving onto top part of left-stair going left, so no diagonal - else - return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; // move diagonally - } - else if (MetatileBehavior_IsSidewaysStairsRightSide(metatileBehavior)) - { - //moving ONTO right side stair - if (direction == DIR_EAST && currentBehavior != metatileBehavior) - return collision; //moving onto top part of right-stair going right, so no diagonal - else - return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; - } - else if (MetatileBehavior_IsSidewaysStairsLeftSideAny(currentBehavior)) - { - //moving OFF of any left side stair - if (direction == DIR_WEST && metatileBehavior != currentBehavior) - return COLLISION_SIDEWAYS_STAIRS_TO_LEFT; //moving off of left stairs onto non-stair -> move diagonal - else - return collision; //moving off of left side stair to east -> move east - } - else if (MetatileBehavior_IsSidewaysStairsRightSideAny(currentBehavior)) - { - //moving OFF of any right side stair - if (direction == DIR_EAST && metatileBehavior != currentBehavior) - return COLLISION_SIDEWAYS_STAIRS_TO_RIGHT; //moving off right stair onto non-stair -> move diagonal - else - return collision; - } - } - + /* + if (MetatileBehavior_IsSidewaysStairsLeftSideTop(metatileBehavior) && direction == DIR_EAST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move + else if (MetatileBehavior_IsSidewaysStairsRightSideTop(metatileBehavior) && direction == DIR_WEST) + return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move + else if (MetatileBehavior_IsSidewaysStairsRightSideBottom(metatileBehavior) && (direction == DIR_EAST || direction == DIR_SOUTH)) + return COLLISION_IMPASSABLE; + else if (MetatileBehavior_IsSidewaysStairsLeftSideBottom(metatileBehavior) && (direction == DIR_WEST || direction == DIR_SOUTH)) + return COLLISION_IMPASSABLE; + else if ((MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) + && direction == DIR_NORTH && collision == COLLISION_NONE) + return COLLISION_IMPASSABLE; //trying to move north off of top-most tile onto same level doesn't work + */ + return collision; } @@ -961,7 +895,7 @@ static void PlayerAvatarTransition_Underwater(struct ObjectEvent *objEvent) ObjectEventSetGraphicsId(objEvent, GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_UNDERWATER)); ObjectEventTurn(objEvent, objEvent->movementDirection); SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_UNDERWATER); - objEvent->fieldEffectSpriteId = sub_8155800(objEvent->spriteId); + objEvent->fieldEffectSpriteId = DoBobbingFieldEffect(objEvent->spriteId); } static void PlayerAvatarTransition_ReturnToField(struct ObjectEvent *objEvent) @@ -1491,6 +1425,8 @@ void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender) gPlayerAvatar.spriteId = objectEvent->spriteId; gPlayerAvatar.gender = gender; SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_5 | PLAYER_AVATAR_FLAG_ON_FOOT); + + CreateFollowerAvatar(); } void SetPlayerInvisibility(bool8 invisible) @@ -1730,12 +1666,14 @@ static void CreateStopSurfingTask(u8 direction) ScriptContext2_Enable(); Overworld_ClearSavedMusic(); Overworld_ChangeMusicToDefault(); - gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_SURFING; + gPlayerAvatar.flags ^= PLAYER_AVATAR_FLAG_SURFING; gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_ON_FOOT; gPlayerAvatar.preventStep = TRUE; taskId = CreateTask(Task_StopSurfingInit, 0xFF); gTasks[taskId].data[0] = direction; Task_StopSurfingInit(taskId); + + PrepareFollowerDismountSurf(); } static void Task_StopSurfingInit(u8 taskId) @@ -2350,22 +2288,3 @@ u8 GetLeftSideStairsDirection(u8 direction) } } -void PlayerSidewaysStairsRightSide(u8 direction) -{ - PlayerSetAnimId(GetDiagonalRightStairsMovement(direction), 8); -} - -void PlayerSidewaysStairsLeftSide(u8 direction) -{ - PlayerSetAnimId(GetDiagonalLeftStairsMovement(direction), 8); -} - -void PlayerSidewaysStairsRightSideRunning(u8 direction) -{ - PlayerSetAnimId(GetDiagonalRightStairsRunningMovement(direction), 8); -} - -void PlayerSidewaysStairsLeftSideRunning(u8 direction) -{ - PlayerSetAnimId(GetDiagonalLeftStairsRunningMovement(direction), 8); -} diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 86e4ec98b3..ab5d6f288d 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1564,10 +1564,3 @@ bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior) return FALSE; } -bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior) -{ - if (metatileBehavior == MB_ROCK_STAIRS) - return TRUE; - else - return FALSE; -} From 598f5dd9140b90c5bd2d61941a2e24f2c6771646 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 28 Jun 2020 17:22:59 -0600 Subject: [PATCH 012/133] cherry pick 8960588d0b0b9e31c8971173396f6e631930229b --- data/layouts/PetalburgCity/map.bin | Bin 1800 -> 1800 bytes src/event_object_movement.c | 18 +++++------------- src/field_control_avatar.c | 11 ++--------- src/field_effect_helpers.c | 2 +- src/field_player_avatar.c | 5 ----- 5 files changed, 8 insertions(+), 28 deletions(-) diff --git a/data/layouts/PetalburgCity/map.bin b/data/layouts/PetalburgCity/map.bin index 35f0172ca20a07e800bc248b803e740364a24715..46c808e0556b1a035ea9cc16f5e47fc0a64f20f5 100644 GIT binary patch delta 229 zcmeC+>)_k)fQcuACDQ={vsfliU=f+bEG5WjFoUVk0Rks5F&ZdL)@Ih`V>Flv7oEs7 zIfYpdC^U;Hn!!h%wkB9_T_m^DN$3M>@ZCBSF^k~q(B zo&hW&!2;4=zyh=>p)g?r6Hsjki=Mz-qZv#)Bs^E$W{(k1D*<&N+_&ine4)v!+3G?M%Hjf05ujtS^xk5 delta 232 zcmeC+>)_k)fQeVq5CIh@Z)6gl#4IHkWE5Tc zp%4~5o@b`dO%+%aS%g`XSSBYhiA-L^BF6)^(+Fboscript; - else - return GetFollowerScriptPointer(); + return GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup)->script; } const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId) @@ -5029,7 +5024,7 @@ static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *objectEvent, s16 for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { curObject = &gObjectEvents[i]; - if (curObject->active && curObject != objectEvent && !FollowMe_IsCollisionExempt(curObject, objectEvent)) + if (curObject->active && curObject != objectEvent) { // check for collision if curObject is active, not the object in question, and not exempt from collisions if ((curObject->currentCoords.x == x && curObject->currentCoords.y == y) || (curObject->previousCoords.x == x && curObject->previousCoords.y == y)) @@ -5185,9 +5180,6 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementAct objectEvent->heldMovementActive = TRUE; objectEvent->heldMovementFinished = FALSE; gSprites[objectEvent->spriteId].data[2] = 0; - - FollowMe(objectEvent, movementActionId, FALSE); - return FALSE; } diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index f0a7f708f8..9c24ee77ea 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -28,7 +28,6 @@ #include "trainer_see.h" #include "trainer_hill.h" #include "wild_encounter.h" -#include "follow_me.h" #include "constants/event_bg.h" #include "constants/event_objects.h" #include "constants/field_poison.h" @@ -480,10 +479,10 @@ static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 me static const u8 *GetInteractedWaterScript(struct MapPosition *unused1, u8 metatileBehavior, u8 direction) { - if (FlagGet(FLAG_BADGE05_GET) == TRUE && PartyHasMonWithSurf() == TRUE && IsPlayerFacingSurfableFishableWater() == TRUE && CheckFollowerFlag(FOLLOWER_FLAG_CAN_SURF)) + if (FlagGet(FLAG_BADGE05_GET) == TRUE && PartyHasMonWithSurf() == TRUE && IsPlayerFacingSurfableFishableWater() == TRUE) return EventScript_UseSurf; - if (MetatileBehavior_IsWaterfall(metatileBehavior) == TRUE && CheckFollowerFlag(FOLLOWER_FLAG_CAN_WATERFALL)) + if (MetatileBehavior_IsWaterfall(metatileBehavior) == TRUE) { if (FlagGet(FLAG_BADGE08_GET) == TRUE && IsPlayerSurfingNorth() == TRUE) return EventScript_UseWaterfall; @@ -495,9 +494,6 @@ static const u8 *GetInteractedWaterScript(struct MapPosition *unused1, u8 metati static bool32 TrySetupDiveDownScript(void) { - if (!CheckFollowerFlag(FOLLOWER_FLAG_CAN_DIVE)) - return FALSE; - if (FlagGet(FLAG_BADGE07_GET) && TrySetDiveWarp() == 2) { ScriptContext1_SetupScript(EventScript_UseDive); @@ -508,9 +504,6 @@ static bool32 TrySetupDiveDownScript(void) static bool32 TrySetupDiveEmergeScript(void) { - if (!CheckFollowerFlag(FOLLOWER_FLAG_CAN_DIVE)) - return FALSE; - if (FlagGet(FLAG_BADGE07_GET) && gMapHeader.mapType == MAP_TYPE_UNDERWATER && TrySetDiveWarp() == 1) { ScriptContext1_SetupScript(EventScript_UseDiveUnderwater); diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 67102a83b2..e8e3dd6fe3 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -1081,7 +1081,7 @@ static void CreateBobbingEffect(struct ObjectEvent *objectEvent, struct Sprite * } } -u8 sub_8155800(u8 oldSpriteId) +u8 DoBobbingFieldEffect(u8 oldSpriteId) { u8 spriteId; struct Sprite *sprite; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index f74b4f5a98..2d70fd2b10 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -20,7 +20,6 @@ #include "strings.h" #include "task.h" #include "tv.h" -#include "follow_me.h" #include "wild_encounter.h" #include "constants/abilities.h" #include "constants/event_objects.h" @@ -1425,8 +1424,6 @@ void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender) gPlayerAvatar.spriteId = objectEvent->spriteId; gPlayerAvatar.gender = gender; SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_5 | PLAYER_AVATAR_FLAG_ON_FOOT); - - CreateFollowerAvatar(); } void SetPlayerInvisibility(bool8 invisible) @@ -1672,8 +1669,6 @@ static void CreateStopSurfingTask(u8 direction) taskId = CreateTask(Task_StopSurfingInit, 0xFF); gTasks[taskId].data[0] = direction; Task_StopSurfingInit(taskId); - - PrepareFollowerDismountSurf(); } static void Task_StopSurfingInit(u8 taskId) From a23f716209b7e765030d2f58bb9adc72eeb4d522 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 14 Jul 2020 14:28:02 -0600 Subject: [PATCH 013/133] add slow stair movement back --- include/constants/global.h | 2 + include/field_player_avatar.h | 2 +- include/metatile_behavior.h | 1 + src/bike.c | 12 ++++-- src/event_object_movement.c | 73 +++++++++++++++++------------------ src/field_player_avatar.c | 41 +++++++++++++++++++- src/metatile_behavior.c | 9 +++++ 7 files changed, 95 insertions(+), 45 deletions(-) diff --git a/include/constants/global.h b/include/constants/global.h index 213ccca5b5..acc1f353d5 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -118,4 +118,6 @@ #define DIR_NORTHWEST 7 #define DIR_NORTHEAST 8 +#define SLOW_MOVEMENT_ON_STAIRS TRUE + #endif // GUARD_CONSTANTS_GLOBAL_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 0f53e0b28d..658dc09d0a 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -64,7 +64,7 @@ bool32 IsPlayerSpinExitActive(void); void SetPlayerInvisibility(bool8 invisible); u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); void StartFishing(u8 rod); -bool32 PlayerIsMovingOnRockStairs(u8 direction); +bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction); //sideways stairs u8 GetRightSideStairsDirection(u8 direction); u8 GetLeftSideStairsDirection(u8 direction); diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 128978cae6..58d6e82d76 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -145,6 +145,7 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); +bool8 MetatileBehavior_IsRockStairs(u8); //sideways stairs bool8 MetatileBehavior_IsSidewaysStairsRightSide(u8); bool8 MetatileBehavior_IsSidewaysStairsLeftSide(u8); diff --git a/src/bike.c b/src/bike.c index 1fe5b58b43..7c9eb0cf5c 100644 --- a/src/bike.c +++ b/src/bike.c @@ -246,6 +246,9 @@ static void MachBikeTransition_TrySpeedUp(u8 direction) } else { + if (ObjectMovingOnRockStairs(playerObjEvent, direction) && gPlayerAvatar.bikeFrameCounter > 1) + gPlayerAvatar.bikeFrameCounter--; + sMachBikeSpeedCallbacks[gPlayerAvatar.bikeFrameCounter](direction); gPlayerAvatar.bikeSpeed = gPlayerAvatar.bikeFrameCounter + (gPlayerAvatar.bikeFrameCounter >> 1); // same as dividing by 2, but compiler is insistent on >> 1 if (gPlayerAvatar.bikeFrameCounter < 2) // do not go faster than the last element in the mach bike array @@ -380,7 +383,6 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16 struct ObjectEvent *playerObjEvent; direction = GetPlayerMovementDirection(); - //gSidewaysStairsDirection = direction; playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; gPlayerAvatar.runningState = NOT_MOVING; @@ -577,7 +579,10 @@ static void AcroBikeTransition_Moving(u8 direction) } else { - PlayerRideWaterCurrent(direction); + if (ObjectMovingOnRockStairs(playerObjEvent, direction)) + PlayerGoSpeed2(direction); + else + PlayerRideWaterCurrent(direction); } } @@ -645,7 +650,7 @@ static void AcroBikeTransition_WheelieHoppingMoving(u8 direction) } else { - derp: + derp: PlayerMovingHoppingWheelie(direction); } } @@ -1033,7 +1038,6 @@ void Bike_UpdateBikeCounterSpeed(u8 counter) static void Bike_SetBikeStill(void) { - //gSidewaysStairsDirection = gObjectEvents[gPlayerAvatar.objectEventId].facingDirection; gPlayerAvatar.bikeFrameCounter = 0; gPlayerAvatar.bikeSpeed = SPEED_STANDING; } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 1695388029..fc13c96643 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -135,7 +135,6 @@ static bool8 AnimateSpriteInFigure8(struct Sprite *sprite); static void UpdateObjectEventSprite(struct Sprite *); static void StartSlowRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction); -static bool8 npc_obj_ministep_stop_on_arrival_slow(struct ObjectEvent *objectEvent, struct Sprite *sprite); const u8 gReflectionEffectPaletteMap[] = {1, 1, 6, 7, 8, 9, 6, 7, 8, 9, 11, 11, 0, 0, 0, 0}; @@ -1142,6 +1141,10 @@ const u8 gRunSlowMovementActions[] = { [DIR_NORTH] = MOVEMENT_ACTION_RUN_UP_SLOW, [DIR_WEST] = MOVEMENT_ACTION_RUN_LEFT_SLOW, [DIR_EAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, + [DIR_SOUTHWEST] = MOVEMENT_ACTION_RUN_LEFT_SLOW, + [DIR_SOUTHEAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, + [DIR_NORTHWEST] = MOVEMENT_ACTION_RUN_LEFT_SLOW, + [DIR_NORTHEAST] = MOVEMENT_ACTION_RUN_RIGHT_SLOW, }; const u8 gOppositeDirections[] = { @@ -5170,10 +5173,35 @@ bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *objectEvent) return FALSE; } +static u8 TryUpdateMovementActionOnStairs(struct ObjectEvent *objectEvent, u8 movementActionId) +{ + if (objectEvent->isPlayer) + return movementActionId; //handled separately + + if (!ObjectMovingOnRockStairs(objectEvent, objectEvent->movementDirection)) + return movementActionId; + + switch (movementActionId) + { + case MOVEMENT_ACTION_WALK_NORMAL_DOWN: + return MOVEMENT_ACTION_WALK_SLOW_DOWN; + case MOVEMENT_ACTION_WALK_NORMAL_UP: + return MOVEMENT_ACTION_WALK_SLOW_UP; + case MOVEMENT_ACTION_WALK_NORMAL_LEFT: + return MOVEMENT_ACTION_WALK_SLOW_LEFT; + case MOVEMENT_ACTION_WALK_NORMAL_RIGHT: + return MOVEMENT_ACTION_WALK_SLOW_RIGHT; + default: + return movementActionId; + } +} + bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementActionId) { if (ObjectEventIsMovementOverridden(objectEvent)) return TRUE; + + movementActionId = TryUpdateMovementActionOnStairs(objectEvent, movementActionId); UnfreezeObjectEvent(objectEvent); objectEvent->movementActionId = movementActionId; @@ -5185,6 +5213,7 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementAct void ObjectEventForceSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementActionId) { + movementActionId = TryUpdateMovementActionOnStairs(objectEvent, movementActionId); ObjectEventClearHeldMovementIfActive(objectEvent); ObjectEventSetHeldMovement(objectEvent, movementActionId); } @@ -5224,7 +5253,7 @@ u8 ObjectEventClearHeldMovementIfFinished(struct ObjectEvent *objectEvent) u8 ObjectEventGetHeldMovementActionId(struct ObjectEvent *objectEvent) { if (objectEvent->heldMovementActive) - return objectEvent->movementActionId; + return TryUpdateMovementActionOnStairs(objectEvent, objectEvent->movementActionId); return 0xFF; } @@ -5329,6 +5358,7 @@ static u32 state_to_direction(u8 a0, u32 a1, u32 a2) static void ObjectEventExecHeldMovementAction(struct ObjectEvent *objectEvent, struct Sprite *sprite) { + objectEvent->movementActionId = TryUpdateMovementActionOnStairs(objectEvent, objectEvent->movementActionId); if (gMovementActionFuncs[objectEvent->movementActionId][sprite->data[2]](objectEvent, sprite)) { objectEvent->heldMovementFinished = TRUE; @@ -5337,6 +5367,7 @@ static void ObjectEventExecHeldMovementAction(struct ObjectEvent *objectEvent, s static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *objectEvent, struct Sprite *sprite) { + objectEvent->movementActionId = TryUpdateMovementActionOnStairs(objectEvent, objectEvent->movementActionId); if (gMovementActionFuncs[objectEvent->movementActionId][sprite->data[2]](objectEvent, sprite)) { objectEvent->movementActionId = 0xFF; @@ -5348,7 +5379,7 @@ static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *objectEvent static void ObjectEventSetSingleMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animId) { - objectEvent->movementActionId = animId; + objectEvent->movementActionId = TryUpdateMovementActionOnStairs(objectEvent, animId); sprite->data[2] = 0; } @@ -9359,40 +9390,6 @@ static void StartSlowRunningAnim(struct ObjectEvent *objectEvent, struct Sprite npc_apply_anim_looping(objectEvent, sprite, GetRunningDirectionAnimNum(objectEvent->facingDirection)); } -#define tDirection data[3] -#define tDelay data[4] -#define tStepNo data[5] -static bool8 obj_npc_ministep_slow(struct Sprite *sprite) -{ - if ((++sprite->tDelay) & 1) - { - Step1(sprite, sprite->tDirection); - sprite->tStepNo++; - } - else - { - Step2(sprite, sprite->tDirection); - sprite->tStepNo += 2; - } - - if (sprite->tStepNo > 15) - return TRUE; - else - return FALSE; -} -static bool8 npc_obj_ministep_stop_on_arrival_slow(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - if (obj_npc_ministep_slow(sprite)) - { - ShiftStillObjectEventCoords(objectEvent); - objectEvent->triggerGroundEffectsOnStop = TRUE; - sprite->animPaused = TRUE; - return TRUE; - } - return FALSE; -} - - bool8 MovementActionFunc_RunSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { StartSlowRunningAnim(objectEvent, sprite, DIR_SOUTH); @@ -9425,7 +9422,7 @@ bool8 MovementActionFunc_RunSlowRight_Step0(struct ObjectEvent *objectEvent, str bool8 MovementActionFunc_RunSlow_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival_slow(objectEvent, sprite)) + if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) { sprite->data[2] = 2; return TRUE; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 2d70fd2b10..19e3fb4869 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -643,13 +643,20 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_UNDERWATER) && (heldKeys & B_BUTTON) && FlagGet(FLAG_SYS_B_DASH) && IsRunningDisallowed(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior) == 0) { - PlayerRun(direction); + if (ObjectMovingOnRockStairs(&gObjectEvents[gPlayerAvatar.objectEventId], direction)) + PlayerRunSlow(direction); + else + PlayerRun(direction); + gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH; return; } else { - PlayerGoSpeed1(direction); + if (ObjectMovingOnRockStairs(&gObjectEvents[gPlayerAvatar.objectEventId], direction)) + PlayerGoSlow(direction); + else + PlayerGoSpeed1(direction); } } @@ -2283,3 +2290,33 @@ u8 GetLeftSideStairsDirection(u8 direction) } } +bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction) +{ + #if SLOW_MOVEMENT_ON_STAIRS + s16 x = objectEvent->currentCoords.x; + s16 y = objectEvent->currentCoords.y; + + switch (direction) + { + case DIR_NORTH: + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x,y)); + case DIR_SOUTH: + MoveCoords(DIR_SOUTH, &x, &y); + return MetatileBehavior_IsRockStairs(MapGridGetMetatileBehaviorAt(x,y)); + case DIR_WEST: + case DIR_EAST: + case DIR_NORTHEAST: + case DIR_NORTHWEST: + case DIR_SOUTHWEST: + case DIR_SOUTHEAST: + // directionOverwrite is only used for sideways stairs motion + if (objectEvent->directionOverwrite) + return TRUE; + default: + return FALSE; + } + #else + return FALSE; + #endif +} + diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index ab5d6f288d..ea397ab91d 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1564,3 +1564,12 @@ bool8 MetatileBehavior_IsSidewaysStairsLeftSideAny(u8 metatileBehavior) return FALSE; } +bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior) +{ + if (metatileBehavior == MB_ROCK_STAIRS) + return TRUE; + else + return FALSE; +} + + From 397da3736c400a72c64bb9d9b8f495523ad01299 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 17 Aug 2020 13:53:36 -0600 Subject: [PATCH 014/133] follower movement and slow stairs --- include/constants/global.h | 1 + src/event_object_movement.c | 9 +++++++-- src/field_player_avatar.c | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/constants/global.h b/include/constants/global.h index acc1f353d5..6434217095 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -119,5 +119,6 @@ #define DIR_NORTHEAST 8 #define SLOW_MOVEMENT_ON_STAIRS TRUE +#define FOLLOW_ME_IMPLEMENTED TRUE //for stairs movement. see ObjectMovingOnRockStairs in src/field_player_avatar.c #endif // GUARD_CONSTANTS_GLOBAL_H diff --git a/src/event_object_movement.c b/src/event_object_movement.c index fc13c96643..54252db1e7 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -5175,8 +5175,13 @@ bool8 ObjectEventIsHeldMovementActive(struct ObjectEvent *objectEvent) static u8 TryUpdateMovementActionOnStairs(struct ObjectEvent *objectEvent, u8 movementActionId) { - if (objectEvent->isPlayer) - return movementActionId; //handled separately + #if FOLLOW_ME_IMPLEMENTED + if (objectEvent->isPlayer || objectEvent->localId == GetFollowerLocalId()) + return movementActionId; //handled separately + #else + if (objectEvent->isPlayer) + return movementActionId; //handled separately + #endif if (!ObjectMovingOnRockStairs(objectEvent, objectEvent->movementDirection)) return movementActionId; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 19e3fb4869..5ef8a0ae2c 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -2296,6 +2296,11 @@ bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction) s16 x = objectEvent->currentCoords.x; s16 y = objectEvent->currentCoords.y; + #if FOLLOW_ME_IMPLEMENTED + if (PlayerHasFollower() && (objectEvent->isPlayer || objectEvent->localId == GetFollowerLocalId())) + return FALSE; + #endif + switch (direction) { case DIR_NORTH: From 01d08d3ceeccec0a6d2f8fc848fa0655aec63f38 Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 22 Aug 2020 15:25:41 -0600 Subject: [PATCH 015/133] fix sand onto sideways stairs bug --- include/constants/global.h | 2 +- src/event_object_movement.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/constants/global.h b/include/constants/global.h index 6434217095..d99ff1392b 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -119,6 +119,6 @@ #define DIR_NORTHEAST 8 #define SLOW_MOVEMENT_ON_STAIRS TRUE -#define FOLLOW_ME_IMPLEMENTED TRUE //for stairs movement. see ObjectMovingOnRockStairs in src/field_player_avatar.c +#define FOLLOW_ME_IMPLEMENTED FALSE //for stairs movement. see ObjectMovingOnRockStairs in src/field_player_avatar.c #endif // GUARD_CONSTANTS_GLOBAL_H diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 54252db1e7..88b269da6e 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -7900,12 +7900,17 @@ static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent *objEve static void GetGroundEffectFlags_Tracks(struct ObjectEvent *objEvent, u32 *flags) { - if (MetatileBehavior_IsDeepSand(objEvent->previousMetatileBehavior)) + u8 behavior = objEvent->previousMetatileBehavior; + + if (objEvent->directionOverwrite) + return; + + if (MetatileBehavior_IsDeepSand(behavior)) { *flags |= GROUND_EFFECT_FLAG_DEEP_SAND; } - else if (MetatileBehavior_IsSandOrDeepSand(objEvent->previousMetatileBehavior) - || MetatileBehavior_IsFootprints(objEvent->previousMetatileBehavior)) + else if (MetatileBehavior_IsSandOrDeepSand(behavior) + || MetatileBehavior_IsFootprints(behavior)) { *flags |= GROUND_EFFECT_FLAG_SAND; } From 7b9f308547d16ce850cdbc2d26e5bb2bc1035037 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 26 Jan 2021 12:26:56 -0700 Subject: [PATCH 016/133] fix trigger tiles at end of sideways stairs (thx spherical ice for bug report) --- src/scrcmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scrcmd.c b/src/scrcmd.c index 7dc02b6a8f..b9c2d942a3 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -998,6 +998,7 @@ bool8 ScrCmd_applymovement(struct ScriptContext *ctx) u16 localId = VarGet(ScriptReadHalfword(ctx)); const void *movementScript = (const void *)ScriptReadWord(ctx); + gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE ScriptMovement_StartObjectMovementScript(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, movementScript); sMovingNpcId = localId; return FALSE; @@ -1010,6 +1011,7 @@ bool8 ScrCmd_applymovement_at(struct ScriptContext *ctx) u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); + gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE ScriptMovement_StartObjectMovementScript(localId, mapNum, mapGroup, movementScript); sMovingNpcId = localId; return FALSE; From 13c5f15e56badc35c9272877c1d7706ef88a100c Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 26 Jan 2021 12:29:08 -0700 Subject: [PATCH 017/133] cherry pick 53731a7fc7579e61d5ee7d32d0e06f1cbe5a085d --- include/event_object_movement.h | 11 ++++++----- src/event_object_movement.c | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 61e7c5d6c2..e9b00d1214 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -427,11 +427,12 @@ u8 MovementType_Invisible_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *); -void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible); -bool32 IsObjectEventSpriteInvisible(u8 objectEventId); -void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId); -void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum); -bool32 IsObjectEventSpriteAnimating(u8 objectEventId); +void SetObjectEventSpriteInvisibility(u8 var, bool32 var2); +bool32 IsObjectEventSpriteInvisible(u8 var); +void SetObjectEventSpriteGraphics(u8 var1, u8 graphicsId); +void SetObjectEventSpriteAnim(u8 var1, u8 var2); +bool32 IsObjectEventSpriteAnimating(u8 var); +u8 GetObjectEventIdByLocalId(u8 localId); // NEW u16 GetMiniStepCount(u8 speed); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 88b269da6e..4cc404d354 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -103,7 +103,6 @@ static void ApplyLevitateMovement(u8); static bool8 MovementType_Disguise_Callback(struct ObjectEvent *, struct Sprite *); static bool8 MovementType_Buried_Callback(struct ObjectEvent *, struct Sprite *); static void CreateReflectionEffectSprites(void); -static u8 GetObjectEventIdByLocalId(u8); static u8 GetObjectEventIdByLocalIdAndMapInternal(u8, u8, u8); static bool8 GetAvailableObjectEventId(u16, u8, u8, u8 *); static void SetObjectEventDynamicGraphicsId(struct ObjectEvent *); @@ -1270,7 +1269,7 @@ static u8 GetObjectEventIdByLocalIdAndMapInternal(u8 localId, u8 mapNum, u8 mapG return OBJECT_EVENTS_COUNT; } -static u8 GetObjectEventIdByLocalId(u8 localId) +u8 GetObjectEventIdByLocalId(u8 localId) { u8 i; for (i = 0; i < OBJECT_EVENTS_COUNT; i++) From 09c5e27a90d4bea780ffd799bd3ed55550f88493 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 26 Jan 2021 12:30:02 -0700 Subject: [PATCH 018/133] syntax fix --- src/scrcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scrcmd.c b/src/scrcmd.c index b9c2d942a3..2acad7a795 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -998,7 +998,7 @@ bool8 ScrCmd_applymovement(struct ScriptContext *ctx) u16 localId = VarGet(ScriptReadHalfword(ctx)); const void *movementScript = (const void *)ScriptReadWord(ctx); - gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE + gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE; ScriptMovement_StartObjectMovementScript(localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, movementScript); sMovingNpcId = localId; return FALSE; @@ -1011,7 +1011,7 @@ bool8 ScrCmd_applymovement_at(struct ScriptContext *ctx) u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); - gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE + gObjectEvents[GetObjectEventIdByLocalId(localId)].directionOverwrite = DIR_NONE; ScriptMovement_StartObjectMovementScript(localId, mapNum, mapGroup, movementScript); sMovingNpcId = localId; return FALSE; From 42cc81a0b9b984143aa564b205b4b3ae58ed6753 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 1 Apr 2021 20:26:21 -0600 Subject: [PATCH 019/133] DoBobbingFieldEffect declaration --- include/field_effect_helpers.h | 2 +- src/field_effect_helpers.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9b7b6ffd5c..6ed0df4c35 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -7,7 +7,7 @@ // Exported ROM declarations u8 CreateWarpArrowSprite(void); -u8 sub_8155800(u8 oldSpriteId); +u8 DoBobbingFieldEffect(u8 oldSpriteId); void SetSurfBobState(u8 spriteId, u8 value); void SetSurfBobWhileFlyingOutState(u8 spriteId, u8 value); void SetSurfBobWhileFishingState(u8 spriteId, u8 value, s16 data1); diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index e8e3dd6fe3..d2cc1887a3 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -29,7 +29,7 @@ static void UpdateAshFieldEffect_Step2(struct Sprite *); static void SynchroniseSurfAnim(struct ObjectEvent *, struct Sprite *); static void sub_81556E8(struct ObjectEvent *, struct Sprite *); static void CreateBobbingEffect(struct ObjectEvent *, struct Sprite *, struct Sprite *); -static void sub_8155850(struct Sprite *); +static void BobbingEffectSpriteCallback(struct Sprite *); static u32 ShowDisguiseFieldEffect(u8, u8, u8); #define sReflectionObjEventId data[0] @@ -1088,14 +1088,14 @@ u8 DoBobbingFieldEffect(u8 oldSpriteId) spriteId = CreateSpriteAtEnd(&gDummySpriteTemplate, 0, 0, -1); sprite = &gSprites[spriteId]; - sprite->callback = sub_8155850; + sprite->callback = BobbingEffectSpriteCallback; sprite->invisible = TRUE; sprite->data[0] = oldSpriteId; sprite->data[1] = 1; return spriteId; } -static void sub_8155850(struct Sprite *sprite) +static void BobbingEffectSpriteCallback(struct Sprite *sprite) { struct Sprite *oldSprite; From e0ee7ce4844198218165afe3cd7102cfd3070f17 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 20 May 2021 15:45:13 -0600 Subject: [PATCH 020/133] fix bike tire tracks off sideways stairs --- src/event_object_movement.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index f976dfc68e..e2205c09f4 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -8313,12 +8313,13 @@ static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, st if (objEvent->currentCoords.x != objEvent->previousCoords.x || objEvent->currentCoords.y != objEvent->previousCoords.y) { + u8 movementDir = (objEvent->previousMovementDirection > DIR_EAST) ? (objEvent->previousMovementDirection - DIR_EAST) : objEvent->previousMovementDirection; gFieldEffectArguments[0] = objEvent->previousCoords.x; gFieldEffectArguments[1] = objEvent->previousCoords.y; gFieldEffectArguments[2] = 149; gFieldEffectArguments[3] = 2; gFieldEffectArguments[4] = - bikeTireTracks_Transitions[objEvent->previousMovementDirection][objEvent->facingDirection - 5]; + bikeTireTracks_Transitions[movementDir][objEvent->facingDirection - 5]; FieldEffectStart(FLDEFF_BIKE_TIRE_TRACKS); } } From 70026f2558cf7d463da8d6b8eb03590b6350e7d4 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 7 Apr 2022 12:24:07 -0400 Subject: [PATCH 021/133] fix tile attributes for sideways stairs behaviors --- src/metatile_behavior.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index ad674390c8..339c2ae468 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -66,13 +66,13 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = [MB_SLIDE_NORTH] = TILE_FLAG_UNUSED, [MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED, [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED, - [MB_SIDEWAYS_STAIRS_RIGHT_SIDE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_SIDEWAYS_STAIRS_LEFT_SIDE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), - [MB_ROCK_STAIRS] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE), + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_LEFT_SIDE] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_LEFT_SIDE_TOP] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM] = TILE_FLAG_UNUSED, + [MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM] = TILE_FLAG_UNUSED, + [MB_ROCK_STAIRS] = TILE_FLAG_UNUSED, [MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, [MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, [MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, From bed5472014cdd7d746a9b4e9fffc952ee9978a8e Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 29 Jul 2022 11:18:03 -0400 Subject: [PATCH 022/133] fix pos2 to x2,y2 --- src/field_screen_effect.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 82aee41755..ee7887a1f3 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1308,15 +1308,15 @@ static bool8 WaitStairExitMovementFinished(s16 *a0, s16 *a1, s16 *a2, s16 *a3, s { *a2 += *a0; *a3 += *a1; - sprite->pos2.x = *a2 >> 5; - sprite->pos2.y = *a3 >> 5; + sprite->x2 = *a2 >> 5; + sprite->y2 = *a3 >> 5; (*a4)--; return TRUE; } else { - sprite->pos2.x = 0; - sprite->pos2.y = 0; + sprite->x2 = 0; + sprite->y2 = 0; return FALSE; } } @@ -1341,8 +1341,8 @@ static void ExitStairsMovement(s16 *a0, s16 *a1, s16 *a2, s16 *a3, s16 *a4) *a3 = *a1 * 16; *a4 = 16; sprite = &gSprites[gPlayerAvatar.spriteId]; - sprite->pos2.x = *a2 >> 5; - sprite->pos2.y = *a3 >> 5; + sprite->x2 = *a2 >> 5; + sprite->y2 = *a3 >> 5; *a0 *= -1; *a1 *= -1; } @@ -1410,8 +1410,8 @@ static void UpdateStairsMovement(s16 a0, s16 a1, s16 *a2, s16 *a3, s16 *a4) *a2 += a0; (*a4)++; - playerSpr->pos2.x = *a2 >> 5; - playerSpr->pos2.y = *a3 >> 5; + playerSpr->x2 = *a2 >> 5; + playerSpr->y2 = *a3 >> 5; if (playerObj->heldMovementFinished) ObjectEventForceSetHeldMovement(playerObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); } From 906622f04dc3a977f379196af295158c9d5324d2 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 29 Jul 2022 11:26:21 -0400 Subject: [PATCH 023/133] add gExitStairsMovementDisabled --- include/overworld.h | 1 + src/field_screen_effect.c | 4 +++- src/overworld.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/overworld.h b/include/overworld.h index adaa6aad04..e24b8e4d9c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -51,6 +51,7 @@ extern void (*gFieldCallback)(void); extern bool8 (*gFieldCallback2)(void); extern u8 gLocalLinkPlayerId; extern u8 gFieldLinkPlayerCount; +extern bool8 gExitStairsMovementDisabled; extern const struct UCoords32 gDirectionToVectors[]; diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index ee7887a1f3..7f775aefdc 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -264,12 +264,14 @@ static void SetUpWarpExitTask(void) behavior = MapGridGetMetatileBehaviorAt(x, y); if (MetatileBehavior_IsDoor(behavior) == TRUE) func = Task_ExitDoor; - else if (MetatileBehavior_IsDirectionalStairWarp(behavior) == TRUE) + else if (MetatileBehavior_IsDirectionalStairWarp(behavior) == TRUE && !gExitStairsMovementDisabled) func = Task_ExitStairs; else if (MetatileBehavior_IsNonAnimDoor(behavior) == TRUE) func = Task_ExitNonAnimDoor; else func = Task_ExitNonDoor; + + gExitStairsMovementDisabled = FALSE; CreateTask(func, 10); } diff --git a/src/overworld.c b/src/overworld.c index 383f10ffe1..108a646cfb 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -202,6 +202,7 @@ EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0 EWRAM_DATA static u16 sAmbientCrySpecies = 0; EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE; EWRAM_DATA struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4] = {0}; +EWRAM_DATA bool8 gExitStairsMovementDisabled = FALSE; static const struct WarpData sDummyWarpData = { @@ -1729,6 +1730,7 @@ void CB2_ContinueSavedGame(void) PlayTimeCounter_Start(); ScriptContext1_Init(); ScriptContext2_Disable(); + gExitStairsMovementDisabled = TRUE; InitMatchCallCounters(); if (UseContinueGameWarp() == TRUE) { @@ -1814,6 +1816,7 @@ static bool32 LoadMapInStepsLink(u8 *state) (*state)++; break; case 1: + gExitStairsMovementDisabled = FALSE; LoadMapFromWarp(TRUE); (*state)++; break; From 7bb81150999f6585e3e6eeb8c4bc22c42e27893f Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 3 Mar 2023 09:08:05 -0500 Subject: [PATCH 024/133] add start menu funcs, credit deokishisu --- data/event_scripts.s | 1 + data/specials.inc | 1 + src/field_control_avatar.c | 12 ++++++++++++ src/field_specials.c | 7 +++++++ 4 files changed, 21 insertions(+) diff --git a/data/event_scripts.s b/data/event_scripts.s index 886c55f71c..3d2a9b2a81 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -691,6 +691,7 @@ EventScript_BackupMrBrineyLocation:: @ 8271E95 .include "data/scripts/set_gym_trainers.inc" EventScript_CancelMessageBox:: + special DoPicboxCancel release end diff --git a/data/specials.inc b/data/specials.inc index 620fae369b..9c23506d20 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -535,3 +535,4 @@ gSpecials:: @ 81DBA64 def_special RemoveRecordsWindow def_special CloseDeptStoreElevatorWindow def_special TrySetBattleTowerLinkType + def_special DoPicboxCancel diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 16e334f429..6547855610 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1103,6 +1103,16 @@ static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) return EventScript_TestSignpostMsg; } +static void Task_OpenStartMenu(u8 taskId) +{ + if (!ArePlayerFieldControlsLocked()) + { + PlaySE(SE_WIN_OPEN); + ShowStartMenu(); + DestroyTask(taskId); + } +} + void FieldInput_HandleCancelSignpost(struct FieldInput *input) { if (ScriptContext1_IsScriptSetUp() == TRUE) @@ -1123,6 +1133,8 @@ void FieldInput_HandleCancelSignpost(struct FieldInput *input) { ScriptContext1_SetupScript(EventScript_CancelMessageBox); ScriptContext2_Enable(); + if (!FuncIsActiveTask(Task_OpenStartMenu)) + CreateTask(Task_OpenStartMenu, 8); } } } diff --git a/src/field_specials.c b/src/field_specials.c index 86be21edac..93e5c0d1c1 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -4376,3 +4376,10 @@ u8 Script_TryGainNewFanFromCounter(void) { return TryGainNewFanFromCounter(gSpecialVar_0x8004); } + +void DoPicboxCancel(void) +{ + u8 t = EOS; + AddTextPrinterParameterized(0, FONT_NORMAL, &t, 0, 1, 0, NULL); + ScriptMenu_HidePokemonPic(); +} From 9bf64085ba959c4c494eec9d8ae74d958f2781ed Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 21 May 2023 12:56:15 -0400 Subject: [PATCH 025/133] fix script context func names --- src/field_screen_effect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index e006db412f..fd6ac119d5 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1356,14 +1356,14 @@ static void Task_ExitStairs(u8 taskId) if (WaitForWeatherFadeIn() == TRUE) { CameraObjectReset1(); - ScriptContext2_Disable(); + UnlockPlayerFieldControls(); DestroyTask(taskId); } break; case 0: Overworld_PlaySpecialMapMusic(); WarpFadeInScreen(); - ScriptContext2_Enable(); + LockPlayerFieldControls(); ExitStairsMovement(&data[1], &data[2], &data[3], &data[4], &data[5]); data[0]++; break; @@ -1425,7 +1425,7 @@ static void Task_StairWarp(u8 taskId) switch (data[0]) { case 0: - ScriptContext2_Enable(); + LockPlayerFieldControls(); FreezeObjectEvents(); CameraObjectReset2(); data[0]++; From e52349b474a58928acba5145e8f596cc13bbc675 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Mon, 22 May 2023 12:28:32 -0400 Subject: [PATCH 026/133] fix missed conflict --- include/event_object_movement.h | 6 ------ src/event_object_movement.c | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index e636fd032d..dc3b4852ed 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -214,13 +214,7 @@ s16 GetFigure8YOffset(s16 idx); void CameraObjectReset2(void); u8 GetObjectEventBerryTreeId(u8 objectEventId); void SetBerryTreeJustPicked(u8 mapId, u8 mapNumber, u8 mapGroup); -<<<<<<< HEAD -bool8 IsBerryTreeSparkling(u8, u8, u8); -struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup); -u8 TrySpawnObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY); -======= bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup); ->>>>>>> 73a6a583b3706979e1a15976e30270984f1f0c26 void MovementType_None(struct Sprite *); void MovementType_LookAround(struct Sprite *); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 084f8760cd..1bf74a7818 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -133,6 +133,7 @@ static u16 GetObjectEventFlagIdByObjectEventId(u8); static void UpdateObjectEventVisibility(struct ObjectEvent *, struct Sprite *); static void MakeSpriteTemplateFromObjectEventTemplate(const struct ObjectEventTemplate *, struct SpriteTemplate *, const struct SubspriteTable **); static void GetObjectEventMovingCameraOffset(s16 *, s16 *); +static const struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8); static void LoadObjectEventPalette(u16); static void RemoveObjectEventIfOutsideView(struct ObjectEvent *); static void SpawnObjectEventOnReturnToField(u8, s16, s16); @@ -1535,7 +1536,7 @@ static u8 TrySetupObjectEventSprite(const struct ObjectEventTemplate *objectEven return objectEventId; } -u8 TrySpawnObjectEventTemplate(const struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) +static u8 TrySpawnObjectEventTemplate(const struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY) { u8 objectEventId; struct SpriteTemplate spriteTemplate; @@ -2498,7 +2499,7 @@ u8 GetObjectEventBerryTreeId(u8 objectEventId) return gObjectEvents[objectEventId].trainerRange_berryTreeId; } -struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup) +static const struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup) { const struct ObjectEventTemplate *templates; const struct MapHeader *mapHeader; From d80cf0a193711b8d8c902b50f9cd286f4acc7b8a Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 24 May 2023 20:48:11 -0400 Subject: [PATCH 027/133] fix exiting sideways stairs onto ice. thanks to Agustin --- src/field_player_avatar.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 44fe6e0c6e..db793d10c0 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -444,7 +444,22 @@ static bool8 ForcedMovement_None(void) static bool8 DoForcedMovement(u8 direction, void (*moveFunc)(u8)) { struct PlayerAvatar *playerAvatar = &gPlayerAvatar; - u8 collision = CheckForPlayerAvatarCollision(direction); + u8 collision; + + // Check for sideways stairs onto ice movement. + switch (direction) + { + case DIR_NORTHWEST: + case DIR_SOUTHWEST: + direction = DIR_WEST; + break; + case DIR_NORTHEAST: + case DIR_SOUTHEAST: + direction = DIR_EAST; + break; + } + + collision = CheckForPlayerAvatarCollision(direction); playerAvatar->flags |= PLAYER_AVATAR_FLAG_FORCED_MOVE; if (collision) From b3f9c8bf7c51f28275e62da7ed413c3354ca9fb8 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 19 Jun 2024 10:25:44 -0400 Subject: [PATCH 028/133] GetSidewaysStairsCollision cant descend stairs into water --- src/event_object_movement.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 1bf74a7818..a9147902c9 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4732,6 +4732,10 @@ u8 GetSidewaysStairsCollision(struct ObjectEvent *objectEvent, u8 dir, u8 curren if ((dir == DIR_SOUTH || dir == DIR_NORTH) && collision != COLLISION_NONE) return collision; + // cant descend stairs into water + if (MetatileBehavior_IsSurfableFishableWater(nextBehavior)) + return collision; + if (MetatileBehavior_IsSidewaysStairsLeftSide(nextBehavior)) { //moving ONTO left side stair From 8a6407b6bc9301b1d0e2c5fd0b0631ffd65e8ba7 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 19 Jun 2024 12:30:09 -0400 Subject: [PATCH 029/133] fix warning --- src/event_object_movement.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index df5c4fd14b..212280d7b8 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -6069,7 +6069,6 @@ static bool8 ObjectEventOnRightSideStair(struct ObjectEvent *objectEvent, s16 x, u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir) { - u8 direction = dir; u8 currentBehavior = MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y); u8 nextBehavior = MapGridGetMetatileBehaviorAt(x, y); u8 collision; From e864b686c7d3119bf2fcdf81227ee81bb38a92bc Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 19 Jun 2024 12:45:36 -0400 Subject: [PATCH 030/133] fix another warning --- src/field_player_avatar.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 42000c5673..2819e27846 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -713,7 +713,6 @@ static u8 CheckForPlayerAvatarStaticCollision(u8 direction) u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior) { u8 collision = GetCollisionAtCoords(objectEvent, x, y, direction); - u8 currentBehavior = MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y); if (collision == COLLISION_ELEVATION_MISMATCH && CanStopSurfing(x, y, direction)) return COLLISION_STOP_SURFING; @@ -733,21 +732,6 @@ u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u CheckAcroBikeCollision(x, y, metatileBehavior, &collision); } - //sideways stairs logic - /* - if (MetatileBehavior_IsSidewaysStairsLeftSideTop(metatileBehavior) && direction == DIR_EAST) - return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move - else if (MetatileBehavior_IsSidewaysStairsRightSideTop(metatileBehavior) && direction == DIR_WEST) - return COLLISION_IMPASSABLE; //moving onto left-side top edge east from ground -> cannot move - else if (MetatileBehavior_IsSidewaysStairsRightSideBottom(metatileBehavior) && (direction == DIR_EAST || direction == DIR_SOUTH)) - return COLLISION_IMPASSABLE; - else if (MetatileBehavior_IsSidewaysStairsLeftSideBottom(metatileBehavior) && (direction == DIR_WEST || direction == DIR_SOUTH)) - return COLLISION_IMPASSABLE; - else if ((MetatileBehavior_IsSidewaysStairsLeftSideTop(currentBehavior) || MetatileBehavior_IsSidewaysStairsRightSideTop(currentBehavior)) - && direction == DIR_NORTH && collision == COLLISION_NONE) - return COLLISION_IMPASSABLE; //trying to move north off of top-most tile onto same level doesn't work - */ - return collision; } From 0cffe4a96aa34e7c3a28a10e2b51c692a7b85e87 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Mon, 8 Jul 2024 14:08:15 -0400 Subject: [PATCH 031/133] syntax fixes, turn slow movement on rock stairs default off, remove petalburg layout change --- data/layouts/PetalburgCity/map.bin | Bin 1800 -> 1800 bytes include/config/overworld.h | 2 +- src/bike.c | 3 +- .../movement_action_func_tables.h | 4 - src/field_player_avatar.c | 6 +- src/metatile_behavior.c | 232 +++++++++--------- 6 files changed, 120 insertions(+), 127 deletions(-) diff --git a/data/layouts/PetalburgCity/map.bin b/data/layouts/PetalburgCity/map.bin index 46c808e0556b1a035ea9cc16f5e47fc0a64f20f5..35f0172ca20a07e800bc248b803e740364a24715 100644 GIT binary patch delta 232 zcmeC+>)_k)fQeVq5CIh@Z)6gl#4IHkWE5Tc zp%4~5o@b`dO%+%aS%g`XSSBYhiA-L^BF6)^(+Fbo)_k)fQcuACDQ={vsfliU=f+bEG5WjFoUVk0Rks5F&ZdL)@Ih`V>Flv7oEs7 zIfYpdC^U;Hn!!h%wkB9_T_m^DN$3M>@ZCBSF^k~q(B zo&hW&!2;4=zyh=>p)g?r6Hsjki=Mz-qZv#)Bs^E$W{(k1D*<&N+_&ine4)v!+3G?M%Hjf05ujtS^xk5 diff --git a/include/config/overworld.h b/include/config/overworld.h index fc6865f53f..6fa0ec9c98 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,7 +3,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. -#define SLOW_MOVEMENT_ON_STAIRS TRUE // If enabled, the player will move slower up/down stairs like in FR +#define SLOW_MOVEMENT_ON_STAIRS FALSE // If enabled, the player will move slower up/down stairs like in FR // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. diff --git a/src/bike.c b/src/bike.c index 1cfecfe152..427dfdfcf2 100644 --- a/src/bike.c +++ b/src/bike.c @@ -206,7 +206,7 @@ static void MachBikeTransition_TurnDirection(u8 direction) Bike_SetBikeStill(); } else - { + { MachBikeTransition_FaceDirection(playerObjEvent->facingDirection); } } @@ -246,6 +246,7 @@ static void MachBikeTransition_TrySpeedUp(u8 direction) } else { + // we did not hit anything that can slow us down, so perform the advancement callback depending on the bikeFrameCounter and try to increase the mach bike's speed. if (ObjectMovingOnRockStairs(playerObjEvent, direction) && gPlayerAvatar.bikeFrameCounter > 1) gPlayerAvatar.bikeFrameCounter--; diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 0ee3e78afc..dda5ff3991 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -266,7 +266,6 @@ u8 MovementAction_FlyUp_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_Fly_Finish(struct ObjectEvent *, struct Sprite *); u8 MovementAction_FlyDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_FlyDown_Step1(struct ObjectEvent *, struct Sprite *); -//slow running u8 MovementActionFunc_RunSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); u8 MovementActionFunc_RunSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); u8 MovementActionFunc_RunSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite); @@ -435,7 +434,6 @@ u8 (*const gMovementActionFuncs_FlyUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FlyDown[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_EmoteX[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, struct Sprite *); -//run slow u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RunUpSlow[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_RunLeftSlow[])(struct ObjectEvent *, struct Sprite *); @@ -604,7 +602,6 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) [MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK] = gMovementActionFuncs_EmoteDoubleExclMark, [MOVEMENT_ACTION_EXIT_POKEBALL] = gMovementActionFuncs_ExitPokeball, [MOVEMENT_ACTION_ENTER_POKEBALL] = gMovementActionFuncs_EnterPokeball, - //run slow [MOVEMENT_ACTION_RUN_DOWN_SLOW] = gMovementActionFuncs_RunDownSlow, [MOVEMENT_ACTION_RUN_UP_SLOW] = gMovementActionFuncs_RunUpSlow, [MOVEMENT_ACTION_RUN_LEFT_SLOW] = gMovementActionFuncs_RunLeftSlow, @@ -1571,7 +1568,6 @@ u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, str MovementAction_Finish, }; -//slow running u8 (*const gMovementActionFuncs_RunDownSlow[])(struct ObjectEvent *, struct Sprite *) = { MovementActionFunc_RunSlowDown_Step0, MovementActionFunc_RunSlow_Step1, diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 2819e27846..8e7c47b89e 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -638,7 +638,7 @@ static void PlayerNotOnBikeTurningInPlace(u8 direction, u16 heldKeys) static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) { u8 collision = CheckForPlayerAvatarCollision(direction); - + if (collision) { if (collision == COLLISION_LEDGE_JUMP) @@ -659,7 +659,7 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) return; } } - + if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) { // same speed as running @@ -2473,7 +2473,6 @@ u8 GetRightSideStairsDirection(u8 direction) default: if (direction > DIR_EAST) direction -= DIR_EAST; - return direction; } } @@ -2489,7 +2488,6 @@ u8 GetLeftSideStairsDirection(u8 direction) default: if (direction > DIR_EAST) direction -= DIR_EAST; - return direction; } } diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 6de81c0f05..7063afcf59 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -8,64 +8,64 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = { - [MB_NORMAL] = TILE_FLAG_UNUSED, - [MB_TALL_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_LONG_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_UNUSED_05] = TILE_FLAG_HAS_ENCOUNTERS, - [MB_DEEP_SAND] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_SHORT_GRASS] = TILE_FLAG_UNUSED, - [MB_CAVE] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_LONG_GRASS_SOUTH_EDGE] = TILE_FLAG_UNUSED, - [MB_NO_RUNNING] = TILE_FLAG_UNUSED, - [MB_INDOOR_ENCOUNTER] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_MOUNTAIN_TOP] = TILE_FLAG_UNUSED, - [MB_BATTLE_PYRAMID_WARP] = TILE_FLAG_UNUSED, - [MB_MOSSDEEP_GYM_WARP] = TILE_FLAG_UNUSED, - [MB_MT_PYRE_HOLE] = TILE_FLAG_UNUSED, - [MB_POND_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_INTERIOR_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_WATERFALL] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_SOOTOPOLIS_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_OCEAN_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_PUDDLE] = TILE_FLAG_UNUSED, - [MB_SHALLOW_WATER] = TILE_FLAG_UNUSED, - [MB_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_FLAG_UNUSED, - [MB_SHOAL_CAVE_ENTRANCE] = TILE_FLAG_UNUSED, - [MB_ICE] = TILE_FLAG_UNUSED, - [MB_SAND] = TILE_FLAG_UNUSED, - [MB_SEAWEED] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_UNUSED_23] = TILE_FLAG_UNUSED, - [MB_ASHGRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_FOOTPRINTS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, - [MB_THIN_ICE] = TILE_FLAG_UNUSED, - [MB_CRACKED_ICE] = TILE_FLAG_UNUSED, - [MB_HOT_SPRINGS] = TILE_FLAG_UNUSED, - [MB_LAVARIDGE_GYM_B1F_WARP] = TILE_FLAG_UNUSED, - [MB_SEAWEED_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, - [MB_REFLECTION_UNDER_BRIDGE] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_EAST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_WEST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_NORTH] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTH] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_NORTHEAST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_NORTHWEST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTHEAST] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTHWEST] = TILE_FLAG_UNUSED, - [MB_JUMP_NORTHEAST] = TILE_FLAG_UNUSED, - [MB_JUMP_NORTHWEST] = TILE_FLAG_UNUSED, - [MB_JUMP_SOUTHEAST] = TILE_FLAG_UNUSED, - [MB_JUMP_SOUTHWEST] = TILE_FLAG_UNUSED, - [MB_WALK_EAST] = TILE_FLAG_UNUSED, - [MB_WALK_WEST] = TILE_FLAG_UNUSED, - [MB_WALK_NORTH] = TILE_FLAG_UNUSED, - [MB_WALK_SOUTH] = TILE_FLAG_UNUSED, - [MB_SLIDE_EAST] = TILE_FLAG_UNUSED, - [MB_SLIDE_WEST] = TILE_FLAG_UNUSED, - [MB_SLIDE_NORTH] = TILE_FLAG_UNUSED, - [MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED, - [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED, + [MB_NORMAL] = TILE_FLAG_UNUSED, + [MB_TALL_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_LONG_GRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_UNUSED_05] = TILE_FLAG_HAS_ENCOUNTERS, + [MB_DEEP_SAND] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_SHORT_GRASS] = TILE_FLAG_UNUSED, + [MB_CAVE] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_LONG_GRASS_SOUTH_EDGE] = TILE_FLAG_UNUSED, + [MB_NO_RUNNING] = TILE_FLAG_UNUSED, + [MB_INDOOR_ENCOUNTER] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_MOUNTAIN_TOP] = TILE_FLAG_UNUSED, + [MB_BATTLE_PYRAMID_WARP] = TILE_FLAG_UNUSED, + [MB_MOSSDEEP_GYM_WARP] = TILE_FLAG_UNUSED, + [MB_MT_PYRE_HOLE] = TILE_FLAG_UNUSED, + [MB_POND_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_INTERIOR_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_WATERFALL] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_SOOTOPOLIS_DEEP_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_OCEAN_WATER] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_PUDDLE] = TILE_FLAG_UNUSED, + [MB_SHALLOW_WATER] = TILE_FLAG_UNUSED, + [MB_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_FLAG_UNUSED, + [MB_SHOAL_CAVE_ENTRANCE] = TILE_FLAG_UNUSED, + [MB_ICE] = TILE_FLAG_UNUSED, + [MB_SAND] = TILE_FLAG_UNUSED, + [MB_SEAWEED] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_UNUSED_23] = TILE_FLAG_UNUSED, + [MB_ASHGRASS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_FOOTPRINTS] = TILE_FLAG_UNUSED | TILE_FLAG_HAS_ENCOUNTERS, + [MB_THIN_ICE] = TILE_FLAG_UNUSED, + [MB_CRACKED_ICE] = TILE_FLAG_UNUSED, + [MB_HOT_SPRINGS] = TILE_FLAG_UNUSED, + [MB_LAVARIDGE_GYM_B1F_WARP] = TILE_FLAG_UNUSED, + [MB_SEAWEED_NO_SURFACING] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS, + [MB_REFLECTION_UNDER_BRIDGE] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_EAST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_WEST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_NORTH] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTH] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_NORTHEAST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_NORTHWEST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTHEAST] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTHWEST] = TILE_FLAG_UNUSED, + [MB_JUMP_NORTHEAST] = TILE_FLAG_UNUSED, + [MB_JUMP_NORTHWEST] = TILE_FLAG_UNUSED, + [MB_JUMP_SOUTHEAST] = TILE_FLAG_UNUSED, + [MB_JUMP_SOUTHWEST] = TILE_FLAG_UNUSED, + [MB_WALK_EAST] = TILE_FLAG_UNUSED, + [MB_WALK_WEST] = TILE_FLAG_UNUSED, + [MB_WALK_NORTH] = TILE_FLAG_UNUSED, + [MB_WALK_SOUTH] = TILE_FLAG_UNUSED, + [MB_SLIDE_EAST] = TILE_FLAG_UNUSED, + [MB_SLIDE_WEST] = TILE_FLAG_UNUSED, + [MB_SLIDE_NORTH] = TILE_FLAG_UNUSED, + [MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED, + [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED, [MB_SIDEWAYS_STAIRS_RIGHT_SIDE] = TILE_FLAG_UNUSED, [MB_SIDEWAYS_STAIRS_LEFT_SIDE] = TILE_FLAG_UNUSED, [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_TOP] = TILE_FLAG_UNUSED, @@ -73,63 +73,63 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = [MB_SIDEWAYS_STAIRS_RIGHT_SIDE_BOTTOM] = TILE_FLAG_UNUSED, [MB_SIDEWAYS_STAIRS_LEFT_SIDE_BOTTOM] = TILE_FLAG_UNUSED, [MB_ROCK_STAIRS] = TILE_FLAG_UNUSED, - [MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_SOUTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_NON_ANIMATED_DOOR] = TILE_FLAG_UNUSED, - [MB_LADDER] = TILE_FLAG_UNUSED, - [MB_EAST_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_WEST_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_NORTH_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED, - [MB_CRACKED_FLOOR_HOLE] = TILE_FLAG_UNUSED, - [MB_AQUA_HIDEOUT_WARP] = TILE_FLAG_UNUSED, - [MB_LAVARIDGE_GYM_1F_WARP] = TILE_FLAG_UNUSED, - [MB_ANIMATED_DOOR] = TILE_FLAG_UNUSED, - [MB_UP_ESCALATOR] = TILE_FLAG_UNUSED, - [MB_DOWN_ESCALATOR] = TILE_FLAG_UNUSED, - [MB_WATER_DOOR] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_WATER_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_DEEP_SOUTH_WARP] = TILE_FLAG_UNUSED, - [MB_UNUSED_6F] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, - [MB_BRIDGE_OVER_POND_LOW] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_MED] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_HIGH] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_FLAG_UNUSED, - [MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_FLAG_UNUSED, - [MB_FORTREE_BRIDGE] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_FLAG_UNUSED, - [MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_FLAG_UNUSED, - [MB_UNUSED_BRIDGE] = TILE_FLAG_UNUSED, - [MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_SCENERY] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_TRAINER_SPOT] = TILE_FLAG_UNUSED, - [MB_HOLDS_SMALL_DECORATION] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_BALLOON] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_IMPASSABLE] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_GLITTER_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_JUMP_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_SPIN_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_SOUND_MAT] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_FLAG_UNUSED, - [MB_IMPASSABLE_WEST_AND_EAST] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_HOLE] = TILE_FLAG_UNUSED, - [MB_HOLDS_LARGE_DECORATION] = TILE_FLAG_UNUSED, - [MB_SECRET_BASE_TV_SHIELD] = TILE_FLAG_UNUSED, - [MB_PLAYER_ROOM_PC_ON] = TILE_FLAG_UNUSED, - [MB_MUDDY_SLOPE] = TILE_FLAG_UNUSED, - [MB_BUMPY_SLOPE] = TILE_FLAG_UNUSED, - [MB_CRACKED_FLOOR] = TILE_FLAG_UNUSED, - [MB_ISOLATED_VERTICAL_RAIL] = TILE_FLAG_UNUSED, - [MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, - [MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED, - [MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, + [MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_SOUTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_NON_ANIMATED_DOOR] = TILE_FLAG_UNUSED, + [MB_LADDER] = TILE_FLAG_UNUSED, + [MB_EAST_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_WEST_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_NORTH_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED, + [MB_CRACKED_FLOOR_HOLE] = TILE_FLAG_UNUSED, + [MB_AQUA_HIDEOUT_WARP] = TILE_FLAG_UNUSED, + [MB_LAVARIDGE_GYM_1F_WARP] = TILE_FLAG_UNUSED, + [MB_ANIMATED_DOOR] = TILE_FLAG_UNUSED, + [MB_UP_ESCALATOR] = TILE_FLAG_UNUSED, + [MB_DOWN_ESCALATOR] = TILE_FLAG_UNUSED, + [MB_WATER_DOOR] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_WATER_SOUTH_ARROW_WARP] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_DEEP_SOUTH_WARP] = TILE_FLAG_UNUSED, + [MB_UNUSED_6F] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, + [MB_BRIDGE_OVER_POND_LOW] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_MED] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_HIGH] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_FLAG_UNUSED, + [MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_FLAG_UNUSED, + [MB_FORTREE_BRIDGE] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_FLAG_UNUSED, + [MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_FLAG_UNUSED, + [MB_UNUSED_BRIDGE] = TILE_FLAG_UNUSED, + [MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_SCENERY] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_TRAINER_SPOT] = TILE_FLAG_UNUSED, + [MB_HOLDS_SMALL_DECORATION] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_BALLOON] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_IMPASSABLE] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_GLITTER_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_JUMP_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_SPIN_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_SOUND_MAT] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_FLAG_UNUSED, + [MB_IMPASSABLE_WEST_AND_EAST] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_HOLE] = TILE_FLAG_UNUSED, + [MB_HOLDS_LARGE_DECORATION] = TILE_FLAG_UNUSED, + [MB_SECRET_BASE_TV_SHIELD] = TILE_FLAG_UNUSED, + [MB_PLAYER_ROOM_PC_ON] = TILE_FLAG_UNUSED, + [MB_MUDDY_SLOPE] = TILE_FLAG_UNUSED, + [MB_BUMPY_SLOPE] = TILE_FLAG_UNUSED, + [MB_CRACKED_FLOOR] = TILE_FLAG_UNUSED, + [MB_ISOLATED_VERTICAL_RAIL] = TILE_FLAG_UNUSED, + [MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, + [MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED, + [MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, }; bool8 MetatileBehavior_IsATile(u8 metatileBehavior) @@ -1481,5 +1481,3 @@ bool8 MetatileBehavior_IsRockStairs(u8 metatileBehavior) else return FALSE; } - - From b43e0e07f73f57c143e0935d0d06f1b469383307 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Mon, 15 Jul 2024 21:45:34 -0700 Subject: [PATCH 032/133] Add config to disable OW_AUTO_SIGNPOST --- include/config/overworld.h | 1 + include/constants/metatile_behaviors.h | 4 ++++ src/metatile_behavior.c | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/include/config/overworld.h b/include/config/overworld.h index b666426996..8d9a46e0b8 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,6 +3,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. +#define OW_AUTO_SIGNPOST FALSE // When the tile that the player is facing has MB_SIGNPOST, the player will automatically read the signpoost. // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 05ee34110d..56df442bb8 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -30,7 +30,11 @@ #define MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2 0x1A #define MB_STAIRS_OUTSIDE_ABANDONED_SHIP 0x1B #define MB_SHOAL_CAVE_ENTRANCE 0x1C +#if OW_AUTO_SIGNPOST == TRUE #define MB_SIGNPOST 0x1D +#else +#define MB_UNUSED_1D 0x1D +#endif #define MB_UNUSED_1E 0x1E #define MB_UNUSED_1F 0x1F #define MB_ICE 0x20 diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index e8abdf5fd8..e5c72b127c 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -125,7 +125,9 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = [MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, [MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED, [MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, +#if OW_AUTO_SIGNPOST == TRUE [MB_SIGNPOST] = TILE_FLAG_UNUSED, +#endif }; bool8 MetatileBehavior_IsATile(u8 metatileBehavior) @@ -1404,6 +1406,10 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) bool8 MetatileBehavior_IsSignpost(u8 mb) { +#if OW_AUTO_SIGNPOST == TRUE return (mb == MB_SIGNPOST); +#else + return FALSE; +#endif } From 8445d44fb6b628d0fb1c812e0250eeac6a87005a Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Mon, 15 Jul 2024 21:48:24 -0700 Subject: [PATCH 033/133] Renamed DoPicboxCancel to UseBlankMessageToCancelPokemonPic --- data/event_scripts.s | 2 +- data/specials.inc | 2 +- include/config/overworld.h | 2 +- src/field_specials.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/event_scripts.s b/data/event_scripts.s index 1778472823..2d1b0d1bea 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -694,7 +694,7 @@ EventScript_BackupMrBrineyLocation:: .include "data/scripts/set_gym_trainers.inc" EventScript_CancelMessageBox:: - special DoPicboxCancel + special UseBlankMessageToCancelPokemonPic release end diff --git a/data/specials.inc b/data/specials.inc index 2779b1fe0c..044d794bc8 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -554,4 +554,4 @@ gSpecials:: def_special Script_GetChosenMonDefensiveEVs def_special Script_GetChosenMonOffensiveIVs def_special Script_GetChosenMonDefensiveIVs - def_special DoPicboxCancel + def_special UseBlankMessageToCancelPokemonPic diff --git a/include/config/overworld.h b/include/config/overworld.h index 8d9a46e0b8..412ced44e6 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,7 +3,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. -#define OW_AUTO_SIGNPOST FALSE // When the tile that the player is facing has MB_SIGNPOST, the player will automatically read the signpoost. +#define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, the player will automatically read the signpost. // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. diff --git a/src/field_specials.c b/src/field_specials.c index d247a4da80..e37a61f4df 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -4267,7 +4267,7 @@ void PreparePartyForSkyBattle(void) CompactPartySlots(); } -void DoPicboxCancel(void) +void UseBlankMessageToCancelPokemonPic(void) { u8 t = EOS; AddTextPrinterParameterized(0, FONT_NORMAL, &t, 0, 1, 0, NULL); From b54cf221d8098cc0a1d53ec5adb867db7d324cd3 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Mon, 15 Jul 2024 22:13:33 -0700 Subject: [PATCH 034/133] Renamed and refactored FieldInput_HandleCancelSignpost into CancelSignPostMessageBox --- include/config/overworld.h | 2 +- include/event_scripts.h | 7 ++-- include/field_control_avatar.h | 2 +- src/field_control_avatar.c | 59 ++++++++++++++++++++-------------- src/overworld.c | 2 +- 5 files changed, 41 insertions(+), 31 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 412ced44e6..aeaf88be58 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,7 +3,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. -#define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, the player will automatically read the signpost. +#define OW_AUTO_SIGNPOST TRUE // When enabled, if the tile that the player is facing has MB_SIGNPOST, the player will automatically read the signpost. // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. diff --git a/include/event_scripts.h b/include/event_scripts.h index 7b7ce54e67..f66e52866d 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -28,6 +28,9 @@ extern const u8 EventScript_FollowerFaceUp[]; extern const u8 EventScript_FollowerFaceResult[]; extern const u8 EnterPokeballMovement[]; +extern const u8 Common_Movement_FollowerSafeStart[]; +extern const u8 Common_Movement_FollowerSafeEnd[]; + extern const u8 EventScript_TestSignpostMsg[]; extern const u8 EventScript_TryGetTrainerScript[]; extern const u8 EventScript_StartTrainerApproach[]; @@ -643,10 +646,6 @@ extern const u8 VSSeeker_Text_BatteryNotChargedNeedXSteps[]; extern const u8 VSSeeker_Text_NoTrainersWithinRange[]; extern const u8 VSSeeker_Text_TrainersNotReady[]; extern const u8 EventScript_VsSeekerChargingDone[]; - -extern const u8 Common_Movement_FollowerSafeStart[]; -extern const u8 Common_Movement_FollowerSafeEnd[]; - extern const u8 EventScript_CancelMessageBox[]; #endif // GUARD_EVENT_SCRIPTS_H diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index 994b4b6712..cbee293a31 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -34,6 +34,6 @@ u8 TrySetDiveWarp(void); const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatileBehavior, u8 direction); const u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position); void ClearPoisonStepCounter(void); -void FieldInput_HandleCancelSignpost(struct FieldInput *input); +void CancelSignPostMessageBox(struct FieldInput *input); #endif // GUARD_FIELDCONTROLAVATAR_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 044c1c1779..85bbb4cf2b 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1167,29 +1167,40 @@ static void Task_OpenStartMenu(u8 taskId) } } -void FieldInput_HandleCancelSignpost(struct FieldInput *input) +bool32 IsDpadPushedToTurnOrMovePlayer(struct FieldInput *input) { - if (ScriptContext_IsEnabled() == TRUE) - { - if (gWalkAwayFromSignInhibitTimer != 0) - { - gWalkAwayFromSignInhibitTimer--; - } - else if (CanWalkAwayToCancelMsgBox() == TRUE) - { - //ClearMsgBoxCancelableState(); - if (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection) - { - ScriptContext_SetupScript(EventScript_CancelMessageBox); - LockPlayerFieldControls(); - } - else if (input->pressedStartButton) - { - ScriptContext_SetupScript(EventScript_CancelMessageBox); - LockPlayerFieldControls(); - if (!FuncIsActiveTask(Task_OpenStartMenu)) - CreateTask(Task_OpenStartMenu, 8); - } - } - } + return (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection); +} + +void CancelSignPostMessageBox(struct FieldInput *input) +{ + if (!ScriptContext_IsEnabled()) + return; + + if (gWalkAwayFromSignInhibitTimer) + { + gWalkAwayFromSignInhibitTimer--; + return; + } + + if (!CanWalkAwayToCancelMsgBox()) + return; + + if (IsDpadPushedToTurnOrMovePlayer(input)) + { + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); + return; + } + + if (!input->pressedStartButton) + return; + + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); + + if (FuncIsActiveTask(Task_OpenStartMenu)) + return; + + CreateTask(Task_OpenStartMenu, 8); } diff --git a/src/overworld.c b/src/overworld.c index 2d787b3cea..866ba27e8e 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1489,7 +1489,7 @@ static void DoCB1_Overworld(u16 newKeys, u16 heldKeys) UpdatePlayerAvatarTransitionState(); FieldClearPlayerInput(&inputStruct); FieldGetPlayerInput(&inputStruct, newKeys, heldKeys); - FieldInput_HandleCancelSignpost(&inputStruct); + CancelSignPostMessageBox(&inputStruct); if (!ArePlayerFieldControlsLocked()) { if (ProcessPlayerFieldInput(&inputStruct) == 1) From 1ae615651d38513ea90953a6cad857f7bb898cdc Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Mon, 15 Jul 2024 22:33:31 -0700 Subject: [PATCH 035/133] Renamed gWalkAwayFromSignInhibitTimer to gWalkAwayFromSignpostTimer --- include/field_message_box.h | 2 +- src/field_control_avatar.c | 4 ++-- src/field_message_box.c | 2 +- src/script.c | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/field_message_box.h b/include/field_message_box.h index eed6c7a9c0..810ac0fc20 100644 --- a/include/field_message_box.h +++ b/include/field_message_box.h @@ -19,6 +19,6 @@ u8 GetFieldMessageBoxMode(void); void StopFieldMessage(void); void InitFieldMessageBox(void); -extern u8 gWalkAwayFromSignInhibitTimer; +extern u8 gWalkAwayFromSignpostTimer; #endif // GUARD_FIELD_MESSAGE_BOX_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 85bbb4cf2b..3c8e7a206e 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1177,9 +1177,9 @@ void CancelSignPostMessageBox(struct FieldInput *input) if (!ScriptContext_IsEnabled()) return; - if (gWalkAwayFromSignInhibitTimer) + if (gWalkAwayFromSignpostTimer) { - gWalkAwayFromSignInhibitTimer--; + gWalkAwayFromSignpostTimer--; return; } diff --git a/src/field_message_box.c b/src/field_message_box.c index 730c569416..9d07ce24dc 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -9,7 +9,7 @@ #include "script.h" static EWRAM_DATA u8 sFieldMessageBoxMode = 0; -EWRAM_DATA u8 gWalkAwayFromSignInhibitTimer = 0; +EWRAM_DATA u8 gWalkAwayFromSignpostTimer = 0; static void ExpandStringAndStartDrawFieldMessage(const u8 *, bool32); static void StartDrawFieldMessage(void); diff --git a/src/script.c b/src/script.c index 03ce886364..6188b5070c 100644 --- a/src/script.c +++ b/src/script.c @@ -505,10 +505,11 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize) #endif //FREE_MYSTERY_EVENT_BUFFERS } -// auto read signposts +#define WALK_AWAY_SIGNPOST_FRAMES 6 + void SetWalkingIntoSignVars(void) { - gWalkAwayFromSignInhibitTimer = 6; + gWalkAwayFromSignpostTimer = 6; sMsgBoxIsCancelable = TRUE; } From 61eff23d8965d228ebf62e36b9b100e151900812 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Mon, 15 Jul 2024 22:57:29 -0700 Subject: [PATCH 036/133] Moved menu defines to header file Added FRLG signpost border Started working on LoadSignPostWindowFrameGfx --- graphics/text_window/signpost.png | Bin 0 -> 219 bytes include/menu.h | 7 +++++++ src/menu.c | 6 ------ src/script.c | 2 +- src/text_window.c | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 graphics/text_window/signpost.png diff --git a/graphics/text_window/signpost.png b/graphics/text_window/signpost.png new file mode 100644 index 0000000000000000000000000000000000000000..a37c7d17c4a73d12d8b5394dea0950293ea801fd GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^8bGYT!VDxQHLDu~DT4r?5ZB_fOaA}=pOlnz_3GJY z9321m7Awr*nDT9kVbIwnN5283&YryoM9;o~7+J;DcCYzn0QIJMx;TbtOiWHtVEpjk zol*Wk)BlSMAs={z8aV$sirMfB+kDUa{w~yEL-qIF<{SsF?=Ej-34edj+=Nw->Hq%# zwIA~%9P4tLBIdHNM9A=o9O>a=W7C<~ru9Q!twU9D0cV}UjAIuV7%py!nV|a3jvZ(t NgQu&X%Q~loCIEb?Sgim6 literal 0 HcmV?d00001 diff --git a/include/menu.h b/include/menu.h index fac4ef1b65..42bd69d45c 100644 --- a/include/menu.h +++ b/include/menu.h @@ -5,6 +5,13 @@ #include "text.h" #include "window.h" +#define DLG_WINDOW_PALETTE_NUM 15 +#define DLG_WINDOW_BASE_TILE_NUM 0x200 +#define STD_WINDOW_PALETTE_NUM 14 +#define STD_WINDOW_PALETTE_SIZE PLTT_SIZEOF(10) +#define STD_WINDOW_BASE_TILE_NUM 0x214 + + #define MENU_NOTHING_CHOSEN -2 #define MENU_B_PRESSED -1 diff --git a/src/menu.c b/src/menu.c index ff1970c3f1..1012a6b290 100644 --- a/src/menu.c +++ b/src/menu.c @@ -23,12 +23,6 @@ #include "config/overworld.h" #include "constants/songs.h" -#define DLG_WINDOW_PALETTE_NUM 15 -#define DLG_WINDOW_BASE_TILE_NUM 0x200 -#define STD_WINDOW_PALETTE_NUM 14 -#define STD_WINDOW_PALETTE_SIZE PLTT_SIZEOF(10) -#define STD_WINDOW_BASE_TILE_NUM 0x214 - struct MenuInfoIcon { u8 width; diff --git a/src/script.c b/src/script.c index 6188b5070c..98d679cd9f 100644 --- a/src/script.c +++ b/src/script.c @@ -509,7 +509,7 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize) void SetWalkingIntoSignVars(void) { - gWalkAwayFromSignpostTimer = 6; + gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; sMsgBoxIsCancelable = TRUE; } diff --git a/src/text_window.c b/src/text_window.c index d1e604d343..3cc3f7d47b 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -82,6 +82,8 @@ static const struct TilesPal sWindowFrames[WINDOW_FRAMES_COUNT] = {sTextWindowFrame20_Gfx, sTextWindowFrame20_Pal} }; +const u16 gSignpostWindow_Gfx[] = INCBIN_U16("graphics/text_window/signpost.4bpp"); + // code const struct TilesPal *GetWindowFrameTilesPal(u8 id) { @@ -199,8 +201,6 @@ void LoadUserWindowBorderGfxOnBg(u8 bg, u16 destOffset, u8 palOffset) void LoadSignPostWindowFrameGfx(void) { - // TODO signpost msgbox frames - //LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUnknown_8470B0C, 0x260, destOffset); - //LoadPalette(GetWindowFrameTilesPal(1), palIdx, 32); - LoadMessageBoxAndBorderGfx(); + LoadBgTiles(GetWindowAttribute(0, WINDOW_BG), gSignpostWindow_Gfx, 0x260, DLG_WINDOW_BASE_TILE_NUM); + LoadPalette(GetTextWindowPalette(1), BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM), PLTT_SIZE_4BPP); } From a0c5e5511c0aae9a5a8374c98c6fbf5b4d65d99f Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Wed, 24 Jul 2024 19:41:36 -0700 Subject: [PATCH 037/133] Added gSignPostWindow_Gfx Added LoadSignBoxGfx Add LoadSignPostWindowFrameGfx --- graphics/text_window/signpost.bin | Bin 0 -> 1200 bytes graphics/text_window/signpost.png | Bin 219 -> 164 bytes include/graphics.h | 3 ++- include/text_window.h | 1 + src/field_message_box.c | 2 +- src/graphics.c | 1 + src/menu.c | 6 ++++++ src/text_window.c | 13 ++++++------- 8 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 graphics/text_window/signpost.bin diff --git a/graphics/text_window/signpost.bin b/graphics/text_window/signpost.bin new file mode 100644 index 0000000000000000000000000000000000000000..6358e199db9cfc27b69dbb01b2c4b385350aee9b GIT binary patch literal 1200 zcmeH@u?+wq48xK%pbq{2Ubvx5NVR7#28KB>2VM^lLNt_VV_`R3zI@m+mC;beI-pJj AfdBvi literal 0 HcmV?d00001 diff --git a/graphics/text_window/signpost.png b/graphics/text_window/signpost.png index a37c7d17c4a73d12d8b5394dea0950293ea801fd..89e667df9265b6bd81c68962a043a68db42b2997 100644 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^7C_9w!VDziE-5wuDT4r?5ZC_<|AFA#xqI2g)j%#)z4*}Q$iB}UTi1x literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^8bGYT!VDxQHLDu~DT4r?5ZB_fOaA}=pOlnz_3GJY z9321m7Awr*nDT9kVbIwnN5283&YryoM9;o~7+J;DcCYzn0QIJMx;TbtOiWHtVEpjk zol*Wk)BlSMAs={z8aV$sirMfB+kDUa{w~yEL-qIF<{SsF?=Ej-34edj+=Nw->Hq%# zwIA~%9P4tLBIdHNM9A=o9O>a=W7C<~ru9Q!twU9D0cV}UjAIuV7%py!nV|a3jvZ(t NgQu&X%Q~loCIEb?Sgim6 diff --git a/include/graphics.h b/include/graphics.h index fc60c29ebf..2da00d9804 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2,8 +2,9 @@ #define GUARD_GRAPHICS_H // overworld -extern const u32 gMessageBox_Gfx[]; extern const u16 gMessageBox_Pal[]; +extern const u32 gMessageBox_Gfx[]; +extern const u32 gSignpostWindow_Gfx[]; // pokeballs extern const u32 gBallGfx_Poke[]; diff --git a/include/text_window.h b/include/text_window.h index 4e26c70a90..a292d1309e 100644 --- a/include/text_window.h +++ b/include/text_window.h @@ -14,6 +14,7 @@ extern const u16 gTextWindowFrame1_Pal[]; const struct TilesPal *GetWindowFrameTilesPal(u8 id); void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset); +void LoadSignBoxGfx(u8 windowId, u16 destOffset, u8 palOffset); void LoadWindowGfx(u8 windowId, u8 frameId, u16 destOffset, u8 palOffset); void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset); void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset); diff --git a/src/field_message_box.c b/src/field_message_box.c index 9d07ce24dc..4f50699a6a 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -41,7 +41,7 @@ static void Task_DrawFieldMessage(u8 taskId) task->tState++; break; case 1: - DrawDialogueFrame(0, TRUE); + DrawDialogueFrame(0, TRUE); task->tState++; break; case 2: diff --git a/src/graphics.c b/src/graphics.c index 58c629fbc9..4efd17db09 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1984,6 +1984,7 @@ const u16 gTradeMenuMonBox_Tilemap[] = INCBIN_U16("graphics/trade/menu_mon_box.b const u16 gMessageBox_Pal[] = INCBIN_U16("graphics/text_window/message_box.gbapal"); const u8 gMessageBox_Gfx[] = INCBIN_U8("graphics/text_window/message_box.4bpp"); +const u8 gSignpostWindow_Gfx[] = INCBIN_U8("graphics/text_window/signpost.4bpp"); const u32 gWallpaperIcon_Cross[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/cross.4bpp.lz"); const u32 gWallpaperIcon_Bolt[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/bolt.4bpp.lz"); diff --git a/src/menu.c b/src/menu.c index 1012a6b290..ecb8dd20d6 100644 --- a/src/menu.c +++ b/src/menu.c @@ -214,6 +214,12 @@ void LoadMessageBoxAndBorderGfx(void) LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); } +void LoadSignPostWindowFrameGfx(void) +{ + LoadSignBoxGfx(0, DLG_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM)); + //LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); +} + void DrawDialogueFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, WindowFunc_DrawDialogueFrame); diff --git a/src/text_window.c b/src/text_window.c index 3cc3f7d47b..6423867205 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -82,8 +82,6 @@ static const struct TilesPal sWindowFrames[WINDOW_FRAMES_COUNT] = {sTextWindowFrame20_Gfx, sTextWindowFrame20_Pal} }; -const u16 gSignpostWindow_Gfx[] = INCBIN_U16("graphics/text_window/signpost.4bpp"); - // code const struct TilesPal *GetWindowFrameTilesPal(u8 id) { @@ -99,6 +97,12 @@ void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset) LoadPalette(GetOverworldTextboxPalettePtr(), palOffset, PLTT_SIZE_4BPP); } +void LoadSignBoxGfx(u8 windowId, u16 destOffset, u8 palOffset) +{ + LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gSignpostWindow_Gfx, 0x1C0, destOffset); + LoadPalette(GetOverworldTextboxPalettePtr(), palOffset, PLTT_SIZE_4BPP); +} + void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset) { LoadUserWindowBorderGfx(windowId, destOffset, palOffset); @@ -199,8 +203,3 @@ void LoadUserWindowBorderGfxOnBg(u8 bg, u16 destOffset, u8 palOffset) LoadPalette(GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->pal, palOffset, PLTT_SIZE_4BPP); } -void LoadSignPostWindowFrameGfx(void) -{ - LoadBgTiles(GetWindowAttribute(0, WINDOW_BG), gSignpostWindow_Gfx, 0x260, DLG_WINDOW_BASE_TILE_NUM); - LoadPalette(GetTextWindowPalette(1), BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM), PLTT_SIZE_4BPP); -} From 389f4e4180a1960c19cca9679a48bf34b42e3942 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Wed, 24 Jul 2024 20:58:18 -0700 Subject: [PATCH 038/133] Worked with ShinyDragonHunter to get signpost working --- graphics/text_window/signpost.png | Bin 164 -> 193 bytes src/menu.c | 126 +++++++++++++++++++++++++++++- src/text_window.c | 2 +- 3 files changed, 125 insertions(+), 3 deletions(-) diff --git a/graphics/text_window/signpost.png b/graphics/text_window/signpost.png index 89e667df9265b6bd81c68962a043a68db42b2997..45ab7c6764b4561cf091f05101e60c4c242c35db 100644 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^8bHj!!VDxUYZhbxDT4r?5ZB_fOaA}=pOlnz_3GJY z9321m7Awr*nDT9kVbIwnN5283&YryoM9;o~7+J;DcCYzn0QGVfctjR6Fz_7#VaBQ2 ze9}Ncb59q?5RRG22@OpD{_ig5W@2PEauEH)&uHK%AiaWV^@I0!6&QqBHXck%6urao iU* literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^7C_9w!VDziE-5wuDT4r?5ZC_<|AFA#xqI2g)j%#)z4*}Q$iB}UTi1x diff --git a/src/menu.c b/src/menu.c index ecb8dd20d6..6cb9c05492 100644 --- a/src/menu.c +++ b/src/menu.c @@ -17,6 +17,7 @@ #include "sound.h" #include "string_util.h" #include "strings.h" +#include "script.h" #include "task.h" #include "text_window.h" #include "window.h" @@ -48,6 +49,7 @@ struct Menu static u16 AddWindowParameterized(u8, u8, u8, u8, u8, u8, u16); static void WindowFunc_DrawStandardFrame(u8, u8, u8, u8, u8, u8); +static void WindowFunc_DrawSignFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_DrawDialogueFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_ClearStdWindowAndFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_ClearDialogWindowAndFrame(u8, u8, u8, u8, u8, u8); @@ -216,13 +218,133 @@ void LoadMessageBoxAndBorderGfx(void) void LoadSignPostWindowFrameGfx(void) { + Menu_LoadStdPal(); LoadSignBoxGfx(0, DLG_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM)); - //LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); + LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); +} + +static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +{ + // Top left + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 0, + tilemapLeft - 2, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 1, + tilemapLeft - 1, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 2, + tilemapLeft - 2, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 3, + tilemapLeft - 1, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + + // Bottom left + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft - 2, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft - 1, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + + // Top + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 4, + tilemapLeft, + tilemapTop - 1, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); + + // Top right + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft + 27, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft + 26, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 2), + tilemapLeft + 27, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3), + tilemapLeft + 26, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + + // Bottom right + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0)), + tilemapLeft + 27, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1)), + tilemapLeft + 26, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + + // Bottom + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4), + tilemapLeft, + tilemapTop + 4, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); +} + +static inline void *GetWindowFunc_DialogueFrame(void) +{ + return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); + } void DrawDialogueFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, WindowFunc_DrawDialogueFrame); + CallWindowFunction(windowId, GetWindowFunc_DialogueFrame()); FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) diff --git a/src/text_window.c b/src/text_window.c index 6423867205..6c02797fe3 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -100,7 +100,7 @@ void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset) void LoadSignBoxGfx(u8 windowId, u16 destOffset, u8 palOffset) { LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gSignpostWindow_Gfx, 0x1C0, destOffset); - LoadPalette(GetOverworldTextboxPalettePtr(), palOffset, PLTT_SIZE_4BPP); + LoadPalette(GetTextWindowPalette(1), palOffset, PLTT_SIZE_4BPP); } void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset) From 614b7f862e1a9b4fd7bef09c9ecc412e2438265d Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Wed, 24 Jul 2024 22:21:00 -0700 Subject: [PATCH 039/133] Working version of interactable signpost msgbox --- src/field_control_avatar.c | 16 ++++++++++++++-- src/menu.c | 12 +----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 3c8e7a206e..df77f798ce 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -82,6 +82,7 @@ static void UpdateLetsGoEvolutionTracker(void); static bool8 UpdatePoisonStepCounter(void); #endif // OW_POISON_DAMAGE static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition * position, u16 metatileBehavior, u8 playerDirection); +static void SetMsgSignPostAndVarFacing(u32 playerDirection); static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection); static u8 GetFacingSignpostType(u16 metatileBehvaior, u8 direction); static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition * position); @@ -379,6 +380,9 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position if (bgEvent->bgUnion.script == NULL) return EventScript_TestSignpostMsg; + if (GetFacingSignpostType(metatileBehavior, direction) != SIGNPOST_NA) + SetMsgSignPostAndVarFacing(direction); + switch (bgEvent->kind) { case BG_EVENT_PLAYER_FACING_ANY: @@ -1133,18 +1137,26 @@ static u8 GetFacingSignpostType(u16 metatileBehavior, u8 playerDirection) if (MetatileBehavior_IsPlayerFacingPokeMartSign(metatileBehavior, playerDirection) == TRUE) return SIGNPOST_POKEMART;*/ + DebugPrintf("behavior is %d",metatileBehavior); + if (MetatileBehavior_IsSignpost(metatileBehavior) == TRUE) return SIGNPOST_SCRIPTED; return SIGNPOST_NA; } +static void SetMsgSignPostAndVarFacing(u32 playerDirection) +{ + DebugPrintf("test"); + MsgSetSignPost(); + gSpecialVar_Facing = playerDirection; +} + static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection) { - gSpecialVar_Facing = playerDirection; ScriptContext_SetupScript(script); SetWalkingIntoSignVars(); - MsgSetSignPost(); + SetMsgSignPostAndVarFacing(playerDirection); } static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) diff --git a/src/menu.c b/src/menu.c index 6cb9c05492..620c4d13e1 100644 --- a/src/menu.c +++ b/src/menu.c @@ -225,7 +225,6 @@ void LoadSignPostWindowFrameGfx(void) static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { - // Top left FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 0, tilemapLeft - 2, @@ -254,8 +253,6 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi 1, 4, DLG_WINDOW_PALETTE_NUM); - - // Bottom left FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), tilemapLeft - 2, @@ -270,8 +267,6 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi 1, 1, DLG_WINDOW_PALETTE_NUM); - - // Top FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 4, tilemapLeft, @@ -279,8 +274,6 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi 26, 1, DLG_WINDOW_PALETTE_NUM); - - // Top right FillBgTilemapBufferRect(bg, BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), tilemapLeft + 27, @@ -309,8 +302,6 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi 1, 4, DLG_WINDOW_PALETTE_NUM); - - // Bottom right FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0)), tilemapLeft + 27, @@ -325,8 +316,6 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi 1, 1, DLG_WINDOW_PALETTE_NUM); - - // Bottom FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4), tilemapLeft, @@ -338,6 +327,7 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi static inline void *GetWindowFunc_DialogueFrame(void) { + DebugPrintf("test %d",IsMsgSignPost()); return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); } From fd69ef339c5ea1578e52f22cc51ff338cb77abb1 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Thu, 25 Jul 2024 19:33:07 -0700 Subject: [PATCH 040/133] Got pokemart and pokecenter changes working --- include/constants/metatile_behaviors.h | 4 +++- include/event_scripts.h | 3 +++ include/metatile_behavior.h | 2 ++ src/field_control_avatar.c | 18 +++++++----------- src/menu.c | 1 - src/metatile_behavior.c | 18 ++++++++++++++++++ 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 56df442bb8..808fa49df7 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -32,11 +32,13 @@ #define MB_SHOAL_CAVE_ENTRANCE 0x1C #if OW_AUTO_SIGNPOST == TRUE #define MB_SIGNPOST 0x1D +#define MB_SIGNPOST_POKECENTER 0x1E +#define MB_SIGNPOST_POKEMART 0x1F #else #define MB_UNUSED_1D 0x1D -#endif #define MB_UNUSED_1E 0x1E #define MB_UNUSED_1F 0x1F +#endif #define MB_ICE 0x20 #define MB_SAND 0x21 #define MB_SEAWEED 0x22 diff --git a/include/event_scripts.h b/include/event_scripts.h index f66e52866d..f23f52cb12 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -648,4 +648,7 @@ extern const u8 VSSeeker_Text_TrainersNotReady[]; extern const u8 EventScript_VsSeekerChargingDone[]; extern const u8 EventScript_CancelMessageBox[]; +extern const u8 Common_EventScript_ShowPokemonCenterSign[]; +extern const u8 Common_EventScript_ShowPokemartSign[]; + #endif // GUARD_EVENT_SCRIPTS_H diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 74f0beca74..0c4622adaf 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -149,5 +149,7 @@ bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); bool8 MetatileBehavior_IsSignpost(u8 mb); +bool8 MetatileBehavior_IsPokemonCenterSign(u8 mb); +bool8 MetatileBehavior_IsPokeMartSign(u8 mb); #endif // GUARD_METATILE_BEHAVIOR_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index df77f798ce..880eb8d59e 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1112,13 +1112,12 @@ static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 me switch (GetFacingSignpostType(metatileBehavior, playerDirection)) { - /* leaving this commented out for examples of custom signpost types case SIGNPOST_POKECENTER: - SetUpWalkIntoSignScript(EventScript_PokecenterSign, playerDirection); + SetUpWalkIntoSignScript(Common_EventScript_ShowPokemonCenterSign, playerDirection); return TRUE; case SIGNPOST_POKEMART: - SetUpWalkIntoSignScript(EventScript_PokemartSign, playerDirection); - return TRUE;*/ + SetUpWalkIntoSignScript(Common_EventScript_ShowPokemartSign, playerDirection); + return TRUE; case SIGNPOST_SCRIPTED: script = GetSignpostScriptAtMapPosition(position); if (script == NULL) @@ -1132,12 +1131,10 @@ static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 me static u8 GetFacingSignpostType(u16 metatileBehavior, u8 playerDirection) { - /*if (MetatileBehavior_IsPlayerFacingPokemonCenterSign(metatileBehavior, playerDirection) == TRUE) + if (MetatileBehavior_IsPokemonCenterSign(metatileBehavior) == TRUE) return SIGNPOST_POKECENTER; - if (MetatileBehavior_IsPlayerFacingPokeMartSign(metatileBehavior, playerDirection) == TRUE) - return SIGNPOST_POKEMART;*/ - - DebugPrintf("behavior is %d",metatileBehavior); + if (MetatileBehavior_IsPokeMartSign(metatileBehavior) == TRUE) + return SIGNPOST_POKEMART; if (MetatileBehavior_IsSignpost(metatileBehavior) == TRUE) return SIGNPOST_SCRIPTED; @@ -1147,7 +1144,7 @@ static u8 GetFacingSignpostType(u16 metatileBehavior, u8 playerDirection) static void SetMsgSignPostAndVarFacing(u32 playerDirection) { - DebugPrintf("test"); + SetWalkingIntoSignVars(); MsgSetSignPost(); gSpecialVar_Facing = playerDirection; } @@ -1155,7 +1152,6 @@ static void SetMsgSignPostAndVarFacing(u32 playerDirection) static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection) { ScriptContext_SetupScript(script); - SetWalkingIntoSignVars(); SetMsgSignPostAndVarFacing(playerDirection); } diff --git a/src/menu.c b/src/menu.c index 620c4d13e1..2679e0a336 100644 --- a/src/menu.c +++ b/src/menu.c @@ -327,7 +327,6 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi static inline void *GetWindowFunc_DialogueFrame(void) { - DebugPrintf("test %d",IsMsgSignPost()); return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); } diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index e5c72b127c..601e2660af 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1413,3 +1413,21 @@ bool8 MetatileBehavior_IsSignpost(u8 mb) #endif } +bool8 MetatileBehavior_IsPokemonCenterSign(u8 mb) +{ +#if OW_AUTO_SIGNPOST == TRUE + return (mb == MB_SIGNPOST_POKECENTER); +#else + return FALSE; +#endif +} + +bool8 MetatileBehavior_IsPokeMartSign(u8 mb) +{ +#if OW_AUTO_SIGNPOST == TRUE + return (mb == MB_SIGNPOST_POKEMART); +#else + return FALSE; +#endif +} + From b5c58e53de13ccf5d1142638f0320d9bec88153a Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Thu, 25 Jul 2024 19:35:28 -0700 Subject: [PATCH 041/133] Removed all comments --- include/script.h | 1 - src/field_control_avatar.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/script.h b/include/script.h index eba18ec35f..48d1f6c0ec 100644 --- a/include/script.h +++ b/include/script.h @@ -63,7 +63,6 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize); // srccmd.h void SetMovingNpcId(u16 npcId); -// auto read signs void SetWalkingIntoSignVars(void); void MsgSetSignPost(void); void ResetFacingNpcOrSignPostVars(void); diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 880eb8d59e..049305db86 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1099,8 +1099,6 @@ int SetCableClubWarp(void) return 0; } -// auto read signposts -// signposts static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 metatileBehavior, u8 playerDirection) { const u8 *script; From c6f89d199667cf9cf1ac877964fa81395ac5649b Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Thu, 25 Jul 2024 19:36:33 -0700 Subject: [PATCH 042/133] Removed swap file --- .swp | Bin 4096 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .swp diff --git a/.swp b/.swp deleted file mode 100644 index 5e1b894bdd178ae6540706061764e60b34548a85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmYc?2=nw+u+%eP00IFJ0Rc=L3=9RuX)rEc+Ql{4JH$Ug*U};^%+=Hkui8<`(GVC7 zfq@DE&QN0`LvU7CR#H?D7786Ghm6`g8UmvsFd71*Aut*OqaiRF0;3@?8UmvsFaRL{ E06$R)(EtDd From 2a5f384e6688acaac4ea3d0db464eface40f86da Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Thu, 25 Jul 2024 19:44:26 -0700 Subject: [PATCH 043/133] Added metatile behaviors to mart and center signs --- .../primary/general/metatile_attributes.bin | Bin 1024 -> 1024 bytes include/constants/metatile_behaviors.h | 4 ++-- src/metatile_behavior.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/tilesets/primary/general/metatile_attributes.bin b/data/tilesets/primary/general/metatile_attributes.bin index af9326451d561c4103afe500c5ae8c7656092fc6..95b03cbdffe43d189b8b49eadb9fb2e9b8c1db62 100644 GIT binary patch delta 21 ccmZqRXyBO8!YnT!Ke64GSx!K1<8e!706 Date: Thu, 25 Jul 2024 20:23:04 -0700 Subject: [PATCH 044/133] Revert metatile behavior --- .../primary/general/metatile_attributes.bin | Bin 1024 -> 1024 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/tilesets/primary/general/metatile_attributes.bin b/data/tilesets/primary/general/metatile_attributes.bin index 95b03cbdffe43d189b8b49eadb9fb2e9b8c1db62..d9cd29016d792fb568494dbf2f820100081a14f8 100644 GIT binary patch delta 35 jcmZqRXy9OHfPjhY`iu+{&3%~}1Q;f^+k&W#$1RxwUG4@X delta 35 ncmZqRXy9OH00Y^H?D~wd6U}{@ Date: Thu, 25 Jul 2024 20:34:14 -0700 Subject: [PATCH 045/133] Clean up files --- include/config/overworld.h | 2 +- include/event_scripts.h | 1 - include/graphics.h | 4 ++-- include/menu.h | 1 - include/metatile_behavior.h | 6 +++--- src/field_control_avatar.c | 20 ++++++++------------ src/metatile_behavior.c | 6 +++--- 7 files changed, 17 insertions(+), 23 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index aeaf88be58..292743a211 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,7 +3,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. -#define OW_AUTO_SIGNPOST TRUE // When enabled, if the tile that the player is facing has MB_SIGNPOST, the player will automatically read the signpost. +#define OW_AUTO_SIGNPOST TRUE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost. // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. diff --git a/include/event_scripts.h b/include/event_scripts.h index f23f52cb12..7ec15d4548 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -647,7 +647,6 @@ extern const u8 VSSeeker_Text_NoTrainersWithinRange[]; extern const u8 VSSeeker_Text_TrainersNotReady[]; extern const u8 EventScript_VsSeekerChargingDone[]; extern const u8 EventScript_CancelMessageBox[]; - extern const u8 Common_EventScript_ShowPokemonCenterSign[]; extern const u8 Common_EventScript_ShowPokemartSign[]; diff --git a/include/graphics.h b/include/graphics.h index 2da00d9804..e58ee7bf50 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2,9 +2,9 @@ #define GUARD_GRAPHICS_H // overworld -extern const u16 gMessageBox_Pal[]; -extern const u32 gMessageBox_Gfx[]; extern const u32 gSignpostWindow_Gfx[]; +extern const u32 gMessageBox_Gfx[]; +extern const u16 gMessageBox_Pal[]; // pokeballs extern const u32 gBallGfx_Poke[]; diff --git a/include/menu.h b/include/menu.h index 42bd69d45c..d2190fb854 100644 --- a/include/menu.h +++ b/include/menu.h @@ -11,7 +11,6 @@ #define STD_WINDOW_PALETTE_SIZE PLTT_SIZEOF(10) #define STD_WINDOW_BASE_TILE_NUM 0x214 - #define MENU_NOTHING_CHOSEN -2 #define MENU_B_PRESSED -1 diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index 0c4622adaf..d49dc2459a 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -148,8 +148,8 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); -bool8 MetatileBehavior_IsSignpost(u8 mb); -bool8 MetatileBehavior_IsPokemonCenterSign(u8 mb); -bool8 MetatileBehavior_IsPokeMartSign(u8 mb); +bool32 MetatileBehavior_IsSignpost(u32 mb); +bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb); +bool32 MetatileBehavior_IsPokeMartSign(u32 mb); #endif // GUARD_METATILE_BEHAVIOR_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 049305db86..7972be7a11 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -35,6 +35,7 @@ #include "constants/event_objects.h" #include "constants/field_poison.h" #include "constants/map_types.h" +#include "constants/metatile_behaviors.h" #include "constants/songs.h" #include "constants/trainer_hill.h" @@ -43,12 +44,7 @@ static EWRAM_DATA u16 sPrevMetatileBehavior = 0; u8 gSelectedObjectEvent; -#define SIGNPOST_POKECENTER 0 -#define SIGNPOST_POKEMART 1 -#define SIGNPOST_INDIGO_1 2 -#define SIGNPOST_INDIGO_2 3 -#define SIGNPOST_SCRIPTED 240 -#define SIGNPOST_NA 255 +#define SIGNPOST_NA 0 static void GetPlayerPosition(struct MapPosition *); static void GetInFrontOfPlayerPosition(struct MapPosition *); @@ -1110,13 +1106,13 @@ static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 me switch (GetFacingSignpostType(metatileBehavior, playerDirection)) { - case SIGNPOST_POKECENTER: + case MB_POKEMON_CENTER_SIGN: SetUpWalkIntoSignScript(Common_EventScript_ShowPokemonCenterSign, playerDirection); return TRUE; - case SIGNPOST_POKEMART: + case MB_POKEMART_SIGN: SetUpWalkIntoSignScript(Common_EventScript_ShowPokemartSign, playerDirection); return TRUE; - case SIGNPOST_SCRIPTED: + case MB_SIGNPOST: script = GetSignpostScriptAtMapPosition(position); if (script == NULL) return FALSE; @@ -1130,12 +1126,12 @@ static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 me static u8 GetFacingSignpostType(u16 metatileBehavior, u8 playerDirection) { if (MetatileBehavior_IsPokemonCenterSign(metatileBehavior) == TRUE) - return SIGNPOST_POKECENTER; + return MB_POKEMON_CENTER_SIGN; if (MetatileBehavior_IsPokeMartSign(metatileBehavior) == TRUE) - return SIGNPOST_POKEMART; + return MB_POKEMART_SIGN; if (MetatileBehavior_IsSignpost(metatileBehavior) == TRUE) - return SIGNPOST_SCRIPTED; + return MB_SIGNPOST; return SIGNPOST_NA; } diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 88bca9f0de..fcf8b64fd1 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1404,7 +1404,7 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) return FALSE; } -bool8 MetatileBehavior_IsSignpost(u8 mb) +bool32 MetatileBehavior_IsSignpost(u32 mb) { #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_SIGNPOST); @@ -1413,7 +1413,7 @@ bool8 MetatileBehavior_IsSignpost(u8 mb) #endif } -bool8 MetatileBehavior_IsPokemonCenterSign(u8 mb) +bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb) { #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMON_CENTER_SIGN); @@ -1422,7 +1422,7 @@ bool8 MetatileBehavior_IsPokemonCenterSign(u8 mb) #endif } -bool8 MetatileBehavior_IsPokeMartSign(u8 mb) +bool32 MetatileBehavior_IsPokeMartSign(u32 mb) { #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMART_SIGN); From 02cdbb3c7daeee4e1843adf2b39abf790a97e9ab Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Thu, 25 Jul 2024 21:07:11 -0700 Subject: [PATCH 046/133] Cleaned up field_control_avatar --- log2.txt | 0 src/field_control_avatar.c | 54 +++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 log2.txt diff --git a/log2.txt b/log2.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 7972be7a11..85e9f2cfb4 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -44,7 +44,7 @@ static EWRAM_DATA u16 sPrevMetatileBehavior = 0; u8 gSelectedObjectEvent; -#define SIGNPOST_NA 0 +#define NOT_SIGNPOST 0 static void GetPlayerPosition(struct MapPosition *); static void GetInFrontOfPlayerPosition(struct MapPosition *); @@ -77,10 +77,10 @@ static void UpdateLetsGoEvolutionTracker(void); #if OW_POISON_DAMAGE < GEN_5 static bool8 UpdatePoisonStepCounter(void); #endif // OW_POISON_DAMAGE -static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition * position, u16 metatileBehavior, u8 playerDirection); +static bool32 TrySetUpWalkIntoSignpostScript(struct MapPosition * position, u32 metatileBehavior, u32 playerDirection); static void SetMsgSignPostAndVarFacing(u32 playerDirection); -static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection); -static u8 GetFacingSignpostType(u16 metatileBehvaior, u8 direction); +static void SetUpWalkIntoSignScript(const u8 *script, u32 playerDirection); +static u32 GetFacingSignpostType(u16 metatileBehvaior, u32 direction); static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition * position); void FieldClearPlayerInput(struct FieldInput *input) @@ -183,18 +183,18 @@ int ProcessPlayerFieldInput(struct FieldInput *input) return TRUE; } - if (input->checkStandardWildEncounter) - { - if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) - { - GetInFrontOfPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) - return TRUE; - GetPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - } - } + if (input->checkStandardWildEncounter) + { + if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) + { + GetInFrontOfPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + GetPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + } + } if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileBehavior) == TRUE) return TRUE; @@ -376,7 +376,7 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position if (bgEvent->bgUnion.script == NULL) return EventScript_TestSignpostMsg; - if (GetFacingSignpostType(metatileBehavior, direction) != SIGNPOST_NA) + if (GetFacingSignpostType(metatileBehavior, direction) != NOT_SIGNPOST) SetMsgSignPostAndVarFacing(direction); switch (bgEvent->kind) @@ -1095,7 +1095,7 @@ int SetCableClubWarp(void) return 0; } -static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 metatileBehavior, u8 playerDirection) +static bool32 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u32 metatileBehavior, u32 playerDirection) { const u8 *script; @@ -1123,7 +1123,7 @@ static bool8 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u16 me } } -static u8 GetFacingSignpostType(u16 metatileBehavior, u8 playerDirection) +static u32 GetFacingSignpostType(u16 metatileBehavior, u32 playerDirection) { if (MetatileBehavior_IsPokemonCenterSign(metatileBehavior) == TRUE) return MB_POKEMON_CENTER_SIGN; @@ -1133,7 +1133,7 @@ static u8 GetFacingSignpostType(u16 metatileBehavior, u8 playerDirection) if (MetatileBehavior_IsSignpost(metatileBehavior) == TRUE) return MB_SIGNPOST; - return SIGNPOST_NA; + return NOT_SIGNPOST; } static void SetMsgSignPostAndVarFacing(u32 playerDirection) @@ -1143,7 +1143,7 @@ static void SetMsgSignPostAndVarFacing(u32 playerDirection) gSpecialVar_Facing = playerDirection; } -static void SetUpWalkIntoSignScript(const u8 *script, u8 playerDirection) +static void SetUpWalkIntoSignScript(const u8 *script, u32 playerDirection) { ScriptContext_SetupScript(script); SetMsgSignPostAndVarFacing(playerDirection); @@ -1161,12 +1161,12 @@ static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) static void Task_OpenStartMenu(u8 taskId) { - if (!ArePlayerFieldControlsLocked()) - { - PlaySE(SE_WIN_OPEN); - ShowStartMenu(); - DestroyTask(taskId); - } + if (ArePlayerFieldControlsLocked()) + return; + + PlaySE(SE_WIN_OPEN); + ShowStartMenu(); + DestroyTask(taskId); } bool32 IsDpadPushedToTurnOrMovePlayer(struct FieldInput *input) From f362f6e754c52ebd6e9c8f6e15ae376f3bd9884a Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Thu, 25 Jul 2024 21:22:08 -0700 Subject: [PATCH 047/133] Cleaned up metatile behavior --- src/menu.c | 2 +- src/metatile_behavior.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/menu.c b/src/menu.c index 2679e0a336..c58f72f3e5 100644 --- a/src/menu.c +++ b/src/menu.c @@ -50,6 +50,7 @@ struct Menu static u16 AddWindowParameterized(u8, u8, u8, u8, u8, u8, u16); static void WindowFunc_DrawStandardFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_DrawSignFrame(u8, u8, u8, u8, u8, u8); +static inline void *GetWindowFunc_DialogueFrame(void); static void WindowFunc_DrawDialogueFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_ClearStdWindowAndFrame(u8, u8, u8, u8, u8, u8); static void WindowFunc_ClearDialogWindowAndFrame(u8, u8, u8, u8, u8, u8); @@ -328,7 +329,6 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi static inline void *GetWindowFunc_DialogueFrame(void) { return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); - } void DrawDialogueFrame(u8 windowId, bool8 copyToVram) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index fcf8b64fd1..1212457d24 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -127,6 +127,8 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = [MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, #if OW_AUTO_SIGNPOST == TRUE [MB_SIGNPOST] = TILE_FLAG_UNUSED, + [MB_POKEMON_CENTER_SIGN] = TILE_FLAG_UNUSED, + [MB_POKEMART_SIGN] = TILE_FLAG_UNUSED, #endif }; From 59c2eeac215a8748933815d2248c064428def099 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Fri, 26 Jul 2024 21:22:29 -0700 Subject: [PATCH 048/133] Default signpost config is off --- include/config/overworld.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 292743a211..c740bf4853 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,7 +3,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. -#define OW_AUTO_SIGNPOST TRUE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost. +#define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost. // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. From 587ffeeb97a53b8ae1123d46690e45af503c37b9 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Fri, 26 Jul 2024 21:31:04 -0700 Subject: [PATCH 049/133] Fixed tabs --- src/field_control_avatar.c | 86 ++++++++-------- src/field_message_box.c | 2 +- src/menu.c | 200 ++++++++++++++++++------------------- src/metatile_behavior.c | 6 +- 4 files changed, 147 insertions(+), 147 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 85e9f2cfb4..92e9df1c54 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -183,18 +183,18 @@ int ProcessPlayerFieldInput(struct FieldInput *input) return TRUE; } - if (input->checkStandardWildEncounter) - { - if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) - { - GetInFrontOfPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) - return TRUE; - GetPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - } - } + if (input->checkStandardWildEncounter) + { + if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) + { + GetInFrontOfPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + GetPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + } + } if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileBehavior) == TRUE) return TRUE; @@ -376,8 +376,8 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position if (bgEvent->bgUnion.script == NULL) return EventScript_TestSignpostMsg; - if (GetFacingSignpostType(metatileBehavior, direction) != NOT_SIGNPOST) - SetMsgSignPostAndVarFacing(direction); + if (GetFacingSignpostType(metatileBehavior, direction) != NOT_SIGNPOST) + SetMsgSignPostAndVarFacing(direction); switch (bgEvent->kind) { @@ -1146,7 +1146,7 @@ static void SetMsgSignPostAndVarFacing(u32 playerDirection) static void SetUpWalkIntoSignScript(const u8 *script, u32 playerDirection) { ScriptContext_SetupScript(script); - SetMsgSignPostAndVarFacing(playerDirection); + SetMsgSignPostAndVarFacing(playerDirection); } static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) @@ -1161,48 +1161,48 @@ static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) static void Task_OpenStartMenu(u8 taskId) { - if (ArePlayerFieldControlsLocked()) - return; + if (ArePlayerFieldControlsLocked()) + return; - PlaySE(SE_WIN_OPEN); - ShowStartMenu(); - DestroyTask(taskId); + PlaySE(SE_WIN_OPEN); + ShowStartMenu(); + DestroyTask(taskId); } bool32 IsDpadPushedToTurnOrMovePlayer(struct FieldInput *input) { - return (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection); + return (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection); } void CancelSignPostMessageBox(struct FieldInput *input) { - if (!ScriptContext_IsEnabled()) - return; + if (!ScriptContext_IsEnabled()) + return; - if (gWalkAwayFromSignpostTimer) - { - gWalkAwayFromSignpostTimer--; - return; - } + if (gWalkAwayFromSignpostTimer) + { + gWalkAwayFromSignpostTimer--; + return; + } - if (!CanWalkAwayToCancelMsgBox()) - return; + if (!CanWalkAwayToCancelMsgBox()) + return; - if (IsDpadPushedToTurnOrMovePlayer(input)) - { - ScriptContext_SetupScript(EventScript_CancelMessageBox); - LockPlayerFieldControls(); - return; - } + if (IsDpadPushedToTurnOrMovePlayer(input)) + { + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); + return; + } - if (!input->pressedStartButton) - return; + if (!input->pressedStartButton) + return; - ScriptContext_SetupScript(EventScript_CancelMessageBox); - LockPlayerFieldControls(); + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); - if (FuncIsActiveTask(Task_OpenStartMenu)) - return; + if (FuncIsActiveTask(Task_OpenStartMenu)) + return; - CreateTask(Task_OpenStartMenu, 8); + CreateTask(Task_OpenStartMenu, 8); } diff --git a/src/field_message_box.c b/src/field_message_box.c index 4f50699a6a..9d07ce24dc 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -41,7 +41,7 @@ static void Task_DrawFieldMessage(u8 taskId) task->tState++; break; case 1: - DrawDialogueFrame(0, TRUE); + DrawDialogueFrame(0, TRUE); task->tState++; break; case 2: diff --git a/src/menu.c b/src/menu.c index c58f72f3e5..441c80250e 100644 --- a/src/menu.c +++ b/src/menu.c @@ -219,116 +219,116 @@ void LoadMessageBoxAndBorderGfx(void) void LoadSignPostWindowFrameGfx(void) { - Menu_LoadStdPal(); + Menu_LoadStdPal(); LoadSignBoxGfx(0, DLG_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM)); LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); } static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 0, - tilemapLeft - 2, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 1, - tilemapLeft - 1, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 2, - tilemapLeft - 2, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 3, - tilemapLeft - 1, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), - tilemapLeft - 2, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), - tilemapLeft - 1, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 4, - tilemapLeft, - tilemapTop - 1, - 26, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), - tilemapLeft + 27, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), - tilemapLeft + 26, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 2), - tilemapLeft + 27, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3), - tilemapLeft + 26, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0)), - tilemapLeft + 27, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1)), - tilemapLeft + 26, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4), - tilemapLeft, - tilemapTop + 4, - 26, - 1, - DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 0, + tilemapLeft - 2, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 1, + tilemapLeft - 1, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 2, + tilemapLeft - 2, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 3, + tilemapLeft - 1, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft - 2, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft - 1, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 4, + tilemapLeft, + tilemapTop - 1, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft + 27, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft + 26, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 2), + tilemapLeft + 27, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3), + tilemapLeft + 26, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0)), + tilemapLeft + 27, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1)), + tilemapLeft + 26, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4), + tilemapLeft, + tilemapTop + 4, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); } static inline void *GetWindowFunc_DialogueFrame(void) { - return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); + return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); } void DrawDialogueFrame(u8 windowId, bool8 copyToVram) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 1212457d24..fc7e3a9326 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1411,7 +1411,7 @@ bool32 MetatileBehavior_IsSignpost(u32 mb) #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_SIGNPOST); #else - return FALSE; + return FALSE; #endif } @@ -1420,7 +1420,7 @@ bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb) #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMON_CENTER_SIGN); #else - return FALSE; + return FALSE; #endif } @@ -1429,7 +1429,7 @@ bool32 MetatileBehavior_IsPokeMartSign(u32 mb) #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMART_SIGN); #else - return FALSE; + return FALSE; #endif } From 31fc49734a1770d4c27f10efebb58069a15fb23b Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 07:34:33 -0700 Subject: [PATCH 050/133] Removed preproc from src/metatile_behavior.c per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1693914236 --- src/metatile_behavior.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index fc7e3a9326..d16194ec2b 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1408,28 +1408,17 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) bool32 MetatileBehavior_IsSignpost(u32 mb) { -#if OW_AUTO_SIGNPOST == TRUE return (mb == MB_SIGNPOST); -#else - return FALSE; -#endif } bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb) { -#if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMON_CENTER_SIGN); -#else - return FALSE; -#endif } bool32 MetatileBehavior_IsPokeMartSign(u32 mb) { -#if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMART_SIGN); -#else - return FALSE; #endif } From 1ad3ba1f329604bf575f3c99f13ccfca812c62d3 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 10:58:51 -0700 Subject: [PATCH 051/133] Fixed compilations errors with abgcc --- include/constants/metatile_behaviors.h | 6 ------ src/metatile_behavior.c | 1 - 2 files changed, 7 deletions(-) diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 7f2bb9df78..780e452531 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -30,15 +30,9 @@ #define MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2 0x1A #define MB_STAIRS_OUTSIDE_ABANDONED_SHIP 0x1B #define MB_SHOAL_CAVE_ENTRANCE 0x1C -#if OW_AUTO_SIGNPOST == TRUE #define MB_SIGNPOST 0x1D #define MB_POKEMON_CENTER_SIGN 0x1E #define MB_POKEMART_SIGN 0x1F -#else -#define MB_UNUSED_1D 0x1D -#define MB_UNUSED_1E 0x1E -#define MB_UNUSED_1F 0x1F -#endif #define MB_ICE 0x20 #define MB_SAND 0x21 #define MB_SEAWEED 0x22 diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index d16194ec2b..eb602b9d22 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1419,6 +1419,5 @@ bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb) bool32 MetatileBehavior_IsPokeMartSign(u32 mb) { return (mb == MB_POKEMART_SIGN); -#endif } From 0a997fa6ca84dbb2c810eb5bcc08f3adcdeb9259 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 14:57:53 -0700 Subject: [PATCH 052/133] Moved follower scripts back to original position https://github.com/rh-hideout/pokeemerald-expansion/pull/5044/files\#r1694003538 --- include/event_scripts.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/event_scripts.h b/include/event_scripts.h index 7ec15d4548..2923ae9331 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -28,9 +28,6 @@ extern const u8 EventScript_FollowerFaceUp[]; extern const u8 EventScript_FollowerFaceResult[]; extern const u8 EnterPokeballMovement[]; -extern const u8 Common_Movement_FollowerSafeStart[]; -extern const u8 Common_Movement_FollowerSafeEnd[]; - extern const u8 EventScript_TestSignpostMsg[]; extern const u8 EventScript_TryGetTrainerScript[]; extern const u8 EventScript_StartTrainerApproach[]; @@ -646,6 +643,10 @@ extern const u8 VSSeeker_Text_BatteryNotChargedNeedXSteps[]; extern const u8 VSSeeker_Text_NoTrainersWithinRange[]; extern const u8 VSSeeker_Text_TrainersNotReady[]; extern const u8 EventScript_VsSeekerChargingDone[]; + +extern const u8 Common_Movement_FollowerSafeStart[]; +extern const u8 Common_Movement_FollowerSafeEnd[]; + extern const u8 EventScript_CancelMessageBox[]; extern const u8 Common_EventScript_ShowPokemonCenterSign[]; extern const u8 Common_EventScript_ShowPokemartSign[]; From d21d23b52ccd50f1961ebe0ac3c5299692da69cb Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 14:59:36 -0700 Subject: [PATCH 053/133] Removed extra spaces per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044/files\#r1694003572 --- src/field_control_avatar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 92e9df1c54..aaeb2a6b14 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -44,7 +44,7 @@ static EWRAM_DATA u16 sPrevMetatileBehavior = 0; u8 gSelectedObjectEvent; -#define NOT_SIGNPOST 0 +#define NOT_SIGNPOST 0 static void GetPlayerPosition(struct MapPosition *); static void GetInFrontOfPlayerPosition(struct MapPosition *); From b66678248364f134e32f07b7608d816c57f0e4cb Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:01:33 -0700 Subject: [PATCH 054/133] Nested conditions per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044/files\#r1694003628 --- src/field_control_avatar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index aaeb2a6b14..244b3d2de8 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -207,9 +207,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) GetInFrontOfPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - if (input->heldDirection && input->dpadDirection == playerDirection) - { - if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + if (input->heldDirection && (input->dpadDirection == playerDirection) && if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE)) return TRUE; } From e360d3bd73184725c66c674648a3734ed2a4f1cf Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:02:15 -0700 Subject: [PATCH 055/133] Removed extra newline per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044/files\#r1694003683 --- src/field_control_avatar.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 244b3d2de8..b6d9298c47 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1127,7 +1127,6 @@ static u32 GetFacingSignpostType(u16 metatileBehavior, u32 playerDirection) return MB_POKEMON_CENTER_SIGN; if (MetatileBehavior_IsPokeMartSign(metatileBehavior) == TRUE) return MB_POKEMART_SIGN; - if (MetatileBehavior_IsSignpost(metatileBehavior) == TRUE) return MB_SIGNPOST; From 3c4aaf53f8442adc7aa4240abd6f213d12026f0e Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:03:03 -0700 Subject: [PATCH 056/133] Removed unneeded preproc per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044/files\#r1694003941 --- src/metatile_behavior.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index eb602b9d22..8b8c4898f5 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -125,11 +125,9 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = [MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, [MB_VERTICAL_RAIL] = TILE_FLAG_UNUSED, [MB_HORIZONTAL_RAIL] = TILE_FLAG_UNUSED, -#if OW_AUTO_SIGNPOST == TRUE [MB_SIGNPOST] = TILE_FLAG_UNUSED, [MB_POKEMON_CENTER_SIGN] = TILE_FLAG_UNUSED, [MB_POKEMART_SIGN] = TILE_FLAG_UNUSED, -#endif }; bool8 MetatileBehavior_IsATile(u8 metatileBehavior) From fccecf038f697f80efb74040e22b8afd5c350410 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:03:45 -0700 Subject: [PATCH 057/133] Removed extra newline per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044/files\#r1694003876 --- src/metatile_behavior.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 8b8c4898f5..903b0a64eb 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1418,4 +1418,3 @@ bool32 MetatileBehavior_IsPokeMartSign(u32 mb) { return (mb == MB_POKEMART_SIGN); } - From 4f03ba98bebf4b04908927e82dc0dcc84e5f133d Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:05:49 -0700 Subject: [PATCH 058/133] Removed extra newline per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044/files\#r1694004015 --- src/text_window.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/text_window.c b/src/text_window.c index 6c02797fe3..efd087977e 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -202,4 +202,3 @@ void LoadUserWindowBorderGfxOnBg(u8 bg, u16 destOffset, u8 palOffset) LoadBgTiles(bg, sWindowFrames[gSaveBlock2Ptr->optionsWindowFrameType].tiles, 0x120, destOffset); LoadPalette(GetWindowFrameTilesPal(gSaveBlock2Ptr->optionsWindowFrameType)->pal, palOffset, PLTT_SIZE_4BPP); } - From 5bb1730394b81b6e63faa7ad3f6015fd9535080d Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:07:50 -0700 Subject: [PATCH 059/133] Fixed if statement compilation --- src/field_control_avatar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index b6d9298c47..1699a6daa2 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -207,9 +207,8 @@ int ProcessPlayerFieldInput(struct FieldInput *input) GetInFrontOfPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - if (input->heldDirection && (input->dpadDirection == playerDirection) && if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE)) + if (input->heldDirection && (input->dpadDirection == playerDirection) && (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE)) return TRUE; - } if (input->pressedAButton && TryStartInteractionScript(&position, metatileBehavior, playerDirection) == TRUE) return TRUE; From 1ac4d195c22070f5026e72727788dac4e18cb53e Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:17:32 -0700 Subject: [PATCH 060/133] Changed mb to MetatileBehavior per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1694003941 --- src/metatile_behavior.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 903b0a64eb..8923e633da 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1404,17 +1404,17 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) return FALSE; } -bool32 MetatileBehavior_IsSignpost(u32 mb) +bool32 MetatileBehavior_IsSignpost(u32 metatileBehavior) { - return (mb == MB_SIGNPOST); + return (metatileBehavior == MB_SIGNPOST); } -bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb) +bool32 MetatileBehavior_IsPokemonCenterSign(u32 metatileBehavior) { - return (mb == MB_POKEMON_CENTER_SIGN); + return (metatileBehavior == MB_POKEMON_CENTER_SIGN); } -bool32 MetatileBehavior_IsPokeMartSign(u32 mb) +bool32 MetatileBehavior_IsPokeMartSign(u32 metatileBehavior) { - return (mb == MB_POKEMART_SIGN); + return (metatileBehavior == MB_POKEMART_SIGN); } From fb53297e644a069065b433d343724df4553a3d9d Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:45:48 -0700 Subject: [PATCH 061/133] Added documentation around OW_AUTO_SIGNPOST --- include/config/overworld.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index c740bf4853..0dd9afda76 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -3,7 +3,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. -#define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost. +#define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost, as seen in FRLG. // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. From 91255a6054cd3b1127e17b5f2f1e03dcab366b43 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sat, 27 Jul 2024 15:49:22 -0700 Subject: [PATCH 062/133] Removed mb labels --- include/metatile_behavior.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index d49dc2459a..5bb95bc18e 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -148,8 +148,8 @@ bool8 MetatileBehavior_IsQuestionnaire(u8); bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); -bool32 MetatileBehavior_IsSignpost(u32 mb); -bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb); -bool32 MetatileBehavior_IsPokeMartSign(u32 mb); +bool32 MetatileBehavior_IsSignpost(u32); +bool32 MetatileBehavior_IsPokemonCenterSign(u32); +bool32 MetatileBehavior_IsPokeMartSign(u32); #endif // GUARD_METATILE_BEHAVIOR_H From 54af254b05f5f9a64f749322719e32cdb913d2c8 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 4 Aug 2024 12:27:41 -0400 Subject: [PATCH 063/133] fix ObjectMovingOnRockStairs with follower with merrps system --- src/field_player_avatar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 0b9ec8aa24..3c2b65a3b2 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -2499,7 +2499,7 @@ bool8 ObjectMovingOnRockStairs(struct ObjectEvent *objectEvent, u8 direction) s16 y = objectEvent->currentCoords.y; // TODO followers on sideways stairs - if (IsFollowerVisible() && (objectEvent->isPlayer || objectEvent->localId == OBJ_EVENT_ID_FOLLOWER)) + if (IsFollowerVisible() && GetFollowerObject() != NULL && (objectEvent->isPlayer || objectEvent->localId == OBJ_EVENT_ID_FOLLOWER)) return FALSE; switch (direction) From d88834dd586eef503bb677f9425f5876cfb6a05b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 7 Aug 2024 13:42:18 -0400 Subject: [PATCH 064/133] Backported OBJ_EVENT_GFX_SPECIES macro from Expansion --- data/maps/DesertRuins/map.json | 2 +- data/maps/IslandCave/map.json | 2 +- include/constants/event_objects.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data/maps/DesertRuins/map.json b/data/maps/DesertRuins/map.json index 80c8f6a483..be0a28481a 100644 --- a/data/maps/DesertRuins/map.json +++ b/data/maps/DesertRuins/map.json @@ -15,7 +15,7 @@ "connections": null, "object_events": [ { - "graphics_id": "OBJ_EVENT_GFX_MON_BASE+SPECIES_REGIROCK", + "graphics_id": "OBJ_EVENT_GFX_SPECIES(REGIROCK)", "x": 8, "y": 7, "elevation": 3, diff --git a/data/maps/IslandCave/map.json b/data/maps/IslandCave/map.json index c6204ff1c5..142ec122d6 100644 --- a/data/maps/IslandCave/map.json +++ b/data/maps/IslandCave/map.json @@ -15,7 +15,7 @@ "connections": 0, "object_events": [ { - "graphics_id": "OBJ_EVENT_GFX_MON_BASE+SPECIES_REGICE", + "graphics_id": "OBJ_EVENT_GFX_SPECIES(REGICE)", "x": 8, "y": 7, "elevation": 3, diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index dc4fdf8870..4eaa82b75d 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -280,6 +280,9 @@ #define OBJ_EVENT_GFX_SPECIES_BITS 11 #define OBJ_EVENT_GFX_SPECIES_MASK ((1 << OBJ_EVENT_GFX_SPECIES_BITS) - 1) +// Used to call a specific species' follower graphics. Useful for static encounters. +#define OBJ_EVENT_GFX_SPECIES(name) (SPECIES_##name + OBJ_EVENT_GFX_MON_BASE) + #define OW_SPECIES(x) (((x)->graphicsId & OBJ_EVENT_GFX_SPECIES_MASK) - OBJ_EVENT_GFX_MON_BASE) #define OW_FORM(x) ((x)->graphicsId >> OBJ_EVENT_GFX_SPECIES_BITS) From e6e2285c441ba0b3965365f7a9f7c1919ea53d9c Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Aug 2024 14:50:38 -0400 Subject: [PATCH 065/133] Added OBJ_EVENT_GFX_SPECIES_SHINY --- include/constants/event_objects.h | 1 + include/constants/species.h | 2 ++ include/data.h | 1 - src/event_object_movement.c | 8 ++++++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 4eaa82b75d..2e7ec7939f 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -282,6 +282,7 @@ // Used to call a specific species' follower graphics. Useful for static encounters. #define OBJ_EVENT_GFX_SPECIES(name) (SPECIES_##name + OBJ_EVENT_GFX_MON_BASE) +#define OBJ_EVENT_GFX_SPECIES_SHINY(name) (SPECIES_##name + OBJ_EVENT_GFX_MON_BASE + SPECIES_SHINY_TAG) #define OW_SPECIES(x) (((x)->graphicsId & OBJ_EVENT_GFX_SPECIES_MASK) - OBJ_EVENT_GFX_MON_BASE) #define OW_FORM(x) ((x)->graphicsId >> OBJ_EVENT_GFX_SPECIES_BITS) diff --git a/include/constants/species.h b/include/constants/species.h index ec60c142ed..e6b6120a4f 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -419,6 +419,8 @@ #define NUM_SPECIES SPECIES_EGG +#define SPECIES_SHINY_TAG 500 + #define SPECIES_UNOWN_B (NUM_SPECIES + 1) #define SPECIES_UNOWN_C (SPECIES_UNOWN_B + 1) #define SPECIES_UNOWN_D (SPECIES_UNOWN_B + 2) diff --git a/include/data.h b/include/data.h index 99b695d72f..ef11242801 100644 --- a/include/data.h +++ b/include/data.h @@ -3,7 +3,6 @@ #include "constants/moves.h" -#define SPECIES_SHINY_TAG 500 #define N_FOLLOWER_HAPPY_MESSAGES 31 #define N_FOLLOWER_NEUTRAL_MESSAGES 14 #define N_FOLLOWER_SAD_MESSAGES 3 diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 77aee61fc0..a19d7a5169 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1672,6 +1672,12 @@ static u8 TrySetupObjectEventSprite(const struct ObjectEventTemplate *objectEven spriteTemplate->tileTag = LoadSheetGraphicsInfo(graphicsInfo, objectEvent->graphicsId, NULL); #endif + if (objectEvent->graphicsId >= OBJ_EVENT_GFX_MON_BASE + SPECIES_SHINY_TAG) + { + objectEvent->shiny = TRUE; + objectEvent->graphicsId -= SPECIES_SHINY_TAG; + } + spriteId = CreateSprite(spriteTemplate, 0, 0, 0); if (spriteId == MAX_SPRITES) { @@ -2749,6 +2755,8 @@ const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u16 graphicsId) if (graphicsId >= OBJ_EVENT_GFX_VARS && graphicsId <= OBJ_EVENT_GFX_VAR_F) graphicsId = VarGetObjectEventGraphicsId(graphicsId - OBJ_EVENT_GFX_VARS); + if (graphicsId >= OBJ_EVENT_GFX_MON_BASE + SPECIES_SHINY_TAG) + graphicsId -= SPECIES_SHINY_TAG; // graphicsId may contain mon form info if (graphicsId > OBJ_EVENT_GFX_SPECIES_MASK) { form = graphicsId >> OBJ_EVENT_GFX_SPECIES_BITS; From 0a55a7f40bd8ed14b71e6a8dfbb24da0121d83e4 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 11 Aug 2024 17:29:09 -0700 Subject: [PATCH 066/133] Combined if statements per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1712962988 --- src/field_control_avatar.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 1699a6daa2..584c319595 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -183,18 +183,15 @@ int ProcessPlayerFieldInput(struct FieldInput *input) return TRUE; } - if (input->checkStandardWildEncounter) - { - if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) - { - GetInFrontOfPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) - return TRUE; - GetPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - } - } + if ((input->checkStandardWildEncounter) && ((input->dpadDirection == 0) || input->dpadDirection == playerDirection)) + { + GetInFrontOfPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + GetPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + } if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileBehavior) == TRUE) return TRUE; From cb779498811f9c9a7d48bffd2a434abb2967d37d Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 11 Aug 2024 17:30:59 -0700 Subject: [PATCH 067/133] Fixed identation per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1712963035 --- src/field_control_avatar.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 584c319595..c9163c1a7e 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -183,15 +183,15 @@ int ProcessPlayerFieldInput(struct FieldInput *input) return TRUE; } - if ((input->checkStandardWildEncounter) && ((input->dpadDirection == 0) || input->dpadDirection == playerDirection)) - { - GetInFrontOfPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) - return TRUE; - GetPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - } + if ((input->checkStandardWildEncounter) && ((input->dpadDirection == 0) || input->dpadDirection == playerDirection)) + { + GetInFrontOfPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + GetPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + } if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileBehavior) == TRUE) return TRUE; @@ -205,7 +205,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); if (input->heldDirection && (input->dpadDirection == playerDirection) && (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE)) - return TRUE; + return TRUE; if (input->pressedAButton && TryStartInteractionScript(&position, metatileBehavior, playerDirection) == TRUE) return TRUE; From b39258ebced39d8cf858c8f5551619fa5e5a271f Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 11 Aug 2024 17:36:01 -0700 Subject: [PATCH 068/133] Combined conditions per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1712963093 --- src/field_control_avatar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index c9163c1a7e..40992feae6 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1093,9 +1093,7 @@ static bool32 TrySetUpWalkIntoSignpostScript(struct MapPosition *position, u32 m { const u8 *script; - if (JOY_HELD(DPAD_LEFT | DPAD_RIGHT)) - return FALSE; - if (playerDirection != DIR_NORTH) + if ((JOY_HELD(DPAD_LEFT | DPAD_RIGHT)) || (playerDirection != DIR_NORTH)) return FALSE; switch (GetFacingSignpostType(metatileBehavior, playerDirection)) From 846e8a29daadc96035944250dde9b391e8fe2846 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 11 Aug 2024 17:49:07 -0700 Subject: [PATCH 069/133] Removed IsMsgSignPost per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1712963672 --- include/script.h | 4 +++- src/field_message_box.c | 2 +- src/menu.c | 2 +- src/script.c | 9 ++------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/script.h b/include/script.h index 48d1f6c0ec..fc50c9d424 100644 --- a/include/script.h +++ b/include/script.h @@ -63,10 +63,12 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize); // srccmd.h void SetMovingNpcId(u16 npcId); +extern u8 sMsgIsSignPost; +extern u8 sMsgBoxIsCancelable; + void SetWalkingIntoSignVars(void); void MsgSetSignPost(void); void ResetFacingNpcOrSignPostVars(void); -bool32 IsMsgSignPost(void); bool32 CanWalkAwayToCancelMsgBox(void); void ClearMsgBoxCancelableState(void); diff --git a/src/field_message_box.c b/src/field_message_box.c index 9d07ce24dc..c0fc1004e9 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -32,7 +32,7 @@ static void Task_DrawFieldMessage(u8 taskId) switch (task->tState) { case 0: - if (IsMsgSignPost()) + if (sMsgIsSignPost) LoadSignPostWindowFrameGfx(); else LoadMessageBoxAndBorderGfx(); diff --git a/src/menu.c b/src/menu.c index 441c80250e..20b8c4dd97 100644 --- a/src/menu.c +++ b/src/menu.c @@ -328,7 +328,7 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi static inline void *GetWindowFunc_DialogueFrame(void) { - return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); + return (sMsgIsSignPost ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); } void DrawDialogueFrame(u8 windowId, bool8 copyToVram) diff --git a/src/script.c b/src/script.c index 98d679cd9f..632af41ff4 100644 --- a/src/script.c +++ b/src/script.c @@ -27,8 +27,8 @@ static u8 sGlobalScriptContextStatus; static struct ScriptContext sGlobalScriptContext; static struct ScriptContext sImmediateScriptContext; static bool8 sLockFieldControls; -static u8 sMsgIsSignPost; -static u8 sMsgBoxIsCancelable; +EWRAM_DATA u8 sMsgIsSignPost = FALSE; +EWRAM_DATA u8 sMsgBoxIsCancelable = FALSE; extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTableEnd[]; @@ -513,11 +513,6 @@ void SetWalkingIntoSignVars(void) sMsgBoxIsCancelable = TRUE; } -bool32 IsMsgSignPost(void) -{ - return sMsgIsSignPost; -} - void ResetFacingNpcOrSignPostVars(void) { sMsgIsSignPost = FALSE; From c3c433439e2f5745782b01ef42e6915783dd5655 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 11 Aug 2024 18:01:52 -0700 Subject: [PATCH 070/133] Removed ClearMsgBoxCancelableState per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1712963672 --- include/script.h | 3 --- src/field_control_avatar.c | 4 ++-- src/scrcmd.c | 4 ++-- src/script.c | 15 --------------- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/include/script.h b/include/script.h index fc50c9d424..a8e7656d51 100644 --- a/include/script.h +++ b/include/script.h @@ -67,9 +67,6 @@ extern u8 sMsgIsSignPost; extern u8 sMsgBoxIsCancelable; void SetWalkingIntoSignVars(void); -void MsgSetSignPost(void); -void ResetFacingNpcOrSignPostVars(void); bool32 CanWalkAwayToCancelMsgBox(void); -void ClearMsgBoxCancelableState(void); #endif // GUARD_SCRIPT_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 40992feae6..6144ca7af0 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -162,7 +162,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) gSpecialVar_LastTalked = 0; gSelectedObjectEvent = 0; - ResetFacingNpcOrSignPostVars(); + sMsgIsSignPost = FALSE; playerDirection = GetPlayerFacingDirection(); GetPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); @@ -1130,7 +1130,7 @@ static u32 GetFacingSignpostType(u16 metatileBehavior, u32 playerDirection) static void SetMsgSignPostAndVarFacing(u32 playerDirection) { SetWalkingIntoSignVars(); - MsgSetSignPost(); + sMsgIsSignPost = TRUE; gSpecialVar_Facing = playerDirection; } diff --git a/src/scrcmd.c b/src/scrcmd.c index e1d6202a04..69c9d961b6 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1290,7 +1290,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); - ClearMsgBoxCancelableState(); + sMsgBoxIsCancelable = FALSE; return FALSE; } @@ -1309,7 +1309,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); - ClearMsgBoxCancelableState(); + sMsgBoxIsCancelable = FALSE; return FALSE; } diff --git a/src/script.c b/src/script.c index 632af41ff4..7945b57ea9 100644 --- a/src/script.c +++ b/src/script.c @@ -513,21 +513,6 @@ void SetWalkingIntoSignVars(void) sMsgBoxIsCancelable = TRUE; } -void ResetFacingNpcOrSignPostVars(void) -{ - sMsgIsSignPost = FALSE; -} - -void MsgSetSignPost(void) -{ - sMsgIsSignPost = TRUE; -} - -void ClearMsgBoxCancelableState(void) -{ - sMsgBoxIsCancelable = FALSE; -} - bool32 CanWalkAwayToCancelMsgBox(void) { return sMsgBoxIsCancelable; From 4387b6ef708b88cffbe4660e7df6574cfabd6409 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 11 Aug 2024 18:10:18 -0700 Subject: [PATCH 071/133] Removed SetWalkingIntoSignVars per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1712963824 --- include/field_control_avatar.h | 3 +++ include/script.h | 3 --- src/field_control_avatar.c | 9 ++++----- src/script.c | 12 ------------ 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index cbee293a31..da23fe4336 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -36,4 +36,7 @@ const u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position); void ClearPoisonStepCounter(void); void CancelSignPostMessageBox(struct FieldInput *input); +#define NOT_SIGNPOST 0 +#define WALK_AWAY_SIGNPOST_FRAMES 6 + #endif // GUARD_FIELDCONTROLAVATAR_H diff --git a/include/script.h b/include/script.h index a8e7656d51..9c778c395d 100644 --- a/include/script.h +++ b/include/script.h @@ -66,7 +66,4 @@ void SetMovingNpcId(u16 npcId); extern u8 sMsgIsSignPost; extern u8 sMsgBoxIsCancelable; -void SetWalkingIntoSignVars(void); -bool32 CanWalkAwayToCancelMsgBox(void); - #endif // GUARD_SCRIPT_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 6144ca7af0..05060825fa 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -44,8 +44,6 @@ static EWRAM_DATA u16 sPrevMetatileBehavior = 0; u8 gSelectedObjectEvent; -#define NOT_SIGNPOST 0 - static void GetPlayerPosition(struct MapPosition *); static void GetInFrontOfPlayerPosition(struct MapPosition *); static u16 GetPlayerCurMetatileBehavior(int); @@ -1129,7 +1127,8 @@ static u32 GetFacingSignpostType(u16 metatileBehavior, u32 playerDirection) static void SetMsgSignPostAndVarFacing(u32 playerDirection) { - SetWalkingIntoSignVars(); + gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; + sMsgBoxIsCancelable = TRUE; sMsgIsSignPost = TRUE; gSpecialVar_Facing = playerDirection; } @@ -1176,8 +1175,8 @@ void CancelSignPostMessageBox(struct FieldInput *input) return; } - if (!CanWalkAwayToCancelMsgBox()) - return; + if (!sMsgBoxIsCancelable) + return; if (IsDpadPushedToTurnOrMovePlayer(input)) { diff --git a/src/script.c b/src/script.c index 7945b57ea9..276163bbb6 100644 --- a/src/script.c +++ b/src/script.c @@ -505,15 +505,3 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize) #endif //FREE_MYSTERY_EVENT_BUFFERS } -#define WALK_AWAY_SIGNPOST_FRAMES 6 - -void SetWalkingIntoSignVars(void) -{ - gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; - sMsgBoxIsCancelable = TRUE; -} - -bool32 CanWalkAwayToCancelMsgBox(void) -{ - return sMsgBoxIsCancelable; -} From 30cc06785d5906750fd945fce8a482af2298da02 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Mon, 12 Aug 2024 06:55:33 -0700 Subject: [PATCH 072/133] Fixed global variable naming conventions --- include/script.h | 4 ++-- src/field_control_avatar.c | 8 ++++---- src/field_message_box.c | 2 +- src/menu.c | 2 +- src/scrcmd.c | 4 ++-- src/script.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/script.h b/include/script.h index 9c778c395d..1f3c4f7afb 100644 --- a/include/script.h +++ b/include/script.h @@ -63,7 +63,7 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize); // srccmd.h void SetMovingNpcId(u16 npcId); -extern u8 sMsgIsSignPost; -extern u8 sMsgBoxIsCancelable; +extern u8 gMsgIsSignPost; +extern u8 gMsgBoxIsCancelable; #endif // GUARD_SCRIPT_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 05060825fa..b64301e670 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -160,7 +160,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) gSpecialVar_LastTalked = 0; gSelectedObjectEvent = 0; - sMsgIsSignPost = FALSE; + gMsgIsSignPost = FALSE; playerDirection = GetPlayerFacingDirection(); GetPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); @@ -1128,8 +1128,8 @@ static u32 GetFacingSignpostType(u16 metatileBehavior, u32 playerDirection) static void SetMsgSignPostAndVarFacing(u32 playerDirection) { gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; - sMsgBoxIsCancelable = TRUE; - sMsgIsSignPost = TRUE; + gMsgBoxIsCancelable = TRUE; + gMsgIsSignPost = TRUE; gSpecialVar_Facing = playerDirection; } @@ -1175,7 +1175,7 @@ void CancelSignPostMessageBox(struct FieldInput *input) return; } - if (!sMsgBoxIsCancelable) + if (!gMsgBoxIsCancelable) return; if (IsDpadPushedToTurnOrMovePlayer(input)) diff --git a/src/field_message_box.c b/src/field_message_box.c index c0fc1004e9..569f067caa 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -32,7 +32,7 @@ static void Task_DrawFieldMessage(u8 taskId) switch (task->tState) { case 0: - if (sMsgIsSignPost) + if (gMsgIsSignPost) LoadSignPostWindowFrameGfx(); else LoadMessageBoxAndBorderGfx(); diff --git a/src/menu.c b/src/menu.c index 20b8c4dd97..d9b331a8b2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -328,7 +328,7 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi static inline void *GetWindowFunc_DialogueFrame(void) { - return (sMsgIsSignPost ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); + return (gMsgIsSignPost ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); } void DrawDialogueFrame(u8 windowId, bool8 copyToVram) diff --git a/src/scrcmd.c b/src/scrcmd.c index 69c9d961b6..23b42b7acd 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1290,7 +1290,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); - sMsgBoxIsCancelable = FALSE; + gMsgBoxIsCancelable = FALSE; return FALSE; } @@ -1309,7 +1309,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); - sMsgBoxIsCancelable = FALSE; + gMsgBoxIsCancelable = FALSE; return FALSE; } diff --git a/src/script.c b/src/script.c index 276163bbb6..7b1af3d542 100644 --- a/src/script.c +++ b/src/script.c @@ -27,8 +27,8 @@ static u8 sGlobalScriptContextStatus; static struct ScriptContext sGlobalScriptContext; static struct ScriptContext sImmediateScriptContext; static bool8 sLockFieldControls; -EWRAM_DATA u8 sMsgIsSignPost = FALSE; -EWRAM_DATA u8 sMsgBoxIsCancelable = FALSE; +EWRAM_DATA u8 gMsgIsSignPost = FALSE; +EWRAM_DATA u8 gMsgBoxIsCancelable = FALSE; extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTableEnd[]; From 04faf370e6875807c659cd1436783f7009a71fd9 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 25 Aug 2024 17:37:15 -0700 Subject: [PATCH 073/133] Cleaned up and reordered functions --- include/field_screen_effect.h | 2 +- src/field_control_avatar.c | 48 ++-- src/field_screen_effect.c | 400 ++++++++++++++++++---------------- src/metatile_behavior.c | 5 +- 4 files changed, 248 insertions(+), 207 deletions(-) diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h index b9a2ef9d5b..3f120ffdeb 100644 --- a/include/field_screen_effect.h +++ b/include/field_screen_effect.h @@ -43,6 +43,6 @@ void FadeOutOrbEffect(void); void WriteFlashScanlineEffectBuffer(u8 flashLevel); bool8 IsPlayerStandingStill(void); void DoStairWarp(u16 metatileBehavior, u16 delay); -bool8 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection); +bool32 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection); #endif // GUARD_FIELD_SCREEN_EFFECT_H diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 58afd16310..c1d2455ff7 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -727,34 +727,38 @@ static bool8 CheckStandardWildEncounter(u16 metatileBehavior) return FALSE; } +static void StorePlayerStateAndSetupWarp(struct MapPosition *position, s32 warpEventId) +{ + StoreInitialPlayerAvatarState(); + SetupWarp(&gMapHeader, warpEventId, position); +} + static bool8 TryArrowWarp(struct MapPosition *position, u16 metatileBehavior, u8 direction) { - s8 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); - u16 delay; + s32 warpEventId = GetWarpEventAtMapPosition(&gMapHeader, position); + u32 delay; - if (warpEventId != WARP_ID_NONE) + if (warpEventId == WARP_ID_NONE) + return FALSE; + + if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE) { - if (IsArrowWarpMetatileBehavior(metatileBehavior, direction) == TRUE) + StorePlayerStateAndSetupWarp(position, warpEventId); + DoWarp(); + return TRUE; + } + else if (IsDirectionalStairWarpMetatileBehavior(metatileBehavior, direction) == TRUE) + { + delay = 0; + if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_BIKE) { - StoreInitialPlayerAvatarState(); - SetupWarp(&gMapHeader, warpEventId, position); - DoWarp(); - return TRUE; - } - else if (IsDirectionalStairWarpMetatileBehavior(metatileBehavior, direction) == TRUE) - { - delay = 0; - if (gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE)) - { - SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT); - delay = 12; - } - - StoreInitialPlayerAvatarState(); - SetupWarp(&gMapHeader, warpEventId, position); - DoStairWarp(metatileBehavior, delay); - return TRUE; + SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT); + delay = 12; } + + StorePlayerStateAndSetupWarp(position, warpEventId); + DoStairWarp(metatileBehavior, delay); + return TRUE; } return FALSE; } diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 0cce757f56..0839dc6bb2 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -50,7 +50,14 @@ static void Task_SpinEnterWarp(u8 taskId); static void Task_WarpAndLoadMap(u8 taskId); static void Task_DoDoorWarp(u8 taskId); static void Task_EnableScriptAfterMusicFade(u8 taskId); -static void Task_ExitStairs(u8 taskId); + +static void ExitStairsMovement(s16*, s16*, s16*, s16*, s16*); +static void GetStairsMovementDirection(u32, s16*, s16*); +static void Task_ExitStairs(u8); +static bool8 WaitStairExitMovementFinished(s16*, s16*, s16*, s16*, s16*); +static void UpdateStairsMovement(s16, s16, s16*, s16*, s16*); +static void Task_StairWarp(u8); +static void ForceStairsMovement(u32, s16*, s16*); // data[0] is used universally by tasks in this file as a state for switches #define tState data[0] @@ -1328,129 +1335,6 @@ static bool32 PrintWhiteOutRecoveryMessage(u8 taskId, const u8 *text, u32 x, u32 return FALSE; } -static void GetStairsMovementDirection(u8 a0, s16 *a1, s16 *a2) -{ - if (MetatileBehavior_IsDirectionalUpRightStairWarp(a0)) - { - *a1 = 16; - *a2 = -10; - } - else if (MetatileBehavior_IsDirectionalUpLeftStairWarp(a0)) - { - *a1 = -17; - *a2 = -10; - } - else if (MetatileBehavior_IsDirectionalDownRightStairWarp(a0)) - { - *a1 = 17; - *a2 = 3; - } - else if (MetatileBehavior_IsDirectionalDownLeftStairWarp(a0)) - { - *a1 = -17; - *a2 = 3; - } - else - { - *a1 = 0; - *a2 = 0; - } -} - -static bool8 WaitStairExitMovementFinished(s16 *a0, s16 *a1, s16 *a2, s16 *a3, s16 *a4) -{ - struct Sprite *sprite; - sprite = &gSprites[gPlayerAvatar.spriteId]; - if (*a4 != 0) - { - *a2 += *a0; - *a3 += *a1; - sprite->x2 = *a2 >> 5; - sprite->y2 = *a3 >> 5; - (*a4)--; - return TRUE; - } - else - { - sprite->x2 = 0; - sprite->y2 = 0; - return FALSE; - } -} - -static void ExitStairsMovement(s16 *a0, s16 *a1, s16 *a2, s16 *a3, s16 *a4) -{ - s16 x, y; - u8 behavior; - s32 r1; - struct Sprite *sprite; - - PlayerGetDestCoords(&x, &y); - behavior = MapGridGetMetatileBehaviorAt(x, y); - if (MetatileBehavior_IsDirectionalDownRightStairWarp(behavior) || MetatileBehavior_IsDirectionalUpRightStairWarp(behavior)) - r1 = 3; - else - r1 = 4; - - ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceSlowMovementAction(r1)); - GetStairsMovementDirection(behavior, a0, a1); - *a2 = *a0 * 16; - *a3 = *a1 * 16; - *a4 = 16; - sprite = &gSprites[gPlayerAvatar.spriteId]; - sprite->x2 = *a2 >> 5; - sprite->y2 = *a3 >> 5; - *a0 *= -1; - *a1 *= -1; -} - -static void Task_ExitStairs(u8 taskId) -{ - s16 * data = gTasks[taskId].data; - switch (data[0]) - { - default: - if (WaitForWeatherFadeIn() == TRUE) - { - CameraObjectReset(); - UnlockPlayerFieldControls(); - DestroyTask(taskId); - } - break; - case 0: - Overworld_PlaySpecialMapMusic(); - WarpFadeInScreen(); - LockPlayerFieldControls(); - ExitStairsMovement(&data[1], &data[2], &data[3], &data[4], &data[5]); - data[0]++; - break; - case 1: - if (!WaitStairExitMovementFinished(&data[1], &data[2], &data[3], &data[4], &data[5])) - data[0]++; - break; - } -} - -bool8 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection) -{ - switch (playerDirection) - { - case DIR_WEST: - if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) - return TRUE; - if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) - return TRUE; - break; - case DIR_EAST: - if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) - return TRUE; - if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) - return TRUE; - break; - } - return FALSE; -} - enum { FRLG_WHITEOUT_ENTER_MSG_SCREEN, FRLG_WHITEOUT_PRINT_MSG, @@ -1517,86 +1401,236 @@ void FieldCB_RushInjuredPokemonToCenter(void) gTasks[taskId].tState = FRLG_WHITEOUT_ENTER_MSG_SCREEN; } -static void ForceStairsMovement(u16 a0, s16 *a1, s16 *a2) +static void GetStairsMovementDirection(u32 metatileBehavior, s16 *speedX, s16 *speedY) { - ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); - GetStairsMovementDirection(a0, a1, a2); + if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + { + *speedX = 16; + *speedY = -10; + } + else if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) + { + *speedX = -17; + *speedY = -10; + } + else if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) + { + *speedX = 17; + *speedY = 3; + } + else if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) + { + *speedX = -17; + *speedY = 3; + } + else + { + *speedX = 0; + *speedY = 0; + } } -static void UpdateStairsMovement(s16 a0, s16 a1, s16 *a2, s16 *a3, s16 *a4) +static bool8 WaitStairExitMovementFinished(s16 *speedX, s16 *speedY, s16 *offsetX, s16 *offsetY, s16 *timer) { - struct Sprite *playerSpr = &gSprites[gPlayerAvatar.spriteId]; - struct ObjectEvent *playerObj = &gObjectEvents[gPlayerAvatar.objectEventId]; + struct Sprite *sprite; + sprite = &gSprites[gPlayerAvatar.spriteId]; + if (*timer != 0) + { + *offsetX += *speedX; + *offsetY += *speedY; + sprite->x2 = *offsetX >> 5; + sprite->y2 = *offsetY >> 5; + (*timer)--; + return TRUE; + } + else + { + sprite->x2 = 0; + sprite->y2 = 0; + return FALSE; + } +} - if (a1 > 0 || *a4 > 6) - *a3 += a1; +static void ExitStairsMovement(s16 *speedX, s16 *speedY, s16 *offsetX, s16 *offsetY, s16 *timer) +{ + s16 x, y; + u32 metatileBehavior; + s32 direction; + struct Sprite *sprite; - *a2 += a0; - (*a4)++; - playerSpr->x2 = *a2 >> 5; - playerSpr->y2 = *a3 >> 5; - if (playerObj->heldMovementFinished) - ObjectEventForceSetHeldMovement(playerObj, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); + PlayerGetDestCoords(&x, &y); + metatileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior) || MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + direction = DIR_WEST; + else + direction = DIR_EAST; + + ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceSlowMovementAction(direction)); + GetStairsMovementDirection(metatileBehavior, speedX, speedY); + *offsetX = *speedX * 16; + *offsetY = *speedY * 16; + *timer = 16; + sprite = &gSprites[gPlayerAvatar.spriteId]; + sprite->x2 = *offsetX >> 5; + sprite->y2 = *offsetY >> 5; + *speedX *= -1; + *speedY *= -1; +} + +#define tState data[0] +#define tSpeedX data[1] +#define tSpeedY data[2] +#define tOffsetX data[3] +#define tOffsetY data[4] +#define tTimer data[5] + +static void Task_ExitStairs(u8 taskId) +{ + s16 * data = gTasks[taskId].data; + switch (tState) + { + default: + if (WaitForWeatherFadeIn() == TRUE) + { + CameraObjectReset(); + UnlockPlayerFieldControls(); + DestroyTask(taskId); + } + break; + case 0: + Overworld_PlaySpecialMapMusic(); + WarpFadeInScreen(); + LockPlayerFieldControls(); + ExitStairsMovement(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + tState++; + break; + case 1: + if (!WaitStairExitMovementFinished(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer)) + tState++; + break; + } +} + +static void ForceStairsMovement(u32 metatileBehavior, s16 *speedX, s16 *speedY) +{ + ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); + GetStairsMovementDirection(metatileBehavior, speedX, speedY); +} +#undef tSpeedX +#undef tSpeedY +#undef tOffsetX +#undef tOffsetY +#undef tTimer + +#define tMetatileBehavior data[1] +#define tSpeedX data[2] +#define tSpeedY data[3] +#define tOffsetX data[4] +#define tOffsetY data[5] +#define tTimer data[6] +#define tDelay data[15] + +static void UpdateStairsMovement(s16 speedX, s16 speedY, s16 *offsetX, s16 *offsetY, s16 *timer) +{ + struct Sprite *playerSprite = &gSprites[gPlayerAvatar.spriteId]; + struct ObjectEvent *playerObjectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + + if (speedY > 0 || *timer > 6) + *offsetY += speedY; + + *offsetX += speedX; + (*timer)++; + playerSprite->x2 = *offsetX >> 5; + playerSprite->y2 = *offsetY >> 5; + if (playerObjectEvent->heldMovementFinished) + ObjectEventForceSetHeldMovement(playerObjectEvent, GetWalkInPlaceNormalMovementAction(GetPlayerFacingDirection())); } static void Task_StairWarp(u8 taskId) { s16 * data = gTasks[taskId].data; - struct ObjectEvent *playerObj = &gObjectEvents[gPlayerAvatar.objectEventId]; - struct Sprite *playerSpr = &gSprites[gPlayerAvatar.spriteId]; + struct ObjectEvent *playerObjectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; + struct Sprite *playerSprite = &gSprites[gPlayerAvatar.spriteId]; - switch (data[0]) + switch (tState) { - case 0: - LockPlayerFieldControls(); - FreezeObjectEvents(); - CameraObjectFreeze(); - data[0]++; - break; - case 1: - if (!ObjectEventIsMovementOverridden(playerObj) || ObjectEventClearHeldMovementIfFinished(playerObj)) - { - if (data[15] != 0) - data[15]--; - else + case 0: + LockPlayerFieldControls(); + FreezeObjectEvents(); + CameraObjectFreeze(); + tState++; + break; + case 1: + if (!ObjectEventIsMovementOverridden(playerObjectEvent) || ObjectEventClearHeldMovementIfFinished(playerObjectEvent)) { - TryFadeOutOldMapMusic(); - PlayRainStoppingSoundEffect(); - playerSpr->oam.priority = 1; - ForceStairsMovement(data[1], &data[2], &data[3]); - PlaySE(SE_EXIT); - data[0]++; + if (tDelay != 0) + tDelay--; + else + { + TryFadeOutOldMapMusic(); + PlayRainStoppingSoundEffect(); + playerSprite->oam.priority = 1; + ForceStairsMovement(tMetatileBehavior, &tSpeedX, &tSpeedY); + PlaySE(SE_EXIT); + tState++; + } } - } - break; - case 2: - UpdateStairsMovement(data[2], data[3], &data[4], &data[5], &data[6]); - data[15]++; - if (data[15] >= 12) - { - WarpFadeOutScreen(); - data[0]++; - } - break; - case 3: - UpdateStairsMovement(data[2], data[3], &data[4], &data[5], &data[6]); - if (!PaletteFadeActive() && BGMusicStopped()) - data[0]++; - break; - default: - gFieldCallback = FieldCB_DefaultWarpExit; - WarpIntoMap(); - SetMainCallback2(CB2_LoadMap); - DestroyTask(taskId); - break; + break; + case 2: + UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + tDelay++; + if (tDelay >= 12) + { + WarpFadeOutScreen(); + tState++; + } + break; + case 3: + UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + if (!PaletteFadeActive() && BGMusicStopped()) + tState++; + break; + default: + gFieldCallback = FieldCB_DefaultWarpExit; + WarpIntoMap(); + SetMainCallback2(CB2_LoadMap); + DestroyTask(taskId); + break; } } void DoStairWarp(u16 metatileBehavior, u16 delay) { u8 taskId = CreateTask(Task_StairWarp, 10); - gTasks[taskId].data[1] = metatileBehavior; - gTasks[taskId].data[15] = delay; + gTasks[taskId].tMetatileBehavior = metatileBehavior; + gTasks[taskId].tDelay = delay; Task_StairWarp(taskId); } +#undef tMetatileBehavior +#undef tSpeedX +#undef tSpeedY +#undef tOffsetX +#undef tOffsetY +#undef tTimer +#undef tDelay + +bool32 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection) +{ + switch (playerDirection) + { + case DIR_WEST: + if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) + return TRUE; + break; + case DIR_EAST: + if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) + return TRUE; + break; + } + return FALSE; +} diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index f5e438042a..d165d702ab 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1435,7 +1435,10 @@ bool8 MetatileBehavior_IsDirectionalDownLeftStairWarp(u8 metatileBehavior) bool8 MetatileBehavior_IsDirectionalStairWarp(u8 metatileBehavior) { - if (metatileBehavior >= MB_UP_RIGHT_STAIR_WARP && metatileBehavior <= MB_DOWN_LEFT_STAIR_WARP) + if (metatileBehavior == MB_UP_RIGHT_STAIR_WARP + || metatileBehavior == MB_UP_LEFT_STAIR_WARP + || metatileBehavior == MB_DOWN_RIGHT_STAIR_WARP + || metatileBehavior == MB_DOWN_LEFT_STAIR_WARP) return TRUE; else return FALSE; From 839cf2e79012e0fc9159af5ab9e6a497e86bbfa4 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:31:12 -0400 Subject: [PATCH 074/133] feat: static OW pokemon now bob while walking in place (per `OW_MON_BOBBING`) --- include/constants/event_objects.h | 3 +++ src/event_object_movement.c | 24 ++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 2e7ec7939f..9c9c1c75e2 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -287,6 +287,9 @@ #define OW_SPECIES(x) (((x)->graphicsId & OBJ_EVENT_GFX_SPECIES_MASK) - OBJ_EVENT_GFX_MON_BASE) #define OW_FORM(x) ((x)->graphicsId >> OBJ_EVENT_GFX_SPECIES_BITS) +// Whether Object Event is an OW pokemon +#define IS_OW_MON_OBJ(obj) ((obj)->graphicsId >= OBJ_EVENT_GFX_MON_BASE) + // If true, follower pokemon will bob up and down // during their idle & walking animations #define OW_MON_BOBBING TRUE diff --git a/src/event_object_movement.c b/src/event_object_movement.c index a19d7a5169..ea8a6b97a9 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1416,7 +1416,7 @@ static u8 InitObjectEventStateFromTemplate(const struct ObjectEventTemplate *tem objectEvent->triggerGroundEffectsOnMove = TRUE; objectEvent->graphicsId = PackGraphicsId(template); SetObjectEventDynamicGraphicsId(objectEvent); - if (objectEvent->graphicsId >= OBJ_EVENT_GFX_MON_BASE) { + if (IS_OW_MON_OBJ(objectEvent)) { if (template->script && template->script[0] == 0x7d) objectEvent->shiny = T1_READ_16(&template->script[2]) >> 15; else if (template->trainerRange_berryTreeId) @@ -1715,7 +1715,7 @@ static u16 PackGraphicsId(const struct ObjectEventTemplate *template) { u32 form = 0; // set form based on template's script, // if first command is bufferspeciesname - if (graphicsId >= OBJ_EVENT_GFX_MON_BASE) { + if (IS_OW_MON_OBJ(template)) { if (template->script && template->script[0] == 0x7d) { form = T1_READ_16(&template->script[2]); form = (form >> 10) & 0x1F; @@ -5300,7 +5300,7 @@ bool8 MovementType_FollowPlayer_Active(struct ObjectEvent *objectEvent, struct S // Animate entering pokeball ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, MOVEMENT_ACTION_ENTER_POKEBALL); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->sTypeFuncId = 2; // movement action sets state to 0 return TRUE; } @@ -5317,7 +5317,7 @@ bool8 MovementType_FollowPlayer_Moving(struct ObjectEvent *objectEvent, struct S #else if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { #endif - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; if (sprite->sTypeFuncId) // restore nonzero state sprite->sTypeFuncId = 1; } else if (objectEvent->movementActionId < MOVEMENT_ACTION_EXIT_POKEBALL) { @@ -5334,11 +5334,11 @@ bool8 FollowablePlayerMovement_Idle(struct ObjectEvent *objectEvent, struct Spri // walk in place ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection)); sprite->sTypeFuncId = 1; - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; return TRUE; } else if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { // finish movement action - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; } else if (OW_MON_BOBBING == TRUE && (sprite->data[3] & 7) == 2) sprite->y2 ^= -1; UpdateFollowerTransformEffect(objectEvent, sprite); @@ -5377,7 +5377,7 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri } MoveObjectEventToMapCoords(objectEvent, targetX, targetY); ObjectEventSetSingleMovement(objectEvent, sprite, MOVEMENT_ACTION_EXIT_POKEBALL); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->sTypeFuncId = 2; if (OW_MON_BOBBING == TRUE) sprite->y2 = 0; @@ -5429,7 +5429,7 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *objectEvent, struct Spri sprite->y2 = -1; } #endif - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->sTypeFuncId = 2; return TRUE; } @@ -5611,6 +5611,14 @@ bool8 MovementType_MoveInPlace_Step1(struct ObjectEvent *objectEvent, struct Spr { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) sprite->sTypeFuncId = 0; + // similar to FollowablePlayerMovement_Idle + else if ( + OW_MON_BOBBING == TRUE + && IS_OW_MON_OBJ(objectEvent) + && (sprite->data[3] & 7) == 2) + { + sprite->y2 ^= 1; + } return FALSE; } From 42d9f24c8472a67d742d9d9da106480c84514336 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 1 Sep 2024 17:15:29 -0400 Subject: [PATCH 075/133] feat: added `OW_MON_WANDER_WALK` config option --- include/constants/event_objects.h | 3 + include/event_object_movement.h | 4 +- .../object_events/movement_type_func_tables.h | 6 +- src/event_object_movement.c | 61 +++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 9c9c1c75e2..a6963d6247 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -293,6 +293,9 @@ // If true, follower pokemon will bob up and down // during their idle & walking animations #define OW_MON_BOBBING TRUE +// If true, OW pokemon with `MOVEMENT_TYPE_WANDER*` +// will walk-in-place in between steps +#define OW_MON_WANDER_WALK TRUE // If true, adds a small amount of overhead // to OW code so that large (48x48, 64x64) OWs diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 7bd697875b..ab62ae2987 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -295,7 +295,7 @@ u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority); u8 MovementType_WanderAround_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_WanderAround_Step3(struct ObjectEvent *, struct Sprite *); +u8 MovementType_Wander_Step3(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step5(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderAround_Step6(struct ObjectEvent *, struct Sprite *); @@ -318,14 +318,12 @@ u8 MovementType_LookAround_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_WanderUpAndDown_Step3(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step5(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderUpAndDown_Step6(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_WanderLeftAndRight_Step3(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step4(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step5(struct ObjectEvent *, struct Sprite *); u8 MovementType_WanderLeftAndRight_Step6(struct ObjectEvent *, struct Sprite *); diff --git a/src/data/object_events/movement_type_func_tables.h b/src/data/object_events/movement_type_func_tables.h index 749c14969c..35180f5b3c 100755 --- a/src/data/object_events/movement_type_func_tables.h +++ b/src/data/object_events/movement_type_func_tables.h @@ -2,7 +2,7 @@ u8 (*const gMovementTypeFuncs_WanderAround[])(struct ObjectEvent *, struct Sprit MovementType_WanderAround_Step0, MovementType_WanderAround_Step1, MovementType_WanderAround_Step2, - MovementType_WanderAround_Step3, + MovementType_Wander_Step3, MovementType_WanderAround_Step4, MovementType_WanderAround_Step5, MovementType_WanderAround_Step6, @@ -36,7 +36,7 @@ u8 (*const gMovementTypeFuncs_WanderUpAndDown[])(struct ObjectEvent *, struct Sp MovementType_WanderUpAndDown_Step0, MovementType_WanderUpAndDown_Step1, MovementType_WanderUpAndDown_Step2, - MovementType_WanderUpAndDown_Step3, + MovementType_Wander_Step3, MovementType_WanderUpAndDown_Step4, MovementType_WanderUpAndDown_Step5, MovementType_WanderUpAndDown_Step6, @@ -48,7 +48,7 @@ u8 (*const gMovementTypeFuncs_WanderLeftAndRight[])(struct ObjectEvent *, struct MovementType_WanderLeftAndRight_Step0, MovementType_WanderLeftAndRight_Step1, MovementType_WanderLeftAndRight_Step2, - MovementType_WanderLeftAndRight_Step3, + MovementType_Wander_Step3, MovementType_WanderLeftAndRight_Step4, MovementType_WanderLeftAndRight_Step5, MovementType_WanderLeftAndRight_Step6, diff --git a/src/event_object_movement.c b/src/event_object_movement.c index ea8a6b97a9..4f2cc94ea7 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -103,6 +103,7 @@ static EWRAM_DATA struct LockedAnimObjectEvents *sLockedAnimObjectEvents = {0}; static void MoveCoordsInDirection(u32, s16 *, s16 *, s16, s16); static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *, struct Sprite *); +static bool32 UpdateMonMoveInPlace(struct ObjectEvent *, struct Sprite *); static void SetMovementDelay(struct Sprite *, s16); static bool8 WaitForMovementDelay(struct Sprite *); static u8 GetCollisionInDirection(struct ObjectEvent *, u8); @@ -3436,12 +3437,20 @@ bool8 MovementType_WanderAround_Step2(struct ObjectEvent *objectEvent, struct Sp return TRUE; } -bool8 MovementType_WanderAround_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) +// common; used by all MovementType_Wander*_Step3 +bool8 MovementType_Wander_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (WaitForMovementDelay(sprite)) { + // resets a mid-movement sprite + ClearObjectEventMovement(objectEvent, sprite); sprite->sTypeFuncId = 4; return TRUE; + } else if ( + OW_MON_WANDER_WALK == TRUE + && IS_OW_MON_OBJ(objectEvent)) + { + UpdateMonMoveInPlace(objectEvent, sprite); } return FALSE; } @@ -3768,16 +3777,6 @@ bool8 MovementType_WanderUpAndDown_Step2(struct ObjectEvent *objectEvent, struct return TRUE; } -bool8 MovementType_WanderUpAndDown_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - if (WaitForMovementDelay(sprite)) - { - sprite->sTypeFuncId = 4; - return TRUE; - } - return FALSE; -} - bool8 MovementType_WanderUpAndDown_Step4(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u8 direction; @@ -3836,16 +3835,6 @@ bool8 MovementType_WanderLeftAndRight_Step2(struct ObjectEvent *objectEvent, str return TRUE; } -bool8 MovementType_WanderLeftAndRight_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) -{ - if (WaitForMovementDelay(sprite)) - { - sprite->sTypeFuncId = 4; - return TRUE; - } - return FALSE; -} - bool8 MovementType_WanderLeftAndRight_Step4(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u8 direction; @@ -5328,19 +5317,27 @@ bool8 MovementType_FollowPlayer_Moving(struct ObjectEvent *objectEvent, struct S return FALSE; } -bool8 FollowablePlayerMovement_Idle(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) -{ +// single function for updating an OW mon's walk-in-place movements +static bool32 UpdateMonMoveInPlace(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (!objectEvent->singleMovementActive) { // walk in place - ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection)); - sprite->sTypeFuncId = 1; - objectEvent->singleMovementActive = TRUE; - return TRUE; + ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection)); + objectEvent->singleMovementActive = TRUE; + return TRUE; } else if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { // finish movement action objectEvent->singleMovementActive = FALSE; } else if (OW_MON_BOBBING == TRUE && (sprite->data[3] & 7) == 2) sprite->y2 ^= -1; + return FALSE; +} + +bool8 FollowablePlayerMovement_Idle(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) +{ + if (UpdateMonMoveInPlace(objectEvent, sprite)) { + sprite->sTypeFuncId = 1; + return TRUE; + } UpdateFollowerTransformEffect(objectEvent, sprite); return FALSE; } @@ -5611,7 +5608,7 @@ bool8 MovementType_MoveInPlace_Step1(struct ObjectEvent *objectEvent, struct Spr { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) sprite->sTypeFuncId = 0; - // similar to FollowablePlayerMovement_Idle + // similar to UpdateMonMoveInPlace else if ( OW_MON_BOBBING == TRUE && IS_OW_MON_OBJ(objectEvent) @@ -10058,14 +10055,16 @@ static u8 DoJumpSpecialSpriteMovement(struct Sprite *sprite) static void SetMovementDelay(struct Sprite *sprite, s16 timer) { - sprite->data[3] = timer; + sprite->data[3] = timer; // kept for legacy reasons + sprite->data[7] = timer; // actual timer } static bool8 WaitForMovementDelay(struct Sprite *sprite) { - if (--sprite->data[3] == 0) + if (--sprite->data[7] == 0) { + sprite->data[3] = 0; // reset animation timer return TRUE; - else + } else return FALSE; } From 60803cdba9fc1b6030e454bd3a88adc158da046a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 9 Sep 2024 13:58:23 -0300 Subject: [PATCH 076/133] Fixed braces style --- src/event_object_movement.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index a4f74c3251..c290456284 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1328,7 +1328,8 @@ static u8 InitObjectEventStateFromTemplate(const struct ObjectEventTemplate *tem objectEvent->triggerGroundEffectsOnMove = TRUE; objectEvent->graphicsId = PackGraphicsId(template); SetObjectEventDynamicGraphicsId(objectEvent); - if (IS_OW_MON_OBJ(objectEvent)) { + if (IS_OW_MON_OBJ(objectEvent)) + { if (template->script && template->script[0] == 0x7d) objectEvent->shiny = T1_READ_16(&template->script[2]) >> 15; else if (template->trainerRange_berryTreeId) @@ -1531,11 +1532,13 @@ u16 LoadSheetGraphicsInfo(const struct ObjectEventGraphicsInfo *info, u16 uuid, // Load, then free, in order to avoid displaying garbage data // before sprite's `sheetTileStart` is repointed tileStart = LoadCompressedSpriteSheetByTemplate(&template, TILE_SIZE_4BPP << sheetSpan); - if (oldTiles) { + if (oldTiles) + { FieldEffectFreeTilesIfUnused(oldTiles); // We weren't able to load the sheet; // retry (after having freed), and set sprite to invisible until done - if (tileStart <= 0) { + if (tileStart <= 0) + { if (sprite) sprite->invisible = TRUE; tileStart = LoadCompressedSpriteSheetByTemplate(&template, TILE_SIZE_4BPP << sheetSpan); @@ -1648,7 +1651,8 @@ static u16 PackGraphicsId(const struct ObjectEventTemplate *template) u32 form = 0; // set form based on template's script, // if first command is bufferspeciesname - if (IS_OW_MON_OBJ(template)) { + if (IS_OW_MON_OBJ(template)) + { if (template->script && template->script[0] == 0x7d) { form = T1_READ_16(&template->script[2]); @@ -5353,23 +5357,31 @@ bool8 MovementType_FollowPlayer_Moving(struct ObjectEvent *objectEvent, struct S } // single function for updating an OW mon's walk-in-place movements -static bool32 UpdateMonMoveInPlace(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (!objectEvent->singleMovementActive) { +static bool32 UpdateMonMoveInPlace(struct ObjectEvent *objectEvent, struct Sprite *sprite) +{ + if (!objectEvent->singleMovementActive) + { // walk in place ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection)); objectEvent->singleMovementActive = TRUE; return TRUE; - } else if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { + } + else if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) + { // finish movement action objectEvent->singleMovementActive = FALSE; - } else if (OW_FOLLOWERS_BOBBING == TRUE && (sprite->data[3] & 7) == 2) + } + else if (OW_FOLLOWERS_BOBBING == TRUE && (sprite->data[3] & 7) == 2) + { sprite->y2 ^= -1; + } return FALSE; } bool8 FollowablePlayerMovement_Idle(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { - if (UpdateMonMoveInPlace(objectEvent, sprite)) { + if (UpdateMonMoveInPlace(objectEvent, sprite)) + { sprite->sTypeFuncId = 1; return TRUE; } @@ -10154,11 +10166,12 @@ static void SetMovementDelay(struct Sprite *sprite, s16 timer) static bool8 WaitForMovementDelay(struct Sprite *sprite) { - if (--sprite->data[7] == 0) { + if (--sprite->data[7] == 0) + { sprite->data[3] = 0; // reset animation timer return TRUE; - } else - return FALSE; + } + return FALSE; } void SetAndStartSpriteAnim(struct Sprite *sprite, u8 animNum, u8 animCmdIndex) From 2f4dc1996ca5afdc9a8581b47a81b8aed510c3a8 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:05:29 +0200 Subject: [PATCH 077/133] Some Strings were switched (#5374) --- src/pokemon_storage_system.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 54fee9e77a..ef0c644c7d 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -8054,15 +8054,15 @@ static const u8 *const sMenuTexts[] = [MENU_CANCEL] = COMPOUND_STRING("CANCEL"), [MENU_STORE] = COMPOUND_STRING("STORE"), [MENU_WITHDRAW] = COMPOUND_STRING("WITHDRAW"), - [MENU_MOVE] = COMPOUND_STRING("SHIFT"), - [MENU_SHIFT] = COMPOUND_STRING("MOVE"), + [MENU_MOVE] = COMPOUND_STRING("MOVE"), + [MENU_SHIFT] = COMPOUND_STRING("SHIFT"), [MENU_PLACE] = COMPOUND_STRING("PLACE"), [MENU_SUMMARY] = COMPOUND_STRING("SUMMARY"), [MENU_RELEASE] = COMPOUND_STRING("RELEASE"), [MENU_MARK] = COMPOUND_STRING("MARK"), - [MENU_JUMP] = COMPOUND_STRING("NAME"), - [MENU_WALLPAPER] = COMPOUND_STRING("JUMP"), - [MENU_NAME] = COMPOUND_STRING("WALLPAPER"), + [MENU_JUMP] = COMPOUND_STRING("JUMP"), + [MENU_WALLPAPER] = COMPOUND_STRING("WALLPAPER"), + [MENU_NAME] = COMPOUND_STRING("NAME"), [MENU_TAKE] = COMPOUND_STRING("TAKE"), [MENU_GIVE] = gPCText_Give, [MENU_GIVE_2] = gPCText_Give, From c804e605d83bcf1a4a931f177ffa445c111773ed Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:40:17 +0200 Subject: [PATCH 078/133] Adds CanEndureHit AI function (#5373) * Adds CanEndureHit AI function * use ai data * missed a function --- src/battle_ai_util.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 5fabe7c134..3f08ace393 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1113,6 +1113,26 @@ s32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler, u32 moveConsidered) return AI_IS_SLOWER; } +static bool32 CanEndureHit(u32 battler, u32 battlerTarget, u32 move) +{ + if (!BATTLER_MAX_HP(battlerTarget) || gMovesInfo[move].effect == EFFECT_MULTI_HIT) + return FALSE; + if (gMovesInfo[move].strikeCount > 1 && !(gMovesInfo[move].effect == EFFECT_DRAGON_DARTS && IsValidDoubleBattle(battlerTarget))) + return FALSE; + if (AI_DATA->holdEffects[battlerTarget] == HOLD_EFFECT_FOCUS_SASH) + return TRUE; + + if (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battler], move)) + { + if (B_STURDY >= GEN_5 && AI_DATA->abilities[battlerTarget] == ABILITY_STURDY) + return TRUE; + if (gBattleMons[battlerTarget].species == SPECIES_MIMIKYU_DISGUISED) + return TRUE; + } + + return FALSE; +} + // Check if target has means to faint ai mon. bool32 CanTargetFaintAi(u32 battlerDef, u32 battlerAtk) { @@ -1123,7 +1143,8 @@ bool32 CanTargetFaintAi(u32 battlerDef, u32 battlerAtk) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !(unusable & (1u << i)) - && AI_DATA->simulatedDmg[battlerDef][battlerAtk][i].expected >= gBattleMons[battlerAtk].hp) + && AI_DATA->simulatedDmg[battlerDef][battlerAtk][i].expected >= gBattleMons[battlerAtk].hp + && !CanEndureHit(battlerDef, battlerAtk, moves[i])) { return TRUE; } @@ -1210,7 +1231,13 @@ bool32 CanAIFaintTarget(u32 battlerAtk, u32 battlerDef, u32 numHits) dmg *= numHits; if (gBattleMons[battlerDef].hp <= dmg) - return TRUE; + { + if (numHits > 1) + return TRUE; + + if (!CanEndureHit(battlerAtk, battlerDef, moves[i])) + return TRUE; + } } } @@ -1922,13 +1949,14 @@ bool32 ShouldLowerEvasion(u32 battlerAtk, u32 battlerDef, u32 defAbility) bool32 CanIndexMoveFaintTarget(u32 battlerAtk, u32 battlerDef, u32 index, u32 numHits) { s32 dmg; + u16 *moves = gBattleMons[battlerAtk].moves; if (numHits) dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][index].expected * numHits; else dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][index].minimum; - if (gBattleMons[battlerDef].hp <= dmg) + if (gBattleMons[battlerDef].hp <= dmg && !CanEndureHit(battlerAtk, battlerDef, moves[index])) return TRUE; return FALSE; } From 5d8c61d8137a68762993d738ba94d889dcde01eb Mon Sep 17 00:00:00 2001 From: Liamjd14 Date: Thu, 12 Sep 2024 17:55:30 +0100 Subject: [PATCH 079/133] Pokemon follower changes for issue #5135 (#5336) --- .../pokemon/arcanine/hisuian/overworld.png | Bin 1178 -> 1058 bytes .../white_striped/overworld_shiny.pal | 6 +- .../pokemon/calyrex/ice_rider/overworld.png | Bin 1111 -> 1113 bytes .../calyrex/ice_rider/overworld_shiny.pal | 8 +- .../calyrex/shadow_rider/overworld.png | Bin 1162 -> 1158 bytes .../calyrex/shadow_rider/overworld_normal.pal | 2 +- .../calyrex/shadow_rider/overworld_shiny.pal | 6 +- .../pokemon/dialga/origin/overworld_shiny.pal | 16 ++-- graphics/pokemon/enamorus/overworld_shiny.pal | 10 +-- .../pokemon/enamorus/therian/overworld.png | Bin 1451 -> 1452 bytes .../enamorus/therian/overworld_shiny.pal | 10 +-- .../pokemon/exeggutor/alolan/overworld.png | Bin 1368 -> 1414 bytes .../pokemon/flabebe/blue_flower/overworld.png | Bin 735 -> 668 bytes .../flabebe/blue_flower/overworld_shiny.pal | 4 +- .../flabebe/orange_flower/overworld.png | Bin 735 -> 670 bytes .../flabebe/orange_flower/overworld_shiny.pal | 4 +- graphics/pokemon/flabebe/overworld.png | Bin 706 -> 663 bytes graphics/pokemon/flabebe/overworld_shiny.pal | 4 +- .../flabebe/white_flower/overworld.png | Bin 707 -> 666 bytes .../flabebe/white_flower/overworld_shiny.pal | 4 +- .../flabebe/yellow_flower/overworld.png | Bin 735 -> 669 bytes .../flabebe/yellow_flower/overworld_shiny.pal | 4 +- .../eternal_flower/overworld_shiny.pal | 4 +- graphics/pokemon/golem/alolan/overworld.png | Bin 902 -> 938 bytes graphics/pokemon/goodra/hisuian/overworld.png | Bin 952 -> 871 bytes .../pokemon/gourgeist/large/overworld.png | Bin 0 -> 949 bytes .../pokemon/gourgeist/small/overworld.png | Bin 0 -> 949 bytes .../pokemon/gourgeist/super/overworld.png | Bin 0 -> 949 bytes .../pokemon/graveler/alolan/overworld.png | Bin 698 -> 749 bytes .../pokemon/growlithe/hisuian/overworld.png | Bin 723 -> 687 bytes graphics/pokemon/kyurem/black/overworld.png | Bin 0 -> 1552 bytes .../pokemon/kyurem/black/overworld_normal.pal | 19 ++++ .../pokemon/kyurem/black/overworld_shiny.pal | 19 ++++ graphics/pokemon/kyurem/white/overworld.png | Bin 0 -> 1442 bytes .../pokemon/kyurem/white/overworld_normal.pal | 19 ++++ .../pokemon/kyurem/white/overworld_shiny.pal | 19 ++++ .../pokemon/landorus/therian/overworld.png | Bin 0 -> 1265 bytes .../landorus/therian/overworld_normal.pal | 19 ++++ .../landorus/therian/overworld_shiny.pal | 19 ++++ graphics/pokemon/lycanroc/overworld.png | Bin 1572 -> 863 bytes .../pokemon/lycanroc/overworld_normal.pal | 4 +- graphics/pokemon/lycanroc/overworld_shiny.pal | 4 +- .../magearna/original_color/overworld.png | Bin 0 -> 890 bytes .../original_color/overworld_normal.pal | 19 ++++ .../original_color/overworld_shiny.pal | 19 ++++ graphics/pokemon/marowak/alolan/overworld.png | Bin 817 -> 833 bytes .../marowak/alolan/overworld_normal.pal | 16 ++-- .../marowak/alolan/overworld_shiny.pal | 18 ++-- .../pokemon/necrozma/dawn_wings/overworld.png | Bin 1474 -> 1470 bytes .../pokemon/ninetales/alolan/overworld.png | Bin 784 -> 887 bytes .../ninetales/alolan/overworld_shiny.pal | 2 +- graphics/pokemon/oricorio/pau/overworld.png | Bin 0 -> 590 bytes .../pokemon/oricorio/pau/overworld_normal.pal | 19 ++++ .../pokemon/oricorio/pau/overworld_shiny.pal | 19 ++++ .../pokemon/oricorio/pom_pom/overworld.png | Bin 0 -> 630 bytes .../oricorio/pom_pom/overworld_normal.pal | 19 ++++ .../oricorio/pom_pom/overworld_shiny.pal | 19 ++++ graphics/pokemon/oricorio/sensu/overworld.png | Bin 0 -> 740 bytes .../oricorio/sensu/overworld_normal.pal | 19 ++++ .../oricorio/sensu/overworld_shiny.pal | 19 ++++ graphics/pokemon/palkia/origin/overworld.png | Bin 1800 -> 1786 bytes .../palkia/origin/overworld_normal.pal | 30 +++---- .../pokemon/palkia/origin/overworld_shiny.pal | 30 +++---- graphics/pokemon/persian/alolan/overworld.png | Bin 689 -> 754 bytes .../pokemon/ponyta/galarian/overworld.png | Bin 738 -> 736 bytes .../ponyta/galarian/overworld_normal.pal | 4 +- .../ponyta/galarian/overworld_shiny.pal | 16 ++-- .../pokemon/pumpkaboo/large/overworld.png | Bin 0 -> 522 bytes .../pokemon/pumpkaboo/small/overworld.png | Bin 0 -> 522 bytes .../pokemon/pumpkaboo/super/overworld.png | Bin 0 -> 522 bytes .../pokemon/raichu/alolan/overworld_shiny.pal | 12 +-- .../pokemon/rapidash/galarian/overworld.png | Bin 965 -> 959 bytes .../rapidash/galarian/overworld_shiny.pal | 14 +-- .../pokemon/sandshrew/alolan/overworld.png | Bin 481 -> 534 bytes .../pokemon/sawsbuck/winter/overworld.png | Bin 814 -> 866 bytes graphics/pokemon/scovillain/overworld.png | Bin 1037 -> 1337 bytes graphics/pokemon/shaymin/sky/overworld.png | Bin 0 -> 829 bytes .../pokemon/shaymin/sky/overworld_normal.pal | 19 ++++ .../pokemon/shaymin/sky/overworld_shiny.pal | 19 ++++ .../pokemon/sliggoo/hisuian/overworld.png | Bin 744 -> 652 bytes .../sliggoo/hisuian/overworld_normal.pal | 4 +- .../sliggoo/hisuian/overworld_shiny.pal | 4 +- .../pokemon/slowbro/galarian/overworld.png | Bin 1046 -> 1099 bytes .../pokemon/thundurus/therian/overworld.png | Bin 0 -> 1976 bytes .../thundurus/therian/overworld_normal.pal | 19 ++++ .../thundurus/therian/overworld_shiny.pal | 19 ++++ graphics/pokemon/tinkatink/overworld.png | Bin 583 -> 705 bytes graphics/pokemon/tinkaton/overworld.png | Bin 1225 -> 1606 bytes graphics/pokemon/tinkatuff/overworld.png | Bin 778 -> 997 bytes .../pokemon/tornadus/therian/overworld.png | Bin 0 -> 1928 bytes .../tornadus/therian/overworld_normal.pal | 19 ++++ .../tornadus/therian/overworld_shiny.pal | 19 ++++ .../toxtricity/low_key/overworld_shiny.pal | 8 +- .../pokemon/typhlosion/hisuian/overworld.png | Bin 1346 -> 1122 bytes .../typhlosion/hisuian/overworld_shiny.pal | 6 +- graphics/pokemon/vulpix/alolan/overworld.png | Bin 607 -> 674 bytes .../pokemon/zygarde/10_percent/overworld.png | Bin 0 -> 693 bytes .../zygarde/10_percent/overworld_normal.pal | 19 ++++ .../zygarde/10_percent/overworld_shiny.pal | 19 ++++ .../pokemon/zygarde/complete/overworld.png | Bin 0 -> 1185 bytes .../zygarde/complete/overworld_normal.pal | 19 ++++ .../zygarde/complete/overworld_shiny.pal | 19 ++++ include/config/overworld.h | 2 +- spritesheet_rules.mk | 54 +++++++++++ src/data/graphics/pokemon.h | 84 +++++++++--------- .../object_event_pic_tables_followers.h | 48 +++++----- .../pokemon/species_info/gen_1_families.h | 32 +++++++ .../pokemon/species_info/gen_4_families.h | 8 ++ .../pokemon/species_info/gen_5_families.h | 40 +++++++++ .../pokemon/species_info/gen_6_families.h | 72 +++++++++++++++ .../pokemon/species_info/gen_7_families.h | 40 +++++++++ .../pokemon/species_info/gen_8_families.h | 8 -- 112 files changed, 896 insertions(+), 202 deletions(-) create mode 100644 graphics/pokemon/gourgeist/large/overworld.png create mode 100644 graphics/pokemon/gourgeist/small/overworld.png create mode 100644 graphics/pokemon/gourgeist/super/overworld.png create mode 100644 graphics/pokemon/kyurem/black/overworld.png create mode 100644 graphics/pokemon/kyurem/black/overworld_normal.pal create mode 100644 graphics/pokemon/kyurem/black/overworld_shiny.pal create mode 100644 graphics/pokemon/kyurem/white/overworld.png create mode 100644 graphics/pokemon/kyurem/white/overworld_normal.pal create mode 100644 graphics/pokemon/kyurem/white/overworld_shiny.pal create mode 100644 graphics/pokemon/landorus/therian/overworld.png create mode 100644 graphics/pokemon/landorus/therian/overworld_normal.pal create mode 100644 graphics/pokemon/landorus/therian/overworld_shiny.pal create mode 100644 graphics/pokemon/magearna/original_color/overworld.png create mode 100644 graphics/pokemon/magearna/original_color/overworld_normal.pal create mode 100644 graphics/pokemon/magearna/original_color/overworld_shiny.pal create mode 100644 graphics/pokemon/oricorio/pau/overworld.png create mode 100644 graphics/pokemon/oricorio/pau/overworld_normal.pal create mode 100644 graphics/pokemon/oricorio/pau/overworld_shiny.pal create mode 100644 graphics/pokemon/oricorio/pom_pom/overworld.png create mode 100644 graphics/pokemon/oricorio/pom_pom/overworld_normal.pal create mode 100644 graphics/pokemon/oricorio/pom_pom/overworld_shiny.pal create mode 100644 graphics/pokemon/oricorio/sensu/overworld.png create mode 100644 graphics/pokemon/oricorio/sensu/overworld_normal.pal create mode 100644 graphics/pokemon/oricorio/sensu/overworld_shiny.pal create mode 100644 graphics/pokemon/pumpkaboo/large/overworld.png create mode 100644 graphics/pokemon/pumpkaboo/small/overworld.png create mode 100644 graphics/pokemon/pumpkaboo/super/overworld.png create mode 100644 graphics/pokemon/shaymin/sky/overworld.png create mode 100644 graphics/pokemon/shaymin/sky/overworld_normal.pal create mode 100644 graphics/pokemon/shaymin/sky/overworld_shiny.pal create mode 100644 graphics/pokemon/thundurus/therian/overworld.png create mode 100644 graphics/pokemon/thundurus/therian/overworld_normal.pal create mode 100644 graphics/pokemon/thundurus/therian/overworld_shiny.pal create mode 100644 graphics/pokemon/tornadus/therian/overworld.png create mode 100644 graphics/pokemon/tornadus/therian/overworld_normal.pal create mode 100644 graphics/pokemon/tornadus/therian/overworld_shiny.pal create mode 100644 graphics/pokemon/zygarde/10_percent/overworld.png create mode 100644 graphics/pokemon/zygarde/10_percent/overworld_normal.pal create mode 100644 graphics/pokemon/zygarde/10_percent/overworld_shiny.pal create mode 100644 graphics/pokemon/zygarde/complete/overworld.png create mode 100644 graphics/pokemon/zygarde/complete/overworld_normal.pal create mode 100644 graphics/pokemon/zygarde/complete/overworld_shiny.pal diff --git a/graphics/pokemon/arcanine/hisuian/overworld.png b/graphics/pokemon/arcanine/hisuian/overworld.png index a3c67a34d3352a96324beed15ed7bf776504e698..ec9fb5d8f8460cbd5d41b8a1d3710233659e88ed 100644 GIT binary patch delta 990 zcmV<410npH38Dy)7#0Wv0001UMu)cm0004VQb$4nuFf3kks&^R1E5JnK~z|U?U>PW z+#n1^Eg@KYo&Epctt2ouNSLJVOkYB$+0Gut+zXPxU6$X`41CBR&o5&dFpj`@uW-g6 z4#X&9EU*L&BLv?mobiXFs0(2Gzva9hy#|PYQovfoo(EVe=U6iVvBEO zUwVNZ*JN%raD5?R;7kkrX$5k?m74%0f}$`0kYnJEW2ugRW08A-9mo8jMguSEMoBX* z(Pjm*LE%!u%-t=ZnuAvVgv)cKJa}_mfjy6|0pjP1N&d6~3zshCaxJqu+%7cc7)yCW zuE1Vk%Qc-s?*O>}Q^_>>GzK!)bHd}S52`+J9NckCM|JxGJ1$S z0@oDrw&0F`V^W3OT!mVJEzgf~3|uB~1kSiVR&J``>c8b6`nD}e4Z^xsf#~y9&Xmxd zxepH_kdg1IBGGNbSKfwjili?{FVZHxlCJbcV9!fCXf!-Lh#-8R^bRR==sl>vc=FG+ zh;ZK$zSB!|^A=Gr&~kJPyb{D?uvueZ!r^ljNT05M%GqG`r@Yw!&JV3qP_`${l~do0 z7lAJjg&GGh$G|;bPW>{=$25UYy~_%3kJ)m-$qECdT@_x+Y{v8SA<%n^jNco*$$<9NyXQL_xJJkVV_ zZ{#z62qZaa(ZJ&oD0xfZ8Pr{tcLv$Ne4{WNG6k&&6Cn@Q!r;}m=U6_;DtE5S`6$j$ z8eFIIx9A&`Leut`E8ghm`S~>nYAo~-{M)RMFHz)NB+A4GPoBY3w*Oyu^;_RymY@JV zl6|AAuo!ScWN~?CVf;?K6h09+9mB{2xB=~#gJ;0vy|90u|Bj!JKP;&r3j_K_6951J M07*qoM6N<$f{a2$~6y7zqRe0002CwraMKEdfB>Z$nykeWuEkdihCr69SxKH}7NKEWlfG;Y)bpRg9hnFp^QAX9e@;nc;ue z_%Z`V8!jOA37$7I0&HGn?dSM1*Kr%5n^~Zl6a4Qh^uPzO{M?c(HxcLtSh+(5Im5{zQIL1%$>JFr=iX5Fp9-xK6Nj0JbrS z%gb2@(i|8-)XFZwXBOB<;wmpQJ$QeN=LsP))cC#T^E4ZYLWBg@q)$gAxsPF8Y@=9V z!nnPzga**6Mo(zJDHYZX!OEJ~#(YL#Mb*=Tw!^nZv zm0izXUfPQF5wmXrn4Jj>7U(Ec_%OvdRYjYO7xr`M!Dy3J(`;45!W=T5=P`d^rnxlE zM8ulHa8aRwfo@+YWHeTg=LX+ZT&k0?jCjPkLq@1jGGYuzN%qMdPe+a^SI8L}j%mxF z-x7h*VFD{Ka-qQ$X4r;p0R?fJ_EncwJa-t)$g?+R!{DFFvsj}yOJML)iMTLZT$}3s z{mox{4REOB?|*&ID~Ex@6>NV1Hhe8EiyW&JyV`D*6NmgR=c=uSNm9_gJpyys)d@@S zh&OzjgsHw{BjGL8go0{D3PDw>oXh5RIC}ru(K}tAZq);Y38Q4wy?Y?uj%3y3*a>G9 zwqt{j713P^Q5F1XK02geeD?tbC(X@(gDOHJK>i4ULL;9ejw7=6Iahy(WLY_4uM$L7 zWS4xd`1lH}JR+~NNV4kQ{=zG*9RC?*bvoujl;yKUuqd$manc_cj3

2+fz~h(0*! zT-mULCYod6JZ~Y*r+?@WH`F|X_B2?$99O^&%Q4(`JC5&Zch5IZyGDlZf?)^`ka~6I z=fc#3x;G4BkY`XeG;@Cj{*Cj~(1q*MyCi=Pg@#)QZ=8J8cCN{0*C`ABQnrR_oA&@K zIab9hE3}hSoB~53@O48@*sz4D;#V?eMpdb14t>s=k({x{xF4RhP;?eU&kdz#AV8U~ d^ZXWH{{deE59D!8`NseN002ovPDHLkV1oYP9SHyc diff --git a/graphics/pokemon/basculin/white_striped/overworld_shiny.pal b/graphics/pokemon/basculin/white_striped/overworld_shiny.pal index b4e0639fc8..9f7acd3090 100644 --- a/graphics/pokemon/basculin/white_striped/overworld_shiny.pal +++ b/graphics/pokemon/basculin/white_striped/overworld_shiny.pal @@ -6,13 +6,13 @@ JASC-PAL 255 255 255 172 197 255 0 0 0 -32 139 65 +80 112 40 16 98 41 123 172 172 172 222 230 -41 189 90 +120 168 56 74 74 74 -90 90 90 +64 80 80 57 74 82 123 148 197 123 148 189 diff --git a/graphics/pokemon/calyrex/ice_rider/overworld.png b/graphics/pokemon/calyrex/ice_rider/overworld.png index 24b3b6215a1198a2305fb7290ea9f58d8dd68c19..48952c59fa266738eba97536e555264d9d68a69b 100644 GIT binary patch delta 990 zcmV<410np^2-ygbiGRCEL_t(oh1Hksma8BPMU5aBaKZb(?L7gV>68Gq{<_T6Qg;j| z;nQXLQ&uTUw@mP3{?LOltKIOo8uJBy%pZF&&Ug>(J!-e{V-AabH^o9K_c`3|`|hpB zRcT^^AM>j3v``h!xwNoL1E{qDjPYZB2`mv$* z7QT3O{{@GInEVJ#)OeWjbj0W)mRVfm(FQQY!lBR=d5-V%%jDFj8BF#E&K(S6o3Diz(DJw2~WgZw86%WDYgNO@s(oNOYoS-xP%QRrWlyUV8+h~nTtY( z!rQngWOn#;+>bbVHCT&LUM<=HC%m>`k>d~oGHkUWI>rc)5;PvEonLbvF}Ex__OiIk zYYQ0(mSSVp0vKZ$7{jJ~I{pVdT8KGa0Xk6Lq&90x- zMmz^*2OM;zo9v}U%JK(vbMaF1K)*cXOZt+W@Cm2HD zW=VNxnBc{vWC%+HN#!1|-Ac5kZP=8ocJmaUAT0+JJt5q$_r?~1X|NHsv z+W30BI77E$mLWw4HY>>6FlS+AKH$H8GM1|x z#_ugIuUUHI^v-LsnPscZ`CWbWArXYY*(!|WQ^qK+RBzniOIhqWqluz_X^$&2E@iV~ zqJJtp;}dK*9m{?xn@!N;pYfb!ei7N4KPAG#`QnNTyl%MGpC15B)Tl91;^kTdHr z0K%%M9z?2l(ZHLQz$o{5>Cjpz2Ap!b3QK%&6qL7t@_0QX=>m%b1Sm?h-WTWcnjvSl zs2)}7{c_dYmqCs>(pOmHt44YNn@H0IE>~B8rPx# M07*qoM6N<$g7tjoX#fBK delta 988 zcmV<210(#|2-gUZiGR6CL_t(oh1Hksma8BPMU5Z`xZwTY_MQZt&XfSP{<_SRQg;j| z;X_=OKV{{zbjt)k<_|p>v)T=Rt1(~T$NaGet zcYKWTb^HD;hrnMZXtx23IeKs`aAS#13t))P+iUrTi$M1>Py-lo%E5sr3x&>wOt#BZd;E;ovQmkn5PPMP!wKdDJL5b)`eAp#i=>6;XwKFi5NK}kOQ9ziLf~de zd1sj5#pG-VTLf|A9}9fN2hE3TWTMeBRH;RkHd%(BoB~#l$RR$T)J?v7v82C(4YU z{yq5>vxMiGH2fb86U_SXgg^ChvpI_OInNLFix~=S&hrE3AguWFwPD6jfg40Ivw^sQ z-@p2p;3|-H?R)*w0_bqEfz?4CCkE~*V2lU~Yk!Jo{Pa>wEU2(s)v|nwt3LVP&u`bp z*W=<0!-`dg6dib2LEeTn3p4WpfB7lcu1e&pv=7TM#>^xhUrsJb`#pd$uPWI$6vl$z zTUvf+>5bDnuf>+YkJ?h+)mI-JL5!hTg%N*bj-sY|;Rau1vkwJbi2kKLuFN=>&9aHA z@PCYtvE6jc&r5#TL_Pi)FNN0^k*)btA`~7juDHPK7Ei6N!i_z^#A+uAzCT7jvkn6w z?276^q~u=lq(%XSSps zRqA!A_5OL1V~z9`*7&NC9>B)Zbb-qi;8kg*M3*=KDnaj`>UF8R0m!oMDy*Q{LEmrh z2)v|s?uYXvx0AFq?{dA`bprUU;|}=HYIy$(_RP-wd?ez3D*ph+h(q*MpsvjT0000< KMNUMnLSTZFZSjr( diff --git a/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal b/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal index 9eb0730f23..4a45354c83 100644 --- a/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal +++ b/graphics/pokemon/calyrex/ice_rider/overworld_shiny.pal @@ -7,13 +7,13 @@ JASC-PAL 0 37 32 146 175 206 183 206 229 -0 75 65 +0 88 72 52 69 167 -66 119 111 +0 112 96 100 100 100 242 242 242 64 83 103 -216 215 206 +208 200 144 0 0 0 -169 160 155 +168 136 88 191 191 191 diff --git a/graphics/pokemon/calyrex/shadow_rider/overworld.png b/graphics/pokemon/calyrex/shadow_rider/overworld.png index bb8c91b2f3a2df113083eb4f7fc719bfffd872ac..8aa1a2247e99f2f8a10b8158ae5d2b58866fa2aa 100644 GIT binary patch delta 1051 zcmV+$1mydQ35E%fO9KE)L6J@v1a-2rp^<7If9Od>K~z|U&6n$UMC4|(_#P9xy2NBF%z1fEQAod;0oxaAJ+N&;&5y}t=`CxcP| zH7-kV2X|qSNBF&eCp0+(E^@VK@?{FDv~a3n$^}&MYT!&GzRUg(~t3-pc+pOpC7x3`!+x@MV%Xf9TK;QOX&v;UmZHCc_QfsnW!ofiD=eIEPS; zap?OPRZ9Zvc$FA}!{;`@3f6%NH;Yn$4Nj9eYGj5r&iWX`0Lu&_rv(eFXF=mmy58ggnOu&J&1hBByt021}$aRZs@oj)zVPDE|1Dil+f6sdV zak<1QhCZ2R4A6yzE%@+=?;~K2L*f8)EeWXNHN!k`@~~M7Af9kqLer;I2z@_469gs- zTl^S7#%MY2N699MUT_|P`epF~g~E%>e@<``AQsk)H9F7ZvbaCfgh<`_wAA8Xg}X$_ z6f*w_&QeVM*lF3Y%B~TZ{xd%Nf1|8wb(Lva<%#2#`CGmZ5k+MfAQ8WpSq{Bde2qZ8 zTc*7&&R_kn`0KA$)}ARAFP`coK;LJ3?`rYA0JDsv!&(t>5in&B^HHaIVp848$V0X4!XpDo2L{!Ou9itJx$ig_c&l2(8jcJ}|X{UXOFUcgE3 zEbGV>E)yPBkcXLyM6D?<@&3fO9C4BiYb$Is?Bt6jJ4<0|3Jc8aie38$Sk@Mqml%59pbAqSI9b-l131D_PGes#-H8nc8j>EV!Zhlg^pmHLhx z+X9dg>SI1d#Lja#(P$Rk(aS2}P9d?}xUL!_XU|P`7=f-f<-W!G#uwlF%5NkVpq8TB z$B=r8r7N%R-2m`T;TGSW|0;g}+)T19z)Y-1dLWa=8IhgtPmnw7cv1B``?5`i?#oNzxVH2^ae227+{0n zia`f|??2daw84TG@44mu(fpW^c7;I)fA1gkC5x)UKIaG{2f$S+ppC!xPXdEQBY;Ql ze_R+KHS63f{JsBRuO|HCC3k<^Wd!_n!)p`w{o6PQyqMs+44}<%%beWQ0%+mBe;X%( z=3-C_pv7f(=H$lh@(O?NKL|}ufxFx-x_n=qDlLqvTT1~=91Tp+i0`_81D_^IU(KM) zS0}Tw&EnQlU>gSmbF{jD3)A9b0)twKe>!|$#m_oVvzK~?TlmbedB|`F52`e=!N67w zdYnV3dOuH-_o_94Z5$;!XYhFpuz_`^!emhku)}GxdG*Y&`b}SB7+{$}QS>PV;e(bbtSY`JJe}euizWSrA8tN+R8s&-Mmib$L4B$i$_zQoF^3vqlrg2a$3H0+Op)U&Pcd)gSn>)m!zTP6(=T#- z;T4?q&ay6C;j-dk1$mgMNK{O5jZYVza>Pk8$5z>9*vSV=ahAf=6c(7-m2hoeV2RB$ zF)LEE=yB_bODIYvjxnU2Vj1e|`!E1}Qkdd<@{i(=&%-230X|EJ0-CtnI^F+@Js3(1up{DED*vDM Z7f(P?k&PDHLkV1l$_00{s9 diff --git a/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal b/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal index 8114f67fe8..5454cdbe6e 100644 --- a/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal +++ b/graphics/pokemon/calyrex/shadow_rider/overworld_normal.pal @@ -8,7 +8,7 @@ JASC-PAL 246 242 246 65 64 74 32 36 65 -49 68 164 +0 75 65 213 210 205 0 32 24 148 174 205 diff --git a/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal b/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal index 8114f67fe8..61607ea95b 100644 --- a/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal +++ b/graphics/pokemon/calyrex/shadow_rider/overworld_shiny.pal @@ -8,12 +8,12 @@ JASC-PAL 246 242 246 65 64 74 32 36 65 -49 68 164 -213 210 205 +0 88 72 +208 200 144 0 32 24 148 174 205 74 52 148 -172 161 156 +168 136 88 98 101 98 24 16 65 49 36 115 diff --git a/graphics/pokemon/dialga/origin/overworld_shiny.pal b/graphics/pokemon/dialga/origin/overworld_shiny.pal index e6bfc48201..24814df9df 100644 --- a/graphics/pokemon/dialga/origin/overworld_shiny.pal +++ b/graphics/pokemon/dialga/origin/overworld_shiny.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -98 182 49 +0 40 128 0 0 0 65 129 255 189 32 16 246 80 65 57 121 180 -98 121 139 -32 64 106 -16 56 90 -24 64 106 +156 172 115 +8 106 123 +8 106 123 +8 148 156 189 202 222 -32 89 148 -139 161 180 -156 210 246 +8 148 156 +115 189 156 +156 246 148 16 16 16 24 40 49 diff --git a/graphics/pokemon/enamorus/overworld_shiny.pal b/graphics/pokemon/enamorus/overworld_shiny.pal index 88fa42851f..d1281fa883 100644 --- a/graphics/pokemon/enamorus/overworld_shiny.pal +++ b/graphics/pokemon/enamorus/overworld_shiny.pal @@ -4,16 +4,16 @@ JASC-PAL 41 165 49 0 0 0 164 133 41 -230 117 156 -189 60 90 -172 72 82 +230 131 164 +255 90 0 +189 82 106 238 234 255 32 36 32 57 60 57 205 202 222 -148 32 24 +164 24 24 255 198 57 16 16 16 -246 85 139 +255 139 238 82 80 90 115 48 57 diff --git a/graphics/pokemon/enamorus/therian/overworld.png b/graphics/pokemon/enamorus/therian/overworld.png index f588895eb27678c7359edcd0ddf78fd1ab92bf81..c52037dfe4bc556d3aa387b50e6cab7d80a037c6 100644 GIT binary patch delta 1341 zcmV-D1;YBP3#_ zY9B5RNkla?5*0lMi-2b;vHJARP33sRJFyOF#j ze}zJ!|6TyFz5WaS-|J%zAfkg#DZ>qNO1|T}`PSS%miu7@9s`g3{oZ-#oPmFQ3AlMa z;g;N+`MuC_1aVI_yUU^%9d!gmj6Z8PC09KxeUpiX=UB?!3_HspY%z!mO2QMv?_-oG%`4Yw^)Ccg& zn*!Vm=@nGINk(8Z@WiVFHe3SepjU`;wjO&6(8EI}y7Bjx8&Bb`uMXhK+XCFhfAffB z@j~K%b>;xh{9q4&Ii7gn@qY`@!|Qe9@SCf#>J7N?#sGH_l@atrgVDfO-W(qd&>>rw zUH-2Dnt5(qwOg0)1BgT22;TFy0FUMRo)eHOd1;m` z+h$H;{n;;F)!E4KKV(KBk$4*sk z-?zMH34z2jXPPFGwb)EI^I{>7Tb2^fUA+cq=SOK_b`WG0xzTE1wSC|5o+U(AZ!xfU zInc_}atY@NOr8no;u)G*IqSMbxR$6b@Gb8e!6XxEmKW(_uoh|L#WyOKe=l^MzK7># znYm}wLy-PmYSdO}RB&e|hG!&Dz0Cl?im$>qxFC(aNvlyJ)fO>+xU%ACE76m+A{N z@nyNf4s;UP*9%x##p^F24g9`-NCV6CDVK3w#kK6;Ebh`LsJg&(SZR zw+DDJpsfeYTl96n&wlI;0bD-a7NG6u*Uwu6d}lyY518qzf#cIKiLRe+3($7->*uWj zzB8by2h6l_z@M)8>EoO0z3HH)9{9YWp%3W~*RxGLzyAnK00000NkvXXu0mjf$;h)% delta 1342 zcmV-E1;P5P3#$u|MJ3>LoUTe&5D*aaE-uF|DU%@{^Hh(!K3@0kO#j6^0002=)l~D5 zY9BETNklIv3fy4zRlNr)|3x4Gxj4t8C1s}#7hL5qn zD^MGF;FFS{ZzNzl`kYj%m2JQ;JOs{VXa@3scv$dr%yIY_E4Snm&qKX|Zypx|kGIx= zoVbvrZa|}x0Y7^v7LLt8E;rNHdrSpc_t63`Fu;%uYkRO z2K>T9x`mMmLj|OQIMMgJdkXjvO75WijT}vB;3qHHC~A4KaAc_#&=Kh5d}eDkZJ0R+;@O9ua6{j=aF52+hCVgNNwE|u-;HRvFG z9k5lfAg)>i54@p$Ynp+|C>H08o%}sU>=!&fl@AwCOosVXdQyDl*+cy6k4`o+QL401C5+I z%2d`Lf~0>2{I4Dk&A^S@M|9#9G~o`9tez{SOiS^8zawwO{{qh*QsKOp7#<5q|Md9Z zJRGr*3azA4WX)k)zI+R``9I0-%?2(O1N=PVUIAE2FyVjoa0p(oQoX__?j1INfw2L2 z=LK2$g=cZny5Q!a7r>KPhnjJhhf=A)wNmTo_)kYr`V3&2KRg*~-DC!DwIZqyBYqx| z6tJY5p#e7B=OLAwI}JSiA|JvQK+8Ffmmf!CWnRX*8?l$?PZ6+JV3`K=HFxwEb8S?`D1?k+$(*5QB;1XiQ(oY06;TvM&+H%jJrI9dVf5AI?TIQO0)c; zJ&@MFrULpD&X)Z=9%LW|m3MhOfRAtc70gLaktwxpe0UjqaF2)YwZqNh*0)=b>|lIb z*EArLT{G5)>>!US{wX@(<6E|}g-Z!-8y_yffxA4U5=(>W_SbhWc@#>2J6P8FF9!Bg z{Jo##)eUg)Tx*8U3KHb;3hcPgL+mSuP9KoxHw{3wtNd?vkzs{qM822ye*7c7m!J4? zKn8dlIIH?^$9*35BP+8_^W1){4aibS_fHYR%QpwV@>d0L;J@G@0_3xFw}8?qd7y|r zp6VX#;<1!t{+b3j@yY3bVQ+sf->hy4lvV@H1gsk<{d4m>{>on601rMnJ?#DGB+4E{ z=|8W;#9<0KxIs}api5r$G^ktH^Dlcvs=Kfq_j<^5IZ63A4BD})$n$g_yXyXH1=Itt z!qYi_je$;l@_N`#tcW{jco0SguI~UvP6bN7e(|f0mz3YM_H&GX6Q8^u@{ODd?oaZn z);t!-!w^Y;KmR?q?Wy7gc=4dmK{|;2p9i0)eW*_3zi_B(ym<)wsYq=i4gb0x)aLaF zPiT3xx9h42@?6(8XyXkz>v$P5#@BX&q3|*$IA^C z91YNg_#R)G{5A4fT((7#!0BqAgUaDgm#ZzfFhCRHdwgZ`*T{2wD%RlnYOjN;;ZK*V zEx0g16XJV(W%5SkcO(9C0_t!VGw9bX3H>MZ2TY7jJmXg&u>b%707*qoM6N<$g4GL~ AG5`Po diff --git a/graphics/pokemon/enamorus/therian/overworld_shiny.pal b/graphics/pokemon/enamorus/therian/overworld_shiny.pal index c799ddfb89..e650396bc8 100644 --- a/graphics/pokemon/enamorus/therian/overworld_shiny.pal +++ b/graphics/pokemon/enamorus/therian/overworld_shiny.pal @@ -6,14 +6,14 @@ JASC-PAL 118 50 58 232 232 248 200 200 216 -224 116 156 -174 74 87 +213 106 156 +213 65 57 16 16 16 243 46 46 -199 46 41 +74 74 74 147 33 30 -243 84 143 -187 62 94 +238 131 230 +203 0 128 247 238 76 255 197 60 0 0 0 diff --git a/graphics/pokemon/exeggutor/alolan/overworld.png b/graphics/pokemon/exeggutor/alolan/overworld.png index 6597515899cf04a2b0529e2b15dcdfc854f5a338..07e24d5c6c19e042ca0e2d6e10dba08143af933a 100644 GIT binary patch delta 1349 zcmV-L1-km!3Wf`i7#0Wv0000ahERKJ!o?~hICrK5Y!pCR~?F^=% zEg;s!@pBY^!mxtL&rp+Zsy__CzC8gg+sXQe;`w9f#xR<5y8z#0unAZPJD6f+4B59) ztjCB<{t$Yw^PA7xk5VOm422jP*w-&D;@}R1*|!DH^K2eAHDek=XoHk?Gbonm6AdC_3^T}d{w5AF#uuE{9F2^hSxvLzBPr}rJLoK{P}pq zCIF#-oubyo70f=;1sIB@J-Y#62Qd3KmWQljvUmu|y~yP^(H7k5H$4M{LGl*^q>WPs zK=$o44OZc>8A|@>^rh7PzgbQXfI$e{}c9*Bp$QxkONYLU0fwg{77%k1zZ#guAIgU<2^PA* z=OqUNRei(9zE1I{>G=|d@r&-Dg3Y#&8JNaD>y~^q8DFoW7W@={FtF-VA;-sBsMh9T zQa}{XN{}|d49w%7%lbx>?Y+J(Xs^II=xE@M4{hSLz0?Le0KrT3b9E0>uZ2N>d`n-! zw)c`QXn|eeV4&ek46YM6RB%dw6Y$K};kgO8Vs%9eeC2j9aK{I~aoj36c`I}lK6@)x z!SSCGyknzZ2mN7S{PUD@ulMDXBZl`55EclJj-SWh^Pj|MFq?${gFc91&I>3=W={SG zk!}3+mqGSI5F9^=TnRu6(KO&B3H%e|BXNBOJ$m%$@wfO5slh{aSiJ^+00000NkvXX Hu0mjfj&On< delta 1303 zcmV+y1?c*Q3)l*f7zqRe0002tcD;;|EJ(j0hU zwMuX4$#-^cZ$Z}k06vV@ibDcnxpk59Sc}w$LF@j=2M7U2&6O#xNfQX+nkDrvEaA%a z2e>MuXP0kg9E%VLnk#?*H*fwkPtRJNWi`=66HPSHL=#Ok(L@tX{BOdoh5!4oPilW) z+u^cvf_f1``lCdI-Gi{*?%D~ANMh+3fn5z(Aj$WO=)|#((kMWZFj%N0RF11sEIlI- zJ~)URZ1q0=#PGxpq5x|lgRNMls;v}S0w;)lM_}Dy{Z)$4^@ibTfHjE55VlfrtP&}) zA{c>C(4cM`YY^=ZBJzEy(nL9MR{wuFwuF?f^5R4e{Zn&&v_QJ9r=rvy`bd$CKgbX( zC=oU|GH*a*ZO}`V^n=vA2Q3i3uOt{42Il#&{;C|I@36=JYs2*$jCQ2VEpY0^!+4^6Z3x&XK`f^ zZW%b?r~_IcU_>EYQp$HsnDnDcCxk3iRZ++S?iZ`)B3g85g|02IGM#z9U ze-PsJ4^!P`vxLEL#=lq>MKO-i9cY1g{T9;qN62EvpUyDPr;9~CeUE=^Kx2shsw@gT zKO+$H>jfBCVwm=)|EkDniwth@&j4Kklb`9|9uh9Yzswnb z7TZF*W(Vs|kez_tqt2*s>@z%k3F`2BEkI2U@cwOHP2?>_}C|65@gTW^h{~fZgv$FX5 z&&OL6*9Nn7#T|12Yp9U8saXC~QBnnhL6ZMblBS zLvC5sXOD7(Zm<`p-gf%T`m+zeX^MRs+8M;SWeski!x*&mXOW+8XwI!C`GEW=0~hGo zhhIs7kdrT|0tYvfG5&v4dVNM3D7f`xdAvg|2fIQ2^)<3L(ZnI~H_3fC?4Q9b)c^nh N07*qoM6LruV1hy6dVBx? diff --git a/graphics/pokemon/flabebe/blue_flower/overworld.png b/graphics/pokemon/flabebe/blue_flower/overworld.png index 02176b255c3da2fafac226cb815ccbf226b4b1c2..cd98db3a57e2e5dbb0dfd9a376528d68b0039f76 100644 GIT binary patch delta 610 zcmV-o0-gQe1)K$t7#auz0001UMu)cm0004VQb$4nuFf3k0000mktH#I0000wNCp1@ z00J6GL_t(oh3%M$j)O1^L~%?Aq`?1w?v4$#d&CZ#c2%u}RaI1D;(2yB)ULbYiYuCLu3rPt0`IVpw_@WMIX`8^7g@CD-?|wV}A^U(&cVJ8E zd&j>ct7q<`hGG;9I)L|ogvcD5I-p70*%C#Qo-FGQoW>Z(#6$R=a}MxC2Q0wdVT^$a zC!dnH8sliJ?E@YOy(IK49Y6#gQ()6zMc#@8{n)w*SWTz^J|J~_6<6?O$(R^P#8V?+ zN5j^jp{)bNYOYLIm5%~mgDZdlP=dh(@BxX*$9H8!&S7PuA!kE>mjwvx7`hTjGz0Q9 zIR-0om**M&W2AX5I)olpN7oLhf4c)apw$7qj3BC@n#hb9NR~_zK&)Y)X4Izzc)JgH2`T2UyA=UOh$0M;(my1IgTlI=V8UEt* w_vvURKceOk@briNUl1o8zVGjbv++xZA6Wn#YS<1>Xgb7!3pi0002CwraKj001qKGBJObfHl+r00M1EL_t(|ob8q|ixWW< zfM>Q$noRbR!}iQU^|Nw4#h$ck-Ju`>|7gR*&^0qiwJVC zye3>3B3K9igOfyW-fV8y;>0Si$mZLfdEa|8lO>F8V;kG}FCpC3#S%A3(sB*7TKYSO zj_ZGks^vrFdLgf_uU@4fKXi=zJ`kY|?LKtXXO7T@mL-JSx*D)46c1=Z#&`O}#{s%h z%0B3XhHyDx=h5B!kSA0l)MG(bxCTc;5PkLdg*@wdB3B3xr91-NqA65&~-Hh?hpUeloc}OpZPSQb?|=-s83DlfS)g1)_m}W)SD5mlr7p2K*u){ z+-igUu0Y6-0eYk&Q>e!Kpc__?I{-w#RvH~;g**TVs30S>ZPVWdc*1Bz`|Wx}IE1#{ zpabebKxb?S@4Yt?+8?Nou@YX^2KbTizQL^YDF_;rmqNm-0GB4T_J&3SB3jg5ry+mg zOM_XQ-uZzk;jcl^OlgK5?I5Zh8Xa)NSLaQ{$`z*z%8WL`e97KP5OJam>v8jc%_(GGM$+#@MX&WX_UuK#(ATE5ZA>Q>W?DrAwDC zUHbn5FkinKfOjP^#thhih~!Z2LShVk{Z7yYe9;8BwM-z}g#ckL|L6Mo!PWtvo{ zXC=R4b7q_^i!mAj6~J46fkm`K6X2qHbWt;;W|wsrblzI;a4|n?&H=^bB-u`<9WHhO~|N&rRS+$R}DGAVlZ5OuP$n6N)DRbo?zHgzbY>znAc!5A6%^ z)*?~7Bo^pCfhFlpvhQ~j?x&v8fLf5spay+lJZ1lMzn2g{dgsTzaL_Lo2Q!ZPorGoc ylQQ3@HB5e}myqD$5A(l3ClbEz=Z3TTWx`KevmBLeG^=O;0000Xgb7!3pi0002CwraKj001qKGBJPOH&RIe00M1EL_t(|ob8q|ixWW< zfM>Q$noRbR!}iQU^|Nw4#h$ck-Ju`>|7gR*&^0qiwJVC zye3>3B3K9igOfyW-fV8y;>0Si$mZLfdEa|8lO>F8V;kG}FCpC3#S%A3(sB*7TKYSO zj_ZGks^vrFdLgf_uU@4fKXi=zJ`kY|?LKtXXO7T@mL-JSx*D)46c1=Z#&`O}#{s%h z%0B3XhHyDx=h5B!kSA0l)MG(bxCTc;5PkLdg*@wdB3B3xr91-NqA65&~-Hh?hpUeloc}OpZPSQb?|=-s83DlfS)g1)_m}W)SD5mlr7p2K*u){ z+-igUu0Y6-0eYk&Q>e!Kpc__?I{-w#RvH~;g**TVs30S>ZPVWdc*1Bz`|Wx}IE1#{ zpabebKxb?S@4Yt?+8?Nou@YX^2KbTizQL^YDF_;rmqNm-0GB4T_J&3SB3jg5ry+mg zOM_XQ-uZzk;jcl^OlgK5?I5Zh8Xa)NSLaQ{$`z*z%8WL`e97KP5OJam>v8jc%_(GGM$+#@MX&WX_UuK#(ATE5ZA>4w#pMfCn+^!#FAMoi8 zY)Rwj`L}iT%wyD0jEX^j2k@Q{nPXQ6G-(?xQTOlYGVjD`j&V*rg`X+s08ezl0^AM8 z7^pJ%tPWwGjk$fmBVm+;v8Mxwz;g<0`)lb^BC+fOUO0XuX8UFTQ>Lu?oTp1yZ~006oK#srSO8{`QIRR9!L0z;P@wOWJC>TRm2Z-mh7CG_;epz$K1 zweb*4=8J}U)TwE?_2|!a;4r8g%>XDlCCxK$gHieNZ`ob~hdra@|Lkb7P`r!I#>8GH4XL0SF9Y4Eer uO@2hvAn57u{J$X17<}LV4JYH520s9xK^f~qqH4AP0000pHAxT6*R7l6|l`(JAKorOC zGA4^(OoJReB(}s-F(fZUFrt(X5Ws>JDtTgIKtf0i2%&Zj4Ar}-W~t&Sd%Rd3lZ82a z7|uni-`PD&h>9t1i1mw~|G#&R&k_6D*S`Kw!QkqD(1L#n2?kb{I35h4+X~USStz@I zjzgy*AIElfaWun;{Ap(WK?J2 zjxjWU*bo*oKl;Mvtq8A_0iU?a!W*HxXb{R{#HnKw>i!VR1>eBMUFH2Xp^On@$1ZeT z18XeO!%;6~oZ!gq^M+m=zitvf{?1R=xJ{P_b2?{yXs~Gih~qxzLU?WrU~c5VWJq@h zpH;&6(qOSv4}Owj{4I_>#S^A{;&u{+#)64|KAn0*&NZtYXCYJabCodGLdHel@E-Fo z-uL)>MGG$GDHoV5JUa7#d9<*x4s_q{%D{Aacg|TrpNJB$vPbG25EqzS1eTjZ|AZ91 z1hyhQvmVD^Sy{r8NP%PFB5qu^(ohF9sXZ;xHR;JRZlqyrpCWkE6x268Kc`muErFiZ#l?~uB@x+D0qWURzV zKH#xy1tfLigD1Yt!nF>AqNBq0Cw+L(Hmf2-yIq+Au{%o zAe-+f>I*r=IHw|ieeVDR)c!pc>AOS9wZ8QLxULfP<*6Oi?U3l7Q=#4nS+l3m(+`IL zZykqPn(sh)-T+XKIy7vz5&f|a91eA%^#PEUb`?AOTwav6n*|W)x9uS8KkVv}!-Ky6 z8h9_UvAxYq@O1{;tT)M64;}7H&ndtqIHXa7Iw+nqf4&|;IfQ6^+!F_N*&NC^ss|2b z@;9fy563Y15s^cNhd=cHggD{wb^mTS8^3h;4iR(`s6OlN-2eap07*qoM6N<$g7&cy AQUCw| delta 655 zcmV;A0&xAB1;Yi97!3pi0002CwraKj001YEGAn;L4jcgh00LJ@L_t(|ob8q|Z__{& z$L~C5%K4g9;3dA3id3=qUYeE>1wMdFPhusNyf781f`J7g)UJq$Ev)fmbxT-S!en#}FJc;A+6$i=(H| z1jG^eS&pb+-TQisvW8=yR#;=ncoS23S_B=LXNfNP|o2?03E96ZQCe{KQFbASeREg+d!V*ws+56y9qHmZM);<0~Th+Rv(6n{ch-QCa zdZ#P{+=2Jkq>izbmsAUBAgNqRGy;i^Qg73TA%57;C-h)Lz@ywy0M}TB$H~vo*<0FX zm-_WG08Dn-|30M&##lw9%<5W$yHG#@TpPQeld80Ej-z;F`f;B+sU{9jx{pQSd>+ZE=zh=Zs}D*mUJp^ zV#XR-h}o=DwP?907thR`3iii p#6PvpEU7W?^#^g6Z6)>FegU_~oiqa*go6M8002ovPDHLkV1iW;H-i8G diff --git a/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal b/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal index 66317d4037..43b725acc2 100644 --- a/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal +++ b/graphics/pokemon/flabebe/white_flower/overworld_shiny.pal @@ -11,8 +11,8 @@ JASC-PAL 232 153 2 221 181 0 243 86 75 -69 66 127 -154 149 228 +31 95 31 +184 216 153 96 90 188 0 0 0 0 0 0 diff --git a/graphics/pokemon/flabebe/yellow_flower/overworld.png b/graphics/pokemon/flabebe/yellow_flower/overworld.png index d170322b186c8d3b7bcfecd3311616c80e22e3b5..b0f7a47f7a3e3d3fe2315fe4153ac7ed256ab1ee 100644 GIT binary patch delta 611 zcmV-p0-XKd1)T+u7#auz0001UMu)cm0004VQb$4nuFf3k0000mktH#I0002%Xt$sM z00J9HL_t(oh3%M)Zi6rkgmFwDO@Y1t+wN?j-PYJ)X{Txur)g?+Cce+%Pwl!>r%s(Z zb?X0%D17}Ih~AYXgwS9UGs8h{AqfFrzY|meUo-)2Z4=nG5HR)fzh6H;*goLX6IhG- z-pTLSnwk5kQj9`C2k=&Z5Se4s1hi;9T2u__*|P4yV~R12JcOS$#{dsZzyjP7#u%t@ z@F9Eck&>~t54acfQqZ?d01BMOz-GXTy*3H@XZt2#wV(ocht$)nxPos>#f4Esd}##i zXjlg{v`v6m!e6Rix8r*YIW^Dd}O5YGar_}6(SEFbLpwS+r;E?wY!icIr6|&;pV{HTtA@&i?s+Eg{uD&X0Rxqc0bSGPe4agtGaw xGvBAxOunm@5b*Se`Cp&|3E%f~!%_V*;U~sl9HI&_2dV%7002ovPDHLkV1j-}8*%^u delta 678 zcmV;X0$Kf?1>Xgb7!3pi0002CwraKj001qKGBJPfebMg#00M1EL_t(|ob8q|ixWW< zfM>Q$noRbR!}iQU^|Nw4#h$ck-Ju`>|7gR*&^0qiwJVC zye3>3B3K9igOfyW-fV8y;>0Si$mZLfdEa|8lO>F8V;kG}FCpC3#S%A3(sB*7TKYSO zj_ZGks^vrFdLgf_uU@4fKXi=zJ`kY|?LKtXXO7T@mL-JSx*D)46c1=Z#&`O}#{s%h z%0B3XhHyDx=h5B!kSA0l)MG(bxCTc;5PkLdg*@wdB3B3xr91-NqA65&~-Hh?hpUeloc}OpZPSQb?|=-s83DlfS)g1)_m}W)SD5mlr7p2K*u){ z+-igUu0Y6-0eYk&Q>e!Kpc__?I{-w#RvH~;g**TVs30S>ZPVWdc*1Bz`|Wx}IE1#{ zpabebKxb?S@4Yt?+8?Nou@YX^2KbTizQL^YDF_;rmqNm-0GB4T_J&3SB3jg5ry+mg zOM_XQ-uZzk;jcl^OlgK5?I5Zh8Xa)NSLaQ{$`z*z%8WL`e97KP5OJam>v8jc%_(GGM$+#@MX&WX_UuK#(ATE5ZA>b24r^^7Z=1@4#%UYG#<2M>5fDAcS0=$|#fh)!`R}}U*0yx*#0$$76DV*ndU1|z@ zoEAiwNCpDn>it~WO9akRWPXstV1e%iSkILJujM??vPVvTApUZJJx;64ihsFFBuRQJ z=Oq=GE9`Lu5YIlqq6V=AbHNh<72aE)a1}UXYZObOl?0kx0sv@_ssS5wn#e`Q69H_j z<4Xv@Hd){1h|i16yCFTkCQa7m5GeCxthEN)jUKf&5@0Q5JWUYB!b1RXOmPTb=ka>O z`hZldPn!6DLDS(x8aMJ=JtU6q*1cTxA)1sIts-SsyR$wW?ge6!c2PL)XqTCZ_aI=$ zRmS54MT@xCCyZ-z`Mp0&L{#C(>JT`7|5#~aNJS-oU7y4ac5+kUULdMMKi{Jm!v>rp z7j!FllpqA6&)q$C9E#`ol5pG~XM$u<0@OfS&Gi~~C~^?^(Z3mY0$FwyU5rYN5;Y8cUl7PQiWN?LR0?Y*$lTB_@95?@;LO{kd12#Ipx`$jY&?gu; zmZt`P@{S?%(wC)v&v}>fu?tlE5<>t_0~(ijm_%qMP=p7LE0g`w%8KI&Qwj_TIzEQ= z6VMvic&;^Y;ItC@Y@=NM&3~;Sechm2MWD_@9K7;vCw%i!oCypwo?oozT@vS_x`E5s ui{eytTnfDRv)twS?y|1cJvN{5*6|BEH#a9p@~KV$00003Il`d5mz5!J2oOCdWLk860l92_UM=!xQvScvnfFd!(UA$y6LzWI%`vLe0ea`1g zViOZcr%F8$iQm2apY!+;{{(9`P}I{~&KjOLUQo?JH+n9KZ0%^m7u7^;?!`2`k z_s-^;97;5OO&7<{VOjSlPSG|m$9g4)0%xa;9A z>7)2gl;`$gi-pnSxOo+XaB6??OXVKV%>rA_+ux%{)v1@`8HzA3C@ZEz;I%oVp4^Hi z_fsfVDAmncGqcW%C!~u{Caacha(M@8Hz? zb3*}B7nZHIiVgnO)XXb&dAh;ieeE8ja>T17Knmi#hnw}5C`4h{t>E~L_SOg9y z%qO#H;)f7X>Xws0R*)GzBn6ORx)W=D!m-t|ABueTl_Qr7B+mn9Q|85&5Bmy&IS--$ z{DYRijF8faLUTFKG&?L}JK`yjlnRuQ^rS71XPW$^>uJwF+x`G|U)O1VXk^g<0000< KMNUMnLSTY>Ns?ax diff --git a/graphics/pokemon/goodra/hisuian/overworld.png b/graphics/pokemon/goodra/hisuian/overworld.png index 5bc1d200c89793fc762de5f4840f0f5ab2524f4d..23f160b786b5596a9ce013173e142974a6c10505 100644 GIT binary patch delta 802 zcmV+-1Ks?%2j>Qm7#0Wv0001UMu)cm0004VQb$4nuFf3kks&^R0_90WK~z|U?U?Jb zs~`-8B_M1m@Bh4Ktzezq8b}@g>@(AJ#$G;xD-dJsvV84pU;8r_U^n^8`$c}!9U#Ic z3SFL33cubj@|*66D+&w>N9!}^I&tDA^$%CM{+f0=a-Z=SgaiuBW%f8nq#zMPqJ(4& zaX4{M9ER>QE?r-LS7-?IxF(n+4#LsMHHQ@wU%kESxM^h=kDz3p5G*TTm_bYpNcW{rwjs^@eo_hg_dhG z-KRWoT~etO$T}q$*Dml~;ige;mVTFq*7b2_(|yVX>yiouw#*_Y#iRN2y9$Wzyhg?eMkk`&w;%9!HsfV3AgZb=TRh@Y?~j=dug}aJX=O zDpY-4VY|S!SAfEh%ud4PsFQoEU{y(<>-uQR#)b(ZPaEKHTq1bMhMrpn&x8jziU{jW z)n=_)HOA*!sW)xeo?BJl1v(r{`#_33WcW~fa5DfXq^;)~{0V1{Z@WP3Rm=7LhOInK zIC{N*2Q8ZV8Nri}TJ{wSJl5xMmKp8XW78Zzx0}+hz!YrG2vneP6W9lc^1(&ShlCH@ z!#IFN^<$m+*MZUSBYj1m3v9mhr_SN|y9N1->WJQxS2><694Kl67A!2j}(6h(XE4r7a-`h>q=GwNzlG>FNGNud|Zc%1QT1${n(~ zc*4I!Fx`Dyq_59HoLdtBxmJiYVk2eV&S|V>3W(vi@_(F^O;ZW zrje0QmmynrEOy?Y)AJE_2QYya;0#!#-a;@nPTiiE7*)L~iU!H)bwg_}%{Q7w06hig zJ1Bz3rWEDLgE&h?k{ATK4$Y-Ty93abxk;Fs^JgU5+_9Ie#Sc)ll;|%&%Q=6I!2bCL z*CSYaH}HyZ5ro~m;xzjj>$T^JF|rT;0IAgAB-`o3TesSGaBx6{t=4}S(YC5XaQ@Nk zfR`vCyAjw=44QTxpn3;_QQD3CMFye`OCwf&!?xx{vn9%1QjMdRRX=9YdlX9_cXk{* zPp4>i0DTiuDM(^(2?Tq)X+nRrotYvE7$|PEJAhSqMqp#M%b$^8gF2}d937$o4a-T) zg~XXHQOVvfl+;`~_7#z@F9JQ@a2F002ov JPDHLkV1lU_tYiQH diff --git a/graphics/pokemon/gourgeist/large/overworld.png b/graphics/pokemon/gourgeist/large/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..f2184b2cfc5642092ba824963e6af6c2affac397 GIT binary patch literal 949 zcmV;m14{gfP)Px#1ZP1_K>z@;j|==^1poj5Cs0gOMVZp1Ga?veRXq?85MUA&;9E|YFEjX)aH?!i z|I;P)?3=KJKu9(wmybC^00009a7bBm000id000id0mpBsWB>pI7fD1xR7l6|mNAdo zFc^kS9d+iIyWlLnDnl;D4P0+Px`PbYEtvd)qq!Y|_tF9Bn6A@ROzqTe70XH2rJ(~= z`BAllN%F zSG#Jmm~f7(*=ts?*Ru5hgT;hyHDe<{XGrvhCX1nFw~~PoU@$ZqnhdNF8+I!gSPgww zO(qwhl6x#+g9^4{L%`stjA=e5TQr^yXt$I>z!;l=Dvnej64njLzBhCu?|>Pw(gaX4k?BBbI0aIs<>w)Aq!l1Pb>Vb^Xg3j1rk(#YxV)eHH=< zYiR<4_X5E0kU&-TJAT0yqah%dE6|FPu3R3)l5sD4&|CmVNrDxDjEe{DpOT3daH<3b zl)CWU<-KcB@no!o=Sc=VD%L3l{A8>N2;K?sg7eu}eI{^D_H0f0{M!8CzRnxQT@Z|@ zo3llSlU%@$LQOz$E+8A;tO8#RxLJ*NY>kE?@P0ikY(RQ^&3!s@bA|(Yl?%+Gwk9As z6A*PWBdnzaoM1Ax_5r;RqRqn=xnv*$23$B}NPAbAz}bwp*NQ;KQa}pNeC>Y;F=OGL z2yttUbDySl81hl^le4#`M1CLmb~h-&*Rd8NENME`;zalK>b8@jb&C*?@6aWNj!yl!=LC5 zEt{p>NF672>@x18#P^)ynCz^>F>=&n6Q&=&d{!EGlHJl3HaMZ;elN8N52zQ6L*!_u z_Sx~>ZCVV}9L{T1Km@1)BEVJ9)&meW0w7P!UXFNa?;PVRsxI_r0b}7p- z+)xL+Cf1Hb_-wn?1h(7n$_*!C11ngT*74xW=@EejI?|^%4!?{Zt4aZE3SkWXNdfR1 XMtVHO6&GWK00000NkvXXu0mjfL?)cf literal 0 HcmV?d00001 diff --git a/graphics/pokemon/gourgeist/small/overworld.png b/graphics/pokemon/gourgeist/small/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..f2184b2cfc5642092ba824963e6af6c2affac397 GIT binary patch literal 949 zcmV;m14{gfP)Px#1ZP1_K>z@;j|==^1poj5Cs0gOMVZp1Ga?veRXq?85MUA&;9E|YFEjX)aH?!i z|I;P)?3=KJKu9(wmybC^00009a7bBm000id000id0mpBsWB>pI7fD1xR7l6|mNAdo zFc^kS9d+iIyWlLnDnl;D4P0+Px`PbYEtvd)qq!Y|_tF9Bn6A@ROzqTe70XH2rJ(~= z`BAllN%F zSG#Jmm~f7(*=ts?*Ru5hgT;hyHDe<{XGrvhCX1nFw~~PoU@$ZqnhdNF8+I!gSPgww zO(qwhl6x#+g9^4{L%`stjA=e5TQr^yXt$I>z!;l=Dvnej64njLzBhCu?|>Pw(gaX4k?BBbI0aIs<>w)Aq!l1Pb>Vb^Xg3j1rk(#YxV)eHH=< zYiR<4_X5E0kU&-TJAT0yqah%dE6|FPu3R3)l5sD4&|CmVNrDxDjEe{DpOT3daH<3b zl)CWU<-KcB@no!o=Sc=VD%L3l{A8>N2;K?sg7eu}eI{^D_H0f0{M!8CzRnxQT@Z|@ zo3llSlU%@$LQOz$E+8A;tO8#RxLJ*NY>kE?@P0ikY(RQ^&3!s@bA|(Yl?%+Gwk9As z6A*PWBdnzaoM1Ax_5r;RqRqn=xnv*$23$B}NPAbAz}bwp*NQ;KQa}pNeC>Y;F=OGL z2yttUbDySl81hl^le4#`M1CLmb~h-&*Rd8NENME`;zalK>b8@jb&C*?@6aWNj!yl!=LC5 zEt{p>NF672>@x18#P^)ynCz^>F>=&n6Q&=&d{!EGlHJl3HaMZ;elN8N52zQ6L*!_u z_Sx~>ZCVV}9L{T1Km@1)BEVJ9)&meW0w7P!UXFNa?;PVRsxI_r0b}7p- z+)xL+Cf1Hb_-wn?1h(7n$_*!C11ngT*74xW=@EejI?|^%4!?{Zt4aZE3SkWXNdfR1 XMtVHO6&GWK00000NkvXXu0mjfL?)cf literal 0 HcmV?d00001 diff --git a/graphics/pokemon/gourgeist/super/overworld.png b/graphics/pokemon/gourgeist/super/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..f2184b2cfc5642092ba824963e6af6c2affac397 GIT binary patch literal 949 zcmV;m14{gfP)Px#1ZP1_K>z@;j|==^1poj5Cs0gOMVZp1Ga?veRXq?85MUA&;9E|YFEjX)aH?!i z|I;P)?3=KJKu9(wmybC^00009a7bBm000id000id0mpBsWB>pI7fD1xR7l6|mNAdo zFc^kS9d+iIyWlLnDnl;D4P0+Px`PbYEtvd)qq!Y|_tF9Bn6A@ROzqTe70XH2rJ(~= z`BAllN%F zSG#Jmm~f7(*=ts?*Ru5hgT;hyHDe<{XGrvhCX1nFw~~PoU@$ZqnhdNF8+I!gSPgww zO(qwhl6x#+g9^4{L%`stjA=e5TQr^yXt$I>z!;l=Dvnej64njLzBhCu?|>Pw(gaX4k?BBbI0aIs<>w)Aq!l1Pb>Vb^Xg3j1rk(#YxV)eHH=< zYiR<4_X5E0kU&-TJAT0yqah%dE6|FPu3R3)l5sD4&|CmVNrDxDjEe{DpOT3daH<3b zl)CWU<-KcB@no!o=Sc=VD%L3l{A8>N2;K?sg7eu}eI{^D_H0f0{M!8CzRnxQT@Z|@ zo3llSlU%@$LQOz$E+8A;tO8#RxLJ*NY>kE?@P0ikY(RQ^&3!s@bA|(Yl?%+Gwk9As z6A*PWBdnzaoM1Ax_5r;RqRqn=xnv*$23$B}NPAbAz}bwp*NQ;KQa}pNeC>Y;F=OGL z2yttUbDySl81hl^le4#`M1CLmb~h-&*Rd8NENME`;zalK>b8@jb&C*?@6aWNj!yl!=LC5 zEt{p>NF672>@x18#P^)ynCz^>F>=&n6Q&=&d{!EGlHJl3HaMZ;elN8N52zQ6L*!_u z_Sx~>ZCVV}9L{T1Km@1)BEVJ9)&meW0w7P!UXFNa?;PVRsxI_r0b}7p- z+)xL+Cf1Hb_-wn?1h(7n$_*!C11ngT*74xW=@EejI?|^%4!?{Zt4aZE3SkWXNdfR1 XMtVHO6&GWK00000NkvXXu0mjfL?)cf literal 0 HcmV?d00001 diff --git a/graphics/pokemon/graveler/alolan/overworld.png b/graphics/pokemon/graveler/alolan/overworld.png index 7ff3687da6b74526eac23acde7bf149df4865c8f..d1c9b50f17ee72e020cd673188203abea6c2bf7f 100644 GIT binary patch delta 687 zcmV;g0#Nfp7#0Wv0001UMu)cm0004VQb$4nuFf3kks&sJbV)=(R9J=WmWytr zFbqZUV?to(|G#&y69OSIFtn?!RAE&}&2f_J2WE!hvBw^J?6Jold+Zk(5r5O+hmAzf z1^N!Jo7dd+|J;Z*@Y(UM19Or@W@({y$p07qvJKwZW&f)=VEKPL|41A$%Sj20dk$C& z45}id;)+gS3UK3p97J{wNg$DoQN<*3x1V>s4Y0`5I4V;hzXF*D>KurLVqk$jmC%>@}G~gsWeH!Xa;8MiPP~l~IZ{0#krBSA>gQ zdx5b~OS5Qo2?blIcpG5J(kKyLIE|e~E4;^SMMGtAiQ3h>S&K}g zwP61mtlY(nMIn2^l3y2N3UK47;f`m4W=oQ~Zw=FqOV{T(!H$nGa_7v-U7Yz=;zpna zSo8h>vKW$oxG||~d-#f5itJ!0ME>C1PWqMm7y(SQB*~h@Nx(U$5}y^>F1pE68``_I zylYOAFPyB5&X}T6W*hVv^D|!4yPRb+ds&??%_&EQaBzh5WKM-P4*l+s(wS#c!c!+_ z2%K{?$Q1IV)!?`ADMyC>@Qn0R>R(4-&D#l<1&-B!l<)$$;2N}8aP(dA!8!->CVZ$= zy#Ow_6}k^Iz;gEYA&($NsDR1woe* V0)+kT1-b>07zqRe0002CwraMKE;fHoNkl^o z7)3UUL@jp{NvL+Gyn@}pFHjFz9R-2*0!1GobKjtQA1Wk8Qh!h-C{PqA;9I2Mo%DUY zBMHDc&T)=&{JZdiQ3A$)*?^7&L*`y*6aP%*e{YcOZw85=y0Wim20REmLHSfX^SggF z>H3XPkWbD1fQYamr>-TR?7fH_p%X+i&Hm@y3VPukhXC1n+_E)PdYfai>vbS`w|HZF z!H+2?gd-y;4K*)M`P>Lz6r?BuVd|7=o?Ani`dSwPb^40ga&EfE%ZC+_@!kjqxMlj7 zU?W&dTs@FV*B6{>zBh(4(p6FCGy#8oPMIAa1Z?DbQs<{RC$7OXCy?L}w}Q%0v;9H}Qq>Tl?GXITurX9eG_2QmL1l-o`INa$ zNixh~SUSrz*G!Yx3KCMtso1OJhb>b(^^D?+=F}Y<%|Umpe9qO-g%Jda+GBsYKKp@( zcuiJ>B@+x%LU9wK?5fA795LI0zlBl{yQ?>5Pfes=Q#`?Ph!D$tV|_l6#_a)k`vLOu zay_45U-d)QB%ffA!6zz&NCv#QcX}ZGbRAt@Z{rE}`8WQBRBonY2HuaSGGf7e$cvuA zQJ;!N|2Gcn1s=knLjkNJ>!j}Mios{JH`=-sBt*fawa2@%9E z@bYj#FR+IiR*t#5*y?g2bm%$)i#Hjf diff --git a/graphics/pokemon/growlithe/hisuian/overworld.png b/graphics/pokemon/growlithe/hisuian/overworld.png index f9cb0ef6cca63516654e540186a2a30528cd66ea..fdacc913455963d38df365b31b00df81a7c3d59e 100644 GIT binary patch delta 615 zcmV-t0+{{N1+N8=7#0Wv0001UMu)cm0004VQb$4nuFf3kks&{SElET{R9J=WmeF$S zFbG7w5*AjP|Nq_svgURY1e4|=Gri^^nfefGK`Yd4yW)x~uDIfgKNLjo@lOZ!9xBZE z$AemLk;06BI;gc4wK(J3#vHGZ@i#*p5_%-#8}}9}jCr=V>E4S$dT(owWSm(X*49l< zI3?#REFk26B2V=7Ws?&w+Z&(1gi9RMfJVpfIMB}kUgtzVoAW%aGd`Yvp*MW3 zW_`?2+7#G|qcG-V=9~(jr*+0hlC)Q{fJFr%M=AZEz-NUqr}13ht$)#@Su%d=n;wO~ zK_N%s*1)%lrMw zkK+*TFM!H&$R)ffZV8jG1NklmQ`GIaL`z(TgAmmhf+Ar;85EJ>Yqi- z!==>M%kwTTeRuD?7r}xqx#1qayLb8S`;M0b=(m3Bw|~~mLT~?d8|XfZ=c41P_Z)wK z4n()CdanV@(MGgFiXl%#d9_81o&<@soh2!yDL=ti|G-AEW0uO+O+Tvv|&T%;E>VrkIy%y z9jcyn*u+IQ{H~rsTnURm0;)w#s}pRap#2R52x{%JU`AX=2KH> z8s}}v(>B}=22ilzrVH)+(w8~M{6v%p<<7&smNbv6P+tq@QPRaNEap)XF$4oByr8yg l(F-eL-1_aR(hU8V_6uxz0d((~e4_vW002ovPDHLkV1k&dKWG2| diff --git a/graphics/pokemon/kyurem/black/overworld.png b/graphics/pokemon/kyurem/black/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..2818f3b943b86aac3721b008282dfa7fc19898fe GIT binary patch literal 1552 zcmV+r2JiWaP)Px#Fi=cXMgJ0j5D*Y3C@3&6DmXYeNJvOWR#sqOVEE_=kcfEitx8BpNQjt_xUiVB z%)995_&J#o2mk;85MyCZb^rhXAOHXWAOHXW000000AjiB`Tzh0a!Eu%R9J zAPj^J5s=Ek_kY_n6Hu_-irx0xZv9ytawE8ibBn!X=`U@6RF)}My2WcuT>t6(-hA5rSQ4|=&A1o&nD5?{J5D3H1jrn6V7XaYc#iB^76QVM~*b5 zLZO%J25@>ViXlPX@n8xCHVM4hrO&9L2uXY2D&I*0O6izw* zQlU*uS0iA>^wlCW<6-*(D1ol+^1`KW#w|qXO$)1S+iKS3oQDv4Rn! z(ZFWnAXkLUxH)EvfK1X{1&$Fk;ayGBSe&;R30l4W|wtQH?FC5Epo2m2| zC=zbQne!T0)Q8OEz!K;$i&}ZjZAKWW30zIzOD^ufv_T@ubT`eIqR;%4h?PcGnC7pn z@)xd*O4~44-VyZcdoD_brTJQ8g5174<@KdZ(Ifie<3WFgKk<-VC=5&p695l76_2cMVl7tXwdo0XvS?fIg;4qVsZ*RQ+UeHR6tN6Fx7KJN_MgK@e|G${DTAuNDcKI z7OZ<3+TRJcB9S#FE0YPf66^ooa?=-C>uIQjej_I6cHX_@$Pk{bGM0yvgR)5uqreGg zYG)cI(l%7cx)m=M%y_+pSckcKzr#DK4pnMgz!Mjb1ZSSAk3w5(z3HiN%BgQr({!kDQo_)6F>2VoxZQjjIImZ zcV9=$xV4DX2mdn1=;eQGT$_ofoF&Fq>8TR;qKTs$7VymNv}FAipCB;C;b&S{FFkcIpaO_a*(}XoXF*x{7bVED+#F1e*qgjJU1F5f72Gy=6>5Q9!aZ+GyRjU&G zjHWL%6E_}jJatYJ2R?p5g>V`bP8L2+aYGe);%L&Sv7Hu>7`4s=y0(C4ZZ(n?DU@c> z61f0G__YAzY2YPwzSv#^4ufEJbP8U$&y4*T|Gjappcg54rsUdfCq6znciOs94LrrV zwcR;%@tjZsrscC2TtL0TZ?Hqe#g(aSz6c|)A`S*B%KOgpEb&$%uRtF7F+8QBFL};f z%yee7q1WmBq~CibxYbJC(I(ZDsBWRmi$ip34Tu~E`-zjcYl#9^&&qHYI4?zF5O_ZOB8TLxmngJCL8aVIMV6(`ek6)~J8|&B z$Zw2|l~6x|;Df@Gf2MVIybbNKw7StxRGdV{=hNZ*T7Mz(*y|r9=$kPx#Fi=cXMeZAb5D*YBFe*MiLQr5}U|?WSU|{Iz`0U&YkcfEitxAZPkhrjzw$HxA z#L?*J_|vz5ga7~l5MyCZb^rhXAOHXWAOHXW000000AjiB`Tzh01W80eR9JsKCh=E8p$**2(uZ4)iO%!>6swuQc*)pDjz>y)H(s0KO<;;C zip@`3txL)@U+QD!YKVBegy50OwuNFtKR+_XyFjK{viVD0|RafktJvrW_gXk z6W8shdiO!!h*u-Wu)@XLwh67d99$-oyzY_uu$GJQS_98qH%#cC)s48>a6V13gw5hb zYx9@P@jgu#h)~@wbIbLo0 zsmW^sM||N?V{uAMb5uyp5&7HQ3r9&sUs%<7Wvw0c6+9a8I2HA@p85(=% zd*=Yy9Cv0xx(FO_XI)uomWq!pUb0k$GUS{Bf$_pRYXb2Z++Ua|I>n{>Lt__cSI@Oa z_?_2t#nH+XQlH2?ufJp$C{Qwo2@ELxT0A4({Yn2~YOa~{ae;T<1iFAC<(!OH)ZoZH zs(i#5Ni;_jOoWPAWc+gyhn zz0BLJ5}gm8BX}3Zxpre1aVrtG>WV+HSzO#icx_wP+>XitH-)ND7#*CIaZ*Ab76EQu z>XoBSv~{R21pe^Si_4AqA})JOhpt{PZAJJutG0$y&!o8gc2x z?5aLf=vsSoW8Qp_n>gf{Ak%z3XL_H0ZFXV-G1U7<$2ofD-w zwMk@#=3U@BcW7`tWqyOO$nf)5it{X$WrmBTm1B7_Sxuq$!d5fI&BZHDYq12$@Gp|w z8m>%n6s0JR_dtPx0-?}5SNaA99P{GcOiZA)$tE!UZQzyHHV=mcktz=P>4i$?I9%b- z9ih)zlVFA7_ocsq?mXOc-gLwSvNAY36ynV@>5(IajvQV2eCb~6z7SdT$n4~J7aVaa zaUoHfxrS914!0(7bdYf1>4@8#rLeR5!sCGrU-s{TWN)GejtzcXxmQ<@2qT^qr!K}aVROie0&JxO>U7}>w{5NzNyJ)bmll# w$j@IvztfwwCZ61U%6i1rxl>%^ZH-6z4+JP`$(5;aU;qFB07*qoM6N<$f@Rge6951J literal 0 HcmV?d00001 diff --git a/graphics/pokemon/kyurem/white/overworld_normal.pal b/graphics/pokemon/kyurem/white/overworld_normal.pal new file mode 100644 index 0000000000..0f6dd354dc --- /dev/null +++ b/graphics/pokemon/kyurem/white/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +238 27 128 +16 16 16 +48 48 42 +62 62 66 +80 96 96 +96 96 96 +80 96 96 +232 232 248 +236 220 10 +144 136 120 +239 173 74 +136 152 144 +184 176 152 +182 207 190 +196 196 209 +232 232 248 diff --git a/graphics/pokemon/kyurem/white/overworld_shiny.pal b/graphics/pokemon/kyurem/white/overworld_shiny.pal new file mode 100644 index 0000000000..922002fe5b --- /dev/null +++ b/graphics/pokemon/kyurem/white/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +238 27 128 +16 16 16 +48 48 42 +62 62 66 +80 96 96 +48 75 81 +80 96 96 +232 232 248 +237 90 188 +90 115 128 +170 45 128 +122 147 200 +184 176 152 +196 203 240 +196 196 209 +232 232 248 diff --git a/graphics/pokemon/landorus/therian/overworld.png b/graphics/pokemon/landorus/therian/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..0f3b0219572d506f3f7165780817ac3745ec2725 GIT binary patch literal 1265 zcmVPx#Do{*RMVQc_R8~}Ne~azy_QuB379|djRTtZs7xsgWS57O`V=>`SN+u;H_{djJ%79L>jt|ueu67EzRGF=-0}TI0@ZJJ>&6EIZX6rjFr@X9f@|3Al^UGj z-xaJfas~@Kzwf)WuRGGiXYYFabnF)R#PB|e?_fTH6Oo)V0ti+hd=73Snqjq%0xJJq z&J`rRo+0teahUKW!F2$4FkOJ6WI|af4AWQqfP=xE_daw}lU=~GD*$iM5g!__7Klk>bqo_NFf&YvU=j9X1Xaj= zi3=A%IkrS^^q~8ND|)yd@sXc)N*P7gl%`~K>?Zh-FmM{Ku>Ri(^n#18jD@*%@}q%t zI8Zs)Xuu6WU4>C(q97i2WP%UQ!juROQpDoQ2Y(WiP$BsiKSBsinnus!R|1cCH#Cyv1(U-WE*P2BKK|l7bN8Iwemf#4W#7~J3u*u}a z1h7#v$O?8T={s%Zd%SU!Q<_DmB<$sA7Q+s-{I+%|IE>1t&~s-nz;$}m(3n#l8K$Pr zzTs+v9JA7lc&v@kgg5i69?xlF$ysrK?VPz8JD>MGWxV!1FG}^h0T4E)!g`;_5jL0WSE>0YJP^ zBNPiC`k_Al>vJ4Mwy74Soc!kik~Y}-mh@2BGZ2HD z0Fb(@P(}MKwz-&H;=GV&sr-@fSAYY*l8e@;K1EzT0)&7ZZ1|i(3_T^kM;~_&oy44& zaa0{~ds-FEkft!W&ideKA)HE$-2P!a_%n@3T%C zi4AVA1i}=GfW(pibYo+HnM)(OS9-kT*9dY)k9{y_23SQZI*pm%1$2^YMf0OwBJ?m9Gd3xYL3 z-FcVgz`wwx3aeFY(Q9xaWT{FktRu*q$Ld#;}bv;bVby=_` zOROiTzm6^q>hrq*+j;bc;1!^(61ZL@`%m+Mu$e5ep5W_vv0D>-MmF=i*V?W<{g;0l b{}1C2!;3IeNO}xI00000NkvXXu0mjfg>_R9 literal 0 HcmV?d00001 diff --git a/graphics/pokemon/landorus/therian/overworld_normal.pal b/graphics/pokemon/landorus/therian/overworld_normal.pal new file mode 100644 index 0000000000..68ee7e89de --- /dev/null +++ b/graphics/pokemon/landorus/therian/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +84 86 84 +109 127 139 +237 237 246 +198 198 211 +22 37 14 +142 85 23 +219 152 23 +246 131 142 +87 78 43 +212 99 49 +225 80 74 +38 37 38 +214 195 61 +0 0 0 +0 0 0 diff --git a/graphics/pokemon/landorus/therian/overworld_shiny.pal b/graphics/pokemon/landorus/therian/overworld_shiny.pal new file mode 100644 index 0000000000..36e4944980 --- /dev/null +++ b/graphics/pokemon/landorus/therian/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +103 64 40 +103 128 140 +237 237 246 +160 184 160 +22 37 14 +158 97 23 +248 160 40 +229 89 32 +38 37 38 +158 97 23 +229 89 32 +38 37 38 +214 195 61 +0 0 0 +0 0 0 diff --git a/graphics/pokemon/lycanroc/overworld.png b/graphics/pokemon/lycanroc/overworld.png index e625ff82502fd85dcca867b122c78d110ff6fe2e..5b8ebcb1f6aa22d5bf381099cdb22f04f16f25f8 100644 GIT binary patch delta 801 zcmV++1K#|k4BrNjFc<(ZP)t-s^Ado^qK&wyyLht{$JrZu>3!u8$nf8a3Oq}>5_(+xncJ8*@ZoBQa|HXKB zxXypTGVHH87v3DM^B=GrVG|GL{NFo}Lx?eip+bYRFXS8*KXSm}pIauiu>(`i-g^;< zLs#LH6V0Vr{B?<(2Y;8hxd==|Y39I?Q<*EYxO25iaw5sIdjg%{5;vR}CL9GG)eC^sm#dvuW# z@iJ3raTI8UvV}sR1v=}gP%RFDC8I^*9_7+^V8T(^5*{~NWq&NL9UcN(k!he0BeN9Y zggcImv!OsBzMWUwDVNSfn3e~NjKxJ@VCfR8F&~?~#U1M!f#PUu#o2)w7l9HUxLD8q z!RD%vpKpOrKBthuMPbgVCTuoB$AKA#z8EzywYKuwZ&@tf<_C{WUhH*hi$kC+5iB<< zcl1vbauG>XLQUEyNEB~N-QrI6%09HcPVl`Qv&A7$ z6iSo^OFq4L&q0wSP4X>pUq}{TH|jjRfFp)@ZG-(3Sv?s2-Dwz=hpq$2iBxOS5R*H_ zVb8xhaejgWa;~!#-UyILj2)1uaPI1RPch=0y`;HzI(6Xa!IpoWx%&7A4|_0zgYBGfyb5gtr&aDzyHPGy>4_SGq0L`?v0&`uk)P8 zH^QAfX1vJFufBcz-nacTY)Rm;go920w%)}Q9sMiF|&@p-+rR9pnCr514rhh@$pzr-|5sZe09~y z&If5{17%{LC^2PPs_s#jiFp!p&VJ`1#SI~mF2yp;eCvvKObt@gII?=PpX|B4_hTMt zZ8)*0SUYjzrQ(Ehz6<>V@`_6)8lN@_eo+{+!|CQB!%s|ezitVzpzgwAQER^r;0WD`HsPE^2L@bzN!WMSj604i>9-u#js{oxO5-2w2sZ=diqVEVsbH;WsK;vIa!C&l*?ph6uwa2bl}RZ zY1cnbJNo$TuLoD21g;ONmSNiJ+Tj=S?#29qhYK`YKS^Et^kGlxM~kh>7dQLJw*_yi zl*um1E)2M#yI5I|^?!XwRLlgW=+)=%Kfay1;ElKFq?*8bwr4Vhx3-;btnSS@@^x{| z42Qonau07TKk#sM=+2Ao-51#JKDom#vu@@ufr@3x`+f>tUN+(J#YV~aucDl@wL)qv z%e4B<8_OPA6e;lT(BoN?ZITiFBFZTA(cTM{dpcK5dmh3SSts8;^>}!r;bZ?x7aA4A zC!SHgmQvaj`mt_h^_-IRGD){zAGvVb5a^rGg>IP_KK(pb&9_QLcM^Z&dG3>sU%SP& znJb8OY&W{$Kk;hw#q%c*W!RL-I`}P#n%p|$rAT}Fznh)HG8f)kML(R&(0k+tV{g}! zb^DI1y2TWEY`f^T)R?_b?#<8VGiUeTuejkX)f=?LHrGnJ{7&VA1#47`WuI6uFNv0T zl4!m1`mdKI;Vst0D3%@)c^nh diff --git a/graphics/pokemon/lycanroc/overworld_normal.pal b/graphics/pokemon/lycanroc/overworld_normal.pal index 87f56c95fa..f75ed7c8f8 100644 --- a/graphics/pokemon/lycanroc/overworld_normal.pal +++ b/graphics/pokemon/lycanroc/overworld_normal.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 -255 255 255 +243 18 128 199 162 141 184 181 175 92 170 238 128 128 128 -88 146 214 +255 255 255 85 129 197 141 116 102 178 98 156 diff --git a/graphics/pokemon/lycanroc/overworld_shiny.pal b/graphics/pokemon/lycanroc/overworld_shiny.pal index 03f98160db..fe310eee21 100644 --- a/graphics/pokemon/lycanroc/overworld_shiny.pal +++ b/graphics/pokemon/lycanroc/overworld_shiny.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 -255 255 255 +243 18 128 136 168 200 184 181 175 92 170 238 128 128 128 -88 146 214 +255 255 240 85 129 197 96 120 176 248 152 136 diff --git a/graphics/pokemon/magearna/original_color/overworld.png b/graphics/pokemon/magearna/original_color/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..0e6c49271e76189adaf001c3e726daee6590eb55 GIT binary patch literal 890 zcmV-=1BLvFP)Px#Fi=cXMVQc_F)S;yN<_nW?CuoA2dw=i}hI zv1|YU0A>!YjsO4v5MyCZb^rhXAOHXWAOHXW000000AjiB`Tzg|+(|@1R9J=Wmy42{ zFbqWzyRxlf^Z%dQD?w5SvYnW=Go7hOb|FWyul#13{@Z{1Ek-b&CJ~t?)`tO3JEsBu z;@i`D{b^QXDWwS8{mJP~P7KcUIX{b0+R}gJR;0*GCXn>@fA;Lg^)rZ8z-Og zT_Qc?eaLrxAqZ+wkIy+s3U*NuC%DV4p{+M~gsVOjE(^wJWrno5_Dx7BX_9^d9d6yT zeMY$Hv%*8If0`T(yoPMo>NT--z{cG!(5_9Jg%Pd-QML(8{tReyRFKntRRr{SN}`r( z2{t*5wd_U$9j*$$;qmS2dy9)Tu#9mC)bcULQ}TyUhfCr71%Y3gD+0QFA0lI16@HITzwYiK$c?pvze$G7oZfVHH@#9gY=FmpXBGn7_c)M0u6Axy~{Ev3#@6vO!ME zvd|#koLaEX?R3a0u;jv(Npj|=1LYyUbmEH_|H}kk)nkO6h&|4_L1A#qf>Fw4!EwnE zCF+6#2 z6FhKRP+#;vY6&s=JGH4qu*daqMKNa_HHmVLbQMS^KAn$a`Xt8V#>GkSz-4ldb6YJT zhTwOB#>7|6PGnj14Y%p0ib;H;%wR%pow( zYtH(avztJh)10#&*U?hAxjOVXpZIkd>T!5L8ze$rUI+O0s+w`x%j+o5qx|79-{6>E zB>2(|PQx5ye0$-<-^xzd=DNwOLbB>+Gs;o;DBnEbaEJ4X>lR-S#yK1&t)ylUH?_iV$4}k{_Yt4E0(*8dUh3(;>F}@FPhk=?Qm)W1 Qm;e9(07*qoM6N<$f~3NxDgXcg literal 0 HcmV?d00001 diff --git a/graphics/pokemon/magearna/original_color/overworld_normal.pal b/graphics/pokemon/magearna/original_color/overworld_normal.pal new file mode 100644 index 0000000000..5a44a54707 --- /dev/null +++ b/graphics/pokemon/magearna/original_color/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +49 44 43 +179 74 68 +203 98 96 +179 74 68 +0 0 0 +232 227 162 +203 98 96 +186 177 108 +94 84 82 +70 153 169 +168 161 155 +239 229 115 +231 227 224 +186 177 108 +0 0 0 diff --git a/graphics/pokemon/magearna/original_color/overworld_shiny.pal b/graphics/pokemon/magearna/original_color/overworld_shiny.pal new file mode 100644 index 0000000000..167f426783 --- /dev/null +++ b/graphics/pokemon/magearna/original_color/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +49 44 43 +90 85 84 +216 120 144 +179 74 68 +0 0 0 +206 200 197 +135 129 126 +153 146 143 +105 93 91 +70 153 169 +168 161 155 +232 220 110 +206 200 197 +167 157 71 +0 0 0 diff --git a/graphics/pokemon/marowak/alolan/overworld.png b/graphics/pokemon/marowak/alolan/overworld.png index 07dc3ff981a167dd8cc14a19ab630882e34be1a9..655c37491ef3cef51d5c458545acc2814332c1f1 100644 GIT binary patch delta 799 zcmV+)1K|9z2Ehi97#0Wv0001UMu)cm0004VQb$4nuFf3kks%s?FfdRk*s!4Z@H8Vc za6nKf*svI=h)_s~sDO~H<-{*f9WDR>0>4Q_K~z|U?Us#>tRM`9$5OzGj_?1rw=MVw zRd?rR?B5j=jtJr?eN{0BVC^BmBf+q>Yb%7fPg{xbypFc*CgGy_fy+;Gh0HN&d^)7-hh zA-L<%NVwxKhf-QSqGj=pqgw?!)4(N1?6`PXOg0HMkCsF4LpEvNv0J|D@VB`%#|MxG z>ow`)HIH=y*XPS29@%6E-k2hH97=Jp9b9uP&blt^Hx2B6xoN<6dPMlsHgLzc_%=sy ze6mSu^OOYF7`WlOf%k(xrNKIbw;W*~t$`b^BbG{=p*`Xi@B7s5;9=lN0XSG={tMh~ z@;=}ZmobHC>pO5OL0)k(q?!$4yyoi;%Zml>P83w3 z=nE4bmvRDsPCHJ9e&P!*B9XskeKja}{l;5^QLZI1oF|5e6ux3enu)w#|5e6QB8=c6_F d#1p?0e*l1-Ci+<<&gK9B002ovPDHLkV1g;7eTx79 delta 783 zcmV+q1MvL82C)W^7zqRe0002CwraMKE*gJPGfy&(LeuzpG$S)`M^Xf9I5530^nZv`j7Nr`S1MCT3P0EW3A9=;OC-DmKstfAj_?aDoL8GaCsN=2IMmK zgRq>*%d!e(2xU`QltG~;Lo;QVX93qkSY4P4PtZQxSygxp3N45uH@GY`iQzhrg{LMW zkxGs?6T{{nLa@Q-u;U7kTX3%iO{sr6$Z@|%E1G2!b#~-69@lZXlp1P|TM(KLC24Dr z<6#mYmuhk;6_96%h|B8Z)w7aRt_(Pg55UXL{$+CQ@~no2(i(>aRXW4hvf9h>a7+&f z=7n56-vwN*6TfvXAE@|~Xj><2KjKtCy$pBg0kM~5B8~ibZ2%7A`jFWRiUWV4wX2OL zEI>R;Gd5g$A(d7tT_r9DM#whvUqY6qp{^pvQ#C@iX`ndljr94u@2uheU}Ve~8u`BaSV1>O%?0ntSihsS|EpE|6*Pq{ntj7OwK zOaqI!Z6{L^%11s*VgDxp%kmy$~X%fyK99Tx98| zNx(4d{4FQaOn@xvq;A-FrSS0ZC@hKK@#Q$KhbG=?nb%enP@8 ze4G{Zd^W%kcolsY@xp({7Y6RkzYW|D2To;$g9t>5kiMTJ0z%>l`i(gq%4frhJ~6I0eo*bPB@ALvH{HL{^cXXzmW&xDBZK&YUFk ziggYLgUKPNP5q zxN&aSB*=Icq=aWcUUetSO+eGfI`Wcr4ts;-Vm!hbionE(QGsYWVpIipfaMLF1Sh=3 zC^NX~4q27kfO=`>ea$+Dy+PtVqDBuD_(cx<5`kzs;?C3pEN|FKm)~`GJYZ<{Giqy zc;-*QcE2T%W`=fuNsbo-9vxJNy+PR<S0yczim zZ!4a$cS0T{Vn<~;7hhgqDHYHB2@vsek!FTdcRJ|5S-E>VhoeEl(q_3i;=W6jCEl^< z*pf1qn%+4aVrLS4B>F@loXT!^m6un+Gxr*xoJ2khG3{7?NjVhCnbmHvy~DvEDpM9V z?1>l?kELKrqAvr`UwFa~mq%!sVbTYtG%J_?XP%@Vl^KM3*DO{fY0Wt)P2?%yHHaXh8GdcnlaqW~k_wDG%1c=x{VB@%vq_ zk3h6R9(9~_33LHy;1H;-5eg|PhroeLF&C~gV7R20quyg+8w`vN2ZP#Del>x2TgM&z z;W&Sgn>b5>3CA6+Txw|Kl3(t4{gnD=m{wRDI}J5|Bn|`BfXP4!>jf^jL;2wjnolY6 z1~hQCW8B>4?|AuR8(np5?iD@`pMb&OyTCgD2SIG1X?n)vA3Cx8~eu;*MPNw-vS>l&*g3LN7uWl<2LMRviavU vWX4`7|7EuZtPTDa_&;55`CrFw0X6Vn$HGw8Gj)4#00000NkvXXu0mjfjREz# delta 1081 zcmV-91jhTm3&IPKi2)?BiWC8Vln_N*i>d*I=Z|oc#B%4ZOZ3vB`)2tzPctF2`>!Q< z91aHS1Z{lLC;XGrhc4N=pQsv8_^0req;e8*a$OfKy7zou0+P(0ef+fqkHf)W(--*j z{e*;H_&6)*`D}n8@GAN);)VZ?FAUt7e;c?R4xGvg2N8%AA$>nd1cqXNlWIWED{cu$ z6zYYKQ+I5CjVBY(^p(sj);U}n2sv{|O!+)BaSEJs=oEyJhu#1Zh^!(%(cB%laT`$e zojFP773&-h2A=_v2-Ks-rfHT28lMetYCQ4OJ@q`zB7t<|7=9SI9S#O%fDlfpapaX6 zMSiLAGlZ%@0(xGtNq`A|b}2bb@uIuj1dVSkpkDFP%vhe8^$uqPr&Pucg(L-<@R&xe zoJN5JaO2#tNs#d@ND0q?yy{Mtn}DW|b>t=M9QFpu#dw4>6oH8mqXN-%#Hb4H0LvRT z2~K#6QD$(}9kMF70rk?%`s1z6s&Ne~FDn`5G| z>V8^o0@@}cnfE2@9F7JVk;if5fRp>xxwI3_)+u~h4P)^-TlUv z+kk37Gb1iftasQOgbI(B1D8*yHKG;b&g}5M;91{D*fSppXdL)pR$LO$fd+~>W&A`! z_(82Z@XVip?S4ytAk7Tzk{mAvJUXZjdxNq!$i2-@?s1u6Z1)8D*fq<3QSN;{EkBi0 zc{B1C-c~$g?}R)^#E!~xF220JQYxPL6CmQ{BFzk^?sU+9vvT)#4o8E8rOk44#C?}4 zOT1&zu_a|JHNA5<#Lgu8Nc4$9IF;S-Dle~sXYMsXIf;CK7-HJ7l5!}NGppTTdxwKT zRHiI!*b^}(9!tTLL|+D=zwm?~E|1VM!=w*PX;v=(&pb&#Dl-W6vc2rsbKwT3RV=)z zox$N?kYbR%4F~e261P9$5g7}xUP~T;EBEm`V-$#TS4~(nd7V<(17N@@fa|K%uvxUQy#2?(cx%N z;`h5;AAx9tJnA^<66gZZz#&juBNS3p4uJ!gVlG@~z;H<~N4>|uHW(Nk4hFTQ{AvR4 zwvIda!*Tu~H*uB%6OKDtxzy0eCBNM9`YH9#Fs-nEHg+0nNE`;L0h56e)(c#4hw{T6 zG@nxB4QSwO$GEx8-|_OtHoEHA+$($>J^_QlcY${R4uaT1)AWqTL!L*@b`1S87@Rdw z8+$PDIIIC9e-rrVz#%BC`f{R?Q*VIA{EJDXHujGxt^sQUzXd*Ap3B?fkFIx9$8Fft zWb@A~X~>Md{>yF+SR4E;@PE4A^1qJV0&3vDnaEJay5dxg00000NkvXXu0mjfmUq7kx;zM|9|kPTiEdic#_n8xD}O?vN+!y8aI z=@sts6jmFe9#3U|eb9RUq!ED(?re`oB~p9bb7=8!Wr%tl)7*TNeSkzRr8+mS<&ryt zgCD~KF1FJ`)8kxZMuUyl%T$lkMKp!b^EfwoOiq0a!(epOp?Hsb?dV|``gd-<&5oB!60Fpl;UGNsd5p2IKhuN(Kt?%4d7HyEbBQb{%Mf@Nfd&_M zXw;fv@#1NJa+9+K%<>|zWY|V|o1_8~jIs{y!*UWHSev9LJw^ zT~vL>_!=W^j>-g0V4V^ym1|16!;?^%_!gIk%zvTIX9%@%? z%BTzbg{`4VWWKzbOr5AW)29-iVxQ@>GNat+t=kfMxk)o`@l;;V;agJT22OTq5oEt#jl z2>c7qrVw9^8zt%aKIPRY#rPD_D35Q^6L;-mC%!1eZiP!jMZvOzRj(7#rPhT{ahj@J zw@Ud`${%xSDZkveE^67&xl46Us`Q!bRrqco`32T9f!vVrwSQ{Av0WTzb5X?X00000 LNkvXXu0mjfLxh;T delta 729 zcmV;~0w(?U29O4j7zqRe0002CwraMKE-!xqs!2paRCt{2)xDC_Fc1J>$rYt7c^K$y zNo1f@R&$V2)6y#S)m*^?;A`#;cudy$v#lt(qhvr${6+R!-j%(K{U86( zC@#3p$8)itGq}soyR_rU*w2YCn+wix95MDYhQ#RwXAW(4!A}k@T&OSDXbh%0?o!(wj*dP@$gW4k-o3i?ZUKP3$xq!i z4uRmB{qc!cdby;4Vo3)HZ_CyNEWnDZMatc(FpN6bz>~#fS;ItIwXWCIsk?ym(jio$ zVru^c&QlqV?skHf)!+t9%VWdJ@=3*vp!rE94%VVPc>5~YLct&a?I1-Mc0{_W9(O=f z4;mCDDywKd>uoBUb28{mHzFPf*eMfAjba8l(0Ct~86Z00000 LNkvXXu0mjfAOC93 diff --git a/graphics/pokemon/ninetales/alolan/overworld_shiny.pal b/graphics/pokemon/ninetales/alolan/overworld_shiny.pal index dfb053a961..0336fd62a9 100644 --- a/graphics/pokemon/ninetales/alolan/overworld_shiny.pal +++ b/graphics/pokemon/ninetales/alolan/overworld_shiny.pal @@ -2,7 +2,7 @@ JASC-PAL 0100 16 152 208 160 -91 74 138 +112 80 112 0 0 0 178 178 219 230 225 246 diff --git a/graphics/pokemon/oricorio/pau/overworld.png b/graphics/pokemon/oricorio/pau/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..16674ed09b22cc089cc80127897787de56b94e6e GIT binary patch literal 590 zcmV-U0Px#Fi=cXMRUcZARr*Xt(yGm*pPs5Xgfsjx4gKHkpKVyzln{qFbqW#f*nKB^!~S<9blWb*shS;ZW3Nrt$IKB z+u*PeuDIfgE3UZWioX#t@{->-@nAxq$0_leBCogbU7(wEcuey&&69kjk>c5W7w8qb zoV$~@H55FX9|FAt4i9mjdxCjZZqbwZr$DXH;ea@2{y~J{^`Ff*fl;ByX;~06;p8v&j0#;|YAr=R6ay|V>niIchujmW6?!~Cxxs=9+=}uDxcrDyoDd7#8spYR z20hLR+MU=S-J4>-<-5OgoDd3OGYYhMh{7t$Q__Z~n8&#@TYp+P!@us3HsdCbv9sDA z^HP4j>>lE6i!=PYL!|(d^9hv;$$;^cQOQ3C{ZY>LPVrBJO%fQlK;uwT;wj+)=aUL4 zr3x?QJxInw1WExG=SvdM#GS!B@n8J)rF_%m0-Ip$-{M3Rh+lGf%KWOP{{5A_`{UN; zv)@5SHe!O|f&HKh zs7F=(ZCt;8;OUYBPd$ePiN@I8%h2|BVq8E{RHMNGfZwFX_U=MYz{J@cOoOKNBfFEr c75uyS0ODjLg^w!s8~^|S07*qoM6N<$f;rnAod5s; literal 0 HcmV?d00001 diff --git a/graphics/pokemon/oricorio/pau/overworld_normal.pal b/graphics/pokemon/oricorio/pau/overworld_normal.pal new file mode 100644 index 0000000000..2121618194 --- /dev/null +++ b/graphics/pokemon/oricorio/pau/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +32 32 32 +192 173 154 +252 234 216 +144 128 112 +104 59 68 +239 183 188 +184 142 145 +0 0 0 +191 137 141 +199 132 137 +242 106 141 +135 104 106 +237 243 238 +230 97 131 +255 190 197 diff --git a/graphics/pokemon/oricorio/pau/overworld_shiny.pal b/graphics/pokemon/oricorio/pau/overworld_shiny.pal new file mode 100644 index 0000000000..4a3a9d46d2 --- /dev/null +++ b/graphics/pokemon/oricorio/pau/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +32 32 32 +223 90 124 +252 152 158 +158 54 72 +104 59 68 +239 183 188 +202 86 116 +0 0 0 +252 152 158 +199 132 137 +254 236 199 +135 104 106 +237 243 238 +220 174 133 +254 236 199 diff --git a/graphics/pokemon/oricorio/pom_pom/overworld.png b/graphics/pokemon/oricorio/pom_pom/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..42f23c505b5d918e1d81fd971fb88fea005b1fe3 GIT binary patch literal 630 zcmV-+0*U>JP)Px#Fi=cXMRUcZ0002=>O!xlEl4^g@ZfNvmPyyiWQS;KX=NL@j*;#2?pIe=?YFy! zXlnoMzx_wBy8r+I^hrcPR9J=Wm+O*)APj{Y60x)e-~VklM0Bf5g3hel*%|V~YQI1Z z2k>&c_2|)~M~@yodi+WNy#M??-{qa=;E(`-(A5*J<`UFMFgQ4eLk@J+gsb_i&vOFl z2^NRaf3ENezUmtQv;>m_j-|kepWrzq>l=BAkg^DEPQwyZZGJUpfy)fJdPal8aKAI= zgED@L69rfWLZE$x7MGmIT!9r<1vWVE?&s?fAFn4?XUO6d9B-_3iST}PfllzbK#T)- zuCGCpvqJ-pzye{!q3WQ{MIVi;!y|1Kw)i5DeC}LZV-}YRfk}#qkD=XN#n;^N`IcV{mfc{OO z$F0FFzA>pj0+WkFY{_zyD3^!1B+#mG^t3a$#rG!F24HfT(f~eBkoOR<;-JNOkCUH# z;e1BByFiPtCXr-JKSyA5aR~gBYw!W84jNo?U@Cm7zAm=-Y!a1>vz&6DAT?kvHwr{Px#Fi=cXMRUcZ8$eFd`S>?sT=3@j0001@=;%B>R;jDul$83oj*)tNp!UAP<*~Jg zXlh70B?+G%GynhsVo5|nR9J=Wm)+8%FbIYd6*1K{_kXtwL|ea>pK)`rvpeO$+IcX% zKoVn0U;EnEzV;tk&bf>KZ2@^02G1el-PS39vF8wR@d*-id5?f`WIRn1JJ6rI{1qbV zvB5h9z&s-i)3Pkn065QZlV1e>*&OH=0AneD#1TpvKlMfY6d1I~=KTV&l!A*~)z}di z9~#_ik<0r8jFccVxvEpp=g$zuX_3b}1@IJWm>i5L=<$m_yG0)F762oZ(?FeqK4+J6 ze4|A^?-y|4n!J#|9E=vlTxv`gOMuI(&$&VerV4{vL5H)z%=(D3!mK3V@dWgt0q`9E^DPr_4nX-GbClMKBEaM9klWml znUdcN9B?Wx1t_vd)A%dGPmK|80y8NTgRCata6aY2IlFoM_cL$64}rWu#Hdd{-c%76 zg;S=jisgZvSwAZ1^28MZ*(b2wrdym9PMD-bAg`K5%|7-vN26#zCK~#90?VAC2<0uS-BV!Pd#QXpM?Tv)(P1@TAp>BKk z%4}bnCK{{MpLJI7C40|16Kev|+EMU+BvMc@fg z2klJXORg8|t6#3T-eaG(#g1YH(=+?3bf5(qmZ z1fYx95kNv9AMl&kAYmZV>{<6Ob2m?kjSLuL^V054|MsMiC=M3cs=#Q>pw+GkZLI!Kq-}!UuO%>09#*fH|!@uNf=LPfo?Zj0z-am zVcNxuQkZkC83?g}CRN97+Ux%Gv^CXx`Gu(zxUG@#%2vaC0pjDpFVYT>q7XC%;PPYs+;16G z?0phgk!N{NV(sIZ{~`uq(bDu@D1 zZ2)5{*;_=tesrLs4Y;wFlZ$(34h>ZUL1%#AR|&N%HldQ?bur8UpC6sCSxQK*ciqM0 zrqo%(y?z-%65w4*nAS4{i4tlUfxZBRAAjd3fMV|^==EQu&q55ph_-_uX%X*%==J09 z@2a|S=B>6D27-T7q zr6mAIfbF(|x^0qSBn3!O(%UeDUe{2s|LlPR6ofi;OGyc%sLT2pe!xO>NPj^0uX~oJ z0Je7l_E)ergHX65wJ97)rjVfoI{n&4NuVaPY10ub1PyktU-3T%AWa$U?f_W^bHv~c z7{*bC?N|CQ4WJHSM7asTU=P6I7kmh<2*EQ;qu&)EwHrIZFjBj{lS~1?@$4syUz%wB z*B$&Oizz1Zm-;1v*1(aa$$x(M_W*SY^xJXnLX;l>${u<%TncgeFFOF%HAT*5#{fF~ zdkxb7T9zia*N=itDBg>HpMXa_oB2Y2yPnbRDV3>%bJ_k=h(Gy_w-#_4w#<8$RyDr_ zFyfaTROUs#WyPbcq(**DKlZb+-OSQT7jduw6u&kw=)dSB(pe(~Y=7i-Q}v66{QL%> zIl=hkk4C>+_)%L=@q)?>IiN$JR z7~b0UK}bqcP+BV81jqmY01$LiPE!E?|NsC0|NsC0|NsC0|Np>Hi$eea25Lz}K~#90 z?VAB}<0uS;Gr>XFoTLB$Z}&ZcyH0w$0hD%kW_fqlHl0d__kV#boZRIyH8nLgH8nLg zH8nLgH8nLgH8nLgH8nLgH8nLgHT8$2e|iA_xODLmnEYH)O-oXTiC%vHxOCqEVBbeg zbo2Yy754-O(;mmdz5M7QIbX5cbzp_AWVAk~%FO{xi4(M);{HV+6uTPj1n=MEyRQH=YDSwFvg@VF~+TV2t6F|9*lGlYxN*ung~j zZhmTaZ7W?n74=Xs_d)j`{~)D#;ido1cf3FcuHFgd-O&mJY<4 z^2PBK91K{*k~sk`V5G`|#T(k(^AfBQc>vJgSd8!!l#J_jk9*|O+08>(7|p!+di{Fi ziwXe=8Gktd0OQYi)#|^WV42G8rfeZG7gkig-TDZO@slOWRdGeOu)LAd!=SOO;Me|n z}!qp6117DtKHBFfTZiX^bi>2hZcs9F9Q4%S#w@tA#R}2)X+|Q z;}4;HV&vgk0bGOasg8IjLCj=j9pxEnFXySatbZKC(zU@CK3D2lTLziTZILr0$>@DwWA0*_@Qo~SO``xATC(N^3+d$aeNUc zjgloAqJ0g0{<{gv&HUHupc;X808V}^-Z|&ny54dzFj_NH`pK`4zwp?G=}O!;L~eT& zynpI@px`8^ES-on3$c1o&vcjO1WtaogO(eY@NL1?sWqHOsm4io<1ZVF=pv!0yx7{u z?>lJtRY#+_MFI1nIw| z2LMSr2srtffq7*KS@U9DOe$*a;=J)#zJG9RVF9yhws14`tRNpjR81s6=?cX{4Jcv+ z(CDF;A5&n~D}-;V+ur#`~BYJp)VeTWoT_;t)s=im{jZVT?DyIih&m#B`A%T!+*jC z0$zSavK9kb!LfvSjODY%_ATIvuK@B=T39J4I{-m8~$hPAA6XGJ(TT6D(R(% zUVf)Zn5=yv(8#l8`wno$3y9(NDSvVg`1^3TpZUw?v5ynv!Ic1%0IY#$L!ZkpB)xir z*URrT2jodnLNzcQ2dTzzU%b$3`p-8J5((7bwO)LjV0lwJZyQrYH2@kJyaC|Lv%Hhv zc@Fdsxuh6Kt~}4QFG5c|&Bo?I8*lHTkz^MDFF^x{!V$GBpr|C+0?^6tJbwl=kQUnB z<>LelqICw&cz6YHAYk2VCD{jH`$Vv#gcVq98*rY5jrJtBeE{S99v6 zmB1Bm_MZVTQP0Jl1Z7hK2#bBJh0pWwvS$Z*_#H{g8(Ur0~n4MyJg3n27Zw2 zy1I`bI%m~%0+5sk%I2#h{C|m`cJQl7iUZccZ@igeCx2hO5h&pY$-dDa2`WL`0zL8D zrYIhZJ!q8co&4$$I0Gr^aER{*;EONo-T)MmJ=cCi0%84@h41mpCe%RyRakX&z%>K4*>e^pLYFt4Er#!vxa;mIK}r3;kcgk2EHW$8koYr zBxw3b({p&`HxPc|=*tH9**b%fSDl;S9&%|9kXHdfrd?oS-|LA@cCOTfPMH;NUMC)7fVFSv`j!tGC-XzVVGci0Hp1{3)oEk~*LdcSwaf zbD#!uhyNTR5ScR5;`B z3UEoM4!HnPs1JsJJznJR3NVsRNrcEBq=6OHXHRwvEi?m3MVxPzLCtQ|)5Zv-B`{Y6=+`b+Ri8;MA zU5?&BDa+dC?Bm5i&Nanr4a#qS4jbNPT zuWir-a!m|>Y}hw&7kSIENVj7Te(D6*uBw0i@z7J;44|dhO~8RY1ANy4JCfAZna9UT z)ceCW=_71|8NZo0YRxt>u;L5X?Py!<$Z)sBjJH834@=J@Y=bF>PQMnb`~ST2t3kUA z;*{axv@~*dPE*q6wmlZL!3no>RHR=W7-#lPc3zsm%xuS6~m+>nyOBU3}D41qoMWZHeg0u<`J?Yg35)TD4l791CE! zQt}MkV3*?XN@F*E3a^7$mBj0)+kY1+fK?7zqRe0002CwraMKE-imfNklD7`svx&tfAMJJf{7GeuI#&_z!U7V*6%PSHZ}JB{ z3m#O?Zk!DG<*bA-m-DjY6&K85%W{8TY%l{eH*>wNiTP~s{1Ib!glMqhf;afl8}iL_ zmT(Ns;D_I-#0;6Wvw;pfCI&g<#Ref&{36IoKxFpaJi}QCFhx}+mU!Y~PRemg#h0kC zX52ccECdo{WHvQpam~IV9AdD{`BMy0@N;G$^q34Jyuf8TcUwlDViJRfvHO3tiebiR z;1s0CgDXRJAoYt9Q%m)Vqrw0`LBG-%=FCCXE;CRbA`c2*4wv@4=FqYG0qT{;FlP=S zm+38GZQ#X#Yip*C=f^3sjRw5IGgLH&D{ftrKP9fwslVEeMrw=IN3H-dDb&90JP}xP z)v3mAv#)(+y{N2-ENoNRL!4*A!4LHDWj5!k!4-YtAuus4gssKyYZZ@)ovKc>$)ND1 zq`x>E%9`k*AWos!hJe!WvT9(0cI36yAI03)&R#vljp3`UPFY VgmkJ-D8T>#002ovPDHLkV1gRZHT?hp diff --git a/graphics/pokemon/ponyta/galarian/overworld.png b/graphics/pokemon/ponyta/galarian/overworld.png index 683780312b2bae83528b1b921dae2d0c72fa92f7..1c37a3d1af7527e655cd759f65947b64d49b1786 100644 GIT binary patch delta 682 zcmV;b0#*Iu1>gmcLVxDoq{VH;L2+u;nbp0zy-3LD?&|*l003&<-g9w5Fqo+J^4=xI zr4|4H0$xc(K~z|U?U&J#nIwpuQ65kiv-dkSY90hUIx2-D&Sm~bd0=-b>WqlE)5 z57Q^A&Lx@gLw_NYtFKIWlANhlKLY{w6Zj=0(qMXxTLL+QXXlER8gmE)6F~~qsd3BV zCa7(LRpdd6jM($@8D+v%FWI6T1X zxeahk-N#d?eedQru^tbVzrH)vAj6kHbo!`|Uc5VOCkMM{tpx&S95;k(^%Ka4gP%Zt z2^vsn~frJx6lR|^DiJ*RFR-=IjW?YH{BEclV2d&LWiPys+{6~Zc zmWTV%*}KT4Hs2-!lQ-j!_43a8ui)nCd${xvaU+TSll7n6b?o3TWc)w&8zMU;Kv5P< QVE_OC07*qoM6N<$g5OU^?f?J) delta 684 zcmV;d0#p6q1>yyeLVw)Tx5aJ6L2+u;nbp0zy&R63?&|*l003&<-g9w5=DOzg^4^Wc zd71zK0$@o*K~z|U?U&uI+#n2uJcY=0`8aoTgvDMu?|#y<{< zSz|W^Ou0(5^-VYqn38`1Tz)Ft$y4BQp-fo?irnHj;0%M_1#tNyLNPKjECDkfpfAQq z;U35K(BuNRe33?xx1W)kAz;Q+sWH}C(k;$RC~}UL!WqW`Ya?Dc(rO5pa400`t7eyx z6dleR<;W~zTz`@oKNUtY^`!}4I0P!icEG^4fgeoF4I%fq8VCVA7*{kEpF@GeoHFt8(F#{E7$<9rlp>-uWFT=N%4 z26(xa0gkEXSPG@j-OM7E^P#fG_k`j&d^7-QrUiUX7#t^`bYtxCXM$;<7nyW{!$!v1$mM9|gA9~* zWN`$>D0s@VZGiE$z|Qz1!8Wkq2BJuz!I*@xe;T?+gADYz#S;jF3p*dQ+9TN?j|BH0 z5mrzi=0|6*B9m%=n+RO29)FJKPsaaVTr=$qlO>)aZn3{I{>{zA4!$Ad--%y-L?(TD S`=;Lj0000igP)& zArlY~5LiYuXIe$&ph@t`M5>mA!A>*Vbxq};Np&k7nL^4G0004@NklTx zBg+}mqO(BTBC-K6_A8EK&LD;^<{a5ja)z{BuV)aJb()7c=U`$3$yug3XGkZy^-etx z-Pp1=tOJaS=Emt7Qio_cBO1;TBI+UKK&s3qLUroOr9KsOji$FP3imz1L@{B^47v~r z*Sq@3PdFdFj)g(IN1rF!Y!Fk;i353T6A8?LtNZX;I4Z)&r$wX3~xCk{C zKgYXg9r<#FrtJT@|0ruS%0l5IE>Oj!wMMN;`!@;;gLy_7rYgitEjeq>B74P9PbFoT zZk}$G5$K!el%}9=iW@7qrOfDPm-jO1SJDFBO^zPJO$Nwz805?*fyvi_FYXATM M07*qoM6N<$f;}wk6#xJL literal 0 HcmV?d00001 diff --git a/graphics/pokemon/pumpkaboo/small/overworld.png b/graphics/pokemon/pumpkaboo/small/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..67542d25d92002659ad86d6c57ae3f75a2f79be5 GIT binary patch literal 522 zcmV+l0`>igP)& zArlY~5LiYuXIe$&ph@t`M5>mA!A>*Vbxq};Np&k7nL^4G0004@NklTx zBg+}mqO(BTBC-K6_A8EK&LD;^<{a5ja)z{BuV)aJb()7c=U`$3$yug3XGkZy^-etx z-Pp1=tOJaS=Emt7Qio_cBO1;TBI+UKK&s3qLUroOr9KsOji$FP3imz1L@{B^47v~r z*Sq@3PdFdFj)g(IN1rF!Y!Fk;i353T6A8?LtNZX;I4Z)&r$wX3~xCk{C zKgYXg9r<#FrtJT@|0ruS%0l5IE>Oj!wMMN;`!@;;gLy_7rYgitEjeq>B74P9PbFoT zZk}$G5$K!el%}9=iW@7qrOfDPm-jO1SJDFBO^zPJO$Nwz805?*fyvi_FYXATM M07*qoM6N<$f;}wk6#xJL literal 0 HcmV?d00001 diff --git a/graphics/pokemon/pumpkaboo/super/overworld.png b/graphics/pokemon/pumpkaboo/super/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..67542d25d92002659ad86d6c57ae3f75a2f79be5 GIT binary patch literal 522 zcmV+l0`>igP)& zArlY~5LiYuXIe$&ph@t`M5>mA!A>*Vbxq};Np&k7nL^4G0004@NklTx zBg+}mqO(BTBC-K6_A8EK&LD;^<{a5ja)z{BuV)aJb()7c=U`$3$yug3XGkZy^-etx z-Pp1=tOJaS=Emt7Qio_cBO1;TBI+UKK&s3qLUroOr9KsOji$FP3imz1L@{B^47v~r z*Sq@3PdFdFj)g(IN1rF!Y!Fk;i353T6A8?LtNZX;I4Z)&r$wX3~xCk{C zKgYXg9r<#FrtJT@|0ruS%0l5IE>Oj!wMMN;`!@;;gLy_7rYgitEjeq>B74P9PbFoT zZk}$G5$K!el%}9=iW@7qrOfDPm-jO1SJDFBO^zPJO$Nwz805?*fyvi_FYXATM M07*qoM6N<$f;}wk6#xJL literal 0 HcmV?d00001 diff --git a/graphics/pokemon/raichu/alolan/overworld_shiny.pal b/graphics/pokemon/raichu/alolan/overworld_shiny.pal index 1d2eb4fe61..4ea7665b8b 100644 --- a/graphics/pokemon/raichu/alolan/overworld_shiny.pal +++ b/graphics/pokemon/raichu/alolan/overworld_shiny.pal @@ -2,16 +2,16 @@ JASC-PAL 0100 16 152 208 160 -112 105 18 -240 225 38 +144 88 40 +248 176 72 0 0 0 -81 54 41 -150 141 24 +168 104 64 +112 40 40 151 117 86 102 68 37 -123 87 56 +136 72 56 112 72 40 -255 239 225 +232 216 176 44 29 27 78 201 201 204 188 174 diff --git a/graphics/pokemon/rapidash/galarian/overworld.png b/graphics/pokemon/rapidash/galarian/overworld.png index 1271349061dc62c666ddf986b32dd5e7c031a1a0..f81fceb9b0e598367eca18e5a57b10e99f0dd485 100644 GIT binary patch delta 859 zcmV-h1El=L2fqi9ZGSyUL_t(oh3!|-a^oNjOu&|)!sq}0+uH?S(!>HX%|qvAq8T@B zc7a`iWO})L;uD|v#67NW6Mi?YVIpu!csF8<@8G{~ATH}NQaHsY{^x}EA}$a(P&mRx zs=qb1Uw=S&KNRy{kz)M`E=l7W=}(hyU`F8f4EJY-i>Ts^s(*G8G{!|U^}%0O-@t%S zXN;@V{c)Eb;|D89zJ6UZK7WE!9|c06KmUMWm=gMuEWW}SUL#6K1sN_Wh{u}YT2LZ5 zB37(pU_h`hi3>8LoeG=bRiHuNSD-?34NPz=88s3uck~Yl7J^6$NjnN>IQ6OJtRV!= z*_=Z#!>hhEE`MVKU4jKpo^;dB7EEyH+p=oWgh%ssQaHo8M%CA^fe}FqW>3&pe1S6@ z6+()Er1+W3^Aa<>>cbfy74e9mlm~%Wq?PGY!<^wQ!D%&+Y-N_84J^$54R^Odc|_Rf zd#AKdz`TDjFD5<&B4LP^@s?nd1P>XMw=C2i(~L*?%<~-n47)w$UfFyzDK(%WBM5 zF6Aa-hI0c7N;8oNYB~vQ2EXBs14&kj86_@m9rp=!-hJOGa9K?7%G~m|HD)+lB=x6s zJZA$-HIQzcd}<}gubRb(7Nx6aU_db0cY`kWIjd?V8~=C_2V=1c*q(NC^Z~C94?KZ= z(x(L-f|G9o2!GBeTz6}`yvyagz!?t4QRdA@I_aasZ}>w2)xbA6g=mwJTiY>kC!EHU z&@z|q3O9QlH*{D{M>y-llKg|AbvrpkUb9gj&Y#<59|`UuV}hWq3AEEW7~?3gti(VQ zH^Wk~w6g&?w;9OO2!ZTT=8PvnNKg_S{S=60cH9}DPk(iLJ_lT#m2{ke>!a?%dHaLBrCIbW4yF~9{gxKGz=&kkN4fTb?J+Eef+iR*JKVgbnnB% laqo_QMEm>vs*e99{sJeVH7>Nun~(qi002ovPDHLkV1ga|j&}e6 delta 869 zcmV-r1DgE52gL`FZGS^aL_t(oh3!|-a^oNjObnKw!sq}0+uH?S(!>HX%|qvA!i<|X zyTGoHWO})L#%FxSXWYm2ZNl%4>oO5ICA>RA2=Cy(ZXm>U9Vra!8i)AA|D5pN2y0y9 zKw*f$I}Sx|{`u<<2=5O?fUgL#cJT;&^>Im<9_U|_Z(v5?@qY}@XNHTYB1cs_0UG0? znfl;At8ZXHs4Iq5dI>zk57r|2`gP6t{0UBd6bOC(`U8StN$5+`NzfTyN022IM7X3y zJk|`?f)YWBSh0?Q0l~f`L_|hA6*$AIK!d)og$m6zFu|>4)JU-0(LW^EvWTQ5X-DA< zr#`iuby*h8*?*iQnBi658sgYMmtYGQPr7O62qrl6ZCSNw!lQXRDV*Wlqw4F|z=)s) zt0(9yzQ7rd3L(WnQvA&2d5ald^&!VcMLZ%XpHSD`_niV`G{Gx#%is2x z;cSuApVIN14a907-8lKwN)TT)3jr-kSI@wJV6yK9UF>sK)k-%0@gfdJvoiG=9ADOm+lHTdmT4)SWU-p_J<|;2Se+2a)`KQqdw%H+hrdKZjv!T(AEUn zDG$at3M?xz(8P_fR4nam0M2a&@-#podz3lzNq-O$lmtgV1!9{WcLwNF-JbJ+yR(vx z9EguN3_&AOgzB9L^MwB4`CI~g&)y7}JKydGeEoafn8k`H@x0CsVQfP?Z^Y9cvhXXs zEc^(URyDZVdi%3YEohO(06Q6CBq#}s`x-fl1o5E*i11u8c*VqZcR6aEBrm`~wHBw- zfnJWu?D05P^%+(X63itu(TolPiM`w^;Z3qKdpE{Q`{%(Q?SzH{%Et43_ibPLB3>VV vulhBaLk->g@NnL{^B>XvIlrpoe;I!Pj_Wlv;>vKE00000NkvXXu0mjfLqet* diff --git a/graphics/pokemon/rapidash/galarian/overworld_shiny.pal b/graphics/pokemon/rapidash/galarian/overworld_shiny.pal index fa425be9b7..71b5d50d48 100644 --- a/graphics/pokemon/rapidash/galarian/overworld_shiny.pal +++ b/graphics/pokemon/rapidash/galarian/overworld_shiny.pal @@ -4,16 +4,16 @@ JASC-PAL 152 208 160 18 2 31 0 24 96 -71 113 111 -107 220 217 -167 235 232 +32 128 120 +56 192 168 +128 224 200 62 62 62 -176 144 32 +176 160 104 245 243 220 -237 237 137 +224 220 175 255 255 255 0 0 0 -233 217 173 -248 248 208 +224 220 175 +247 247 228 232 232 248 230 223 160 diff --git a/graphics/pokemon/sandshrew/alolan/overworld.png b/graphics/pokemon/sandshrew/alolan/overworld.png index 8b6c58a6699a2bf44cd7f14b43137f4cf050c129..1ca8f0e17d3325ef473897edcb6ce9c3f67668fd 100644 GIT binary patch delta 473 zcmV;~0Ve+81C|7k7#0Wv0001UMu)cm0004VQb$4nuFf3kks&jGph-kQR9J=WmfLOv zAq+&|P-^NygXyfyIPl`yvTSwPR9VU%cMphya2^b{)nXQ`pK;c$eS;a7kRdHDeRu|9&hJa= zIt=-oy^kSfng%nD1jMtH$>bSGxO`{X|59fh0b>lE6fZ%4$XULUsFLM~jDVEmclZ;B z)k=_YjbS>md-eWqLoR!t7xQ&Wnmhb$@DA6QNte7g3fU!u9J9qd<{ZrC5#=0>mD3GQ zAmSn#O`i+oTolYuz%e862Z#P8d~#>Tu}+#BT;h=t6ni2t`FURmgEx~Tfe9;bMy^V#9Xlm P00000NkvXXu0mjfea+U* delta 420 zcmV;V0bBl-1mOda7zqRe0002CwraMKE;E04NklfG)b| zqKp3%y(Ipn!+e2L%;Od(8I6+`+xxwY2hIekam<^ni8u6w%1dZ55)sC{k2C-$f<%7- zydhO6a`z4Qb_?#K#S=l)2iEq1;q}r>5ZZR!W?EA2EP7~&hF3IMmb{xKuy6ug^+yaDEC3FS`4 zz*^4gjdnT=tu$7GH^AUhsMJ}M!P;|_KG(0_CR*pNHEHDCoNh9eKO?;-MD5sIeD2Yd=pVi%m~V3_OgkC7 O0000{AVrPj1&DVh+pX){w%Qg!{3dADdA?ES_^1Vj6)S63GHvyOI#3G z{IOCC$R&rHa~k!3=$0V5(YPR8<3+ayTVI1DNRiw}cpxCI_jI-q_ExJrC~gDV1yW4flmn=EI=pus7p zKPyWews`#JNxTCF-@`>Q+yZwl=UtOX&S-J$kzGK_4w>>1FK4AYHXja4VO1&0J+k=G zBsjdlndPn4r0fuj^D0|~!&0|$jk|IfyujICX?3egdW-M%YpW^YLknPV7k7t6+oU=t zu8RS)l_F1nSc4y`G3ChIZ=kciichAMDa9eEk6A5W4iL4YNA7n6a01f>m`c!$l?(u;SY~%?2{Bv z8!a20J4E$cWQv zM^!$>;5^Mq!Z-Kr0XT-JfOX>*EE9;h{u4kgGK=~II0COhKMhq zecz3GkiWby+8cF%^XPpn;x$6ZVVqUPKp&?UBE>*x{CyWRhsZa0o+RL1{1A#Xe9O*j z9BdfW0*ru8eIXA!AuS;qv7zqRe0002CwraMKEt8 zUWP_UAr!_;x(3of+Fe2}J+y_M#poD3iGt$I5|M%a0T%y<fLYTbBF-Jq2@62;O?| z+W(-lsNFZanWfi4AA#kwJM+Gi{R!~D{-z!p8>=1HVqJurEe%t0yJbAvgid!|&9MIE-%htKZp5Wraa~3nr7t96GVdG*1GaVNdc!-)7wq$EBT<6)B6dndwz; z&1MKz-NilBFlo9gb!~8~Tal%2wT^4WaVZ1rc~W-v?5_IS@hMBXB{z2EPCPtmfEgvF z+OivTpyXD2a{t@L7FZ4N;N+2f#_!*TWgzKz^N*7c-5IPIT-)x3SBuA1Cxf4M$6Q(pUi$vX+db^rU1`ZZc{!nED1 zDj)k$U^`A2)^2(oZZVWYA;N$2ctX;-t|!}T*ezMZPf{ZstDB!ytDW*NJa^HG%Haf? zc7<2NH)7Wl*g(fMrBu^u7%z>hXgv6h`39b^RG@m;hizrthzsgXTXCz&u-_Qs@sn|V z!jRcmG)KrIUySf^9rd~io1}U+^1T`oOM`Rl{ATtb}6Xa6@gA%gd6OPIk zn0j^@tyuus#sMXUzc)ZMmY*V*IM9j_aLJ4Tmt4=dz$1)?CT`34f~1ao+ZZ6A9%PsT2SJ002ovPDHLkV1g5CZ;b!| diff --git a/graphics/pokemon/scovillain/overworld.png b/graphics/pokemon/scovillain/overworld.png index a0dcf404339449e710fe9b0caef6d2b0ff5c94d1..ed7dfcaedc9b6ae55f1af184e552e0bc06e7ba88 100644 GIT binary patch delta 1280 zcmV+b1^@bu2)PO&iBL{Q4GJ0x0000DNk~Le000310000W2m=5B0Lph(){!Age+0Kl zL_t(&f$dm}a_cG#G_h=fU-|#Py(@uj-cEbxoVhbMBxyTdfwZdy+782ae8+cu$9Mb( zhLQ1CGHo*cN~WI-^Lo9;u`R(*^yxC(wrQH@`Hw1K@@h#(cZ%?rPlM!>KGEni+ywix z3K%n@*4JGv(KMr`sUv~#Qvn(Ze>~|EjXpy~749ieG^}W8XM&MRNBO+`43d1(lxaRg zisek8-*C#4J|8pG#35kIpT`Z8kgF1Dsph^Tk~-54KMGJdMCXiH@kNri;*DIA#}>GHRGG92~-Nemhp}R@DJJoNOI3_4&tVT_w{*X z7@-OaK5v&mDM8^k>j(^yo?bdg8RY_H9Yzn(E$3i@F$jRc&Ph)c&m7`Ax4^j+=*!B< z2~_G+lYp8G1HAfy0E26Cf7xyW!~|)&Egl3Q@>>MoO({^>VX|N=4mi&M;LyZU)gdzQ z^SYAS+tVZ$b1e07g#<)4xk3Xl;DMNlLFg%hYI(A{C0RDh8zX@>(p zkqi#OQxD5}kwcXKx{T^1pL*8yB6hsy`nW=XJ!iOb3bVq3LnAXSe``=6BRH^UC|`X5 zkL1q?8hI!Mx;l&&s~}NOExuqq z9#&eRl+m0+L68P=JT1sW%XH4?altuZmQnIjAyDWrgOml1FXXSeJGowy5zetgZkH~? zPz?n=Z;IX^i9S?ue*mQn?-mD`)O4%S4VBD|2s*3`hEQ>(NC1OrSXJ`6QXt=9ZL$bR zdK+cG3hV6^@Ns-44vG4_3Vq^1Tyz84tVADM5x}MlqZSAF#YO`%ZzKdQUXGz1M8AX1 z2Tt)qptHlQ0+FOGer*)@U%1H}68Nu+(nn;4pg#z_K2=y1e+Ud$uEOZD1|;6lrDell zTR3awjUJ24i9{IihsT*DoT32j@P)fFy)JU&xkD6|jzJ??&Q|U@F^Jcv%0Ez4hDD2g zjiSKINRrqax_0QW9IkReX(d^8YC?|}4jIl4JAKvpCwS)%3x7uxYj}gmAyvn*`o7C? zZn)Co8*h}Re;wYes6@8)XVQfi4!Lm9>(1}uzLe8uMg4%A2)Yd5aUgnigZj zs@7U$s8<-_g+l_4%ME8pdwv%WBiQW6IBt4*x92_JD9~+?*5Ye}z#|TBc+oHMt5UI9 zYa6w3rs~o0F)kHuyK`=D{x|6nr`_SjO`H{{hyTTFf7s#9a&x~{aQw`0H}8$5pYStG zJc19`GZP2ACF8%H9|mu_)As%N7(Z|%$+N9toF_aKc`7 z`2latzt=gq!@r6vLq3`-KjERkHx}jNeKZIta&!a&LvTEr^MULd)hh!BGV*|B1BRQA zH~Ns`R#;l6H5EAgv~FTgojUh84PAjy1#0Nc2i_Fuj(hjdK&l2Xz1!!;8Ss#}v3aus qx&l3<0N$P-E%cj!-_82pkADE$9zf+JCm7!V0000#8@DkSN{KRyOIs~flZra+UZPm++Bv1zl41CXpZJNN_?9pd z|C+=X!i?i+ZCk=$)o04pNTXXK{N>#s`KIqX!x)RT#(OoQX`XO(BnUqh&`|KEuZU`3 z)kr%9Mpm-&9zzAq(<}n;b*5D9e@vv`aOzE8-cbgIxCbU9)!I8FTPL6JtANTOt+D7h zlC1mS)SJGHAlQh43G0SjppsxslwS(W2}&xlwM=nbl1)5KOtW^Z1jd?^|2&@y|E|7* zVC*7|=#;N(;>$b8Xsl+&m|f6Ay7SWMVh znU?o3!A1cH_MYSisvQb@V8IrqNMAZq zNcpdeRVTyJv-V4d%xkI7f9C=cf&&MJ^2wpvQaB@Id8h?m6UK;DkQktQ{Ca5V8KDHv z9Ks5WOAMW94hNNU{xGP}m%#}^8p!jsAdi;FUlJCa6SG*Uqe@_$FoTo>jt>ft$!mr1 zm`!j_9lEk;5r%3g=5bRD24(uFP;e3SK)`S%T!{d)8eCTDd@V3ce^`es10Z=W+u~0N zefmY*+A(t|ne!_2i3f4<2E?FTpDP4h1RY+UmleGhz7ygNuXrW!oG`0Ee95uP$qll5 zF5DCjU2|6Y$SerPg!R-{!EA(}Vegz=n6b#rBqHEXz?meSk_4Ubg?k>JBEd_Ct~o=a zv~v%?Z^fXXuaG zF4xv*ec_cu7Y=&e`Ys-*oHm#D)u1LW6W(ywIfsnr6%xF1DB^fH;taLxyLgOf^C$4l zZ;?r^)YzUox1PGAL4ZE2ln>&fWY?^&0A{QMmM#7SBA8>1N9xphj?>T;2!dF;R}Z`? z@Xq__pJ8exC~#x*77e-rU$_Bp*C&m>n(!aRFEA-DY3j+KYybcN07*qoM6N<$f}}Id AP5=M^ diff --git a/graphics/pokemon/shaymin/sky/overworld.png b/graphics/pokemon/shaymin/sky/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..0ef9f6a09d14a151ae1d2c0f2ee57999f2b9eafa GIT binary patch literal 829 zcmV-D1H$}?P)Px#Fi=cXMVQc_SXgkd;9z*DFz~O-VM{o{z$hD0Q~&wbx#I?X}lld+ndGTFsxs%!BFp zg@wTX!u|cP6F34j?p9Mm)c;=@g!W_OA_2S#Oo3NkLMWx&cu#{pERY`H7C;?3AFvvASK4O? zymQ7=0niGFT7aEjx#>X9s;}zfkYM1menKf?KxBRM7V5l+O`DXgR8?r_huZlp5I+Jr z4?p3EDZrKA98@4hkBHKLvq0un12jRE=)Hhh!O4RwkaI-qeH=NC`gx0pM6@^9hhv~F z;oSkdLiU&wbb%K>3X}-7V}9P|3>R+bll6&`%RB;&lY_(>Jz9dK3pA%6`7D7J1y~>i zOWreY%Ol~7)dA(?;B<%+KxzqaUvo@^~#uXaDUGbUYv>pd*sAQNV>8 zaNl>W&z#Rkr_JQ;Lf!{ z)+V6SA&>;xoA~5LfmA@o`E*}B_9aJX;ZyPoP#(N3EIvGfNuQfTx#6($Yuq7Ee_nHm zPB>Wu;=)7l) z%E4X&S~xyj&XA!Elvi9sl#*pHI@^f(aTNC|Tj{z0?uB{l*AQmKp# zivsBct^_{Dr+XG(bDS#q7SwFL41X8!#Gm8WPoPI7|A+koYeX&F$>_Qv00000NkvXX Hu0mjfU$b^E literal 0 HcmV?d00001 diff --git a/graphics/pokemon/shaymin/sky/overworld_normal.pal b/graphics/pokemon/shaymin/sky/overworld_normal.pal new file mode 100644 index 0000000000..81840ca696 --- /dev/null +++ b/graphics/pokemon/shaymin/sky/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +88 88 112 +176 224 96 +120 168 48 +240 192 0 +240 128 168 +128 128 152 +184 56 56 +248 40 48 +48 152 72 +232 232 248 +168 168 208 +64 64 64 +104 128 0 +40 88 56 +0 0 0 diff --git a/graphics/pokemon/shaymin/sky/overworld_shiny.pal b/graphics/pokemon/shaymin/sky/overworld_shiny.pal new file mode 100644 index 0000000000..391cbc1791 --- /dev/null +++ b/graphics/pokemon/shaymin/sky/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +88 88 112 +136 208 192 +80 168 152 +240 192 0 +240 128 168 +128 128 152 +184 56 56 +248 40 48 +48 152 72 +232 232 248 +168 168 208 +64 64 64 +104 128 0 +56 104 96 +0 0 0 diff --git a/graphics/pokemon/sliggoo/hisuian/overworld.png b/graphics/pokemon/sliggoo/hisuian/overworld.png index 511b750d83cc9b553cce2238c32b5b4a48a0d82e..a195d8204726fec4009b36e5b94f0c5e18cb0e7f 100644 GIT binary patch delta 608 zcmV-m0-ycp1&jrd7#0Wv0001UMu)cm0004VQb$4nuFf3kks%|0V4RRZY+wKY00000 z000000000000YQ^g#Z8o3Q0skR9J=WmI050APj|-Qb7Ly55BgdyG-bdy5x3=HFL)A zt-Ml{P16%kJn_Vr1oQjFIlkQ=VaRU=r`!g}sW$}Ta^D2)>pZ_3A1ENPgCXB!phH9c z9R)C_bd~c;cqBl7TnO*yE4(H5THtds$cg@j6N^8R82udZi89GDNi5%&_(YU)&S~tx z<&>F7p71;z-sh`9!EOOAS9{qkUg45f4sB6CKjNwofqg~=K;GgKXPshO-Tf9JuIp>d zKX?lvz8k#4S*O=|K_PArc&(DX*8Xb-^P2^D%MWuKU@?P#%g_Me`x?K(?-xLIH&}Zr z%#&G^bL|!2bI#Q@h`0{0)HXwP=^8{_4X!aRaLCyvrVbZ5;-*=oO@+BEgPj=hWZUF$ zt9Q8>T=empHBNJhdDfk>NPg-H5EsF08{Htk&t;R)XN-A{8V3pDl0L-9)?kh?T;P&< zw$yUf%MUnzQPD?)o8llr-2BN3DaAwwhnR=epUqD=&DCN_IdD_Nqr~OvFV0*vtV?e{ z$2>H1tI7A_5jTlAWb0A40-vt~P+>V}XaI0)uJ!jcR|(17Y(?4-bb`wO5>)K4>w^Kz z;}+-nYLLTLq)841c)U3z`ODhzhxvN<74L6)#LXc;yAq$@HSmc70=W{v={N2CVa1$& u;q!d5jlz{6POs>thkODU^3SCBZ}9`wEFS6bknREi00004jvcX{!4Wf0agvy{hdst(L-R0P+)NXYv#vGsqVf z_Nq#bX>#_LYlM9i01J;)t~jXZoWiH#WEZZr>GCQzFRL(@_{akfn)1JrMSy>3n-agi z%z}bj$ph5}>W9R#N-YYFj9Wj<$=m5-36SC2=T7w{Rheuxed|NV38p0$0U8~x4xu@} zp+NdU58J#x(J-~WW!2(a(oa-t1qU@8owU+Zsb$ptno zI0?{r7|qtn@O(bxf^XC{4WfUIkd+%qb)TJkj%`iDg2ktT-sc%Z*A{7m4Z6nItdV%aN3ANUOQQiBcGYEcoVeW}4|&tX{(tQsf3{~z6{RZ;00000NkvXXu0mjf3v5iZ diff --git a/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal b/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal index 66b17f5ba2..875167548a 100644 --- a/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal +++ b/graphics/pokemon/sliggoo/hisuian/overworld_normal.pal @@ -10,8 +10,8 @@ JASC-PAL 189 148 205 222 197 255 139 82 139 -0 0 0 -0 0 0 +96 156 144 +64 108 96 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal b/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal index d9dcb3cab2..3d0290753a 100644 --- a/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal +++ b/graphics/pokemon/sliggoo/hisuian/overworld_shiny.pal @@ -10,8 +10,8 @@ JASC-PAL 189 148 205 222 197 255 139 82 139 -0 0 0 -0 0 0 +170 171 96 +134 124 71 0 0 0 0 0 0 0 0 0 diff --git a/graphics/pokemon/slowbro/galarian/overworld.png b/graphics/pokemon/slowbro/galarian/overworld.png index f62e2b3bdd8463de15f83630a7751395809e1641..2aa367992c28d4f8f56c3b4cedf7b0a7a46da46b 100644 GIT binary patch delta 1052 zcmV+%1mpXb2+IgAiBL{Q4GJ0x0000DNk~Le000310000W2m=5B0Lph()&Kwi0drDE zLIAGL9O;oEKYz(dL_t(&f$f;>mYymMg-4=5u#WeCw`V8#i2?ea>5q0Tv)XCbJP7Wc z1ktarH{N*TjW^zSn$Aicr>JoeWFNmLHkZ5!oqdlg_&vCtbY`_rO7q|J3 zG6;DzX%HlS&i5r~jE$S@@W32e8k-#QMvaQZ4ktGq;eRXxIy^5SMG`tiR_92t++f{; z7DsmX5_PtKHV-lG`l6Mi9+xFxF8;V!^QXg+V9gMZ6$hFe`Q0--+6J_F45z>lKj+#c zqHm;VE9~)H;G%D2(}6ZeZ|xb5b`Q5XG932=KQfG_Y4SXSrdM{E|HmOPjI9!A^GK7| z6gxkWm4CqwZwMsfnYsqhIysLeBBr+n^tdFLMvmh!jN@uGVVj4^doTAV|5%r|_?F?g z=_?IzoVdX?coE!f4Xy@cgTYr6c)FEHkLwtyTE%4izyqtSK^mtkzhP9k2-N9OV)~!^bAl-m z-+#Eh3qqg_V`){K*oyPU##xQLbDS}c3ZoTK-hPLxKvDP$0ez%3eZ|hn@nz@JG(z+N z(Q_Mj|Y`DjD5jc9$0kY($A^w{OnV;Ta;^PB$2^+Bhoz067L3-5gp!t{-M z6l$-4>^>jw&k@~Ea(RUHq&QDrhCkPFpZ)$ZjBEMVV6Ls*|K$4TzRCX8UpC+PApQf0 WVKp8Oj6T2s0000%cZ7lOYthGvs)6qn%1X26p0lPR1_6KAoQUxLJ=7l zND_U>i270lSx^up^iEWkZ?nSQz-&>@S>EObZr!%)p67167jEU(z~{s5`Q6>~{Gaz5 zz)YG+GikbsW&iH1iJWHrT+B22e-~#@#I#z-+5y6BcH?_sXd>MrPFthKq&>p2OT$by zqg(9UCNQ!zL~PhiSqhXs>r9X|Ku!@C$YQaYYHsp-01S+KKyu~7!+uU_q0Xj#=vq^o z%>dQ;9=-vLEDaIi_jt-(s+rL`CxotoBb$ND_ov)u#>i5D3e@5{C4kO?e?xqil&VDo zsI%B5fBDFl+qFi<0nEQ#9uG0FCH-7)-SRlZ=x?o9QbFtkr;%|0!EK_b+Ja1rbY}5d z$kZwbdo%{HzPak#KtjUE@-p>ZdYx1^NoA5b$cE6q5ZdJ#aG5kl$;Bkc)g4wW1@JPi zNwQvfu5l!1x0I0=x`msie;=ZJ9zuTA?owF_km>~J9I>R|Z;~t_Y0oEYD05RDt@v^Y6|pPR>? zY(=JR57QCGM=cW$8~=G%za@}%DG$gf07*}Np0oXAZ*PmY3-6NPf3jzy`+d|=(ZrdK zCv@L%2!cgJxO7cZU0^_Ti5w8kd+Ff?ROPw);j!F+Y;Wbc#l@mg03uad);BbmYK%Cq zqsL{uYqscHJJv?U0K&Qrbss{G(cjdI0bJXU##6<}apzFxaJaXdoFCg58FfCEy|W^= zaXe2no`c#EpeX2?f6B?l3!~5GK+d}Y3lNXApC|;z1J!G!!nvUXk~yC;&E{=mj?=)D zrJak2jCvpt4d(r9S%Ed4h@deNg7u>3vDKkMJZ8-efs)9gPjs{!mrXqQu@F1btpr$i zwm!b{N^x7-DMUKlCY`1e>l@-0zRw!Iab60K91rKo0q=T$e@;>Gp{hkLocQjwSm8b0 zqFSi03Sab8*;_L%66xYv<>NXTCFvOdvCw>rlUAnp8y!myo_+UL3fRTZxA7&h=b7TG zqN1ZORRNMa2b-OT6bG%%&cGdUj!c+6d=SF??ZfHw@zIux@ZjLy3n|&XkT9*cDaD^| z?li4_sM%}nJvFIgYR^p_-{jMtVT|(CBTjB!3wzC-H{migx&0tWtr^auME VhQKn1caH!7002ovPDHLkV1kyC?$!VR diff --git a/graphics/pokemon/thundurus/therian/overworld.png b/graphics/pokemon/thundurus/therian/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..e8b76b77a177402565442500401b10ecf5b64444 GIT binary patch literal 1976 zcmV;p2S@mcP)Px#Fi=cXMVQc_O-*C%?e;7yEXKyt7A6jnVacS7_Y+cAV7b~(oV07e-d~4lsF*PL z;6MNX0I7+SEdT%qHc3Q5RCt{2T8nbzC=4{n0uH?Q|DStm2|p&;Ghpvks;KCQv}x0(O`A4t+O%oYrcIkRZQ8VH)22|bmxipv|u>m!IR&EIAqSTQ|-M=%aY0i1-PW0Vwm7%=D#i+V&n)x zbQGxyu#OO3;3{AzmRT=!xF7C{=;f43KH}&2Hk6e>-@1chfS_LVF7w|O4&@+;A!`Kv z>Q~qZS%oivOAuUV0`a=ahL@{N0IZ|rOqBS%;9h{^a}m*bu&gd`TgBAgFi50DFQWu5_}#^fp73mG_S}T)!Sq9dSsGF>5k7E;oC2Oh)!9kl#-4BQZxPw zM-Ab6WWKu4ciRYXF_%7xHZZ0?ICSP0f6`(6{Up?oT+PKce7b0LQsV^$j7Ek0SgK z-j@PWt&$cGaoB<ztZ!!iU*p$IE)C)*%&>_Gkd!}sIDnj6P7h1S)@Ew0~ zpb5tMRWVs=_P%6!>APBl8(mO04e;OKu8tG8cs}BXUn0v8#-&8dDck?I&BWOiyb}~< zI0L8(w#&)3W$YT|kjUW;4P?OuZukKO(FAoJPABMJQK;fCovN&ewstVW$J+hBz-!>{ zn;-(X-ynq|eoGz7rDl}|x7mbom2N&E$jXpQNE$#^`sP+lmbV-31Og>i7h1?~@B?oO zHnrC#s27W$vK@c-M zVFE!0gUhuOJG!LDjiGjW|5wh~Oge~xmwHZcU*U>3$GQ}>CP+5M_^Yu6@V*OL4+MPq z2CvSwx3JFth+j@pMkD1d$wsbp9WmH%%pk~MaB0`Drvpd;efb+{n=J(b;V8iU@xQ{) z6zWn?n;>c5SkS|~PxA6o(`s3`?}D`l{wutv3GSixDJ{um>7n=;a31d|AA27VFZn`{ zylL1IMe$hEcIAX-$hf)WZRl(P2Yjt1tnT|R1-S-L2VV_g65o#iwz}Zn1OEly*95hD zXr4*?(haO93!Kb4wy$})Ut0-eJNO#L4t%Ob%v&MW6kyBi9y{R4^wT!Xoln+l6SQ`b zc$4gxQnqazQ(|s+!LtXZ6ff{}eB7~%j{wR5gAM2w%gJW_KL~jD63;_$F2ZyN4f_bh zYa1J+aY^yS3{zbgf}4H<_j(@gQ}Aelh@eby8;n;eqPwuIr;&RPlnT67c!{FlvJ2Qz z2rYmdBOD1)PcmIkF;51IeVe5yn5@zeM3w&GW>eBOV@ag<0!Plj~U&6Hi#{L0EtvV1#$Lv1<0000< KMNUMnLSTYQ5~U;n literal 0 HcmV?d00001 diff --git a/graphics/pokemon/thundurus/therian/overworld_normal.pal b/graphics/pokemon/thundurus/therian/overworld_normal.pal new file mode 100644 index 0000000000..30e45bed09 --- /dev/null +++ b/graphics/pokemon/thundurus/therian/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +77 77 99 +237 237 246 +44 43 44 +198 198 210 +22 38 14 +145 97 201 +164 140 247 +19 82 87 +96 185 218 +78 156 180 +107 192 222 +95 135 105 +168 152 48 +248 224 64 +0 0 0 diff --git a/graphics/pokemon/thundurus/therian/overworld_shiny.pal b/graphics/pokemon/thundurus/therian/overworld_shiny.pal new file mode 100644 index 0000000000..15920a815d --- /dev/null +++ b/graphics/pokemon/thundurus/therian/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +152 208 160 +77 77 99 +237 237 246 +44 43 44 +198 198 210 +22 38 14 +144 32 176 +164 140 247 +24 40 72 +128 152 200 +72 96 136 +17 79 81 +128 152 200 +148 144 48 +248 200 112 +0 0 0 diff --git a/graphics/pokemon/tinkatink/overworld.png b/graphics/pokemon/tinkatink/overworld.png index 85e9bf94ee64e96469f20bed81bc5b78a68a3704..bc045052330a295a17a8dea454da6e3de0c2ae85 100644 GIT binary patch delta 643 zcmV-}0(||)1i=L%iBL{Q4GJ0x0000DNk~Le000310000W2m=5B0Lph(){!Age*!;A zL_t(&f$f;fa>F1DMZp$wf(!ruxs@PJoLY}ItU801JwnpGsIkW(%$PA_#*7&=X3Ur| zW5$da$M|T4;r@dK;+jw+C`f;0|29#U;o_}mWllLj_^(n6 zYdJSnpv6c13lVXIKkFmf3#xE#u-#k6eG^k0{x<`17V6*7IPdYJK4qB(e`uVa5wu|Y zzVn)h9c&(-_rv~N1-|k8^>s-Ayd$<-mM3(0tIr8{!Q3;?86-{(VnUL)@2EU$Ph2SR z+E5e)zVVU;1NJ>7Y$5e84v!tBB$<2S3TA`p0pH6UUM1AkB%4CemZ|NaKD!feh_go#=qC7 d;TZIP;~U-*8a}8f%5MMw002ovPDHLkV1g^|D@XtU delta 520 zcmV+j0{8vF1;+#-iBL{Q4GJ0x0000DNk~Le0002M0000W2m=5B0CPr%w~--Be*wiw zL_t(oh3%KYj>0euMC;->kkb7B=dP1d)T$GkC5M$(nIq5GGfo@9Gz|?64Gj$q4GsMl z5%uxj4!!efzS;d9t`)c0?qKrn`83bwe2Go<9)>HamDcIQ>2D6gZsJ->eQ> zH6GUjvJb%FoeQMMK@A3uxW?rae~XO#HrImr7D5Nt?rN~i_=a!xqWN`;Yk_X3J^lk8 z%@LpTuLD$j9X#GEzc&q9yf^pvU!!(*s(TMIUr{ zS2>*C`ziUZ22VUapO*rbhe+Kr+@H%QrXXr>S)_5-9yp@_yF-BnPkc=vf55VYAXRAo z>TnIH7yO2afx(FnT&@L7uk~m_Mg|X@*Y)}cCE5)_f2+f@niAonQUeUuk2ekiobv;N z=lmI1Nc0l&rwOvf)0(;LFr}mm0s(Sf)nes>PN?K(-WPB+$a{R|(g|A3lvpA>{)(BS zPQm`4nxLL?{h@H}kycGuUVlt9POxm4w+%ysWhvVUaLz4@lmspB*rPFif9YDs_X=p0 zOz-^IAlv!(2KfDZ_n_AI!M%LK;Mzk5-2XeBe`r1$0p$ezJN*Dl+7y@k+>3Jn0000< KMNUMnLSTZLlk{Ey diff --git a/graphics/pokemon/tinkaton/overworld.png b/graphics/pokemon/tinkaton/overworld.png index d34001d5cb2a8fb7e3eb7233cd95221bdcabf059..702afdab9dde80da17c64aa28814a6e310c4eeb6 100644 GIT binary patch delta 1551 zcmV+q2JrdG3C0W|iBL{Q4GJ0x0000DNk~Le000310000W2m=5B0Lph(){!Age+9%z zL_t(&f#sR&lB6IEg-v2JB96ZQ+iotP+@0E~{k2q2SB;-Q&LINQ%ksYzMEqq7#N`LK z0heF)^mnmNYaxEth=<|52qXZ+cLxAo9GKt)aQ)21bl_AW!>@-9`hO8f;I_@ZIso9f zOdOaP^Z;DHIu=a)c~Qvpll&R=fBzqoDy~gPa(!ISq3CER6#*e_j-#Q04?Dz{&jV8ZZ~gLCfI1 zP6FgU9~j>?Hb^pK6Qy-SEN|m1#&jjKlu$m=+Btgbp zLV#U7LMyEU!bb*iG~6hnq_{lmu{!@#^1eTFg|;Z@#2C4>RXd;pk%gH+{uByIJdn1EXpy;!wSnkqX7sCqP^QWUQsKD?fK*p2)#B+h%aWEJ{l>oK|AoaN^ zB;u%DEZkY00%2@W(5S-V)B#-&r44ofa^Cf4pipM|+X2Z7<3O7)c`nd7pGrPOf^mY| zy^<#p8uhjf90-1Be^Bt=ves?pz}*Ivyz5V`(3e5R#E6`1iY!I+1m+5b1C9BkPxP|` zVnS^|@Mz0T1sO1gSl{Dc+UzcX;7XrBK3>6yR{b=@}!NCINQg zXTwGRt^yCDe?$JX$Nh0&&b8g-K$KtT-)9Da#&T=ilTXW#H~KS$yE?!T9_NvV5R3A& z;g7)YgUfeq0PjU+JQ-laXTwXa0V9Jn7HiV)9HBap>1%nTzf#Dn>2V!bXt_5B8cqyU z;3)#n<09$nNuenxZB@fVibdkgE4Kzc95|LEdb)cvf1t?kmN)tUF8O#$Ls2HsVvR%=!o(?#hEvL^H_4u3b~Ngifv*cs~?R|s2h@10@Q{ukhl-kv2yH)YVVe{JMJ(X0E%ljugG~~5H zjc($A@zQ}?po}oadkO<|muCFJlE)WpQg#vb4d7Aib3LYto_F zrF(Opg&ch6$UX~s!0$4JZ~R9;{{G|gD*=B~{s2W#U`yMe&#V9d002ovPDHLkV1mWP B{H6c^ delta 1167 zcmV;A1aSMt49N*0iBL{Q4GJ0x0000DNk~Le0002M0000W2m=5B0CPr%w~--Be*{NK zL_t(oh2@y*lB_BWg-y~jg3kE| zpEDuipLClTBml%Y0l{Yp zkAT9ug5Syql$F_dZ2}PcUzh-EdCZp$8e=Cx1Y|n(^{X3&?em3w0`2Aig5?J!%}TJY zpVFf01HNn!V&qBey9EfmNr@6dPhYefuMpt6_5rk;0|-fnX8-IF#pCBwe^&XU_xTEg z5%jAA5Y)P(tHB^OsL>;Um^?uB$AfZ>giKKVNVD$pT?X+n*c2F$ERe5rAS7W#i#LJj z9w0^HK@p`yq}FqH{-@R*zRMu8F*C@YssZrELFDV=k1vu8Z}B=(ME3x*KmJ&$+fkt~ zq0zg1g~7OM#M+?r00r#pe`YY!22ZpELhk{pLGi~0miH2^6#=gFKHqJSJBl^6*(`wV zK}dbw91`)YAqP+2F2U{t?xdqGK?!s}l`)tAO5Ndm42BS|*h~MW%crYfCUn+qa|rh6 z0&-e(WZt5T;2r~N-QnvQEFFpt2e{vZlGL)~e^>bQfAP5n zYXaH8`Bty5=Pc0;pv&9%_W&z{QLbhGd5dZFhVM2=G69jSQvS(2$F2Gw=y?(f;aS`Y z;L$sPaE+IXBwQKxfAos)GDt}c9z=)yX^->}jCDxyA;|VC|7irs2jDk79@E9SxO(fq zH28gRe7696mW=cZz|v>wr8j^FNXO5Sa}rZZwo-+^x8C}fvo0ky_#*~?j+3PAQ|3cm z#GDRz;>tE*344>RqK0w;Ee+0mY=h@YzvsmQpi1T#K zQx1OXIZB-!a**}QD^enP<5I3$7*v#PG=y2-+k4l%Z z>99xIpr=JWi(ZJB_1Nej{v#gLHwcK`PRr3-0onTGyyhe>x=Q5=a98fE zPh9yz>;G6}6XMR;5`qC7cKy8o@+Lx_K>E4`>f4(8W$hwc#Oe)R*3FMLDs(O3>w0lv zDgUMO>D=f#8W)$U?;BnA&sB@Lckfm{=LrVybF8-`@Zj|`YI9+xYbXHUH1Px9dj=DI hePZx0hVRbN{{v;3NE2eTrNaOK002ovPDHLkV1lazdb-rvkhS9x*zUl!gM-2eNcIU61&rM+ikbqcH3>Y z-S!&>Xy5Sv-C#yD6pr|}wxE5(KQXh0zmb41L@czuv3SI5jCPZn5*Qi^NBol@4ZhUv z)x{(Jit(>%hE!N6bap8y`VcH3RnL1E(fEl_#IY9$n&G#lz z`us@1J74FfZ}zJsam0@(Re@}-cA%TC-xHLF0s%AV#2Sw{Z|_=;W{{H%DsP#YSNg;I z%hC}a3uN4nm*R6&+nMVu3LNo?)GrJ4GcKHx_u_A5Yyyumzb_u~4+NgDfAmFmp#pjf zg2EA>YJb2C%A^3Bv%+3yEdvIhVvMH1>BU8i0z;r6L(mdn^L8%36#W*Tytf4oc-&Gl z1;&kP*zr|@3nAwKK<{z_2E11ibiueTbC&;MmYX ze25JAOCi~k)V@hBOWQUv|D55;%7*Js~LEldff&=7di%z*n4R{sENe*FEp7lD9 z3HIF*NDeO4Af8!h0K7swmgq!%WCxe7+fabZiw-dgi_cu#ed0k*ewe>RR=>~Ph)4mP3YbqAHSvDb zQ2VXmXj;npUOw1}k?tLr{W0}s2jEQtws8lP;;jxSWmP(0e|P65Rvfs7ine-?rtcIA znLO!>F$3sZ1Zgw_P`)(-=ssAA7#BahY7o~_5udD?00000 LNkvXXu0mjf$6v1~ delta 717 zcmV;;0y6#O2Z{zEiBL{Q4GJ0x0000DNk~Le0002M0000W2m=5B0CPr%w~--Be*%a} zL_t(oh3%Konw%gEg^iOI1lE23w`~$|$E_!!?M~Yp^Uddl=Lmm7KxbL*xZ{pH?zrPs zK@wll|98+T5fIMwe-U8~Uy;B=;w$=OkwXL%1HzeZeCh}YXZoMlQ1a#u$oR>L-s4-h zxP&u(mH@4~g3v%K9e_B&iT(+Ye-@`tJ`!;B0MLT_3i5L8GroVuWw1PEvP($|Mpa&`($ z^qg}DxIA?z3t&n*NlIPIndW5t;nxcsTzD0&Ij7U$(5-g>l z6izzKaFMzNfWyEdlGX5%fOH1g1P-5o+X|3PLstfQ5BIS*IT8V)POiEm+jr;zi1-%@ zYp5S;dgUD#0Gm!>>2N0(Zf2Iyzfq&UYA!1~4dom+>*v&tYGt z8Qib^9e4Sj4h?W$Bj|?gJ}Q<-eoc6MePx#Fi=cXMVQc_QBhLb+T|7{4%o{=jC@6GHG<#YSurfC`qI)*f=Nv z0000005ng|T>tea%e5+*?KW0>4xHuLkdp z!mgznT3OH)Vo1&p6`*I&V+BZn!y~ngHA<&C8 z2{RJ03m*vl)9yXB|GC_e2tEQo;o$-Vc*F!i`fB1Xsb2w;P;N-*5B$^aJ+=R3zx5HA z*DtneRJi=ueoEAP4P8nb5O#UJ(guT1s<)0j@ti{z-e+3_{0;vd*k$j z*R~H7NT$HXpU4`?M1|&tPZ0(7?O}^TX%9TOy}1ys{Z9nS&WD4*ylx9ndRM?JfUK*6 zwR>hx$-WtXq-%#5IPft6*0r|(1pkS)z^h)53V;OywLg6#kZ8Z;A~3J|Gg`Rt{PItj z1ziGUSqou1jX2r2w8%td4ff&_KA-?A2iX*0<6kL6;1!pH0yF`WyY^vM0;v=mq*#0e z=CuV(_^O4xplw5UU1ioU4PWyVmKmnlGtlYL3QVZNP32na%nB2AB_CFEG%D+ZVTLm}>tVMIB91EOR&aJRJCjhAP1Kw00J+1J+l3tgLaJjYTtZ*A&?OP)uLOokHA_> zc|5dn(L4WoTk5+J$Phqvuceu~V^@OwpYZ{hI%+7|_)jhH5T=?ZeIl&N#)u zzediVvoC=O5YDQ;jxKeR zKm^B--wzc4lTXztnv#a1o>VUZY>nFn=mQ^XV0z*dBT(Zu`jv{vIgV+v={IW+dz(l8 zZ}UbVKl!g(0MZ=&Kq~-kqdVRL36GKW%wGiB_-}*U zbAb|5;7K6aI286m7ZBPNh{s_95T-BtqTrpB9b7N?b}791?(x{>%-p>@Qh;3YWk( z0O_w?fZ)poq#~|c>35t%(}GC|7MXx1dz@{XPG`Jqq6FNx@lS8SYIFps1?LS89=nCZ zVT4mjhq1^qAn=DNp!#fS6J&w>&3E1u8_!(-57e8vROY&WG}@M2d( z>ug@Mdx8$6Sxdb5>jVwFKgWpi&#Mk_^oA#$tRsH#9yZ6~=e4~&aKYnMgFYH`fxZ{R zw#{)%5q_WGj(zpuHS|FCh5)&JbbZB#J{Z2Nc;^LeJA-?-?%VP!e>wD8%Taf+3gqpi zf5&&e;TUcKS8&e3w;68Q*WP~1|LyXVSihBq!{U$9hy7ynzmqZSyX`-vF;1Jl_jaxT O0000D=b|Nj6002nz+ zIbwU&#dA4}tlr+N?(YAj5ExQHF^Catg#Z8p;7LS5R9J=Wm+5xnAPj{gcCcH&|J%-$ zupK~3dS*G(KUK3d{$#jU0@6MnKk*a)DCoNd{B6+Sz%)be@wW$sOBa!CfYx7B#_;-| z1Cx@2gHj5dII?7a(9QqUz&|snhG0z;Lap1j)fxhNu&7+Pse(>}FBP8r4+PFk&pl7@T z*WSh}F>8a&w?K8P6gGoD6A@nNn+!Pb@Sy1y@}6?eT;qa&cmB9IbZ+2I8-Q*K-fhnF zFE99M(BK?cUxmvHeR_h6I~MQ##BmY#m3l9cTKK}9(;ZG+*NE!^19%J08`B3DZjK*I z9*(>-^49QetmhvD zMkNqeMy~aDi4|XDEk%NXVobr@5z1%qQem)Sec?SPB{1XK&08&M_FQT`_0?+bp@D00 zrwDYPyIdepwczB`u!M`|Xn?Hkg!hJitheTW+=dLp0ERrj=*-E#;^#CeVy8CNXSpo0 zy7z8i=4e2=f=jGAP%rtCp;}Nx;2lN*-t#jeHrF2GD+98U;UHQD(h#PBF+m%sbNnuU zDwNIo%4RnZFaF8^Hk=+gws!`OSz$STlTQlUoxD!d@y$mp0$Yq+0DZ=A0ycqQ)8LVR z3r3aB;!(0P@C6?wq61hX*>=$SCas;1Sd{bW5s$+(aLC~v#fPGNQ_X#8R_mC=G5h3) z`kol($x)6GoNN3av>HbAm(C{#EbJP>?!bAKjcOc^#(%9>{)f#<;EOkZqyLonA|dwr zU&bbbwrnfR%&t1i#(GhJ$H`5D)9^1PrNnpeFQbq9)!_M=`V$hr0N?mF1rRp5#{d8T M07*qoM6N<$f;2QB_5c6? delta 1320 zcmV+@1=srG2*L`G7zqRe0002CwraMKE*F1FK@haGdjJ3c5D-#1F=C5@Qd&x!-rlV4 z?*HzK08&9QEzK6y000EdNkl^{L-(~V ztb{dd1U+i9K390w7vFu+X^`_o=C*%3iGYX)Jp8*>?r8v56GWEfpycQ|#1R7wcO;oq1}xUp+%TZSeP*NB1DfWs*_uN_ zgcL1-1Ti&3MEt0tUTZMUZZ1+Q&IoTaIX^8uMDFkI-Sh^&Oxt|E`qQy;n|Xi4j_tYV z0)IMF;2D25u#hoN5hX^t{t0kD-kd^2DB}vj4`AsMOVz^$pjs6IRvSiJ2x_gf?H`To zVj;q)gDJ*36~~mVV60Y2&A1^fAEbm?;dCL5;5iqUwg#p&4S{xT(ze&Oc{TyiBfo#e(j^qEr5FKDHArQWuLq1#4U#eE_AYe#x~bBa3}W2e zWDR}GH+9R`U~MwfU4qXuD<*iwx`PDi@)QS!;Hq4puWfcU^ux}RR!9nr#C$G50tlYe z=A(#77kHn^@|J_X9I%A%qS65?_^i(2Jo&A$ECPKLlOkqF8q@W_%wm72dNCQWTtJ58 zGI@2_6lILT>Q7*^S!{+FgtT;m$Q3C@M1}~~o9Kt&J+&549+nGUZ<5CbwFXvSc~vj7 z??Ed=Zx1m;a&9mQ`N=*CGDMOYq^QhA2YgMX?XC;WH>Rb9?JY~4uK5a7V|9?F8z;P; zeJ2-WIwDJXlRsAc^ZI|Tx%Ye&rJtWDFuxR;-U%yJFrYtDrnTH7?RzmxzK^DA0+QE1 zxN5p`@Yq(#*WVJ{-Yb`I+UV8^4`Q>EacH_(hUiRi|8-K9Qk%+KBSlJAdV&c#VN^7p zgo?T35yiQY#GCr?4nVO2)A_rp$>s{O1YSR0a`byU9bymXIP-riZmi{%5mE+oiB6Ln zb9UazeU>~hURlVeoV%VLiy`&GLGV?37{Y2Cp*GasGL9UnmtQ>16H?qH*qNR)&!!<7 zhf2HSp!W=~D=h&Z9s}4McdOjO8bNeasjJW3ot+i!U$R*yvxgE+K@I$e3a`vfQH>YI z$LwBFLPgD=nU{ah@o*17u;0-&j3F4aH07WB#!`dV^>Mqy z`y8(x6atxK)T8U2Q-f;kohy6wb=a$}1;0UzpJkoiicP1m$90ZNsIU%2qb|(=6c;NP z9Nm)}`Jx~WuZ@i4I}=K9;|*$V>hfjDE58a(zvNuO&{luwnn~)vOEg9yUpAAZRUWYs z-5(|3ld8hg{Ruej?y-;M;io34VRYEX^8OZ++j^Y>#(ak{Sit?=aM?EqzJ9m3GIb|- z68y#<6+f?r?2czDU+ka*4FifVRS$H~ce~amoC5n6t~q#ndg1tZ@yWSODTzVJ&0PR5 e|2O{k{s9z*Tos(>{;xIw0000145PG|A}uGDY-ibL6dZ*e@w<{Wx$N>xGDtFgg;;BpPCwk`4;1^J+Dx4IH)qg zT{Xfb=N5mZ67%wZ6J%Db;RA_5iYpF*1L1XCV-rBmxj$_J4I3@z%x+s-+?eGTITw)L zyI;E=N;x(LIZ_YR0*M6|!$+84^eBHng`abHbjIgb4|^!*EKxKUbSbK=o1L60&a@gk z6j2(JeO|uc&_{8|FhvFm3yunC>r|*OaE@r33h`}!LAO*K>iAs0EZU%)W5!V) za-;4fr#D8$-G|aR>2*`X85iH!C9prc6dVO&HmGkVSWY!k@s%S^I!|yMK*q&pS~zH# z5M|gHn->Q&RBl2DTcMW4{?E~0zmp6A;UE)ie-JyrSHh>!@U@1_84*=@ z%{k)x%#K8VgEHmp3iT0@c_{N6pZ8Mk4eC`+VNCI<2MYcO z(_G~)fSk)1eAn{(4UVX68Pd!e|6gFmeFYp7;1(X$oSXCTHRWrJX}c3k!F8-83%gdI zOMH;-`8qFKc+i==dlPR@(<%q`9oqmV-W|!X!vix<4jRSR3M$08Z(zV@2oj$I?h(*o zi|74Ea{rOukH;$yIj$g@1LSvs`+rJufeHNh{zdmrvWe`n-?TprDiAlD=@j|^0000< KMNUMnLSTY+I3Vo+ delta 557 zcmV+|0@D4W1>Xda7zqRe0002CwraMKE-8Nj|4BqaRCt{2)G?3SAQT61VCW3QZZZaf zb#v_KcJPaGE6D68wYt4kBzLYV^=lV;ml&Lobgh(^=_joJBM)qZ9`&e4J?dYJtp&Yh z!Z^C+yZJi_npFR7k=BK$+`ldvgo^|+LrNlw=S8OX1|vPm5lJ`*^Yl_ z16;J#ZpS-XGC8oCEt3W_qpE*JNV3H1)TCX6zr5gW!Qo82_4eHF!k?<{6%jZml1(pD zW33l`&$KQWVGA0xMJ0cI{=%qo!~UbEYB!njR&BaYiPNdhjcN^c(5J^QjJy5~Xw!Ib zC(G0b32D04i1jHzm}q@=WxVqaXu*H@`3(&Bjs18za4R#1;s%VFW;!!gE(Q*wV6{7d zAkNqDJ~egB9k-;UQb~i{*m%ZS?eukH^>Q?tIOpGoKKI|i2KHHl%*3{(*68pofhe~&-X@0mKNrvt_3GmZX+CWk~;Cld(oDogX@`YKyrYj{@3~gY!HnKufW3z00000NkvXXu0mjfkq8n~ diff --git a/graphics/pokemon/zygarde/10_percent/overworld.png b/graphics/pokemon/zygarde/10_percent/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..1b72c1eeef3c340990ea3e0f331a93372d4fded1 GIT binary patch literal 693 zcmV;m0!safP)Px#Fi=cXMRUcZ0000|VNf?gHViES6&e-Z{nd)uAQ)01DKRKRn;sP!75B>(^dGf6~2R9J=Wm)&~9AP9zwm}qcW?*DEF=BH05VAkwpd%{7R=B4nV zsLA7T+ikbqcH3?L!2m$LKFhBMxM&apw3p}k^#B(QkfTD35jZ?5`8)i20I`A1Q|WL( zP7rXcpK5-eUk@PS(3zVamk|nKln-@$di-ht7)LYo8NMg5oqGII0D$C$?(!|Z)R>(7 zE`PrO?v0Sc#GR%8^Ba%xm-AmQfOvSPaa$X_&ZEO)Oxemmg`BujGr!N@FCZs2LNVT^ z_&S?hu%Z7^aGWU7G-7#+v%{(o%>WjED&(u28-)k2*w9}$I`%XA@Rc{STyJbUr5C{9 zna}1-B6HI>450E|{x`nImk3D}_{!UPm#0~3^G%#z!$EzA!{U-STd;< z$l`Q35A3$a_b(iN##vw@ZZ%59SSL@e;zuq>yvoT~!@0vb{wl04l({TF<`@!v@|J6E zB0d)fWP#`e@Ht73%(zo@CL6 z`0&taeN~NQJ?t^A&r%lN9K82kVeDf#EJROL%d8CX;i1yie1V-;*)uQewhuSA@uRt^ b(!Xh6+jtr1i}|;z00000NkvXXu0mjf9U?x# literal 0 HcmV?d00001 diff --git a/graphics/pokemon/zygarde/10_percent/overworld_normal.pal b/graphics/pokemon/zygarde/10_percent/overworld_normal.pal new file mode 100644 index 0000000000..d084071aa5 --- /dev/null +++ b/graphics/pokemon/zygarde/10_percent/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +0 0 0 +82 97 80 +55 65 54 +12 45 2 +21 26 21 +222 253 213 +138 217 32 +24 82 33 +41 49 40 +67 155 30 +21 26 21 +254 141 141 +41 49 40 +254 82 82 +0 0 0 diff --git a/graphics/pokemon/zygarde/10_percent/overworld_shiny.pal b/graphics/pokemon/zygarde/10_percent/overworld_shiny.pal new file mode 100644 index 0000000000..5ea188226b --- /dev/null +++ b/graphics/pokemon/zygarde/10_percent/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +29 29 29 +222 222 216 +162 162 152 +23 47 41 +29 29 29 +116 248 213 +68 216 176 +40 117 95 +29 29 29 +54 154 127 +0 0 0 +254 141 141 +136 136 136 +254 82 82 +0 0 0 diff --git a/graphics/pokemon/zygarde/complete/overworld.png b/graphics/pokemon/zygarde/complete/overworld.png new file mode 100644 index 0000000000000000000000000000000000000000..6b7303c36e574d5dcd38e3db1c1b3ddcdecb2d7e GIT binary patch literal 1185 zcmV;S1YY}zP)Px#Fi=cXMRUcZE-ftx2nbnOQyCT(u-I5TIy(6H_;`>&dU|sZ4-Zh7*yuo5=&(SL z(D*4a79UH=F#rGrA4x<(R9J<*n2naJDh!2f0zs>DeE+w-I{^U|QD?2W&Z=$s0_+|6 z>kLD@KA(XI@Ae}7y1)LKXF?X%xcZ#a== zA`)Sew!%J-9SAWa;8MWfagB)N(mL!a$E>j>+Imp@z9ZJ_iA}d`odk@H?&{esuD|>}GphXNf%yTed`r8#T-p zygEgXcuet>68wr=2!{~vc6sUm7bcm$wFPv!11B9ILg4Nd*BQ#*YlgWwMsB$lYX}rh6Cy2;UU3zO96RJ! z1-|0CN_j7vz;lXkcuX*$Dx4~(ued3kzEjlqhDU+6LM4I66yI=)o@OXydo8qc`Hb5( z3xRR7eZ%7zk?iO&`7D7K1Hbeh4$YX`st# zTbPLc;i&Kv&+R2ePq|7Q@#i$)1ur>m)6F ze!{a3AU}E)*WAl4In6VGZIsO8I5OK-iO?k(xZ!x)xEp13na}eRUIv2n4WO*W(acPv z65A_un#RZxJ?m({<9gq?gF%>+sp}_>(1ScQM6@@y3}C6^_@k>HBDI0h9#P`8 z0qY<)XOsOXAe9YO>_K4sy~NvnI2p`*SHB3<5hQY)r14ty$ApEPC;673>>!(=%xi-s zmX7s#C-7W91{~@a12%`62G*cs%R<@);m^7JNGdZW>A9?qJ#g%DBX#P>fCi5l&Ia7s zfJh2ya!hg7RjebhGFZiy^ywBy*d~0}fCa?Zy?)DZG=QFTejm8sLWUL}*3kz)uGa#q zvN|@`7brvj9vf^+U@F6w9HYD(>IXaS)8)T**L4eNa}8M6vzeB`I(A>*5}3@i46b&j zq(*&YxTo%6NW)CG?0m%p_Ud1y8165#-wpW>6?i?UTeXlS00000NkvXXu0mjfaeX0T literal 0 HcmV?d00001 diff --git a/graphics/pokemon/zygarde/complete/overworld_normal.pal b/graphics/pokemon/zygarde/complete/overworld_normal.pal new file mode 100644 index 0000000000..c70f440e11 --- /dev/null +++ b/graphics/pokemon/zygarde/complete/overworld_normal.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +46 45 45 +8 8 8 +89 89 83 +25 22 22 +176 216 88 +59 58 58 +248 248 248 +120 144 64 +122 122 115 +16 15 15 +80 152 216 +232 64 88 +232 176 64 +144 208 248 +41 49 22 diff --git a/graphics/pokemon/zygarde/complete/overworld_shiny.pal b/graphics/pokemon/zygarde/complete/overworld_shiny.pal new file mode 100644 index 0000000000..9f9a249ea7 --- /dev/null +++ b/graphics/pokemon/zygarde/complete/overworld_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +115 197 164 +86 84 84 +8 8 8 +197 197 187 +61 61 61 +90 194 166 +135 134 134 +248 248 248 +69 139 120 +235 235 230 +135 134 134 +80 152 216 +232 64 88 +232 176 64 +144 208 248 +23 47 41 diff --git a/include/config/overworld.h b/include/config/overworld.h index b666426996..bd1c49ab42 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -43,7 +43,7 @@ // (You should not use 48x48 sprites/tables for compressed gfx) // 16x32, 32x32, 64x64 etc are fine // Follower Pokémon -#define OW_FOLLOWERS_ENABLED FALSE // Enables follower Pokémon, HGSS style. Requires OW_POKEMON_OBJECT_EVENTS. Note that additional scripting may be required for them to be fully supported! +#define OW_FOLLOWERS_ENABLED FALSE // Enables follower Pokémon, HGSS style. Requires OW_POKEMON_OBJECT_EVENTS. Note that additional scripting may be required for them to be fully supported! #define OW_FOLLOWERS_BOBBING TRUE // If true, follower pokemon will bob up and down during their idle & walking animations #define OW_FOLLOWERS_POKEBALLS TRUE // Followers will emerge from the pokeball they are stored in, instead of a normal pokeball diff --git a/spritesheet_rules.mk b/spritesheet_rules.mk index e97b1b5ffe..7855bf8d21 100644 --- a/spritesheet_rules.mk +++ b/spritesheet_rules.mk @@ -4413,6 +4413,60 @@ $(POKEMONGFXDIR)/tauros/paldean_combat_breed/overworld.4bpp: %.4bpp: %.png $(POKEMONGFXDIR)/ursaluna/bloodmoon/overworld.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 4 -mheight 4 +$(POKEMONGFXDIR)/shaymin/sky/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/oricorio/pom_pom/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/oricorio/pau/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/oricorio/sensu/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/zygarde/10_percent/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/zygarde/complete/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/magearna/original_color/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/kyurem/white/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/kyurem/black/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/tornadus/therian/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 8 -mheight 8 + +$(POKEMONGFXDIR)/thundurus/therian/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 8 -mheight 8 + +$(POKEMONGFXDIR)/landorus/therian/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/pumpkaboo/small/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/pumpkaboo/large/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/pumpkaboo/super/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/gourgeist/small/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/gourgeist/large/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + +$(POKEMONGFXDIR)/gourgeist/super/overworld.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 4 -mheight 4 + $(MISCGFXDIR)/emotes.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 2 -mheight 2 diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index e43fa7c565..a1c1a20108 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -11044,10 +11044,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/shiny.gbapal.lz"); const u8 gMonIcon_ShayminSky[] = INCBIN_U8("graphics/pokemon/shaymin/sky/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_ShayminSky[] = INCBIN_COMP("graphics/pokemon/shaymin/sky/overworld.4bpp"); + const u32 gObjectEventPic_ShayminSky[] = INCBIN_COMP("graphics/pokemon/shaymin/sky/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_ShayminSky[] = INCBIN_U32("graphics/pokemon/shaymin/sky/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_SHAYMIN @@ -14077,10 +14077,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/shiny.gbapal.lz"); const u8 gMonIcon_TornadusTherian[] = INCBIN_U8("graphics/pokemon/tornadus/therian/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_TornadusTherian[] = INCBIN_COMP("graphics/pokemon/tornadus/therian/overworld.4bpp"); + const u32 gObjectEventPic_TornadusTherian[] = INCBIN_COMP("graphics/pokemon/tornadus/therian/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_TornadusTherian[] = INCBIN_U32("graphics/pokemon/tornadus/therian/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_TORNADUS @@ -14108,10 +14108,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/shiny.gbapal.lz"); const u8 gMonIcon_ThundurusTherian[] = INCBIN_U8("graphics/pokemon/thundurus/therian/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_ThundurusTherian[] = INCBIN_COMP("graphics/pokemon/thundurus/therian/overworld.4bpp"); + const u32 gObjectEventPic_ThundurusTherian[] = INCBIN_COMP("graphics/pokemon/thundurus/therian/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_ThundurusTherian[] = INCBIN_U32("graphics/pokemon/thundurus/therian/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_THUNDURUS @@ -14175,10 +14175,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/shiny.gbapal.lz"); const u8 gMonIcon_LandorusTherian[] = INCBIN_U8("graphics/pokemon/landorus/therian/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_LandorusTherian[] = INCBIN_COMP("graphics/pokemon/landorus/therian/overworld.4bpp"); + const u32 gObjectEventPic_LandorusTherian[] = INCBIN_COMP("graphics/pokemon/landorus/therian/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_LandorusTherian[] = INCBIN_U32("graphics/pokemon/landorus/therian/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_LANDORUS @@ -14238,10 +14238,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/shiny.gbapal.lz"); const u8 gMonIcon_KyuremWhite[] = INCBIN_U8("graphics/pokemon/kyurem/white/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_KyuremWhite[] = INCBIN_COMP("graphics/pokemon/kyurem/white/overworld.4bpp"); + const u32 gObjectEventPic_KyuremWhite[] = INCBIN_COMP("graphics/pokemon/kyurem/white/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_KyuremWhite[] = INCBIN_U32("graphics/pokemon/kyurem/white/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -14251,10 +14251,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/shiny.gbapal.lz"); const u8 gMonIcon_KyuremBlack[] = INCBIN_U8("graphics/pokemon/kyurem/black/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_KyuremBlack[] = INCBIN_COMP("graphics/pokemon/kyurem/black/overworld.4bpp"); + const u32 gObjectEventPic_KyuremBlack[] = INCBIN_COMP("graphics/pokemon/kyurem/black/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_KyuremBlack[] = INCBIN_U32("graphics/pokemon/kyurem/black/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FUSION_FORMS @@ -15812,9 +15812,9 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ #if OW_POKEMON_OBJECT_EVENTS const u32 gObjectEventPic_PumpkabooAverage[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/overworld.4bpp"); - // const u32 gObjectEventPic_PumpkabooSmall[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/small/overworld.4bpp"); - // const u32 gObjectEventPic_PumpkabooLarge[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/large/overworld.4bpp"); - // const u32 gObjectEventPic_PumpkabooSuper[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/super/overworld.4bpp"); + const u32 gObjectEventPic_PumpkabooSmall[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/small/overworld.4bpp"); + const u32 gObjectEventPic_PumpkabooLarge[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/large/overworld.4bpp"); + const u32 gObjectEventPic_PumpkabooSuper[] = INCBIN_COMP("graphics/pokemon/pumpkaboo/super/overworld.4bpp"); #endif //OW_POKEMON_OBJECT_EVENTS const u32 gMonPalette_Gourgeist[] = INCBIN_U32("graphics/pokemon/gourgeist/normal.gbapal.lz"); @@ -15843,9 +15843,9 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ #if OW_POKEMON_OBJECT_EVENTS const u32 gObjectEventPic_GourgeistAverage[] = INCBIN_COMP("graphics/pokemon/gourgeist/overworld.4bpp"); - // const u32 gObjectEventPic_GourgeistSmall[] = INCBIN_COMP("graphics/pokemon/gourgeist/small/overworld.4bpp"); - // const u32 gObjectEventPic_GourgeistLarge[] = INCBIN_COMP("graphics/pokemon/gourgeist/large/overworld.4bpp"); - // const u32 gObjectEventPic_GourgeistSuper[] = INCBIN_COMP("graphics/pokemon/gourgeist/super/overworld.4bpp"); + const u32 gObjectEventPic_GourgeistSmall[] = INCBIN_COMP("graphics/pokemon/gourgeist/small/overworld.4bpp"); + const u32 gObjectEventPic_GourgeistLarge[] = INCBIN_COMP("graphics/pokemon/gourgeist/large/overworld.4bpp"); + const u32 gObjectEventPic_GourgeistSuper[] = INCBIN_COMP("graphics/pokemon/gourgeist/super/overworld.4bpp"); #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_PUMPKABOO @@ -16005,10 +16005,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/shiny.gbapal.lz"); const u8 gMonIcon_Zygarde10[] = INCBIN_U8("graphics/pokemon/zygarde/10_percent/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_Zygarde10[] = INCBIN_COMP("graphics/pokemon/zygarde/10_percent/overworld.4bpp"); + const u32 gObjectEventPic_Zygarde10[] = INCBIN_COMP("graphics/pokemon/zygarde/10_percent/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_Zygarde10[] = INCBIN_U32("graphics/pokemon/zygarde/10_percent/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -16018,10 +16018,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/shiny.gbapal.lz"); const u8 gMonIcon_ZygardeComplete[] = INCBIN_U8("graphics/pokemon/zygarde/complete/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - //const u32 gObjectEventPic_ZygardeComplete[] = INCBIN_COMP("graphics/pokemon/zygarde/complete/overworld.4bpp"); + const u32 gObjectEventPic_ZygardeComplete[] = INCBIN_COMP("graphics/pokemon/zygarde/complete/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - //const u32 gOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_normal.gbapal.lz"); - //const u32 gShinyOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_ZygardeComplete[] = INCBIN_U32("graphics/pokemon/zygarde/complete/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_ZYGARDE @@ -16464,10 +16464,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/shiny.gbapal.lz"); const u8 gMonIcon_OricorioPomPom[] = INCBIN_U8("graphics/pokemon/oricorio/pom_pom/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_OricorioPomPom[] = INCBIN_COMP("graphics/pokemon/oricorio/pom_pom/overworld.4bpp"); + const u32 gObjectEventPic_OricorioPomPom[] = INCBIN_COMP("graphics/pokemon/oricorio/pom_pom/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_OricorioPomPom[] = INCBIN_U32("graphics/pokemon/oricorio/pom_pom/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -16477,10 +16477,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/shiny.gbapal.lz"); const u8 gMonIcon_OricorioPau[] = INCBIN_U8("graphics/pokemon/oricorio/pau/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_OricorioPau[] = INCBIN_COMP("graphics/pokemon/oricorio/pau/overworld.4bpp"); + const u32 gObjectEventPic_OricorioPau[] = INCBIN_COMP("graphics/pokemon/oricorio/pau/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_OricorioPau[] = INCBIN_U32("graphics/pokemon/oricorio/pau/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS @@ -16490,10 +16490,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/shiny.gbapal.lz"); const u8 gMonIcon_OricorioSensu[] = INCBIN_U8("graphics/pokemon/oricorio/sensu/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_OricorioSensu[] = INCBIN_COMP("graphics/pokemon/oricorio/sensu/overworld.4bpp"); + const u32 gObjectEventPic_OricorioSensu[] = INCBIN_COMP("graphics/pokemon/oricorio/sensu/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_OricorioSensu[] = INCBIN_U32("graphics/pokemon/oricorio/sensu/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_ORICORIO @@ -17718,10 +17718,10 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_ const u32 gMonShinyPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/shiny.gbapal.lz"); const u8 gMonIcon_MagearnaOriginalColor[] = INCBIN_U8("graphics/pokemon/magearna/original_color/icon.4bpp"); #if OW_POKEMON_OBJECT_EVENTS - // const u32 gObjectEventPic_MagearnaOriginalColor[] = INCBIN_COMP("graphics/pokemon/magearna/original_color/overworld.4bpp"); + const u32 gObjectEventPic_MagearnaOriginalColor[] = INCBIN_COMP("graphics/pokemon/magearna/original_color/overworld.4bpp"); #if OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE - // const u32 gOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_normal.gbapal.lz"); - // const u32 gShinyOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_shiny.gbapal.lz"); + const u32 gOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_normal.gbapal.lz"); + const u32 gShinyOverworldPalette_MagearnaOriginalColor[] = INCBIN_U32("graphics/pokemon/magearna/original_color/overworld_shiny.gbapal.lz"); #endif //OW_PKMN_OBJECTS_SHARE_PALETTES #endif //OW_POKEMON_OBJECT_EVENTS #endif //P_FAMILY_MAGEARNA diff --git a/src/data/object_events/object_event_pic_tables_followers.h b/src/data/object_events/object_event_pic_tables_followers.h index 1e20ef3798..6ad602a629 100644 --- a/src/data/object_events/object_event_pic_tables_followers.h +++ b/src/data/object_events/object_event_pic_tables_followers.h @@ -3078,9 +3078,9 @@ static const struct SpriteFrameImage sPicTable_Darkrai[] = { static const struct SpriteFrameImage sPicTable_ShayminLand[] = { overworld_ascending_frames(gObjectEventPic_ShayminLand, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_ShayminSky[] = { +static const struct SpriteFrameImage sPicTable_ShayminSky[] = { overworld_ascending_frames(gObjectEventPic_ShayminSky, 4, 4), -};*/ +}; #endif //P_FAMILY_SHAYMIN #if P_FAMILY_ARCEUS @@ -3914,9 +3914,9 @@ static const struct SpriteFrameImage sPicTable_Virizion[] = { static const struct SpriteFrameImage sPicTable_TornadusIncarnate[] = { overworld_ascending_frames(gObjectEventPic_TornadusIncarnate, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_TornadusTherian[] = { +static const struct SpriteFrameImage sPicTable_TornadusTherian[] = { overworld_ascending_frames(gObjectEventPic_TornadusTherian, 4, 4), -};*/ +}; #endif //P_FAMILY_TORNADUS #if P_FAMILY_THUNDURUS @@ -3924,9 +3924,9 @@ static const struct SpriteFrameImage sPicTable_TornadusIncarnate[] = { static const struct SpriteFrameImage sPicTable_ThundurusIncarnate[] = { overworld_ascending_frames(gObjectEventPic_ThundurusIncarnate, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_ThundurusTherian[] = { +static const struct SpriteFrameImage sPicTable_ThundurusTherian[] = { overworld_ascending_frames(gObjectEventPic_ThundurusTherian, 4, 4), -};*/ +}; #endif //P_FAMILY_THUNDURUS #if P_FAMILY_RESHIRAM @@ -3946,9 +3946,9 @@ static const struct SpriteFrameImage sPicTable_Zekrom[] = { static const struct SpriteFrameImage sPicTable_LandorusIncarnate[] = { overworld_ascending_frames(gObjectEventPic_LandorusIncarnate, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_LandorusTherian[] = { +static const struct SpriteFrameImage sPicTable_LandorusTherian[] = { overworld_ascending_frames(gObjectEventPic_LandorusTherian, 4, 4), -};*/ +}; #endif //P_FAMILY_LANDORUS #if P_FAMILY_ENAMORUS @@ -3965,12 +3965,12 @@ static const struct SpriteFrameImage sPicTable_Kyurem[] = { overworld_ascending_frames(gObjectEventPic_Kyurem, 4, 4), }; #if P_FUSION_FORMS -/*static const struct SpriteFrameImage sPicTable_KyuremWhite[] = { +static const struct SpriteFrameImage sPicTable_KyuremWhite[] = { overworld_ascending_frames(gObjectEventPic_KyuremWhite, 4, 4), }; static const struct SpriteFrameImage sPicTable_KyuremBlack[] = { overworld_ascending_frames(gObjectEventPic_KyuremBlack, 4, 4), -};*/ +}; #endif //P_FUSION_FORMS #endif //P_FAMILY_KYUREM @@ -4416,7 +4416,7 @@ static const struct SpriteFrameImage sPicTable_Trevenant[] = { static const struct SpriteFrameImage sPicTable_PumpkabooAverage[] = { overworld_ascending_frames(gObjectEventPic_PumpkabooAverage, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_PumpkabooSmall[] = { +static const struct SpriteFrameImage sPicTable_PumpkabooSmall[] = { overworld_ascending_frames(gObjectEventPic_PumpkabooSmall, 4, 4), }; static const struct SpriteFrameImage sPicTable_PumpkabooLarge[] = { @@ -4424,12 +4424,12 @@ static const struct SpriteFrameImage sPicTable_PumpkabooLarge[] = { }; static const struct SpriteFrameImage sPicTable_PumpkabooSuper[] = { overworld_ascending_frames(gObjectEventPic_PumpkabooSuper, 4, 4), -};*/ +}; static const struct SpriteFrameImage sPicTable_GourgeistAverage[] = { overworld_ascending_frames(gObjectEventPic_GourgeistAverage, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_GourgeistSmall[] = { +static const struct SpriteFrameImage sPicTable_GourgeistSmall[] = { overworld_ascending_frames(gObjectEventPic_GourgeistSmall, 4, 4), }; static const struct SpriteFrameImage sPicTable_GourgeistLarge[] = { @@ -4437,7 +4437,7 @@ static const struct SpriteFrameImage sPicTable_GourgeistLarge[] = { }; static const struct SpriteFrameImage sPicTable_GourgeistSuper[] = { overworld_ascending_frames(gObjectEventPic_GourgeistSuper, 4, 4), -};*/ +}; #endif //P_FAMILY_PUMPKABOO #if P_FAMILY_BERGMITE @@ -4484,12 +4484,12 @@ static const struct SpriteFrameImage sPicTable_Yveltal[] = { static const struct SpriteFrameImage sPicTable_Zygarde50[] = { overworld_ascending_frames(gObjectEventPic_Zygarde50, 4, 4), }; -//static const struct SpriteFrameImage sPicTable_Zygarde10[] = { -// overworld_ascending_frames(gObjectEventPic_Zygarde10, 4, 4), -//}; -//static const struct SpriteFrameImage sPicTable_ZygardeComplete[] = { -// overworld_ascending_frames(gObjectEventPic_ZygardeComplete, 4, 4), -//}; +static const struct SpriteFrameImage sPicTable_Zygarde10[] = { + overworld_ascending_frames(gObjectEventPic_Zygarde10, 4, 4), +}; +static const struct SpriteFrameImage sPicTable_ZygardeComplete[] = { + overworld_ascending_frames(gObjectEventPic_ZygardeComplete, 4, 4), +}; #endif //P_FAMILY_ZYGARDE @@ -4607,7 +4607,7 @@ static const struct SpriteFrameImage sPicTable_Crabominable[] = { static const struct SpriteFrameImage sPicTable_OricorioBaile[] = { overworld_ascending_frames(gObjectEventPic_OricorioBaile, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_OricorioPomPom[] = { +static const struct SpriteFrameImage sPicTable_OricorioPomPom[] = { overworld_ascending_frames(gObjectEventPic_OricorioPomPom, 4, 4), }; static const struct SpriteFrameImage sPicTable_OricorioPau[] = { @@ -4615,7 +4615,7 @@ static const struct SpriteFrameImage sPicTable_OricorioPau[] = { }; static const struct SpriteFrameImage sPicTable_OricorioSensu[] = { overworld_ascending_frames(gObjectEventPic_OricorioSensu, 4, 4), -};*/ +}; #endif //P_FAMILY_ORICORIO #if P_FAMILY_CUTIEFLY @@ -4967,9 +4967,9 @@ static const struct SpriteFrameImage sPicTable_NecrozmaDawnWings[] = { static const struct SpriteFrameImage sPicTable_Magearna[] = { overworld_ascending_frames(gObjectEventPic_Magearna, 4, 4), }; -/*static const struct SpriteFrameImage sPicTable_MagearnaOriginalColor[] = { +static const struct SpriteFrameImage sPicTable_MagearnaOriginalColor[] = { overworld_ascending_frames(gObjectEventPic_MagearnaOriginalColor, 4, 4), -};*/ +}; #endif //P_FAMILY_MAGEARNA #if P_FAMILY_MARSHADOW diff --git a/src/data/pokemon/species_info/gen_1_families.h b/src/data/pokemon/species_info/gen_1_families.h index 386418fa2c..72b4e43c0b 100644 --- a/src/data/pokemon/species_info/gen_1_families.h +++ b/src/data/pokemon/species_info/gen_1_families.h @@ -2088,6 +2088,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconSprite = gMonIcon_RaticateAlolan, .iconPalIndex = 2, FOOTPRINT(Raticate) + OVERWORLD( + sPicTable_RaticateAlolan, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_RaticateAlolan, + gShinyOverworldPalette_RaticateAlolan + ) .isTotem = TRUE, .isAlolanForm = TRUE, .levelUpLearnset = sRaticateAlolanLevelUpLearnset, @@ -3410,6 +3418,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconPalIndexFemale = 2, #endif FOOTPRINT(Pikachu) + OVERWORLD( + sPicTable_Pikachu, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pikachu, + gShinyOverworldPalette_Pikachu + ) .cannotBeTraded = TRUE, .allPerfectIVs = TRUE, .levelUpLearnset = sPikachuLevelUpLearnset, @@ -11842,6 +11858,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconSprite = gMonIcon_MarowakAlolan, .iconPalIndex = 1, FOOTPRINT(Marowak) + OVERWORLD( + sPicTable_MarowakAlolan, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_MarowakAlolan, + gShinyOverworldPalette_MarowakAlolan + ) .isTotem = TRUE, .isAlolanForm = TRUE, .levelUpLearnset = sMarowakAlolanLevelUpLearnset, @@ -15606,6 +15630,14 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconPalIndexFemale = 2, #endif FOOTPRINT(Eevee) + OVERWORLD( + sPicTable_Eevee, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Eevee, + gShinyOverworldPalette_Eevee + ) .cannotBeTraded = TRUE, .allPerfectIVs = TRUE, .levelUpLearnset = sEeveeLevelUpLearnset, diff --git a/src/data/pokemon/species_info/gen_4_families.h b/src/data/pokemon/species_info/gen_4_families.h index 6b37bb2065..c0fdd1ecec 100644 --- a/src/data/pokemon/species_info/gen_4_families.h +++ b/src/data/pokemon/species_info/gen_4_families.h @@ -6348,6 +6348,14 @@ const struct SpeciesInfo gSpeciesInfoGen4[] = .iconSprite = gMonIcon_ShayminSky, .iconPalIndex = 1, FOOTPRINT(Shaymin) + OVERWORLD( + sPicTable_ShayminSky, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_ShayminSky, + gShinyOverworldPalette_ShayminSky + ) .isMythical = TRUE, .isFrontierBanned = TRUE, .levelUpLearnset = sShayminSkyLevelUpLearnset, diff --git a/src/data/pokemon/species_info/gen_5_families.h b/src/data/pokemon/species_info/gen_5_families.h index d73559f169..e8907999fe 100644 --- a/src/data/pokemon/species_info/gen_5_families.h +++ b/src/data/pokemon/species_info/gen_5_families.h @@ -11047,6 +11047,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconSprite = gMonIcon_TornadusTherian, .iconPalIndex = 1, FOOTPRINT(Tornadus) + OVERWORLD( + sPicTable_TornadusTherian, + SIZE_64x64, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_TornadusTherian, + gShinyOverworldPalette_TornadusTherian + ) .isLegendary = TRUE, .levelUpLearnset = sTornadusLevelUpLearnset, .teachableLearnset = sTornadusTeachableLearnset, @@ -11169,6 +11177,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconSprite = gMonIcon_ThundurusTherian, .iconPalIndex = 0, FOOTPRINT(Thundurus) + OVERWORLD( + sPicTable_ThundurusTherian, + SIZE_64x64, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_ThundurusTherian, + gShinyOverworldPalette_ThundurusTherian + ) .isLegendary = TRUE, .levelUpLearnset = sThundurusLevelUpLearnset, .teachableLearnset = sThundurusTeachableLearnset, @@ -11418,6 +11434,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconSprite = gMonIcon_LandorusTherian, .iconPalIndex = 0, FOOTPRINT(Landorus) + OVERWORLD( + sPicTable_LandorusTherian, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_LandorusTherian, + gShinyOverworldPalette_LandorusTherian + ) .isLegendary = TRUE, .levelUpLearnset = sLandorusLevelUpLearnset, .teachableLearnset = sLandorusTeachableLearnset, @@ -11549,6 +11573,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconSprite = gMonIcon_KyuremWhite, .iconPalIndex = 0, FOOTPRINT(Kyurem) + OVERWORLD( + sPicTable_KyuremWhite, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_KyuremWhite, + gShinyOverworldPalette_KyuremWhite + ) .isLegendary = TRUE, .cannotBeTraded = TRUE, .isFrontierBanned = TRUE, @@ -11612,6 +11644,14 @@ const struct SpeciesInfo gSpeciesInfoGen5[] = .iconSprite = gMonIcon_KyuremBlack, .iconPalIndex = 0, FOOTPRINT(Kyurem) + OVERWORLD( + sPicTable_KyuremBlack, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_KyuremBlack, + gShinyOverworldPalette_KyuremBlack + ) .isLegendary = TRUE, .cannotBeTraded = TRUE, .isFrontierBanned = TRUE, diff --git a/src/data/pokemon/species_info/gen_6_families.h b/src/data/pokemon/species_info/gen_6_families.h index 973f24e13d..5946ac5c44 100644 --- a/src/data/pokemon/species_info/gen_6_families.h +++ b/src/data/pokemon/species_info/gen_6_families.h @@ -4554,6 +4554,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Pumpkaboo, .iconPalIndex = 2, FOOTPRINT(Pumpkaboo) + OVERWORLD( + sPicTable_PumpkabooSmall, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pumpkaboo, + gShinyOverworldPalette_Pumpkaboo + ) .levelUpLearnset = sPumpkabooLevelUpLearnset, .teachableLearnset = sPumpkabooTeachableLearnset, .eggMoveLearnset = sPumpkabooEggMoveLearnset, @@ -4609,6 +4617,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Pumpkaboo, .iconPalIndex = 2, FOOTPRINT(Pumpkaboo) + OVERWORLD( + sPicTable_PumpkabooLarge, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pumpkaboo, + gShinyOverworldPalette_Pumpkaboo + ) .levelUpLearnset = sPumpkabooLevelUpLearnset, .teachableLearnset = sPumpkabooTeachableLearnset, .eggMoveLearnset = sPumpkabooEggMoveLearnset, @@ -4666,6 +4682,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Pumpkaboo, .iconPalIndex = 2, FOOTPRINT(Pumpkaboo) + OVERWORLD( + sPicTable_PumpkabooSuper, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Pumpkaboo, + gShinyOverworldPalette_Pumpkaboo + ) .levelUpLearnset = sPumpkabooLevelUpLearnset, .teachableLearnset = sPumpkabooTeachableLearnset, .eggMoveLearnset = sPumpkabooEggMoveLearnset, @@ -4783,6 +4807,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Gourgeist, .iconPalIndex = 2, FOOTPRINT(Gourgeist) + OVERWORLD( + sPicTable_GourgeistSmall, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Gourgeist, + gShinyOverworldPalette_Gourgeist + ) .levelUpLearnset = sGourgeistLevelUpLearnset, .teachableLearnset = sGourgeistTeachableLearnset, .formSpeciesIdTable = sGourgeistFormSpeciesIdTable, @@ -4836,6 +4868,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Gourgeist, .iconPalIndex = 2, FOOTPRINT(Gourgeist) + OVERWORLD( + sPicTable_GourgeistLarge, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Gourgeist, + gShinyOverworldPalette_Gourgeist + ) .levelUpLearnset = sGourgeistLevelUpLearnset, .teachableLearnset = sGourgeistTeachableLearnset, .formSpeciesIdTable = sGourgeistFormSpeciesIdTable, @@ -4891,6 +4931,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Gourgeist, .iconPalIndex = 2, FOOTPRINT(Gourgeist) + OVERWORLD( + sPicTable_GourgeistSuper, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Gourgeist, + gShinyOverworldPalette_Gourgeist + ) .levelUpLearnset = sGourgeistLevelUpLearnset, .teachableLearnset = sGourgeistTeachableLearnset, .formSpeciesIdTable = sGourgeistFormSpeciesIdTable, @@ -5578,6 +5626,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Zygarde10, .iconPalIndex = 1, FOOTPRINT(Zygarde) + OVERWORLD( + sPicTable_Zygarde10, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Zygarde10, + gShinyOverworldPalette_Zygarde10 + ) .isLegendary = TRUE, .isFrontierBanned = TRUE, .levelUpLearnset = sZygardeLevelUpLearnset, @@ -5631,6 +5687,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_Zygarde10, .iconPalIndex = 1, FOOTPRINT(Zygarde) + OVERWORLD( + sPicTable_Zygarde10, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_Zygarde10, + gShinyOverworldPalette_Zygarde10 + ) .isLegendary = TRUE, .isFrontierBanned = TRUE, .levelUpLearnset = sZygardeLevelUpLearnset, @@ -5688,6 +5752,14 @@ const struct SpeciesInfo gSpeciesInfoGen6[] = .iconSprite = gMonIcon_ZygardeComplete, .iconPalIndex = 1, FOOTPRINT(Zygarde) + OVERWORLD( + sPicTable_ZygardeComplete, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_ZygardeComplete, + gShinyOverworldPalette_ZygardeComplete + ) .isLegendary = TRUE, .isFrontierBanned = TRUE, .levelUpLearnset = sZygardeLevelUpLearnset, diff --git a/src/data/pokemon/species_info/gen_7_families.h b/src/data/pokemon/species_info/gen_7_families.h index 4669051d04..dfee119ed5 100644 --- a/src/data/pokemon/species_info/gen_7_families.h +++ b/src/data/pokemon/species_info/gen_7_families.h @@ -1481,6 +1481,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconSprite = gMonIcon_OricorioPomPom, .iconPalIndex = 1, FOOTPRINT(Oricorio) + OVERWORLD( + sPicTable_OricorioPomPom, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_OricorioPomPom, + gShinyOverworldPalette_OricorioPomPom + ) .levelUpLearnset = sOricorioLevelUpLearnset, .teachableLearnset = sOricorioTeachableLearnset, .eggMoveLearnset = sOricorioEggMoveLearnset, @@ -1537,6 +1545,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconSprite = gMonIcon_OricorioPau, .iconPalIndex = 1, FOOTPRINT(Oricorio) + OVERWORLD( + sPicTable_OricorioPau, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_OricorioPau, + gShinyOverworldPalette_OricorioPau + ) .levelUpLearnset = sOricorioLevelUpLearnset, .teachableLearnset = sOricorioTeachableLearnset, .eggMoveLearnset = sOricorioEggMoveLearnset, @@ -1593,6 +1609,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconSprite = gMonIcon_OricorioSensu, .iconPalIndex = 0, FOOTPRINT(Oricorio) + OVERWORLD( + sPicTable_OricorioSensu, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_OricorioSensu, + gShinyOverworldPalette_OricorioSensu + ) .levelUpLearnset = sOricorioLevelUpLearnset, .teachableLearnset = sOricorioTeachableLearnset, .eggMoveLearnset = sOricorioEggMoveLearnset, @@ -4620,6 +4644,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconSprite = gMonIcon_MimikyuDisguised, .iconPalIndex = 1, FOOTPRINT(Mimikyu) + OVERWORLD( + sPicTable_MimikyuDisguised, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_MimikyuDisguised, + gShinyOverworldPalette_MimikyuDisguised + ) .isTotem = TRUE, .levelUpLearnset = sMimikyuLevelUpLearnset, .teachableLearnset = sMimikyuTeachableLearnset, @@ -6458,6 +6490,14 @@ const struct SpeciesInfo gSpeciesInfoGen7[] = .iconSprite = gMonIcon_MagearnaOriginalColor, .iconPalIndex = 0, FOOTPRINT(Magearna) + OVERWORLD( + sPicTable_MagearnaOriginalColor, + SIZE_32x32, + SHADOW_SIZE_M, + TRACKS_FOOT, + gOverworldPalette_MagearnaOriginalColor, + gShinyOverworldPalette_MagearnaOriginalColor + ) .isMythical = TRUE, .isFrontierBanned = TRUE, .levelUpLearnset = sMagearnaLevelUpLearnset, diff --git a/src/data/pokemon/species_info/gen_8_families.h b/src/data/pokemon/species_info/gen_8_families.h index 2f63abf560..3f8257d966 100644 --- a/src/data/pokemon/species_info/gen_8_families.h +++ b/src/data/pokemon/species_info/gen_8_families.h @@ -3460,14 +3460,6 @@ const struct SpeciesInfo gSpeciesInfoGen8[] = .iconSprite = gMonIcon_ToxtricityGigantamax, .iconPalIndex = 0, FOOTPRINT(Toxtricity) - OVERWORLD( - sPicTable_ToxtricityLowKey, - SIZE_32x32, - SHADOW_SIZE_M, - TRACKS_FOOT, - gOverworldPalette_ToxtricityLowKey, - gShinyOverworldPalette_ToxtricityLowKey - ) .isGigantamax = TRUE, .levelUpLearnset = sToxtricityLowKeyLevelUpLearnset, .teachableLearnset = sToxtricityLowKeyTeachableLearnset, From 9bdc9e5dab3bbe0dc5a1d73d2f74a704ae965f79 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:49:29 -0400 Subject: [PATCH 080/133] Disguise KO prevention consideration (#5375) --- src/battle_ai_switch_items.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 2fb8417ad9..c33878465a 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -1610,7 +1610,7 @@ static u32 GetSwitchinHitsToKO(s32 damageTaken, u32 battler) u8 weatherDuration = gWishFutureKnock.weatherDuration, holdEffectParam = ItemId_GetHoldEffectParam(item); u32 opposingBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(battler))); u32 opposingAbility = gBattleMons[opposingBattler].ability, ability = AI_DATA->switchinCandidate.battleMon.ability; - bool32 usedSingleUseHealingItem = FALSE; + bool32 usedSingleUseHealingItem = FALSE, opponentCanBreakMold = IsMoldBreakerTypeAbility(opposingBattler, opposingAbility); s32 currentHP = startingHP; // No damage being dealt @@ -1632,7 +1632,7 @@ static u32 GetSwitchinHitsToKO(s32 damageTaken, u32 battler) currentHP = currentHP - damageTaken; // One shot prevention effects - if (damageTaken >= maxHP && currentHP == maxHP && (heldItemEffect == HOLD_EFFECT_FOCUS_SASH || (B_STURDY >= GEN_5 && ability == ABILITY_STURDY))) + if (damageTaken >= maxHP && currentHP == maxHP && (heldItemEffect == HOLD_EFFECT_FOCUS_SASH || (!opponentCanBreakMold && B_STURDY >= GEN_5 && ability == ABILITY_STURDY))) currentHP = 1; // If mon is still alive, apply weather impact first, as it might KO the mon before it can heal with its item (order is weather -> item -> status) @@ -1697,6 +1697,10 @@ static u32 GetSwitchinHitsToKO(s32 damageTaken, u32 battler) hitsToKO++; } + // Disguise will always add an extra hit to KO + if (opponentCanBreakMold && AI_DATA->switchinCandidate.battleMon.species == SPECIES_MIMIKYU_DISGUISED) + hitsToKO++; + // If mon had a hypothetical status from TSpikes, clear it if (AI_DATA->switchinCandidate.hypotheticalStatus == TRUE) { From 3d8b73300a1aaa6912327e718865c5cdba9d4197 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:46:59 +0200 Subject: [PATCH 081/133] Fixes Multi Hit moves removing destiny bond flag in the middle of attack (#5377) --- src/battle_script_commands.c | 3 ++- test/battle/move_effect/destiny_bond.c | 17 +++++++++++++++++ test/battle/move_effect/multi_hit.c | 25 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 test/battle/move_effect/destiny_bond.c diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d4afe23be4..08444ae569 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4686,7 +4686,8 @@ static void MoveValuesCleanUp(void) gIsCriticalHit = FALSE; gBattleScripting.moveEffect = 0; gBattleCommunication[MISS_TYPE] = 0; - gHitMarker &= ~HITMARKER_DESTINYBOND; + if (!gMultiHitCounter) + gHitMarker &= ~HITMARKER_DESTINYBOND; gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; } diff --git a/test/battle/move_effect/destiny_bond.c b/test/battle/move_effect/destiny_bond.c new file mode 100644 index 0000000000..baba378f6b --- /dev/null +++ b/test/battle/move_effect/destiny_bond.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Destiny Bond faints the opposing mon if it fainted from the attack") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DESTINY_BOND); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DESTINY_BOND, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + MESSAGE("Wobbuffet took Foe Wobbuffet with it!"); + MESSAGE("Foe Wobbuffet fainted!"); + } +} diff --git a/test/battle/move_effect/multi_hit.c b/test/battle/move_effect/multi_hit.c index df9cfea807..fca9da8150 100644 --- a/test/battle/move_effect/multi_hit.c +++ b/test/battle/move_effect/multi_hit.c @@ -231,3 +231,28 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after killi MESSAGE("Bagon's Speed rose!"); } } + +SINGLE_BATTLE_TEST("Multi Hit moves will not disrupt Destiny Bond flag") +{ + u32 hp; + PARAMETRIZE { hp = 11; } + PARAMETRIZE { hp = 55; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(55); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DESTINY_BOND); MOVE(opponent, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DESTINY_BOND, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + if (hp == 55) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + } + MESSAGE("Wobbuffet took Foe Wobbuffet with it!"); + MESSAGE("Foe Wobbuffet fainted!"); + } +} From 8c0580828fd2f33afd887afc86f19922c59e3f92 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 13 Sep 2024 09:27:16 -0300 Subject: [PATCH 082/133] Apply suggestions from code review Co-authored-by: Bassoonian --- src/event_object_movement.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index c290456284..ef09ea93f3 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -3463,9 +3463,8 @@ bool8 MovementType_Wander_Step3(struct ObjectEvent *objectEvent, struct Sprite * ClearObjectEventMovement(objectEvent, sprite); sprite->sTypeFuncId = 4; return TRUE; - } else if ( - OW_MON_WANDER_WALK == TRUE - && IS_OW_MON_OBJ(objectEvent)) + } + else if (OW_MON_WANDER_WALK == TRUE && IS_OW_MON_OBJ(objectEvent)) { UpdateMonMoveInPlace(objectEvent, sprite); } @@ -5668,10 +5667,9 @@ bool8 MovementType_MoveInPlace_Step1(struct ObjectEvent *objectEvent, struct Spr if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) sprite->sTypeFuncId = 0; // similar to UpdateMonMoveInPlace - else if ( - OW_FOLLOWERS_BOBBING == TRUE - && IS_OW_MON_OBJ(objectEvent) - && (sprite->data[3] & 7) == 2) + else if (OW_FOLLOWERS_BOBBING == TRUE + && IS_OW_MON_OBJ(objectEvent) + && (sprite->data[3] & 7) == 2) { sprite->y2 ^= 1; } From 9633cefd11824249e58e10fa46c6f90c50723711 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Fri, 13 Sep 2024 15:30:01 +0200 Subject: [PATCH 083/133] Custom anim table follower macro & Farfetch'd example (#5309) Co-authored-by: Hedara --- include/event_object_movement.h | 1 + src/data/object_events/object_event_anims.h | 2 +- src/data/pokemon/species_info.h | 22 +++++++++++++++++++ .../pokemon/species_info/gen_1_families.h | 3 ++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 2906789b37..77da1ef1fd 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -113,6 +113,7 @@ extern const struct OamData gObjectEventBaseOam_64x64; extern const struct SubspriteTable sOamTables_32x32[]; extern const struct SubspriteTable sOamTables_64x64[]; extern const union AnimCmd *const sAnimTable_Following[]; +extern const union AnimCmd *const sAnimTable_Following_Asym[]; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; extern const u8 gReflectionEffectPaletteMap[]; diff --git a/src/data/object_events/object_event_anims.h b/src/data/object_events/object_event_anims.h index bde3c3b0d5..d6229e57c9 100755 --- a/src/data/object_events/object_event_anims.h +++ b/src/data/object_events/object_event_anims.h @@ -1173,7 +1173,7 @@ const union AnimCmd *const sAnimTable_Following[] = { }; // Like the above, but has separate frames for facing right -static const union AnimCmd *const sAnimTable_Following_Asym[] = { +const union AnimCmd *const sAnimTable_Following_Asym[] = { [ANIM_STD_FACE_SOUTH] = sAnim_FaceSouth, [ANIM_STD_FACE_NORTH] = sAnim_FaceNorth2F, [ANIM_STD_FACE_WEST] = sAnim_FaceWest2F, diff --git a/src/data/pokemon/species_info.h b/src/data/pokemon/species_info.h index 4f21223eee..de8423fb44 100644 --- a/src/data/pokemon/species_info.h +++ b/src/data/pokemon/species_info.h @@ -46,8 +46,30 @@ .affineAnims = gDummySpriteAffineAnimTable, \ }, \ OVERWORLD_PAL(__VA_ARGS__) + +#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...) \ +.overworldData = { \ + .tileTag = TAG_NONE, \ + .paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \ + .reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, \ + .size = (_size == SIZE_32x32 ? 512 : 2048), \ + .width = (_size == SIZE_32x32 ? 32 : 64), \ + .height = (_size == SIZE_32x32 ? 32 : 64), \ + .paletteSlot = PALSLOT_NPC_1, \ + .shadowSize = shadow, \ + .inanimate = FALSE, \ + .compressed = COMP, \ + .tracks = _tracks, \ + .oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \ + .subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \ + .anims = _anims, \ + .images = picTable, \ + .affineAnims = gDummySpriteAffineAnimTable, \ +}, \ + OVERWORLD_PAL(__VA_ARGS__) #else #define OVERWORLD(picTable, _size, shadow, _tracks, ...) +#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...) #endif //OW_POKEMON_OBJECT_EVENTS // Maximum value for a female Pokémon is 254 (MON_FEMALE) which is 100% female. diff --git a/src/data/pokemon/species_info/gen_1_families.h b/src/data/pokemon/species_info/gen_1_families.h index 72b4e43c0b..0acdc9dada 100644 --- a/src/data/pokemon/species_info/gen_1_families.h +++ b/src/data/pokemon/species_info/gen_1_families.h @@ -9515,11 +9515,12 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconSprite = gMonIcon_Farfetchd, .iconPalIndex = 1, FOOTPRINT(Farfetchd) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Farfetchd, SIZE_32x32, SHADOW_SIZE_M, TRACKS_NONE, + sAnimTable_Following_Asym, gOverworldPalette_Farfetchd, gShinyOverworldPalette_Farfetchd ) From 100c7dd8ad8f1419a6cd1e2d9248fdc26c7d79d4 Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:08:23 +0100 Subject: [PATCH 084/133] Fixes Powder (status) interactions + tests (#5370) * Simplified fix from #4638 * Fixes interactions with Z-Moves, Magic Guard, Heavy Rain, Pledge * Powder Tests * Remove duplicate * Assume Powder is a powder move * Add config for Powder Rain interaction * Only primal rain * Z-Moves fix handled in Canceller_Z_Moves * Fix BattleScript name * Make sure Z-Move + Powder still damages user --- data/battle_scripts_1.s | 10 ++ include/battle_scripts.h | 1 + include/config/battle.h | 1 + src/battle_script_commands.c | 7 +- src/battle_util.c | 26 ++- test/battle/ability/dancer.c | 22 +++ test/battle/gimmick/zmove.c | 54 ++++++ test/battle/move_effect/pledge.c | 45 +++++ test/battle/move_effect/powder.c | 295 +++++++++++++++++++++++++++++++ 9 files changed, 452 insertions(+), 9 deletions(-) create mode 100644 test/battle/move_effect/powder.c diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e042201d94..0040c7e804 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -9404,6 +9404,16 @@ BattleScript_ZMoveActivateStatus:: copybyte sSTATCHANGER, sSAVED_STAT_CHANGER return +BattleScript_ZMoveActivatePowder:: + flushtextbox + trytrainerslidezmovemsg + savetarget + printstring STRINGID_ZPOWERSURROUNDS + playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL + setzeffect + restoretarget + goto BattleScript_MoveUsedPowder + BattleScript_ZEffectPrintString:: printfromtable gZEffectStringIds waitmessage B_WAIT_TIME_LONG diff --git a/include/battle_scripts.h b/include/battle_scripts.h index fb1e72af24..893ab42a5e 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -329,6 +329,7 @@ extern const u8 BattleScript_ProteanActivates[]; extern const u8 BattleScript_DazzlingProtected[]; extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[]; extern const u8 BattleScript_MoveUsedPowder[]; +extern const u8 BattleScript_ZMoveActivatePowder[]; extern const u8 BattleScript_SelectingNotAllowedStuffCheeks[]; extern const u8 BattleScript_SelectingNotAllowedStuffCheeksInPalace[]; extern const u8 BattleScript_SelectingNotAllowedBelch[]; diff --git a/include/config/battle.h b/include/config/battle.h index 55091fb331..501c4162ee 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -122,6 +122,7 @@ #define B_KNOCK_OFF_REMOVAL GEN_LATEST // In Gen5+, Knock Off removes the foe's item instead of rendering it unusable. #define B_HEAL_BELL_SOUNDPROOF GEN_LATEST // In Gen5, Heal Bell affects all mons with Soundproof. In Gen6-8 it affects inactive mons, but not battlers. In Gen9 it always affects the user. #define B_CHARGE GEN_LATEST // In Gen8-, Charge status is lost regardless of the typing of the next move. +#define B_POWDER_RAIN GEN_LATEST // In Gen7+, Powder doesn't damage the user of a Fire type move in heavy rain. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 08444ae569..59ff47018e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6291,19 +6291,20 @@ static void Cmd_moveend(void) if (gMovesInfo[gCurrentMove].danceMove) { u32 battler, nextDancer = 0; - bool32 turnOnHitmarker = FALSE; + bool32 hasDancerTriggered = FALSE; for (battler = 0; battler < gBattlersCount; battler++) { if (gSpecialStatuses[battler].dancerUsedMove) { // in case a battler fails to act on a Dancer-called move - turnOnHitmarker = TRUE; + hasDancerTriggered = TRUE; break; } } if (!(gMoveResultFlags & (MOVE_RESULT_FAILED | MOVE_RESULT_DOESNT_AFFECT_FOE) + || (gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE && !hasDancerTriggered) || (!gSpecialStatuses[gBattlerAttacker].dancerUsedMove && gBattleStruct->bouncedMoveIsUsed))) { // Dance move succeeds // Set target for other Dancer mons; set bit so that mon cannot activate Dancer off of its own move @@ -6317,8 +6318,6 @@ static void Cmd_moveend(void) { if (GetBattlerAbility(battler) == ABILITY_DANCER && !gSpecialStatuses[battler].dancerUsedMove) { - if (turnOnHitmarker) - gHitMarker |= HITMARKER_ATTACKSTRING_PRINTED; if (!nextDancer || (gBattleMons[battler].speed < gBattleMons[nextDancer & 0x3].speed)) nextDancer = battler | 0x4; } diff --git a/src/battle_util.c b/src/battle_util.c index b2cf51ba0c..78491d2756 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3558,11 +3558,20 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType) case CANCELLER_POWDER_STATUS: if (gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER) { - if (moveType == TYPE_FIRE) + u32 partnerMove = gBattleMons[BATTLE_PARTNER(gBattlerAttacker)].moves[gBattleStruct->chosenMovePositions[BATTLE_PARTNER(gBattlerAttacker)]]; + if ((moveType == TYPE_FIRE && !gBattleStruct->pledgeMove) + || (gCurrentMove == MOVE_FIRE_PLEDGE && partnerMove == MOVE_GRASS_PLEDGE) + || (gCurrentMove == MOVE_GRASS_PLEDGE && partnerMove == MOVE_FIRE_PLEDGE && gBattleStruct->pledgeMove)) { gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE; - gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; - gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD + && (B_POWDER_RAIN < GEN_7 || !IsBattlerWeatherAffected(gBattlerAttacker, B_WEATHER_RAIN_PRIMAL))) + gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + + if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE + || gBattleStruct->obedienceResult != OBEYS + || HasTrainerUsedGimmick(gBattlerAttacker, GIMMICK_Z_MOVE)) + gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; effect = 1; } @@ -3592,7 +3601,15 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType) SetGimmickAsActivated(gBattlerAttacker, GIMMICK_Z_MOVE); gBattleScripting.battler = gBattlerAttacker; - if (gMovesInfo[gCurrentMove].category == DAMAGE_CATEGORY_STATUS) + if (gProtectStructs[gBattlerAttacker].powderSelfDmg) + { + if (!alreadyUsed) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivatePowder; + } + } + else if (gMovesInfo[gCurrentMove].category == DAMAGE_CATEGORY_STATUS) { if (!alreadyUsed) { @@ -6058,7 +6075,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (IsBattlerAlive(battler) && (gMovesInfo[gCurrentMove].danceMove) && !gSpecialStatuses[battler].dancerUsedMove - && (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED) && gBattlerAttacker != battler) { // Set bit and save Dancer mon's original target diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c index 660a719c69..b39fa291c8 100644 --- a/test/battle/ability/dancer.c +++ b/test/battle/ability/dancer.c @@ -145,3 +145,25 @@ SINGLE_BATTLE_TEST("Dancer-called attacks have their type updated") MESSAGE("It's super effective!"); } } + +DOUBLE_BATTLE_TEST("Dancer doesn't call a move that didn't execute due to Powder") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_FIERY_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_FIERY_DANCE].type == TYPE_FIRE); + PLAYER(SPECIES_VOLCARONA); + PLAYER(SPECIES_ORICORIO); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerLeft, MOVE_FIERY_DANCE, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIERY_DANCE, playerLeft); + HP_BAR(opponentLeft); + ABILITY_POPUP(playerRight, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIERY_DANCE, playerRight); + } + } +} diff --git a/test/battle/gimmick/zmove.c b/test/battle/gimmick/zmove.c index 51c6516106..4e6fc26cae 100644 --- a/test/battle/gimmick/zmove.c +++ b/test/battle/gimmick/zmove.c @@ -397,6 +397,60 @@ SINGLE_BATTLE_TEST("(Z-MOVE) Z-Sleep Talk turns Weather Ball into Breakneck Blit } } +SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves and deals 25% of maximum HP to the user") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FIRIUM_Z); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER, gimmick: GIMMICK_Z_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ZMOVE_ACTIVATE, player); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_INFERNO_OVERDRIVE, player); + } THEN { + EXPECT_MUL_EQ(player->maxHP, UQ_4_12(0.75), player->hp); + } +} + +DOUBLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves (from Z-Mirror Move)") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(gMovesInfo[MOVE_MIRROR_MOVE].type == TYPE_FLYING); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FLYINIUM_Z); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, MOVE_EMBER, target: playerLeft); MOVE(playerLeft, MOVE_MIRROR_MOVE, gimmick: GIMMICK_Z_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ZMOVE_ACTIVATE, playerLeft); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_INFERNO_OVERDRIVE, playerLeft); + } +} + +SINGLE_BATTLE_TEST("(Z-MOVE) Powder blocks Fire type Z-Moves but not boosts granted") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_WILL_O_WISP].type == TYPE_FIRE); + ASSUME(gMovesInfo[MOVE_WILL_O_WISP].zMove.effect == Z_EFFECT_ATK_UP_1); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_FIRIUM_Z); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_WILL_O_WISP, gimmick: GIMMICK_Z_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ZMOVE_ACTIVATE, player); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, player); + } THEN { + EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1); + } +} + // Miscellaneous Interactions DOUBLE_BATTLE_TEST("(Z-MOVE) Instruct fails if the target last used a Z-Move") { diff --git a/test/battle/move_effect/pledge.c b/test/battle/move_effect/pledge.c index d2cc16aa47..2098217827 100644 --- a/test/battle/move_effect/pledge.c +++ b/test/battle/move_effect/pledge.c @@ -331,6 +331,51 @@ DOUBLE_BATTLE_TEST("Damage calculation: Combined pledge move") } } +DOUBLE_BATTLE_TEST("Pledge move combo interactions with Powder are correct") +{ + // Fire Pledge as the first move or Fire Pledge combo should fail + u32 moveLeft, moveRight, speedLeft, speedRight; + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_WATER_PLEDGE; speedLeft = 4; speedRight = 3; } // FAIL 1 + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_WATER_PLEDGE; speedLeft = 3; speedRight = 4; } + PARAMETRIZE { moveLeft = MOVE_WATER_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 4; speedRight = 3; } + PARAMETRIZE { moveLeft = MOVE_WATER_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 3; speedRight = 4; } + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_GRASS_PLEDGE; speedLeft = 4; speedRight = 3; } // FAIL 1 + PARAMETRIZE { moveLeft = MOVE_FIRE_PLEDGE; moveRight = MOVE_GRASS_PLEDGE; speedLeft = 3; speedRight = 4; } // FAIL 2 + PARAMETRIZE { moveLeft = MOVE_GRASS_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 4; speedRight = 3; } + PARAMETRIZE { moveLeft = MOVE_GRASS_PLEDGE; moveRight = MOVE_FIRE_PLEDGE; speedLeft = 3; speedRight = 4; } // FAIL 2 + GIVEN { + ASSUME(gMovesInfo[MOVE_FIRE_PLEDGE].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Speed(speedLeft); } + PLAYER(SPECIES_WYNAUT) { Speed(speedRight); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } + OPPONENT(SPECIES_VIVILLON) { Speed(5); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerLeft, moveLeft, target: opponentLeft); MOVE(playerRight, moveRight, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + if (speedLeft > speedRight && moveLeft == MOVE_FIRE_PLEDGE) { // FAIL 1 + NOT ANIMATION(ANIM_TYPE_MOVE, moveLeft, playerLeft); + HP_BAR(playerLeft); + ANIMATION(ANIM_TYPE_MOVE, moveRight, playerRight); + } + else if (speedLeft > speedRight) { + NOT HP_BAR(playerLeft); + if (moveLeft == MOVE_GRASS_PLEDGE) + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerRight); + else + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerRight); + } + else if (moveLeft == MOVE_WATER_PLEDGE || moveRight == MOVE_WATER_PLEDGE) { + NOT HP_BAR(playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + } + else { // FAIL 2 + HP_BAR(playerLeft); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + } + } +} + DOUBLE_BATTLE_TEST("Pledge move combo fails if ally fails to act - Sleep Right") { u32 speedPLeft, speedPRight, speedOLeft, speedORight; diff --git a/test/battle/move_effect/powder.c b/test/battle/move_effect/powder.c new file mode 100644 index 0000000000..dbd1570e6c --- /dev/null +++ b/test/battle/move_effect/powder.c @@ -0,0 +1,295 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_POWDER].effect == EFFECT_POWDER); + ASSUME(gMovesInfo[MOVE_POWDER].powderMove == TRUE); + ASSUME(gMovesInfo[MOVE_EMBER].type == TYPE_FIRE); +} + + +SINGLE_BATTLE_TEST("Powder blocks the target's Fire type moves and deals 25% of maximum HP to target") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_MUL_EQ(player->maxHP, UQ_4_12(0.75), player->hp); + } +} + +SINGLE_BATTLE_TEST("Powder blocks the target's Fire type moves and consumes PP") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Moves(MOVE_EMBER); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->pp[0], gMovesInfo[MOVE_EMBER].pp - 1); + } +} + +SINGLE_BATTLE_TEST("Powder only blocks the target's Fire type moves on the same turn") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); } + TURN { MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } THEN { + EXPECT_EQ(player->maxHP, player->hp); + } +} + +SINGLE_BATTLE_TEST("Powder doesn't damage target if it has Magic Guard") +{ + GIVEN { + PLAYER(SPECIES_ALAKAZAM) { Ability(ABILITY_MAGIC_GUARD); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->maxHP, player->hp); + } +} + +SINGLE_BATTLE_TEST("Powder doesn't damage target under heavy rain") +{ + GIVEN { + ASSUME(B_POWDER_RAIN >= GEN_7); + PLAYER(SPECIES_KYOGRE_PRIMAL) { Ability(ABILITY_PRIMORDIAL_SEA); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->maxHP, player->hp); + } +} + +DOUBLE_BATTLE_TEST("Powder blocks the target's Fire type moves even if it doesn't target Powder user") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerLeft, MOVE_EMBER, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, playerLeft); + HP_BAR(opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Powder fails if target is already affected by Powder") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VIVILLON); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, MOVE_POWDER, target: playerLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentLeft); + } +} + +SINGLE_BATTLE_TEST("Powder fails if the target is Grass type") +{ + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_VENUSAUR].types[0] == TYPE_GRASS || gSpeciesInfo[SPECIES_VENUSAUR].types[1] == TYPE_GRASS); + PLAYER(SPECIES_VENUSAUR); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } +} + +SINGLE_BATTLE_TEST("Powder fails if the target has Overcoat") +{ + GIVEN { + PLAYER(SPECIES_FORRETRESS) { Ability(ABILITY_OVERCOAT); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } +} + +DOUBLE_BATTLE_TEST("Powder still blocks the target's Fire type moves even if it was given Grass type") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].effect == EFFECT_THIRD_TYPE); + ASSUME(gMovesInfo[MOVE_FORESTS_CURSE].argument == TYPE_GRASS); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_TREVENANT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, MOVE_FORESTS_CURSE, target: playerLeft); MOVE(playerLeft, MOVE_EMBER, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FORESTS_CURSE, opponentLeft); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, playerLeft); + HP_BAR(opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Powder still blocks the target's Fire type moves even if it was given Overcoat") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DOODLE].effect == EFFECT_DOODLE); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_FORRETRESS) { Ability(ABILITY_OVERCOAT); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(playerRight, MOVE_DOODLE, target: opponentLeft); MOVE(playerLeft, MOVE_EMBER, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOODLE, playerRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, playerLeft); + HP_BAR(opponentLeft); + } + } THEN { + EXPECT_EQ(playerLeft->ability, ABILITY_OVERCOAT); + } +} + +SINGLE_BATTLE_TEST("Powder prevents Protean from changing its user to Fire type") +{ + GIVEN { + PLAYER(SPECIES_GRENINJA) { Ability(ABILITY_PROTEAN); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ABILITY_POPUP(player, ABILITY_PROTEAN); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent); + } + } +} + +SINGLE_BATTLE_TEST("Powder doesn't prevent a Fire move from thawing its user out") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_FLAME_WHEEL].thawsUser); + ASSUME(gMovesInfo[MOVE_FLAME_WHEEL].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_FLAME_WHEEL); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + MESSAGE("Wobbuffet was defrosted by Flame Wheel!"); + STATUS_ICON(player, none: TRUE); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FLAME_WHEEL, player); + HP_BAR(opponent); + } + } +} + +SINGLE_BATTLE_TEST("Powder doesn't consume Berry from Fire type Natural Gift but prevents using the move") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_NATURAL_GIFT].effect == EFFECT_NATURAL_GIFT); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_CHERI_BERRY); } + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(opponent, MOVE_POWDER); MOVE(player, MOVE_NATURAL_GIFT); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_NATURAL_GIFT, player); + HP_BAR(opponent); + } + } THEN { + EXPECT_EQ(player->item, ITEM_CHERI_BERRY); + } +} + +DOUBLE_BATTLE_TEST("Powder damages a target using Shell Trap even if it wasn't hit by a Physical move") +{ + u32 move; + PARAMETRIZE { move = MOVE_TACKLE; } + PARAMETRIZE { move = MOVE_EMBER; } + PARAMETRIZE { move = MOVE_TICKLE;} + GIVEN { + ASSUME(gMovesInfo[MOVE_SHELL_TRAP].effect == EFFECT_SHELL_TRAP); + ASSUME(gMovesInfo[MOVE_SHELL_TRAP].type == TYPE_FIRE); + ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL); + ASSUME(gMovesInfo[MOVE_EMBER].category == DAMAGE_CATEGORY_SPECIAL); + ASSUME(gMovesInfo[MOVE_TICKLE].category == DAMAGE_CATEGORY_STATUS); + ASSUME(gMovesInfo[MOVE_TICKLE].effect == EFFECT_TICKLE); + PLAYER(SPECIES_TURTONATOR); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + OPPONENT(SPECIES_VIVILLON); + } WHEN { + TURN { MOVE(playerLeft, MOVE_SHELL_TRAP); MOVE(opponentRight, MOVE_POWDER, target: playerLeft); MOVE(opponentLeft, move, target: playerLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, move, opponentLeft); + if (move != MOVE_TICKLE) + HP_BAR(playerLeft); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerLeft); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); + } + HP_BAR(playerLeft); + } +} From c7e1e857f376e4f30fde11f3e640c51ba68da0ef Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:17:59 +0100 Subject: [PATCH 085/133] Fix After You/Shell Trap not updating battlers' actions correctly (#5384) --- src/battle_script_commands.c | 12 ++++++++++ test/battle/move_effect/after_you.c | 34 ++++++++++++++++++++++++++++ test/battle/move_effect/shell_trap.c | 32 ++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 59ff47018e..c33fce7fae 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8930,29 +8930,41 @@ static bool32 ChangeOrderTargetAfterAttacker(void) { u32 i; u8 data[MAX_BATTLERS_COUNT]; + u8 actionsData[MAX_BATTLERS_COUNT]; if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) || GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) return FALSE; for (i = 0; i < gBattlersCount; i++) + { data[i] = gBattlerByTurnOrder[i]; + actionsData[i] = gActionsByTurnOrder[i]; + } if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 2) { gBattlerByTurnOrder[1] = gBattlerTarget; + gActionsByTurnOrder[1] = actionsData[2]; gBattlerByTurnOrder[2] = data[1]; + gActionsByTurnOrder[2] = actionsData[1]; gBattlerByTurnOrder[3] = data[3]; + gActionsByTurnOrder[3] = actionsData[3]; } else if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 3) { gBattlerByTurnOrder[1] = gBattlerTarget; + gActionsByTurnOrder[1] = actionsData[3]; gBattlerByTurnOrder[2] = data[1]; + gActionsByTurnOrder[2] = actionsData[1]; gBattlerByTurnOrder[3] = data[2]; + gActionsByTurnOrder[3] = actionsData[2]; } else // Attacker == 1, Target == 3 { gBattlerByTurnOrder[2] = gBattlerTarget; + gActionsByTurnOrder[2] = actionsData[3]; gBattlerByTurnOrder[3] = data[2]; + gActionsByTurnOrder[3] = actionsData[2]; } return TRUE; } diff --git a/test/battle/move_effect/after_you.c b/test/battle/move_effect/after_you.c index fa6e47e0e2..b788fab725 100644 --- a/test/battle/move_effect/after_you.c +++ b/test/battle/move_effect/after_you.c @@ -52,5 +52,39 @@ DOUBLE_BATTLE_TEST("After You does nothing if the target has already moved") } } +DOUBLE_BATTLE_TEST("After You calculates correct targets if only one pokemon is left on the opposing side") +{ + GIVEN { + PLAYER(SPECIES_GRENINJA) { Speed(120); } + PLAYER(SPECIES_REGIROCK) { Speed(10); } + OPPONENT(SPECIES_PIDGEOT) { Speed(100); } + OPPONENT(SPECIES_DRAGONITE) { Speed(60); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_AFTER_YOU, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentLeft); + MOVE(opponentRight, MOVE_CELEBRATE); + } + TURN { + MOVE(playerLeft, MOVE_AFTER_YOU, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentRight); + MOVE(opponentRight, MOVE_CELEBRATE); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, playerLeft); + MESSAGE("Regirock took the kind offer!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentLeft); + MESSAGE("Foe Pidgeot fainted!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, playerLeft); + MESSAGE("Regirock took the kind offer!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + } +} + TO_DO_BATTLE_TEST("After You doesn't fail if the turner remains the same after After You (Gen8+)"); TO_DO_BATTLE_TEST("After You ignores the effects of Quash"); diff --git a/test/battle/move_effect/shell_trap.c b/test/battle/move_effect/shell_trap.c index cd63be2376..40febf040e 100644 --- a/test/battle/move_effect/shell_trap.c +++ b/test/battle/move_effect/shell_trap.c @@ -166,3 +166,35 @@ DOUBLE_BATTLE_TEST("Shell Trap activates immediately after being hit on turn 3 a HP_BAR(opponentRight); } } + +DOUBLE_BATTLE_TEST("Shell Trap targets correctly if one of the opponents has fainted") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SHELL_TRAP].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_GRENINJA) { Speed(60); } + PLAYER(SPECIES_TURTONATOR) { Speed(10); } + OPPONENT(SPECIES_BLASTOISE) { Speed(120); } + OPPONENT(SPECIES_SCIZOR) { Speed(100); } + } WHEN { + TURN { + MOVE(opponentLeft, MOVE_TACKLE, target: playerRight); + MOVE(playerRight, MOVE_SHELL_TRAP); + } + TURN { + MOVE(opponentLeft, MOVE_TACKLE, target: playerRight); + MOVE(playerRight, MOVE_SHELL_TRAP); + } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerRight); + MESSAGE("Foe Scizor fainted!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft); + + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SHELL_TRAP_SETUP, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SHELL_TRAP, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft); + } +} From fbea1e7e7eb43c762d0da472620eb36fbfb3dd97 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sat, 14 Sep 2024 08:16:20 +0200 Subject: [PATCH 086/133] Fixes Defog used by the wrong side when there is a Substitue and Screen (#5381) --- src/battle_script_commands.c | 7 ++++++- test/battle/move_effect/defog.c | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 76c39377a1..bfb7eec56d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8637,6 +8637,10 @@ static void RemoveAllTerrains(void) BattleScriptPushCursor(); \ gBattlescriptCurrInstr = battlescript; \ } \ + else \ + { \ + gBattlerAttacker = saveBattler; \ + } \ return TRUE; \ } \ } @@ -8651,9 +8655,9 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear) struct SideTimer *sideTimer = &gSideTimers[i]; u32 *sideStatuses = &gSideStatuses[i]; - gBattlerAttacker = i; // For correct battle string. Ally's / Foe's if (GetBattlerSide(battlerAtk) != i) { + gBattlerAttacker = i; // For correct battle string. Ally's / Foe's DEFOG_CLEAR(SIDE_STATUS_REFLECT, reflectTimer, BattleScript_SideStatusWoreOffReturn, MOVE_REFLECT); DEFOG_CLEAR(SIDE_STATUS_LIGHTSCREEN, lightscreenTimer, BattleScript_SideStatusWoreOffReturn, MOVE_LIGHT_SCREEN); DEFOG_CLEAR(SIDE_STATUS_MIST, mistTimer, BattleScript_SideStatusWoreOffReturn, MOVE_MIST); @@ -8662,6 +8666,7 @@ static bool32 TryDefogClear(u32 battlerAtk, bool32 clear) } if (B_DEFOG_EFFECT_CLEARING >= GEN_6) { + gBattlerAttacker = i; // For correct battle string. Ally's / Foe's DEFOG_CLEAR(SIDE_STATUS_SPIKES, spikesAmount, BattleScript_SpikesDefog, 0); DEFOG_CLEAR(SIDE_STATUS_STEALTH_ROCK, stealthRockAmount, BattleScript_StealthRockDefog, 0); DEFOG_CLEAR(SIDE_STATUS_TOXIC_SPIKES, toxicSpikesAmount, BattleScript_ToxicSpikesDefog, 0); diff --git a/test/battle/move_effect/defog.c b/test/battle/move_effect/defog.c index 80d500d2ee..ab6d647a97 100644 --- a/test/battle/move_effect/defog.c +++ b/test/battle/move_effect/defog.c @@ -383,3 +383,21 @@ DOUBLE_BATTLE_TEST("Defog lowers evasiveness by 1 and removes everything it can" } } } + +SINGLE_BATTLE_TEST("Defog is used on the correct side if opposing mon is behind a substitute with Screen up") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_LIGHT_SCREEN); } + TURN { MOVE(opponent, MOVE_SUBSTITUTE); MOVE(player, MOVE_DEFOG); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_LIGHT_SCREEN, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SUBSTITUTE, opponent); + MESSAGE("Wobbuffet used Defog!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DEFOG, player); + MESSAGE("Foe Wobbuffet's evasiveness fell!"); + MESSAGE("Foe's Light Screen wore off!"); + } +} From 79776bf6bbd3421ef5fd0a6978041f330981d3a0 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Sat, 14 Sep 2024 04:45:26 -0400 Subject: [PATCH 087/133] ShouldSwitchIfWonderGuard tests and cleanup (#5383) --- include/random.h | 3 ++- src/battle_ai_switch_items.c | 6 ++--- test/battle/ai/ai_switching.c | 49 ++++++++++++++++++++++++++++++++++- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/include/random.h b/include/random.h index d254a08f03..b2eddce27d 100644 --- a/include/random.h +++ b/include/random.h @@ -199,7 +199,8 @@ enum RandomTag RNG_TRACE, RNG_FICKLE_BEAM, RNG_AI_ABILITY, - RNG_AI_HASBADODDS, + RNG_AI_SWITCH_HASBADODDS, + RNG_AI_SWITCH_WONDER_GUARD, RNG_SHELL_SIDE_ARM, }; diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index c19cbd05c5..c959e99674 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -180,7 +180,7 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult) && gBattleMons[battler].hp >= gBattleMons[battler].maxHP / 4))) { // 50% chance to stay in regardless - if (!RandomPercentage(RNG_AI_HASBADODDS, 50)) + if (!RandomPercentage(RNG_AI_SWITCH_HASBADODDS, 50)) return FALSE; // Switch mon out @@ -203,7 +203,7 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult) return FALSE; // 50% chance to stay in regardless - if (!RandomPercentage(RNG_AI_HASBADODDS, 50)) + if (!RandomPercentage(RNG_AI_SWITCH_HASBADODDS, 50)) return FALSE; // Switch mon out @@ -284,7 +284,7 @@ static bool32 ShouldSwitchIfWonderGuard(u32 battler, bool32 emitResult) move = GetMonData(&party[i], MON_DATA_MOVE1 + j); if (move != MOVE_NONE) { - if (AI_GetTypeEffectiveness(move, battler, opposingBattler) >= UQ_4_12(2.0) && Random() % 3 < 2) + if (AI_GetTypeEffectiveness(move, battler, opposingBattler) >= UQ_4_12(2.0) && (RandomPercentage(RNG_AI_SWITCH_WONDER_GUARD, 66) || ((AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_SMART_SWITCHING)))) { // We found a mon. gBattleStruct->AI_monToSwitchIntoId[battler] = i; diff --git a/test/battle/ai/ai_switching.c b/test/battle/ai/ai_switching.c index b3927509f0..6fb9b499d9 100644 --- a/test/battle/ai/ai_switching.c +++ b/test/battle/ai/ai_switching.c @@ -360,7 +360,7 @@ AI_SINGLE_BATTLE_TEST("AI won't use trapping behaviour if player only has 1 mon AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if mon would be OKHO'd and they have a good switchin 50% of the time") { - PASSES_RANDOMLY(50, 100, RNG_AI_HASBADODDS); + PASSES_RANDOMLY(50, 100, RNG_AI_SWITCH_HASBADODDS); GIVEN { ASSUME(gSpeciesInfo[SPECIES_RHYDON].types[0] == TYPE_GROUND); ASSUME(gSpeciesInfo[SPECIES_PELIPPER].types[0] == TYPE_WATER); @@ -375,3 +375,50 @@ AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if mon would TURN { MOVE(player, MOVE_THUNDERBOLT) ; EXPECT_SWITCH(opponent, 1); } } } + +AI_SINGLE_BATTLE_TEST("Switch AI: AI will switch out if it can't deal damage to a mon with Wonder Guard 66% of the time") +{ + u32 aiOmniscientFlag = 0; + PARAMETRIZE { aiOmniscientFlag = 0; } + PARAMETRIZE { aiOmniscientFlag = AI_FLAG_OMNISCIENT; } + PASSES_RANDOMLY(66, 100, RNG_AI_SWITCH_WONDER_GUARD); + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[0] == TYPE_BUG); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[1] == TYPE_GHOST); + ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); + AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | aiOmniscientFlag); + PLAYER(SPECIES_SHEDINJA) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SHADOW_BALL); } + } WHEN { + if(aiOmniscientFlag == 0) { + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_MOVE(opponent, MOVE_TACKLE); } + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_SWITCH(opponent, 1); } + } + else { + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_SWITCH(opponent, 1); } + } + + } +} + +AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_SWITCHING: AI will switch out if it can't deal damage to a mon with Wonder Guard 100% of the time") +{ + PASSES_RANDOMLY(100, 100, RNG_AI_SWITCH_WONDER_GUARD); + GIVEN { + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[0] == TYPE_BUG); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].types[1] == TYPE_GHOST); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[0] == ABILITY_WONDER_GUARD); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[1] == ABILITY_NONE); + ASSUME(gSpeciesInfo[SPECIES_SHEDINJA].abilities[2] == ABILITY_NONE); + ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(gMovesInfo[MOVE_SHADOW_BALL].type == TYPE_GHOST); + AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SMART_SWITCHING); + PLAYER(SPECIES_SHEDINJA) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_TACKLE); } + OPPONENT(SPECIES_ZIGZAGOON) { Moves(MOVE_SHADOW_BALL); } + } WHEN { + TURN { MOVE(player, MOVE_TACKLE) ; EXPECT_SWITCH(opponent, 1); } + } +} From 9d483cee5d46116043762197210edfb3b4af61b5 Mon Sep 17 00:00:00 2001 From: Liamjd14 Date: Sat, 14 Sep 2024 19:21:34 +0100 Subject: [PATCH 088/133] Enable asym for followers issue #5382 (#5385) * Applies asym code to followers galarian slowbro tinkaton line scovillain --- graphics/pokemon/scovillain/overworld.png | Bin 1337 -> 1338 bytes .../pokemon/slowbro/galarian/overworld.png | Bin 1099 -> 1096 bytes graphics/pokemon/tinkaton/overworld.png | Bin 1606 -> 1587 bytes .../pokemon/species_info/gen_1_families.h | 3 ++- .../pokemon/species_info/gen_9_families.h | 16 ++++++++-------- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/graphics/pokemon/scovillain/overworld.png b/graphics/pokemon/scovillain/overworld.png index ed7dfcaedc9b6ae55f1af184e552e0bc06e7ba88..6eb5fac3e42c23de2b395877a3dc18716dc363af 100644 GIT binary patch delta 1245 zcmV<31S0#n3c3oAZGX5)L_t(&f$dm}lH({0G(on&ul)btUQ1vb%)^pG6pH2qNp%)MID z(On|^<=r6pq)#&X3|GPatOCYZ)cU%rB^oExGGLr|O&lkz_xowXWXf5Iv{Z9nGqO7K4nGP| zI7HW2M0}CttvKaDpAQ%wMC`IGWM6X@zNjVgd8N7~`YPb7mwa5umbFL8+SUuLUL3aKZJm$2jIu8%JS*zOD$&S6$q zaA;)4d4Gut+z1XF7|Lguz?Q-pL6(P7ptHkhu?ivv&^>-WH1v$11kW6T42(+*HPI9f zI?nmSAUA!=JwP{xSBpxtFVky~3%@%=Vd)q& zl5no_oD+iteX9H;MP*pDIMnF$OqV37H#BzaupF*(Kxrkn>ePe*FB~!)9rpUF^Uv_k z9~R*mQN#!akwdDEBl@<<7iGhh7AJVUG=J^z>O>`Stv{1ayl}{ggI;%i7Z0TzHY@5M zv@1<~b51VSZrxj);nlPlE228*kfB~-f)@^nI38{|L)z=RcpTAYKgRK-m#e+*0Y`y; zg|rTz4FZoixZy>=#Lr5_X02`1#+j-|$H%x-xNhG2t@+=iN1Qf~7dLTMoF4ucvwvcT zd&kZFTEX!Q39X{bPK`ktFxlhH;+oSm3_x z*xTE?aZo72j9CqW`z9bNYpsuXWBnCp=MMiWt_*o^Mt;I$fo}xm{k=B`D6)410z+`z zo9lsWI;&R(4rJs3%LWWL?{D-W$5s(qmo*jG!?JGTK%F|zaT>Y;p$gQ{TMxV`&^7Pf zKLe>cf$7~oH;xGpi5r{uRzO#vhZMlu>ytpgnee++|NHR|BEUe^wlI1C00000NkvXX Hu0mjf!mdVz delta 1244 zcmV<21S9*p3b_i9ZGX2(L_t(&f$dm}a_cG#G_h=fU-|#Py(@uj-cEbxoVhbMBxyTd zfwZdy+782ae8+cu$9Mb(hLQ1CGHo*cN~WI-^Lo9;u`R(*^yxC(wrQH@`Hw1K@@h#( zcZ%?rPlM!>KGEni+ywix3K%n@*4JGv(KMr`sUv~#Qvn(ZJb&pEjXpy~749ieG^}W8 zXM&MRNBO+`43d1(lxaRgisek8-*C#4J|8pG#35kIpT`Z8kgF1Dsph^Tk~-54KMGJd zMCXiH@kNri;*DIA#}>GHRGG92~-Nemhp}R z@DJJoNOI3_4&tVT_w{*X7@-OaK5v&mDM8^k>j(^yo?bdg8RY_H9Yzn(E$3i@F$jRc z&Ph)c&m7`Ax4^j+=*!B<2~_G+lYp8G1HAfy0E26C*?(>W!~|)&Egl3Q@>>MoO({^> zVX|N=4mi&M;LyZU)gdzQ^SYAS+tVZ$b1e07g#<)4xk3Xl;DMNlLF zg%hYI(A{C0RDh8zX@>(pkqi#OQxD5}kwcXKx{T^1pL*8yB6hsy`nW=XJ!iOb3bVq3 zLnAXSYkyE6BRH^UC|`X5kL1q?8hI!Mx;l&&s~} zNOExuqq9#&eRl+m0+L68P=JT1sW%XH4?altuZmQnIjAyDWrgOml1 zFXXSeJGowy5zetgZkH~?Pz?n=Z;IX^i9S?u0Dq+n?-mD`)O4%S4VBD|2s*3`hEQ>( zNC1OrSXJ`6QXt=9ZL$bRdK+cG3hV6^@Ns-44vG4_3Vq^1Tyz84tVADM5x}MlqZSAF z#YO`%ZzKdQUXGz1M8AX12Tt)qptHlQ0+FOGer*)@U%1H}68Nu+(nn;4pg#z_K2=y1 z2!9M$uEOZD1|;6lrDellTR3awjUJ24i9{IihsT*DoT32j@P)fFy)JU&xkD6|jzJ?? z&Q|U@F^Jcv%0Ez4hDD2gjiSKINRrqax_0QW9IkReX(d^8YC?|}4jIl4JAKvpCwS)% z3x7uxYj}gmAyvn*`o7C?Zn)Co8*h}R9e>`es6@8)XVQfi4!Lm9>(1}uzLe8uMg4%A2)Yd5aUgnigZjs@7U$s8<-_g+l_4%ME8pdwv%WBiQW6IBt4*x92_JD9~+? z*5Ye}z#|TBc+oHMt5UI9Ya6w3rs~o0F)kHuyK`=D{x|6nr`_SjO`H{{hyTTF*ni>9 za&x~{aQw`0H}8$5pYStGJc19`GZP2ACF8%H9|mu_)As%N7(Z|%$+N9toF_aKc`7`2latzt=gq!@r6vLq3`-KjERkHx}jNeKZIta&!a&LvTEr z^MULd)hh!BGV*|B1BRQAH~Ns`SXEl5H5EAgv~FTgojUh84PAjy1#0Nc2i_Fuj(hjd zK&l2Xz1!!;8Ss#}v3ausx&l3<0N$P-E%cj!-_82pkADE$9zf+JCm7!V0000Grf~a5W$s48Eek)2&2$T*pAwDkkFx9#~}!(l}lD4Wq(;MW9ZP64U?O zpA$@p_{QyB5CUZwORM6-KuIKBxNU&;p|~Y>sb3F%&^td0OaB^Y<;*j- z%g?)`MWJ7pxz+%k9i06s3`(T89C2Eu=TVoXpl-Z!m<`K{kI9v3w(zi2Py|Xe?*QT>O!)zt#X0?iQ2P;;aXMp*lYd&?kl_*?MI; zX|Yl7>7glwZ(E=mkSKoJT&izbpb$SI9_w;ou5k6IG>9=E?=zKinoN*+XuZ$M`!4#A zD{pKYeLkmXYYU z0#f1>x(2K=_f{j6jr&cG?J=B9DEii$K;kyv1jb>DhXTQOei!Hx^DOn1gUVfsInDCh zo!ff=W?t8=M^qu*o;D4x24sW5R}^@wP6;a-PhpRwQ_zMAjq&0oT&dKp* z=hHMo^a0Z*P)@me-YpD33#6IiwDX5Shfh)^D5jZ67AcR+!ZVHW&SlY~#f%r09^VzB z^wlVuA!@#iBJW~2xcHNQE(SqA1cvEQ7>X4riKGj+4bVOmx5O^>>%k9t=SN}bU*oKt zdB%46d3UrZ^y@O$8lba-vparBnjaLq{VOj97o^!((&!TYBJKye3 z>LM)G>^dMwnJwWat<b$~r>MQmN$U&m zeGtO*je8VouYl}6AMei*-A{6Pg!QC2PhN&U*Kwcy{xOVe`PX2st=<3R`scpM{?%VL c-}oT@1BhWY9uAB?zyJUM07*qoM6N<$f@T;((*OVf diff --git a/graphics/pokemon/tinkaton/overworld.png b/graphics/pokemon/tinkaton/overworld.png index 702afdab9dde80da17c64aa28814a6e310c4eeb6..382f3b4200e797e5919151d171553f3cbf56dc68 100644 GIT binary patch delta 1496 zcmV;}1t*u8E4m*SlJWeZ5<2e$#0U-tBGu`X*l_t_JkhW8>60i1hx0N}-e1`qpmzh%?_VCL2FwleY{20q$o;bo4y^on zQRtWwCyfBy%(rR4S|A0@gZH`!p#OYee%IU}&WwX{!vm83jT~?-UidR8j4@X9vnML> zIGk&EEl@o+27d?vm7~pbHT1{+13ZMDYD~ut;vv$DkJ5#6J z^}Gm#5GY9f?zyK;f{FJQ-=rF42)NJ3HbAOP41!adrtnCkV~zV>&+@`ee>#OEuv17k z5Ou=gGxADc0QoWu@FIP}MWE+7B*k(7!Z|ZY^iiXf<9|Lm&@6I^PyOi>(!Bvg?nCoc zsL3mVt_bW_2|!MeIp+}IWRIMd(E;W&gD4tm)HzOZp6jVP{nK*WpS42W6l7scoZIRh z5P^<_sX+QP3V{}G#5reubP+i`EyIz5`OKiCk3KrpbIiOdcHHo1qA&?e@yOgsJ%`bN zM_`CjLVqiedjv7a<|;7Y0j2Z~uzNFuL?G+aS!pysAO6NS9eKMrtSC#U z39J<|2b}YwkM)xSY(j59;+8@2X%u-b^7wK)&yl&}mOpO_pS6KFpLa(GOo4TRyzo3o z$pHQ845)Z-P^=n79tv$iZW_4Z&#S`1@dK6v?*{P9!=D@Amj-kORpD?7@L5UqA8CX!@>i}=y^r&R>G)njwAnDoZpBdB$l&vZ0*DY}1ojKxyAEc?uG}FUi>$P`F_bb*fYauz{}h22;>CZ`<5?V7b7?m_kbmSi`p=a?AhA3e&+OAS<%9l8;VB9!!t490 zLr7)9i@-k@l|Q`!bQW3hY=91*4lj-d%nXuPw8?N%gyKM@Z{&miULnGDUw0gNm~bQ@ z0>4?{_jM!pRZ?ilQCgMo9Hzo?)|E$t3I~eiN}irU4QTRv4ye+ zcpQ_5-3gboHVFjjOSXfvUg*vizqYBjL4e}x#&VM_OnTLjBZdc~^sN#*o5v0p!Dd{5T=TCBI%6o+p z-NFHjKLUA#UAm_+Ku&4OZ`bnlfQ`a#MB4xwMVrfOs^qz;{|IoqFy(_lJo%Azbl~9^ zW9UcUq4i+8EqacND0;{9QG&`~5IH0xZdZ9R%-fiY%iNG#lhvWTwV`cJ*5;QCjTTkGDM yS0Tq>yt1!Cp75tE;T!+akH7zM`IUfwDSrV0WM7wQD;tgg0000@-9`hO8f;I_@ZIso9fOdOaP^Z;DHIu=a)c~Qvpll&R=|9>WsVB_N63~-Lv#<2kt zgSh{AofUG#wE;7K<_eVx=Igi#?xfJ0Kr`sw0CMY>qoDy~gPa(!ISq3CER6#*e_j-# zQ04?Dz{&jV8ZZ~gLCfI1P6FgU9~j>?Hb^pK6Qy-SE zN|m1#&jjKlu$m=+BtgbpLV#U7LMyEU!bb*iG~6hnq_{lmu{!@#^1eTFg|;Z@#2C4> zRXd;pk%gH+{uByIJdn1EXpy;!wSnkqX7sCqP^QWUQsKD?fK*p2) z#B+h%aWEJ{l>oK|AoaN^B;u%DEZkY00%2@W(5S-V)B#-&r44ofa^Cf4pipM|+X2Z7 z<3O7)c`nd7pGrPOf^mY|y^<#p8uhjf90-1BP=D~=ves?pz}*Ivyz5V`(3e5R#E6`1 ziY!I+1m+5b1C9BkPxP|`VnS^|@Mz0T1sO1gSl{Dc+UzcX;7X zrBK3>6yR{b=@}!NCINQgXTwGRt^yCDLx29X$Nh0&&b8g-K$KtT-)9Da#&T=ilTXW# zH~KS$yE?!T9_NvV5R3A&;g7)YgUfeq0PjU+JQ-laXTwXa0V9Jn7HiV)9HBap>1%nT zzf#Dn>2V!bXt_5B8cqyU;3)#n<09$nNuenxZB@fVibdkgE4Kzc95|LEdb)cvpnu5k zmN)tUF8O#$Ls2HsVvR%=!o(?#hEvL^H_4u3b~Ng zifv*cs~?R|s2h@10@Q{ukhl-kv2yH)YV zVe{JMJ(X0E%ljugG~~5Hjc($A@zQ}?po}oadkO<|muCFJlE)WpQg#vb4d7Aib3LYt zo_FrF(Opg&ch6$UX~s!0$4JZ~R9;{{G|gD*=B~{s2W#U`yMe R&#V9d002ovPDHLkV1k!$_Vxe( diff --git a/src/data/pokemon/species_info/gen_1_families.h b/src/data/pokemon/species_info/gen_1_families.h index 0acdc9dada..7082e64464 100644 --- a/src/data/pokemon/species_info/gen_1_families.h +++ b/src/data/pokemon/species_info/gen_1_families.h @@ -9176,11 +9176,12 @@ const struct SpeciesInfo gSpeciesInfoGen1[] = .iconSprite = gMonIcon_SlowbroGalarian, .iconPalIndex = 0, FOOTPRINT(Slowbro) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_SlowbroGalarian, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, + sAnimTable_Following_Asym, gOverworldPalette_SlowbroGalarian, gShinyOverworldPalette_SlowbroGalarian ) diff --git a/src/data/pokemon/species_info/gen_9_families.h b/src/data/pokemon/species_info/gen_9_families.h index 554c0c1d9b..650b3c5a07 100644 --- a/src/data/pokemon/species_info/gen_9_families.h +++ b/src/data/pokemon/species_info/gen_9_families.h @@ -3215,12 +3215,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconSprite = gMonIcon_Scovillain, .iconPalIndex = 1, FOOTPRINT(Scovillain) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Scovillain, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Scovillain, gShinyOverworldPalette_Scovillain ) @@ -3526,12 +3526,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconSprite = gMonIcon_Tinkatink, .iconPalIndex = 1, FOOTPRINT(Tinkatink) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Tinkatink, SIZE_32x32, SHADOW_SIZE_S, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Tinkatink, gShinyOverworldPalette_Tinkatink ) @@ -3589,12 +3589,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconSprite = gMonIcon_Tinkatuff, .iconPalIndex = 1, FOOTPRINT(Tinkatuff) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Tinkatuff, SIZE_32x32, SHADOW_SIZE_S, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Tinkatuff, gShinyOverworldPalette_Tinkatuff ) @@ -3651,12 +3651,12 @@ const struct SpeciesInfo gSpeciesInfoGen9[] = .iconSprite = gMonIcon_Tinkaton, .iconPalIndex = 1, FOOTPRINT(Tinkaton) - OVERWORLD( + OVERWORLD_SET_ANIM( sPicTable_Tinkaton, SIZE_32x32, SHADOW_SIZE_M, TRACKS_FOOT, - //sAnimTable_Following_Asym, + sAnimTable_Following_Asym, gOverworldPalette_Tinkaton, gShinyOverworldPalette_Tinkaton ) From 0d7c193e4c6a99c5cb3424f709e73b4a91a18a29 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:55:03 +0200 Subject: [PATCH 089/133] fixes Micle Berry not increasing accuracy on the next turn (#5358) * fixes Micle Berry not increasing accuracy on the next turn * adds bitfield instead of using protect struct * test from pawkkie * ndebug * renaming * delete redundant comment * typo * micle berry more detailed descriptions --- include/battle.h | 3 ++- src/battle_script_commands.c | 5 ++-- src/battle_util.c | 3 +-- test/battle/hold_effect/micle_berry.c | 33 +++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/include/battle.h b/include/battle.h index 1729c76b3d..91233c8fe8 100644 --- a/include/battle.h +++ b/include/battle.h @@ -184,9 +184,9 @@ struct ProtectStruct u32 powderSelfDmg:1; u32 usedThroatChopPreventedMove:1; u32 statRaised:1; - u32 usedMicleBerry:1; u32 usedCustapBerry:1; // also quick claw u32 touchedProtectLike:1; + u32 unused:1; // End of 32-bit bitfield u16 disableEjectPack:1; u16 statFell:1; @@ -802,6 +802,7 @@ struct BattleStruct u32 stellarBoostFlags[NUM_BATTLE_SIDES]; // stored as a bitfield of flags for all types for each side u8 fickleBeamBoosted:1; u8 obedienceResult:3; + u8 usedMicleBerry; }; // The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c33fce7fae..04f3c966bb 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1689,9 +1689,8 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u break; } - if (gProtectStructs[battlerAtk].usedMicleBerry) + if (gBattleStruct->usedMicleBerry & 1u << battlerAtk) { - gProtectStructs[battlerAtk].usedMicleBerry = FALSE; if (atkAbility == ABILITY_RIPEN) calc = (calc * 140) / 100; // ripen gives 40% acc boost else @@ -6417,7 +6416,6 @@ static void Cmd_moveend(void) DebugPrintfLevel(MGBA_LOG_WARN, "savedTargetCount is greater than 0! More calls to SaveBattlerTarget than RestoreBattlerTarget!"); // #endif } - gBattleStruct->targetsDone[gBattlerAttacker] = 0; gProtectStructs[gBattlerAttacker].targetAffected = FALSE; gProtectStructs[gBattlerAttacker].shellTrap = FALSE; @@ -6438,6 +6436,7 @@ static void Cmd_moveend(void) gBattleStruct->poisonPuppeteerConfusion = FALSE; gBattleStruct->fickleBeamBoosted = FALSE; gBattleStruct->distortedTypeMatchups = 0; + gBattleStruct->usedMicleBerry &= ~(1u << gBattlerAttacker); if (gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) gBattleStruct->pledgeMove = FALSE; if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_Z_MOVE) diff --git a/src/battle_util.c b/src/battle_util.c index 78491d2756..a3711f161c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6825,8 +6825,7 @@ static u8 TrySetMicleBerry(u32 battler, u32 itemId, bool32 end2) { if (HasEnoughHpToEatBerry(battler, 4, itemId)) { - gProtectStructs[battler].usedMicleBerry = TRUE; // battler's next attack has increased accuracy - + gBattleStruct->usedMicleBerry |= 1u << battler; if (end2) { BattleScriptExecute(BattleScript_MicleBerryActivateEnd2); diff --git a/test/battle/hold_effect/micle_berry.c b/test/battle/hold_effect/micle_berry.c index 2bc44c8069..87f6742609 100644 --- a/test/battle/hold_effect/micle_berry.c +++ b/test/battle/hold_effect/micle_berry.c @@ -64,3 +64,36 @@ SINGLE_BATTLE_TEST("Micle Berry raises the holder's accuracy by 1.2") ANIMATION(ANIM_TYPE_MOVE, MOVE_SUBMISSION, player); } } + +SINGLE_BATTLE_TEST("Micle Berry increases the accuracy of the next used move across turns") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ROCK_SLIDE].accuracy == 90); + PASSES_RANDOMLY(100, 100, RNG_ACCURACY); + PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(26); Item(ITEM_MICLE_BERRY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + TURN { MOVE(player, MOVE_ROCK_SLIDE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, player); + } +} + +SINGLE_BATTLE_TEST("Micle Berry increases the accuracy of the next used move the same turn the berry was triggered") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ROCK_SLIDE].accuracy == 90); + PASSES_RANDOMLY(100, 100, RNG_ACCURACY); + PLAYER(SPECIES_WOBBUFFET) { MaxHP(100); HP(26); Item(ITEM_MICLE_BERRY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_ROCK_SLIDE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_SLIDE, player); + } +} From f6319d8446616e22450f45d28fa2b0f9b3ff83b7 Mon Sep 17 00:00:00 2001 From: Sadfish the Sad Date: Sun, 15 Sep 2024 02:22:40 -0400 Subject: [PATCH 090/133] new animations for many moves more details in description (#5367) New: Me First, Zippy Zap, Splishy Splash, Floaty Fall, Pika Papow, Bouncy Bubble, Buzzy Buzz, Sizzly Slide, Glitzy Glow, Baddy Bad, Sappy Seed, Freezy Frost, Sparkly Swirl, Veevee Volley, Snap Trap, Astral Barrage, Burning Bulwark Updated: Aura Sphere, Dark Void, Spirit Shackle Fixed: Springtide Storm, Bleakwind Storm, Wildbolt Storm, Sandsear Storm, Clangorous Soul(Blaze) --- data/battle_anim_scripts.s | 572 ++++++++++++++++-- .../sprites/spirit_shackle_arrow.png | Bin 236 -> 341 bytes include/battle_anim.h | 3 + src/battle_anim_bug.c | 3 +- src/battle_anim_effects_1.c | 4 +- src/battle_anim_effects_3.c | 11 + src/battle_anim_fight.c | 6 +- src/battle_anim_flying.c | 5 +- src/battle_anim_mon_movement.c | 16 +- src/battle_anim_new.c | 79 ++- src/battle_anim_rock.c | 31 +- 11 files changed, 607 insertions(+), 123 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 296de004ac..14f9a3f592 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -691,6 +691,32 @@ gBattleAnimMove_LuckyChant:: end gBattleAnimMove_MeFirst:: + loadspritegfx ANIM_TAG_ORBS + loadspritegfx ANIM_TAG_FINGER + loadspritegfx ANIM_TAG_THOUGHT_BUBBLE + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_ORBS, 0, 12, 12, 0x7FAF + setalpha 11, 5 + monbg_static ANIM_DEF_PARTNER + splitbgprio_all + createsprite gThoughtBubbleSpriteTemplate, ANIM_ATTACKER, 11, 0, 100 + playsewithpan SE_M_METRONOME, SOUND_PAN_ATTACKER + delay 6 + createsprite gMetronomeFingerSpriteTemplate, ANIM_ATTACKER, 12, 0 + delay 24 + loopsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER, 22, 3 + waitforvisualfinish + panse SE_M_MINIMIZE, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0 + createvisualtask AnimTask_ShrinkTargetCopy, 5, 128, 24 + delay 15 + createsprite gMimicOrbSpriteTemplate, ANIM_TARGET, 2, -12, 24 + delay 10 + setarg 7, 0xFFFF + waitforvisualfinish + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 11, RGB_WHITE + waitforvisualfinish + clearmonbg_static ANIM_DEF_PARTNER + blendoff end gBattleAnimMove_Copycat:: @@ -1092,8 +1118,8 @@ gBattleAnimMove_ForcePalm:: end gBattleAnimMove_AuraSphere:: - loadspritegfx ANIM_TAG_METEOR - loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_IMPACT_2 + loadspritegfx ANIM_TAG_LEER monbg ANIM_ATK_PARTNER splitbgprio ANIM_ATTACKER setalpha 12, 8 @@ -3600,17 +3626,18 @@ gBattleAnimMove_DarkVoid:: waitbgfadein createvisualtask AnimTask_DestinyBondWhiteShadow, 5, 0, 0x30 loopsewithpan SE_M_CONFUSE_RAY, SOUND_PAN_ATTACKER, 5, 2 - delay 0x30 - createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0xfd00, 0x15, 0, 0x70 @Last is speed - createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0xfd00, 0x15, 0, 0x70 @Last is speed - delay 0x40 + delay 48 + createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, -768, 21, 0, 112 @Last is duration + createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, -768, 21, 0, 112 @Last is duration + delay 64 invisible ANIM_TARGET invisible ANIM_DEF_PARTNER - createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, 1, 0, 0x20, 0x3c + createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0, 32, 60 + createsprite gDarkVoidPurpleStarsTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_DEF_PARTNER, 0, 32, 60 waitforvisualfinish createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0, 16 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_DEF_PARTNER, 0, 16 - delay 0x20 + delay 32 call UnsetPsychicBg visible ANIM_TARGET visible ANIM_DEF_PARTNER @@ -9827,27 +9854,25 @@ gBattleAnimMove_BanefulBunker:: gBattleAnimMove_SpiritShackle:: loadspritegfx ANIM_TAG_SPIRIT_ARROW @Arrow - loadspritegfx ANIM_TAG_CHAIN_LINK @Chain - monbg ANIM_DEF_PARTNER - splitbgprio ANIM_TARGET - setalpha 12, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x10, 0x0 - waitforvisualfinish + loadspritegfx ANIM_TAG_PURPLE_CHAIN + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_PURPLE_CHAIN, 0, 9, 9, RGB_BLACK + monbg ANIM_TARGET playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER - createsprite gSpiritShackleArrowTemplate, ANIM_TARGET, 2, 0x10, 0x0, 0x0, 0x0, 0xf - delay 0x8 + createsprite gSpiritShackleArrowTemplate, ANIM_TARGET, 2, 16, 0, 0, 0, 15 + delay 8 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 10, 1 waitforvisualfinish - loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER, 0x1c, 0x2 - createsprite gSpiritShackleChainTemplate, ANIM_TARGET, 2, 0xfff0, 0xfff0 - delay 0x4 - createsprite gSpiritShackleChainTemplate, ANIM_TARGET, 2, 0xfff0, 0x0 - delay 0x4 - createsprite gSpiritShackleChainTemplate, ANIM_TARGET, 2, 0xfff0, 0x10 + loopsewithpan SE_M_SCRATCH, SOUND_PAN_TARGET, 6, 2 + createsprite gChainBindingSpriteTemplate, ANIM_TARGET, 4, 0, 16, 0, 1 + delay 7 + createsprite gChainBindingSpriteTemplate, ANIM_TARGET, 2, 0, 8, 1, 1 + delay 3 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1 + delay 20 + setarg 7, 0xFFFF + playsewithpan SE_M_BIND, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x0, 0x0 - waitforvisualfinish - clearmonbg ANIM_DEF_PARTNER + clearmonbg ANIM_TARGET blendoff end @@ -12621,43 +12646,385 @@ PhotonGeyserBeam: return gBattleAnimMove_ZippyZap:: - end @to do: + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_SPARK_2 + monbg ANIM_ATK_PARTNER + setalpha 12, 8 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + createsprite gGrowingShockWaveOrbSpriteTemplate, ANIM_ATTACKER, 2 @electric circle + waitforvisualfinish + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 1, 5 + createvisualtask AnimTask_TraceMonBlended, 2, 0, 4, 7, 3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + delay 4 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, 0, 0, ANIM_TARGET, 1 + call ElectricityEffect + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + blendoff + waitforvisualfinish + end gBattleAnimMove_SplishySplash:: - end @to do: + loadspritegfx ANIM_TAG_SPARK_2 + createvisualtask AnimTask_CreateSurfWave, 2, ANIM_SURF_PAL_SURF + delay 24 + panse SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 + waitforvisualfinish + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 10, 1 + call ElectricityEffect + end gBattleAnimMove_FloatyFall:: - end @to do: + loadspritegfx ANIM_TAG_ROUND_SHADOW + loadspritegfx ANIM_TAG_IMPACT + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_ROUND_SHADOW, 0, 12, 12, RGB_YELLOW + monbg ANIM_DEF_PARTNER + setalpha 12, 8 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + createsprite gFlyBallUpSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 13, 336 + waitforvisualfinish + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + createsprite gFlyBallAttackSpriteTemplate, ANIM_ATTACKER, 2, 20, FALSE + delay 20 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 6, 0, 8, 1 + playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + blendoff + waitforvisualfinish + end gBattleAnimMove_PikaPapow:: - end @to do: + createvisualtask AnimTask_GetReturnPowerLevel, 2 + delay 2 + jumpreteq 0, gBattleAnimMove_ThunderShock + jumpreteq 1, gBattleAnimMove_ShockWave + jumpreteq 2, gBattleAnimMove_Thunderbolt + jumpreteq 3, gBattleAnimMove_Thunder gBattleAnimMove_BouncyBubble:: - end @to do: + loadspritegfx ANIM_TAG_BUBBLE + loadspritegfx ANIM_TAG_SMALL_BUBBLES + loadspritegfx ANIM_TAG_ORBS + loadspritegfx ANIM_TAG_BLUE_STAR + loadspritegfx ANIM_TAG_IMPACT + monbg ANIM_TARGET + splitbgprio ANIM_TARGET + setalpha 12, 8 + delay 1 + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 12, RGB(13, 12, 31) + waitforvisualfinish + playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 + delay 2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 + waitforvisualfinish + call WaterBubblesEffectLong + call GigaDrainAbsorbEffect + waitforvisualfinish + delay 15 + call HealingEffect + waitforvisualfinish + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 12, 0, RGB(13, 12, 31) + waitforvisualfinish + clearmonbg ANIM_TARGET + blendoff + end gBattleAnimMove_BuzzyBuzz:: - end @to do: + loadspritegfx ANIM_TAG_ELECTRIC_ORBS + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_SPARK + loadspritegfx ANIM_TAG_LIGHTNING + loadspritegfx ANIM_TAG_SHOCK_3 + loadspritegfx ANIM_TAG_SPARK_2 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK + waitforvisualfinish + createsprite gSpriteTemplate_SpiritBreakChargeBall, ANIM_TARGET, 1, ANIM_TARGET + delay 10 + createvisualtask AnimTask_ElectricBolt, 5, 24, -52, 0 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 7 + createvisualtask AnimTask_ElectricBolt, 5, -24, -52, 0 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 7 + createvisualtask AnimTask_ElectricBolt, 5, 0, -60, 1 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 9 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 0, 13, RGB_BLACK + waitforvisualfinish + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 13, 0, RGB_BLACK + waitforvisualfinish + delay 20 + waitplaysewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET, 19 + call ElectricityEffect + waitforvisualfinish + delay 20 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK + waitforvisualfinish + end gBattleAnimMove_SizzlySlide:: - end @to do: + loadspritegfx ANIM_TAG_SMALL_EMBER + loadspritegfx ANIM_TAG_IMPACT + monbg ANIM_ATK_PARTNER + setalpha 12, 8 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 0 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 4 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 8 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 12 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 16 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 20 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 24 + playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER + waitforvisualfinish + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 1, 5 + createvisualtask AnimTask_TraceMonBlended, 2, 0, 4, 7, 3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + delay 4 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, 0, 0, ANIM_TARGET, 1 + createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_TARGET, RGB_RED, 12, 1, 1 + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + call FireSpreadEffect + delay 7 + createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 9 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + end gBattleAnimMove_GlitzyGlow:: - end @to do: + loadspritegfx ANIM_TAG_THIN_RING @hypervoice ring + loadspritegfx ANIM_TAG_SPARK_2 @yellow color + loadspritegfx ANIM_TAG_WATER_ORB @blue color + loadspritegfx ANIM_TAG_POISON_BUBBLE @violet color + loadspritegfx ANIM_TAG_SMALL_EMBER @flame wheel particle + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_CIRCLE_OF_LIGHT, 0, 12, 12, 0x289F + monbg ANIM_DEF_PARTNER + splitbgprio_foes ANIM_TARGET + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 0, 12, 0 @Darken + playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER + createsprite gGrowingShockWaveOrbSpriteTemplate, ANIM_ATTACKER, 0, 0 + delay 18 + panse SE_M_SCREECH, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 + createsprite gSynchronoiseVioletRingTemplate, ANIM_ATTACKER, 0, 25, 0, 0, 0, 0, 0, 1 + delay 1 + createsprite gSynchronoiseBlueRingTemplate, ANIM_ATTACKER, 0, 25, 0, 0, 0, 0, 0, 1 + delay 1 + createsprite gSynchronoiseYellowRingTemplate, ANIM_ATTACKER, 0, 25, 0, 0, 0, 0, 0, 1 + delay 36 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 6, 1 + createvisualtask AnimTask_ShakeBattleTerrain, 2, 1, 0, 6, 1 + waitforvisualfinish + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 12, 0, 0 @Darken + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + blendoff + delay 1 + unloadspritegfx ANIM_TAG_THIN_RING @hypervoice ring + unloadspritegfx ANIM_TAG_SPARK_2 @yellow color + unloadspritegfx ANIM_TAG_WATER_ORB @blue color + unloadspritegfx ANIM_TAG_POISON_BUBBLE @violet color + unloadspritegfx ANIM_TAG_SMALL_EMBER @flame wheel particle + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + waitforvisualfinish + goto gBattleAnimMove_LightScreen gBattleAnimMove_BaddyBad:: - end @to do: + loadspritegfx ANIM_TAG_STRAIGHT_BEAM + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_STRAIGHT_BEAM, 0, 14, 14, RGB_BLACK + monbg ANIM_ATTACKER + splitbgprio ANIM_ATTACKER + playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER + fadetobg BG_DARK + waitbgfadein + delay 10 + playsewithpan SE_M_LEER, SOUND_PAN_ATTACKER + createvisualtask AnimTask_NightShadeClone, 5, 133 + delay 10 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 6, 0, 16, RGB_BLACK + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 4, 0, 96, 1 + panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 + call PhotonGeyserBeam + waitforvisualfinish + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 16, 0, RGB_BLACK + waitforvisualfinish + delay 1 + restorebg + waitbgfadein + waitforvisualfinish + clearmonbg ANIM_ATTACKER + unloadspritegfx ANIM_TAG_STRAIGHT_BEAM + waitforvisualfinish + goto gBattleAnimMove_Reflect gBattleAnimMove_SappySeed:: - end @to do: + loadspritegfx ANIM_TAG_SPROUT + loadspritegfx ANIM_TAG_SEED + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_TARGET + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 40, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -20, ANIM_TARGET, 1 + delay 2 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -30, ANIM_TARGET, 1 + delay 2 + call FullBeanstalk + call FallingSeeds + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + call FullBeanstalk + waitforvisualfinish + end +FullBeanstalk: + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -10, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -20, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -30, ANIM_TARGET, 1 + createsprite gSproutGrowSpriteTemplate, ANIM_ATTACKER, 3, 0, -40, ANIM_TARGET, 1 + delay 2 + return +FallingSeeds: + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -20, 0, -10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 28, 0, 10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -10, 0, -5, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 10, 0, 6, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 24, 0, 10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -32, 0, -10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, -20, 0, -10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + createsprite gFallingSeedSpriteTemplate, ANIM_TARGET, 2, 30, 0, 10, 0 + playsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET + return gBattleAnimMove_FreezyFrost:: - end @to do: + loadspritegfx ANIM_TAG_ICICLE_SPEAR + loadspritegfx ANIM_TAG_ICE_SPIKES + loadspritegfx ANIM_TAG_IMPACT + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_ICICLE_SPEAR, 0, 0, 12, RGB_BLACK + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_ICE_SPIKES, 0, 0, 12, RGB_BLACK + waitforvisualfinish + call FreezyFrostHitEffect + call FreezyFrostHitEffect + call FreezyFrostHitEffect + call FreezyFrostHitEffect + waitforvisualfinish + call IceSpikesEffectLong + waitforvisualfinish + end +FreezyFrostHitEffect: + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, -4, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 4109, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 4, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + createsprite gFreezyFrostRisingSpearSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, -16, 16 + playsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET + delay 1 + return gBattleAnimMove_SparklySwirl:: - end @to do: + loadspritegfx ANIM_TAG_GUST + loadspritegfx ANIM_TAG_PINK_PETAL + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_GUST, 0, 15, 15, RGB(31, 21, 21) + monbg ANIM_DEF_PARTNER + splitbgprio ANIM_TARGET + playsewithpan SE_M_GUST, SOUND_PAN_TARGET + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1 + call HurricaneGust + call PinkPetalVortex + call HurricaneGust + call PinkPetalVortex + call HurricaneGust + call PinkPetalVortex + waitforvisualfinish + stopsound + clearmonbg ANIM_TARGET + end +PinkPetalVortex: + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 28, 528, 30, 13, 50, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 32, 480, 20, 16, -46, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 33, 576, 20, 8, 42, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 31, 400, 25, 11, -42, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 28, 512, 25, 16, 46, 1 + delay 2 + createsprite gPinkPetalVortexTemplate, ANIM_TARGET, 2, 0, 33, 464, 30, 15, -50, 1 + delay 2 + return gBattleAnimMove_VeeveeVolley:: - end @to do: + createvisualtask AnimTask_GetReturnPowerLevel, 2 + delay 2 + jumpreteq 0, gBattleAnimMove_Tackle + jumpreteq 1, gBattleAnimMove_Headbutt + jumpreteq 2, gBattleAnimMove_TakeDown + jumpreteq 3, gBattleAnimMove_DoubleEdge gBattleAnimMove_DoubleIronBash:: loadspritegfx ANIM_TAG_GUST @@ -13004,6 +13371,9 @@ gBattleAnimMove_ClangorousSoul:: createsprite gClangorousSoulRedFistTemplate, ANIM_ATTACKER, 2, 0x10, 0, 0, 0, 10, ANIM_ATTACKER, ANIM_LEFT_FIST, 1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish + unloadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + unloadspritegfx ANIM_TAG_SPARKLE_2 @stars + waitforvisualfinish loadspritegfx ANIM_TAG_THIN_RING @ring playsewithpan SE_SHINY, SOUND_PAN_ATTACKER createsprite gClangorousSoulRedRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x0, 0x0 @@ -13104,8 +13474,31 @@ gBattleAnimMove_DrumBeating:: blendoff end -gBattleAnimMove_SnapTrap:: @ placeholder - goto gBattleAnimMove_Bite +gBattleAnimMove_SnapTrap:: + loadspritegfx ANIM_TAG_LEAF @leaves + loadspritegfx ANIM_TAG_FLOWER @flowers + loadspritegfx ANIM_TAG_SHARP_TEETH + loadspritegfx ANIM_TAG_IMPACT + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_SHARP_TEETH, 0, 10, 10, 0x0688 + monbg ANIM_TARGET + setalpha 12, 8 + playsewithpan SE_M_BITE, SOUND_PAN_TARGET + createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0, -32, 0, 0, 819, 10 + createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0, 32, 4, 0, -819, 10 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + delay 10 + playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 192, 176, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, -192, 240, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 192, -160, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, -192, -112, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 160, 48, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, -224, -32, 40 + createsprite gTropKickLeavesTemplate, ANIM_TARGET, 1, 0, 10, 112, -128, 40 + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + end gBattleAnimMove_PyroBall:: loadspritegfx ANIM_TAG_FLAT_ROCK @@ -14848,7 +15241,44 @@ gBattleAnimMove_GlacialLance:: gBattleAnimMove_AstralBarrage:: - goto gBattleAnimMove_ShadowBall + loadspritegfx ANIM_TAG_FLAT_ROCK + loadspritegfx ANIM_TAG_ICE_CRYSTALS + loadspritegfx ANIM_TAG_GHOSTLY_SPIRIT + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_FLAT_ROCK, 0x0, 0xA, 0xA, RGB(2, 1, 4) + createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_ICE_CRYSTALS, 0x0, 0xA, 0xA, RGB(2, 1, 4) + monbg ANIM_ATK_PARTNER + splitbgprio ANIM_ATTACKER + setalpha 12, 8 + fadetobg BG_GHOST + waitbgfadein + createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, 4, 1, 180, 1 + createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 20, 0, 5 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 200, 96, 1, 120 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 20, 248, 4, 112 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 130, 160, 2, 104 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 160, 192, 0, 96 + delay 8 + createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 60, 288, 3, 88 + delay 74 + panse SE_M_BLIZZARD, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 + call BlizzardIceCrystals + call BlizzardIceCrystals + playsewithpan SE_M_BLIZZARD2, SOUND_PAN_TARGET + waitforvisualfinish + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET + createspriteontargets gCurseGhostSpriteTemplate, ANIM_TARGET, 3, 2, 8, -5, ANIM_TARGET, 0 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 8, 0, 16, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 8, 0, 16, 1 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + restorebg + waitbgfadein + blendoff + delay 1 + end @Credits to Skeli @@ -14995,8 +15425,9 @@ gBattleAnimMove_SpringtideStorm:: loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_RED_HEART playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x6, 0x0, 0xB, 0x7ADF + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 2, 6, 0, 11, 0x7ADF call HurricaneGustCentered call SpringtideStormHeartSwirl call HurricaneGustCentered @@ -15565,8 +15996,9 @@ gBattleAnimMove_BleakwindStorm:: loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_ICE_CRYSTALS playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x7FFF + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 4, 0, 11, 0x7FFF call HurricaneGustCentered call BleakwindStormIceSwirl call HurricaneGustCentered @@ -15581,7 +16013,7 @@ gBattleAnimMove_BleakwindStorm:: call BleakwindStormIceSwirl waitforvisualfinish stopsound - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x7FFF + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 1, 11, 0, 0x7FFF waitforvisualfinish end BleakwindStormIceSwirl: @@ -15605,11 +16037,12 @@ gBattleAnimMove_WildboltStorm:: loadspritegfx ANIM_TAG_SPARK_2 fadetobg BG_MAX_LIGHTNING waitbgfadeout - createvisualtask AnimTask_StartSlidingBg, 0x5, 0xff00, 0x0, 0x1, 0xffff + createvisualtask AnimTask_StartSlidingBg, 5, -256, 0, 1, 0xffff waitbgfadein playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x07FE + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 4, 0, 11, 0x07FE call HurricaneGustCentered call WildboltStormSparkSwirl call HurricaneGustCentered @@ -15624,7 +16057,7 @@ gBattleAnimMove_WildboltStorm:: call WildboltStormSparkSwirl waitforvisualfinish stopsound - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x07FE + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 1, 11, 0, 0x07FE call UnsetPsychicBg waitforvisualfinish end @@ -15650,8 +16083,9 @@ gBattleAnimMove_SandsearStorm:: loadspritegfx ANIM_TAG_SMALL_EMBER createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_GUST, 0x0, 0xA, 0xA, 0x190B playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x1F + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 88, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 88, 1 + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 4, 0, 11, 0x1F call HurricaneGustCentered call SandsearStormFireSpin call HurricaneGustCentered @@ -15666,7 +16100,7 @@ gBattleAnimMove_SandsearStorm:: call SandsearStormFireSpin waitforvisualfinish stopsound - createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x1F + createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_TARGET | F_PAL_DEF_PARTNER), 1, 11, 0, 0x1F waitforvisualfinish end @@ -15997,7 +16431,30 @@ ChillyReceptionSnowballs: return gBattleAnimMove_BurningBulwark:: - goto gBattleAnimMove_Protect + loadspritegfx ANIM_TAG_PROTECT @protect + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + monbg ANIM_ATK_PARTNER + splitbgprio ANIM_ATTACKER + waitplaysewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER 16 + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_PROTECT, 0, 13, 13, 0x015B + createsprite gProtectSpriteTemplate, ANIM_ATTACKER, 2, 24, 0, 90 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 0 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 4 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 8 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 12 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 16 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 20 + delay 2 + createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 56, 24 + createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_ATTACKER, RGB_RED, 10, 0, 2 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + end gBattleAnimMove_AlluringVoice:: loadspritegfx ANIM_TAG_THIN_RING @@ -27667,8 +28124,8 @@ Status_Thunder_Cage: @ TODO goto gBattleAnimMove_ThunderCage -Status_Snap_Trap: @ placeholder - goto gBattleAnimMove_Bite +Status_Snap_Trap: + goto gBattleAnimMove_SnapTrap Status_SandTomb: loadspritegfx ANIM_TAG_MUD_SAND @@ -33004,6 +33461,9 @@ gBattleAnimMove_ClangorousSoulblaze:: createsprite gClangorousSoulRedFistTemplate, ANIM_ATTACKER, 2, 0x10, 0x0, 0x0, 0x0, 0xa, ANIM_ATTACKER, ANIM_LEFT_FIST, 0x1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish + unloadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + unloadspritegfx ANIM_TAG_SPARKLE_2 @stars + waitforvisualfinish loadspritegfx ANIM_TAG_THIN_RING @ring playsewithpan SE_SHINY, SOUND_PAN_ATTACKER createsprite gClangorousSoulRedRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x0, 0x0 diff --git a/graphics/battle_anims/sprites/spirit_shackle_arrow.png b/graphics/battle_anims/sprites/spirit_shackle_arrow.png index ff86f33d21cd4f83c7f7419eeb578c540ef8a41c..cc520e6b5d5ee4dcee9822c660335933ce2823b4 100644 GIT binary patch delta 301 zcmaFEc$H~_N`sf3r=1Ueo4brGY19+2JsTth?3y^w370~qErTVAC~|>cZIUl zA_ZeTlfu>|4}nTJN(%hkfilKGHiK7#raX{hNq6*hWMJ6X&;2Kn705RT@CkAK|Nnon zmc)`JOaAv|olWry3JRLjtoi?5^S!-EAgv4&-301)N^ukenT$!^?k@kAvVS@XxH6+Io;h1!ZR!y3Yq+_aqY)8Z`3vjPR`>S1C5#JFUj8a%kk^oV_FH}*$V&{Ku6{1-oD!MK`G1mcNgc!giEjVv)%W`{-~zw)=gkJnm3z84 zhE&W+PFTP(W$H98h0iy=yt$btusV5rALR~U<#N6l(lLGUDh(c9Uk5<}efLm72`Qy += gBattleAnimArgs[1]; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index ed2e7457f6..8c2d73ff80 100644 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1281,6 +1281,17 @@ const struct SpriteTemplate gTeraCrystalSpreadSpriteTemplate = .callback = AnimTask_TeraCrystalShatter, }; +const struct SpriteTemplate gPinkPetalVortexTemplate = +{ + .tileTag = ANIM_TAG_PINK_PETAL, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSweetScentPetalAnimCmdTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; + // Task data for AnimTask_TeraCrystalShatter #define tCounter data[0] #define tDX data[6] diff --git a/src/battle_anim_fight.c b/src/battle_anim_fight.c index e150a2a57d..ed18e89f9b 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -414,9 +414,9 @@ const struct SpriteTemplate gPalmSpriteTemplate = const struct SpriteTemplate gAuraSphereBlast = { - .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, - .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, - .oam = &gOamData_AffineOff_ObjNormal_64x64, + .tileTag = ANIM_TAG_IMPACT_2, + .paletteTag = ANIM_TAG_IMPACT_2, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 1fd587fa4c..7d21624495 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -359,7 +359,10 @@ const struct SpriteTemplate gSkyAttackBirdSpriteTemplate = // same as AnimEllipticalGust but centered on targets static void AnimEllipticalGustCentered(struct Sprite *sprite) { - InitSpritePosToAnimTargetsCentre(sprite, FALSE); + if (IsDoubleBattle()) + InitSpritePosToAnimTargetsCentre(sprite, FALSE); + else + InitSpritePosToAnimTarget(sprite, FALSE); sprite->y += 20; sprite->data[1] = 191; sprite->callback = AnimEllipticalGust_Step; diff --git a/src/battle_anim_mon_movement.c b/src/battle_anim_mon_movement.c index 051524a689..04fd111a84 100644 --- a/src/battle_anim_mon_movement.c +++ b/src/battle_anim_mon_movement.c @@ -487,11 +487,7 @@ static void ReverseVerticalDipDirection(struct Sprite *sprite) // arg 2: duration static void SlideMonToOriginalPos(struct Sprite *sprite) { - u32 monSpriteId; - if (!gBattleAnimArgs[0]) - monSpriteId = gBattlerSpriteIds[gBattleAnimAttacker]; - else - monSpriteId = gBattlerSpriteIds[gBattleAnimTarget]; + u32 monSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gSprites[monSpriteId].x + gSprites[monSpriteId].x2; @@ -554,15 +550,9 @@ static void SlideMonToOriginalPos_Step(struct Sprite *sprite) // arg 4: duration static void SlideMonToOffset(struct Sprite *sprite) { - u8 battler; - u8 monSpriteId; - if (!gBattleAnimArgs[0]) - battler = gBattleAnimAttacker; - else - battler = gBattleAnimTarget; + u8 monSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - monSpriteId = gBattlerSpriteIds[battler]; - if (GetBattlerSide(battler) != B_SIDE_PLAYER) + if (GetBattlerSide(gBattleAnimArgs[0]) != B_SIDE_PLAYER) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; if (gBattleAnimArgs[3] == 1) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 4cadfaaffd..50bb83305f 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -99,7 +99,6 @@ static void SpriteCB_GlacialLance_Step1(struct Sprite* sprite); static void SpriteCB_GlacialLance_Step2(struct Sprite* sprite); static void SpriteCB_GlacialLance(struct Sprite* sprite); static void SpriteCB_TripleArrowKick(struct Sprite* sprite); -static void AnimMakingItRain(struct Sprite *sprite); // const data // general @@ -2176,18 +2175,7 @@ const struct SpriteTemplate gSpiritShackleArrowTemplate = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimSonicBoomProjectile -}; - -const struct SpriteTemplate gSpiritShackleChainTemplate = -{ - .tileTag = ANIM_TAG_CHAIN_LINK, - .paletteTag = ANIM_TAG_CHAIN_LINK, - .oam = &gOamData_AffineOff_ObjNormal_32x16, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimThunderWave + .callback = AnimTranslateStinger }; //darkest lariat @@ -7235,18 +7223,6 @@ const struct SpriteTemplate gBitterBladeImpactTemplate = .callback = AnimClawSlash }; -// Make It Rain -const struct SpriteTemplate gMakingItRainTemplate = -{ - .tileTag = ANIM_TAG_COIN, - .paletteTag = ANIM_TAG_COIN, - .oam = &gOamData_AffineNormal_ObjNormal_16x16, - .anims = gCoinAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimMakingItRain, -}; - const struct SpriteTemplate gRedExplosionSpriteTemplate = { .tileTag = ANIM_TAG_RED_EXPLOSION, @@ -7280,6 +7256,39 @@ const struct SpriteTemplate gMoonUpSpriteTemplate = .callback = AnimWeatherBallUp, }; +const union AnimCmd gSproutAnimCmds[] = +{ + ANIMCMD_FRAME(96, 5), + ANIMCMD_END, +}; + +const union AnimCmd *const gSproutAnimTable[] = +{ + gSproutAnimCmds, +}; + +const struct SpriteTemplate gSproutGrowSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPROUT, + .paletteTag = ANIM_TAG_SPROUT, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gSproutAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos, +}; + +const struct SpriteTemplate gFreezyFrostRisingSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ICICLE_SPEAR, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_GeyserTarget +}; + // functions //general void AnimTask_IsTargetPartner(u8 taskId) @@ -9266,26 +9275,6 @@ void AnimTask_StickySyrup(u8 taskId) DestroyAnimVisualTask(taskId); } -static void AnimMakingItRain(struct Sprite *sprite) -{ - if (gBattleAnimArgs[3] != 0) - SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &sprite->x, &sprite->y); //coin shower on target - - sprite->x += gBattleAnimArgs[0]; - sprite->y += 14; - StartSpriteAnim(sprite, gBattleAnimArgs[1]); - AnimateSprite(sprite); - sprite->data[0] = 0; - sprite->data[1] = 0; - sprite->data[2] = 4; - sprite->data[3] = 16; - sprite->data[4] = -70; - sprite->data[5] = gBattleAnimArgs[2]; - StoreSpriteCallbackInData6(sprite, AnimFallingRock_Step); - sprite->callback = TranslateSpriteInEllipse; - sprite->callback(sprite); -} - void AnimTask_RandomBool(u8 taskId) { if (RandomPercentage(RNG_NONE, 50)) diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index 5aa14ffa34..b6239ca063 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -349,6 +349,28 @@ const struct SpriteTemplate gSeedFlareGreenWavesTemplate = .callback = AnimFlyingSandCrescent }; +const struct SpriteTemplate gMakingItRainTemplate = +{ + .tileTag = ANIM_TAG_COIN, + .paletteTag = ANIM_TAG_COIN, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gCoinAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFallingRock, +}; + +const struct SpriteTemplate gFallingSeedSpriteTemplate = +{ + .tileTag = ANIM_TAG_SEED, + .paletteTag = ANIM_TAG_SEED, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFallingRock, +}; + static void AnimStealthRock(struct Sprite *sprite) { s16 x, y; @@ -456,7 +478,14 @@ void AnimRockFragment(struct Sprite *sprite) // Swirls particle in vortex. Used for moves like Fire Spin or Sand Tomb void AnimParticleInVortex(struct Sprite *sprite) { - InitSpritePosToAnimBattler(gBattleAnimArgs[6], sprite, FALSE); + if (IsDoubleBattle() //got a little lazy here will fix later + && (gAnimMoveIndex == MOVE_BLEAKWIND_STORM + || gAnimMoveIndex == MOVE_SANDSEAR_STORM + || gAnimMoveIndex == MOVE_SPRINGTIDE_STORM + || gAnimMoveIndex == MOVE_WILDBOLT_STORM)) + InitSpritePosToAnimTargetsCentre(sprite, FALSE); + else + InitSpritePosToAnimTarget(sprite, FALSE); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[4]; From 25e9ca2ac66b1f87ad5ca4ca3b50166ab2c8a9ed Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 15 Sep 2024 08:24:26 +0200 Subject: [PATCH 091/133] Cleaned up a bit of code with GetBattlerPartyData (#5378) * rename GetBattlerPartyData --- include/battle.h | 8 ++++---- src/battle_anim_mons.c | 6 +----- src/battle_debug.c | 7 +------ src/battle_message.c | 9 ++------- src/battle_script_commands.c | 5 +---- src/battle_tv.c | 13 ++----------- src/pokeball.c | 8 ++------ src/type_icons.c | 2 +- 8 files changed, 14 insertions(+), 44 deletions(-) diff --git a/include/battle.h b/include/battle.h index 66f8531ae7..7ccbcfbfe4 100644 --- a/include/battle.h +++ b/include/battle.h @@ -1153,11 +1153,10 @@ static inline u32 GetBattlerSide(u32 battler) return GetBattlerPosition(battler) & BIT_SIDE; } -static inline struct Pokemon* GetBattlerData(u32 battlerId) +static inline struct Pokemon* GetPartyBattlerData(u32 battler) { - u32 index = gBattlerPartyIndexes[battlerId]; - - return (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) ? &gEnemyParty[index] : &gPlayerParty[index]; + u32 index = gBattlerPartyIndexes[battler]; + return (GetBattlerSide(battler) == B_SIDE_OPPONENT) ? &gEnemyParty[index] : &gPlayerParty[index]; } static inline struct Pokemon *GetSideParty(u32 side) @@ -1176,3 +1175,4 @@ static inline bool32 IsDoubleBattle(void) } #endif // GUARD_BATTLE_H + diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index e0b4820409..dec12e0dc6 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -116,11 +116,7 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 coordType) } else { - if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) - mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; - else - mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; - + mon = GetPartyBattlerData(battlerId); illusionMon = GetIllusionMonPtr(battlerId); if (illusionMon != NULL) mon = illusionMon; diff --git a/src/battle_debug.c b/src/battle_debug.c index b088aa73ba..a5421a932b 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -2269,14 +2269,9 @@ static void UpdateMonData(struct BattleDebugMenu *data) { if (data->battlerWasChanged[i]) { - struct Pokemon *mon; + struct Pokemon *mon = GetPartyBattlerData(i); struct BattlePokemon *battleMon = &gBattleMons[i]; - if (GetBattlerSide(i) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[i]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[i]]; - SetMonData(mon, MON_DATA_HELD_ITEM, &battleMon->item); SetMonData(mon, MON_DATA_STATUS, &battleMon->status1); SetMonData(mon, MON_DATA_HP, &battleMon->hp); diff --git a/src/battle_message.c b/src/battle_message.c index 7c009f5a73..727091cec6 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3091,14 +3091,9 @@ static const u8 *TryGetStatusString(u8 *src) static void GetBattlerNick(u32 battler, u8 *dst) { - struct Pokemon *mon, *illusionMon; + struct Pokemon *illusionMon = GetIllusionMonPtr(battler); + struct Pokemon *mon = GetPartyBattlerData(battler); - if (GetBattlerSide(battler) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[battler]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[battler]]; - - illusionMon = GetIllusionMonPtr(battler); if (illusionMon != NULL) mon = illusionMon; GetMonData(mon, MON_DATA_NICKNAME, dst); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index bfb7eec56d..283f42a23b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9877,10 +9877,7 @@ static void Cmd_various(void) case VARIOUS_HANDLE_FORM_CHANGE: { VARIOUS_ARGS(u8 case_); - if (GetBattlerSide(battler) == B_SIDE_OPPONENT) - mon = &gEnemyParty[gBattlerPartyIndexes[battler]]; - else - mon = &gPlayerParty[gBattlerPartyIndexes[battler]]; + mon = GetPartyBattlerData(battler); // Change species. if (cmd->case_ == 0) diff --git a/src/battle_tv.c b/src/battle_tv.c index 24d573d0bf..22e5ab1c31 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -338,17 +338,8 @@ void BattleTv_SetDataBasedOnString(u16 stringId) defSide = GetBattlerSide(gBattlerTarget); effSide = GetBattlerSide(gEffectBattler); scriptingSide = GetBattlerSide(gBattleMsgDataPtr->scrActive); - - if (atkSide == B_SIDE_PLAYER) - atkMon = &gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]; - else - atkMon = &gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]]; - - if (defSide == B_SIDE_PLAYER) - defMon = &gPlayerParty[gBattlerPartyIndexes[gBattlerTarget]]; - else - defMon = &gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]]; - + atkMon = GetPartyBattlerData(gBattlerAttacker); + defMon = GetPartyBattlerData(gBattlerTarget); moveSlot = GetBattlerMoveSlotId(gBattlerAttacker, gBattleMsgDataPtr->currentMove); if (moveSlot >= MAX_MON_MOVES && IsNotSpecialBattleString(stringId) && stringId > BATTLESTRINGS_TABLE_START) diff --git a/src/pokeball.c b/src/pokeball.c index 914455af5a..21557d973a 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -1571,12 +1571,8 @@ void FreeBallGfx(u8 ballId) static u16 GetBattlerPokeballItemId(u8 battlerId) { - struct Pokemon *mon, *illusionMon; - - if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; + struct Pokemon *illusionMon; + struct Pokemon *mon = GetPartyBattlerData(battlerId); illusionMon = GetIllusionMonPtr(battlerId); if (illusionMon != NULL) diff --git a/src/type_icons.c b/src/type_icons.c index 361312ab91..41fa102bb9 100644 --- a/src/type_icons.c +++ b/src/type_icons.c @@ -291,7 +291,7 @@ static bool32 UseDoubleBattleCoords(u32 position) static u32 GetMonPublicType(u32 battlerId, u32 typeNum) { - struct Pokemon* mon = GetBattlerData(battlerId); + struct Pokemon* mon = GetPartyBattlerData(battlerId); u32 monSpecies = GetMonData(mon,MON_DATA_SPECIES,NULL); struct Pokemon* monIllusion; u32 illusionSpecies; From 3433567188e539fdf99427894222ead271789f86 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Sun, 15 Sep 2024 20:28:04 +0200 Subject: [PATCH 092/133] Gourgeist and Pumpkaboo follower sizes (#5390) * Gourgeist sizes * Gourgeist all sizes * Pumpkaboo small * Added all sizes of Pumpkaboo * Resized Gourgeist (no more Titan) --------- Co-authored-by: Hedara --- graphics/pokemon/gourgeist/large/overworld.png | Bin 949 -> 895 bytes graphics/pokemon/gourgeist/overworld.png | Bin 949 -> 819 bytes graphics/pokemon/gourgeist/small/overworld.png | Bin 949 -> 619 bytes graphics/pokemon/gourgeist/super/overworld.png | Bin 949 -> 1149 bytes graphics/pokemon/pumpkaboo/large/overworld.png | Bin 522 -> 597 bytes graphics/pokemon/pumpkaboo/overworld.png | Bin 522 -> 512 bytes graphics/pokemon/pumpkaboo/small/overworld.png | Bin 522 -> 429 bytes graphics/pokemon/pumpkaboo/super/overworld.png | Bin 522 -> 769 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/graphics/pokemon/gourgeist/large/overworld.png b/graphics/pokemon/gourgeist/large/overworld.png index f2184b2cfc5642092ba824963e6af6c2affac397..e542ea438599630e83dc2972b8fa25a5e4aff7ea 100644 GIT binary patch delta 835 zcmV-J1HAmT2mc0;7#0Wv0001UMu)cm0004VQb$4nuFf3kkv=tl0|rS%K~z|U?U><` zq#z80M+1T*@Bh5l3Fx4P~Tpj z&$DI0;g7-z&~oVUJ%MM?=JY+MnS$le<26Ar=gH%MW&t)QiuM#Zyc&GOWuDDl;1uW> z^f)Uf)1t@2WT)_dIK^P+w|Q7%N^u!Ve4ZZh7xQE|ba;q-fBXz2E>CTI$wd$ihYk-h zqQWKOs!Cjr%Ge&J=_@VL@Z5v-hzgHXXxhjx3j>(GO`C0IBm~)29;U)nGyz#*Im;5=v zAX>~D_E?Jt?zk=>stq2-AN(Zf4Wd6G(YOHcL>C_LT&M}A48fMCmS7Rx2lreROwu1K z{@|UU^9KQc$tKYYpoy4c6P^n|f<+oQ7xq`?x>#aer3XH7O+W<(BjqxR?|3KZ`b)CS zhYumaDPBLzgFM=ak0}KmE`?96$P^9(p)Qb~D+1=k{*3s8cY@A;^|$G#jotp8g|N-aIKJbZ;Nzc<3L$TQY6aAAQ8-a;;0l9d8!q}tyRT4NH1m26DbD87sXnDvPL*cu+CY+s{>=zJIHs~x%!x(u7E-OUceZWRY1kV z0;B>Ay@9obl@DI3sO$|M#*1K3|0)%XSBS$!)7GgjsJ(%^;Y%S+g@+N(V-%0*w*Cg6 z0}ihuLJ^|^`Gws1a_L#Td~Ia(M{e%F*N;;o{LNQmPvXf<;4A*S@dw;XC01rkh_?U$ N002ovPDHLkV1g{vkx~Ev delta 889 zcmV-<1BU$n2DJx}7$yV*0002CwraKj0004VQb$4nuFf3k00004XF*Lt006O%3;baP zkuEiV010qNS#tmY4#NNd4#NS*Z>VGd00S3EL_t(Y$L*FekJ>O8hD{xH=9s(SEWIj2 zF2)U9Z$P?(4A(7~{DGsn9fJ4L0qK~o(^X9E)NU2aN!O*J16BD^wVgn0qvR@8>eO#Q zdYt%sA3Gur_+NiqNA+s{+p3{vH6MWrhFHIUYBH~e(eRM#73?8byK1tSaE`0lYgVw= zvh@Ii#e{A(Vl7SImFfw)Aq!l1Pb>Vb^Xg3j1rk(#YxV)eHH=N2;K?sg7eu}eI{^!PWEg~`TW}a;l9or#$6DMsGGAzhm%~uk3vmA za4sMl-mC&&4Y*m2cWjM@A@F`ZENnn}e9e72a&v|QdX)>zqP8X=ITH|dG9#>|1e{

WAl+;ijv|nMF~|?4&W|_AYZhyB#2U{sUBHpJU|oR^9upELLmr4@b)tQh+SWv!3;=XFcm#|IrHJD;~b$fS-KEB|(g? zf(d8*1xJjo!WrKacnW@h!SVMTkz9o{-Vk3UEaq|)e2X{fS-~f<+4TdK0@E6VodI>04 ziR=nIek7p!(gaHFd;$!;5-R>M)~nc$ovU z0E6!WLt}%jg%5#$lJLTD{i^Q*(Rg>jExHTbv zIBo)^Z#RCq6o){0t0dI6`~MV(J^q_3mnxSg=k#XXw*3r9(D;ZK;@Y;_R=z9m2_P>B z;dMLsB}^9>Vyir*t$q40!~f(X;HQ4Ms5YYl3|v(%@pyxOUMuT=@kZSRb{pZXcD~%{ z@NcZHjuxr@Z?3FR!Pg9r*rq==!obnuk|4Gw|744m0I?kwssJ!=!kfdpiOR7y;xjU# zRf7*44K4}R7+3kz-&^6$O@X5Z%YQ(t06|FoL-Q9P*y3WsHpgyZ3s}_i?U!(FGjqo@{@mi9TYmseaT!PEtHGiG0000wFdf delta 899 zcmV-}1AP3m2DJx}7%Bt<0002CwraKj0004VQb$4nuFf3k00004XF*Lt006O%3;baP z0000dkuocPmybC^00009a7bBm000id000id0mpBsWB>pI7fD1xR7l6|mNAdoFc^kS z9d+iIyWlLnDnl;D4P0+Px`PbYEtvd)qq!Y|_tF9Bn6A@ROzqTe70XH2rJ(~=`BAl< zKy0JrDpl&#Z$NsS_O< zvY2p=tJ!N-u-CHn0E5MZZZ%^gKxatwh9--lX19`o5nwPh8k!8O5gT?Z7+4K`S4}1t zppttmVS@^`Vne{-r;KSnCR;R~4rsTOLBJTBfGUnuJYXwi*Y8QUoRfe}qjCm866*mv zUyROw+4U!Dc$H7@=lo{Z!U`jnXaYI|f6~+T#GeET_ZfBl%NdLknPA09&bxgU0tstr z0)qDf!0(ViRrWi6!4{(-AeSr9ijuBe9>tPzFMH5j07prJ6@iS42koDdi576G1O}A4 z@ZIITYfY)O+auiARFGS0$&ZdS&esWjfNrcemyK~Kze-5eL8Y;h68$)3(TUnCLlQz z5Op#mtfd5;U^2G$0lg5S&BGSCWFP_tTsUJ$dsmsj*^IW=ia^FvKnl-%?SBa|W8t2E z2yttUbDySl81hl^le4#`M1CLmb~h-&*Rd8NENME`;zalK>b8@jb&CvT zr}o+L-ECS7)Ev%hRX_x&0wTaw(AEPGHUc1Dw6Y|KQm3gNS!X;z6X5d;0k}j?2&Hx@ z%Q4(g2fQZMjzsuuyVV4?+waN^Ct?FDSeDlD;LGU|fd)F#r#BA2j2^2>0c;9k4E{+0 Z@Eb;YJjE3kV}t+z002ovPDHLkV1jDDjlci^ diff --git a/graphics/pokemon/gourgeist/small/overworld.png b/graphics/pokemon/gourgeist/small/overworld.png index f2184b2cfc5642092ba824963e6af6c2affac397..cbbd3cca8a83fec1c908fd653f561b8c8f6a58f4 100644 GIT binary patch delta 567 zcmV-70?7Tf2kQio7#auz0001UMu)cm0004VQb$4nuFf3k0000mkwPnf0000000000 z0OhIQ+5i9m5Oh*bQvm<}|NsC0|NsC0|NsC0|G-d-LjV8)%}GQ-R9J=WSJ!gHAPh8G zs?Gm@Z$xp54~b03LuP{J%EOjh(aasku3fu!?b@|#*RH=&z#7hFj9DS9$w8zhoZ-cv zh|~x=VNnjUlLmBrIlwP}bl|L}p5g58W-U$#aFaEp6MP72!WnMip!H}QL1b7)q3SC^ z)(7XbgmXLu7vv7CYXph0u6M~R0jIcg3_Ho+dVdqVA5m8I2LeuO<%Bw3{1JRi82j_^ zIy3^@U@2C88Ddpm2}6BN7$dYrqTxNCji->0XC6l*l(Bv?x}H~mh^{Y$k-i7Kt`b6S zK*YPhwO1VbTVKwfPGH7kkneoF!c~1Eyz1|OM&0BvknrYjxWmf~{ZY@)n*jSbPP?85 zAF93+Ui3Xb&yc;ugBlecUCgxs)sGgizc`yYfy5 z;Q7r)kwed4wh5-UO+dL$vpz5AG5yE#9mWd0uK#!S21CIT5P4V?U$X!J002ovPDHLk FV1ix54G{nU delta 899 zcmV-}1AP4J1hof{7%Bt<0002CwraKj0004VQb$4nuFf3k00004XF*Lt006O%3;baP z0000dkuocPmybC^00009a7bBm000id000id0mpBsWB>pI7fD1xR7l6|mNAdoFc^kS z9d+iIyWlLnDnl;D4P0+Px`PbYEtvd)qq!Y|_tF9Bn6A@ROzqTe70XH2rJ(~=`BAl< zKy0JrDpl&#Z$NsS_O< zvY2p=tJ!N-u-CHn0E5MZZZ%^gKxatwh9--lX19`o5nwPh8k!8O5gT?Z7+4K`S4}1t zppttmVS@^`Vne{-r;KSnCR;R~4rsTOLBJTBfGUnuJYXwi*Y8QUoRfe}qjCm866*mv zUyROw+4U!Dc$H7@=lo{Z!U`jnXaYI|f6~+T#GeET_ZfBl%NdLknPA09&bxgU0tstr z0)qDf!0(ViRrWi6!4{(-AeSr9ijuBe9>tPzFMH5j07prJ6@iS42koDdi576G1O}A4 z@ZIITYfY)O+auiARFGS0$&ZdS&esWjfNrcemyK~Kze-5eL8Y;h68$)3(TUnCLlQz z5Op#mtfd5;U^2G$0lg5S&BGSCWFP_tTsUJ$dsmsj*^IW=ia^FvKnl-%?SBa|W8t2E z2yttUbDySl81hl^le4#`M1CLmb~h-&*Rd8NENME`;zalK>b8@jb&CvT zr}o+L-ECS7)Ev%hRX_x&0wTaw(AEPGHUc1Dw6Y|KQm3gNS!X;z6X5d;0k}j?2&Hx@ z%Q4(g2fQZMjzsuuyVV4?+waN^Ct?FDSeDlD;LGU|fd)F#r#BA2j2^2>0c;9k4E{+0 Z@Eb;YJjE3kV}t+z002ovPDHLkV1g)ejrITl diff --git a/graphics/pokemon/gourgeist/super/overworld.png b/graphics/pokemon/gourgeist/super/overworld.png index f2184b2cfc5642092ba824963e6af6c2affac397..d9494d1971b33a9102b6e70d410f4b553fdbbbea 100644 GIT binary patch delta 1101 zcmV-T1hV_J2mJ_;7#auz0001UMu)cm0004VQb$4nuFf3k0000mkwPnf0000000000 z0OhIQ+5i9m5Oh*bQvm<}|NsC0|NsC0|NsC0|G-d-LjV8+-$_J4R9J!0q^}vVZ(n(2Sf}D z!yT^$Rtg*bQ#v37#JS;rj<*6k!6k>kbAY%M+;J@sR)e%OA=vb84@(ob@Dcld|BVa$fwIMP=4kVa2R(J zIz3zRaMB1l)qq4~mfoCb*>8t4VTqac^3{u*aP8pj&Z z3C2+{B#zd6<-A9K$FPY&t$#rVb<)6uhfXlu=lK$p?ie>t0ioSZnxNcdVin9-A|=0Y z2^cp4PC7Yv7$+Uryb}yD-1q$y3_=-q{G(T*oTn2!3_+U4m@n(bHQ?%aYXPu1C&DuyX^7908+_%<02#b_IASE2(gAEZJaRiM*biIl z^+{_%Nh8VJs;X zUV_>{4H(W3lEY7flLq7h%Gltwfc_Z^WWf?(G>`=gpXH-RD<9N~r%`K|4Q6a`72pNd zUt6Gm=aUBhyZ|}fgSIl{XAZeP>x(tWaL^%xWC}KJ+^7LNKP$iM(8#AL*SAhS-)8?O z&j#0}b8a-~eB;ynJRo+yuL0%<6&62qf8iYB%7j`SLJ?Ty%VDpOY`z?me89Xvv(s-l zAN;h3wtv2pQ^4xwF6U2oSk``#&#!M+ub@RJZufHTvv`aBPw%&X$p44)k0Jj7b1yY* TP*-^~00000NkvXXu0mjfkB$lo delta 899 zcmV-}1AP4b2(<^07%Bt<0002CwraKj0004VQb$4nuFf3k00004XF*Lt006O%3;baP z0000dkuocPmybC^00009a7bBm000id000id0mpBsWB>pI7fD1xR7l6|mNAdoFc^kS z9d+iIyWlLnDnl;D4P0+Px`PbYEtvd)qq!Y|_tF9Bn6A@ROzqTe70XH2rJ(~=`BAl< zKy0JrDpl&#Z$NsS_O< zvY2p=tJ!N-u-CHn0E5MZZZ%^gKxatwh9--lX19`o5nwPh8k!8O5gT?Z7+4K`S4}1t zppttmVS@^`Vne{-r;KSnCR;R~4rsTOLBJTBfGUnuJYXwi*Y8QUoRfe}qjCm866*mv zUyROw+4U!Dc$H7@=lo{Z!U`jnXaYI|f6~+T#GeET_ZfBl%NdLknPA09&bxgU0tstr z0)qDf!0(ViRrWi6!4{(-AeSr9ijuBe9>tPzFMH5j07prJ6@iS42koDdi576G1O}A4 z@ZIITYfY)O+auiARFGS0$&ZdS&esWjfNrcemyK~Kze-5eL8Y;h68$)3(TUnCLlQz z5Op#mtfd5;U^2G$0lg5S&BGSCWFP_tTsUJ$dsmsj*^IW=ia^FvKnl-%?SBa|W8t2E z2yttUbDySl81hl^le4#`M1CLmb~h-&*Rd8NENME`;zalK>b8@jb&CvT zr}o+L-ECS7)Ev%hRX_x&0wTaw(AEPGHUc1Dw6Y|KQm3gNS!X;z6X5d;0k}j?2&Hx@ z%Q4(g2fQZMjzsuuyVV4?+waN^Ct?FDSeDlD;LGU|fd)F#r#BA2j2^2>0c;9k4E{+0 Z@Eb;YJjE3kV}t+z002ovPDHLkV1jk9jtl?* diff --git a/graphics/pokemon/pumpkaboo/large/overworld.png b/graphics/pokemon/pumpkaboo/large/overworld.png index 67542d25d92002659ad86d6c57ae3f75a2f79be5..5c9d3e7f96142b488968e14ea4b906527881df83 100644 GIT binary patch delta 547 zcmV+;0^I$I1l0tP7#auz0001UMu)cm0004VQb$4nuFf3k0000mktHa90000000000 z00000%d|(}0005gNkl?t-9Ed$0ki$P^DBl7+(k` zNlKSpcG+c@U3S@DF(Nv}PX=K2qencEsCqsTPpm4gLYH$K-Om8}#PNwZc8C;uoJGY` z7;y+BFUg2QAO#6{oNIJ{XL-PpA(N*s;MjuQA_W`*$tgg@twMf}Mf_|CWJfa2Fye#~ zr}3N!Ikhd0a%3l_ZJD*J zNSUGJYLohR4Xk6d3kC>&~wa lKN@2f#~}{?1MB~teF4Ot65!udV^IJA002ovPDHLkV1m6}_8tHL delta 472 zcmV;}0Vn>|1d0TZ7!3pi0002CwraKj001PBGAMtULdp~X00E&%L_t(|obA=UYQr!P z0N}HxLKZ1Dfo_iDA<)T|Ucl0|eSt0+3t7771)9xd>QbEa39^L@g^-u4Tted??n!kB|*AQaNT42Um^d4^;0^=-aNYP2g!sP7*I`#!4 z%Nc*tqO(BTBC-K6_A8EK&LD;^<{a5ja)z{BuV)aJb()7c=U`$3$yug3XGkZy^-etx z-Pp1=tOJaS=Emt7Qio_cBO1;TBI+UKK&s3qLUroOr9KsOji$FP3imz1L@{B^47v~r z*Sq@3PdFdFj)g(IN1rF!Y!Fhk(6A6UJ1|M*aZb;jqp$);JZplPap124# z7C*#2vFYgyKETl%Cf4?6GTAG z{RQKLL$zF_@^TQ4gfy;Pe*v2SAQMNswPK z!+%t8AfVeBs6WZm#W5tJ_3gBSMTZr5TpU;5(D?WN|Jsx}-vlOTWGse8ZU<*&G_kUvq- zUu25LgPEF#3ndEYDy#@R5`V@);lS#G1Ho)NO}TddDlRv8kn(SiQ0tt(4dume^)Jhu zuR6?ljB)SldD}8O<{LlJ{P%SIZ56xgk6YUvP5NF5?B_XG@Y;W0X!~0=Zi~5Zj)h;? z+^G0(W&Y>O503R6u5ZXL|0KEbW&C2VCH}C@H(~+^R7r?2&I3o0HzL)Je;ecYEr& zJk5AC;k9uf%Y>r$G07$C_k5pWcg(xL+ulyLy`wpJV?*Artbzopr0LG5eE&u=k delta 472 zcmV;}0Vn=|1d0TZ7!3pi0002CwraKj001PBGAMtULdp~X00E&%L_t(|obA=UYQr!P z0N}HxLKZ1Dfo_iDA<)T|Ucl0|eSt0+3t7771)9xd>QbEa39^L@g^-u4Tted??n!kB|*AQaNT42Um^d4^;0^=-aNYP2g!sP7*I`#!4 z%Nc*tqO(BTBC-K6_A8EK&LD;^<{a5ja)z{BuV)aJb()7c=U`$3$yug3XGkZy^-etx z-Pp1=tOJaS=Emt7Qio_cBO1;TBI+UKK&s3qLUroOr9KsOji$FP3imz1L@{B^47v~r z*Sq@3PdFdFj)g(IN1rF!Y!Fhk(6A6UJ1|M*aZb;jqp$);JZplPap124# z7C*#2vFYgyKETl%Cf4?6GTAG z{RQKLL$z)UB(g$^rlv^-UJJN~`?e$(?EDOtvEeQtX5$vN;hK`VjOFV>H0=7O~oHz%|Ue*d$|K<&{QuKNtd-`+^y`8!deyFVdQ I&MBb@03DaB@Bjb+ delta 472 zcmV;}0Vn>g1BwKY7!3pi0002CwraKj001PBGAMtULdp~X00E&%L_t(|obA=UYQr!P z0N}HxLKZ1Dfo_iDA<)T|Ucl0|eSt0+3t7771)9xd>QbEa39^L@g^-u4Tted??n!kB|*AQaNT42Um^d4^;0^=-aNYP2g!sP7*I`#!4 z%Nc*tqO(BTBC-K6_A8EK&LD;^<{a5ja)z{BuV)aJb()7c=U`$3$yug3XGkZy^-etx z-Pp1=tOJaS=Emt7Qio_cBO1;TBI+UKK&s3qLUroOr9KsOji$FP3imz1L@{B^47v~r z*Sq@3PdFdFj)g(IN1rF!Y!Fhk(6A6UJ1|M*aZb;jqp$);JZplPap124# z7C*#2vFYgyKETl%Cf4?6GTAG z{RQKLL$z0u7Bc|tFpweHEQk&upB?TW|(ZVQC7LV=!jpq z;}Gz!cNsixxK5DgpD}W8yuRJ-q*~;*PVdg^1bU8wcrMYy9z?W;5{HNoLUAKY_-MZ1 z=K|g4=of;{M-)6Wgw9Xk)I*Fu|6=kncI_|nn0fq$gPKQwLrsrs@NSPo1o-)gQ;XLa z`wn8uZ+A)zh?!Fv)UWxieoFp0Vt`@B@lA>6;l`nh0|yD)58*iOf=A5<&nhNfe4Jp# z2lZ3%Imt0rs^b0pl`cXoWh{7HT&h1ZfCTya2@CqA$QbEa39^L@g^-u4Tted??n!kB|*AQaNT42Um^d4^;0^=-aNYP2g!sP7*I`#!4 z%Nc*tqO(BTBC-K6_A8EK&LD;^<{a5ja)z{BuV)aJb()7c=U`$3$yug3XGkZy^-etx z-Pp1=tOJaS=Emt7Qio_cBO1;TBI+UKK&s3qLUroOr9KsOji$FP3imz1L@{B^47v~r z*Sq@3PdFdFj)g(IN1rF!Y!Fhk(6A6UJ1|M*aZb;jqp$);JZplPap124# z7C*#2vFYgyKETl%Cf4?6GTAG z{RQKLL$z Date: Mon, 16 Sep 2024 12:12:34 -0300 Subject: [PATCH 093/133] Version 1.9.2 (#5357) * Version 1.9.2 * Apply suggestions from code review Co-authored-by: Pawkkie <61265402+Pawkkie@users.noreply.github.com> * Updated to latest master * Updated to latest master * Fix last PR * Corrected order + Pumpkaboo/Gourgeist credits --------- Co-authored-by: Pawkkie <61265402+Pawkkie@users.noreply.github.com> --- .../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 | 1 + README.md | 4 +- docs/SUMMARY.md | 2 + docs/changelogs/1.9.x/1.9.0.md | 2 +- docs/changelogs/1.9.x/1.9.1.md | 4 +- docs/changelogs/1.9.x/1.9.2.md | 202 ++++++++++++++++++ docs/changelogs/template.md | 11 +- include/constants/expansion.h | 4 +- 11 files changed, 228 insertions(+), 11 deletions(-) create mode 100644 docs/changelogs/1.9.x/1.9.2.md diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml index edebc1bbf0..9ffdc70fba 100644 --- a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml +++ b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.9.1 (Latest release) + - 1.9.2 (Latest release) - master (default, unreleased bugfixes) - upcoming (Edge) + - 1.9.1 - 1.9.0 - 1.8.6 - 1.8.5 diff --git a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml index dd3024230b..ce50b0bffd 100644 --- a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml +++ b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.9.1 (Latest release) + - 1.9.2 (Latest release) - master (default, unreleased bugfixes) - upcoming (Edge) + - 1.9.1 - 1.9.0 - 1.8.6 - 1.8.5 diff --git a/.github/ISSUE_TEMPLATE/04_other_errors.yaml b/.github/ISSUE_TEMPLATE/04_other_errors.yaml index 29960c267b..c78093d60e 100644 --- a/.github/ISSUE_TEMPLATE/04_other_errors.yaml +++ b/.github/ISSUE_TEMPLATE/04_other_errors.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.9.1 (Latest release) + - 1.9.2 (Latest release) - master (default, unreleased bugfixes) - upcoming (Edge) + - 1.9.1 - 1.9.0 - 1.8.6 - 1.8.5 diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2f38af1d..bb9fec3e7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Pokeemerald-Expansion Changelogs ## 1.9.x +- **[Version 1.9.2](docs/changelogs/1.9.x/1.9.2.md) - 🧹 Bugfix Release** - **[Version 1.9.1](docs/changelogs/1.9.x/1.9.1.md) - 🧹 Bugfix Release** - **[Version 1.9.0](docs/changelogs/1.9.x/1.9.0.md) - ✨ Feature Release** diff --git a/README.md b/README.md index f09f5a7d90..37ea8336b7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,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 1.9.1 https://github.com/rh-hideout/pokeemerald-expansion/ +Based off RHH's pokeemerald-expansion 1.9.2 https://github.com/rh-hideout/pokeemerald-expansion/ ``` ## What features are included? @@ -178,7 +178,7 @@ With this, you'll get the latest version of pokeemerald-expansion, plus a couple - Check your current version. - You can check in the debug menu's `Utilities -> Expansion Version` option. - If the option is not available, you possibly have version 1.6.2 or older. In that case, please check the [changelogs](CHANGELOG.md) to determine your version based on the features available on your repository. -- Once you have your remote set up, run the command `git pull RHH expansion/X.Y.Z`, replacing X, Y and Z with the digits of the respective version you want to update to (eg, to update to 1.8.4, use `git pull RHH expansion/1.8.4`). +- Once you have your remote set up, run the command `git pull RHH expansion/X.Y.Z`, replacing X, Y and Z with the digits of the respective version you want to update to (eg, to update to 1.9.2, use `git pull RHH expansion/1.9.2`). - ***Important:*** If you are several versions behind, we recommend updating one minor version at a time, skipping directly to the latest patch version (eg, 1.5.3 -> 1.6.2 -> 1.7.4 and so on) - Alternatively, you can update to unreleased versions of the expansion. - ***master (stable):*** It contains unreleased **bugfixes** that will come in the next patch version. To merge, use `git pull RHH master`. diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 603fa225db..faeb069783 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -19,6 +19,8 @@ - [How to use the Testing System](./how_to_testing_system.md) - [Changelog](./CHANGELOG.md) - [1.9.x]() + - [Version 1.9.2](changelogs/1.9.x/1.9.2.md) + - [Version 1.9.1](changelogs/1.9.x/1.9.1.md) - [Version 1.9.0](changelogs/1.9.x/1.9.0.md) - [1.8.x]() - [Version 1.8.6](changelogs/1.8.x/1.8.6.md) diff --git a/docs/changelogs/1.9.x/1.9.0.md b/docs/changelogs/1.9.x/1.9.0.md index 0d39f109ed..b0815c6e2a 100644 --- a/docs/changelogs/1.9.x/1.9.0.md +++ b/docs/changelogs/1.9.x/1.9.0.md @@ -551,6 +551,6 @@ * @rayrobdod made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4727 * @innocenthedgehog made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4988 -**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.8.5...expansion/1.9.0 +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.8.6...expansion/1.9.0 diff --git a/docs/changelogs/1.9.x/1.9.1.md b/docs/changelogs/1.9.x/1.9.1.md index 8393727c2a..dfe8946bd9 100644 --- a/docs/changelogs/1.9.x/1.9.1.md +++ b/docs/changelogs/1.9.x/1.9.1.md @@ -120,14 +120,14 @@ * Improved 1.8 ⇒ 1.9 non-Competitive syntax migration instructions by @mrgriffin in [#5079](https://github.com/rh-hideout/pokeemerald-expansion/pull/5079) ## 📦 Branch Synchronisation 📦 -### pret +### pret's base pokeemerald * 5th of August in [#5098](https://github.com/rh-hideout/pokeemerald-expansion/pull/5098) * Fixed bottom half of Mt. Pyre not being labeled in PokeNav by @fdeblasio in [pret#2018](https://github.com/pret/pokeemerald/pull/2018) * 7th of August in [#5116](https://github.com/rh-hideout/pokeemerald-expansion/pull/5116) * Changed type1 and type2 to be consistent by @pkmnsnfrn in [pret#2021](https://github.com/pret/pokeemerald/pull/2021) * 14th of August in [#5165](https://github.com/rh-hideout/pokeemerald-expansion/pull/5165) * Fix type for offset in MapConnection by @GriffinRichards in [pret#2011](https://github.com/pret/pokeemerald/pull/2011) -### Followers +### merrp/aarant's followers * 7th of August in [#5110](https://github.com/rh-hideout/pokeemerald-expansion/pull/5110) * Fixed expanded OW IDs by @pkmnsnfrn in [aarant#38](https://github.com/aarant/pokeemerald/pull/38) * Fix two small text errors in follower dialogue by @Bassoonian in [aarant#39](https://github.com/aarant/pokeemerald/pull/39) diff --git a/docs/changelogs/1.9.x/1.9.2.md b/docs/changelogs/1.9.x/1.9.2.md new file mode 100644 index 0000000000..4d95fc95f9 --- /dev/null +++ b/docs/changelogs/1.9.x/1.9.2.md @@ -0,0 +1,202 @@ +# Version 1.9.2 + +```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.9.2`. +``` + +## 🌋 *REFACTORS* 🌋 +📜 = Uses a migration script. +* Remove unused `BattleScript_WindPowerActivatesEnd2` in [#5257](https://github.com/rh-hideout/pokeemerald-expansion/pull/5257) +* Refactored in-battle disobedience to fix bug in [#5245](https://github.com/rh-hideout/pokeemerald-expansion/pull/5245) + +## 💥 *Hardlock/Softlock/Crash/Compiling fixes* 💥 +* Fixed hardlock when Hyperspace Fury is used by Hoopa Unbound by @AlexOn1ine in [#5237](https://github.com/rh-hideout/pokeemerald-expansion/pull/5237) +* Fixed compile error when `OW_POKEMON_OBJECT_EVENTS` is `TRUE` but `P_HISUIAN_FORMS` is `FALSE` around Basculin by @hjk321 in [#5256](https://github.com/rh-hideout/pokeemerald-expansion/pull/5256) +* Fixed hardlock when the AI cannot choose moves due to its opponent having Wonder Guard by @Pawkkie and Wiz in [#5317](https://github.com/rh-hideout/pokeemerald-expansion/pull/5317) +* Fixed multiple Pledge move hardlocks + * Fixed potential hardlock when attempting to use Pledge moves on the same turn that the user would wake up by @PhallenTree in [#5330](https://github.com/rh-hideout/pokeemerald-expansion/pull/5330) + * Fixed hardlock when the opponent's combo doesn't happen when cancelled by sleep by @hedara90 and @PhallenTree in [#5339](https://github.com/rh-hideout/pokeemerald-expansion/pull/5339) + * Fixes hardlock when the opponent's combo doesn't happen when cancelled by freeze by @PhallenTree in [#5340](https://github.com/rh-hideout/pokeemerald-expansion/pull/5340) + * Fixed hardlock when the opponent's combo doesn't happen when cancelled by Powder by @hedara90 in [#5341](https://github.com/rh-hideout/pokeemerald-expansion/pull/5341) + +## 🧬 General 🧬 +### Fixed +* Fixed loading into the wrong version of a map after saving in areas with multiple layouts by @hedara90 in [#5347](https://github.com/rh-hideout/pokeemerald-expansion/pull/5347) + +## 🐉 Pokémon 🐉 +### Added +* Added `OVERWORLD_SET_ANIM` macro to allow using custom animation tables for Overworld Pokémon by @hedara90 in [#5309](https://github.com/rh-hideout/pokeemerald-expansion/pull/5309) + * Added asymetrical Farfetch'd sprites using a previously unused table from merrp's followers branch. +* Added unique sprites for overworld Pumpkaboo and Gourgeist forms by @hedara90 in [#5390](https://github.com/rh-hideout/pokeemerald-expansion/pull/5390) +* Added missing Sirfetch'd competitive alias (`SPECIES_SIRFETCH_D`) by @cawtds in [#5283](https://github.com/rh-hideout/pokeemerald-expansion/pull/5283) +* Added Paldean Wooper and Clodsire overworld sprites by @Cafeei in [#5277](https://github.com/rh-hideout/pokeemerald-expansion/pull/5277) +* Added missing Gen 9 Overworld sprites by @Liamjd14 in [#5304](https://github.com/rh-hideout/pokeemerald-expansion/pull/5304) + * Original sprites by Darkus_Shadow, Princess-Phoenix, shaderr31, Molfang62, CarmaNekko, EduarPokeN, Larryturbo, TyranitarDark and Anarlaurendil + * Sources: + * Normal: https://www.deviantart.com/darkusshadow/art/Gen-9-Paldea-Pokemon-Overworld-Sprites-967776690 + * Shiny: https://www.deviantart.com/darkusshadow/art/SHINY-Gen-9-Paldea-Pokemon-Overworld-Sprites-967779547 +* Added missing overworld sprites by @Liamjd14 in [#5336](https://github.com/rh-hideout/pokeemerald-expansion/pull/5336) + * **New Sprites:** + * Oricorio Pom Pom/Pa'U/Sensu, Zygarde 10%/Complete and Original Color Magearna + * Credits to: Princess-Phoenix, Larryturbo, Kidkatt, Zender1752 and SageDeoxys. + * Black/White Kyurem + * Credits to: Larryturbo. + * Shaymin Sky and Therian Tornadus/Thundurus/Landorus + * Credits to: @Liamjd14 + * **Using their base form's sprites** + * Totem Raticate/Mimikyu/Marowak and Partner Pikachu/Eevee +* Added Added asymmetrical overworld sprites by @Liamjd14 in [#5336](https://github.com/rh-hideout/pokeemerald-expansion/pull/5336) + * Slowbro (Galarian), Tinkatink, Tinkatuff, Tinkaton and Scovillain + * Enabled in `gSpeciesInfo` by @Liamjd14 in [#5385](https://github.com/rh-hideout/pokeemerald-expansion/pull/5385) +### Changed +* Improved Garganacl and Naclstack battle sprites by using the ones from @CyanSMP64's repo by @kittenchilly in [#5142](https://github.com/rh-hideout/pokeemerald-expansion/pull/5142) +* Improved both shiny Indeedee by @Cafeei in [#5285](https://github.com/rh-hideout/pokeemerald-expansion/pull/5285) +* Shiny Combusken now uses its Gen8+ palette by @Cafeei in [#5333](https://github.com/rh-hideout/pokeemerald-expansion/pull/5333) +### Fixed +* Reenabled unused female Indeedee overworld sprite by @Cafeei in [#5285](https://github.com/rh-hideout/pokeemerald-expansion/pull/5285) +* Fixed G-Max Corviknight and Centiskorch's expanded names by @PhallenTree in [#5296](https://github.com/rh-hideout/pokeemerald-expansion/pull/5296) +* Fixed G-Max Cinderace back sprite by @hedara90 in [#5295](https://github.com/rh-hideout/pokeemerald-expansion/pull/5295) +* Fixed Shiny Mothim' by @Cafeei in [#5333](https://github.com/rh-hideout/pokeemerald-expansion/pull/5333) +* Fixed multiple battle sprite issues by @kittenchilly in [#5142](https://github.com/rh-hideout/pokeemerald-expansion/pull/5142) + * **Sprite issues:** + * Bombirdier, Mega Absol/Aerodactyl/Latias/Latios/Salamence, Orthworm and Veluza. + * **Shiny issues:** + * Bombirdier, Kilowattrel, Landorus, Magearna, Mega Diancie/Medicham, Galarian Ponyta, Shroodle, Spidops and Wattrel. +* Fixed multiple overworld Pokémon sprites - Part 1 by @Cafeei in [#5241](https://github.com/rh-hideout/pokeemerald-expansion/pull/5241) + * **"Blinking pixels":** + * Dwebble, Krookodile, Servine, Throh and Vulpix. + * **Shiny Palettes** + * Crustle, Excadrill, Lillipup, Serperior, Servine, Sigilyph, Swoobat, Tranquil and Venipede. + * **Misc fixes:** + * Archen, Basculin, Blitzle, Crustle, Escavalier, Krokorok, Krookodile, Sawsbuck, secondary, Serperior, Snivy, Throh, Woobat, Zebstrika +* Fixed multiple overworld Pokémon sprites - Part 2 by @Cafeei in [#5333](https://github.com/rh-hideout/pokeemerald-expansion/pull/5333) + * **Palette Fixes:** + * Shiny Riolu/Snover, Oshawott, Kabutops, Shieldon, Kingler and Groudon. + * **Fixed "Blinking pixels":** + * Abomasnow, Aggron, Alakazam, Ariados, Articuno, Azumarill, Barboach, Bayleef, Bibarel, Blastoise, Celebi, Charmeleon, Cherrim, Chinchou, Cloyster, Corphish, Corsola, Crawdaunt, Cubone, Dewott, Doduo, Dusknoir, Electabuzz, Espeon, Exeggcute, Farfetch'd, Feraligatr, Flaafy, Flareon, Floatzel, Furret, Gastly, Girafarig, Giratina, Gligar, Gloom, Golbat, Grumpig, Hariyama, Heatran (just reduced), Hoppip, Jolteon, Jumpluff, Kricketot, Larvitar, Leafeon, Lileep, Lumineon, Luxio, Luxray, Machamp, Magneton, Mantine, Mantyke, Marowak, Meowth, Mesprit, Mew, Mewtwo, Mime Jr, Moltres, Numel, Oshawott, Phione, Pinsir, Politoed, Porygon-Z, Probopass, Quilava, Qwilfish, Rampardos, Rapidash, Regirock, Sceptile, Scizor, Seel, Shieldon, Shiftry, Slowking, Smoochum, Sneasel, Spheal, Steelix, Sudowoodo, Suicune, Swellow, Swinub, Tentacruel, Togekiss, Togepi, Vaporeon, Vibrava, Wartortle, Wooper, Yanma, Yanma, Yanmega, Zangoose, Zapdos, Zubat + * **Misc. Sprite Fixes**: Dewott, Misdreavus, Oshawott, Torkoal and Victini. +* Overworld sprite fixes by @Liamjd14 (with help from @hedara90 to solve conflicts) in [#5334](https://github.com/rh-hideout/pokeemerald-expansion/pull/5334) + * **Palette Fixes**: Shieldon. + * **Misc. Sprite Fixes** Torkoal. + * **"Blinking pixels":** + * Ambipom, Armaldo, Crawdaunt, Crobat, Donphan, Flaaffy, Flygon, Grovyle, Hoppip, Igglybuff, Illumise, Jumpluff, Ledian, Ledyba, Mamoswine, Mantine, Marshtomp, Meganium, Mightyena, Miltank, Numel, Prinplup, Raikou, Roserade, Skarmory, Skiploom, Spinarak, Staraptor, Stunky, Torkoal, Wooper, Xatu, Yanma +* Overworld Pokémon sprite changes by @Liamjd14 in [#5336](https://github.com/rh-hideout/pokeemerald-expansion/pull/5336) + * **Fixed "blinking pixels":** + * Alolan Graveler/Golem/Alolan/Ninetales + * Dawn Wings Necrozma + * Hisuian Growlithe/Arcanine + * Winter Sawsbuck + * **Added missing Shiny Palettes** + * Calyrex Ice/Shadow Rider, Origin Dialga/Palkia, White-Striped Basculin, Therian Enamorus and Low-Key Toxtricity. + * **Removed Gigantamax Low-Key Toxtricity using base Low-Key follower sprites.** + * **Fixed Shiny palettes** + * Alolan Marowak/Raichu, Eternal Flower Floette, Flabébé (All), Galarian Ponyta/Rapidash + * Typhlosion-Hisui follower shiny stomach color wrong - done + * **Other sprite/palette fixes** + * Alolan Exeggutor/Marowak/Persian/Raichu/Sandshrew, Hisuian Sligoo/Goodra and Winter Sawsbuck. +## ⚔️ Battle General ⚔️ ## +### Changed +* Updated Damage Category icons to match Gen6+ colors by @kittenchilly in [#5080](https://github.com/rh-hideout/pokeemerald-expansion/pull/5080) +### Fixed +* Fixed Slateport Battle Tent/Battle Factory issues by @SarnPoke in [#5281](https://github.com/rh-hideout/pokeemerald-expansion/pull/5281) + * Choosing the "SWAP" option no longer shows invalid Pokémon ("??????????"). + * Reloading after choosing "REST" no longer resets the player's challenge party to invalid Pokémon ("??????????"). +* Fixed Starting Status happening Wild Battles from a previous Trainer Battle by @PhallenTree in [#5248](https://github.com/rh-hideout/pokeemerald-expansion/pull/5248) +* Fixed bugged behavior caused by Z-Moves and disobedience by @hedara90 in [#5245](https://github.com/rh-hideout/pokeemerald-expansion/pull/5245) +* Fixed Entry Hazards targeting wrong side of the field if the opponent fainted by @PhallenTree in [#5262](https://github.com/rh-hideout/pokeemerald-expansion/pull/5262) +* Fixed being able to use multiple of the same Gimmick in Double Battles by @AgustinGDLV in [#5235](https://github.com/rh-hideout/pokeemerald-expansion/pull/5235) +* Fixed Terastallization not granting immunity to Tar Shot by @AlexOn1ine in [#5302](https://github.com/rh-hideout/pokeemerald-expansion/pull/5302) +* Fixed `Cmd_trainerslidein/out` using the incorrect function by @ghoulslash in [#5326](https://github.com/rh-hideout/pokeemerald-expansion/pull/5326) + * Cleanup by @hedara90 in [#5344](https://github.com/rh-hideout/pokeemerald-expansion/pull/5344) + +## 🤹 Moves 🤹 +### Added +* Added Charge's Gen 9 behavior via `B_CHARGE` config by @AlexOn1ine in [#5274](https://github.com/rh-hideout/pokeemerald-expansion/pull/5274) +* Added Powder's Gen 7+ behavior of not causing damage when under Heavy Rain via `B_POWDER_RAIN` by @PhallenTree in [#5370](https://github.com/rh-hideout/pokeemerald-expansion/pull/5370) +### Fixed +* Fixed move descriptions missing periods (Decorate, Collision Course, Electro Drift) by @Pawkkie and Kasen in [#5221](https://github.com/rh-hideout/pokeemerald-expansion/pull/5221) +* Fixed Confide not being blocked by Crafty Shield interaction by @hedara90 in [#5202](https://github.com/rh-hideout/pokeemerald-expansion/pull/5202) +* Fixed message for switch out moves by @kittenchilly in [#5258](https://github.com/rh-hideout/pokeemerald-expansion/pull/5258) +* Fixed Ice Fang's descriptions using the opposite of what they're supposed to do based on `B_USE_FROSTBITE` by @laserXdolphin in [#5273](https://github.com/rh-hideout/pokeemerald-expansion/pull/5273) +* Fixes to Instruct by @PhallenTree in [#5262](https://github.com/rh-hideout/pokeemerald-expansion/pull/5262) + * Fixed Instruct bypassing AtkCanceler checks (Instruct allowed the target to act while asleep, flinched, etc.) and its interaction with First Turn Only moves (Fake Out, First Impression, Mat Block). + * Fixed Instruct's animation using the attacker and target of the called move. +* Fixed Scale Shot's effect not activating if the opponent fainted before all hits finished by @AlexOn1ine in [#5292](https://github.com/rh-hideout/pokeemerald-expansion/pull/5292) +* Fixed Round not preserving turn order for non-Round users if there's a switch out at the beginning of the turn by @AlexOn1ine in [#5292](https://github.com/rh-hideout/pokeemerald-expansion/pull/5292) +* Fixed Max Moves ignoring absorbing abilities (+ test) by @PhallenTree in [#5296](https://github.com/rh-hideout/pokeemerald-expansion/pull/5296) +* Fixed attack string for Max Moves not being printed if it's blocked by Max Guard by @hedara90 in [#5312](https://github.com/rh-hideout/pokeemerald-expansion/pull/5312) +* Fixed some Pledge move combo issues by @PhallenTree in [#5330](https://github.com/rh-hideout/pokeemerald-expansion/pull/5330) + * Fixed Pledge move combos attempting to be executed multiple times in a turn, causing mons to decrement sleep timer multiple times during the turn or causing infinite loops. +* Fixed potential issue with custom non-sound moves that use `EFFECT_ATTACK_UP_USER_ALLY` or `EFFECT_PERISH_SONG` being blocked by Soundproof anyway by @AlexOn1ine in [#5301](https://github.com/rh-hideout/pokeemerald-expansion/pull/5301) +* Fixed Pledge combinations not being absorbed by absorption Abilities (Sap Sipper, Storm Drain, etc.) by @hedara90 in [#5364](https://github.com/rh-hideout/pokeemerald-expansion/pull/5364) +* Fixed Toxic Thread decreasing speed by 2 stages instead of 1 by @AsparagusEduardo in [#5369](https://github.com/rh-hideout/pokeemerald-expansion/pull/5369) +* Fixed Destiny Bond not working if the user was fainted by a multi-Hit move's non-first hit by @AlexOn1ine in [#5377](https://github.com/rh-hideout/pokeemerald-expansion/pull/5377) +* Fixed Powder interactions by @PhallenTree in [#5370](https://github.com/rh-hideout/pokeemerald-expansion/pull/5370) + * Fixed Magic Guard not protecting against Powder's secondary damage when using a Fire-type move. + * Fixed Fire/Water Pledge combination being cancelled by Powder. + * Fixed Fire Z-Moves not playing their animations and not granting their secondary effects when the user is under Powder's effect +* Fixed After You/Shell Trap not updating battlers' actions correctly by @PhallenTree in [#5384](https://github.com/rh-hideout/pokeemerald-expansion/pull/5384) + +## 🎭 Abilities 🎭 +### Fixed +* Fixed weather abilities not activating when Cloud Nine user leaves the field by @AlexOn1ine in [#5209](https://github.com/rh-hideout/pokeemerald-expansion/pull/5209) +* Fixed missing `break` for Poison Puppeteer's code by @u8-Salem in [#5243](https://github.com/rh-hideout/pokeemerald-expansion/pull/5243) +* Fixed Pokémon with Purifying Salt being poisoned by Toxic Spikes by @AlexOn1ine in [#5252](https://github.com/rh-hideout/pokeemerald-expansion/pull/5252) +* Fixed Parental Bond not affecting Snore by @hedara90 in [#5264](https://github.com/rh-hideout/pokeemerald-expansion/pull/5264) +* Fixed Tera Shift's description by @AsparagusEduardo in [#5351](https://github.com/rh-hideout/pokeemerald-expansion/pull/5351) + +## 🧶 Items 🧶 +### Fixed +* Fixed berries missing their timing after passive damage by @AlexOn1ine in [#5300](https://github.com/rh-hideout/pokeemerald-expansion/pull/5300) +* Fixed Micle Berry not increasing accuracy on the next turn by @AlexOn1ine in [#5358](https://github.com/rh-hideout/pokeemerald-expansion/pull/5358) + +## 🤖 Battle AI 🤖 +### Changed +* AI is encouraged to use "always crit" moves on partner with Anger Point by @SarnPoke in [#5244](https://github.com/rh-hideout/pokeemerald-expansion/pull/5244) +### Fixed +* Fixed AI not seeing the power of Max Moves by @AlexOn1ine in [#5299](https://github.com/rh-hideout/pokeemerald-expansion/pull/5299) +* Fixed minor wrong order in `AI_CalcDamage` that made Nature Power not be considered for Z-Moves by @AlexOn1ine in [#5155](https://github.com/rh-hideout/pokeemerald-expansion/pull/5155) +* Fixed AI not considering Tera Blast/Tera Storm by @AlexOn1ine in [#5155](https://github.com/rh-hideout/pokeemerald-expansion/pull/5155) +* Fixed `AI_IsMoveEffectInPlus` reading the incorrect stat for secondary effects that reduce stats by 2 stages by @ghoulslash and @Pawkkie in [#5366](https://github.com/rh-hideout/pokeemerald-expansion/pull/5366) + +## 🧹 Other Cleanup 🧹 +### Changed +* Remove unused `BattleScript_WindPowerActivatesEnd2` signature by @u8-Salem in [#5257](https://github.com/rh-hideout/pokeemerald-expansion/pull/5257) +* Replaced all usages of tabs in C files with spaces by @hedara90 in [#5261](https://github.com/rh-hideout/pokeemerald-expansion/pull/5261) +* Fixed missing `break`s in two `ENDTURN` cases by @ghoulslash in [#5350](https://github.com/rh-hideout/pokeemerald-expansion/pull/5350) +* `ShouldSwitchIfWonderGuard` cleanup by @Pawkkie in [#5383](https://github.com/rh-hideout/pokeemerald-expansion/pull/5383) + +## 🧪 Test Runner 🧪 +### Added +* Added missing Adaptability, Aerilate, Aftermath tests by @kittenchilly in [#5242](https://github.com/rh-hideout/pokeemerald-expansion/pull/5242) +* Added missing Disguise tests by @hedara90 in [#5249](https://github.com/rh-hideout/pokeemerald-expansion/pull/5249) +* Added some missing Instruct tests by @PhallenTree in [#5262](https://github.com/rh-hideout/pokeemerald-expansion/pull/5262) +* Added missing Powder tests by @PhallenTree in [#5370](https://github.com/rh-hideout/pokeemerald-expansion/pull/5370) +* Added `ShouldSwitchIfWonderGuard` AI tests by @Pawkkie in [#5383](https://github.com/rh-hideout/pokeemerald-expansion/pull/5383) +### Changed +* Moved `ASSUME`s to inside `GIVEN` blocks to prevent them from being added correctly to the totals in the test summary by @AsparagusEduardo in [#5308](https://github.com/rh-hideout/pokeemerald-expansion/pull/5308) + +## 📚 Documentation 📚 +### Fixed +* Fixed test system documentation saying that `make check TESTS="Spikes"` could be done with single quotes instead of double quotes by @AsparagusEduardo in [#5266](https://github.com/rh-hideout/pokeemerald-expansion/pull/5266) + +## 📦 Branch Synchronisation 📦 +### pret's base pokeemerald +* N/A +### merrp/aarant's followers +* Merrp merge (September 9th) by @AsparagusEduardo in [#5359](https://github.com/rh-hideout/pokeemerald-expansion/pull/5359) + * aarant#40 (discarded, as it was already part of the expansion) + * New features: + * [Static OW pokemon now bob while walking in place](https://github.com/rh-hideout/pokeemerald-expansion/commit/839cf2e79012e0fc9159af5ab9e6a497e86bbfa4) + * Toggled by `OW_FOLLOWERS_BOBBING`. + * [Added `OW_MON_WANDER_WALK` config option](https://github.com/rh-hideout/pokeemerald-expansion/commit/42d9f24c8472a67d742d9d9da106480c84514336) + * If true, OW pokemon with `MOVEMENT_TYPE_WANDER*` will walk-in-place in between steps. + +## New Contributors +* @laserXdolphin made their first contribution in [#5273](https://github.com/rh-hideout/pokeemerald-expansion/pull/5273) +* @Liamjd14 made their first contribution in [#5304](https://github.com/rh-hideout/pokeemerald-expansion/pull/5304) + +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.9.1...expansion/1.9.2 + diff --git a/docs/changelogs/template.md b/docs/changelogs/template.md index a40afebad3..fe4191f589 100644 --- a/docs/changelogs/template.md +++ b/docs/changelogs/template.md @@ -10,7 +10,7 @@ 📜 = Uses a migration script. * N/A -## 💥 *Softlock/Crash fixes* 💥 +## 💥 *Hardlock/Softlock/Crash/Compiling fixes* 💥 * N/A ## 🧬 General 🧬 @@ -122,6 +122,14 @@ ### Fixed * N/A +## 📚 Documentation 📚 +### Added +* N/A +### Changed +* N/A +### Fixed +* N/A + ## 📦 Branch Synchronisation 📦 ### pret's base pokeemerald * N/A @@ -135,3 +143,4 @@ **Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.Y.Z...expansion/1.Y.Z + diff --git a/include/constants/expansion.h b/include/constants/expansion.h index caf7e4ddab..338c41a848 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -1,13 +1,13 @@ #ifndef GUARD_CONSTANTS_EXPANSION_H #define GUARD_CONSTANTS_EXPANSION_H -// 1.9.1 +// 1.9.2 #define EXPANSION_VERSION_MAJOR 1 #define EXPANSION_VERSION_MINOR 9 #define EXPANSION_VERSION_PATCH 2 // 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 6116b8b04e4152f4e794fd54907c1a9979db375a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 16 Sep 2024 11:57:41 -0300 Subject: [PATCH 094/133] Start 1.9.3 cycle --- include/constants/expansion.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/constants/expansion.h b/include/constants/expansion.h index 338c41a848..8a86282619 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -1,13 +1,13 @@ #ifndef GUARD_CONSTANTS_EXPANSION_H #define GUARD_CONSTANTS_EXPANSION_H -// 1.9.2 +// Last version: 1.9.2 #define EXPANSION_VERSION_MAJOR 1 #define EXPANSION_VERSION_MINOR 9 -#define EXPANSION_VERSION_PATCH 2 +#define EXPANSION_VERSION_PATCH 3 // 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 95dac7c4acb7fea7b3d4af866194236eee7d4926 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:58:43 +0200 Subject: [PATCH 095/133] Remove potential uninitialized behavior (#5393) `MAX_BATTLERS_COUNT` makes more sense to use here because we iterate over max battlers in the first place. --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 04f3c966bb..698b8db4b4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8935,7 +8935,7 @@ static bool32 ChangeOrderTargetAfterAttacker(void) || GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) return FALSE; - for (i = 0; i < gBattlersCount; i++) + for (i = 0; i < MAX_BATTLERS_COUNT; i++) { data[i] = gBattlerByTurnOrder[i]; actionsData[i] = gActionsByTurnOrder[i]; From 27db57f854856ccb75cf6b661e78d45f1e4e17c5 Mon Sep 17 00:00:00 2001 From: RavePossum <145081120+ravepossum@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:57:13 -0400 Subject: [PATCH 096/133] fallback on default BW popup theme to reduce potential for error (#5392) --- src/map_name_popup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 5cc1f3cfd5..500d45e866 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -625,7 +625,7 @@ static void LoadMapNamePopUpWindowBg(void) switch (popUpThemeId) { // add additional gen 5-style pop-up themes as cases here - case MAPPOPUP_THEME_BW_DEFAULT: + default: // MAPPOPUP_THEME_BW_DEFAULT if (OW_POPUP_BW_COLOR == OW_POPUP_BW_COLOR_WHITE) LoadPalette(sMapPopUpTilesPalette_BW_White, BG_PLTT_ID(14), sizeof(sMapPopUpTilesPalette_BW_White)); else From 6ef36837e94edcde20a5ddf78ab0c89e77df106a Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:58:49 +0200 Subject: [PATCH 097/133] Fixed corruption of the next turn used move caused by Scale Shot (#5397) --- data/battle_scripts_1.s | 40 +++-------------------------- include/battle_scripts.h | 1 + src/battle_script_commands.c | 10 +++----- test/battle/move_effect/multi_hit.c | 40 +++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 43 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0040c7e804..06b82f43b7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3279,51 +3279,17 @@ BattleScript_RoarBlockedByDynamax: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_MultiHitLoop:: - jumpifhasnohp BS_ATTACKER, BattleScript_MultiHitEnd - jumpifhasnohp BS_TARGET, BattleScript_MultiHitPrintStrings - jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoMultiHit - jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_MultiHitPrintStrings -BattleScript_DoMultiHit:: - movevaluescleanup - copyhword sMOVE_EFFECT, sMULTIHIT_EFFECT - critcalc - damagecalc - jumpifmovehadnoeffect BattleScript_MultiHitNoMoreHits - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - multihitresultmessage - flushtextbox - addbyte sMULTIHIT_STRING + 4, 1 - moveendto MOVEEND_NEXT_TARGET - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings - decrementmultihit BattleScript_MultiHitLoop - goto BattleScript_MultiHitPrintStrings -BattleScript_MultiHitNoMoreHits:: - pause B_WAIT_TIME_SHORT BattleScript_MultiHitPrintStrings:: resultmessage waitmessage B_WAIT_TIME_LONG - jumpifmovehadnoeffect BattleScript_MultiHitEnd copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 printstring STRINGID_HITXTIMES waitmessage B_WAIT_TIME_LONG return -BattleScript_MultiHitEnd:: - setadditionaleffects - tryfaintmon BS_TARGET - moveendcase MOVEEND_SYNCHRONIZE_TARGET - moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES - end +BattleScript_ScaleShot:: + call BattleScript_MultiHitPrintStrings + goto BattleScript_DefDownSpeedUp BattleScript_EffectConversion:: attackcanceler diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 893ab42a5e..e98790764d 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -460,6 +460,7 @@ extern const u8 BattleScript_DefDownSpeedUp[]; extern const u8 BattleScript_AffectionBasedStatusHeal[]; extern const u8 BattleScript_AffectionBasedEndurance[]; extern const u8 BattleScript_SymbiosisActivates[]; +extern const u8 BattleScript_ScaleShot[]; extern const u8 BattleScript_MultiHitPrintStrings[]; extern const u8 BattleScript_RemoveFireType[]; extern const u8 BattleScript_TargetAbilityStatRaiseRet[]; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 698b8db4b4..1e4b10e928 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6030,13 +6030,11 @@ static void Cmd_moveend(void) gBattleScripting.multihitString[4]++; if (gMultiHitCounter == 0) { - if (gMovesInfo[gCurrentMove].argument == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty()) - { - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; - } BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + if (gMovesInfo[gCurrentMove].argument == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty()) + gBattlescriptCurrInstr = BattleScript_ScaleShot; + else + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; effect = TRUE; } else diff --git a/test/battle/move_effect/multi_hit.c b/test/battle/move_effect/multi_hit.c index fca9da8150..052226d1c8 100644 --- a/test/battle/move_effect/multi_hit.c +++ b/test/battle/move_effect/multi_hit.c @@ -160,6 +160,46 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after final } } +SINGLE_BATTLE_TEST("Scale Shot is immune to Fairy types and will end the move correctly") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + ASSUME(gMovesInfo[MOVE_SCALE_SHOT].type == TYPE_DRAGON); + ASSUME(gSpeciesInfo[SPECIES_CLEFAIRY].types[0] == TYPE_FAIRY || gSpeciesInfo[SPECIES_CLEFAIRY].types[1] == TYPE_FAIRY); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_CLEFAIRY) { HP(1); } + } WHEN { + TURN { MOVE(player, MOVE_SCALE_SHOT); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player); + MESSAGE("It doesn't affect Foe Clefairy…"); + } +} + +DOUBLE_BATTLE_TEST("Scale Shot does not corrupt the next turn move used") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_SCALE_SHOT, target: opponentRight); SWITCH(playerLeft, 2); SEND_OUT(opponentRight, 2); } + TURN { MOVE(playerRight, MOVE_BULLDOZE); MOVE(playerLeft, MOVE_CELEBRATE); MOVE(opponentRight, MOVE_CELEBRATE); MOVE(opponentLeft, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, playerRight); + HP_BAR(opponentRight); + MESSAGE("Hit 1 time(s)!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLDOZE, playerRight); + HP_BAR(playerLeft); + HP_BAR(opponentLeft); + HP_BAR(opponentRight); + } +} + SINGLE_BATTLE_TEST("Endure does not prevent multiple hits and stat changes occur at the end of the turn") { GIVEN { From ac2b41ae71de8539217d046f15b873101b818741 Mon Sep 17 00:00:00 2001 From: nescioquid <34481132+nescioquid@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:03:36 -0400 Subject: [PATCH 098/133] Typo fixes and Growth move description change (#5398) * changes Growth's move description to account for Gen 5+ behavior * completes B_DIVE_BALL_MODIFIER comment * fixes typos and incongruent spacing in various files * Update src/data/moves_info.h Co-authored-by: Bassoonian --------- Co-authored-by: Bassoonian --- include/config/battle.h | 2 +- include/config/overworld.h | 4 ++-- migration_scripts/README.md | 2 +- src/data/moves_info.h | 5 +++++ src/party_menu.c | 2 +- src/pokemon.c | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index 501c4162ee..402b5db6cf 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -165,7 +165,7 @@ #define B_RESTORE_HELD_BATTLE_ITEMS GEN_LATEST // In Gen9, all non-berry items are restored after battle. #define B_SOUL_DEW_BOOST GEN_LATEST // In Gens3-6, Soul Dew boosts Latis' Sp. Atk and Sp. Def. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead. #define B_NET_BALL_MODIFIER GEN_LATEST // In Gen7+, Net Ball's catch multiplier is x5 instead of x3. -#define B_DIVE_BALL_MODIFIER GEN_LATEST // In Gen4+, Dive Ball's effectiveness increases by when Surfing or Fishing. +#define B_DIVE_BALL_MODIFIER GEN_LATEST // In Gen4+, Dive Ball's effectiveness increases by x3.5 when Surfing or Fishing. #define B_NEST_BALL_MODIFIER GEN_LATEST // Nest Ball's formula varies depending on the Gen. See Cmd_handleballthrow. #define B_REPEAT_BALL_MODIFIER GEN_LATEST // In Gen7+, Repeat Ball's catch multiplier is x3.5 instead of x3. #define B_TIMER_BALL_MODIFIER GEN_LATEST // In Gen5+, Timer Ball's effectiveness increases by x0.3 per turn instead of x0.1 diff --git a/include/config/overworld.h b/include/config/overworld.h index 2e1e1d7b12..c792c76678 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -44,7 +44,7 @@ // 16x32, 32x32, 64x64 etc are fine #define OW_MON_WANDER_WALK TRUE // If true, OW pokemon with MOVEMENT_TYPE_WANDER will walk-in-place in between steps. // Follower Pokémon -#define OW_FOLLOWERS_ENABLED FALSE // Enables follower Pokémon, HGSS style. Requires OW_POKEMON_OBJECT_EVENTS. Note that additional scripting may be required for them to be fully supported! +#define OW_FOLLOWERS_ENABLED FALSE // Enables follower Pokémon, HGSS style. Requires OW_POKEMON_OBJECT_EVENTS. Note that additional scripting may be required for them to be fully supported! #define OW_FOLLOWERS_BOBBING TRUE // If true, follower pokemon will bob up and down during their idle & walking animations #define OW_FOLLOWERS_POKEBALLS TRUE // Followers will emerge from the pokeball they are stored in, instead of a normal pokeball @@ -79,7 +79,7 @@ // Map pop-up config #define OW_POPUP_GENERATION GEN_3 // Different generations display location names in overworld pop-ups differently. - // Only choies are currently GEN_3 and GEN_5, all others will default to Gen3 pop-ups. + // Only choices are currently GEN_3 and GEN_5, all others will default to Gen3 pop-ups. // Gen5 map pop-up config // Constants diff --git a/migration_scripts/README.md b/migration_scripts/README.md index 5ae26c1c0a..5ff925d8ef 100644 --- a/migration_scripts/README.md +++ b/migration_scripts/README.md @@ -11,7 +11,7 @@ These scripts exist to help developers make the transition between refactored sy All migration scripts require [`python3`](https://www.python.org/downloads/) to be installed. Migration scripts are executed by running the following commands from the root directory of a developer's project. ```bash -chmod +x migration_scripts/*.py ; #give permision to make the script executable +chmod +x migration_scripts/*.py ; #give permission to make the script executable python3 migration_scripts/*.py ; #run the migration script ``` diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 6e0230cf31..b6d0aaf3ca 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -1938,8 +1938,13 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = COMPOUND_STRING("Growth"), .description = COMPOUND_STRING( + #if B_GROWTH_STAT_RAISE >= GEN_5 + "Forces the body to grow,\n" + "raising Attack and Sp. Atk."), + #else "Forces the body to grow\n" "and heightens Sp. Atk."), + #endif .effect = B_GROWTH_STAT_RAISE >= GEN_5 ? EFFECT_GROWTH : EFFECT_SPECIAL_ATTACK_UP, .power = 0, .type = TYPE_NORMAL, diff --git a/src/party_menu.c b/src/party_menu.c index 5214ddc2be..32ccd6ca19 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4672,7 +4672,7 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc task) if (canHeal == TRUE) { if (hp == 0) - AnimatePartySlot(gPartyMenu.slotId, 1); + AnimatePartySlot(gPartyMenu.slotId, 1); PartyMenuModifyHP(taskId, gPartyMenu.slotId, 1, GetMonData(mon, MON_DATA_HP) - hp, Task_DisplayHPRestoredMessage); ResetHPTaskData(taskId, 0, hp); return; diff --git a/src/pokemon.c b/src/pokemon.c index 66fb83332f..0583939a85 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -684,7 +684,7 @@ const struct NatureInfo gNaturesInfo[NUM_NATURES] = #elif P_LVL_UP_LEARNSETS >= GEN_8 #include "data/pokemon/level_up_learnsets/gen_8.h" // Sword/Shield #elif P_LVL_UP_LEARNSETS >= GEN_7 -#include "data/pokemon/level_up_learnsets/gen_7.h" // Ultra Sun/ Ultra Moon +#include "data/pokemon/level_up_learnsets/gen_7.h" // Ultra Sun/Ultra Moon #elif P_LVL_UP_LEARNSETS >= GEN_6 #include "data/pokemon/level_up_learnsets/gen_6.h" // Omega Ruby/Alpha Sapphire #elif P_LVL_UP_LEARNSETS >= GEN_5 From 76656e85c2f682f35d2504ee4a46c8c2f37dad0b Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Wed, 18 Sep 2024 23:10:29 +0100 Subject: [PATCH 099/133] Fix Quash implementation, adds After You and Quash missing configs + tests (#5400) * Fix Quash + After You and Quash configs * Add tests --- include/config/battle.h | 2 + src/battle_script_commands.c | 41 ++++++++----- test/battle/move_effect/after_you.c | 49 ++++++++++++++- test/battle/move_effect/quash.c | 92 ++++++++++++++++++++++++++++- 4 files changed, 163 insertions(+), 21 deletions(-) diff --git a/include/config/battle.h b/include/config/battle.h index 402b5db6cf..b00eb199a9 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -123,6 +123,8 @@ #define B_HEAL_BELL_SOUNDPROOF GEN_LATEST // In Gen5, Heal Bell affects all mons with Soundproof. In Gen6-8 it affects inactive mons, but not battlers. In Gen9 it always affects the user. #define B_CHARGE GEN_LATEST // In Gen8-, Charge status is lost regardless of the typing of the next move. #define B_POWDER_RAIN GEN_LATEST // In Gen7+, Powder doesn't damage the user of a Fire type move in heavy rain. +#define B_AFTER_YOU_TURN_ORDER GEN_LATEST // In Gen8+, After You doesn't fail if the turn order wouldn't change after use. +#define B_QUASH_TURN_ORDER GEN_LATEST // In Gen8+, Quash-affected battlers move according to speed order. Before Gen8, Quash-affected battlers move in the order they were affected by Quash. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1e4b10e928..ee2a148831 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8929,9 +8929,10 @@ static bool32 ChangeOrderTargetAfterAttacker(void) u8 data[MAX_BATTLERS_COUNT]; u8 actionsData[MAX_BATTLERS_COUNT]; - if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget) - || GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) + if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) return FALSE; + if (GetBattlerTurnOrderNum(gBattlerAttacker) + 1 == GetBattlerTurnOrderNum(gBattlerTarget)) + return B_AFTER_YOU_TURN_ORDER >= GEN_8; for (i = 0; i < MAX_BATTLERS_COUNT; i++) { @@ -8944,8 +8945,6 @@ static bool32 ChangeOrderTargetAfterAttacker(void) gActionsByTurnOrder[1] = actionsData[2]; gBattlerByTurnOrder[2] = data[1]; gActionsByTurnOrder[2] = actionsData[1]; - gBattlerByTurnOrder[3] = data[3]; - gActionsByTurnOrder[3] = actionsData[3]; } else if (GetBattlerTurnOrderNum(gBattlerAttacker) == 0 && GetBattlerTurnOrderNum(gBattlerTarget) == 3) { @@ -17110,7 +17109,7 @@ void BS_TryActivateGulpMissile(void) void BS_TryQuash(void) { NATIVE_ARGS(const u8 *failInstr); - u32 i; + u32 i, j; // It's true if foe is faster, has a bigger priority, or switches if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) @@ -17121,19 +17120,29 @@ void BS_TryQuash(void) // If the above condition is not true, it means we are faster than the foe, so we can set the quash bit gProtectStructs[gBattlerTarget].quash = TRUE; - for (i = 0; i < gBattlersCount; i++) + + if (B_QUASH_TURN_ORDER < GEN_8) { - gBattlerByTurnOrder[i] = i; - } - for (i = 0; i < gBattlersCount - 1; i++) - { - s32 j; - for (j = i + 1; j < gBattlersCount; j++) + // Gen 7- config makes target go last so that the order of quash targets is kept for the correct turn order + j = GetBattlerTurnOrderNum(gBattlerTarget); + for (i = j + 1; i < gBattlersCount; i++) { - if (!gProtectStructs[i].quash - && !gProtectStructs[j].quash - && GetWhichBattlerFaster(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE) == -1) - SwapTurnOrder(i, j); + SwapTurnOrder(i, j); + j++; + } + } + else + { + // Gen 8+ config only alters Turn Order of battlers affected by Quash, dynamic speed should handle the rest + for (i = gCurrentTurnActionNumber + 1; i < gBattlersCount - 1; i++) + { + for (j = i + 1; j < gBattlersCount; j++) + { + u32 battler1 = gBattlerByTurnOrder[i], battler2 = gBattlerByTurnOrder[j]; + if ((gProtectStructs[battler1].quash || gProtectStructs[battler2].quash) + && GetWhichBattlerFaster(battler1, battler2, FALSE) == -1) + SwapTurnOrder(i, j); + } } } gBattlescriptCurrInstr = cmd->nextInstr; diff --git a/test/battle/move_effect/after_you.c b/test/battle/move_effect/after_you.c index b788fab725..32ea44efb1 100644 --- a/test/battle/move_effect/after_you.c +++ b/test/battle/move_effect/after_you.c @@ -52,7 +52,7 @@ DOUBLE_BATTLE_TEST("After You does nothing if the target has already moved") } } -DOUBLE_BATTLE_TEST("After You calculates correct targets if only one pokemon is left on the opposing side") +DOUBLE_BATTLE_TEST("After You calculates correct turn order if only one pokemon is left on the opposing side") { GIVEN { PLAYER(SPECIES_GRENINJA) { Speed(120); } @@ -86,5 +86,48 @@ DOUBLE_BATTLE_TEST("After You calculates correct targets if only one pokemon is } } -TO_DO_BATTLE_TEST("After You doesn't fail if the turner remains the same after After You (Gen8+)"); -TO_DO_BATTLE_TEST("After You ignores the effects of Quash"); +DOUBLE_BATTLE_TEST("After You doesn't fail if the turn order remains the same after After You (Gen8+)") +{ + GIVEN { + ASSUME(B_AFTER_YOU_TURN_ORDER >= GEN_8); + PLAYER(SPECIES_WOBBUFFET) { Speed(4); } + PLAYER(SPECIES_WYNAUT) { Speed(1); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } + OPPONENT(SPECIES_WYNAUT) { Speed(3); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_CELEBRATE); + MOVE(playerRight, MOVE_CELEBRATE); + MOVE(opponentLeft, MOVE_CELEBRATE); + MOVE(opponentRight, MOVE_AFTER_YOU, target: opponentLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); + } +} + +DOUBLE_BATTLE_TEST("After You ignores the effects of Quash") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_QUASH].effect == EFFECT_QUASH); + PLAYER(SPECIES_WOBBUFFET) { Speed(4); } + PLAYER(SPECIES_WYNAUT) { Speed(1); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(2); } + OPPONENT(SPECIES_WYNAUT) { Speed(3); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_QUASH, target: opponentLeft); + MOVE(playerRight, MOVE_CELEBRATE); + MOVE(opponentLeft, MOVE_CELEBRATE); + MOVE(opponentRight, MOVE_AFTER_YOU, target: opponentLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); + } +} diff --git a/test/battle/move_effect/quash.c b/test/battle/move_effect/quash.c index fd2bd9d877..5500fcb33e 100644 --- a/test/battle/move_effect/quash.c +++ b/test/battle/move_effect/quash.c @@ -32,14 +32,102 @@ DOUBLE_BATTLE_TEST("Quash is not affected by dynamic speed") PLAYER(SPECIES_WOBBUFFET) { Speed(30); } OPPONENT(SPECIES_TORCHIC) { Speed(50); } OPPONENT(SPECIES_TREECKO) { Speed(40); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_QUASH, target: opponentLeft); + MOVE(opponentRight, MOVE_TAILWIND); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TAILWIND, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + } +} + +DOUBLE_BATTLE_TEST("Quash calculates correct turn order if only one pokemon is left on the opposing side") +{ + GIVEN { + PLAYER(SPECIES_GRENINJA) { Speed(120); } + PLAYER(SPECIES_REGIROCK) { Speed(100); } + OPPONENT(SPECIES_PIDGEOT) { Speed(10); } + OPPONENT(SPECIES_DRAGONITE) { Speed(60); } + } WHEN { + TURN { + MOVE(playerLeft, MOVE_QUASH, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentLeft); + MOVE(opponentRight, MOVE_CELEBRATE); + } + TURN { + MOVE(playerLeft, MOVE_QUASH, target: playerRight); + MOVE(playerRight, MOVE_STONE_EDGE, target: opponentRight); + MOVE(opponentRight, MOVE_CELEBRATE); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentLeft); + MESSAGE("Foe Pidgeot fainted!"); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_STONE_EDGE, playerRight); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Quash-affected targets move from fastest to slowest (Gen 8+) or from first affected battler to last (Gen 7-)") +{ + u32 speedLeft, speedRight; + + PARAMETRIZE { speedLeft = 60; speedRight = 50; } + PARAMETRIZE { speedLeft = 50; speedRight = 60; } + GIVEN { + PLAYER(SPECIES_VOLBEAT) { Speed(10); Ability(ABILITY_PRANKSTER); } + PLAYER(SPECIES_WOBBUFFET) { Speed(70); } + OPPONENT(SPECIES_TORCHIC) { Speed(speedLeft); } + OPPONENT(SPECIES_TREECKO) { Speed(speedRight); } } WHEN { TURN { MOVE(playerLeft, MOVE_QUASH, target: opponentRight); + MOVE(playerRight, MOVE_QUASH, target: opponentLeft); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerRight); + if (B_QUASH_TURN_ORDER < GEN_8) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + } + else if (speedLeft > speedRight) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + } + else { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Quash-affected mon that acted early via After You is not affected by dynamic speed") +{ + GIVEN { + ASSUME(B_RECALC_TURN_AFTER_ACTIONS >= GEN_8); + ASSUME(gMovesInfo[MOVE_TAILWIND].effect == EFFECT_TAILWIND); + ASSUME(gMovesInfo[MOVE_AFTER_YOU].effect == EFFECT_AFTER_YOU); + PLAYER(SPECIES_VOLBEAT) { Speed(20); Ability(ABILITY_PRANKSTER); } + PLAYER(SPECIES_WOBBUFFET) { Speed(30); } + OPPONENT(SPECIES_TORCHIC) { Speed(10); } + OPPONENT(SPECIES_TREECKO) { Speed(40); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_QUASH, target: opponentLeft); + MOVE(opponentRight, MOVE_AFTER_YOU, target: opponentLeft); MOVE(opponentLeft, MOVE_TAILWIND); } } SCENE { ANIMATION(ANIM_TYPE_MOVE, MOVE_QUASH, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_AFTER_YOU, opponentRight); ANIMATION(ANIM_TYPE_MOVE, MOVE_TAILWIND, opponentLeft); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); - ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, playerRight); // this is the relevant part, testing if quash affected battler becomes last to move causing playerRight to not move } } From 71dfd3e7c03bb02f80b8071b4f3d191ee69406f8 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 19 Sep 2024 00:25:53 +0200 Subject: [PATCH 100/133] Ogerpon masks were missing their hold effects (#5391) * Ogerpon masks were missing their hold effects * fix wrong num * test * correct tests and additional fix * added hold effect to battle debug --- include/constants/hold_effects.h | 5 ++-- src/battle_debug.c | 2 ++ src/battle_util.c | 4 +++ src/data/items.h | 6 +++++ test/battle/hold_effect/ogerpon_mask.c | 36 ++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 test/battle/hold_effect/ogerpon_mask.c diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index 0f364d2462..a159102932 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -155,11 +155,12 @@ // Gen9 hold effects #define HOLD_EFFECT_ABILITY_SHIELD 175 #define HOLD_EFFECT_CLEAR_AMULET 176 -#define HOLD_EFFECT_MIRROR_HERB 177 // Not implemented. +#define HOLD_EFFECT_MIRROR_HERB 177 #define HOLD_EFFECT_PUNCHING_GLOVE 178 #define HOLD_EFFECT_COVERT_CLOAK 179 #define HOLD_EFFECT_LOADED_DICE 180 -#define HOLD_EFFECT_BOOSTER_ENERGY 181 // Not implemented. +#define HOLD_EFFECT_BOOSTER_ENERGY 181 +#define HOLD_EFFECT_OGERPON_MASK 182 // Gen2 hold effect #define HOLD_EFFECT_BERSERK_GENE 184 diff --git a/src/battle_debug.c b/src/battle_debug.c index b088aa73ba..c3b4ac85aa 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -2435,6 +2435,7 @@ static const u8 sText_HoldEffectCovertCloak[] = _("Covert Cloak"); static const u8 sText_HoldEffectLoadedDice[] = _("Loaded Dice"); static const u8 sText_HoldEffectBoosterEnergy[] = _("Booster Energy"); static const u8 sText_HoldEffectBerserkGene[] = _("Berserk Gene"); +static const u8 sText_HoldEffectOgerponMask[] = _("Ogerpon Mask"); static const u8 *const sHoldEffectNames[] = { [HOLD_EFFECT_NONE] = sText_HoldEffectNone, @@ -2585,6 +2586,7 @@ static const u8 *const sHoldEffectNames[] = [HOLD_EFFECT_LOADED_DICE] = sText_HoldEffectLoadedDice, [HOLD_EFFECT_BOOSTER_ENERGY] = sText_HoldEffectBoosterEnergy, [HOLD_EFFECT_BERSERK_GENE] = sText_HoldEffectBerserkGene, + [HOLD_EFFECT_OGERPON_MASK] = sText_HoldEffectOgerponMask, }; static const u8 *GetHoldEffectName(u16 holdEffect) { diff --git a/src/battle_util.c b/src/battle_util.c index a3711f161c..612965fff2 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9454,6 +9454,10 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32 if (gMovesInfo[move].punchingMove) modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); break; + case HOLD_EFFECT_OGERPON_MASK: + if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_OGERPON) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); + break; } // Terastallization boosts weak, non-priority, non-multi hit moves after modifiers to 60 BP. diff --git a/src/data/items.h b/src/data/items.h index f97c4670c1..adfb1914a2 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -13659,6 +13659,8 @@ const struct Item gItemsInfo[] = { .name = HANDLE_EXPANDED_ITEM_NAME("CornrstneMask", "Cornerstone Mask"), .price = 0, + .holdEffect = HOLD_EFFECT_OGERPON_MASK, + .holdEffectParam = 20, .description = COMPOUND_STRING( "Allows Ogerpon to\n" "wield the Rock-\n" @@ -13674,6 +13676,8 @@ const struct Item gItemsInfo[] = { .name = HANDLE_EXPANDED_ITEM_NAME("WellsprngMask", "Wellspring Mask"), .price = 0, + .holdEffect = HOLD_EFFECT_OGERPON_MASK, + .holdEffectParam = 20, .description = COMPOUND_STRING( "Allows Ogerpon to\n" "wield the Water-\n" @@ -13689,6 +13693,8 @@ const struct Item gItemsInfo[] = { .name = HANDLE_EXPANDED_ITEM_NAME("HrthflameMask", "Hearthflame Mask"), .price = 0, + .holdEffect = HOLD_EFFECT_OGERPON_MASK, + .holdEffectParam = 20, .description = COMPOUND_STRING( "Allows Ogerpon to\n" "wield the Fire-\n" diff --git a/test/battle/hold_effect/ogerpon_mask.c b/test/battle/hold_effect/ogerpon_mask.c new file mode 100644 index 0000000000..31fb0511f4 --- /dev/null +++ b/test/battle/hold_effect/ogerpon_mask.c @@ -0,0 +1,36 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gItemsInfo[ITEM_CORNERSTONE_MASK].holdEffect == HOLD_EFFECT_OGERPON_MASK); + ASSUME(gItemsInfo[ITEM_WELLSPRING_MASK].holdEffect == HOLD_EFFECT_OGERPON_MASK); + ASSUME(gItemsInfo[ITEM_HEARTHFLAME_MASK].holdEffect == HOLD_EFFECT_OGERPON_MASK); + ASSUME(gItemsInfo[ITEM_CORNERSTONE_MASK].holdEffectParam == 20); + ASSUME(gItemsInfo[ITEM_WELLSPRING_MASK].holdEffectParam == 20); + ASSUME(gItemsInfo[ITEM_HEARTHFLAME_MASK].holdEffectParam == 20); +} + +SINGLE_BATTLE_TEST("Ogerpon Masks increase the base power of moves by 20%", s16 damage) +{ + u32 species; + u32 item; + PARAMETRIZE { species = SPECIES_OGERPON_TEAL_MASK; item = ITEM_NONE; } + PARAMETRIZE { species = SPECIES_OGERPON_WELLSPRING_MASK; item = ITEM_CORNERSTONE_MASK; } + PARAMETRIZE { species = SPECIES_OGERPON_HEARTHFLAME_MASK; item = ITEM_WELLSPRING_MASK; } + PARAMETRIZE { species = SPECIES_OGERPON_CORNERSTONE_MASK; item = ITEM_HEARTHFLAME_MASK; } + + GIVEN { + ASSUME(gMovesInfo[MOVE_TACKLE].power > 0); + PLAYER(species) { Item(item); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.2), results[1].damage); + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.2), results[2].damage); + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.2), results[3].damage); + } +} From 5cb1be7e5cff8a9a7afb349ce6b92175350759cf Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:58:56 +0200 Subject: [PATCH 101/133] Minor Gem check optimazation (#5401) Since the variable is only used once I removed it and replaced it with a direct call. Also the if statement is short enough to fit into one line. very ocd induced change but I couldn't look away. --- src/battle_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index a4c55ce9b5..78e44956a4 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -6010,9 +6010,7 @@ void SetTypeBeforeUsingMove(u32 move, u32 battler) gBattleStruct->dynamicMoveType = TYPE_ELECTRIC | F_DYNAMIC_TYPE_SET; // Check if a gem should activate. - moveType = GetMoveType(move); - if (holdEffect == HOLD_EFFECT_GEMS - && moveType == ItemId_GetSecondaryId(heldItem)) + if (holdEffect == HOLD_EFFECT_GEMS && GetMoveType(move) == ItemId_GetSecondaryId(heldItem)) { gSpecialStatuses[battler].gemParam = GetBattlerHoldEffectParam(battler); gSpecialStatuses[battler].gemBoost = TRUE; From 68c51f84121f12dc87737ad3283a3e5a974f4093 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:00:32 +0200 Subject: [PATCH 102/133] Fixes Spiky Shield Counter interaction (#5402) * Fixes Spiky Shield Counter interaction * Update test/battle/move_effect/protect.c --------- Co-authored-by: Bassoonian --- src/battle_script_commands.c | 4 +++- test/battle/move_effect/protect.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ee2a148831..0048cf14e4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5448,7 +5448,9 @@ static void Cmd_moveend(void) case MOVEEND_PROTECT_LIKE_EFFECT: if (gProtectStructs[gBattlerAttacker].touchedProtectLike) { - if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) + if (gProtectStructs[gBattlerTarget].spikyShielded + && gMovesInfo[gCurrentMove].effect != EFFECT_COUNTER + && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 8; diff --git a/test/battle/move_effect/protect.c b/test/battle/move_effect/protect.c index aca5ef859d..60b55ebb75 100644 --- a/test/battle/move_effect/protect.c +++ b/test/battle/move_effect/protect.c @@ -547,3 +547,22 @@ DOUBLE_BATTLE_TEST("Crafty Shield does not protect against moves that target all MESSAGE("Foe Sunflora's Defense rose!"); } } + +SINGLE_BATTLE_TEST("Spiky Shield does not damage users on Counter or Mirror Coat") +{ + u32 move; + PARAMETRIZE { move = MOVE_MIRROR_COAT; } + PARAMETRIZE { move = MOVE_COUNTER; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SPIKY_SHIELD); MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIKY_SHIELD, player); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(opponent); + } + } +} From fee26e29f5f1b513ea887a0de390ad5c3dad6fe2 Mon Sep 17 00:00:00 2001 From: psf <77138753+pkmnsnfrn@users.noreply.github.com> Date: Thu, 19 Sep 2024 03:01:12 -0700 Subject: [PATCH 103/133] Add AUTO_SCROLL_TEXT and NUM_FRAMES_AUTO_SCROLL_DELAY (#5054) * Added AUTO_SCROLL_TEXT * Moved NUM_FRAMES_AUTO_SCROLL_DELAY * Moved NUM_FRAMES_AUTO_SCROLL_DELAY per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054/files#r1698268265 * Apply suggestions from https://github.com/rh-hideout/pokeemerald-expansion/pull/5054/files#r1698268524 Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Added ability to skip text with button press per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054\#issuecomment-2267100771 * Update gflib/text.h per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054#issuecomment-2274402891 * Update text.h * Fixed alignment per https://github.com/rh-hideout/pokeemerald-expansion/pull/5054/files\#r1711780606 * Moved NUM_FRAMES_AUTO_SCROLL_DELAY * Update gflib/text.c Co-authored-by: Bassoonian --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> Co-authored-by: Bassoonian --- gflib/text.c | 34 +++++++++++++++++++++------------- include/config/general.h | 3 +++ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/gflib/text.c b/gflib/text.c index 59c6e3f4e8..e2adba1cdb 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -932,8 +932,9 @@ bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) { struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields); - if (subStruct->autoScrollDelay == 49) + if (subStruct->autoScrollDelay == NUM_FRAMES_AUTO_SCROLL_DELAY) { + subStruct->autoScrollDelay = 0; return TRUE; } else @@ -943,21 +944,29 @@ bool32 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) } } +void SetResultWithButtonPress(bool32 *result) +{ + if (JOY_NEW(A_BUTTON | B_BUTTON)) + { + *result = TRUE; + PlaySE(SE_SELECT); + } +} + bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter) { bool32 result = FALSE; - if (gTextFlags.autoScroll != 0) + if (gTextFlags.autoScroll != 0 || AUTO_SCROLL_TEXT) { result = TextPrinterWaitAutoMode(textPrinter); + + if (AUTO_SCROLL_TEXT) + SetResultWithButtonPress(&result); } else { TextPrinterDrawDownArrow(textPrinter); - if (JOY_NEW(A_BUTTON | B_BUTTON)) - { - result = TRUE; - PlaySE(SE_SELECT); - } + SetResultWithButtonPress(&result); } return result; } @@ -965,17 +974,16 @@ bool32 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter) bool32 TextPrinterWait(struct TextPrinter *textPrinter) { bool32 result = FALSE; - if (gTextFlags.autoScroll != 0) + if (gTextFlags.autoScroll != 0 || AUTO_SCROLL_TEXT) { result = TextPrinterWaitAutoMode(textPrinter); + + if (AUTO_SCROLL_TEXT) + SetResultWithButtonPress(&result); } else { - if (JOY_NEW(A_BUTTON | B_BUTTON)) - { - result = TRUE; - PlaySE(SE_SELECT); - } + SetResultWithButtonPress(&result); } return result; } diff --git a/include/config/general.h b/include/config/general.h index dc39f4919a..ac338a1f50 100644 --- a/include/config/general.h +++ b/include/config/general.h @@ -72,6 +72,9 @@ #define SUMMARY_SCREEN_NATURE_COLORS TRUE // If TRUE, nature-based stat boosts and reductions will be red and blue in the summary screen. #define HQ_RANDOM TRUE // If TRUE, replaces the default RNG with an implementation of SFC32 RNG. May break code that relies on RNG. #define COMPETITIVE_PARTY_SYNTAX TRUE // If TRUE, parties are defined in "competitive syntax". +#define AUTO_SCROLL_TEXT FALSE // If TRUE, text will automatically scroll to the next line after NUM_FRAMES_AUTO_SCROLL_DELAY. Players can still press A_BUTTON or B_BUTTON to scroll on their own. +#define NUM_FRAMES_AUTO_SCROLL_DELAY 49 + // Measurement system constants to be used for UNITS #define UNITS_IMPERIAL 0 // Inches, feet, pounds From f0bd3c57daa2a32eca39e01b8f10c92d85d8e4bf Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Thu, 19 Sep 2024 05:45:11 -0700 Subject: [PATCH 104/133] Fixed spacing per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#pullrequestreview-2315029773 --- src/field_control_avatar.c | 8 ++++---- src/field_message_box.c | 2 +- src/scrcmd.c | 2 +- src/script.c | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index bad5974f16..cc1f95753c 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -161,7 +161,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) gSpecialVar_LastTalked = 0; gSelectedObjectEvent = 0; - gMsgIsSignPost = FALSE; + gMsgIsSignPost = FALSE; playerDirection = GetPlayerFacingDirection(); GetPlayerPosition(&position); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); @@ -1122,7 +1122,7 @@ static void SetMsgSignPostAndVarFacing(u32 playerDirection) { gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; gMsgBoxIsCancelable = TRUE; - gMsgIsSignPost = TRUE; + gMsgIsSignPost = TRUE; gSpecialVar_Facing = playerDirection; } @@ -1168,8 +1168,8 @@ void CancelSignPostMessageBox(struct FieldInput *input) return; } - if (!gMsgBoxIsCancelable) - return; + if (!gMsgBoxIsCancelable) + return; if (IsDpadPushedToTurnOrMovePlayer(input)) { diff --git a/src/field_message_box.c b/src/field_message_box.c index 569f067caa..47c728f74d 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -32,7 +32,7 @@ static void Task_DrawFieldMessage(u8 taskId) switch (task->tState) { case 0: - if (gMsgIsSignPost) + if (gMsgIsSignPost) LoadSignPostWindowFrameGfx(); else LoadMessageBoxAndBorderGfx(); diff --git a/src/scrcmd.c b/src/scrcmd.c index dbe5fa5ee6..86be73404c 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1310,7 +1310,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx) ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ScriptMovement_UnfreezeObjectEvents(); UnfreezeObjectEvents(); - gMsgBoxIsCancelable = FALSE; + gMsgBoxIsCancelable = FALSE; return FALSE; } diff --git a/src/script.c b/src/script.c index 7b1af3d542..e6e2aa264d 100644 --- a/src/script.c +++ b/src/script.c @@ -504,4 +504,3 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize) InitRamScript(script, scriptSize, MAP_GROUP(UNDEFINED), MAP_NUM(UNDEFINED), NO_OBJECT); #endif //FREE_MYSTERY_EVENT_BUFFERS } - From 64d4d7e570c85c00f653132c3ac27ffae126040a Mon Sep 17 00:00:00 2001 From: Rose Silicon Date: Thu, 19 Sep 2024 12:03:13 -0400 Subject: [PATCH 105/133] Simplify HP Logic (#5403) --- src/pokemon.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index d76d1df58c..faa1a65aef 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1800,29 +1800,19 @@ void CalculateMonStats(struct Pokemon *mon) CALC_STAT(baseSpAttack, spAttackIV, spAttackEV, STAT_SPATK, MON_DATA_SPATK) CALC_STAT(baseSpDefense, spDefenseIV, spDefenseEV, STAT_SPDEF, MON_DATA_SPDEF) - if (species == SPECIES_SHEDINJA) - { - if (currentHP != 0 || oldMaxHP == 0) - currentHP = 1; - else - return; - } - else - { - if (currentHP == 0 && oldMaxHP == 0) - currentHP = newMaxHP; - else if (currentHP != 0) - { - if (newMaxHP > oldMaxHP) - currentHP += newMaxHP - oldMaxHP; - if (currentHP <= 0) - currentHP = 1; - if (currentHP > newMaxHP) - currentHP = newMaxHP; - } - else - return; - } + // Since a pokemon's maxHP data could either not have + // been initialized at this point or this pokemon is + // just fainted, the check for oldMaxHP is important. + if (currentHP == 0 && oldMaxHP != 0) + return; + + // Only add to currentHP if newMaxHP went up. + if (newMaxHP > oldMaxHP) + currentHP += newMaxHP - oldMaxHP; + + // Ensure currentHP does not surpass newMaxHP. + if (currentHP > newMaxHP) + currentHP = newMaxHP; SetMonData(mon, MON_DATA_HP, ¤tHP); } From 4cd23a377db84f20d5520dc32e4115da1a202a89 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:19:45 -0400 Subject: [PATCH 106/133] anger shell use saveattacker (#5409) * anger shell use saveattacker * tabs instead of spaces * add BattleScript_RestoreAttackerButItFailed for anger shell failure * Update data/battle_scripts_1.s Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --------- Co-authored-by: ghoulslash Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- data/battle_scripts_1.s | 8 +++++++- src/battle_util.c | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9af9d7fd27..a7295d9b53 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4724,6 +4724,9 @@ BattleScript_ButItFailed:: resultmessage waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_RestoreAttackerButItFailed: + restoreattacker + goto BattleScript_ButItFailed BattleScript_NotAffected:: pause B_WAIT_TIME_SHORT @@ -6460,12 +6463,14 @@ BattleScript_SeedSowerActivates:: return BattleScript_AngerShellActivates:: + saveattacker + copybyte gBattlerAttacker, gBattlerTarget call BattleScript_AbilityPopUp jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_AngerShellTryDef jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_SPEED, MAX_STAT_STAGE, BattleScript_AngerShellTryDef jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_AngerShellTryDef - jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_ButItFailed + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_RestoreAttackerButItFailed BattleScript_AngerShellTryDef:: setbyte sSTAT_ANIM_PLAYED, FALSE modifybattlerstatstage BS_ATTACKER, STAT_DEF, DECREASE, 1, BattleScript_AngerShellTrySpDef, ANIM_ON @@ -6479,6 +6484,7 @@ BattleScript_AngerShellTrySpAtk: BattleScript_AngerShellTrySpeed: modifybattlerstatstage BS_ATTACKER, STAT_SPEED, INCREASE, 1, BattleScript_AngerShellRet, ANIM_ON BattleScript_AngerShellRet: + restoreattacker return BattleScript_WindPowerActivates:: diff --git a/src/battle_util.c b/src/battle_util.c index 035a2c981c..83af21cdcf 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5936,7 +5936,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && HadMoreThanHalfHpNowDoesnt(gBattlerTarget) && !(TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))) { - gBattlerAttacker = gBattlerTarget; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_AngerShellActivates; effect++; From f7d2e62cccd9e5b27829a31f280aa9b096d34d66 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Sat, 21 Sep 2024 11:51:08 -0500 Subject: [PATCH 107/133] Fix Switcheroo giving score even if the opponent has no held item (#5412) --- src/battle_ai_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 869f5dded3..1483c875ba 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -4065,7 +4065,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(DECENT_EFFECT); // Force 'em out next turn break; default: - if (move != MOVE_BESTOW && aiData->items[battlerAtk] == ITEM_NONE) + if (move != MOVE_BESTOW && aiData->items[battlerAtk] == ITEM_NONE && aiData->items[battlerDef] != ITEM_NONE) { switch (aiData->holdEffects[battlerDef]) { From 39a8a77d3d74294b52ca5c81333132398126a952 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Sat, 21 Sep 2024 13:28:20 -0500 Subject: [PATCH 108/133] Play point animation when sending a follower into battle (#5406) * Add point animation when sending a follower into battle * Update trainers.h --- src/battle_controllers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 929aa2a59d..37e89d8acb 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -2903,7 +2903,7 @@ void BtlController_HandleIntroTrainerBallThrow(u32 battler, u16 tagTrainerPal, c if (side == B_SIDE_PLAYER) { StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[battler]], SpriteCB_FreePlayerSpriteLoadMonSprite); - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 1); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], ShouldDoSlideInAnim() ? 2 : 1); paletteNum = AllocSpritePalette(tagTrainerPal); LoadCompressedPalette(trainerPal, OBJ_PLTT_ID(paletteNum), PLTT_SIZE_4BPP); From d1bb7770d30e8a97b6dca8418a27d89b9715debb Mon Sep 17 00:00:00 2001 From: Frank DeBlasio <35279583+fdeblasio@users.noreply.github.com> Date: Sat, 21 Sep 2024 14:44:25 -0400 Subject: [PATCH 109/133] Converted berry and PokeBlock strings to COMPOUND_STRINGs (#5324) * Converted bag pocket names to COMPOUND_STRINGs * Converted berry-related text to COMPOUND_STRINGs * Converted PokeBlock-related text to COMPOUND_STRINGs * Added indexes to BerryFirmnessStrings * Updated call to sBerryFirmnessStrings * Changed gText to sText --- include/strings.h | 44 --------------------------------- src/berry_tag_screen.c | 34 +++++++++++++++---------- src/pokeblock.c | 51 +++++++++++++++++++++----------------- src/pokeblock_feed.c | 10 +++++--- src/strings.c | 56 ++++-------------------------------------- 5 files changed, 61 insertions(+), 134 deletions(-) diff --git a/include/strings.h b/include/strings.h index 041f43d05b..8a035eb251 100644 --- a/include/strings.h +++ b/include/strings.h @@ -62,15 +62,6 @@ extern const u8 gText_MultiLink[]; extern const u8 gText_Single[]; extern const u8 gText_Double[]; -extern const u8 gText_Spicy[]; -extern const u8 gText_Dry[]; -extern const u8 gText_Sweet[]; -extern const u8 gText_Bitter[]; -extern const u8 gText_Sour[]; - -extern const u8 gText_StowCase[]; -extern const u8 gText_LvVar1[]; - extern const u8 gText_Spicy2[]; extern const u8 gText_Dry2[]; extern const u8 gText_Sweet2[]; @@ -117,9 +108,6 @@ extern const u8 gText_NoDecorationsInUse[]; extern const u8 gText_Exit[]; extern const u8 gText_Cancel[]; -extern const u8 gText_ThrowAwayVar1[]; -extern const u8 gText_Var1ThrownAway[]; - extern const u8 gText_Color161Shadow161[]; extern const u8 gText_GoBackPrevMenu[]; extern const u8 gText_CantPlaceInRoom[]; @@ -184,25 +172,6 @@ extern const u8 gText_Coins[]; extern const u8 gText_Silver[]; extern const u8 gText_Gold[]; -extern const u8 gText_Var1AteTheVar2[]; -extern const u8 gText_Var1HappilyAteVar2[]; -extern const u8 gText_Var1DisdainfullyAteVar2[]; - -extern const u8 gText_RedPokeblock[]; -extern const u8 gText_BluePokeblock[]; -extern const u8 gText_PinkPokeblock[]; -extern const u8 gText_GreenPokeblock[]; -extern const u8 gText_YellowPokeblock[]; -extern const u8 gText_PurplePokeblock[]; -extern const u8 gText_IndigoPokeblock[]; -extern const u8 gText_BrownPokeblock[]; -extern const u8 gText_LiteBluePokeblock[]; -extern const u8 gText_OlivePokeblock[]; -extern const u8 gText_GrayPokeblock[]; -extern const u8 gText_BlackPokeblock[]; -extern const u8 gText_WhitePokeblock[]; -extern const u8 gText_GoldPokeblock[]; - extern const u8 gMenuText_Use[]; extern const u8 gMenuText_Toss[]; extern const u8 gMenuText_Give[]; @@ -334,19 +303,6 @@ extern const u8 gText_LoadingEvent[]; extern const u8 gText_DontRemoveCableTurnOff[]; extern const u8 gText_LinkStandby2[]; -// berry tag screen text -extern const u8 gBerryFirmnessString_VerySoft[]; -extern const u8 gBerryFirmnessString_Soft[]; -extern const u8 gBerryFirmnessString_Hard[]; -extern const u8 gBerryFirmnessString_VeryHard[]; -extern const u8 gBerryFirmnessString_SuperHard[]; -extern const u8 gText_BerryTag[]; -extern const u8 gText_NumberVar1Var2[]; -extern const u8 gText_SizeSlash[]; -extern const u8 gText_Var1DotVar2[]; -extern const u8 gText_ThreeMarks[]; -extern const u8 gText_FirmSlash[]; - // item menu screen text extern const u8 gText_CloseBag[]; extern const u8 gText_NumberItem_HM[]; diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index c6eb731845..fcd322ce33 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -143,11 +143,12 @@ static const struct WindowTemplate sWindowTemplates[] = static const u8 *const sBerryFirmnessStrings[] = { - gBerryFirmnessString_VerySoft, - gBerryFirmnessString_Soft, - gBerryFirmnessString_Hard, - gBerryFirmnessString_VeryHard, - gBerryFirmnessString_SuperHard + [BERRY_FIRMNESS_UNKNOWN] = COMPOUND_STRING("???"), + [BERRY_FIRMNESS_VERY_SOFT] = COMPOUND_STRING("Very soft"), + [BERRY_FIRMNESS_SOFT] = COMPOUND_STRING("Soft"), + [BERRY_FIRMNESS_HARD] = COMPOUND_STRING("Hard"), + [BERRY_FIRMNESS_VERY_HARD] = COMPOUND_STRING("Very hard"), + [BERRY_FIRMNESS_SUPER_HARD] = COMPOUND_STRING("Super hard") }; // this file's functions @@ -172,6 +173,13 @@ static void Task_DisplayAnotherBerry(u8 taskId); static void TryChangeDisplayedBerry(u8 taskId, s8 toMove); static void HandleBagCursorPositionChange(s8 toMove); +static const u8 sText_SizeSlash[] = _("SIZE /"); +static const u8 sText_FirmSlash[] = _("FIRM /"); +static const u8 sText_Var1DotVar2[] = _("{STR_VAR_1}.{STR_VAR_2}”"); +static const u8 sText_NumberVar1Var2[] = _("{NO}{STR_VAR_1} {STR_VAR_2}"); +static const u8 sText_BerryTag[] = _("BERRY TAG"); +static const u8 sText_ThreeMarks[] = _("???"); + // code void DoBerryTagScreen(void) { @@ -386,7 +394,7 @@ static void AddBerryTagTextToBg0(void) { memcpy(GetBgTilemapBuffer(0), sBerryTag->tilemapBuffers[2], sizeof(sBerryTag->tilemapBuffers[2])); FillWindowPixelBuffer(WIN_BERRY_TAG, PIXEL_FILL(15)); - PrintTextInBerryTagScreen(WIN_BERRY_TAG, gText_BerryTag, GetStringCenterAlignXOffset(FONT_NORMAL, gText_BerryTag, 0x40), 1, 0, 1); + PrintTextInBerryTagScreen(WIN_BERRY_TAG, sText_BerryTag, GetStringCenterAlignXOffset(FONT_NORMAL, sText_BerryTag, 0x40), 1, 0, 1); PutWindowTilemap(WIN_BERRY_TAG); ScheduleBgCopyTilemapToVram(0); } @@ -405,14 +413,14 @@ static void PrintBerryNumberAndName(void) const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); ConvertIntToDecimalStringN(gStringVar1, sBerryTag->berryId, STR_CONV_MODE_LEADING_ZEROS, 2); StringCopy(gStringVar2, berry->name); - StringExpandPlaceholders(gStringVar4, gText_NumberVar1Var2); + StringExpandPlaceholders(gStringVar4, sText_NumberVar1Var2); PrintTextInBerryTagScreen(WIN_BERRY_NAME, gStringVar4, 0, 1, 0, 0); } static void PrintBerrySize(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_SizeSlash, 0, 1, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_SizeSlash, 0, 1, TEXT_SKIP_DRAW, NULL); if (berry->size != 0) { u32 inches, fraction; @@ -425,23 +433,23 @@ static void PrintBerrySize(void) ConvertIntToDecimalStringN(gStringVar1, inches, STR_CONV_MODE_LEFT_ALIGN, 2); ConvertIntToDecimalStringN(gStringVar2, fraction, STR_CONV_MODE_LEFT_ALIGN, 2); - StringExpandPlaceholders(gStringVar4, gText_Var1DotVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1DotVar2); AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gStringVar4, 0x28, 1, 0, NULL); } else { - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_ThreeMarks, 0x28, 1, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_ThreeMarks, 0x28, 1, 0, NULL); } } static void PrintBerryFirmness(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_FirmSlash, 0, 0x11, TEXT_SKIP_DRAW, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_FirmSlash, 0, 0x11, TEXT_SKIP_DRAW, NULL); if (berry->firmness != 0) - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sBerryFirmnessStrings[berry->firmness - 1], 0x28, 0x11, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sBerryFirmnessStrings[berry->firmness], 0x28, 0x11, 0, NULL); else - AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, gText_ThreeMarks, 0x28, 0x11, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, FONT_NORMAL, sText_ThreeMarks, 0x28, 0x11, 0, NULL); } static void PrintBerryDescription1(void) diff --git a/src/pokeblock.c b/src/pokeblock.c index e01e821f7e..b68fe16ce3 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -130,6 +130,11 @@ static void ReturnToPokeblockCaseOnField(void); static void CreateTossPokeblockYesNoMenu(u8); static void TossPokeblock(u8); +static const u8 sText_StowCase[] = _("Stow CASE."); +static const u8 sText_LvVar1[] = _("{LV}{STR_VAR_1}"); +static const u8 sText_ThrowAwayVar1[] = _("Throw away this\n{STR_VAR_1}?"); +static const u8 sText_Var1ThrownAway[] = _("The {STR_VAR_1}\nwas thrown away."); + EWRAM_DATA static struct PokeblockSavedData sSavedPokeblockData = {0}; EWRAM_DATA static struct PokeblockMenuStruct *sPokeblockMenu = NULL; @@ -197,20 +202,20 @@ static const struct BgTemplate sBgTemplatesForPokeblockMenu[] = const u8 *const gPokeblockNames[] = { [PBLOCK_CLR_NONE] = NULL, - [PBLOCK_CLR_RED] = gText_RedPokeblock, - [PBLOCK_CLR_BLUE] = gText_BluePokeblock, - [PBLOCK_CLR_PINK] = gText_PinkPokeblock, - [PBLOCK_CLR_GREEN] = gText_GreenPokeblock, - [PBLOCK_CLR_YELLOW] = gText_YellowPokeblock, - [PBLOCK_CLR_PURPLE] = gText_PurplePokeblock, - [PBLOCK_CLR_INDIGO] = gText_IndigoPokeblock, - [PBLOCK_CLR_BROWN] = gText_BrownPokeblock, - [PBLOCK_CLR_LITE_BLUE] = gText_LiteBluePokeblock, - [PBLOCK_CLR_OLIVE] = gText_OlivePokeblock, - [PBLOCK_CLR_GRAY] = gText_GrayPokeblock, - [PBLOCK_CLR_BLACK] = gText_BlackPokeblock, - [PBLOCK_CLR_WHITE] = gText_WhitePokeblock, - [PBLOCK_CLR_GOLD] = gText_GoldPokeblock + [PBLOCK_CLR_RED] = COMPOUND_STRING("RED {POKEBLOCK}"), + [PBLOCK_CLR_BLUE] = COMPOUND_STRING("BLUE {POKEBLOCK}"), + [PBLOCK_CLR_PINK] = COMPOUND_STRING("PINK {POKEBLOCK}"), + [PBLOCK_CLR_GREEN] = COMPOUND_STRING("GREEN {POKEBLOCK}"), + [PBLOCK_CLR_YELLOW] = COMPOUND_STRING("YELLOW {POKEBLOCK}"), + [PBLOCK_CLR_PURPLE] = COMPOUND_STRING("PURPLE {POKEBLOCK}"), + [PBLOCK_CLR_INDIGO] = COMPOUND_STRING("INDIGO {POKEBLOCK}"), + [PBLOCK_CLR_BROWN] = COMPOUND_STRING("BROWN {POKEBLOCK}"), + [PBLOCK_CLR_LITE_BLUE] = COMPOUND_STRING("LITEBLUE {POKEBLOCK}"), + [PBLOCK_CLR_OLIVE] = COMPOUND_STRING("OLIVE {POKEBLOCK}"), + [PBLOCK_CLR_GRAY] = COMPOUND_STRING("GRAY {POKEBLOCK}"), + [PBLOCK_CLR_BLACK] = COMPOUND_STRING("BLACK {POKEBLOCK}"), + [PBLOCK_CLR_WHITE] = COMPOUND_STRING("WHITE {POKEBLOCK}"), + [PBLOCK_CLR_GOLD] = COMPOUND_STRING("GOLD {POKEBLOCK}") }; static const struct MenuAction sPokeblockMenuActions[] = @@ -702,11 +707,11 @@ static void DrawPokeblockMenuTitleText(void) const u8 *itemName = ItemId_GetName(ITEM_POKEBLOCK_CASE); PrintOnPokeblockWindow(WIN_TITLE, itemName, GetStringCenterAlignXOffset(FONT_NORMAL, itemName, 0x48)); - PrintOnPokeblockWindow(WIN_SPICY, gText_Spicy, 0); - PrintOnPokeblockWindow(WIN_DRY, gText_Dry, 0); - PrintOnPokeblockWindow(WIN_SWEET, gText_Sweet, 0); - PrintOnPokeblockWindow(WIN_BITTER, gText_Bitter, 0); - PrintOnPokeblockWindow(WIN_SOUR, gText_Sour, 0); + PrintOnPokeblockWindow(WIN_SPICY, COMPOUND_STRING("SPICY"), 0); + PrintOnPokeblockWindow(WIN_DRY, COMPOUND_STRING("DRY"), 0); + PrintOnPokeblockWindow(WIN_SWEET, COMPOUND_STRING("SWEET"), 0); + PrintOnPokeblockWindow(WIN_BITTER, COMPOUND_STRING("BITTER"), 0); + PrintOnPokeblockWindow(WIN_SOUR, COMPOUND_STRING("SOUR"), 0); for (i = 0; i < WIN_ACTIONS_TALL; i++) PutWindowTilemap(i); @@ -723,7 +728,7 @@ static void UpdatePokeblockList(void) sPokeblockMenu->items[i].id = i; } - StringCopy(sPokeblockMenu->menuItemsStrings[i], gText_StowCase); + StringCopy(sPokeblockMenu->menuItemsStrings[i], sText_StowCase); sPokeblockMenu->items[i].name = sPokeblockMenu->menuItemsStrings[i]; sPokeblockMenu->items[i].id = LIST_CANCEL; @@ -744,7 +749,7 @@ static void PutPokeblockListMenuString(u8 *dst, u16 pkblId) *(txtPtr++) = CHAR_BLOCK_1; ConvertIntToDecimalStringN(gStringVar1, GetHighestPokeblocksFlavorLevel(pkblock), STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(txtPtr, gText_LvVar1); + StringExpandPlaceholders(txtPtr, sText_LvVar1); } static void MovePokeblockMenuCursor(s32 pkblId, bool8 onInit, struct ListMenu *list) @@ -1203,7 +1208,7 @@ static void PokeblockAction_Toss(u8 taskId) ClearStdWindowAndFrameToTransparent(tWindowId, FALSE); StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1Ptr->pokeblocks[gSpecialVar_ItemId].color]); - StringExpandPlaceholders(gStringVar4, gText_ThrowAwayVar1); + StringExpandPlaceholders(gStringVar4, sText_ThrowAwayVar1); DisplayMessageAndContinueTask(taskId, WIN_TOSS_MSG, 10, 13, FONT_NORMAL, GetPlayerTextSpeedDelay(), gStringVar4, CreateTossPokeblockYesNoMenu); } @@ -1214,7 +1219,7 @@ static void CreateTossPokeblockYesNoMenu(u8 taskId) static void TossedPokeblockMessage(u8 taskId) { - StringExpandPlaceholders(gStringVar4, gText_Var1ThrownAway); + StringExpandPlaceholders(gStringVar4, sText_Var1ThrownAway); DisplayMessageAndContinueTask(taskId, WIN_TOSS_MSG, 10, 13, FONT_NORMAL, GetPlayerTextSpeedDelay(), gStringVar4, TossPokeblock); } diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index f31896a4cb..f79f35a781 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -96,6 +96,10 @@ static u8 CreatePokeblockCaseSpriteForFeeding(void); static u8 CreateMonSprite(struct Pokemon *); static void SpriteCB_ThrownPokeblock(struct Sprite *); +static const u8 sText_Var1AteTheVar2[] = _("{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_Var1HappilyAteVar2[] = _("{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_Var1DisdainfullyAteVar2[] = _("{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); + EWRAM_DATA static struct PokeblockFeed *sPokeblockFeed = NULL; EWRAM_DATA static struct CompressedSpritePalette sPokeblockSpritePal = {0}; @@ -792,11 +796,11 @@ static void Task_PrintAtePokeblockMessage(u8 taskId) PokeblockCopyName(pokeblock, gStringVar2); if (gPokeblockGain == 0) - StringExpandPlaceholders(gStringVar4, gText_Var1AteTheVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1AteTheVar2); else if (gPokeblockGain > 0) - StringExpandPlaceholders(gStringVar4, gText_Var1HappilyAteVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1HappilyAteVar2); else - StringExpandPlaceholders(gStringVar4, gText_Var1DisdainfullyAteVar2); + StringExpandPlaceholders(gStringVar4, sText_Var1DisdainfullyAteVar2); gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY); diff --git a/src/strings.c b/src/strings.c index 6009dbf5e6..3f21f86c47 100644 --- a/src/strings.c +++ b/src/strings.c @@ -141,7 +141,6 @@ const u8 gText_Store[] = _("STORE"); const u8 gMenuText_Check[] = _("CHECK"); const u8 gText_None[] = _("NONE"); const u8 gMenuText_Deselect[] = _("DESELECT"); -const u8 gText_ThreeMarks[] = _("???"); const u8 gText_FiveMarks[] = _("?????"); const u8 gText_Slash[] = _("/"); const u8 gText_OneDash[] = _("-"); @@ -224,64 +223,19 @@ const u8 *const gPyramidBagMenu_ReturnToStrings[] = }; const u8 gText_ReturnToVar1[] = _("Return to\n{STR_VAR_1}."); -const u8 gText_ItemsPocket[] = _("ITEMS"); -const u8 gText_PokeBallsPocket[] = _("POKé BALLS"); -const u8 gText_TMHMPocket[] = _("TMs & HMs"); -const u8 gText_BerriesPocket[] = _("BERRIES"); -const u8 gText_KeyItemsPocket[] = _("KEY ITEMS"); const u8 *const gPocketNamesStringsTable[] = { - [ITEMS_POCKET] = gText_ItemsPocket, - [BALLS_POCKET] = gText_PokeBallsPocket, - [TMHM_POCKET] = gText_TMHMPocket, - [BERRIES_POCKET] = gText_BerriesPocket, - [KEYITEMS_POCKET] = gText_KeyItemsPocket + [ITEMS_POCKET] = COMPOUND_STRING("ITEMS"), + [BALLS_POCKET] = COMPOUND_STRING("POKé BALLS"), + [TMHM_POCKET] = COMPOUND_STRING("TMs & HMs"), + [BERRIES_POCKET] = COMPOUND_STRING("BERRIES"), + [KEYITEMS_POCKET] = COMPOUND_STRING("KEY ITEMS") }; const u8 gText_NumberItem_TMBerry[] = _("{NO}{STR_VAR_1}{CLEAR 0x07}{STR_VAR_2}"); const u8 gText_NumberItem_HM[] = _("{CLEAR_TO 0x11}{STR_VAR_1}{CLEAR 0x05}{STR_VAR_2}"); -const u8 gText_SizeSlash[] = _("SIZE /"); -const u8 gText_FirmSlash[] = _("FIRM /"); -const u8 gText_Var1DotVar2[] = _("{STR_VAR_1}.{STR_VAR_2}”"); -// Berry firmness strings -const u8 gBerryFirmnessString_VerySoft[] = _("Very soft"); -const u8 gBerryFirmnessString_Soft[] = _("Soft"); -const u8 gBerryFirmnessString_Hard[] = _("Hard"); -const u8 gBerryFirmnessString_VeryHard[] = _("Very hard"); -const u8 gBerryFirmnessString_SuperHard[] = _("Super hard"); - -const u8 gText_NumberVar1Var2[] = _("{NO}{STR_VAR_1} {STR_VAR_2}"); -const u8 gText_BerryTag[] = _("BERRY TAG"); -const u8 gText_RedPokeblock[] = _("RED {POKEBLOCK}"); -const u8 gText_BluePokeblock[] = _("BLUE {POKEBLOCK}"); -const u8 gText_PinkPokeblock[] = _("PINK {POKEBLOCK}"); -const u8 gText_GreenPokeblock[] = _("GREEN {POKEBLOCK}"); -const u8 gText_YellowPokeblock[] = _("YELLOW {POKEBLOCK}"); -const u8 gText_PurplePokeblock[] = _("PURPLE {POKEBLOCK}"); -const u8 gText_IndigoPokeblock[] = _("INDIGO {POKEBLOCK}"); -const u8 gText_BrownPokeblock[] = _("BROWN {POKEBLOCK}"); -const u8 gText_LiteBluePokeblock[] = _("LITEBLUE {POKEBLOCK}"); -const u8 gText_OlivePokeblock[] = _("OLIVE {POKEBLOCK}"); -const u8 gText_GrayPokeblock[] = _("GRAY {POKEBLOCK}"); -const u8 gText_BlackPokeblock[] = _("BLACK {POKEBLOCK}"); -const u8 gText_WhitePokeblock[] = _("WHITE {POKEBLOCK}"); -const u8 gText_GoldPokeblock[] = _("GOLD {POKEBLOCK}"); -const u8 gText_Spicy[] = _("SPICY"); -const u8 gText_Dry[] = _("DRY"); -const u8 gText_Sweet[] = _("SWEET"); -const u8 gText_Bitter[] = _("BITTER"); -const u8 gText_Sour[] = _("SOUR"); -const u8 gText_Tasty[] = _("TASTY"); // Unused -const u8 gText_Feel[] = _("FEEL"); // Unused -const u8 gText_StowCase[] = _("Stow CASE."); -const u8 gText_LvVar1[] = _("{LV}{STR_VAR_1}"); -const u8 gText_ThrowAwayVar1[] = _("Throw away this\n{STR_VAR_1}?"); -const u8 gText_Var1ThrownAway[] = _("The {STR_VAR_1}\nwas thrown away."); -const u8 gText_Var1AteTheVar2[] = _("{STR_VAR_1} ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); -const u8 gText_Var1HappilyAteVar2[] = _("{STR_VAR_1} happily ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); -const u8 gText_Var1DisdainfullyAteVar2[] = _("{STR_VAR_1} disdainfully ate the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); const u8 gText_ShopBuy[] = _("BUY"); const u8 gText_ShopSell[] = _("SELL"); const u8 gText_ShopQuit[] = _("QUIT"); From 832a7b286d3cedf202ae1af238b58abd66879511 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sat, 21 Sep 2024 21:22:30 +0200 Subject: [PATCH 110/133] Update item_use.c (#5415) --- src/item_use.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item_use.c b/src/item_use.c index fd74b7082b..d38c4b1f98 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1491,7 +1491,7 @@ void FieldUseFunc_VsSeeker(u8 taskId) SetUpItemUseOnFieldCallback(taskId); } else - DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].data[3]); + DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem); } void Task_ItemUse_CloseMessageBoxAndReturnToField_VsSeeker(u8 taskId) From 16e8be12335695e5fdb7100f1706a292f1f60ed0 Mon Sep 17 00:00:00 2001 From: kleenxfeu <149011275+kleenxfeu@users.noreply.github.com> Date: Sat, 21 Sep 2024 23:47:19 +0200 Subject: [PATCH 111/133] Mega evolution animation is a little smoother (#4816) * Smoother primal/mega animation * Just to make the CI run. It needs to run * Update src/battle_anim_effects_3.c --------- Co-authored-by: kleeenexfeu <94004034+kleeenexfeu@users.noreply.github.com> Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- data/battle_anim_scripts.s | 8 ++-- src/battle_anim_effects_3.c | 82 +++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 4 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 2f1a3cb73c..0435eb8e77 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -28060,7 +28060,7 @@ General_MegaEvolution: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish @@ -28251,7 +28251,7 @@ General_PrimalReversion_Alpha: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish @@ -28278,7 +28278,7 @@ General_PrimalReversion_Omega: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish @@ -28314,7 +28314,7 @@ General_UltraBurst:: call LightThatBurnsTheSkyGreenSparks delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA - createvisualtask AnimTask_TransformMon, 2, 1, 0 + createvisualtask AnimTask_HideSwapSprite, 2, 1, 0 createsprite gUltraBurstSymbolSpriteTemplate, ANIM_ATTACKER, 0x0, 0x0, 0x0, 0x0, 0x0 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index ed2e7457f6..0b5f3fcf94 100644 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2378,6 +2378,88 @@ void AnimTask_SwallowDeformMon(u8 taskId) } } +void AnimTask_HideSwapSprite(u8 taskId) +{ + int i, j; + u8 position; + struct BattleAnimBgData animBg; + u8 *dest; + u8 *src; + u16 *bgTilemap; + + u8 spriteId = gBattlerSpriteIds[gBattleAnimAttacker]; + + switch (gTasks[taskId].data[0]) + { + case 0: + gTasks[taskId].data[11] = gSprites[spriteId].x; // Save battler position + gSprites[spriteId].x = -64; // hide it from screen to avoid the blip/glitch effect when swapping the sprite. + gTasks[taskId].data[10] = gBattleAnimArgs[0]; + gTasks[taskId].data[0]++; + break; + case 1: + HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gBattleAnimArgs[1]); + GetBgDataForTransform(&animBg, gBattleAnimAttacker); + + if (IsContest()) + position = 0; + else + position = GetBattlerPosition(gBattleAnimAttacker); + + src = gMonSpritesGfxPtr->spritesGfx[position]; + dest = animBg.bgTiles; + CpuCopy32(src, dest, MON_PIC_SIZE); + LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset); + if (IsContest()) + { + if (IsSpeciesNotUnown(gContestResources->moveAnim->species) != IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies)) + { + bgTilemap = (u16 *)animBg.bgTilemap; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 4; j++) + { + u16 temp = bgTilemap[j + i * 0x20]; + bgTilemap[j + i * 0x20] = bgTilemap[(7 - j) + i * 0x20]; + bgTilemap[(7 - j) + i * 0x20] = temp; + } + } + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + { + bgTilemap[j + i * 0x20] ^= 0x400; + } + } + } + + if (IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies)) + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest; + else + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteOpponentSide; + + StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], BATTLER_AFFINE_NORMAL); + } + + gTasks[taskId].data[0]++; + break; + case 2: + gSprites[spriteId].x = gTasks[taskId].data[11]; // restores battler position + if (!IsContest()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + { + if (gTasks[taskId].data[10] == 0) + SetBattlerShadowSpriteCallback(gBattleAnimAttacker, gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].transformSpecies); + } + } + + DestroyAnimVisualTask(taskId); + break; + } +} + void AnimTask_TransformMon(u8 taskId) { int i, j; From 1ba0875654d8c9cc94da276d5dab2bf08b5734af Mon Sep 17 00:00:00 2001 From: Frank DeBlasio <35279583+fdeblasio@users.noreply.github.com> Date: Sun, 22 Sep 2024 03:54:01 -0400 Subject: [PATCH 112/133] Removed FRONTIER_BRAIN_SPRITES and updated TRAINER_SPRITE, TRAINER_BACK_SPRITE, and TRAINER_CLASS (#5166) * Removed FRONTIER_BRAIN_SPRITES * Updated TRAINER_SPRITE and TRAINER_BACK_SPRITE * Updated TRAINER_CLASS macro * Removed FRONTIER_BRAIN_TEXTS * Turned Frontier Brain text to COMPOUND_STRINGs * Removed frontier_brain.inc from event_scripts.s * Addressed front sprite comment * Addressed backsprite comments --- data/event_scripts.s | 1 - data/text/frontier_brain.inc | 108 ---------------- include/strings.h | 30 ----- src/battle_main.c | 134 ++++++++++---------- src/data/graphics/trainers.h | 230 +++++++++++++++++------------------ src/frontier_util.c | 128 +++++++++++++++---- 6 files changed, 288 insertions(+), 343 deletions(-) delete mode 100644 data/text/frontier_brain.inc diff --git a/data/event_scripts.s b/data/event_scripts.s index d7e82eb95c..2ef99d34fb 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1148,6 +1148,5 @@ EventScript_VsSeekerChargingDone:: .include "data/scripts/trainer_hill.inc" .include "data/scripts/test_signpost.inc" .include "data/scripts/follower.inc" - .include "data/text/frontier_brain.inc" .include "data/text/save.inc" .include "data/text/birch_speech.inc" diff --git a/data/text/frontier_brain.inc b/data/text/frontier_brain.inc deleted file mode 100644 index 1292f2a564..0000000000 --- a/data/text/frontier_brain.inc +++ /dev/null @@ -1,108 +0,0 @@ -@ Battle Tower -gText_AnabelWonSilver:: - .string "It's very disappointing…$" - -gText_AnabelDefeatSilver:: - .string "Okay, I understand…$" - -gText_AnabelWonGold:: - .string "I'm terribly sorry…$" - -gText_AnabelDefeatGold:: - .string "Thank you…$" - -@ Battle Dome -gText_TuckerWonSilver:: - .string "Ahahaha! Aren't you embarrassed?\n" - .string "Everyone's watching!$" - -gText_TuckerDefeatSilver:: - .string "Grr…\n" - .string "What the…$" - -gText_TuckerWonGold:: - .string "My DOME ACE title isn't just for show!$" - -gText_TuckerDefeatGold:: - .string "Ahahaha!\n" - .string "You're inspiring!$" - -@ Battle Factory -gText_NolandWonSilver:: - .string "Way to work!\n" - .string "That was a good lesson, eh?$" - -gText_NolandDefeatSilver:: - .string "Good job!\n" - .string "You know what you're doing!$" - -gText_NolandWonGold:: - .string "Hey, hey, hey!\n" - .string "You're finished already?$" - -gText_NolandDefeatGold:: - .string "What happened here?$" - -@ Battle Pike -gText_LucyWonSilver:: - .string "Humph…$" - -gText_LucyDefeatSilver:: - .string "Urk…$" - -gText_LucyWonGold:: - .string "Hah!$" - -gText_LucyDefeatGold:: - .string "Darn!$" - -@ Battle Arena -gText_GretaWonSilver:: - .string "Oh, come on!\n" - .string "You have to try harder than that!$" - -gText_GretaDefeatSilver:: - .string "No way!\n" - .string "Good job!$" - -gText_GretaWonGold:: - .string "Heheh!\n" - .string "What did you expect?$" - -gText_GretaDefeatGold:: - .string "Huh?\n" - .string "Are you serious?!$" - -@ Battle Palace -gText_SpenserWonSilver:: - .string "Your POKéMON are wimpy because\n" - .string "you're wimpy as a TRAINER!$" - -gText_SpenserDefeatSilver:: - .string "Ah…\n" - .string "Now this is something else…$" - -gText_SpenserWonGold:: - .string "Gwahahaha!\n" - .string "My brethren, we have nothing to fear!$" - -gText_SpenserDefeatGold:: - .string "Gwah!\n" - .string "Hahahaha!$" - -@ Battle Pyramid -gText_BrandonWonSilver:: - .string "Hey! What's wrong with you!\n" - .string "Let's see some effort! Get up!$" - -gText_BrandonDefeatSilver:: - .string "That's it! You've done great!\n" - .string "You've worked hard for this!$" - -gText_BrandonWonGold:: - .string "Hey! Don't you give up now!\n" - .string "Get up! Don't lose faith in yourself!$" - -gText_BrandonDefeatGold:: - .string "That's it! You've done it!\n" - .string "You kept working for this!$" diff --git a/include/strings.h b/include/strings.h index 8a035eb251..84f87ff491 100644 --- a/include/strings.h +++ b/include/strings.h @@ -1219,36 +1219,6 @@ extern const u8 gText_FrontierFacilityRoomsCleared[]; extern const u8 gText_FrontierFacilityKOsStreak[]; extern const u8 gText_FrontierFacilityFloorsCleared[]; -// Frontier Brain -extern const u8 gText_AnabelWonSilver[]; -extern const u8 gText_TuckerWonSilver[]; -extern const u8 gText_SpenserWonSilver[]; -extern const u8 gText_GretaWonSilver[]; -extern const u8 gText_NolandWonSilver[]; -extern const u8 gText_LucyWonSilver[]; -extern const u8 gText_BrandonWonSilver[]; -extern const u8 gText_AnabelDefeatSilver[]; -extern const u8 gText_TuckerDefeatSilver[]; -extern const u8 gText_SpenserDefeatSilver[]; -extern const u8 gText_GretaDefeatSilver[]; -extern const u8 gText_NolandDefeatSilver[]; -extern const u8 gText_LucyDefeatSilver[]; -extern const u8 gText_BrandonDefeatSilver[]; -extern const u8 gText_AnabelWonGold[]; -extern const u8 gText_TuckerWonGold[]; -extern const u8 gText_SpenserWonGold[]; -extern const u8 gText_GretaWonGold[]; -extern const u8 gText_NolandWonGold[]; -extern const u8 gText_LucyWonGold[]; -extern const u8 gText_BrandonWonGold[]; -extern const u8 gText_AnabelDefeatGold[]; -extern const u8 gText_TuckerDefeatGold[]; -extern const u8 gText_SpenserDefeatGold[]; -extern const u8 gText_GretaDefeatGold[]; -extern const u8 gText_NolandDefeatGold[]; -extern const u8 gText_LucyDefeatGold[]; -extern const u8 gText_BrandonDefeatGold[]; - // Battle Tower. extern const u8 BattleFrontier_BattleTowerMultiPartnerRoom_Text_Apprentice1Intro[]; extern const u8 BattleFrontier_BattleTowerMultiPartnerRoom_Text_Apprentice1Mon1[]; diff --git a/src/battle_main.c b/src/battle_main.c index 78e44956a4..c7f6eeafda 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -304,7 +304,7 @@ static const s8 sCenterToCornerVecXs[8] ={-32, -16, -16, -32, -32}; // extra args are money and ball #define TRAINER_CLASS(trainerClass, trainerName, ...) \ - [TRAINER_CLASS_##trainerClass] = \ + [trainerClass] = \ { \ .name = _(trainerName), \ .money = DEFAULT(5, __VA_ARGS__), \ @@ -313,72 +313,72 @@ static const s8 sCenterToCornerVecXs[8] ={-32, -16, -16, -32, -32}; const struct TrainerClass gTrainerClasses[TRAINER_CLASS_COUNT] = { - TRAINER_CLASS(PKMN_TRAINER_1, "{PKMN} TRAINER"), - TRAINER_CLASS(PKMN_TRAINER_2, "{PKMN} TRAINER"), - TRAINER_CLASS(HIKER, "HIKER", 10), - TRAINER_CLASS(TEAM_AQUA, "TEAM AQUA"), - TRAINER_CLASS(PKMN_BREEDER, "{PKMN} BREEDER", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_HEAL_BALL : ITEM_FRIEND_BALL), - TRAINER_CLASS(COOLTRAINER, "COOLTRAINER", 12, ITEM_ULTRA_BALL), - TRAINER_CLASS(BIRD_KEEPER, "BIRD KEEPER", 8), - TRAINER_CLASS(COLLECTOR, "COLLECTOR", 15, ITEM_PREMIER_BALL), - TRAINER_CLASS(SWIMMER_M, "SWIMMER♂", 2, ITEM_DIVE_BALL), - TRAINER_CLASS(TEAM_MAGMA, "TEAM MAGMA"), - TRAINER_CLASS(EXPERT, "EXPERT", 10), - TRAINER_CLASS(AQUA_ADMIN, "AQUA ADMIN", 10), - TRAINER_CLASS(BLACK_BELT, "BLACK BELT", 8, ITEM_ULTRA_BALL), - TRAINER_CLASS(AQUA_LEADER, "AQUA LEADER", 20, ITEM_MASTER_BALL), - TRAINER_CLASS(HEX_MANIAC, "HEX MANIAC", 6), - TRAINER_CLASS(AROMA_LADY, "AROMA LADY", 10), - TRAINER_CLASS(RUIN_MANIAC, "RUIN MANIAC", 15), - TRAINER_CLASS(INTERVIEWER, "INTERVIEWER", 12), - TRAINER_CLASS(TUBER_F, "TUBER", 1), - TRAINER_CLASS(TUBER_M, "TUBER", 1), - TRAINER_CLASS(LADY, "LADY", 50), - TRAINER_CLASS(BEAUTY, "BEAUTY", 20), - TRAINER_CLASS(RICH_BOY, "RICH BOY", 50), - TRAINER_CLASS(POKEMANIAC, "POKéMANIAC", 15), - TRAINER_CLASS(GUITARIST, "GUITARIST", 8), - TRAINER_CLASS(KINDLER, "KINDLER", 8), - TRAINER_CLASS(CAMPER, "CAMPER", 4), - TRAINER_CLASS(PICNICKER, "PICNICKER", 4), - TRAINER_CLASS(BUG_MANIAC, "BUG MANIAC", 15), - TRAINER_CLASS(PSYCHIC, "PSYCHIC", 6), - TRAINER_CLASS(GENTLEMAN, "GENTLEMAN", 20, ITEM_LUXURY_BALL), - TRAINER_CLASS(ELITE_FOUR, "ELITE FOUR", 25, ITEM_ULTRA_BALL), - TRAINER_CLASS(LEADER, "LEADER", 25), - TRAINER_CLASS(SCHOOL_KID, "SCHOOL KID"), - TRAINER_CLASS(SR_AND_JR, "SR. AND JR.", 4), - TRAINER_CLASS(WINSTRATE, "WINSTRATE", 10), - TRAINER_CLASS(POKEFAN, "POKéFAN", 20), - TRAINER_CLASS(YOUNGSTER, "YOUNGSTER", 4), - TRAINER_CLASS(CHAMPION, "CHAMPION", 50), - TRAINER_CLASS(FISHERMAN, "FISHERMAN", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_DIVE_BALL : ITEM_LURE_BALL), - TRAINER_CLASS(TRIATHLETE, "TRIATHLETE", 10), - TRAINER_CLASS(DRAGON_TAMER, "DRAGON TAMER", 12), - TRAINER_CLASS(NINJA_BOY, "NINJA BOY", 3), - TRAINER_CLASS(BATTLE_GIRL, "BATTLE GIRL", 6), - TRAINER_CLASS(PARASOL_LADY, "PARASOL LADY", 10), - TRAINER_CLASS(SWIMMER_F, "SWIMMER♀", 2, ITEM_DIVE_BALL), - TRAINER_CLASS(TWINS, "TWINS", 3), - TRAINER_CLASS(SAILOR, "SAILOR", 8), - TRAINER_CLASS(COOLTRAINER_2, "COOLTRAINER", 5, ITEM_ULTRA_BALL), - TRAINER_CLASS(MAGMA_ADMIN, "MAGMA ADMIN", 10), - TRAINER_CLASS(RIVAL, "{PKMN} TRAINER", 15), - TRAINER_CLASS(BUG_CATCHER, "BUG CATCHER", 4), - TRAINER_CLASS(PKMN_RANGER, "{PKMN} RANGER", 12), - TRAINER_CLASS(MAGMA_LEADER, "MAGMA LEADER", 20, ITEM_MASTER_BALL), - TRAINER_CLASS(LASS, "LASS", 4), - TRAINER_CLASS(YOUNG_COUPLE, "YOUNG COUPLE", 8), - TRAINER_CLASS(OLD_COUPLE, "OLD COUPLE", 10), - TRAINER_CLASS(SIS_AND_BRO, "SIS AND BRO", 3), - TRAINER_CLASS(SALON_MAIDEN, "SALON MAIDEN"), - TRAINER_CLASS(DOME_ACE, "DOME ACE"), - TRAINER_CLASS(PALACE_MAVEN, "PALACE MAVEN"), - TRAINER_CLASS(ARENA_TYCOON, "ARENA TYCOON"), - TRAINER_CLASS(FACTORY_HEAD, "FACTORY HEAD"), - TRAINER_CLASS(PIKE_QUEEN, "PIKE QUEEN"), - TRAINER_CLASS(PYRAMID_KING, "PYRAMID KING"), - TRAINER_CLASS(RS_PROTAG, "{PKMN} TRAINER"), + TRAINER_CLASS(TRAINER_CLASS_PKMN_TRAINER_1, "{PKMN} TRAINER"), + TRAINER_CLASS(TRAINER_CLASS_PKMN_TRAINER_2, "{PKMN} TRAINER"), + TRAINER_CLASS(TRAINER_CLASS_HIKER, "HIKER", 10), + TRAINER_CLASS(TRAINER_CLASS_TEAM_AQUA, "TEAM AQUA"), + TRAINER_CLASS(TRAINER_CLASS_PKMN_BREEDER, "{PKMN} BREEDER", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_HEAL_BALL : ITEM_FRIEND_BALL), + TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER, "COOLTRAINER", 12, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_BIRD_KEEPER, "BIRD KEEPER", 8), + TRAINER_CLASS(TRAINER_CLASS_COLLECTOR, "COLLECTOR", 15, ITEM_PREMIER_BALL), + TRAINER_CLASS(TRAINER_CLASS_SWIMMER_M, "SWIMMER♂", 2, ITEM_DIVE_BALL), + TRAINER_CLASS(TRAINER_CLASS_TEAM_MAGMA, "TEAM MAGMA"), + TRAINER_CLASS(TRAINER_CLASS_EXPERT, "EXPERT", 10), + TRAINER_CLASS(TRAINER_CLASS_AQUA_ADMIN, "AQUA ADMIN", 10), + TRAINER_CLASS(TRAINER_CLASS_BLACK_BELT, "BLACK BELT", 8, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_AQUA_LEADER, "AQUA LEADER", 20, ITEM_MASTER_BALL), + TRAINER_CLASS(TRAINER_CLASS_HEX_MANIAC, "HEX MANIAC", 6), + TRAINER_CLASS(TRAINER_CLASS_AROMA_LADY, "AROMA LADY", 10), + TRAINER_CLASS(TRAINER_CLASS_RUIN_MANIAC, "RUIN MANIAC", 15), + TRAINER_CLASS(TRAINER_CLASS_INTERVIEWER, "INTERVIEWER", 12), + TRAINER_CLASS(TRAINER_CLASS_TUBER_F, "TUBER", 1), + TRAINER_CLASS(TRAINER_CLASS_TUBER_M, "TUBER", 1), + TRAINER_CLASS(TRAINER_CLASS_LADY, "LADY", 50), + TRAINER_CLASS(TRAINER_CLASS_BEAUTY, "BEAUTY", 20), + TRAINER_CLASS(TRAINER_CLASS_RICH_BOY, "RICH BOY", 50), + TRAINER_CLASS(TRAINER_CLASS_POKEMANIAC, "POKéMANIAC", 15), + TRAINER_CLASS(TRAINER_CLASS_GUITARIST, "GUITARIST", 8), + TRAINER_CLASS(TRAINER_CLASS_KINDLER, "KINDLER", 8), + TRAINER_CLASS(TRAINER_CLASS_CAMPER, "CAMPER", 4), + TRAINER_CLASS(TRAINER_CLASS_PICNICKER, "PICNICKER", 4), + TRAINER_CLASS(TRAINER_CLASS_BUG_MANIAC, "BUG MANIAC", 15), + TRAINER_CLASS(TRAINER_CLASS_PSYCHIC, "PSYCHIC", 6), + TRAINER_CLASS(TRAINER_CLASS_GENTLEMAN, "GENTLEMAN", 20, ITEM_LUXURY_BALL), + TRAINER_CLASS(TRAINER_CLASS_ELITE_FOUR, "ELITE FOUR", 25, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_LEADER, "LEADER", 25), + TRAINER_CLASS(TRAINER_CLASS_SCHOOL_KID, "SCHOOL KID"), + TRAINER_CLASS(TRAINER_CLASS_SR_AND_JR, "SR. AND JR.", 4), + TRAINER_CLASS(TRAINER_CLASS_WINSTRATE, "WINSTRATE", 10), + TRAINER_CLASS(TRAINER_CLASS_POKEFAN, "POKéFAN", 20), + TRAINER_CLASS(TRAINER_CLASS_YOUNGSTER, "YOUNGSTER", 4), + TRAINER_CLASS(TRAINER_CLASS_CHAMPION, "CHAMPION", 50), + TRAINER_CLASS(TRAINER_CLASS_FISHERMAN, "FISHERMAN", 10, B_TRAINER_CLASS_POKE_BALLS >= GEN_8 ? ITEM_DIVE_BALL : ITEM_LURE_BALL), + TRAINER_CLASS(TRAINER_CLASS_TRIATHLETE, "TRIATHLETE", 10), + TRAINER_CLASS(TRAINER_CLASS_DRAGON_TAMER, "DRAGON TAMER", 12), + TRAINER_CLASS(TRAINER_CLASS_NINJA_BOY, "NINJA BOY", 3), + TRAINER_CLASS(TRAINER_CLASS_BATTLE_GIRL, "BATTLE GIRL", 6), + TRAINER_CLASS(TRAINER_CLASS_PARASOL_LADY, "PARASOL LADY", 10), + TRAINER_CLASS(TRAINER_CLASS_SWIMMER_F, "SWIMMER♀", 2, ITEM_DIVE_BALL), + TRAINER_CLASS(TRAINER_CLASS_TWINS, "TWINS", 3), + TRAINER_CLASS(TRAINER_CLASS_SAILOR, "SAILOR", 8), + TRAINER_CLASS(TRAINER_CLASS_COOLTRAINER_2, "COOLTRAINER", 5, ITEM_ULTRA_BALL), + TRAINER_CLASS(TRAINER_CLASS_MAGMA_ADMIN, "MAGMA ADMIN", 10), + TRAINER_CLASS(TRAINER_CLASS_RIVAL, "{PKMN} TRAINER", 15), + TRAINER_CLASS(TRAINER_CLASS_BUG_CATCHER, "BUG CATCHER", 4), + TRAINER_CLASS(TRAINER_CLASS_PKMN_RANGER, "{PKMN} RANGER", 12), + TRAINER_CLASS(TRAINER_CLASS_MAGMA_LEADER, "MAGMA LEADER", 20, ITEM_MASTER_BALL), + TRAINER_CLASS(TRAINER_CLASS_LASS, "LASS", 4), + TRAINER_CLASS(TRAINER_CLASS_YOUNG_COUPLE, "YOUNG COUPLE", 8), + TRAINER_CLASS(TRAINER_CLASS_OLD_COUPLE, "OLD COUPLE", 10), + TRAINER_CLASS(TRAINER_CLASS_SIS_AND_BRO, "SIS AND BRO", 3), + TRAINER_CLASS(TRAINER_CLASS_SALON_MAIDEN, "SALON MAIDEN"), + TRAINER_CLASS(TRAINER_CLASS_DOME_ACE, "DOME ACE"), + TRAINER_CLASS(TRAINER_CLASS_PALACE_MAVEN, "PALACE MAVEN"), + TRAINER_CLASS(TRAINER_CLASS_ARENA_TYCOON, "ARENA TYCOON"), + TRAINER_CLASS(TRAINER_CLASS_FACTORY_HEAD, "FACTORY HEAD"), + TRAINER_CLASS(TRAINER_CLASS_PIKE_QUEEN, "PIKE QUEEN"), + TRAINER_CLASS(TRAINER_CLASS_PYRAMID_KING, "PYRAMID KING"), + TRAINER_CLASS(TRAINER_CLASS_RS_PROTAG, "{PKMN} TRAINER"), }; static void (* const sTurnActionsFuncsTable[])(void) = diff --git a/src/data/graphics/trainers.h b/src/data/graphics/trainers.h index 2a7baf1bc8..613e5fcb14 100644 --- a/src/data/graphics/trainers.h +++ b/src/data/graphics/trainers.h @@ -297,110 +297,110 @@ const u32 gTrainerBackPicPalette_Leaf[] = INCBIN_U32("graphics/trainers/back_pic // gTrainerFrontPic/gTrainerPalette pointers, (e.g "gTrainerFrontPic_Hiker" and "gTrainerPalette_Hiker"). // The last three parameters control the X and Y coordinates and rotation of the mugshot on the screen. // They default to 0, 0, and 0x200 which are default values used by the majority of the game's trainer sprites. -#define TRAINER_SPRITE(trainerPic, file, ...) \ - [TRAINER_PIC_##trainerPic] = \ - { \ - .frontPic = {gTrainerFrontPic_##file, TRAINER_PIC_SIZE, TRAINER_PIC_##trainerPic},\ - .palette = {gTrainerPalette_##file, TRAINER_PIC_##trainerPic}, \ - .mugshotCoords = {DEFAULT(0, __VA_ARGS__), DEFAULT_2(0, __VA_ARGS__)}, \ - .mugshotRotation = DEFAULT_3(0x200, __VA_ARGS__), \ +#define TRAINER_SPRITE(trainerPic, picFile, paletteFile, ...) \ + [trainerPic] = \ + { \ + .frontPic = {picFile, TRAINER_PIC_SIZE, trainerPic}, \ + .palette = {paletteFile, trainerPic}, \ + .mugshotCoords = {DEFAULT(0, __VA_ARGS__), DEFAULT_2(0, __VA_ARGS__)}, \ + .mugshotRotation = DEFAULT_3(0x200, __VA_ARGS__), \ } const struct TrainerSprite gTrainerSprites[] = { - TRAINER_SPRITE(HIKER, Hiker), - TRAINER_SPRITE(AQUA_GRUNT_M, AquaGruntM), - TRAINER_SPRITE(POKEMON_BREEDER_F, PokemonBreederF), - TRAINER_SPRITE(COOLTRAINER_M, CoolTrainerM), - TRAINER_SPRITE(BIRD_KEEPER, BirdKeeper), - TRAINER_SPRITE(COLLECTOR, Collector), - TRAINER_SPRITE(AQUA_GRUNT_F, AquaGruntF), - TRAINER_SPRITE(SWIMMER_M, SwimmerM), - TRAINER_SPRITE(MAGMA_GRUNT_M, MagmaGruntM), - TRAINER_SPRITE(EXPERT_M, ExpertM), - TRAINER_SPRITE(AQUA_ADMIN_M, AquaAdminM), - TRAINER_SPRITE(BLACK_BELT, BlackBelt), - TRAINER_SPRITE(AQUA_ADMIN_F, AquaAdminF), - TRAINER_SPRITE(AQUA_LEADER_ARCHIE, AquaLeaderArchie), - TRAINER_SPRITE(HEX_MANIAC, HexManiac), - TRAINER_SPRITE(AROMA_LADY, AromaLady), - TRAINER_SPRITE(RUIN_MANIAC, RuinManiac), - TRAINER_SPRITE(INTERVIEWER, Interviewer), - TRAINER_SPRITE(TUBER_F, TuberF), - TRAINER_SPRITE(TUBER_M, TuberM), - TRAINER_SPRITE(COOLTRAINER_F, CoolTrainerF), - TRAINER_SPRITE(LADY, Lady), - TRAINER_SPRITE(BEAUTY, Beauty), - TRAINER_SPRITE(RICH_BOY, RichBoy), - TRAINER_SPRITE(EXPERT_F, ExpertF), - TRAINER_SPRITE(POKEMANIAC, Pokemaniac), - TRAINER_SPRITE(MAGMA_GRUNT_F, MagmaGruntF), - TRAINER_SPRITE(GUITARIST, Guitarist), - TRAINER_SPRITE(KINDLER, Kindler), - TRAINER_SPRITE(CAMPER, Camper), - TRAINER_SPRITE(PICNICKER, Picnicker), - TRAINER_SPRITE(BUG_MANIAC, BugManiac), - TRAINER_SPRITE(POKEMON_BREEDER_M, PokemonBreederM), - TRAINER_SPRITE(PSYCHIC_M, PsychicM), - TRAINER_SPRITE(PSYCHIC_F, PsychicF), - TRAINER_SPRITE(GENTLEMAN, Gentleman), - TRAINER_SPRITE(ELITE_FOUR_SIDNEY, EliteFourSidney), - TRAINER_SPRITE(ELITE_FOUR_PHOEBE, EliteFourPhoebe), - TRAINER_SPRITE(ELITE_FOUR_GLACIA, EliteFourGlacia, -4, 4, 0x1B0), - TRAINER_SPRITE(ELITE_FOUR_DRAKE, EliteFourDrake, 0, 5, 0x1A0), - TRAINER_SPRITE(LEADER_ROXANNE, LeaderRoxanne), - TRAINER_SPRITE(LEADER_BRAWLY, LeaderBrawly), - TRAINER_SPRITE(LEADER_WATTSON, LeaderWattson), - TRAINER_SPRITE(LEADER_FLANNERY, LeaderFlannery), - TRAINER_SPRITE(LEADER_NORMAN, LeaderNorman), - TRAINER_SPRITE(LEADER_WINONA, LeaderWinona), - TRAINER_SPRITE(LEADER_TATE_AND_LIZA, LeaderTateAndLiza), - TRAINER_SPRITE(LEADER_JUAN, LeaderJuan), - TRAINER_SPRITE(SCHOOL_KID_M, SchoolKidM), - TRAINER_SPRITE(SCHOOL_KID_F, SchoolKidF), - TRAINER_SPRITE(SR_AND_JR, SrAndJr), - TRAINER_SPRITE(POKEFAN_M, PokefanM), - TRAINER_SPRITE(POKEFAN_F, PokefanF), - TRAINER_SPRITE(YOUNGSTER, Youngster), - TRAINER_SPRITE(CHAMPION_WALLACE, ChampionWallace, -8, 7, 0x188), - TRAINER_SPRITE(FISHERMAN, Fisherman), - TRAINER_SPRITE(CYCLING_TRIATHLETE_M, CyclingTriathleteM), - TRAINER_SPRITE(CYCLING_TRIATHLETE_F, CyclingTriathleteF), - TRAINER_SPRITE(RUNNING_TRIATHLETE_M, RunningTriathleteM), - TRAINER_SPRITE(RUNNING_TRIATHLETE_F, RunningTriathleteF), - TRAINER_SPRITE(SWIMMING_TRIATHLETE_M, SwimmingTriathleteM), - TRAINER_SPRITE(SWIMMING_TRIATHLETE_F, SwimmingTriathleteF), - TRAINER_SPRITE(DRAGON_TAMER, DragonTamer), - TRAINER_SPRITE(NINJA_BOY, NinjaBoy), - TRAINER_SPRITE(BATTLE_GIRL, BattleGirl), - TRAINER_SPRITE(PARASOL_LADY, ParasolLady), - TRAINER_SPRITE(SWIMMER_F, SwimmerF), - TRAINER_SPRITE(TWINS, Twins), - TRAINER_SPRITE(SAILOR, Sailor), - TRAINER_SPRITE(MAGMA_ADMIN, MagmaAdmin), - TRAINER_SPRITE(WALLY, Wally), - TRAINER_SPRITE(BRENDAN, Brendan), - TRAINER_SPRITE(MAY, May), - TRAINER_SPRITE(BUG_CATCHER, BugCatcher), - TRAINER_SPRITE(POKEMON_RANGER_M, PokemonRangerM), - TRAINER_SPRITE(POKEMON_RANGER_F, PokemonRangerF), - TRAINER_SPRITE(MAGMA_LEADER_MAXIE, MagmaLeaderMaxie), - TRAINER_SPRITE(LASS, Lass), - TRAINER_SPRITE(YOUNG_COUPLE, YoungCouple), - TRAINER_SPRITE(OLD_COUPLE, OldCouple), - TRAINER_SPRITE(SIS_AND_BRO, SisAndBro), - TRAINER_SPRITE(STEVEN, Steven, 0, 7, 0x188), - TRAINER_SPRITE(SALON_MAIDEN_ANABEL, SalonMaidenAnabel), - TRAINER_SPRITE(DOME_ACE_TUCKER, DomeAceTucker), - TRAINER_SPRITE(PALACE_MAVEN_SPENSER, PalaceMavenSpenser), - TRAINER_SPRITE(ARENA_TYCOON_GRETA, ArenaTycoonGreta), - TRAINER_SPRITE(FACTORY_HEAD_NOLAND, FactoryHeadNoland), - TRAINER_SPRITE(PIKE_QUEEN_LUCY, PikeQueenLucy), - TRAINER_SPRITE(PYRAMID_KING_BRANDON, PyramidKingBrandon), - TRAINER_SPRITE(RED, Red), - TRAINER_SPRITE(LEAF, Leaf), - TRAINER_SPRITE(RS_BRENDAN, RubySapphireBrendan), - TRAINER_SPRITE(RS_MAY, RubySapphireMay), + TRAINER_SPRITE(TRAINER_PIC_HIKER, gTrainerFrontPic_Hiker, gTrainerPalette_Hiker), + TRAINER_SPRITE(TRAINER_PIC_AQUA_GRUNT_M, gTrainerFrontPic_AquaGruntM, gTrainerPalette_AquaGruntM), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_BREEDER_F, gTrainerFrontPic_PokemonBreederF, gTrainerPalette_PokemonBreederF), + TRAINER_SPRITE(TRAINER_PIC_COOLTRAINER_M, gTrainerFrontPic_CoolTrainerM, gTrainerPalette_CoolTrainerM), + TRAINER_SPRITE(TRAINER_PIC_BIRD_KEEPER, gTrainerFrontPic_BirdKeeper, gTrainerPalette_BirdKeeper), + TRAINER_SPRITE(TRAINER_PIC_COLLECTOR, gTrainerFrontPic_Collector, gTrainerPalette_Collector), + TRAINER_SPRITE(TRAINER_PIC_AQUA_GRUNT_F, gTrainerFrontPic_AquaGruntF, gTrainerPalette_AquaGruntF), + TRAINER_SPRITE(TRAINER_PIC_SWIMMER_M, gTrainerFrontPic_SwimmerM, gTrainerPalette_SwimmerM), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_GRUNT_M, gTrainerFrontPic_MagmaGruntM, gTrainerPalette_MagmaGruntM), + TRAINER_SPRITE(TRAINER_PIC_EXPERT_M, gTrainerFrontPic_ExpertM, gTrainerPalette_ExpertM), + TRAINER_SPRITE(TRAINER_PIC_AQUA_ADMIN_M, gTrainerFrontPic_AquaAdminM, gTrainerPalette_AquaAdminM), + TRAINER_SPRITE(TRAINER_PIC_BLACK_BELT, gTrainerFrontPic_BlackBelt, gTrainerPalette_BlackBelt), + TRAINER_SPRITE(TRAINER_PIC_AQUA_ADMIN_F, gTrainerFrontPic_AquaAdminF, gTrainerPalette_AquaAdminF), + TRAINER_SPRITE(TRAINER_PIC_AQUA_LEADER_ARCHIE, gTrainerFrontPic_AquaLeaderArchie, gTrainerPalette_AquaLeaderArchie), + TRAINER_SPRITE(TRAINER_PIC_HEX_MANIAC, gTrainerFrontPic_HexManiac, gTrainerPalette_HexManiac), + TRAINER_SPRITE(TRAINER_PIC_AROMA_LADY, gTrainerFrontPic_AromaLady, gTrainerPalette_AromaLady), + TRAINER_SPRITE(TRAINER_PIC_RUIN_MANIAC, gTrainerFrontPic_RuinManiac, gTrainerPalette_RuinManiac), + TRAINER_SPRITE(TRAINER_PIC_INTERVIEWER, gTrainerFrontPic_Interviewer, gTrainerPalette_Interviewer), + TRAINER_SPRITE(TRAINER_PIC_TUBER_F, gTrainerFrontPic_TuberF, gTrainerPalette_TuberF), + TRAINER_SPRITE(TRAINER_PIC_TUBER_M, gTrainerFrontPic_TuberM, gTrainerPalette_TuberM), + TRAINER_SPRITE(TRAINER_PIC_COOLTRAINER_F, gTrainerFrontPic_CoolTrainerF, gTrainerPalette_CoolTrainerF), + TRAINER_SPRITE(TRAINER_PIC_LADY, gTrainerFrontPic_Lady, gTrainerPalette_Lady), + TRAINER_SPRITE(TRAINER_PIC_BEAUTY, gTrainerFrontPic_Beauty, gTrainerPalette_Beauty), + TRAINER_SPRITE(TRAINER_PIC_RICH_BOY, gTrainerFrontPic_RichBoy, gTrainerPalette_RichBoy), + TRAINER_SPRITE(TRAINER_PIC_EXPERT_F, gTrainerFrontPic_ExpertF, gTrainerPalette_ExpertF), + TRAINER_SPRITE(TRAINER_PIC_POKEMANIAC, gTrainerFrontPic_Pokemaniac, gTrainerPalette_Pokemaniac), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_GRUNT_F, gTrainerFrontPic_MagmaGruntF, gTrainerPalette_MagmaGruntF), + TRAINER_SPRITE(TRAINER_PIC_GUITARIST, gTrainerFrontPic_Guitarist, gTrainerPalette_Guitarist), + TRAINER_SPRITE(TRAINER_PIC_KINDLER, gTrainerFrontPic_Kindler, gTrainerPalette_Kindler), + TRAINER_SPRITE(TRAINER_PIC_CAMPER, gTrainerFrontPic_Camper, gTrainerPalette_Camper), + TRAINER_SPRITE(TRAINER_PIC_PICNICKER, gTrainerFrontPic_Picnicker, gTrainerPalette_Picnicker), + TRAINER_SPRITE(TRAINER_PIC_BUG_MANIAC, gTrainerFrontPic_BugManiac, gTrainerPalette_BugManiac), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_BREEDER_M, gTrainerFrontPic_PokemonBreederM, gTrainerPalette_PokemonBreederM), + TRAINER_SPRITE(TRAINER_PIC_PSYCHIC_M, gTrainerFrontPic_PsychicM, gTrainerPalette_PsychicM), + TRAINER_SPRITE(TRAINER_PIC_PSYCHIC_F, gTrainerFrontPic_PsychicF, gTrainerPalette_PsychicF), + TRAINER_SPRITE(TRAINER_PIC_GENTLEMAN, gTrainerFrontPic_Gentleman, gTrainerPalette_Gentleman), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_SIDNEY, gTrainerFrontPic_EliteFourSidney, gTrainerPalette_EliteFourSidney), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_PHOEBE, gTrainerFrontPic_EliteFourPhoebe, gTrainerPalette_EliteFourPhoebe), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_GLACIA, gTrainerFrontPic_EliteFourGlacia, gTrainerPalette_EliteFourGlacia, -4, 4, 0x1B0), + TRAINER_SPRITE(TRAINER_PIC_ELITE_FOUR_DRAKE, gTrainerFrontPic_EliteFourDrake, gTrainerPalette_EliteFourDrake, 0, 5, 0x1A0), + TRAINER_SPRITE(TRAINER_PIC_LEADER_ROXANNE, gTrainerFrontPic_LeaderRoxanne, gTrainerPalette_LeaderRoxanne), + TRAINER_SPRITE(TRAINER_PIC_LEADER_BRAWLY, gTrainerFrontPic_LeaderBrawly, gTrainerPalette_LeaderBrawly), + TRAINER_SPRITE(TRAINER_PIC_LEADER_WATTSON, gTrainerFrontPic_LeaderWattson, gTrainerPalette_LeaderWattson), + TRAINER_SPRITE(TRAINER_PIC_LEADER_FLANNERY, gTrainerFrontPic_LeaderFlannery, gTrainerPalette_LeaderFlannery), + TRAINER_SPRITE(TRAINER_PIC_LEADER_NORMAN, gTrainerFrontPic_LeaderNorman, gTrainerPalette_LeaderNorman), + TRAINER_SPRITE(TRAINER_PIC_LEADER_WINONA, gTrainerFrontPic_LeaderWinona, gTrainerPalette_LeaderWinona), + TRAINER_SPRITE(TRAINER_PIC_LEADER_TATE_AND_LIZA, gTrainerFrontPic_LeaderTateAndLiza, gTrainerPalette_LeaderTateAndLiza), + TRAINER_SPRITE(TRAINER_PIC_LEADER_JUAN, gTrainerFrontPic_LeaderJuan, gTrainerPalette_LeaderJuan), + TRAINER_SPRITE(TRAINER_PIC_SCHOOL_KID_M, gTrainerFrontPic_SchoolKidM, gTrainerPalette_SchoolKidM), + TRAINER_SPRITE(TRAINER_PIC_SCHOOL_KID_F, gTrainerFrontPic_SchoolKidF, gTrainerPalette_SchoolKidF), + TRAINER_SPRITE(TRAINER_PIC_SR_AND_JR, gTrainerFrontPic_SrAndJr, gTrainerPalette_SrAndJr), + TRAINER_SPRITE(TRAINER_PIC_POKEFAN_M, gTrainerFrontPic_PokefanM, gTrainerPalette_PokefanM), + TRAINER_SPRITE(TRAINER_PIC_POKEFAN_F, gTrainerFrontPic_PokefanF, gTrainerPalette_PokefanF), + TRAINER_SPRITE(TRAINER_PIC_YOUNGSTER, gTrainerFrontPic_Youngster, gTrainerPalette_Youngster), + TRAINER_SPRITE(TRAINER_PIC_CHAMPION_WALLACE, gTrainerFrontPic_ChampionWallace, gTrainerPalette_ChampionWallace, -8, 7, 0x188), + TRAINER_SPRITE(TRAINER_PIC_FISHERMAN, gTrainerFrontPic_Fisherman, gTrainerPalette_Fisherman), + TRAINER_SPRITE(TRAINER_PIC_CYCLING_TRIATHLETE_M, gTrainerFrontPic_CyclingTriathleteM, gTrainerPalette_CyclingTriathleteM), + TRAINER_SPRITE(TRAINER_PIC_CYCLING_TRIATHLETE_F, gTrainerFrontPic_CyclingTriathleteF, gTrainerPalette_CyclingTriathleteF), + TRAINER_SPRITE(TRAINER_PIC_RUNNING_TRIATHLETE_M, gTrainerFrontPic_RunningTriathleteM, gTrainerPalette_RunningTriathleteM), + TRAINER_SPRITE(TRAINER_PIC_RUNNING_TRIATHLETE_F, gTrainerFrontPic_RunningTriathleteF, gTrainerPalette_RunningTriathleteF), + TRAINER_SPRITE(TRAINER_PIC_SWIMMING_TRIATHLETE_M, gTrainerFrontPic_SwimmingTriathleteM, gTrainerPalette_SwimmingTriathleteM), + TRAINER_SPRITE(TRAINER_PIC_SWIMMING_TRIATHLETE_F, gTrainerFrontPic_SwimmingTriathleteF, gTrainerPalette_SwimmingTriathleteF), + TRAINER_SPRITE(TRAINER_PIC_DRAGON_TAMER, gTrainerFrontPic_DragonTamer, gTrainerPalette_DragonTamer), + TRAINER_SPRITE(TRAINER_PIC_NINJA_BOY, gTrainerFrontPic_NinjaBoy, gTrainerPalette_NinjaBoy), + TRAINER_SPRITE(TRAINER_PIC_BATTLE_GIRL, gTrainerFrontPic_BattleGirl, gTrainerPalette_BattleGirl), + TRAINER_SPRITE(TRAINER_PIC_PARASOL_LADY, gTrainerFrontPic_ParasolLady, gTrainerPalette_ParasolLady), + TRAINER_SPRITE(TRAINER_PIC_SWIMMER_F, gTrainerFrontPic_SwimmerF, gTrainerPalette_SwimmerF), + TRAINER_SPRITE(TRAINER_PIC_TWINS, gTrainerFrontPic_Twins, gTrainerPalette_Twins), + TRAINER_SPRITE(TRAINER_PIC_SAILOR, gTrainerFrontPic_Sailor, gTrainerPalette_Sailor), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_ADMIN, gTrainerFrontPic_MagmaAdmin, gTrainerPalette_MagmaAdmin), + TRAINER_SPRITE(TRAINER_PIC_WALLY, gTrainerFrontPic_Wally, gTrainerPalette_Wally), + TRAINER_SPRITE(TRAINER_PIC_BRENDAN, gTrainerFrontPic_Brendan, gTrainerPalette_Brendan), + TRAINER_SPRITE(TRAINER_PIC_MAY, gTrainerFrontPic_May, gTrainerPalette_May), + TRAINER_SPRITE(TRAINER_PIC_BUG_CATCHER, gTrainerFrontPic_BugCatcher, gTrainerPalette_BugCatcher), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_RANGER_M, gTrainerFrontPic_PokemonRangerM, gTrainerPalette_PokemonRangerM), + TRAINER_SPRITE(TRAINER_PIC_POKEMON_RANGER_F, gTrainerFrontPic_PokemonRangerF, gTrainerPalette_PokemonRangerF), + TRAINER_SPRITE(TRAINER_PIC_MAGMA_LEADER_MAXIE, gTrainerFrontPic_MagmaLeaderMaxie, gTrainerPalette_MagmaLeaderMaxie), + TRAINER_SPRITE(TRAINER_PIC_LASS, gTrainerFrontPic_Lass, gTrainerPalette_Lass), + TRAINER_SPRITE(TRAINER_PIC_YOUNG_COUPLE, gTrainerFrontPic_YoungCouple, gTrainerPalette_YoungCouple), + TRAINER_SPRITE(TRAINER_PIC_OLD_COUPLE, gTrainerFrontPic_OldCouple, gTrainerPalette_OldCouple), + TRAINER_SPRITE(TRAINER_PIC_SIS_AND_BRO, gTrainerFrontPic_SisAndBro, gTrainerPalette_SisAndBro), + TRAINER_SPRITE(TRAINER_PIC_STEVEN, gTrainerFrontPic_Steven, gTrainerPalette_Steven, 0, 7, 0x188), + TRAINER_SPRITE(TRAINER_PIC_SALON_MAIDEN_ANABEL, gTrainerFrontPic_SalonMaidenAnabel, gTrainerPalette_SalonMaidenAnabel), + TRAINER_SPRITE(TRAINER_PIC_DOME_ACE_TUCKER, gTrainerFrontPic_DomeAceTucker, gTrainerPalette_DomeAceTucker), + TRAINER_SPRITE(TRAINER_PIC_PALACE_MAVEN_SPENSER, gTrainerFrontPic_PalaceMavenSpenser, gTrainerPalette_PalaceMavenSpenser), + TRAINER_SPRITE(TRAINER_PIC_ARENA_TYCOON_GRETA, gTrainerFrontPic_ArenaTycoonGreta, gTrainerPalette_ArenaTycoonGreta), + TRAINER_SPRITE(TRAINER_PIC_FACTORY_HEAD_NOLAND, gTrainerFrontPic_FactoryHeadNoland, gTrainerPalette_FactoryHeadNoland), + TRAINER_SPRITE(TRAINER_PIC_PIKE_QUEEN_LUCY, gTrainerFrontPic_PikeQueenLucy, gTrainerPalette_PikeQueenLucy), + TRAINER_SPRITE(TRAINER_PIC_PYRAMID_KING_BRANDON, gTrainerFrontPic_PyramidKingBrandon, gTrainerPalette_PyramidKingBrandon), + TRAINER_SPRITE(TRAINER_PIC_RED, gTrainerFrontPic_Red, gTrainerPalette_Red), + TRAINER_SPRITE(TRAINER_PIC_LEAF, gTrainerFrontPic_Leaf, gTrainerPalette_Leaf), + TRAINER_SPRITE(TRAINER_PIC_RS_BRENDAN, gTrainerFrontPic_RubySapphireBrendan, gTrainerPalette_RubySapphireBrendan), + TRAINER_SPRITE(TRAINER_PIC_RS_MAY, gTrainerFrontPic_RubySapphireMay, gTrainerPalette_RubySapphireMay), }; static const union AnimCmd sAnimCmd_Hoenn[] = @@ -526,23 +526,23 @@ const struct SpriteFrameImage gTrainerBackPicTable_Steven[] = // .backPic goes functionally unused, since none of these pics are compressed // and the place they would get extracted to gets overwritten later anyway // the casts are so they'll play nice with the strict struct definition -#define TRAINER_BACK_SPRITE(trainerPic, yOffset, sprite, pal, anim) \ - [TRAINER_BACK_PIC_##trainerPic] = \ - { \ - .coordinates = {.size = 8, .y_offset = yOffset}, \ - .backPic = {(const u32 *)gTrainerBackPic_##sprite, TRAINER_PIC_SIZE * ARRAY_COUNT(gTrainerBackPicTable_##sprite), TRAINER_BACK_PIC_##trainerPic}, \ - .palette = {gTrainer##pal, TRAINER_BACK_PIC_##trainerPic}, \ - .animation = sBackAnims_##anim, \ +#define TRAINER_BACK_SPRITE(trainerPic, yOffset, sprite, table, pal, anim) \ + [trainerPic] = \ + { \ + .coordinates = {.size = 8, .y_offset = yOffset}, \ + .backPic = {(const u32 *)sprite, TRAINER_PIC_SIZE * ARRAY_COUNT(table), trainerPic}, \ + .palette = {pal, trainerPic}, \ + .animation = anim, \ } const struct TrainerBacksprite gTrainerBacksprites[] = { - TRAINER_BACK_SPRITE(BRENDAN, 4, Brendan, Palette_Brendan, Hoenn), - TRAINER_BACK_SPRITE(MAY, 4, May, Palette_May, Hoenn), - TRAINER_BACK_SPRITE(RED, 5, Red, BackPicPalette_Red, Kanto), - TRAINER_BACK_SPRITE(LEAF, 5, Leaf, BackPicPalette_Leaf, Kanto), - TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_BRENDAN, 4, RubySapphireBrendan, Palette_RubySapphireBrendan, Hoenn), - TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_MAY, 4, RubySapphireMay, Palette_RubySapphireMay, Hoenn), - TRAINER_BACK_SPRITE(WALLY, 4, Wally, Palette_Wally, Hoenn), - TRAINER_BACK_SPRITE(STEVEN, 4, Steven, Palette_Steven, Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_BRENDAN, 4, gTrainerBackPic_Brendan, gTrainerBackPicTable_Brendan, gTrainerPalette_Brendan, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_MAY, 4, gTrainerBackPic_May, gTrainerBackPicTable_May, gTrainerPalette_May, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_RED, 5, gTrainerBackPic_Red, gTrainerBackPicTable_Red, gTrainerBackPicPalette_Red, sBackAnims_Kanto), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_LEAF, 5, gTrainerBackPic_Leaf, gTrainerBackPicTable_Leaf, gTrainerBackPicPalette_Leaf, sBackAnims_Kanto), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN, 4, gTrainerBackPic_RubySapphireBrendan, gTrainerBackPicTable_RubySapphireBrendan, gTrainerPalette_RubySapphireBrendan, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY, 4, gTrainerBackPic_RubySapphireMay, gTrainerBackPicTable_RubySapphireMay, gTrainerPalette_RubySapphireMay, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_WALLY, 4, gTrainerBackPic_Wally, gTrainerBackPicTable_Wally, gTrainerPalette_Wally, sBackAnims_Hoenn), + TRAINER_BACK_SPRITE(TRAINER_BACK_PIC_STEVEN, 4, gTrainerBackPic_Steven, gTrainerBackPicTable_Steven, gTrainerPalette_Steven, sBackAnims_Hoenn), }; diff --git a/src/frontier_util.c b/src/frontier_util.c index b9d4f29e32..4424676644 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -94,71 +94,155 @@ static void ShowPyramidResultsWindow(void); static void ShowLinkContestResultsWindow(void); static void CopyFrontierBrainText(bool8 playerWonText); -#define FRONTIER_BRAIN_SPRITES(Brain) \ - .trainerId = TRAINER_##Brain, \ - .objEventGfx = OBJ_EVENT_GFX_##Brain - -#define FRONTIER_BRAIN_TEXTS(Brain) \ - .lostTexts = {gText_##Brain##DefeatSilver, gText_##Brain##DefeatGold}, \ - .wonTexts = {gText_##Brain##WonSilver, gText_##Brain##WonGold} - // battledBit: Flags to change the conversation when the Frontier Brain is encountered for a battle // First bit is has battled them before and not won yet, second bit is has battled them and won (obtained a Symbol) const struct FrontierBrain gFrontierBrainInfo[NUM_FRONTIER_FACILITIES] = { [FRONTIER_FACILITY_TOWER] = { - FRONTIER_BRAIN_SPRITES(ANABEL), + .trainerId = TRAINER_ANABEL, + .objEventGfx = OBJ_EVENT_GFX_ANABEL, .isFemale = TRUE, - FRONTIER_BRAIN_TEXTS(Anabel), + .lostTexts = { + COMPOUND_STRING("Okay, I understand…"), //Silver + COMPOUND_STRING("Thank you…") //Gold + }, + .wonTexts = { + COMPOUND_STRING("It's very disappointing…"), //Silver + COMPOUND_STRING("I'm terribly sorry…") //Gold + }, .battledBit = {1 << 0, 1 << 1}, .streakAppearances = {35, 70, 35, 1}, }, [FRONTIER_FACILITY_DOME] = { - FRONTIER_BRAIN_SPRITES(TUCKER), + .trainerId = TRAINER_TUCKER, + .objEventGfx = OBJ_EVENT_GFX_TUCKER, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Tucker), + .lostTexts = { + COMPOUND_STRING( + "Grr…\n" + "What the…"), //Silver + COMPOUND_STRING( + "Ahahaha!\n" + "You're inspiring!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Ahahaha! Aren't you embarrassed?\n" + "Everyone's watching!"), //Silver + COMPOUND_STRING("My DOME ACE title isn't just for show!") //Gold + }, .battledBit = {1 << 2, 1 << 3}, .streakAppearances = {1, 2, 5, 0}, }, [FRONTIER_FACILITY_PALACE] = { - FRONTIER_BRAIN_SPRITES(SPENSER), + .trainerId = TRAINER_SPENSER, + .objEventGfx = OBJ_EVENT_GFX_SPENSER, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Spenser), + .lostTexts = { + COMPOUND_STRING( + "Ah…\n" + "Now this is something else…"), //Silver + COMPOUND_STRING( + "Gwah!\n" + "Hahahaha!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Your POKéMON are wimpy because\n" + "you're wimpy as a TRAINER!"), //Silver + COMPOUND_STRING( + "Gwahahaha!\n" + "My brethren, we have nothing to fear!") //Gold + }, .battledBit = {1 << 4, 1 << 5}, .streakAppearances = {21, 42, 21, 1}, }, [FRONTIER_FACILITY_ARENA] = { - FRONTIER_BRAIN_SPRITES(GRETA), + .trainerId = TRAINER_GRETA, + .objEventGfx = OBJ_EVENT_GFX_GRETA, .isFemale = TRUE, - FRONTIER_BRAIN_TEXTS(Greta), + .lostTexts = { + COMPOUND_STRING( + "No way!\n" + "Good job!"), //Silver + COMPOUND_STRING( + "Huh?\n" + "Are you serious?!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Oh, come on!\n" + "You have to try harder than that!"), //Silver + COMPOUND_STRING( + "Heheh!\n" + "What did you expect?") //Gold + }, .battledBit = {1 << 6, 1 << 7}, .streakAppearances = {28, 56, 28, 1}, }, [FRONTIER_FACILITY_FACTORY] = { - FRONTIER_BRAIN_SPRITES(NOLAND), + .trainerId = TRAINER_NOLAND, + .objEventGfx = OBJ_EVENT_GFX_NOLAND, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Noland), + .lostTexts = { + COMPOUND_STRING( + "Good job!\n" + "You know what you're doing!"), //Silver + COMPOUND_STRING("What happened here?") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Way to work!\n" + "That was a good lesson, eh?"), //Silver + COMPOUND_STRING( + "Hey, hey, hey!\n" + "You're finished already?") //Gold + }, .battledBit = {1 << 8, 1 << 9}, .streakAppearances = {21, 42, 21, 1}, }, [FRONTIER_FACILITY_PIKE] = { - FRONTIER_BRAIN_SPRITES(LUCY), + .trainerId = TRAINER_LUCY, + .objEventGfx = OBJ_EVENT_GFX_LUCY, .isFemale = TRUE, - FRONTIER_BRAIN_TEXTS(Lucy), + .lostTexts = { + COMPOUND_STRING("Urk…"), //Silver + COMPOUND_STRING("Darn!") //Gold + }, + .wonTexts = { + COMPOUND_STRING("Humph…"), //Silver + COMPOUND_STRING("Hah!") //Gold + }, .battledBit = {1 << 10, 1 << 11}, .streakAppearances = {28, 140, 56, 1}, }, [FRONTIER_FACILITY_PYRAMID] = { - FRONTIER_BRAIN_SPRITES(BRANDON), + .trainerId = TRAINER_BRANDON, + .objEventGfx = OBJ_EVENT_GFX_BRANDON, .isFemale = FALSE, - FRONTIER_BRAIN_TEXTS(Brandon), + .lostTexts = { + COMPOUND_STRING( + "That's it! You've done great!\n" + "You've worked hard for this!"), //Silver + COMPOUND_STRING( + "That's it! You've done it!\n" + "You kept working for this!") //Gold + }, + .wonTexts = { + COMPOUND_STRING( + "Hey! What's wrong with you!\n" + "Let's see some effort! Get up!"), //Silver + COMPOUND_STRING( + "Hey! Don't you give up now!\n" + "Get up! Don't lose faith in yourself!") //Gold + }, .battledBit = {1 << 12, 1 << 13}, .streakAppearances = {21, 70, 35, 0}, }, From d695a6240dbbd6bcdd7785fd172119efb3e49146 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Sun, 22 Sep 2024 05:25:42 -0400 Subject: [PATCH 113/133] Convert settotemboost command to callnative (#5418) * settotemboost use callnative * Update src/battle_main.c --------- Co-authored-by: ghoulslash Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- asm/macros/event.inc | 18 +++++++++--------- data/specials.inc | 1 - src/battle_main.c | 16 ++++++++-------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 83338673cf..c5a83a28f7 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2105,15 +2105,15 @@ @ The rest of the arguments are the stat change values to each stat. @ For example, giving the first opponent +1 to atk and -2 to speed would be: settotemboost B_POSITION_OPPONENT_LEFT, 1, 0, -2 .macro settotemboost battler:req, atk=0,def=0,speed=0,spatk=0,spdef=0,acc=0,evas=0 - setvar VAR_0x8000, \battler - setvar VAR_0x8001, \atk - setvar VAR_0x8002, \def - setvar VAR_0x8003, \speed - setvar VAR_0x8004, \spatk - setvar VAR_0x8005, \spdef - setvar VAR_0x8006, \acc - setvar VAR_0x8007, \evas - special SetTotemBoost + callnative ScriptSetTotemBoost + .2byte \battler + .2byte \atk + .2byte \def + .2byte \speed + .2byte \spatk + .2byte \spdef + .2byte \acc + .2byte \evas .endm @ useful totem boost macros diff --git a/data/specials.inc b/data/specials.inc index f02497d603..5ebb3d0ee1 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -534,7 +534,6 @@ gSpecials:: def_special RemoveRecordsWindow def_special CloseDeptStoreElevatorWindow def_special TrySetBattleTowerLinkType - def_special SetTotemBoost def_special TrySpecialOverworldEvo def_special GetNumberSprayStrength def_special GetSprayId diff --git a/src/battle_main.c b/src/battle_main.c index d011cde1db..a9336c3f8b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -43,6 +43,7 @@ #include "roamer.h" #include "safari_zone.h" #include "scanline_effect.h" +#include "script.h" #include "sound.h" #include "sprite.h" #include "string_util.h" @@ -5935,21 +5936,20 @@ void SetTypeBeforeUsingMove(u32 move, u32 battlerAtk) } } -// special to set a field's totem boost(s) -// inputs: -// var8000: battler -// var8001 - var8007: stat changes -void SetTotemBoost(void) +// Queues stat boosts for a given battler for totem battles +void ScriptSetTotemBoost(struct ScriptContext *ctx) { - u32 battler = gSpecialVar_0x8000; + u32 battler = VarGet(ScriptReadHalfword(ctx)); + u32 stat; u32 i; for (i = 0; i < (NUM_BATTLE_STATS - 1); i++) { - if (*(&gSpecialVar_0x8001 + i)) + stat = VarGet(ScriptReadHalfword(ctx)); + if (stat) { gQueuedStatBoosts[battler].stats |= (1 << i); - gQueuedStatBoosts[battler].statChanges[i] = *(&gSpecialVar_0x8001 + i); + gQueuedStatBoosts[battler].statChanges[i] = stat; gQueuedStatBoosts[battler].stats |= 0x80; // used as a flag for the "totem flared to life" script } } From 60e2c0f859bebfbbf9d5f6cfcd79e6e899cac0dc Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 22 Sep 2024 12:05:45 +0200 Subject: [PATCH 114/133] Merge item description branch history (#5419) * Recreated ghoul's item_desc_header branch Fixed tabs vs spaces Fixing whitespace * Fixed item in header not showing on maximum flash level * Fixed item icon being affected by thunderstorms * Shops now set the obtained item flag. * Fixed build * fix seashore house * better soda pop fix, thx asparagus * fix item icon showing in battle pyramid * fix hiding item desc in battle pyramid --------- Co-authored-by: Eduardo Quezada D'Ottone Co-authored-by: ghoulslash --- data/battle_scripts_1.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a7295d9b53..04784ccdac 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4725,8 +4725,8 @@ BattleScript_ButItFailed:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_RestoreAttackerButItFailed: - restoreattacker - goto BattleScript_ButItFailed + restoreattacker + goto BattleScript_ButItFailed BattleScript_NotAffected:: pause B_WAIT_TIME_SHORT From d122c0a22233c7a0097c58f9b1ff2fa1fbfc8633 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 22 Sep 2024 14:14:15 +0200 Subject: [PATCH 115/133] Fix affection check for exp multiplier --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0048cf14e4..c65e1455d8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -16193,7 +16193,7 @@ void ApplyExperienceMultipliers(s32 *expAmount, u8 expGetterMonId, u8 faintedBat *expAmount = (*expAmount * 150) / 100; if (B_UNEVOLVED_EXP_MULTIPLIER >= GEN_6 && IsMonPastEvolutionLevel(&gPlayerParty[expGetterMonId])) *expAmount = (*expAmount * 4915) / 4096; - if (B_AFFECTION_MECHANICS == TRUE && GetBattlerAffectionHearts(expGetterMonId) >= AFFECTION_FOUR_HEARTS) + if (B_AFFECTION_MECHANICS == TRUE && GetMonAffectionHearts(&gPlayerParty[expGetterMonId]) >= AFFECTION_FOUR_HEARTS) *expAmount = (*expAmount * 4915) / 4096; if (CheckBagHasItem(ITEM_EXP_CHARM, 1)) //is also for other exp boosting Powers if/when implemented *expAmount = (*expAmount * 150) / 100; From bfa020da08f5ed30e01bd7492a1b0b2344fe401b Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 22 Sep 2024 09:19:58 -0400 Subject: [PATCH 116/133] fix tile attributes --- src/metatile_behavior.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 0248c3cfee..7a447148e1 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -66,8 +66,6 @@ static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] = [MB_SLIDE_NORTH] = TILE_FLAG_UNUSED, [MB_SLIDE_SOUTH] = TILE_FLAG_UNUSED, [MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_UNUSED, - [MB_UNUSED_49] = TILE_FLAG_UNUSED, - [MB_UNUSED_4A] = TILE_FLAG_UNUSED, [MB_EASTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, [MB_WESTWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, [MB_NORTHWARD_CURRENT] = TILE_FLAG_UNUSED | TILE_FLAG_SURFABLE, From 918d45a6232ad2c29f93f655d001c68b12a7b9d8 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 22 Sep 2024 16:33:17 +0200 Subject: [PATCH 117/133] Fix default tera type changing upon evolution/form change (#5422) --- src/evolution_scene.c | 19 +++++++------------ src/pokemon.c | 2 ++ test/pokemon.c | 11 ++++++++--- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 98879430cb..6119494907 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -545,19 +545,13 @@ static void CB2_TradeEvolutionSceneUpdate(void) static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) { u32 data = 0; - #if P_SHEDINJA_BALL >= GEN_4 - u16 ball = ITEM_POKE_BALL; - #endif + u16 ball = ITEM_POKE_BALL; const struct Evolution *evolutions = GetSpeciesEvolutions(preEvoSpecies); if (evolutions == NULL) return; - if (evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE - #if P_SHEDINJA_BALL >= GEN_4 - && (CheckBagHasItem(ball, 1)) - #endif - ) + if (evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE && (P_SHEDINJA_BALL < GEN_4 || CheckBagHasItem(ball, 1))) { s32 i; struct Pokemon *shedinja = &gPlayerParty[gPlayerPartyCount]; @@ -567,10 +561,11 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, GetSpeciesName(evolutions[1].targetSpecies)); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, &data); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, &data); - #if P_SHEDINJA_BALL >= GEN_4 - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_POKEBALL, &ball); - RemoveBagItem(ball, 1); - #endif + if (P_SHEDINJA_BALL >= GEN_4) + { + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_POKEBALL, &ball); + RemoveBagItem(ball, 1); + } for (i = MON_DATA_COOL_RIBBON; i < MON_DATA_COOL_RIBBON + CONTEST_CATEGORIES_COUNT; i++) SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data); diff --git a/src/pokemon.c b/src/pokemon.c index 0583939a85..e186ce4d51 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2791,6 +2791,8 @@ u32 GetBoxMonData3(struct BoxPokemon *boxMon, s32 field, u8 *data) { const u8 *types = gSpeciesInfo[substruct0->species].types; retVal = (boxMon->personality & 0x1) == 0 ? types[0] : types[1]; + // To avoid this value changing upon form change/evolution, we directly set it for future cases + SetBoxMonData(boxMon, MON_DATA_TERA_TYPE, &retVal); } else { diff --git a/test/pokemon.c b/test/pokemon.c index 8419b9c7e1..562b8b10a3 100644 --- a/test/pokemon.c +++ b/test/pokemon.c @@ -325,20 +325,25 @@ TEST("givemon [vars]") EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_TERA_TYPE), TYPE_FIRE); } -TEST("checkteratype/setteratype work") +TEST("checkteratype works") { CreateMon(&gPlayerParty[0], SPECIES_WOBBUFFET, 100, 0, FALSE, 0, OT_ID_PRESET, 0); RUN_OVERWORLD_SCRIPT( checkteratype 0; ); - EXPECT(VarGet(VAR_RESULT) == TYPE_PSYCHIC); + EXPECT_EQ(VarGet(VAR_RESULT), TYPE_PSYCHIC); +} + +TEST("setteratype works") +{ + CreateMon(&gPlayerParty[0], SPECIES_WOBBUFFET, 100, 0, FALSE, 0, OT_ID_PRESET, 0); RUN_OVERWORLD_SCRIPT( setteratype TYPE_FIRE, 0; checkteratype 0; ); - EXPECT(VarGet(VAR_RESULT) == TYPE_FIRE); + EXPECT_EQ(VarGet(VAR_RESULT), TYPE_FIRE); } TEST("createmon [simple]") From b924461ae3e48a3138cb07eb913279c3917d7c6d Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:41:26 +0200 Subject: [PATCH 118/133] Clean up Unseen Fist Check (#5420) * Clean up Unseedn Fist Check * fix compiling --- src/battle_util.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 83af21cdcf..a54e8a12c8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8541,13 +8541,9 @@ bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move) if (gProtectStructs[battlerDef].maxGuarded && IsMoveBlockedByMaxGuard(move)) return TRUE; - // Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here. - // This means extra logic is needed to handle Shell Side Arm. - if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST - && (gMovesInfo[move].makesContact - || (gMovesInfo[move].effect == EFFECT_SHELL_SIDE_ARM - && gBattleStruct->shellSideArmCategory[battlerAtk][battlerDef] == DAMAGE_CATEGORY_PHYSICAL)) - && !gProtectStructs[battlerDef].maxGuarded) // Max Guard cannot be bypassed by Unseen Fist + if (!gProtectStructs[battlerDef].maxGuarded // Max Guard cannot be bypassed by Unseen Fist + && IsMoveMakingContact(move, gBattlerAttacker) + && GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST) return FALSE; else if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_CRAFTY_SHIELD && IS_MOVE_STATUS(move)) From ad0778722b34b21f0c5171b61187ff13c3ddd1b1 Mon Sep 17 00:00:00 2001 From: psf <77138753+pkmnsnfrn@users.noreply.github.com> Date: Sun, 22 Sep 2024 10:07:17 -0700 Subject: [PATCH 119/133] Adds SAVE_TYPE_ERROR_SCREEN (#5188) * Original commit * Moved config from save to general https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720747901 Reindent function per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720747984 Split Compound String into seperate lines per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720748104 Changed Rom to ROM per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720748104 Removed extra new line per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720748172 * fixed spacing per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#issuecomment-2295134679 * Updated spacing per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#issuecomment-2306527812 * Removed comment and made line breaks consistent per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#pullrequestreview-2320266015 --- include/config/general.h | 1 + src/main.c | 3 ++- src/save_failed_screen.c | 52 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/include/config/general.h b/include/config/general.h index ac338a1f50..cff1432bb7 100644 --- a/include/config/general.h +++ b/include/config/general.h @@ -86,4 +86,5 @@ // Naming Screen #define AUTO_LOWERCASE_KEYBOARD GEN_LATEST // Starting in GEN_6, after entering the first uppercase character, the keyboard switches to lowercase letters. +#define SAVE_TYPE_ERROR_SCREEN FALSE // When enabled, this shows an error message when the game is loaded on a cart without a flash chip or on an emulator with the wrong save type setting instead of crashing. #endif // GUARD_CONFIG_GENERAL_H diff --git a/src/main.c b/src/main.c index 47907a0111..616c67800b 100644 --- a/src/main.c +++ b/src/main.c @@ -34,6 +34,7 @@ static void IntrDummy(void); // Defined in the linker script so that the test build can override it. extern void gInitialMainCB2(void); +extern void CB2_FlashNotDetectedScreen(void); const u8 gGameVersion = GAME_VERSION; @@ -114,7 +115,7 @@ void AgbMain() gSoftResetDisabled = FALSE; if (gFlashMemoryPresent != TRUE) - SetMainCallback2(NULL); + SetMainCallback2((SAVE_TYPE_ERROR_SCREEN) ? CB2_FlashNotDetectedScreen : NULL); gLinkTransferringData = FALSE; diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index e9257debf2..9bd981facc 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -399,3 +399,55 @@ static bool8 WipeSectors(u32 sectorBits) else return TRUE; } + +void CB2_FlashNotDetectedScreen(void) +{ + static const struct WindowTemplate textWin[] = + { + { + .bg = 0, + .tilemapLeft = 3, + .tilemapTop = 2, + .width = 24, + .height = 16, + .paletteNum = 15, + .baseBlock = 1, + } + }; + + if (gMain.state) + return; + + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); + DmaFill16(3, 0, VRAM, VRAM_SIZE); + DmaFill32(3, 0, OAM, OAM_SIZE); + DmaFill16(3, 0, PLTT, PLTT_SIZE); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); + LoadBgTiles(0, gTextWindowFrame1_Gfx, 0x120, 0x214); + DeactivateAllTextPrinters(); + ResetTasks(); + ResetPaletteFade(); + LoadPalette(gTextWindowFrame1_Pal, 0xE0, 0x20); + LoadPalette(gStandardMenuPalette, 0xF0, 0x20); + InitWindows(textWin); + DrawStdFrameWithCustomTileAndPalette(0, TRUE, 0x214, 0xE); + static const u8 saveFailedMessage[] =_( + "{COLOR RED}ERROR! {COLOR DARK_GRAY}Flash memory not detected!\n" + "\n" + "If playing on an emulator, set your\n" + "save type setting to\n" + "Flash 1Mb/128K and reload the ROM.\n" + "\n" + "If playing on hardware, your cart\n" + "does not have a working flash chip."); + SaveFailedScreenTextPrint(saveFailedMessage, 1, 0); + TransferPlttBuffer(); + *(u16*)PLTT = RGB(17, 18, 31); + ShowBg(0); + gMain.state++; +} From acd07ccfc10adb701f015d6d8f9e061c5ba1add0 Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Sun, 22 Sep 2024 13:44:18 -0400 Subject: [PATCH 120/133] add rocky helmet dmg to tangling hair + defiant test to ensure original battler IDs from chaining effects (#5423) Co-authored-by: ghoulslash --- test/battle/ability/tangling_hair.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/battle/ability/tangling_hair.c b/test/battle/ability/tangling_hair.c index 0dbc0264ce..508678a037 100644 --- a/test/battle/ability/tangling_hair.c +++ b/test/battle/ability/tangling_hair.c @@ -50,10 +50,10 @@ SINGLE_BATTLE_TEST("Tangling Hair does not cause Rocky Helmet miss activation") } } -SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant") +SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant and keeps original attacker/target") { GIVEN { - PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); } + PLAYER(SPECIES_DUGTRIO) { Ability(ABILITY_TANGLING_HAIR); Item(ITEM_ROCKY_HELMET); } OPPONENT(SPECIES_PAWNIARD) { Ability(ABILITY_DEFIANT); } } WHEN { TURN { MOVE(opponent, MOVE_TACKLE); } @@ -64,5 +64,7 @@ SINGLE_BATTLE_TEST("Tangling Hair Speed stat drop triggers defiant") MESSAGE("Foe Pawniard's Speed fell!"); ABILITY_POPUP(opponent, ABILITY_DEFIANT); MESSAGE("Foe Pawniard's Attack sharply rose!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Foe Pawniard was hurt by Dugtrio's Rocky Helmet!"); } } From 55086586c57cc867fa45f618669f53cca2aa8987 Mon Sep 17 00:00:00 2001 From: psf <77138753+pkmnsnfrn@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:59:43 -0700 Subject: [PATCH 121/133] Revert 5422 (#5424) --- src/evolution_scene.c | 19 ++++++++++++------- src/pokemon.c | 2 -- test/pokemon.c | 11 +++-------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 6119494907..98879430cb 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -545,13 +545,19 @@ static void CB2_TradeEvolutionSceneUpdate(void) static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) { u32 data = 0; - u16 ball = ITEM_POKE_BALL; + #if P_SHEDINJA_BALL >= GEN_4 + u16 ball = ITEM_POKE_BALL; + #endif const struct Evolution *evolutions = GetSpeciesEvolutions(preEvoSpecies); if (evolutions == NULL) return; - if (evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE && (P_SHEDINJA_BALL < GEN_4 || CheckBagHasItem(ball, 1))) + if (evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE + #if P_SHEDINJA_BALL >= GEN_4 + && (CheckBagHasItem(ball, 1)) + #endif + ) { s32 i; struct Pokemon *shedinja = &gPlayerParty[gPlayerPartyCount]; @@ -561,11 +567,10 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, GetSpeciesName(evolutions[1].targetSpecies)); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, &data); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, &data); - if (P_SHEDINJA_BALL >= GEN_4) - { - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_POKEBALL, &ball); - RemoveBagItem(ball, 1); - } + #if P_SHEDINJA_BALL >= GEN_4 + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_POKEBALL, &ball); + RemoveBagItem(ball, 1); + #endif for (i = MON_DATA_COOL_RIBBON; i < MON_DATA_COOL_RIBBON + CONTEST_CATEGORIES_COUNT; i++) SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data); diff --git a/src/pokemon.c b/src/pokemon.c index e186ce4d51..0583939a85 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2791,8 +2791,6 @@ u32 GetBoxMonData3(struct BoxPokemon *boxMon, s32 field, u8 *data) { const u8 *types = gSpeciesInfo[substruct0->species].types; retVal = (boxMon->personality & 0x1) == 0 ? types[0] : types[1]; - // To avoid this value changing upon form change/evolution, we directly set it for future cases - SetBoxMonData(boxMon, MON_DATA_TERA_TYPE, &retVal); } else { diff --git a/test/pokemon.c b/test/pokemon.c index 562b8b10a3..8419b9c7e1 100644 --- a/test/pokemon.c +++ b/test/pokemon.c @@ -325,25 +325,20 @@ TEST("givemon [vars]") EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_TERA_TYPE), TYPE_FIRE); } -TEST("checkteratype works") +TEST("checkteratype/setteratype work") { CreateMon(&gPlayerParty[0], SPECIES_WOBBUFFET, 100, 0, FALSE, 0, OT_ID_PRESET, 0); RUN_OVERWORLD_SCRIPT( checkteratype 0; ); - EXPECT_EQ(VarGet(VAR_RESULT), TYPE_PSYCHIC); -} - -TEST("setteratype works") -{ - CreateMon(&gPlayerParty[0], SPECIES_WOBBUFFET, 100, 0, FALSE, 0, OT_ID_PRESET, 0); + EXPECT(VarGet(VAR_RESULT) == TYPE_PSYCHIC); RUN_OVERWORLD_SCRIPT( setteratype TYPE_FIRE, 0; checkteratype 0; ); - EXPECT_EQ(VarGet(VAR_RESULT), TYPE_FIRE); + EXPECT(VarGet(VAR_RESULT) == TYPE_FIRE); } TEST("createmon [simple]") From e67d5a23ed54a0fc8a584199d99fe3019804bbbd Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:40:44 +0100 Subject: [PATCH 122/133] Adds some Snatch interactions, fixes for Dragon Darts, Trace, Primal Reversion, Protosynthesis/Quark Drive (#5430) * Fixes Electrified Dragon Darts sometimes targeting battlers with absorbing abilities (Volt Absorb, Motor Drive) * Add Snatch interactions with Dancer, Swallow * Trace fix + cleanup * Simplify Quash * Fixes multiple mons with Primal Reversion causing only one Primal Reversion, add tests * Fix Booster Energy Ability Popup * Accidentally removed healing from Swallow * More Trace cleanup --- data/battle_scripts_1.s | 12 +-- include/battle.h | 3 +- include/battle_scripts.h | 1 - include/battle_util.h | 2 +- src/battle_script_commands.c | 52 ++++++------ src/battle_util.c | 29 +++---- test/battle/ability/dancer.c | 79 +++++++++++++++++ test/battle/ability/trace.c | 15 ++++ test/battle/form_change/primal_reversion.c | 98 ++++++++++++++++++++++ test/battle/move_effect/dragon_darts.c | 77 +++++++++++++++++ 10 files changed, 313 insertions(+), 55 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 06b82f43b7..94f5736317 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6961,12 +6961,12 @@ BattleScript_WishMegaEvolution:: BattleScript_PrimalReversion:: call BattleScript_PrimalReversionRet - end2 + end3 BattleScript_PrimalReversionRestoreAttacker:: call BattleScript_PrimalReversionRet copybyte gBattlerAttacker, sSAVED_BATTLER - end2 + end3 BattleScript_PrimalReversionRet:: flushtextbox @@ -7675,15 +7675,11 @@ BattleScript_EmergencyExitWildNoPopUp:: BattleScript_TraceActivates:: pause B_WAIT_TIME_SHORT - call BattleScript_AbilityPopUp + call BattleScript_AbilityPopUpScripting printstring STRINGID_PKMNTRACED waitmessage B_WAIT_TIME_LONG settracedability BS_SCRIPTING switchinabilities BS_SCRIPTING - return - -BattleScript_TraceActivatesEnd3:: - call BattleScript_TraceActivates end3 BattleScript_ReceiverActivates:: @@ -10011,7 +10007,7 @@ BattleScript_BerserkGeneRet_End: BattleScript_BoosterEnergyEnd2:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, sB_ANIM_ARG1 - call BattleScript_AbilityPopUpTarget + call BattleScript_AbilityPopUpScripting printstring STRINGID_BOOSTERENERGYACTIVATES waitmessage B_WAIT_TIME_MED printstring STRINGID_STATWASHEIGHTENED diff --git a/include/battle.h b/include/battle.h index 91233c8fe8..582dcedfc2 100644 --- a/include/battle.h +++ b/include/battle.h @@ -93,7 +93,7 @@ struct ResourceFlags #define RESOURCE_FLAG_ROOST 0x2 #define RESOURCE_FLAG_UNBURDEN 0x4 #define RESOURCE_FLAG_UNUSED 0x8 -#define RESOURCE_FLAG_TRACED 0x10 +#define RESOURCE_FLAG_UNUSED_2 0x10 #define RESOURCE_FLAG_EMERGENCY_EXIT 0x20 #define RESOURCE_FLAG_NEUTRALIZING_GAS 0x40 #define RESOURCE_FLAG_ICE_FACE 0x80 @@ -751,6 +751,7 @@ struct BattleStruct u8 blunderPolicy:1; // should blunder policy activate u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky u8 bouncedMoveIsUsed:1; + u8 snatchedMoveIsUsed:1; u8 descriptionSubmenu:1; // For Move Description window in move selection screen u8 ackBallUseBtn:1; // Used for the last used ball feature u8 ballSwapped:1; // Used for the last used ball feature diff --git a/include/battle_scripts.h b/include/battle_scripts.h index e98790764d..84c1b70cf4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -166,7 +166,6 @@ extern const u8 BattleScript_ItemSteal[]; extern const u8 BattleScript_DrizzleActivates[]; extern const u8 BattleScript_SpeedBoostActivates[]; extern const u8 BattleScript_TraceActivates[]; -extern const u8 BattleScript_TraceActivatesEnd3[]; extern const u8 BattleScript_RainDishActivates[]; extern const u8 BattleScript_SandstreamActivates[]; extern const u8 BattleScript_ShedSkinActivates[]; diff --git a/include/battle_util.h b/include/battle_util.h index 3a64b84462..ec8c03a6bd 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -256,7 +256,7 @@ bool32 MoveHasAdditionalEffectSelf(u32 move, u32 moveEffect); bool32 MoveHasAdditionalEffectSelfArg(u32 move, u32 moveEffect, u32 argument); bool32 MoveHasChargeTurnAdditionalEffect(u32 move); bool32 CanTargetPartner(u32 battlerAtk, u32 battlerDef); -bool32 TargetFullyImmuneToCurrMove(u32 BattlerAtk, u32 battlerDef); +bool32 TargetFullyImmuneToCurrMove(u32 battlerAtk, u32 battlerDef); bool32 CanBeSlept(u32 battler, u32 ability); bool32 CanBePoisoned(u32 battlerAtk, u32 battlerDef, u32 defAbility); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c65e1455d8..b018535cbe 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1401,6 +1401,7 @@ static void Cmd_attackcanceler(void) if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gMovesInfo[gCurrentMove].snatchAffected) { gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE; + gBattleStruct->snatchedMoveIsUsed = TRUE; gBattleScripting.battler = gBattlerByTurnOrder[i]; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SnatchedMove; @@ -6287,7 +6288,7 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_DANCER: // Special case because it's so annoying - if (gMovesInfo[gCurrentMove].danceMove) + if (gMovesInfo[gCurrentMove].danceMove && !gBattleStruct->snatchedMoveIsUsed) { u32 battler, nextDancer = 0; bool32 hasDancerTriggered = FALSE; @@ -6431,6 +6432,7 @@ static void Cmd_moveend(void) gBattleStruct->swapDamageCategory = FALSE; gBattleStruct->categoryOverride = FALSE; gBattleStruct->bouncedMoveIsUsed = FALSE; + gBattleStruct->snatchedMoveIsUsed = FALSE; gBattleStruct->enduredDamage = 0; gBattleStruct->additionalEffectsCounter = 0; gBattleStruct->poisonPuppeteerConfusion = FALSE; @@ -11537,7 +11539,7 @@ static void Cmd_stockpiletohpheal(void) const u8 *failInstr = cmd->failInstr; - if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) + if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0 && !gBattleStruct->snatchedMoveIsUsed) { gBattlescriptCurrInstr = failInstr; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FAILED; @@ -11553,14 +11555,22 @@ static void Cmd_stockpiletohpheal(void) } else { - gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / (1 << (3 - gDisableStructs[gBattlerAttacker].stockpileCounter)); + if (gDisableStructs[gBattlerAttacker].stockpileCounter > 0) + { + gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / (1 << (3 - gDisableStructs[gBattlerAttacker].stockpileCounter)); + gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; + gBattleStruct->moveEffect2 = MOVE_EFFECT_STOCKPILE_WORE_OFF; + } + else // Snatched move + { + gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4; + gBattleScripting.animTurn = 1; + } if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; - - gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; - gBattleStruct->moveEffect2 = MOVE_EFFECT_STOCKPILE_WORE_OFF; + gBattlescriptCurrInstr = cmd->nextInstr; gBattlerTarget = gBattlerAttacker; } @@ -17122,30 +17132,18 @@ void BS_TryQuash(void) // If the above condition is not true, it means we are faster than the foe, so we can set the quash bit gProtectStructs[gBattlerTarget].quash = TRUE; - - if (B_QUASH_TURN_ORDER < GEN_8) + + // this implementation assumes turn order is correct when using Quash + i = GetBattlerTurnOrderNum(gBattlerTarget); + for (j = i + 1; j < gBattlersCount; j++) { // Gen 7- config makes target go last so that the order of quash targets is kept for the correct turn order - j = GetBattlerTurnOrderNum(gBattlerTarget); - for (i = j + 1; i < gBattlersCount; i++) - { + // Gen 8+ config alters Turn Order of the target according to speed, dynamic speed should handle the rest + if (B_QUASH_TURN_ORDER < GEN_8 || GetWhichBattlerFaster(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE) == -1) SwapTurnOrder(i, j); - j++; - } - } - else - { - // Gen 8+ config only alters Turn Order of battlers affected by Quash, dynamic speed should handle the rest - for (i = gCurrentTurnActionNumber + 1; i < gBattlersCount - 1; i++) - { - for (j = i + 1; j < gBattlersCount; j++) - { - u32 battler1 = gBattlerByTurnOrder[i], battler2 = gBattlerByTurnOrder[j]; - if ((gProtectStructs[battler1].quash || gProtectStructs[battler2].quash) - && GetWhichBattlerFaster(battler1, battler2, FALSE) == -1) - SwapTurnOrder(i, j); - } - } + else + break; + i++; } gBattlescriptCurrInstr = cmd->nextInstr; } diff --git a/src/battle_util.c b/src/battle_util.c index 612965fff2..86e846d09c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4368,13 +4368,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (gSpecialStatuses[battler].switchInAbilityDone) break; - if (gBattleResources->flags->flags[battler] & RESOURCE_FLAG_TRACED) - break; side = (BATTLE_OPPOSITE(GetBattlerPosition(battler))) & BIT_SIDE; target1 = GetBattlerAtPosition(side); target2 = GetBattlerAtPosition(side + BIT_FLANK); - gSpecialStatuses[battler].switchInAbilityDone = TRUE; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { if (!gAbilitiesInfo[gBattleMons[target1].ability].cantBeTraced && gBattleMons[target1].hp != 0 @@ -4393,11 +4390,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 if (effect != 0) { - BattleScriptPushCursorAndCallback(BattleScript_TraceActivatesEnd3); - gBattleResources->flags->flags[battler] &= ~RESOURCE_FLAG_TRACED; + BattleScriptPushCursorAndCallback(BattleScript_TraceActivates); gBattleStruct->tracedAbility[battler] = gLastUsedAbility = gBattleMons[chosenTarget].ability; RecordAbilityBattle(chosenTarget, gLastUsedAbility); // Record the opposing battler has this ability - battler = gBattlerAbility = gBattleScripting.battler = battler; + gBattlerAbility = battler; PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, chosenTarget, gBattlerPartyIndexes[chosenTarget]) PREPARE_ABILITY_BUFFER(gBattleTextBuff2, gLastUsedAbility) @@ -5214,7 +5210,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 break; case ABILITY_GOOD_AS_GOLD: if (IS_MOVE_STATUS(gCurrentMove) - && !(moveTarget & MOVE_TARGET_USER) && !(moveTarget & MOVE_TARGET_OPPONENTS_FIELD) && !(moveTarget & MOVE_TARGET_ALL_BATTLERS)) effect = 3; @@ -6388,14 +6383,14 @@ bool32 TryPrimalReversion(u32 battler) { if (gBattlerAttacker == battler) { - BattleScriptExecute(BattleScript_PrimalReversion); + BattleScriptPushCursorAndCallback(BattleScript_PrimalReversion); } else { // edge case for scenarios like a switch-in after activated eject button gBattleScripting.savedBattler = gBattlerAttacker; gBattlerAttacker = battler; - BattleScriptExecute(BattleScript_PrimalReversionRestoreAttacker); + BattleScriptPushCursorAndCallback(BattleScript_PrimalReversionRestoreAttacker); } return TRUE; } @@ -8706,7 +8701,7 @@ u32 CountBattlerStatIncreases(u32 battler, bool32 countEvasionAcc) u32 GetMoveTargetCount(u32 move, u32 battlerAtk, u32 battlerDef) { - switch (GetBattlerMoveTargetType(gBattlerAttacker, move)) + switch (GetBattlerMoveTargetType(battlerAtk, move)) { case MOVE_TARGET_BOTH: return !(gAbsentBattlerFlags & gBitTable[battlerDef]) @@ -11816,19 +11811,19 @@ bool32 CanTargetPartner(u32 battlerAtk, u32 battlerDef) && battlerDef != BATTLE_PARTNER(battlerAtk)); } -static inline bool32 DoesCurrentTargetHaveAbilityImmunity(void) +static inline bool32 DoesBattlerHaveAbilityImmunity(u32 battlerDef) { - return (AbilityBattleEffects(ABILITYEFFECT_WOULD_BLOCK, gBattlerTarget, 0, 0, 0) - || AbilityBattleEffects(ABILITYEFFECT_WOULD_ABSORB, gBattlerTarget, 0, 0, 0)); + return (AbilityBattleEffects(ABILITYEFFECT_WOULD_BLOCK, battlerDef, 0, 0, 0) + || AbilityBattleEffects(ABILITYEFFECT_WOULD_ABSORB, battlerDef, 0, 0, 0)); } -bool32 TargetFullyImmuneToCurrMove(u32 BattlerAtk, u32 battlerDef) +bool32 TargetFullyImmuneToCurrMove(u32 battlerAtk, u32 battlerDef) { u32 moveType = 0; GET_MOVE_TYPE(gCurrentMove, moveType); - return ((CalcTypeEffectivenessMultiplier(gCurrentMove, moveType, BattlerAtk, battlerDef, GetBattlerAbility(battlerDef), FALSE) == UQ_4_12(0.0)) - || IsBattlerProtected(BattlerAtk, battlerDef, gCurrentMove) + return ((CalcTypeEffectivenessMultiplier(gCurrentMove, moveType, battlerAtk, battlerDef, GetBattlerAbility(battlerDef), FALSE) == UQ_4_12(0.0)) + || IsBattlerProtected(battlerAtk, battlerDef, gCurrentMove) || IsSemiInvulnerable(battlerDef, gCurrentMove) - || DoesCurrentTargetHaveAbilityImmunity()); + || DoesBattlerHaveAbilityImmunity(battlerDef)); } diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c index b39fa291c8..2132530958 100644 --- a/test/battle/ability/dancer.c +++ b/test/battle/ability/dancer.c @@ -146,6 +146,85 @@ SINGLE_BATTLE_TEST("Dancer-called attacks have their type updated") } } +DOUBLE_BATTLE_TEST("Dancer doesn't trigger on a snatched move") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_SNATCH].effect == EFFECT_SNATCH); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ORICORIO); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_SNATCH); MOVE(playerRight, MOVE_DRAGON_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SNATCH, opponentRight); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight); + NONE_OF { + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + } + } +} + +DOUBLE_BATTLE_TEST("Dancer triggers on Instructed dance moves") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].instructBanned == FALSE); + ASSUME(gMovesInfo[MOVE_INSTRUCT].effect == EFFECT_INSTRUCT); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ORICORIO); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_DRAGON_DANCE); MOVE(playerLeft, MOVE_INSTRUCT, target: playerRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_INSTRUCT, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + } +} + +DOUBLE_BATTLE_TEST("Dancer-called move doesn't update move to be Instructed") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DANCE].danceMove == TRUE); + ASSUME(gMovesInfo[MOVE_TACKLE].instructBanned == FALSE); + ASSUME(gMovesInfo[MOVE_INSTRUCT].effect == EFFECT_INSTRUCT); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ORICORIO); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); MOVE(playerRight, MOVE_DRAGON_DANCE); MOVE(opponentRight, MOVE_INSTRUCT, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_INSTRUCT, opponentRight); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DANCE, opponentLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + } +} + DOUBLE_BATTLE_TEST("Dancer doesn't call a move that didn't execute due to Powder") { GIVEN { diff --git a/test/battle/ability/trace.c b/test/battle/ability/trace.c index acc49bcf13..3042f8e22b 100644 --- a/test/battle/ability/trace.c +++ b/test/battle/ability/trace.c @@ -80,6 +80,21 @@ SINGLE_BATTLE_TEST("Trace will copy an opponent's ability whenever it has the ch } } + +SINGLE_BATTLE_TEST("Trace copies opponent's Intimidate and triggers it immediately") +{ + GIVEN { + PLAYER(SPECIES_RALTS) { Ability(ABILITY_TRACE); } + OPPONENT(SPECIES_MASQUERAIN) { Ability(ABILITY_INTIMIDATE); } + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(player, ABILITY_TRACE); + ABILITY_POPUP(player, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + } +} + DOUBLE_BATTLE_TEST("Trace respects the turn order") { GIVEN { diff --git a/test/battle/form_change/primal_reversion.c b/test/battle/form_change/primal_reversion.c index 2f2f406827..df19a1d0d6 100644 --- a/test/battle/form_change/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -234,3 +234,101 @@ SINGLE_BATTLE_TEST("Primal reversion happens immediately if it was brought in by EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); } } + + +DOUBLE_BATTLE_TEST("Primal reversion triggers for multiple battlers if multiple fainted the previous turn") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_CATERPIE) { HP(1); } + PLAYER(SPECIES_RESHIRAM); + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_EARTHQUAKE); + SEND_OUT(opponentRight, 3); + SEND_OUT(opponentLeft, 2); + SEND_OUT(playerRight, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EARTHQUAKE, playerLeft); + ABILITY_POPUP(opponentLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(opponentRight, ABILITY_DESOLATE_LAND); + } +} + +DOUBLE_BATTLE_TEST("Primal reversion triggers for all battlers if multiple fainted the previous turn") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_CATERPIE) { HP(1); } + PLAYER(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_EXPLOSION); + SEND_OUT(opponentRight, 3); + SEND_OUT(opponentLeft, 2); + SEND_OUT(playerRight, 3); + SEND_OUT(playerLeft, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft); + ABILITY_POPUP(playerLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(playerRight, ABILITY_DESOLATE_LAND); + ABILITY_POPUP(opponentLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(opponentRight, ABILITY_DESOLATE_LAND); + } +} + +DOUBLE_BATTLE_TEST("Primal reversion and other switch-in effects trigger for all battlers if multiple fainted the previous turn") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_EXPLOSION].effect == EFFECT_EXPLOSION); + ASSUME(gMovesInfo[MOVE_EXPLOSION].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(gMovesInfo[MOVE_STICKY_WEB].effect == EFFECT_STICKY_WEB); + ASSUME(gMovesInfo[MOVE_SPIKES].effect == EFFECT_SPIKES); + ASSUME(gMovesInfo[MOVE_TOXIC_SPIKES].effect == EFFECT_TOXIC_SPIKES); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_CATERPIE) { HP(1); } + PLAYER(SPECIES_SCRAFTY) { Ability(ABILITY_INTIMIDATE); } + PLAYER(SPECIES_RESHIRAM); + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_CATERPIE) { HP(1); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); } + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_STICKY_WEB); + MOVE(opponentLeft, MOVE_SPIKES); + MOVE(playerRight, MOVE_TOXIC_SPIKES); } + TURN { MOVE(playerLeft, MOVE_EXPLOSION); + SEND_OUT(opponentRight, 3); + SEND_OUT(opponentLeft, 2); + SEND_OUT(playerRight, 3); + SEND_OUT(playerLeft, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STICKY_WEB, playerLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIKES, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC_SPIKES, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_EXPLOSION, playerLeft); + ABILITY_POPUP(playerLeft, ABILITY_INTIMIDATE); + ABILITY_POPUP(playerRight, ABILITY_TURBOBLAZE); + ABILITY_POPUP(opponentLeft, ABILITY_PRIMORDIAL_SEA); + ABILITY_POPUP(opponentRight, ABILITY_DESOLATE_LAND); + } THEN { + EXPECT_NE(playerLeft->hp, playerLeft->maxHP); + EXPECT_NE(playerRight->hp, playerRight->maxHP); + EXPECT_EQ(opponentLeft->status1, STATUS1_POISON); + EXPECT_EQ(opponentRight->status1, STATUS1_POISON); + EXPECT_EQ(opponentLeft->statStages[STAT_ATK], DEFAULT_STAT_STAGE - 1); + EXPECT_EQ(opponentRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE - 1); + EXPECT_EQ(opponentLeft->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); + EXPECT_EQ(opponentRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); + } +} diff --git a/test/battle/move_effect/dragon_darts.c b/test/battle/move_effect/dragon_darts.c index 8190f0f4bd..08913d6011 100644 --- a/test/battle/move_effect/dragon_darts.c +++ b/test/battle/move_effect/dragon_darts.c @@ -94,6 +94,83 @@ DOUBLE_BATTLE_TEST("Dragon Darts strikes the left ally twice if the target is a } } +DOUBLE_BATTLE_TEST("Dragon Darts strikes left ally twice if electrified and right ally has Volt Absorb") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + MESSAGE("Hit 2 time(s)!"); + } +} + +DOUBLE_BATTLE_TEST("Dragon Darts strikes right ally twice if electrified and left ally has Volt Absorb") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + MESSAGE("Hit 2 time(s)!"); + } +} + +DOUBLE_BATTLE_TEST("Dragon Darts strikes left ally twice if electrified and right ally has Motor Drive") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_ELECTIVIRE) { Ability(ABILITY_MOTOR_DRIVE); }; + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentLeft); + MESSAGE("Hit 2 time(s)!"); + } +} + +DOUBLE_BATTLE_TEST("Dragon Darts strikes right ally twice if electrified and left ally has Motor Drive") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_ELECTIVIRE) { Ability(ABILITY_MOTOR_DRIVE); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_ELECTRIFY, target: playerLeft); MOVE(playerLeft, MOVE_DRAGON_DARTS, target: opponentRight); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, playerLeft); + HP_BAR(opponentRight); + MESSAGE("Hit 2 time(s)!"); + } +} + + DOUBLE_BATTLE_TEST("Dragon Darts strikes the ally twice if the target is in a semi-invulnerable turn") { GIVEN { From c1dffc694e29e2a104a5b97312b367a8514aa7f8 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Fri, 27 Sep 2024 16:40:49 -0500 Subject: [PATCH 123/133] Merge level_caps and ev_caps into one caps file (#5429) * Merge level_caps and ev_caps into one caps file * Update caps.h --- include/{level_caps.h => caps.h} | 11 +++++-- include/config/{level_caps.h => caps.h} | 22 ++++++++++--- include/config/ev_caps.h | 16 ---------- include/constants/global.h | 3 +- include/ev_caps.h | 10 ------ src/battle_controller_player.c | 2 +- src/battle_interface.c | 2 +- src/battle_script_commands.c | 2 +- src/{level_caps.c => caps.c} | 38 ++++++++++++++++++++++- src/daycare.c | 2 +- src/ev_caps.c | 41 ------------------------- src/party_menu.c | 2 +- src/pokemon.c | 11 +++---- 13 files changed, 73 insertions(+), 89 deletions(-) rename include/{level_caps.h => caps.h} (68%) rename include/config/{level_caps.h => caps.h} (55%) delete mode 100644 include/config/ev_caps.h delete mode 100644 include/ev_caps.h rename src/{level_caps.c => caps.c} (69%) delete mode 100644 src/ev_caps.c diff --git a/include/level_caps.h b/include/caps.h similarity index 68% rename from include/level_caps.h rename to include/caps.h index c455408079..f6dd61b632 100644 --- a/include/level_caps.h +++ b/include/caps.h @@ -1,5 +1,5 @@ -#ifndef GUARD_LEVEL_CAP_H -#define GUARD_LEVEL_CAP_H +#ifndef GUARD_CAPS_H +#define GUARD_CAPS_H #if B_EXP_CAP_TYPE != EXP_CAP_NONE && B_EXP_CAP_TYPE != EXP_CAP_HARD && B_EXP_CAP_TYPE != EXP_CAP_SOFT #error "Invalid choice for B_EXP_CAP_TYPE, must be of [EXP_CAP_NONE, EXP_CAP_HARD, EXP_CAP_SOFT]" @@ -14,7 +14,12 @@ #endif #endif +#if B_EV_CAP_TYPE != EV_CAP_NONE && B_EV_CAP_TYPE != EV_CAP_FLAG_LIST && B_EV_CAP_TYPE != EV_CAP_VARIABLE && B_EV_CAP_TYPE != EV_CAP_NO_GAIN +#error "Invalid choice for B_EV_CAP_TYPE, must be one of [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN]" +#endif + u32 GetCurrentLevelCap(void); u32 GetSoftLevelCapExpValue(u32 level, u32 expValue); +u32 GetCurrentEVCap(void); -#endif /* GUARD_LEVEL_CAP_H */ +#endif /* GUARD_CAPS_H */ diff --git a/include/config/level_caps.h b/include/config/caps.h similarity index 55% rename from include/config/level_caps.h rename to include/config/caps.h index e8d7b8818e..2debe442cf 100644 --- a/include/config/level_caps.h +++ b/include/config/caps.h @@ -1,7 +1,7 @@ -#ifndef GUARD_CONFIG_LEVEL_CAP_H -#define GUARD_CONFIG_LEVEL_CAP_H +#ifndef GUARD_CONFIG_CAPS_H +#define GUARD_CONFIG_CAPS_H -// Constants +// Level Cap Constants #define EXP_CAP_NONE 0 // Regular behavior, no level caps are applied #define EXP_CAP_HARD 1 // Pokémon with a level >= the level cap cannot gain any experience #define EXP_CAP_SOFT 2 // Pokémon with a level >= the level cap will gain reduced experience @@ -10,7 +10,7 @@ #define LEVEL_CAP_FLAG_LIST 1 // Level cap is chosen according to the first unset flag in `sLevelCapFlagMap` #define LEVEL_CAP_VARIABLE 2 // Level cap is chosen according to the contents of the event variable specified by B_LEVEL_CAP_VARIABLE -// Configs +// Level Cap Configs #define B_EXP_CAP_TYPE EXP_CAP_NONE // [EXP_CAP_NONE, EXP_CAP_HARD, EXP_CAP_SOFT] choose the type of level cap to apply #define B_LEVEL_CAP_TYPE LEVEL_CAP_NONE // [LEVEL_CAP_NONE, LEVEL_CAP_FLAG_LIST, LEVEL_CAP_VARIABLE] choose the method to derive the level cap #define B_LEVEL_CAP_VARIABLE 0 // event variable used to derive level cap if B_LEVEL_CAP_TYPE is set to LEVEL_CAP_VARIABLE @@ -18,4 +18,16 @@ #define B_RARE_CANDY_CAP FALSE // If set to true, Rare Candies can't be used to go over the level cap #define B_LEVEL_CAP_EXP_UP FALSE // If set to true, mons under level cap will receive more experience -#endif /* GUARD_CONFIG_LEVEL_CAP_H */ +// EV Cap Constants +#define EV_CAP_NONE 0 // Regular behavior, no EV caps are applied +#define EV_CAP_FLAG_LIST 1 // EV cap is chosen according to the first unset flag in `sEVCapFlagMap` +#define EV_CAP_VARIABLE 2 // EV cap is chosen according to the contents of the event variable specified by B_EV_CAP_VARIABLE +#define EV_CAP_NO_GAIN 3 // No EVs can be gained + +// EV Cap Configs +#define B_EV_CAP_TYPE EV_CAP_NONE // [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN] choose the type of EV cap to apply#define B_EV_CAP_VARIABLE 12 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE +#define B_EV_CAP_VARIABLE 8 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE + +#define B_EV_ITEMS_CAP FALSE // If set to true, EV-boosting items can't be used to go over the EV cap + +#endif /* GUARD_CONFIG_CAPS_H */ diff --git a/include/config/ev_caps.h b/include/config/ev_caps.h deleted file mode 100644 index 0513ff086e..0000000000 --- a/include/config/ev_caps.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef GUARD_CONFIG_EV_CAP_H -#define GUARD_CONFIG_EV_CAP_H - -// Constants for EV Cap Types -#define EV_CAP_NONE 0 // Regular behavior, no EV caps are applied -#define EV_CAP_FLAG_LIST 1 // EV cap is chosen according to the first unset flag in `sEVCapFlagMap` -#define EV_CAP_VARIABLE 2 // EV cap is chosen according to the contents of the event variable specified by B_EV_CAP_VARIABLE -#define EV_CAP_NO_GAIN 3 // No EVs can be gained - -// Configs for EV Cap -#define B_EV_CAP_TYPE EV_CAP_NONE // [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN] choose the type of EV cap to apply#define B_EV_CAP_VARIABLE 12 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE -#define B_EV_CAP_VARIABLE 8 // event variable used to derive EV cap if B_EV_CAP_TYPE is set to EV_CAP_VARIABLE - -#define B_EV_ITEMS_CAP FALSE // If set to true, EV-boosting items can't be used to go over the EV cap - -#endif /*GUARD_CONFIG_EV_CAP_H*/ diff --git a/include/constants/global.h b/include/constants/global.h index a4623c9d8b..89508e374d 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -5,10 +5,9 @@ #include "config/battle.h" #include "config/debug.h" #include "config/item.h" -#include "config/level_caps.h" +#include "config/caps.h" #include "config/pokemon.h" #include "config/overworld.h" -#include "config/ev_caps.h" // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. diff --git a/include/ev_caps.h b/include/ev_caps.h deleted file mode 100644 index 2b2dd0b02b..0000000000 --- a/include/ev_caps.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GUARD_EV_CAP_H -#define GUARD_EV_CAP_H - -#if B_EV_CAP_TYPE != EV_CAP_NONE && B_EV_CAP_TYPE != EV_CAP_FLAG_LIST && B_EV_CAP_TYPE != EV_CAP_VARIABLE && B_EV_CAP_TYPE != EV_CAP_NO_GAIN -#error "Invalid choice for B_EV_CAP_TYPE, must be one of [EV_CAP_NONE, EV_CAP_FLAG_LIST, EV_CAP_VARIABLE, EV_CAP_NO_GAIN]" -#endif - -u32 GetCurrentEVCap(void); - -#endif /* GUARD_EV_CAP_H */ diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index afff143266..cc5454ad54 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -41,7 +41,7 @@ #include "constants/songs.h" #include "constants/trainers.h" #include "constants/rgb.h" -#include "level_caps.h" +#include "caps.h" #include "menu.h" #include "pokemon_summary_screen.h" #include "type_icons.h" diff --git a/src/battle_interface.c b/src/battle_interface.c index 4c17322b53..5c514a0d80 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -33,7 +33,7 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/items.h" -#include "level_caps.h" +#include "caps.h" enum { // Corresponds to gHealthboxElementsGfxTable (and the tables after it) in graphics.c diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 283f42a23b..8bbe5ba89f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -27,7 +27,7 @@ #include "bg.h" #include "string_util.h" #include "pokemon_icon.h" -#include "level_caps.h" +#include "caps.h" #include "m4a.h" #include "mail.h" #include "event_data.h" diff --git a/src/level_caps.c b/src/caps.c similarity index 69% rename from src/level_caps.c rename to src/caps.c index 61b4c8dc8f..9c30e55527 100644 --- a/src/level_caps.c +++ b/src/caps.c @@ -1,7 +1,7 @@ #include "global.h" #include "battle.h" #include "event_data.h" -#include "level_caps.h" +#include "caps.h" #include "pokemon.h" @@ -81,3 +81,39 @@ u32 GetSoftLevelCapExpValue(u32 level, u32 expValue) return expValue; } } + +u32 GetCurrentEVCap(void) +{ + + static const u16 sEvCapFlagMap[][2] = { + // Define EV caps for each milestone + {FLAG_BADGE01_GET, 30}, + {FLAG_BADGE02_GET, 90}, + {FLAG_BADGE03_GET, 150}, + {FLAG_BADGE04_GET, 210}, + {FLAG_BADGE05_GET, 270}, + {FLAG_BADGE06_GET, 330}, + {FLAG_BADGE07_GET, 390}, + {FLAG_BADGE08_GET, 450}, + {FLAG_IS_CHAMPION, MAX_TOTAL_EVS}, + }; + + if (B_EV_CAP_TYPE == EV_CAP_FLAG_LIST) + { + for (u32 evCap = 0; evCap < ARRAY_COUNT(sEvCapFlagMap); evCap++) + { + if (!FlagGet(sEvCapFlagMap[evCap][0])) + return sEvCapFlagMap[evCap][1]; + } + } + else if (B_EV_CAP_TYPE == EV_CAP_VARIABLE) + { + return VarGet(B_EV_CAP_VARIABLE); + } + else if (B_EV_CAP_TYPE == EV_CAP_NO_GAIN) + { + return 0; + } + + return MAX_TOTAL_EVS; +} diff --git a/src/daycare.c b/src/daycare.c index e13f993c3f..7a31f15b27 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -3,7 +3,7 @@ #include "battle.h" #include "daycare.h" #include "string_util.h" -#include "level_caps.h" +#include "caps.h" #include "mail.h" #include "pokemon_storage_system.h" #include "event_data.h" diff --git a/src/ev_caps.c b/src/ev_caps.c deleted file mode 100644 index 8eb3531ca4..0000000000 --- a/src/ev_caps.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "global.h" -#include "battle.h" -#include "event_data.h" -#include "ev_caps.h" -#include "pokemon.h" - -u32 GetCurrentEVCap(void) -{ - - static const u16 sEvCapFlagMap[][2] = { - // Define EV caps for each milestone - {FLAG_BADGE01_GET, 30}, - {FLAG_BADGE02_GET, 90}, - {FLAG_BADGE03_GET, 150}, - {FLAG_BADGE04_GET, 210}, - {FLAG_BADGE05_GET, 270}, - {FLAG_BADGE06_GET, 330}, - {FLAG_BADGE07_GET, 390}, - {FLAG_BADGE08_GET, 450}, - {FLAG_IS_CHAMPION, MAX_TOTAL_EVS}, - }; - - if (B_EV_CAP_TYPE == EV_CAP_FLAG_LIST) - { - for (u32 evCap = 0; evCap < ARRAY_COUNT(sEvCapFlagMap); evCap++) - { - if (!FlagGet(sEvCapFlagMap[evCap][0])) - return sEvCapFlagMap[evCap][1]; - } - } - else if (B_EV_CAP_TYPE == EV_CAP_VARIABLE) - { - return VarGet(B_EV_CAP_VARIABLE); - } - else if (B_EV_CAP_TYPE == EV_CAP_NO_GAIN) - { - return 0; - } - - return MAX_TOTAL_EVS; -} diff --git a/src/party_menu.c b/src/party_menu.c index 5def34b3eb..ecee16d0af 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -32,7 +32,7 @@ #include "item.h" #include "item_menu.h" #include "item_use.h" -#include "level_caps.h" +#include "caps.h" #include "link.h" #include "link_rfu.h" #include "mail.h" diff --git a/src/pokemon.c b/src/pokemon.c index faa1a65aef..43199c8538 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -19,7 +19,7 @@ #include "field_weather.h" #include "graphics.h" #include "item.h" -#include "level_caps.h" +#include "caps.h" #include "link.h" #include "main.h" #include "overworld.h" @@ -60,7 +60,6 @@ #include "constants/union_room.h" #include "constants/weather.h" #include "wild_encounter.h" -#include "ev_caps.h" #define FRIENDSHIP_EVO_THRESHOLD ((P_FRIENDSHIP_EVO_THRESHOLD >= GEN_9) ? 160 : 220) @@ -3879,11 +3878,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov // Ensure the increase does not exceed the max EV per stat (252) evCap = (itemEffect[10] & ITEM10_IS_VITAMIN) ? EV_ITEM_RAISE_LIMIT : MAX_PER_STAT_EVS; - + // Check if the per-stat limit is reached if (dataSigned >= evCap) return TRUE; // Prevents item use if the per-stat cap is already reached - + if (dataSigned + evChange > evCap) temp2 = evCap - dataSigned; else @@ -4068,11 +4067,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov // Ensure the increase does not exceed the max EV per stat (252) evCap = (itemEffect[10] & ITEM10_IS_VITAMIN) ? EV_ITEM_RAISE_LIMIT : MAX_PER_STAT_EVS; - + // Check if the per-stat limit is reached if (dataSigned >= evCap) return TRUE; // Prevents item use if the per-stat cap is already reached - + if (dataSigned + evChange > evCap) temp2 = evCap - dataSigned; else From cf2f85bdd71588b0c6fc25b299295b3c87edfd64 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Fri, 27 Sep 2024 17:08:24 -0700 Subject: [PATCH 124/133] Fixed identation per https://github.com/rh-hideout/pokeemerald-expansion/pull/5278\#discussion_r1779192846 https://github.com/rh-hideout/pokeemerald-expansion/pull/5278#discussion_r1779195689 https://github.com/rh-hideout/pokeemerald-expansion/pull/5278#discussion_r1779196484 --- src/field_screen_effect.c | 148 +++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index 0839dc6bb2..cd1dfdf032 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1316,21 +1316,21 @@ static bool32 PrintWhiteOutRecoveryMessage(u8 taskId, const u8 *text, u32 x, u32 switch (gTasks[taskId].tPrintState) { - case 0: - FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); - StringExpandPlaceholders(gStringVar4, text); - AddTextPrinterParameterized4(windowId, FONT_NORMAL, x, y, 1, 0, sWhiteoutTextColors, 1, gStringVar4); - gTextFlags.canABSpeedUpPrint = FALSE; - gTasks[taskId].tPrintState = 1; - break; - case 1: - RunTextPrinters(); - if (!IsTextPrinterActive(windowId)) - { - gTasks[taskId].tPrintState = 0; - return TRUE; - } - break; + case 0: + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); + StringExpandPlaceholders(gStringVar4, text); + AddTextPrinterParameterized4(windowId, FONT_NORMAL, x, y, 1, 0, sWhiteoutTextColors, 1, gStringVar4); + gTextFlags.canABSpeedUpPrint = FALSE; + gTasks[taskId].tPrintState = 1; + break; + case 1: + RunTextPrinters(); + if (!IsTextPrinterActive(windowId)) + { + gTasks[taskId].tPrintState = 0; + return TRUE; + } + break; } return FALSE; } @@ -1489,25 +1489,25 @@ static void Task_ExitStairs(u8 taskId) s16 * data = gTasks[taskId].data; switch (tState) { - default: - if (WaitForWeatherFadeIn() == TRUE) - { - CameraObjectReset(); - UnlockPlayerFieldControls(); - DestroyTask(taskId); - } - break; - case 0: - Overworld_PlaySpecialMapMusic(); - WarpFadeInScreen(); - LockPlayerFieldControls(); - ExitStairsMovement(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + default: + if (WaitForWeatherFadeIn() == TRUE) + { + CameraObjectReset(); + UnlockPlayerFieldControls(); + DestroyTask(taskId); + } + break; + case 0: + Overworld_PlaySpecialMapMusic(); + WarpFadeInScreen(); + LockPlayerFieldControls(); + ExitStairsMovement(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + tState++; + break; + case 1: + if (!WaitStairExitMovementFinished(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer)) tState++; - break; - case 1: - if (!WaitStairExitMovementFinished(&tSpeedX, &tSpeedY, &tOffsetX, &tOffsetY, &tTimer)) - tState++; - break; + break; } } @@ -1554,48 +1554,48 @@ static void Task_StairWarp(u8 taskId) switch (tState) { - case 0: - LockPlayerFieldControls(); - FreezeObjectEvents(); - CameraObjectFreeze(); + case 0: + LockPlayerFieldControls(); + FreezeObjectEvents(); + CameraObjectFreeze(); + tState++; + break; + case 1: + if (!ObjectEventIsMovementOverridden(playerObjectEvent) || ObjectEventClearHeldMovementIfFinished(playerObjectEvent)) + { + if (tDelay != 0) + tDelay--; + else + { + TryFadeOutOldMapMusic(); + PlayRainStoppingSoundEffect(); + playerSprite->oam.priority = 1; + ForceStairsMovement(tMetatileBehavior, &tSpeedX, &tSpeedY); + PlaySE(SE_EXIT); + tState++; + } + } + break; + case 2: + UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + tDelay++; + if (tDelay >= 12) + { + WarpFadeOutScreen(); tState++; - break; - case 1: - if (!ObjectEventIsMovementOverridden(playerObjectEvent) || ObjectEventClearHeldMovementIfFinished(playerObjectEvent)) - { - if (tDelay != 0) - tDelay--; - else - { - TryFadeOutOldMapMusic(); - PlayRainStoppingSoundEffect(); - playerSprite->oam.priority = 1; - ForceStairsMovement(tMetatileBehavior, &tSpeedX, &tSpeedY); - PlaySE(SE_EXIT); - tState++; - } - } - break; - case 2: - UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); - tDelay++; - if (tDelay >= 12) - { - WarpFadeOutScreen(); - tState++; - } - break; - case 3: - UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); - if (!PaletteFadeActive() && BGMusicStopped()) - tState++; - break; - default: - gFieldCallback = FieldCB_DefaultWarpExit; - WarpIntoMap(); - SetMainCallback2(CB2_LoadMap); - DestroyTask(taskId); - break; + } + break; + case 3: + UpdateStairsMovement(tSpeedX, tSpeedY, &tOffsetX, &tOffsetY, &tTimer); + if (!PaletteFadeActive() && BGMusicStopped()) + tState++; + break; + default: + gFieldCallback = FieldCB_DefaultWarpExit; + WarpIntoMap(); + SetMainCallback2(CB2_LoadMap); + DestroyTask(taskId); + break; } } From 796a5985497985d54ae9720f81e6907c51677f73 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Fri, 27 Sep 2024 17:10:38 -0700 Subject: [PATCH 125/133] Combined lines per https://github.com/rh-hideout/pokeemerald-expansion/pull/5278\#discussion_r1779193552 --- src/field_screen_effect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index cd1dfdf032..bb49519820 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1432,8 +1432,7 @@ static void GetStairsMovementDirection(u32 metatileBehavior, s16 *speedX, s16 *s static bool8 WaitStairExitMovementFinished(s16 *speedX, s16 *speedY, s16 *offsetX, s16 *offsetY, s16 *timer) { - struct Sprite *sprite; - sprite = &gSprites[gPlayerAvatar.spriteId]; + struct Sprite *sprite = &gSprites[gPlayerAvatar.spriteId]; if (*timer != 0) { *offsetX += *speedX; From eb1469af1dfd0c0c83aab862a6322bd44256d17e Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Fri, 27 Sep 2024 17:15:05 -0700 Subject: [PATCH 126/133] added curly braces per https://github.com/rh-hideout/pokeemerald-expansion/pull/5278\#discussion_r1779196726 --- src/field_screen_effect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index bb49519820..cd7f51b3da 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1563,7 +1563,9 @@ static void Task_StairWarp(u8 taskId) if (!ObjectEventIsMovementOverridden(playerObjectEvent) || ObjectEventClearHeldMovementIfFinished(playerObjectEvent)) { if (tDelay != 0) + { tDelay--; + } else { TryFadeOutOldMapMusic(); From 874d4d047002a7651a4767e145c8b71a98996a84 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Fri, 27 Sep 2024 17:19:58 -0700 Subject: [PATCH 127/133] Removed switch case per https://github.com/rh-hideout/pokeemerald-expansion/pull/5278\#discussion_r1779197182 --- src/field_screen_effect.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index cd7f51b3da..073c92f3e0 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1618,20 +1618,19 @@ void DoStairWarp(u16 metatileBehavior, u16 delay) bool32 IsDirectionalStairWarpMetatileBehavior(u16 metatileBehavior, u8 playerDirection) { - switch (playerDirection) + if (playerDirection == DIR_WEST) { - case DIR_WEST: - if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) - return TRUE; - if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) - return TRUE; - break; - case DIR_EAST: - if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) - return TRUE; - if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) - return TRUE; - break; + if (MetatileBehavior_IsDirectionalUpLeftStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownLeftStairWarp(metatileBehavior)) + return TRUE; + } + else if (playerDirection == DIR_EAST) + { + if (MetatileBehavior_IsDirectionalUpRightStairWarp(metatileBehavior)) + return TRUE; + if (MetatileBehavior_IsDirectionalDownRightStairWarp(metatileBehavior)) + return TRUE; } return FALSE; } From 1956376e0e633c3cadbafae746f985fee16dfe33 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sat, 28 Sep 2024 07:46:52 +0200 Subject: [PATCH 128/133] Use move effect for some moves instead of ids (#5433) --- src/battle_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index c7f6eeafda..d492919850 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5184,15 +5184,15 @@ static bool32 TryDoMoveEffectsBeforeMoves(void) { gBattleStruct->focusPunchBattlers |= 1u << battlers[i]; gBattlerAttacker = battlers[i]; - switch (gChosenMoveByBattler[gBattlerAttacker]) + switch (gMovesInfo[gChosenMoveByBattler[gBattlerAttacker]].effect) { - case MOVE_FOCUS_PUNCH: + case EFFECT_FOCUS_PUNCH: BattleScriptExecute(BattleScript_FocusPunchSetUp); return TRUE; - case MOVE_BEAK_BLAST: + case EFFECT_BEAK_BLAST: BattleScriptExecute(BattleScript_BeakBlastSetUp); return TRUE; - case MOVE_SHELL_TRAP: + case EFFECT_SHELL_TRAP: BattleScriptExecute(BattleScript_ShellTrapSetUp); return TRUE; } From 580b9e3b84db7a02d58d5ca722f5df5f568059b4 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sat, 28 Sep 2024 15:02:51 +0200 Subject: [PATCH 129/133] Update src/metatile_behavior.c --- src/metatile_behavior.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 9d96fc4a64..ef349be7cf 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1406,7 +1406,7 @@ bool8 MetatileBehavior_IsTrainerHillTimer(u8 metatileBehavior) bool8 MetatileBehavior_IsDirectionalUpRightStairWarp(u8 metatileBehavior) { - if(metatileBehavior == MB_UP_RIGHT_STAIR_WARP) + if (metatileBehavior == MB_UP_RIGHT_STAIR_WARP) return TRUE; else return FALSE; From 5e027754c707881f62d66adb1fc22e12ca435622 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:16:33 -0400 Subject: [PATCH 130/133] Add ShouldSwitch result to AiLogicData (#5440) * Add ShouldSwitch to AiLogicData * Convert shouldSwitch to bitfield * Update include/battle.h Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update include/battle.h --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- include/battle.h | 3 ++- src/battle_ai_main.c | 6 +++--- src/battle_ai_switch_items.c | 4 ++-- src/battle_ai_util.c | 8 +++----- src/battle_main.c | 2 ++ 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/battle.h b/include/battle.h index 3b3c42e054..f1628ddd9b 100644 --- a/include/battle.h +++ b/include/battle.h @@ -366,11 +366,12 @@ struct AiLogicData u8 effectiveness[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex u8 moveAccuracy[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex u8 moveLimitations[MAX_BATTLERS_COUNT]; - bool8 shouldSwitchMon; // Because all available moves have no/little effect. Each bit per battler. + u8 shouldSwitchIfBadMoves; // Because all available moves have no/little effect. Each bit per battler. u8 monToSwitchId[MAX_BATTLERS_COUNT]; // ID of the mon to switch. bool8 weatherHasEffect; // The same as WEATHER_HAS_EFFECT. Stored here, so it's called only once. u8 mostSuitableMonId[MAX_BATTLERS_COUNT]; // Stores result of GetMostSuitableMonToSwitchInto, which decides which generic mon the AI would switch into if they decide to switch. This can be overruled by specific mons found in ShouldSwitch; the final resulting mon is stored in AI_monToSwitchIntoId. struct SwitchinCandidate switchinCandidate; // Struct used for deciding which mon to switch to in battle_ai_switch_items.c + u8 shouldSwitch; // Stores result of ShouldSwitch, which decides whether a mon should be switched out }; struct AI_ThinkingStruct diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 8848ac2c17..acc13a7378 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -504,12 +504,12 @@ static bool32 AI_SwitchMonIfSuitable(u32 battler, bool32 doubleBattle) if (doubleBattle) { u32 partner = BATTLE_PARTNER(battler); - if (AI_DATA->shouldSwitchMon & (1u << partner) && AI_DATA->monToSwitchId[partner] == monToSwitchId) + if (AI_DATA->shouldSwitchIfBadMoves & (1u << partner) && AI_DATA->monToSwitchId[partner] == monToSwitchId) { return FALSE; } } - AI_DATA->shouldSwitchMon |= 1 << battler; + AI_DATA->shouldSwitchIfBadMoves |= 1 << battler; AI_DATA->monToSwitchId[battler] = monToSwitchId; return TRUE; } @@ -3679,7 +3679,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) } break; case EFFECT_BATON_PASS: - if (ShouldSwitch(battlerAtk, FALSE) && (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE + if ((AI_DATA->shouldSwitch & (1u << battlerAtk)) && (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE || (gStatuses3[battlerAtk] & (STATUS3_ROOTED | STATUS3_AQUA_RING | STATUS3_MAGNET_RISE | STATUS3_POWER_TRICK)) || AnyStatIsRaised(battlerAtk))) ADJUST_SCORE(BEST_EFFECT); diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index b46fe29631..3f13a8c3f4 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -218,9 +218,9 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult) static bool32 ShouldSwitchIfAllBadMoves(u32 battler, bool32 emitResult) { - if (AI_DATA->shouldSwitchMon & (1u << battler)) + if (AI_DATA->shouldSwitchIfBadMoves & (1u << battler)) { - AI_DATA->shouldSwitchMon &= ~(1u << battler); + AI_DATA->shouldSwitchIfBadMoves &= ~(1u << battler); gBattleStruct->AI_monToSwitchIntoId[battler] = AI_DATA->monToSwitchId[battler]; if (emitResult) BtlController_EmitTwoReturnValues(battler, BUFFER_B, B_ACTION_SWITCH, 0); diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 3f08ace393..14f5c44ffc 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2699,10 +2699,8 @@ enum { bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 moveIndex) { bool32 hasStatBoost = AnyUsefulStatIsRaised(battlerAtk) || gBattleMons[battlerDef].statStages[STAT_EVASION] >= 9; //Significant boost in evasion for any class - bool32 shouldSwitch; u32 battlerToSwitch; - shouldSwitch = ShouldSwitch(battlerAtk, FALSE); battlerToSwitch = gBattleStruct->AI_monToSwitchIntoId[battlerAtk]; if (PartyBattlerShouldAvoidHazards(battlerAtk, battlerToSwitch)) @@ -2727,7 +2725,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 if (CanTargetFaintAi(battlerDef, battlerAtk)) return PIVOT; // Won't get the two turns, pivot - if (!IS_MOVE_STATUS(move) && (shouldSwitch + if (!IS_MOVE_STATUS(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) || (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH || (B_STURDY >= GEN_5 && defAbility == ABILITY_STURDY) || defAbility == ABILITY_MULTISCALE @@ -2742,7 +2740,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 || defAbility == ABILITY_SHADOW_SHIELD))) return PIVOT; // pivot to break sash/sturdy/multiscale - if (shouldSwitch) + if (AI_DATA->shouldSwitch & (1u << battlerAtk)) return PIVOT; /* TODO - check if switchable mon unafffected by/will remove hazards @@ -2813,7 +2811,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 else if (CanAIFaintTarget(battlerAtk, battlerDef, 2)) { // can knock out foe in 2 hits - if (IS_MOVE_STATUS(move) && (shouldSwitch //Damaging move + if (IS_MOVE_STATUS(move) && ((AI_DATA->shouldSwitch & (1u << battlerAtk)) //Damaging move //&& (switchScore >= SWITCHING_INCREASE_RESIST_ALL_MOVES + SWITCHING_INCREASE_KO_FOE //remove hazards || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)))) return DONT_PIVOT; // Pivot to break the sash diff --git a/src/battle_main.c b/src/battle_main.c index e8c37c60b0..92e1618fc7 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4178,6 +4178,8 @@ static void HandleTurnActionSelectionState(void) if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) && (BattlerHasAi(battler) && !(gBattleTypeFlags & BATTLE_TYPE_PALACE))) { + if (ShouldSwitch(battler, FALSE)) + AI_DATA->shouldSwitch |= (1u << battler); if (AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_RISKY) // Risky AI switches aggressively even mid battle AI_DATA->mostSuitableMonId[battler] = GetMostSuitableMonToSwitchInto(battler, TRUE); else From c8afe9bbde880294095c0a31681b4c24856ee33d Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 29 Sep 2024 13:34:11 -0400 Subject: [PATCH 131/133] some formatting fixes --- include/config/overworld.h | 2 +- src/event_object_movement.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/config/overworld.h b/include/config/overworld.h index 7439ebc5ad..3298a03209 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -4,7 +4,7 @@ // Movement config #define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. #define OW_AUTO_SIGNPOST FALSE // When enabled, if the tile that the player is facing has MB_SIGNPOST, MB_POKEMART_SIGN, or MB_POKEMON_CENTER_SIGN, the player will automatically read the signpost, as seen in FRLG. -#define SLOW_MOVEMENT_ON_STAIRS FALSE // If enabled, the player will move slower up/down stairs like in FR +#define SLOW_MOVEMENT_ON_STAIRS FALSE // If enabled, the player will move slower up/down stairs like in FR // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 93bd3ba7ea..7f913cde28 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -9812,7 +9812,7 @@ static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, st gFieldEffectArguments[2] = 149; gFieldEffectArguments[3] = 2; gFieldEffectArguments[4] = - bikeTireTracks_Transitions[movementDir][objEvent->facingDirection - 5]; + bikeTireTracks_Transitions[movementDir][objEvent->facingDirection - 5]; FieldEffectStart(FLDEFF_BIKE_TIRE_TRACKS); } } From 8d331691006942b13df2759e4f1a318fe4ac13fe Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:54:03 -0400 Subject: [PATCH 132/133] Add Gen 1 Crit Chance (#5439) Adds GEN_1 config to B_CRIT_CHANGE, only affects the chance, not multiplier or other Gen 1 quirks. --- src/battle_script_commands.c | 94 +++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 8b65b76cd0..ec5d2f61a0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1948,6 +1948,79 @@ s32 CalcCritChanceStage(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordA u32 holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE); return CalcCritChanceStageArgs(battlerAtk, battlerDef, move, recordAbility, abilityAtk, abilityDef, holdEffectAtk); } + +// Bulbapedia: https://bulbapedia.bulbagarden.net/wiki/Critical_hit#Generation_I +// Crit chance = Threshold / 256, Threshold maximum of 255 +// Threshold = Base Speed / 2 +// High crit move = 8 * (Base Speed / 2) +// Focus Energy = 4 * (Base Speed / 2) +s32 CalcCritChanceStageGen1(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbility) +{ + // Vanilla + u32 focusEnergyScaler = 4; + u32 highCritRatioScaler = 8; + + // Not vanilla + u32 superLuckScaler = 4; + u32 scopeLensScaler = 4; + u32 luckyPunchScaler = 8; + u32 farfetchedLeekScaler = 8; + + s32 critChance = 0; + s32 moveCritStage = gMovesInfo[gCurrentMove].criticalHitStage; + s32 bonusCritStage = gBattleStruct->bonusCritStages[gBattlerAttacker]; // G-Max Chi Strike + u32 abilityAtk = GetBattlerAbility(gBattlerAttacker); + u32 abilityDef = GetBattlerAbility(gBattlerTarget); + u32 holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE); + u16 baseSpeed = gSpeciesInfo[gBattleMons[battlerAtk].species].baseSpeed; + + critChance = baseSpeed / 2; + + // Crit scaling + if (moveCritStage > 0) + critChance = critChance * highCritRatioScaler * moveCritStage; + + if (bonusCritStage > 0) + critChance = critChance * bonusCritStage; + + if ((gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY_ANY) != 0) + critChance = critChance * focusEnergyScaler; + + if (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS) + critChance = critChance * scopeLensScaler; + + if (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY) + critChance = critChance * luckyPunchScaler; + + if (BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk)) + critChance = critChance * farfetchedLeekScaler; + + if (abilityAtk == ABILITY_SUPER_LUCK) + critChance = critChance * superLuckScaler; + + if (critChance > 255) + critChance = 255; + + // Prevented crits + if (gSideStatuses[battlerDef] & SIDE_STATUS_LUCKY_CHANT) + critChance = -1; + else if (abilityDef == ABILITY_BATTLE_ARMOR || abilityDef == ABILITY_SHELL_ARMOR) + { + if (recordAbility) + RecordAbilityBattle(battlerDef, abilityDef); + critChance = -1; + } + + // Guaranteed crits + else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS + || gMovesInfo[move].alwaysCriticalHit == TRUE + || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) + { + critChance = -2; + } + + return critChance; +} #undef BENEFITS_FROM_LEEK s32 GetCritHitOdds(s32 critChanceIndex) @@ -1963,7 +2036,13 @@ static void Cmd_critcalc(void) CMD_ARGS(); u16 partySlot; - s32 critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); + s32 critChance; + + if (B_CRIT_CHANCE == GEN_1) + critChance = CalcCritChanceStageGen1(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); + else + critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); + gPotentialItemEffectBattler = gBattlerAttacker; if (gBattleTypeFlags & (BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FIRST_BATTLE)) @@ -1973,7 +2052,18 @@ static void Cmd_critcalc(void) else if (critChance == -2) gIsCriticalHit = TRUE; else - gIsCriticalHit = RandomChance(RNG_CRITICAL_HIT, 1, sCriticalHitOdds[critChance]); + { + if (B_CRIT_CHANCE == GEN_1) + { + u8 critRoll = RandomUniform(RNG_CRITICAL_HIT, 1, 256); + if (critRoll <= critChance) + gIsCriticalHit = 1; + else + gIsCriticalHit = 0; + } + else + gIsCriticalHit = RandomChance(RNG_CRITICAL_HIT, 1, sCriticalHitOdds[critChance]); + } // Counter for EVO_CRITICAL_HITS. partySlot = gBattlerPartyIndexes[gBattlerAttacker]; From 42c43a3f8fefcf65b9c1f60c826bbd286da63dce Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 29 Sep 2024 22:45:50 +0200 Subject: [PATCH 133/133] Adds Commander and Order Up (#5246) * Adds Commander * review points * new line * correction * regression / double targeting still broken * fix wrong target order * transform fixes * haze test * fixes, tests * bring back wrongly removed else if case * Eject Pack / Button test + fix * red card fix * test fixes * Fixes Tatsu being hit by multi hit move * change transform check * fix test + revert change * Fix Tatsugiri attacking after freed up from Dozo in the same turn * Dragon Darts tests * fix test * review comments * assumtion in wrong file * Order Up test fixes --------- Co-authored-by: hedara90 <90hedara@gmail.com> --- asm/macros/battle_script.inc | 6 +- data/battle_scripts_1.s | 52 ++- include/battle.h | 7 + include/battle_script_commands.h | 2 + include/battle_scripts.h | 2 + include/constants/battle.h | 8 +- include/constants/battle_move_effects.h | 1 + include/constants/battle_string_ids.h | 3 +- src/battle_ai_main.c | 3 + src/battle_ai_util.c | 5 + src/battle_main.c | 16 +- src/battle_message.c | 4 +- src/battle_script_commands.c | 139 ++++-- src/battle_util.c | 35 +- src/data/abilities.h | 1 + src/data/battle_move_effects.h | 6 + src/data/moves_info.h | 7 +- test/battle/ability/commander.c | 423 +++++++++++++++++++ test/battle/hold_effect/eject_button.c | 24 ++ test/battle/move_effect_secondary/order_up.c | 172 ++++++++ 20 files changed, 872 insertions(+), 44 deletions(-) create mode 100644 test/battle/ability/commander.c create mode 100644 test/battle/move_effect_secondary/order_up.c diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 5982716bc9..d45487e644 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1351,7 +1351,6 @@ .4byte \func .endm -@ callnative macros .macro savetarget callnative BS_SaveTarget .endm @@ -1727,6 +1726,11 @@ .4byte \failInstr .endm + .macro jumpifcommanderactive jumpInstr:req + callnative BS_JumpIfCommanderActive + .4byte \jumpInstr + .endm + @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 16168ca124..05eb64d15a 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3265,6 +3265,7 @@ BattleScript_EffectRoar:: attackstring ppreduce jumpifroarfails BattleScript_ButItFailed + jumpifcommanderactive BattleScript_ButItFailed jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_ButItFailed jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut jumpifstatus3 BS_TARGET, STATUS3_ROOTED, BattleScript_PrintMonIsRooted @@ -8008,11 +8009,52 @@ BattleScript_CostarActivates:: BattleScript_ZeroToHeroActivates:: pause B_WAIT_TIME_SHORT - call BattleScript_AbilityPopUp + call BattleScript_AbilityPopUpScripting printstring STRINGID_ZEROTOHEROTRANSFORMATION waitmessage B_WAIT_TIME_LONG end3 +BattleScript_CommanderActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUpScripting + printstring STRINGID_COMMANDERACTIVATES + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderAtkIncrease: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPATK | BIT_SPDEF | BIT_SPEED, STAT_CHANGE_BY_TWO + setstatchanger STAT_ATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderDefIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderDefIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderDefIncrease: + setstatchanger STAT_DEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderSpAtkIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderSpAtkIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderSpAtkIncrease: + setstatchanger STAT_SPATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderSpDefIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderSpDefIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderSpDefIncrease: + setstatchanger STAT_SPDEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderSpeedIncrease + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderSpeedIncrease + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderSpeedIncrease: + setstatchanger STAT_SPEED, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CommanderEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CommanderEnd + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_CommanderEnd: + restoreattacker + end3 + BattleScript_HospitalityActivates:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp @@ -9533,6 +9575,14 @@ BattleScript_StickyBarbTransfer:: removeitem BS_TARGET return +BattleScript_RedCardActivationNoSwitch:: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_REDCARDACTIVATE + waitmessage B_WAIT_TIME_LONG + removeitem BS_SCRIPTING + restoretarget + return + BattleScript_RedCardActivates:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT printstring STRINGID_REDCARDACTIVATE diff --git a/include/battle.h b/include/battle.h index f1628ddd9b..16df7c500a 100644 --- a/include/battle.h +++ b/include/battle.h @@ -201,10 +201,13 @@ struct ProtectStruct u16 eatMirrorHerb:1; u16 activateOpportunist:2; // 2 - to copy stats. 1 - stats copied (do not repeat). 0 - no stats to copy u16 usedAllySwitch:1; + u16 padding:2; + // End of 16-bit bitfield u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; + }; struct SpecialStatus @@ -818,9 +821,13 @@ struct BattleStruct u8 boosterEnergyActivates; u8 distortedTypeMatchups; u8 categoryOverride; // for Z-Moves and Max Moves + u8 commandingDondozo; + u16 commanderActive[NUM_BATTLE_SIDES]; u32 stellarBoostFlags[NUM_BATTLE_SIDES]; // stored as a bitfield of flags for all types for each side u8 fickleBeamBoosted:1; u8 obedienceResult:3; + u8 padding:4; + u8 usedEjectItem; u8 usedMicleBerry; }; diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 4f1593d4d8..7326647d41 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -57,6 +57,8 @@ bool32 IsMoveNotAllowedInSkyBattles(u32 move); bool32 DoSwitchInAbilities(u32 battlerId); u8 GetFirstFaintedPartyIndex(u8 battlerId); bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler); +void SaveBattlerTarget(u32 battler); +void SaveBattlerAttacker(u32 battler); extern void (* const gBattleScriptingCommandsTable[])(void); extern const struct StatFractions gAccuracyStageRatios[]; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 84c1b70cf4..9e2fb84485 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -412,6 +412,7 @@ extern const u8 BattleScript_BattlerGotOverItsInfatuation[]; extern const u8 BattleScript_Pickpocket[]; extern const u8 BattleScript_StickyBarbTransfer[]; extern const u8 BattleScript_AttackerItemStatRaise[]; +extern const u8 BattleScript_RedCardActivationNoSwitch[]; extern const u8 BattleScript_RedCardActivates[]; extern const u8 BattleScript_EjectButtonActivates[]; extern const u8 BattleScript_EjectPackActivate_Ret[]; @@ -477,6 +478,7 @@ extern const u8 BattleScript_CudChewActivates[]; extern const u8 BattleScript_SupremeOverlordActivates[]; extern const u8 BattleScript_CostarActivates[]; extern const u8 BattleScript_ZeroToHeroActivates[]; +extern const u8 BattleScript_CommanderActivates[]; extern const u8 BattleScript_HospitalityActivates[]; extern const u8 BattleScript_ToxicDebrisActivates[]; extern const u8 BattleScript_EarthEaterActivates[]; diff --git a/include/constants/battle.h b/include/constants/battle.h index f9800ef4b3..560448159a 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -166,7 +166,7 @@ #define STATUS3_YAWN_TURN(num) (((num) << 11) & STATUS3_YAWN) #define STATUS3_IMPRISONED_OTHERS (1 << 13) #define STATUS3_GRUDGE (1 << 14) -#define STATUS3___UNUSED (1 << 15) +#define STATUS3_COMMANDER (1 << 15) #define STATUS3_GASTRO_ACID (1 << 16) #define STATUS3_EMBARGO (1 << 17) #define STATUS3_UNDERWATER (1 << 18) @@ -183,7 +183,8 @@ #define STATUS3_LASER_FOCUS (1 << 29) #define STATUS3_POWER_TRICK (1 << 30) #define STATUS3_SKY_DROPPED (1 << 31) // Target of Sky Drop -#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER | STATUS3_PHANTOM_FORCE) +#define STATUS3_SEMI_INVULNERABLE_NO_COMMANDER (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER | STATUS3_PHANTOM_FORCE) // Exception for Transform / Imposter +#define STATUS3_SEMI_INVULNERABLE (STATUS3_SEMI_INVULNERABLE_NO_COMMANDER | STATUS3_COMMANDER) #define STATUS4_ELECTRIFIED (1 << 0) #define STATUS4_MUD_SPORT (1 << 1) // Only used if B_SPORT_TURNS < GEN_6 @@ -401,8 +402,9 @@ #define MOVE_EFFECT_SECRET_POWER 77 #define MOVE_EFFECT_PSYCHIC_NOISE 78 #define MOVE_EFFECT_TERA_BLAST 79 +#define MOVE_EFFECT_ORDER_UP 80 -#define NUM_MOVE_EFFECTS 80 +#define NUM_MOVE_EFFECTS 81 #define MOVE_EFFECT_AFFECTS_USER 0x2000 #define MOVE_EFFECT_CERTAIN 0x4000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 5da278110f..770e773f80 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -354,6 +354,7 @@ enum { EFFECT_DRAGON_DARTS, EFFECT_GUARDIAN_OF_ALOLA, EFFECT_SHELL_SIDE_ARM, + EFFECT_ORDER_UP, NUM_BATTLE_MOVE_EFFECTS, }; diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 9fbb70a223..08c80248fe 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -712,8 +712,9 @@ #define STRINGID_FOGLIFTED 710 #define STRINGID_PKMNMADESHELLGLEAM 711 #define STRINGID_FICKLEBEAMDOUBLED 712 +#define STRINGID_COMMANDERACTIVATES 713 -#define BATTLESTRINGS_COUNT 713 +#define BATTLESTRINGS_COUNT 714 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index acc13a7378..e686b52071 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -835,6 +835,9 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) if (IsTwoTurnNotSemiInvulnerableMove(battlerAtk, move) && CanTargetFaintAi(battlerDef, battlerAtk)) RETURN_SCORE_MINUS(10); + if (gBattleStruct->commandingDondozo & (1u << battlerDef)) + RETURN_SCORE_MINUS(20); + // check if negates type switch (effectiveness) { diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 14f5c44ffc..05dbbe916a 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -412,6 +412,9 @@ bool32 IsDamageMoveUnusable(u32 move, u32 battlerAtk, u32 battlerDef) if (battlerDef == BATTLE_PARTNER(battlerAtk)) battlerDefAbility = aiData->abilities[battlerDef]; + if (gBattleStruct->commandingDondozo & (1u << battlerDef)) + return TRUE; + switch (battlerDefAbility) { case ABILITY_LIGHTNING_ROD: @@ -1508,6 +1511,8 @@ bool32 IsSemiInvulnerable(u32 battlerDef, u32 move) { if (gStatuses3[battlerDef] & STATUS3_PHANTOM_FORCE) return TRUE; + else if (gBattleStruct->commandingDondozo & (1u << battlerDef)) + return TRUE; else if (!gMovesInfo[move].damagesAirborne && gStatuses3[battlerDef] & STATUS3_ON_AIR) return TRUE; else if (!gMovesInfo[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER) diff --git a/src/battle_main.c b/src/battle_main.c index 92e1618fc7..d30d7a927f 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3343,6 +3343,16 @@ const u8* FaintClearSetData(u32 battler) gBattleStruct->palaceFlags &= ~(1u << battler); gBattleStruct->boosterEnergyActivates &= ~(1u << battler); + if (gBattleStruct->commanderActive[battler] != SPECIES_NONE) + { + u32 partner = BATTLE_PARTNER(battler); + if (IsBattlerAlive(partner)) + { + BtlController_EmitSpriteInvisibility(partner, BUFFER_A, FALSE); + MarkBattlerForControllerExec(partner); + } + } + for (i = 0; i < ARRAY_COUNT(gSideTimers); i++) { // User of sticky web fainted, so reset the stored battler ID @@ -4194,7 +4204,7 @@ static void HandleTurnActionSelectionState(void) || gBattleStruct->absentBattlerFlags & (1u << GetBattlerAtPosition(BATTLE_PARTNER(position))) || gBattleCommunication[GetBattlerAtPosition(BATTLE_PARTNER(position))] == STATE_WAIT_ACTION_CONFIRMED) { - if (gBattleStruct->absentBattlerFlags & (1u << battler)) + if ((gBattleStruct->absentBattlerFlags & (1u << battler)) || (gBattleStruct->commandingDondozo & (1u << battler))) { gChosenActionByBattler[battler] = B_ACTION_NOTHING_FAINTED; if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) @@ -5116,6 +5126,9 @@ static void TurnValuesCleanUp(bool8 var0) if (gDisableStructs[i].substituteHP == 0) gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE; + if (!(gStatuses3[i] & STATUS3_COMMANDER)) + gBattleStruct->commandingDondozo &= ~(1u << i); + gSpecialStatuses[i].parentalBondState = PARENTAL_BOND_OFF; } @@ -5124,6 +5137,7 @@ static void TurnValuesCleanUp(bool8 var0) gSideTimers[B_SIDE_PLAYER].followmeTimer = 0; gSideTimers[B_SIDE_OPPONENT].followmeTimer = 0; + gBattleStruct->usedEjectItem = 0; gBattleStruct->pledgeMove = FALSE; // combined pledge move may not have been used due to a canceller } diff --git a/src/battle_message.c b/src/battle_message.c index 727091cec6..d90113b5ea 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -830,7 +830,8 @@ static const u8 sText_TargetIsBeingSaltCured[] = _("{B_DEF_NAME_WITH_PREFIX} is static const u8 sText_TargetIsHurtBySaltCure[] = _("{B_DEF_NAME_WITH_PREFIX} is hurt by {B_BUFF1}!"); static const u8 sText_TargetCoveredInStickyCandySyrup[] = _("{B_DEF_NAME_WITH_PREFIX} got covered\nin sticky syrup!"); static const u8 sText_PkmnTellChillingReceptionJoke[] = _("{B_ATK_NAME_WITH_PREFIX} is preparing to tell a\nchillingly bad joke!"); -static const u8 sText_ZeroToHeroTransformation[] = _("{B_ATK_NAME_WITH_PREFIX} underwent a heroic\ntransformation!"); +static const u8 sText_ZeroToHeroTransformation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} underwent a heroic\ntransformation!"); +static const u8 sText_CommanderActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} was swallowed by Dondozo\nand became Dondozo's commander!"); static const u8 sText_TheTwoMovesBecomeOne[] = _("The two moves become one!\nIt's a combined move!{PAUSE 16}"); static const u8 sText_ARainbowAppearedOnSide[] = _("A rainbow appeared in the sky\non {B_ATK_TEAM2} team's side!"); static const u8 sText_TheRainbowDisappeared[] = _("The rainbow on {B_ATK_TEAM2}\nside disappeared!"); @@ -869,6 +870,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ARAINBOWAPPEAREDONSIDE - BATTLESTRINGS_TABLE_START] = sText_ARainbowAppearedOnSide, [STRINGID_THETWOMOVESBECOMEONE - BATTLESTRINGS_TABLE_START] = sText_TheTwoMovesBecomeOne, [STRINGID_ZEROTOHEROTRANSFORMATION - BATTLESTRINGS_TABLE_START] = sText_ZeroToHeroTransformation, + [STRINGID_COMMANDERACTIVATES - BATTLESTRINGS_TABLE_START] = sText_CommanderActivates, [STRINGID_PKMNTELLCHILLINGRECEPTIONJOKE - BATTLESTRINGS_TABLE_START] = sText_PkmnTellChillingReceptionJoke, [STRINGID_MOVEBLOCKEDBYDYNAMAX - BATTLESTRINGS_TABLE_START] = sText_MoveBlockedByDynamax, [STRINGID_TARGETISHURTBYSALTCURE - BATTLESTRINGS_TABLE_START] = sText_TargetIsHurtBySaltCure, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ec5d2f61a0..897bf1dab3 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -337,8 +337,6 @@ static bool8 CanBurnHitThaw(u16 move); static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent); static void TryUpdateEvolutionTracker(u32 evolutionMethod, u32 upAmount, u16 usedMove); static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u8 *failInstr, u16 move); -static void SaveBattlerAttacker(u32 battler); -static void SaveBattlerTarget(u32 battler); static void Cmd_attackcanceler(void); static void Cmd_accuracycheck(void); @@ -1197,6 +1195,13 @@ static void Cmd_attackcanceler(void) u16 attackerAbility = GetBattlerAbility(gBattlerAttacker); u32 moveType = GetMoveType(gCurrentMove); + if (gBattleStruct->usedEjectItem & (1u << gBattlerAttacker)) + { + gBattleStruct->usedEjectItem = 0; + gCurrentActionFuncId = B_ACTION_TRY_FINISH; + return; + } + // Weight-based moves are blocked by Dynamax. if ((GetActiveGimmick(gBattlerTarget) == GIMMICK_DYNAMAX) && IsMoveBlockedByDynamax(gCurrentMove)) { @@ -1516,14 +1521,17 @@ static bool32 AccuracyCalcHelper(u16 move) return TRUE; } // If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits. - else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) + else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD + && !(gStatuses3[gBattlerTarget] & STATUS3_COMMANDER) + && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) { if (!JumpIfMoveFailed(7, move)) RecordAbilityBattle(gBattlerAttacker, ABILITY_NO_GUARD); return TRUE; } // If the target has the ability No Guard and they aren't involved in a Sky Drop or the current move isn't Sky Drop, move hits. - else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) + else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD + && (gMovesInfo[move].effect != EFFECT_SKY_DROP || gBattleStruct->skyDropTargets[gBattlerTarget] == 0xFF)) { if (!JumpIfMoveFailed(7, move)) RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD); @@ -1531,8 +1539,8 @@ static bool32 AccuracyCalcHelper(u16 move) } // If the target is under the effects of Telekinesis, and the move isn't a OH-KO move, move hits. else if (gStatuses3[gBattlerTarget] & STATUS3_TELEKINESIS - && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) - && gMovesInfo[move].effect != EFFECT_OHKO) + && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) + && gMovesInfo[move].effect != EFFECT_OHKO) { JumpIfMoveFailed(7, move); return TRUE; @@ -1544,10 +1552,11 @@ static bool32 AccuracyCalcHelper(u16 move) return TRUE; } - if ((gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE) - || ((gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) && !(gMovesInfo[move].damagesAirborne || gMovesInfo[move].damagesAirborneDoubleDamage)) - || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) && !gMovesInfo[move].damagesUnderground) - || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) && !gMovesInfo[move].damagesUnderwater)) + if ((gStatuses3[gBattlerTarget] & STATUS3_COMMANDER) + || (gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE) + || ((gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) && !(gMovesInfo[move].damagesAirborne || gMovesInfo[move].damagesAirborneDoubleDamage)) + || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) && !gMovesInfo[move].damagesUnderground) + || ((gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) && !gMovesInfo[move].damagesUnderwater)) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(7, move); @@ -2943,9 +2952,10 @@ void SetMoveEffect(bool32 primary, bool32 certain) INCREMENT_RESET_RETURN if (!(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) - && TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) - && !primary - && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING) + && TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove) + && !(gMovesInfo[gCurrentMove].effect == EFFECT_ORDER_UP && gBattleStruct->commanderActive[gBattlerAttacker]) + && !primary + && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING) INCREMENT_RESET_RETURN if (!IsBattlerAlive(gEffectBattler) && !activateAfterFaint) @@ -3919,6 +3929,43 @@ void SetMoveEffect(bool32 primary, bool32 certain) gBattlescriptCurrInstr = BattleScript_LowerAtkSpAtk; } break; + case MOVE_EFFECT_ORDER_UP: + { + u32 stat = 0; + bool32 commanderAffected = TRUE; + switch (gBattleStruct->commanderActive[gEffectBattler]) + { + case SPECIES_TATSUGIRI_CURLY: + stat = STAT_ATK; + break; + case SPECIES_TATSUGIRI_DROOPY: + stat = STAT_DEF; + break; + case SPECIES_TATSUGIRI_STRETCHY: + stat = STAT_SPEED; + break; + default: + commanderAffected = FALSE; + break; + } + if (!commanderAffected + || NoAliveMonsForEitherParty() + || ChangeStatBuffs(SET_STAT_BUFF_VALUE(1), + stat, + affectsUser | STAT_CHANGE_UPDATE_MOVE_EFFECT, + 0) == STAT_CHANGE_DIDNT_WORK) + { + gBattlescriptCurrInstr++; + } + else + { + gBattleScripting.animArg1 = gBattleScripting.moveEffect & ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); + gBattleScripting.animArg2 = 0; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_StatUp; + } + } + break; } } } @@ -5482,17 +5529,17 @@ static bool32 TryKnockOffBattleScript(u32 battlerDef) static u32 GetNextTarget(u32 moveTarget, bool32 excludeCurrent) { - u32 i; - for (i = 0; i < MAX_BATTLERS_COUNT; i++) + u32 battler; + for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) { - if (i != gBattlerAttacker - && !(excludeCurrent && i == gBattlerTarget) - && IsBattlerAlive(i) - && !(gBattleStruct->targetsDone[gBattlerAttacker] & (1u << i)) - && (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) - break; + if (battler != gBattlerAttacker + && !(excludeCurrent && battler == gBattlerTarget) + && IsBattlerAlive(battler) + && !(gBattleStruct->targetsDone[gBattlerAttacker] & (1u << battler)) + && (GetBattlerSide(battler) != GetBattlerSide(gBattlerAttacker) || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) + break; } - return i; + return battler; } static void Cmd_moveend(void) @@ -6245,6 +6292,7 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection effect = TRUE; BattleScriptPushCursor(); + gBattleStruct->usedEjectItem |= 1u << battler; if (ejectButtonBattlers & (1u << battler)) { gBattlescriptCurrInstr = BattleScript_EjectButtonActivates; @@ -6314,8 +6362,15 @@ static void Cmd_moveend(void) if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE) gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_RedCardActivates; - gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = TRUE; + if (gBattleStruct->commanderActive[gBattlerAttacker] != SPECIES_NONE) + { + gBattlescriptCurrInstr = BattleScript_RedCardActivationNoSwitch; + } + else + { + gBattlescriptCurrInstr = BattleScript_RedCardActivates; + gSpecialStatuses[gBattlerAttacker].preventLifeOrbDamage = TRUE; + } effect = TRUE; break; // Only fastest red card activates } @@ -6478,8 +6533,6 @@ static void Cmd_moveend(void) && (gBattleMons[gBattlerAttacker].status2 & STATUS2_LOCK_CONFUSE) != STATUS2_LOCK_CONFUSE_TURN(1)) // And won't end this turn CancelMultiTurnMoves(gBattlerAttacker); // Cancel it - - if (gBattleStruct->savedAttackerCount > 0) { // #if TESTING @@ -6525,6 +6578,18 @@ static void Cmd_moveend(void) if (B_CHARGE <= GEN_8 || moveType == TYPE_ELECTRIC) gStatuses3[gBattlerAttacker] &= ~(STATUS3_CHARGED_UP); memset(gQueuedStatBoosts, 0, sizeof(gQueuedStatBoosts)); + + for (i = 0; i < gBattlersCount; i++) + { + if (gBattleStruct->commanderActive[i] != SPECIES_NONE && !IsBattlerAlive(i)) + { + u32 partner = BATTLE_PARTNER(i); + gBattleStruct->commanderActive[i] = SPECIES_NONE; + if (IsBattlerAlive(partner)) + gStatuses3[partner] &= ~STATUS3_COMMANDER; + } + } + gBattleScripting.moveendState++; break; case MOVEEND_COUNT: @@ -7425,6 +7490,7 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler) switch (GetBattlerAbility(i)) { case ABILITY_TRACE: + case ABILITY_COMMANDER: if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, i, 0, 0, 0)) return TRUE; break; @@ -12567,7 +12633,7 @@ static void Cmd_transformdataexecution(void) gBattlescriptCurrInstr = cmd->nextInstr; if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED || gBattleStruct->illusion[gBattlerTarget].on - || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) + || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE_NO_COMMANDER) { gMoveResultFlags |= MOVE_RESULT_FAILED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORM_FAILED; @@ -13357,7 +13423,8 @@ static void Cmd_trysetperishsong(void) { if (gStatuses3[i] & STATUS3_PERISH_SONG || GetBattlerAbility(i) == ABILITY_SOUNDPROOF - || BlocksPrankster(gCurrentMove, gBattlerAttacker, i, TRUE)) + || BlocksPrankster(gCurrentMove, gBattlerAttacker, i, TRUE) + || gStatuses3[i] & STATUS3_COMMANDER) { notAffectedCount++; } @@ -15767,7 +15834,7 @@ static void Cmd_callnative(void) // Callnative Funcs -static void SaveBattlerTarget(u32 battler) +void SaveBattlerTarget(u32 battler) { if (gBattleStruct->savedTargetCount < NELEMS(gBattleStruct->savedBattlerTarget)) gBattleStruct->savedBattlerTarget[gBattleStruct->savedTargetCount++] = battler; @@ -15775,7 +15842,7 @@ static void SaveBattlerTarget(u32 battler) DebugPrintfLevel(MGBA_LOG_WARN, "Attempting to exceed savedBattlerTarget array size!"); } -static void SaveBattlerAttacker(u32 battler) +void SaveBattlerAttacker(u32 battler) { if (gBattleStruct->savedAttackerCount < NELEMS(gBattleStruct->savedBattlerAttacker)) gBattleStruct->savedBattlerAttacker[gBattleStruct->savedAttackerCount++] = battler; @@ -17344,3 +17411,15 @@ void BS_TryRevivalBlessing(void) MarkBattlerForControllerExec(gBattlerAttacker); } } + +void BS_JumpIfCommanderActive(void) +{ + NATIVE_ARGS(const u8 *jumpInstr); + + if (gBattleStruct->commanderActive[gBattlerTarget] != SPECIES_NONE) + gBattlescriptCurrInstr = cmd->jumpInstr; + else if (gStatuses3[gBattlerTarget] & STATUS3_COMMANDER) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} diff --git a/src/battle_util.c b/src/battle_util.c index e0e5fe2485..e32e21cf2a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -130,7 +130,9 @@ void HandleAction_UseMove(void) u16 moveTarget; gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; - if (gBattleStruct->absentBattlerFlags & (1u << gBattlerAttacker) || !IsBattlerAlive(gBattlerAttacker)) + if (gBattleStruct->absentBattlerFlags & (1u << gBattlerAttacker) + || gBattleStruct->commandingDondozo & (1u << gBattlerAttacker) + || !IsBattlerAlive(gBattlerAttacker)) { gCurrentActionFuncId = B_ACTION_FINISHED; return; @@ -4113,7 +4115,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 u32 moveType, move; u32 side; u32 i, j; - u32 partner; + u32 partner = 0; struct Pokemon *mon; if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) @@ -4404,7 +4406,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !(gBattleMons[BATTLE_OPPOSITE(battler)].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE)) && !(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) && !(gBattleStruct->illusion[BATTLE_OPPOSITE(battler)].on) - && !(gStatuses3[BATTLE_OPPOSITE(battler)] & STATUS3_SEMI_INVULNERABLE)) + && !(gStatuses3[BATTLE_OPPOSITE(battler)] & STATUS3_SEMI_INVULNERABLE_NO_COMMANDER)) { gBattlerAttacker = battler; gBattlerTarget = BATTLE_OPPOSITE(battler); @@ -4907,7 +4909,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !(gBattleStruct->transformZeroToHero[side] & (1u << gBattlerPartyIndexes[battler]))) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; - gBattlerAttacker = battler; gBattleStruct->transformZeroToHero[side] |= 1u << gBattlerPartyIndexes[battler]; BattleScriptPushCursorAndCallback(BattleScript_ZeroToHeroActivates); effect++; @@ -4980,6 +4981,28 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 effect++; } break; + case ABILITY_COMMANDER: + partner = BATTLE_PARTNER(battler); + if (!gSpecialStatuses[battler].switchInAbilityDone + && gBattleStruct->commanderActive[partner] == SPECIES_NONE + && gBattleMons[partner].species == SPECIES_DONDOZO + && GET_BASE_SPECIES_ID(GetMonData(GetPartyBattlerData(battler), MON_DATA_SPECIES)) == SPECIES_TATSUGIRI) + { + SaveBattlerAttacker(gBattlerAttacker); + gSpecialStatuses[battler].switchInAbilityDone = TRUE; + gBattlerAttacker = partner; + gBattleStruct->commandingDondozo |= 1u << battler; + gBattleStruct->commanderActive[partner] = gBattleMons[battler].species; + gStatuses3[battler] |= STATUS3_COMMANDER; + if (gBattleMons[battler].status2 & STATUS2_CONFUSION + && !(gStatuses4[battler] & STATUS4_INFINITE_CONFUSION)) + gBattleMons[battler].status2 -= STATUS2_CONFUSION_TURN(1); + BtlController_EmitSpriteInvisibility(battler, BUFFER_A, TRUE); + MarkBattlerForControllerExec(battler); + BattleScriptPushCursorAndCallback(BattleScript_CommanderActivates); + effect++; + } + break; } break; case ABILITYEFFECT_ENDTURN: @@ -6519,7 +6542,9 @@ u32 IsAbilityPreventingEscape(u32 battler) bool32 CanBattlerEscape(u32 battler) // no ability check { - if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_SHED_SHELL) + if (gBattleStruct->commanderActive[battler] != SPECIES_NONE) + return FALSE; + else if (GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_SHED_SHELL) return TRUE; else if (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) return TRUE; diff --git a/src/data/abilities.h b/src/data/abilities.h index 7c67f2da17..30a34ffe90 100644 --- a/src/data/abilities.h +++ b/src/data/abilities.h @@ -2141,6 +2141,7 @@ const struct Ability gAbilitiesInfo[ABILITIES_COUNT] = .cantBeSwapped = TRUE, .cantBeTraced = TRUE, .cantBeSuppressed = TRUE, + .cantBeOverwritten = TRUE, }, [ABILITY_ELECTROMORPHOSIS] = diff --git a/src/data/battle_move_effects.h b/src/data/battle_move_effects.h index ead7cee6f1..776563bbec 100644 --- a/src/data/battle_move_effects.h +++ b/src/data/battle_move_effects.h @@ -2255,4 +2255,10 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] = .battleScript = BattleScript_EffectHit, .battleTvScore = 0, // TODO: Assign points }, + + [EFFECT_ORDER_UP] = + { + .battleScript = BattleScript_EffectHit, + .battleTvScore = 0, // TODO: Assign points + }, }; diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 74e12c4e7a..0d754f479d 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -19325,7 +19325,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .description = COMPOUND_STRING( "Boosts a user's stats\n" "depending on Tatsugiri."), - .effect = EFFECT_PLACEHOLDER, // EFFECT_ORDER_UP + .effect = EFFECT_ORDER_UP, .power = 80, .type = TYPE_DRAGON, .accuracy = 100, @@ -19335,6 +19335,11 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .category = DAMAGE_CATEGORY_PHYSICAL, .mirrorMoveBanned = TRUE, .metronomeBanned = TRUE, + .additionalEffects = ADDITIONAL_EFFECTS({ + .moveEffect = MOVE_EFFECT_ORDER_UP, + .self = TRUE, + .chance = 100, + }), .battleAnimScript = gBattleAnimMove_OrderUp, }, diff --git a/test/battle/ability/commander.c b/test/battle/ability/commander.c new file mode 100644 index 0000000000..af02f971a3 --- /dev/null +++ b/test/battle/ability/commander.c @@ -0,0 +1,423 @@ +#include "global.h" +#include "test/battle.h" + +DOUBLE_BATTLE_TEST("Commander will activate once Dondozo switches in") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { SWITCH(playerLeft, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + } +} + +DOUBLE_BATTLE_TEST("Commander increases all stats by 2 stages once it is triggered") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Dondozo's Attack sharply rose!"); + MESSAGE("Dondozo's Defense sharply rose!"); + MESSAGE("Dondozo's Sp. Atk sharply rose!"); + MESSAGE("Dondozo's Sp. Def sharply rose!"); + MESSAGE("Dondozo's Speed sharply rose!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri avoids moves targetted towards it") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); MOVE(opponentRight, MOVE_POUND, target: playerRight); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + MESSAGE("Foe Wobbuffet's attack missed!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POUND, opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri will still take residual damage from a field effect while inside Dondozo") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_TYRANITAR) { Ability(ABILITY_SAND_STREAM); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ABILITY_POPUP(opponentLeft, ABILITY_SAND_STREAM); + MESSAGE("Dondozo is buffeted by the sandstorm!"); + MESSAGE("Tatsugiri is buffeted by the sandstorm!"); + MESSAGE("Foe Wobbuffet is buffeted by the sandstorm!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri will still take poison damage if while inside Dondozo") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); Status1(STATUS1_POISON); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Tatsugiri is hurt by poison!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri still avoids moves even when the attacker has No Guard") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_MACHAMP) { Ability(ABILITY_NO_GUARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + MESSAGE("Foe Machamp's attack missed!"); + } +} + +DOUBLE_BATTLE_TEST("Commander cannot affect a Dondozo that was previously affected by Commander until it faints and revived") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { HP(1); Ability(ABILITY_COMMANDER); Status1(STATUS1_POISON); } + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_CELEBRATE); SWITCH(playerLeft, 2); SEND_OUT(playerLeft, 3); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Tatsugiri is hurt by poison!"); + NONE_OF { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + } + } +} + +DOUBLE_BATTLE_TEST("Commander prevents Whirlwind from working against Dondozo or Tatsugiri while it's active") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_WHIRLWIND, target: playerLeft); } + TURN { MOVE(opponentRight, MOVE_WHIRLWIND, target: playerRight); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Foe Wobbuffet used Whirlwind!"); + MESSAGE("But it failed!"); + MESSAGE("Foe Wobbuffet used Whirlwind!"); + MESSAGE("But it failed!"); + } +} + +DOUBLE_BATTLE_TEST("Commander prevents Red Card from working while Commander is active") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft); + } THEN { + EXPECT(opponentLeft->item == ITEM_NONE); + EXPECT(playerRight->species == SPECIES_DONDOZO); + } + +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri is not damaged by a double target move if Dondozo faints") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_DONDOZO) { HP(1); }; + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_SURF); SEND_OUT(playerLeft, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + HP_BAR(playerLeft); + MESSAGE("Dondozo fainted!"); + NOT HP_BAR(playerRight); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri takes no damage from multi-target damaging moves") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_SURF); MOVE(opponentRight, MOVE_SURF); SWITCH(playerLeft, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft); + HP_BAR(playerLeft); + NOT HP_BAR(playerRight); + HP_BAR(opponentRight); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentRight); + HP_BAR(playerLeft); + HP_BAR(opponentLeft); + NOT HP_BAR(playerRight); + } +} + +DOUBLE_BATTLE_TEST("Commander doesn't prevent Transform from working on a Commander Tatsugiri") +{ + GIVEN { + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_TRANSFORM, target: playerRight); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TRANSFORM, opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander doesn't prevent Imposter from working on a Commander Tatsugiri") +{ + GIVEN { + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_DITTO) { Ability(ABILITY_IMPOSTER); } + } WHEN { + TURN { } + TURN { SWITCH(opponentRight, 2); } + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ABILITY_POPUP(opponentRight, ABILITY_IMPOSTER); + MESSAGE("Foe Ditto transformed into Tatsugiri using Imposter!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri is still affected by Haze while controlling Dondozo") +{ + GIVEN { + PLAYER(SPECIES_DONDOZO); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_PERISH_SONG); } + TURN {} + TURN {} + TURN {} + } SCENE { + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_PERISH_SONG, opponentLeft); + MESSAGE("All affected POKéMON will faint in three turns!"); + MESSAGE("Dondozo's PERISH count fell to 0!"); + MESSAGE("Dondozo fainted!"); + MESSAGE("Foe Wobbuffet's PERISH count fell to 0!"); + MESSAGE("Foe Wobbuffet fainted!"); + NONE_OF { + MESSAGE("Tatsugiri's PERISH count fell to 0!"); + MESSAGE("Tatsugiri fainted!"); + } + MESSAGE("Foe Wynaut's PERISH count fell to 0!"); + MESSAGE("Foe Wynaut fainted!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri is still affected by Haze while controlling Dondozo") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_SWORDS_DANCE); } + TURN { SWITCH(playerLeft, 2); MOVE(opponentRight, MOVE_HAZE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SWORDS_DANCE, playerRight); + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HAZE, opponentRight); + } THEN { + EXPECT_EQ(playerRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE); + } +} + +DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Left Slot)") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_TACKLE, target: opponentLeft); } + TURN { SWITCH(playerLeft, 2); MOVE(opponentLeft, MOVE_SURF); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + ABILITY_POPUP(playerRight, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft); + HP_BAR(playerLeft); + MESSAGE("Foe Wobbuffet's attack missed!"); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Attacker is kept (Dondozo Right Slot)") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponentRight, MOVE_TACKLE, target: opponentLeft); } + TURN { SWITCH(playerRight, 2); MOVE(opponentLeft, MOVE_SURF); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + MESSAGE("Foe Wobbuffet's attack missed!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft); + HP_BAR(playerRight); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri does not attack if Dondozo faints the same turn it's switched in") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { + SWITCH(playerLeft, 2); + MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft); + MOVE(opponentRight, MOVE_TACKLE, target: playerRight); + MOVE(playerRight, MOVE_CELEBRATE); + SEND_OUT(playerLeft, 0); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft); + HP_BAR(playerLeft); + MESSAGE("Dondozo fainted!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight); + HP_BAR(playerRight); + NOT MESSAGE("Tatsugiri used Celebrate!"); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri does not get hit by Dragon Darts when a commanded Dondozo faints") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DARTS].effect == EFFECT_DRAGON_DARTS); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO) { HP(1); } + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { SWITCH(playerLeft, 2); MOVE(opponentRight, MOVE_DRAGON_DARTS, target: playerRight); SEND_OUT(playerRight, 0); } + } SCENE { + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, opponentRight); + MESSAGE("Dondozo fainted!"); + NOT HP_BAR(playerLeft); + } +} + +DOUBLE_BATTLE_TEST("Commander Tatsugiri does not get hit by Dragon Darts when commanding Dondozo") +{ + bool32 targetPlayerRight; + PARAMETRIZE { targetPlayerRight = TRUE; } + PARAMETRIZE { targetPlayerRight = FALSE; } + GIVEN { + ASSUME(gMovesInfo[MOVE_DRAGON_DARTS].effect == EFFECT_DRAGON_DARTS); + PLAYER(SPECIES_TATSUGIRI) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + if (targetPlayerRight == TRUE) + TURN { MOVE(opponentRight, MOVE_DRAGON_DARTS, target: playerRight); } + else + TURN { MOVE(opponentRight, MOVE_DRAGON_DARTS, target: playerLeft); } + } SCENE { + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_DARTS, opponentRight); + HP_BAR(playerRight); + NOT HP_BAR(playerLeft); + HP_BAR(playerRight); + NOT HP_BAR(playerLeft); + } +} diff --git a/test/battle/hold_effect/eject_button.c b/test/battle/hold_effect/eject_button.c index da358c2aa9..f53a270d82 100644 --- a/test/battle/hold_effect/eject_button.c +++ b/test/battle/hold_effect/eject_button.c @@ -208,3 +208,27 @@ SINGLE_BATTLE_TEST("Eject Button is not triggered after High Jump Kick crash dam } } } + +DOUBLE_BATTLE_TEST("Eject Button activation will not trigger an attack from the incoming mon") +{ + GIVEN { + PLAYER(SPECIES_TATSUGIRI) { Speed(10); Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_WOBBUFFET) { Speed(100); Item(ITEM_EJECT_BUTTON); } + PLAYER(SPECIES_DONDOZO) { Speed(20); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(50); Item(ITEM_EJECT_PACK); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(10); } + OPPONENT(SPECIES_WYNAUT) { Speed(1); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_MAKE_IT_RAIN); SEND_OUT(playerRight, 2); SEND_OUT(opponentRight, 2); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_MAKE_IT_RAIN, opponentRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight); + MESSAGE("Wobbuffet is switched out with the Eject Button!"); + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentLeft); + MESSAGE("Wobbuffet is switched out with the Eject Pack!"); + } + } +} diff --git a/test/battle/move_effect_secondary/order_up.c b/test/battle/move_effect_secondary/order_up.c new file mode 100644 index 0000000000..ea1980062c --- /dev/null +++ b/test/battle/move_effect_secondary/order_up.c @@ -0,0 +1,172 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gMovesInfo[MOVE_ORDER_UP].additionalEffects[0].moveEffect == MOVE_EFFECT_ORDER_UP); +} + +DOUBLE_BATTLE_TEST("Order Up increases a stat based on Tatsugiri's form") +{ + u32 species = 0; + PARAMETRIZE { species = SPECIES_TATSUGIRI_CURLY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_DROOPY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_STRETCHY; } + + GIVEN { + PLAYER(species) { Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VOLBEAT) { Ability(ABILITY_PRANKSTER); }; + } WHEN { + TURN { MOVE(opponentRight, MOVE_HAZE); MOVE(playerRight, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HAZE, opponentRight); // Remove previous stat boosts + ANIMATION(ANIM_TYPE_MOVE, MOVE_ORDER_UP, playerRight); + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + MESSAGE("Dondozo's Attack rose!"); + break; + case SPECIES_TATSUGIRI_DROOPY: + MESSAGE("Dondozo's Defense rose!"); + break; + case SPECIES_TATSUGIRI_STRETCHY: + MESSAGE("Dondozo's Speed rose!"); + break; + } + } THEN { + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + EXPECT_EQ(playerRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_DROOPY: + EXPECT_EQ(playerRight->statStages[STAT_DEF], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_STRETCHY: + EXPECT_EQ(playerRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 1); + break; + } + } +} + +DOUBLE_BATTLE_TEST("Order Up increases a stat based on Tatsugiri's form even if Tatsugiri fainted inside Dondozo") +{ + u32 species = 0; + PARAMETRIZE { species = SPECIES_TATSUGIRI_CURLY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_DROOPY; } + PARAMETRIZE { species = SPECIES_TATSUGIRI_STRETCHY; } + + GIVEN { + PLAYER(species) { HP(1); Status1(STATUS1_POISON); Ability(ABILITY_COMMANDER); } + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_VOLBEAT) { Ability(ABILITY_PRANKSTER); }; + } WHEN { + TURN { } + TURN { MOVE(opponentRight, MOVE_HAZE); MOVE(playerRight, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_COMMANDER); + MESSAGE("Tatsugiri was swallowed by Dondozo and became Dondozo's commander!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Tatsugiri is hurt by poison!"); + MESSAGE("Tatsugiri fainted!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_HAZE, opponentRight); // Remove previous stat boosts + ANIMATION(ANIM_TYPE_MOVE, MOVE_ORDER_UP, playerRight); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + MESSAGE("Dondozo's Attack rose!"); + break; + case SPECIES_TATSUGIRI_DROOPY: + MESSAGE("Dondozo's Defense rose!"); + break; + case SPECIES_TATSUGIRI_STRETCHY: + MESSAGE("Dondozo's Speed rose!"); + break; + } + } THEN { + switch (species) + { + case SPECIES_TATSUGIRI_CURLY: + EXPECT_EQ(playerRight->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_DROOPY: + EXPECT_EQ(playerRight->statStages[STAT_DEF], DEFAULT_STAT_STAGE + 1); + break; + case SPECIES_TATSUGIRI_STRETCHY: + EXPECT_EQ(playerRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 1); + break; + } + } +} + +DOUBLE_BATTLE_TEST("Order up does not boosts any stats if Dondozo is not affected by Commander") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_DONDOZO); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(playerRight, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + } +} + +DOUBLE_BATTLE_TEST("Order Up is boosted by Sheer Force without removing the stat boosting effect") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + PLAYER(SPECIES_DONDOZO) { Speed(10); } + PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(8); } + OPPONENT(SPECIES_TAUROS) { Speed(21); Ability(ABILITY_SHEER_FORCE); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_ENTRAINMENT, target: playerLeft); MOVE(playerLeft, MOVE_ORDER_UP, target: opponentLeft); } + } SCENE { + MESSAGE("Foe Tauros used Entrainment!"); + MESSAGE("Dondozo acquired Sheer Force!"); + MESSAGE("Dondozo used Order Up!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + } +} +DOUBLE_BATTLE_TEST("Order Up is always boosted by Sheer Force", s16 damage) +{ + u32 move; + u32 ability; + PARAMETRIZE(move = MOVE_CELEBRATE, ability = ABILITY_STORM_DRAIN); + PARAMETRIZE(move = MOVE_ENTRAINMENT, ability = ABILITY_STORM_DRAIN); + PARAMETRIZE(move = MOVE_ENTRAINMENT, ability = ABILITY_COMMANDER); + + GIVEN { + ASSUME(gMovesInfo[MOVE_HAZE].effect == EFFECT_HAZE); + ASSUME(gMovesInfo[MOVE_ENTRAINMENT].effect == EFFECT_ENTRAINMENT); + PLAYER(SPECIES_DONDOZO) { Speed(10); } + PLAYER(SPECIES_TATSUGIRI_CURLY) { Speed(9); Ability(ability); } + OPPONENT(SPECIES_TAUROS) { Speed(21); Ability(ABILITY_SHEER_FORCE); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(22); } + } WHEN { + TURN { MOVE(opponentRight, MOVE_HAZE); + MOVE(opponentLeft, move, target: playerLeft); + MOVE(playerLeft, MOVE_ORDER_UP, target: opponentRight); } + } SCENE { + MESSAGE("Foe Wobbuffet used Haze!"); + if (move == MOVE_ENTRAINMENT) + { + MESSAGE("Foe Tauros used Entrainment!"); + MESSAGE("Dondozo acquired Sheer Force!"); + } + MESSAGE("Dondozo used Order Up!"); + HP_BAR(opponentRight, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, UQ_4_12(1.3), results[1].damage); + EXPECT_MUL_EQ(results[0].damage, UQ_4_12(1.3), results[2].damage); + } +}