diff --git a/constants/collision_constants.asm b/constants/collision_constants.asm index a183e8c..c683ff6 100644 --- a/constants/collision_constants.asm +++ b/constants/collision_constants.asm @@ -62,7 +62,7 @@ DEF COLL_PIT EQU $60 DEF COLL_VIRTUAL_BOY EQU $61 ; garbage DEF COLL_64 EQU $64 ; garbage DEF COLL_65 EQU $65 ; garbage -DEF COLL_PIT_68 EQU $68 ; unused +DEF COLL_SWITCH EQU $68 ; Previously PIT_68, changed to make a non-warping equivalent to the pit, allowing for RBY cave switch mechanics DEF COLL_WARP_CARPET_DOWN EQU $70 DEF COLL_DOOR EQU $71 DEF COLL_LADDER EQU $72 diff --git a/constants/event_flags.asm b/constants/event_flags.asm index 2a89ca6..a64e074 100644 --- a/constants/event_flags.asm +++ b/constants/event_flags.asm @@ -1503,7 +1503,10 @@ const EVENT_RADIO_TOWER_5F_ULTRA_BALL const EVENT_DARK_CAVE_VIOLET_ENTRANCE_DIRE_HIT const EVENT_BATTLE_TOWER_OPEN_CIVILIANS -; Unused: next 48 events + const EVENT_WINNERS_PATH_ITEM1 + const EVENT_WINNERS_PATH_ITEM2 + const EVENT_WINNERS_PATH_SWITCH_PRESSED +; Unused: next 45 events ; Nihon Trainers const EVENT_BEAT_BUG_CATCHER_ELWYN diff --git a/data/collision/collision_permissions.asm b/data/collision/collision_permissions.asm index 188338c..645ab3f 100644 --- a/data/collision/collision_permissions.asm +++ b/data/collision/collision_permissions.asm @@ -105,7 +105,7 @@ TileCollisionTable:: db LAND_TILE ; COLL_65 db LAND_TILE ; 66 db LAND_TILE ; 67 - db LAND_TILE ; COLL_PIT_68 + db LAND_TILE ; COLL_SWITCH db LAND_TILE ; 69 db WALL_TILE ; 6a db LAND_TILE ; 6b diff --git a/data/tilesets/cave_attributes.bin b/data/tilesets/cave_attributes.bin index be6ecae..48efcf3 100644 Binary files a/data/tilesets/cave_attributes.bin and b/data/tilesets/cave_attributes.bin differ diff --git a/data/tilesets/cave_collision.asm b/data/tilesets/cave_collision.asm index f39e842..9870e19 100644 --- a/data/tilesets/cave_collision.asm +++ b/data/tilesets/cave_collision.asm @@ -77,7 +77,7 @@ tilecoll FLOOR, FLOOR, WALL, FLOOR ; 4c tilecoll UP_WALL, UP_WALL, FLOOR, FLOOR ; 4d tilecoll UP_WALL, UP_WALL, FLOOR, FLOOR ; 4e - tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 4f + tilecoll FLOOR, SWITCH, FLOOR, FLOOR ; 4f tilecoll FLOOR, WALL, FLOOR, FLOOR ; 50 tilecoll WALL, FLOOR, FLOOR, FLOOR ; 51 tilecoll WALL, FLOOR, FLOOR, LADDER ; 52 @@ -85,4 +85,6 @@ tilecoll WATER, WATER, WATER, WATER ; 54 tilecoll WATER, WALL, WATER, WALL ; 55 tilecoll WATER, WALL, WALL, WALL ; 56 - tilecoll WALL, WALL, FLOOR, WARP_CARPET_DOWN ; 57 + tilecoll WALL, WALL, WALL, FLOOR ; 57 + tilecoll FLOOR, WALL, FLOOR, WARP_CARPET_DOWN ; 58 + tilecoll FLOOR, SWITCH, FLOOR, FLOOR ; 59 diff --git a/data/tilesets/cave_metatiles.bin b/data/tilesets/cave_metatiles.bin index de979d1..686eebd 100644 Binary files a/data/tilesets/cave_metatiles.bin and b/data/tilesets/cave_metatiles.bin differ diff --git a/engine/overworld/map_setup.asm b/engine/overworld/map_setup.asm index e70f9ab..c55f308 100644 --- a/engine/overworld/map_setup.asm +++ b/engine/overworld/map_setup.asm @@ -82,9 +82,6 @@ LoadMapObjects: farcall InitializeVisibleSprites ret -MapSetup_DummyFunction: ; unreferenced - ret - ResetPlayerObjectAction: ld hl, wPlayerSpriteSetupFlags set PLAYERSPRITESETUP_RESET_ACTION_F, [hl] diff --git a/engine/overworld/tile_events.asm b/engine/overworld/tile_events.asm index d5d07c1..36b4944 100644 --- a/engine/overworld/tile_events.asm +++ b/engine/overworld/tile_events.asm @@ -3,8 +3,6 @@ CheckWarpCollision:: ld a, [wPlayerTile] cp COLL_PIT jr z, .warp - cp COLL_PIT_68 - jr z, .warp and $f0 cp HI_NYBBLE_WARPS jr z, .warp diff --git a/gfx/tilesets/cave.png b/gfx/tilesets/cave.png index dc3348a..40eaacc 100644 Binary files a/gfx/tilesets/cave.png and b/gfx/tilesets/cave.png differ diff --git a/home/map_objects.asm b/home/map_objects.asm index bd17c0f..9bd0377 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -153,7 +153,7 @@ CheckCounterTile:: CheckPitTile:: cp COLL_PIT ret z - cp COLL_PIT_68 + cp COLL_SWITCH ret CheckIceTile:: @@ -519,16 +519,6 @@ _GetMovementIndex:: ld a, h ret -SetVramState_Bit0:: ; unreferenced - ld hl, wVramState - set 0, [hl] - ret - -ResetVramState_Bit0:: ; unreferenced - ld hl, wVramState - res 0, [hl] - ret - UpdateSprites:: ld a, [wVramState] bit 0, a diff --git a/maps/BurnedTower1F.asm b/maps/BurnedTower1F.asm index 60e0b8a..cb0e7d4 100644 --- a/maps/BurnedTower1F.asm +++ b/maps/BurnedTower1F.asm @@ -282,17 +282,17 @@ BurnedTower1F_MapEvents: warp_event 9, 15, ECRUTEAK_CITY, 13 warp_event 10, 15, ECRUTEAK_CITY, 13 warp_event 10, 9, BURNED_TOWER_B1F, 1 - warp_event 5, 5, BURNED_TOWER_B1F, 1 ; inaccessible, left over from G/S - warp_event 5, 6, BURNED_TOWER_B1F, 1 ; inaccessible, left over from G/S - warp_event 4, 6, BURNED_TOWER_B1F, 1 ; inaccessible, left over from G/S - warp_event 15, 4, BURNED_TOWER_B1F, 2 ; inaccessible, left over from G/S - warp_event 15, 5, BURNED_TOWER_B1F, 2 ; inaccessible, left over from G/S - warp_event 10, 7, BURNED_TOWER_B1F, 3 ; inaccessible, left over from G/S - warp_event 5, 14, BURNED_TOWER_B1F, 4 ; inaccessible, left over from G/S - warp_event 4, 14, BURNED_TOWER_B1F, 4 ; inaccessible, left over from G/S - warp_event 14, 14, BURNED_TOWER_B1F, 5 ; inaccessible, left over from G/S - warp_event 15, 14, BURNED_TOWER_B1F, 5 ; inaccessible, left over from G/S - warp_event 7, 15, BURNED_TOWER_B1F, 6 ; inaccessible, left over from G/S +; warp_event 5, 5, BURNED_TOWER_B1F, 1 ; inaccessible, left over from G/S +; warp_event 5, 6, BURNED_TOWER_B1F, 1 ; inaccessible, left over from G/S +; warp_event 4, 6, BURNED_TOWER_B1F, 1 ; inaccessible, left over from G/S +; warp_event 15, 4, BURNED_TOWER_B1F, 2 ; inaccessible, left over from G/S +; warp_event 15, 5, BURNED_TOWER_B1F, 2 ; inaccessible, left over from G/S +; warp_event 10, 7, BURNED_TOWER_B1F, 3 ; inaccessible, left over from G/S +; warp_event 5, 14, BURNED_TOWER_B1F, 4 ; inaccessible, left over from G/S +; warp_event 4, 14, BURNED_TOWER_B1F, 4 ; inaccessible, left over from G/S +; warp_event 14, 14, BURNED_TOWER_B1F, 5 ; inaccessible, left over from G/S +; warp_event 15, 14, BURNED_TOWER_B1F, 5 ; inaccessible, left over from G/S +; warp_event 7, 15, BURNED_TOWER_B1F, 6 ; inaccessible, left over from G/S def_coord_events coord_event 11, 9, SCENE_BURNEDTOWER1F_RIVAL_BATTLE, BurnedTowerRivalBattleScript diff --git a/maps/BurnedTowerB1F.asm b/maps/BurnedTowerB1F.asm index c3d148b..f8ab6b1 100644 --- a/maps/BurnedTowerB1F.asm +++ b/maps/BurnedTowerB1F.asm @@ -155,12 +155,6 @@ BurnedTowerSuicuneMovement2: remove_sliding step_end -BurnedTowerUnusedMovement: ; unreferenced - set_sliding - big_step DOWN - remove_sliding - step_end - BurnedTowerSuicuneMovement3: set_sliding big_step UP diff --git a/maps/DebugRoom.asm b/maps/DebugRoom.asm index 5d36b1b..583029a 100644 --- a/maps/DebugRoom.asm +++ b/maps/DebugRoom.asm @@ -502,7 +502,7 @@ DebugRoom_MapEvents: warp_event 19, 34, BLUE_FOREST, 1 ; southern warp warp_event 33, 33, BLUE_FOREST, 1 ; southeast warp warp_event 5, 3, AZALEA_TOWN, 1 - warp_event 34, 11, WINNERS_PATH_OUTSIDE, 1 + warp_event 34, 11, WINNERS_PATH, 3 def_coord_events diff --git a/maps/IlexForest.asm b/maps/IlexForest.asm index 4db77c3..d503cc8 100644 --- a/maps/IlexForest.asm +++ b/maps/IlexForest.asm @@ -420,9 +420,6 @@ IlexForestHiddenSuperPotion: IlexForestHiddenFullHeal: hiddenitem FULL_HEAL, EVENT_ILEX_FOREST_HIDDEN_FULL_HEAL -IlexForestBoulder: ; unreferenced - jumpstd StrengthBoulderScript - IlexForestSignpost: jumptext IlexForestSignpostText diff --git a/maps/WinnersPath.ablk b/maps/WinnersPath.ablk index 56b7247..5ae8447 100644 --- a/maps/WinnersPath.ablk +++ b/maps/WinnersPath.ablk @@ -3,10 +3,10 @@ A&1@2' ST 0U $&VN#M ....................  -+)K -)))! -))( -( !+JWN#M ....................   + +K +)O+) ) +(*))(( +( +JXJN#M ....................   *E*B   diff --git a/maps/WinnersPath.asm b/maps/WinnersPath.asm index f6f71d4..ee5c7df 100644 --- a/maps/WinnersPath.asm +++ b/maps/WinnersPath.asm @@ -1,9 +1,71 @@ object_const_def + const WINNERS_PATH_COOLTRAINERM1 + const WINNERS_PATH_COOLTRAINERM2 + const WINNERS_PATH_BEAUTY + const WINNERS_PATH_BOULDER1 + const WINNERS_PATH_NPCITEM1 + const WINNERS_PATH_NPCITEM2 + const WINNERS_PATH_ROCK WinnersPath_MapScripts: def_scene_scripts def_callbacks + callback MAPCALLBACK_TILES, WinnersPathSwitchClickCallback + callback MAPCALLBACK_CMDQUEUE, WinnersPathSwitchCallback + +; This replicates the boulder switch functionality of RBY. +; Not sure why they removed this to be honest, it's quite nice. +; This is extremely hacky and the boulder won't move if you reload the map and put it back on the switch, but given there's no function for switches and I can't be bothered to make one, this will do. +WinnersPathSwitchCallback: + checkevent EVENT_WINNERS_PATH_SWITCH_PRESSED + iftrue .noBoulderNeeded + writecmdqueue .CommandQueue +.noBoulderNeeded + endcallback + +.CommandQueue: + cmdqueue CMDQUEUE_STONETABLE, .StoneTable ; check if any stones are sitting on a warp (or in our case, the switch) + +.StoneTable: + stonetable 7, WINNERS_PATH_BOULDER1, .Boulder1 + db -1 ; end + +.Boulder1: + checkevent EVENT_WINNERS_PATH_SWITCH_PRESSED + iftrue .skip + pause 30 + scall .switchClicked + setevent EVENT_WINNERS_PATH_SWITCH_PRESSED + opentext + writetext WinnersPathDoorOpenedText + waitbutton + closetext + changeblock 2, 22, $1C ; boulder gate + changeblock 4, 24, $59 ; switch + reloadmappart + delcmdqueue CMDQUEUE_STONETABLE, .StoneTable + ; fallthrough +.skip + end + +.switchClicked: + playsound SFX_STRENGTH + earthquake 80 + end + +WinnersPathSwitchClickCallback: + checkevent EVENT_WINNERS_PATH_SWITCH_PRESSED + iffalse .keepBlock + changeblock 2, 22, $1C ; boulder gate + changeblock 4, 24, $59 ; switch +.keepBlock + endcallback + +WinnersPathDoorOpenedText: + text "The switch was" + line "pressed!" + done WinnersPathSign1Script: jumptext WinnersPathSign1Text @@ -119,16 +181,29 @@ BeautyJaclynAfterBattleText: line "CHAMPIONs! Eek!" done +WinnersPathBoulder: + jumpstd StrengthBoulderScript + +WinnersPathRock: + jumpstd SmashRockScript + +WinnersPathItem1: + itemball TM_CURSE + +WinnersPathItem2: + itemball TM_ROLLOUT + WinnersPath_MapEvents: db 0, 0 ; filler def_warp_events warp_event 3, 49, WINNERS_PATH_OUTSIDE, 3 warp_event 17, 39, WINNERS_PATH, 3 - warp_event 17, 29, WINNERS_PATH, 2 + warp_event 15, 29, WINNERS_PATH, 2 warp_event 3, 21, WINNERS_PATH, 5 warp_event 3, 11, WINNERS_PATH, 4 warp_event 17, 5, WINNERS_PATH_OUTSIDE, 4 ; Some Route... + warp_event 5, 24, WINNERS_PATH_OUTSIDE, 4 ; Dummy warp for the switch. Hope this works! def_coord_events @@ -138,5 +213,9 @@ WinnersPath_MapEvents: def_object_events object_event 9, 43, SPRITE_COOLTRAINER_M, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 2, TrainerCoolTrainerErick, -1 - object_event 5, 22, SPRITE_COOLTRAINER_M, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 2, TrainerCoolTrainerAndy, -1 + object_event 8, 22, SPRITE_COOLTRAINER_M, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 2, TrainerCoolTrainerAndy, -1 object_event 7, 8, SPRITE_BEAUTY, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 2, TrainerBeautyJaclyn, -1 + object_event 14, 23, SPRITE_BOULDER, SPRITEMOVEDATA_STRENGTH_BOULDER, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, WinnersPathBoulder, -1 + object_event 10, 6, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, WinnersPathItem1, EVENT_WINNERS_PATH_ITEM1 + object_event 2, 29, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, WinnersPathItem2, EVENT_WINNERS_PATH_ITEM2 + object_event 3, 28, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, WinnersPathRock, -1