From 4948d800307df9ba669a82bd72da05943d797603 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Wed, 11 May 2022 22:54:03 -0400 Subject: [PATCH 1/2] fix: follower pokemon should disappear when healed by nurse --- data/scripts/pkmn_center_nurse.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/scripts/pkmn_center_nurse.inc b/data/scripts/pkmn_center_nurse.inc index c0fe80a994..9c5afba8d6 100644 --- a/data/scripts/pkmn_center_nurse.inc +++ b/data/scripts/pkmn_center_nurse.inc @@ -33,7 +33,7 @@ EventScript_PkmnCenterNurse_IllTakeYourPkmn2:: return EventScript_PkmnCenterNurse_TakeAndHealPkmn:: - applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterLeft @ TODO: Make follower disappear here + applymovement VAR_0x800B, Movement_PkmnCenterNurse_Turn waitmovement 0 dofieldeffect FLDEFF_POKECENTER_HEAL waitfieldeffect FLDEFF_POKECENTER_HEAL @@ -117,6 +117,10 @@ EventScript_PkmnCenterNurse_GoldCardHealPkmn:: goto EventScript_PkmnCenterNurse_HealPkmn end +Movement_PkmnCenterNurse_Turn: + walk_in_place_faster_left + step_end + Movement_PkmnCenterNurse_Bow: nurse_joy_bow delay_4 From 758e4049cd235d7505abc78846739459580bdef3 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Fri, 3 May 2024 00:43:39 -0400 Subject: [PATCH 2/2] fix: `LARGE_OW_SUPPORT` and affine OW movements fixed #33 --- .../object_events/object_event_subsprites.h | 646 +++++++++--------- src/event_object_movement.c | 10 +- 2 files changed, 327 insertions(+), 329 deletions(-) diff --git a/src/data/object_events/object_event_subsprites.h b/src/data/object_events/object_event_subsprites.h index cb17e219e0..972deabb00 100755 --- a/src/data/object_events/object_event_subsprites.h +++ b/src/data/object_events/object_event_subsprites.h @@ -2130,6 +2130,327 @@ static const struct Subsprite sOamTable_24x32_4[] = { }, }; +static const struct Subsprite sOamTable_64x64_Follower[] = { + { + .x = -32, .y = -32, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -32, .y = 0, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 32, + .priority = 2 + } +}; + +static const struct Subsprite sOamTable_64x64_HotSprings[] = { + { + .x = -32, + .y = -32, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -32, + .y = 0, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = 0, + .y = 0, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 36, + .priority = 2 + }, + { + .x = -32, + .y = 8, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 40, + .priority = 2 + }, + { + .x = 0, + .y = 8, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 44, + .priority = 2 + }, + { + .x = -32, + .y = 16, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 48, + .priority = 2 + }, + { + .x = 0, + .y = 16, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 52, + .priority = 2 + }, + { + .x = -32, + .y = 24, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 56, + .priority = 3 + }, + { + .x = 0, + .y = 24, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 60, + .priority = 3 + }, +}; + +static const struct Subsprite sOamTable_64x64_Grass2[] = { + { + .x = -32, + .y = -32, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -32, + .y = 0, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 32, + .priority = 2 + }, + { + .x = 0, + .y = 0, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 36, + .priority = 2 + }, + { + .x = -32, + .y = 8, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 40, + .priority = 2 + }, + { + .x = 0, + .y = 8, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 44, + .priority = 2 + }, + { + .x = -32, + .y = 16, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 48, + .priority = 3 + }, + { + .x = 0, + .y = 16, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 52, + .priority = 3 + }, + { + .x = -32, + .y = 24, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 56, + .priority = 3 + }, + { + .x = 0, + .y = 24, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 60, + .priority = 3 + }, +}; + +static const struct Subsprite sOamTable_64x64_Grass1[] = { + { + .x = -32, + .y = -32, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -32, + .y = 0, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 32, + .priority = 1 + }, + { + .x = 0, + .y = 0, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 36, + .priority = 1 + }, + { + .x = -32, + .y = 8, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 40, + .priority = 1 + }, + { + .x = 0, + .y = 8, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 44, + .priority = 1 + }, + { + .x = -32, + .y = 16, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 48, + .priority = 3 + }, + { + .x = 0, + .y = 16, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 52, + .priority = 3 + }, + { + .x = -32, + .y = 24, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 56, + .priority = 3 + }, + { + .x = 0, + .y = 24, + SUBSPRITE_SHAPE(32, 8), + .tileOffset = 60, + .priority = 3 + }, +}; + +static const struct Subsprite sOamTable_64x64_Grass3[] = { + { + .x = -32, + .y = -24, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 0, + .priority = 2 + }, + { + .x = -32, + .y = 8, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 32, + .priority = 3 + } +}; + +static const struct Subsprite sOamTable_64x64_Grass4[] = { + { + .x = -32, + .y = -24, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 0, + .priority = 1 + }, + { + .x = -32, + .y = 8, + SUBSPRITE_SHAPE(64, 32), + .tileOffset = 32, + .priority = 3 + } +}; + + +static const struct SubspriteTable sOamTables_16x24[] = { + SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_1), + SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_2), + SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_3), + SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_4), +}; + + +static const struct SubspriteTable sOamTables_24x16[] = { + SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_1), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_2), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_3), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_3), +}; + +static const struct SubspriteTable sOamTables_24x24[] = { + SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_0), // reflections + SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_0), // all 2 + SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_1), // all 1 + SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_2), // bottom 8 3 + SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_3), // bottom 16 3 + SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_4), // top 1, bottom 16 3 +}; + +static const struct SubspriteTable sOamTables_24x32[] = { + SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_1), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_2), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_3), + SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_4), +}; + + +static const struct SubspriteTable sOamTables_32x24[] = { + SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_0), + SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_1), + SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_2), + SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_3), + SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_4), +}; + + +// For following pokemon +// Makes the top 32 pixels priority 1, +// so that very tall pokemon's heads +// will appear on top of buildings, etc. +static const struct SubspriteTable sOamTables_64x64_Tall[] = { + {}, // unused + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Follower), // elevation 3 + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_1), // elevation 4 + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_HotSprings), // hot springs + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass2), // long grass + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass1) // long grass priority 1 +}; + +// Like sOamTables_64x64_Tall, but fewer pixels visible in long grass +// Meant for pokemon that are more long than tall like Wailord +static const struct SubspriteTable sOamTables_64x64_Long[] = { + {}, // unused + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Follower), // elevation 3 + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_1), // elevation 4 + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_HotSprings), // hot springs + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass3), // long grass + SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass4) // long grass priority 1 +}; +#endif + static const struct Subsprite sOamTable_48x48[] = { { .x = -24, @@ -2565,302 +2886,7 @@ static const struct Subsprite sOamTable_48x48_Grass1[] = { } }; -static const struct Subsprite sOamTable_64x64_Follower[] = { - { - .x = -32, .y = -32, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 0, - .priority = 1 - }, - { - .x = -32, .y = 0, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 32, - .priority = 2 - } -}; - -static const struct Subsprite sOamTable_64x64_HotSprings[] = { - { - .x = -32, - .y = -32, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 0, - .priority = 2 - }, - { - .x = -32, - .y = 0, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 32, - .priority = 2 - }, - { - .x = 0, - .y = 0, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 36, - .priority = 2 - }, - { - .x = -32, - .y = 8, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 40, - .priority = 2 - }, - { - .x = 0, - .y = 8, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 44, - .priority = 2 - }, - { - .x = -32, - .y = 16, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 48, - .priority = 2 - }, - { - .x = 0, - .y = 16, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 52, - .priority = 2 - }, - { - .x = -32, - .y = 24, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 56, - .priority = 3 - }, - { - .x = 0, - .y = 24, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 60, - .priority = 3 - }, -}; - -static const struct Subsprite sOamTable_64x64_Grass2[] = { - { - .x = -32, - .y = -32, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 0, - .priority = 2 - }, - { - .x = -32, - .y = 0, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 32, - .priority = 2 - }, - { - .x = 0, - .y = 0, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 36, - .priority = 2 - }, - { - .x = -32, - .y = 8, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 40, - .priority = 2 - }, - { - .x = 0, - .y = 8, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 44, - .priority = 2 - }, - { - .x = -32, - .y = 16, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 48, - .priority = 3 - }, - { - .x = 0, - .y = 16, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 52, - .priority = 3 - }, - { - .x = -32, - .y = 24, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 56, - .priority = 3 - }, - { - .x = 0, - .y = 24, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 60, - .priority = 3 - }, -}; - -static const struct Subsprite sOamTable_64x64_Grass1[] = { - { - .x = -32, - .y = -32, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 0, - .priority = 1 - }, - { - .x = -32, - .y = 0, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 32, - .priority = 1 - }, - { - .x = 0, - .y = 0, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 36, - .priority = 1 - }, - { - .x = -32, - .y = 8, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 40, - .priority = 1 - }, - { - .x = 0, - .y = 8, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 44, - .priority = 1 - }, - { - .x = -32, - .y = 16, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 48, - .priority = 3 - }, - { - .x = 0, - .y = 16, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 52, - .priority = 3 - }, - { - .x = -32, - .y = 24, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 56, - .priority = 3 - }, - { - .x = 0, - .y = 24, - SUBSPRITE_SHAPE(32, 8), - .tileOffset = 60, - .priority = 3 - }, -}; - -static const struct Subsprite sOamTable_64x64_Grass3[] = { - { - .x = -32, - .y = -24, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 0, - .priority = 2 - }, - { - .x = -32, - .y = 8, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 32, - .priority = 3 - } -}; - -static const struct Subsprite sOamTable_64x64_Grass4[] = { - { - .x = -32, - .y = -24, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 0, - .priority = 1 - }, - { - .x = -32, - .y = 8, - SUBSPRITE_SHAPE(64, 32), - .tileOffset = 32, - .priority = 3 - } -}; - - -static const struct SubspriteTable sOamTables_16x24[] = { - SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_1), - SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_2), - SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_3), - SUBSPRITE_TABLE_ENTRY(sOamTable_16x24_4), -}; - - -static const struct SubspriteTable sOamTables_24x16[] = { - SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_1), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_2), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_3), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x16_3), -}; - -static const struct SubspriteTable sOamTables_24x24[] = { - SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_0), // reflections - SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_0), // all 2 - SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_1), // all 1 - SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_2), // bottom 8 3 - SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_3), // bottom 16 3 - SUBSPRITE_TABLE_ENTRY(sOamTable_24x24_4), // top 1, bottom 16 3 -}; - -static const struct SubspriteTable sOamTables_24x32[] = { - SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_1), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_2), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_3), - SUBSPRITE_TABLE_ENTRY(sOamTable_24x32_4), -}; - - -static const struct SubspriteTable sOamTables_32x24[] = { - SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_0), - SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_1), - SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_2), - SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_3), - SUBSPRITE_TABLE_ENTRY(sOamTable_32x24_4), -}; - - +// Also used for truck static const struct SubspriteTable sOamTables_48x48[] = { SUBSPRITE_TABLE_ENTRY(sOamTable_48x48), // reflections SUBSPRITE_TABLE_ENTRY(sOamTable_48x48), // elevation 3 @@ -2868,30 +2894,4 @@ static const struct SubspriteTable sOamTables_48x48[] = { SUBSPRITE_TABLE_ENTRY(sOamTable_48x48_HotSprings), // hot springs SUBSPRITE_TABLE_ENTRY(sOamTable_48x48_Grass2), // long grass SUBSPRITE_TABLE_ENTRY(sOamTable_48x48_Grass1) // long grass priority 1 -}; - - -// For following pokemon -// Makes the top 32 pixels priority 1, -// so that very tall pokemon's heads -// will appear on top of buildings, etc. -static const struct SubspriteTable sOamTables_64x64_Tall[] = { - {}, // unused - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Follower), // elevation 3 - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_1), // elevation 4 - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_HotSprings), // hot springs - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass2), // long grass - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass1) // long grass priority 1 -}; - -// Like sOamTables_64x64_Tall, but fewer pixels visible in long grass -// Meant for pokemon that are more long than tall like Wailord -static const struct SubspriteTable sOamTables_64x64_Long[] = { - {}, // unused - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Follower), // elevation 3 - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_1), // elevation 4 - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_HotSprings), // hot springs - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass3), // long grass - SUBSPRITE_TABLE_ENTRY(sOamTable_64x64_Grass4) // long grass priority 1 -}; -#endif \ No newline at end of file +}; \ No newline at end of file diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 4ee9b5a988..bb9e32ed46 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -9488,9 +9488,8 @@ static void DoGroundEffects_OnSpawn(struct ObjectEvent *objEvent, struct Sprite if (objEvent->triggerGroundEffectsOnMove) { flags = 0; - #if LARGE_OW_SUPPORT - sprite->subspriteMode = SUBSPRITES_ON; - #endif + if (LARGE_OW_SUPPORT && !sprite->oam.affineMode) + sprite->subspriteMode = SUBSPRITES_ON; UpdateObjectEventElevationAndPriority(objEvent, sprite); GetAllGroundEffectFlags_OnSpawn(objEvent, &flags); SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite); @@ -9507,9 +9506,8 @@ static void DoGroundEffects_OnBeginStep(struct ObjectEvent *objEvent, struct Spr if (objEvent->triggerGroundEffectsOnMove) { flags = 0; - #if LARGE_OW_SUPPORT - sprite->subspriteMode = SUBSPRITES_ON; - #endif + if (LARGE_OW_SUPPORT && !sprite->oam.affineMode) + sprite->subspriteMode = SUBSPRITES_ON; UpdateObjectEventElevationAndPriority(objEvent, sprite); GetAllGroundEffectFlags_OnBeginStep(objEvent, &flags); SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite);