From 2cbf9d9db089686166fe0a2e7541c725437c17ae Mon Sep 17 00:00:00 2001 From: SoupPotato Date: Thu, 31 Oct 2024 09:40:27 +0000 Subject: [PATCH] Added Sitrus and Lum Berry trees --- constants/engine_flags.asm | 2 + constants/event_flags.asm | 2 + constants/wram_constants.asm | 2 + data/events/engine_flags.asm | 2 + data/maps/attributes.asm | 2 +- maps/Route13.asm | 76 ++++++++++++++++++++++++++++++++++++ maps/Route13.blk | 3 +- maps/SilverCaveOutside.asm | 74 ++++++++++++++++++++++++++++++++++- maps/SilverCaveOutside.blk | 3 +- 9 files changed, 161 insertions(+), 5 deletions(-) diff --git a/constants/engine_flags.asm b/constants/engine_flags.asm index 3f527ff83..27644af1f 100644 --- a/constants/engine_flags.asm +++ b/constants/engine_flags.asm @@ -175,6 +175,8 @@ const ENGINE_DAILY_MOUNT_MOON_1F_MUSHROOM const ENGINE_DAILY_MOUNT_MOON_B1F_MUSHROOM const ENGINE_DAILY_MOUNT_MOON_B2F_MUSHROOM + const ENGINE_DAILY_ROUTE_13_BERRY + const ENGINE_DAILY_SILVER_CAVE_OUTSIDE_BERRY ; wDailyFlags2 const ENGINE_MT_MOON_SQUARE_CLEFAIRY const ENGINE_UNION_CAVE_LAPRAS diff --git a/constants/event_flags.asm b/constants/event_flags.asm index 6a5efbdc5..f31207cb4 100644 --- a/constants/event_flags.asm +++ b/constants/event_flags.asm @@ -452,6 +452,8 @@ const EVENT_FOSSIL_SCIENTIST_WORKING_DOME const EVENT_FOSSIL_SCIENTIST_WORKING_AMBER const EVENT_PEWTER_MUSEUM_OBTAINED_OLD_AMBER + const EVENT_ROUTE_13_BERRY + const EVENT_SILVER_CAVE_OUTSIDE_BERRY ; Unused: next 157 events const_next 600 diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index 2544ada62..c4f415ee2 100644 --- a/constants/wram_constants.asm +++ b/constants/wram_constants.asm @@ -352,6 +352,8 @@ DEF CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2 const DAILYFLAGS_MOUNT_MOON_1F_MUSHROOM ; 65 const DAILYFLAGS_MOUNT_MOON_B1F_MUSHROOM ; 66 const DAILYFLAGS_MOUNT_MOON_B2F_MUSHROOM ; 67 + const DAILYFLAGS_ROUTE13_BERRY ; 68 + const DAILYFLAGS_SILVER_CAVE_OUTSIDE_BERRY ; 69 ; wDailyFlags2:: const_def diff --git a/data/events/engine_flags.asm b/data/events/engine_flags.asm index 080a6c9bf..0adecabfc 100644 --- a/data/events/engine_flags.asm +++ b/data/events/engine_flags.asm @@ -185,6 +185,8 @@ EngineFlags: engine_flag wDailyFlags1, DAILYFLAGS_MOUNT_MOON_1F_MUSHROOM engine_flag wDailyFlags1, DAILYFLAGS_MOUNT_MOON_B1F_MUSHROOM engine_flag wDailyFlags1, DAILYFLAGS_MOUNT_MOON_B2F_MUSHROOM + engine_flag wDailyFlags1, DAILYFLAGS_ROUTE13_BERRY + engine_flag wDailyFlags1, DAILYFLAGS_SILVER_CAVE_OUTSIDE_BERRY engine_flag wDailyFlags2, DAILYFLAGS2_MT_MOON_SQUARE_CLEFAIRY_F engine_flag wDailyFlags2, DAILYFLAGS2_UNION_CAVE_LAPRAS_F diff --git a/data/maps/attributes.asm b/data/maps/attributes.asm index bc38fa697..fa837b094 100644 --- a/data/maps/attributes.asm +++ b/data/maps/attributes.asm @@ -316,7 +316,7 @@ ENDM connection north, Route13, ROUTE_13, 0 connection west, Route15, ROUTE_15, 9 - map_attributes Route13, ROUTE_13, $43, NORTH | SOUTH + map_attributes Route13, ROUTE_13, $0f, NORTH | SOUTH connection north, Route12, ROUTE_12, 28 connection south, Route14, ROUTE_14, 0 diff --git a/maps/Route13.asm b/maps/Route13.asm index 9f4bdc2cd..12a5db6d8 100644 --- a/maps/Route13.asm +++ b/maps/Route13.asm @@ -4,11 +4,27 @@ const ROUTE_13_POKEFAN_M1 const ROUTE_13_POKEFAN_M2 const ROUTE_13_POKEFAN_M3 + const ROUTE_13_YOUNGSTER3 + const ROUTE_13_YOUNGSTER4 + const ROUTE_13_LASS1 + const ROUTE_13_LASS2 + const ROUTE_13_YOUNGSTER5 + const ROUTE_13_LASS3 + const ROUTE_13_BERRY Route13_MapScripts: def_scene_scripts def_callbacks + callback MAPCALLBACK_OBJECTS, Route13Fruittree + +Route13Fruittree: +.Berry: + checkflag ENGINE_DAILY_ROUTE_13_BERRY + iftrue .NoBerry + appear ROUTE_13_BERRY +.NoBerry: + endcallback TrainerCoupleTimandSue1: trainer COUPLE, TIMANDSUE1, EVENT_BEAT_COUPLE_TIMANDSUE, CoupleTimandSueSeenText, CoupleTimandSueBeatenText, 0, .Script @@ -383,6 +399,39 @@ Route13DirectionsSign: Route13HiddenCalcium: hiddenitem CALCIUM, EVENT_ROUTE_13_HIDDEN_CALCIUM +Route13BerryTree: + opentext + getitemname STRING_BUFFER_3, SITRUS_BERRY + writetext Route13BerryTreeText + promptbutton + writetext Route13HeyItsBerryText + promptbutton + giveitem SITRUS_BERRY + iffalse Route13NoRoomInBag + disappear ROUTE_13_BERRY + setflag ENGINE_DAILY_ROUTE_13_BERRY + writetext Route13FoundItemText + playsound SFX_ITEM + waitsfx + itemnotify + closetext + end + +Route13NoBerry: + opentext + writetext Route13BerryTreeText + promptbutton + writetext Route13NothingHereText + waitbutton + closetext + end + +Route13NoRoomInBag: + writetext Route13NoRoomInBagText + waitbutton + closetext + end + PicnickerPiperSeenText: text "Hey, hey, how" line "about we bring out" @@ -625,6 +674,31 @@ Route13DirectionsSignText: line "CITY" done +Route13BerryTreeText: + text "It's a" + line "BERRY tree…" + done + +Route13NothingHereText: + text "There's nothing" + line "here…" + done + +Route13HeyItsBerryText: + text "Hey! It's" + line "@" + text_ram wStringBuffer3 + text "!" + done + +Route13FoundItemText: + text_far _FoundItemText + text_end + +Route13NoRoomInBagText: + text_far _CantCarryItemText + text_end + Route13_MapEvents: db 0, 0 ; filler @@ -637,6 +711,7 @@ Route13_MapEvents: bg_event 51, 11, BGEVENT_READ, Route13Sign bg_event 17, 13, BGEVENT_READ, Route13DirectionsSign bg_event 36, 13, BGEVENT_ITEM, Route13HiddenCalcium + bg_event 63, 3, BGEVENT_READ, Route13NoBerry def_object_events object_event 63, 11, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 3, TrainerBirdKeeperPerry, -1 @@ -650,3 +725,4 @@ Route13_MapEvents: object_event 16, 6, SPRITE_LASS, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_TRAINER, 2, TrainerPicnickerGinger, -1 object_event 52, 6, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 1, TrainerCoupleTimandSue1, -1 object_event 53, 6, SPRITE_LASS, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 1, TrainerCoupleTimandSue2, -1 + object_event 63, 3, SPRITE_BERRY, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, PAL_NPC_YELLOW, OBJECTTYPE_SCRIPT, 0, Route13BerryTree, EVENT_ROUTE_13_BERRY diff --git a/maps/Route13.blk b/maps/Route13.blk index c3c74dec0..ead031a9f 100644 --- a/maps/Route13.blk +++ b/maps/Route13.blk @@ -1,6 +1,7 @@ MCCC -MllllllCCC +Mlll¥ +lCCC M1wwwwwwwwwwwww11wwww1www4 nCCC Mwwwww1wwwwwww1wwwwwwwww1m nCCC diff --git a/maps/SilverCaveOutside.asm b/maps/SilverCaveOutside.asm index 1fdd12fd9..29c819d9d 100644 --- a/maps/SilverCaveOutside.asm +++ b/maps/SilverCaveOutside.asm @@ -1,13 +1,25 @@ + object_const_def + const SILVER_CAVE_OUTSIDE_BERRY + SilverCaveOutside_MapScripts: def_scene_scripts def_callbacks callback MAPCALLBACK_NEWMAP, SilverCaveOutsideFlypointCallback + callback MAPCALLBACK_OBJECTS, SilverCaveOutsideFruittree SilverCaveOutsideFlypointCallback: setflag ENGINE_FLYPOINT_SILVER_CAVE endcallback +SilverCaveOutsideFruittree: +.Berry: + checkflag ENGINE_DAILY_SILVER_CAVE_OUTSIDE_BERRY + iftrue .NoBerry + appear SILVER_CAVE_OUTSIDE_BERRY +.NoBerry: + endcallback + MtSilverPokecenterSign: jumpstd PokecenterSignScript @@ -17,10 +29,68 @@ MtSilverSign: SilverCaveOutsideHiddenFullRestore: hiddenitem FULL_RESTORE, EVENT_SILVER_CAVE_OUTSIDE_HIDDEN_FULL_RESTORE +SilverCaveOutsideBerryTree: + opentext + getitemname STRING_BUFFER_3, LUM_BERRY + writetext SilverCaveOutsideBerryTreeText + promptbutton + writetext SilverCaveOutsideHeyItsBerryText + promptbutton + giveitem LUM_BERRY + iffalse SilverCaveOutsideNoRoomInBag + disappear SILVER_CAVE_OUTSIDE_BERRY + setflag ENGINE_DAILY_SILVER_CAVE_OUTSIDE_BERRY + writetext SilverCaveOutsideFoundItemText + playsound SFX_ITEM + waitsfx + itemnotify + closetext + end + +SilverCaveOutsideNoBerry: + opentext + writetext SilverCaveOutsideBerryTreeText + promptbutton + writetext SilverCaveOutsideNothingHereText + waitbutton + closetext + end + +SilverCaveOutsideNoRoomInBag: + writetext SilverCaveOutsideNoRoomInBagText + waitbutton + closetext + end + MtSilverSignText: text "MT.SILVER" done +SilverCaveOutsideBerryTreeText: + text "It's a" + line "BERRY tree…" + done + +SilverCaveOutsideNothingHereText: + text "There's nothing" + line "here…" + done + +SilverCaveOutsideHeyItsBerryText: + text "Hey! It's" + line "@" + text_ram wStringBuffer3 + text "!" + done + +SilverCaveOutsideFoundItemText: + text_far _FoundItemText + text_end + +SilverCaveOutsideNoRoomInBagText: + text_far _CantCarryItemText + text_end + SilverCaveOutside_MapEvents: db 0, 0 ; filler @@ -33,6 +103,8 @@ SilverCaveOutside_MapEvents: def_bg_events bg_event 24, 19, BGEVENT_READ, MtSilverPokecenterSign bg_event 17, 13, BGEVENT_READ, MtSilverSign - bg_event 9, 25, BGEVENT_ITEM, SilverCaveOutsideHiddenFullRestore + bg_event 27, 20, BGEVENT_ITEM, SilverCaveOutsideHiddenFullRestore + bg_event 9, 25, BGEVENT_READ, SilverCaveOutsideNoBerry def_object_events + object_event 9, 25, SPRITE_BERRY, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, SilverCaveOutsideBerryTree, EVENT_SILVER_CAVE_OUTSIDE_BERRY diff --git a/maps/SilverCaveOutside.blk b/maps/SilverCaveOutside.blk index 87a67df4f..1271ea749 100644 --- a/maps/SilverCaveOutside.blk +++ b/maps/SilverCaveOutside.blk @@ -1,8 +1,7 @@ ,,),,),,,$WW*,,,,,,,,,),,),,,,,,(,,,,,,,WW%,,),,,,,,$WWW*,,,,,,,,)+WWW*,,,,,$WWW,,,,,)),,,$W*,,,,,WWWWW%)+WW*$WW*,,,,,,,,,))1(,,,(,,+W,,,,,+%)1 $W*,$W*),,,,,,)+%  !(,,,$%,WWWWW%) |r$WWWWWW,,,,,,) X11Z/lll,+WWWW% Z/o -`,) -Y +`,)¥Y  5ln,)/[ e-/,)