Skip to content

Commit d36fe62

Browse files
committed
Squashed commit of the following:
commit 3541e8129556895a1d0a884746dede191edc9f77 Author: UberArsenal <[email protected]> Date: Fri Sep 19 12:37:04 2025 -0400 Squashed commit of the following: commit 0485c9e Author: UberArsenal <[email protected]> Date: Fri Sep 19 12:30:39 2025 -0400 Fix Professor Oak trainer set for Bulbasaur players commit 943eeb6 Author: UberArsenal <[email protected]> Date: Fri Sep 19 12:07:48 2025 -0400 Add prompt to reuse repel when effect ends commit 59da8c8 Author: PokefanMarcel <[email protected]> Date: Wed Sep 10 21:48:30 2025 +0200 Clean up home/copy2.asm (pret#531) * Use `SCREEN_WIDTH`, rename loop, and remove obsolete comment in `ClearScreenArea` * Use `SCREEN_HEIGHT` and `lb` in `CopyScreenTileBufferToVRAM` * Use `SCREEN_AREA` in `ClearScreen` commit 108bf29 Author: PokefanMarcel <[email protected]> Date: Sun Sep 7 18:46:26 2025 +0200 Use RAMG_SRAM_ENABLE (pret#530) commit b496791 Author: PokefanMarcel <[email protected]> Date: Wed Sep 3 18:01:15 2025 +0200 Document visual glitch with Pewter City Gym guy (pret#526) commit 8da7deb Author: Vortyne <[email protected]> Date: Wed Sep 3 11:59:22 2025 -0400 Update comment for clarity (pret#529) Actually copies from battle struct to party struct to make HP and status changes to a pokemon permanent commit 4d2594c Author: Narishma-gb <[email protected]> Date: Wed Sep 3 17:56:09 2025 +0200 Label and constant cleanup (pret#528) * Label cleanup, add some constants instead of raw numbers * Rename load/save game functions to be more explicit commit d98b5e6 Author: Rangi42 <[email protected]> Date: Thu Aug 28 19:22:16 2025 -0400 Document where badge and elevator floor "items" are used commit fd5dc11 Author: Rangi42 <[email protected]> Date: Wed Aug 27 11:36:32 2025 -0400 Specify file extensions that `make` does not generate commit 126c3f3 Author: Narishma-gb <[email protected]> Date: Sun Aug 17 16:00:34 2025 +0200 Document a bug in `PrintBenchGuyText` (pret#523) commit 5e8b835 Author: Rangi <[email protected]> Date: Sun Aug 17 09:58:09 2025 -0400 Use `dname` macro to automatically pad names with `"@"` characters (pret#525) commit 31fc2e2 Author: PokefanMarcel <[email protected]> Date: Sat Aug 16 14:37:08 2025 +0200 Use `<STAT>_UP1_EFFECT` constants (pret#522) commit c51d1b7 Author: Rangi42 <[email protected]> Date: Wed Aug 13 15:09:12 2025 -0400 List end markers (-1 aka $FF) are not part of table data commit 263a35a Author: Rangi42 <[email protected]> Date: Wed Aug 13 13:03:45 2025 -0400 Say how many bytes the assertion macros expected vs got commit 1eb6f61 Author: Rangi42 <[email protected]> Date: Mon Aug 11 16:31:18 2025 -0400 Identify `JOYP_SGB_MLT_REQ` constant commit bdbc8cb Author: Rangi42 <[email protected]> Date: Mon Aug 11 15:43:27 2025 -0400 Update hardware.inc to 5.3.0 and use its `JOYP_SGB_*` constants commit 6f8ee8a Author: Rangi42 <[email protected]> Date: Sun Aug 3 21:05:52 2025 -0400 Try to catch missing commas in `tmhm` learnsets commit fd86bca Author: Rangi42 <[email protected]> Date: Tue Jul 22 08:59:51 2025 -0400 Update hardware.inc to 5.2.0 commit e2f7c5c Author: kagnusdev <[email protected]> Date: Fri Jul 11 23:36:45 2025 +0200 Use hardware constants for tile attributes in VermilionDockOAMBlock (pret#516) commit 4eaccc4 Author: kagnusdev <[email protected]> Date: Tue Jul 8 00:59:17 2025 +0200 Use less generic labels for party finding loops (pret#514) commit d6e9f53 Author: Rangi <[email protected]> Date: Wed Jul 2 20:17:19 2025 -0400 Require RGBDS 0.9.3 for its DMG palette specs (pret#513) commit 3f4b3ee Author: Rangi42 <[email protected]> Date: Wed Jul 2 18:32:31 2025 -0400 Check limits for warp, bg, and object events commit aa85c00 Author: Rangi42 <[email protected]> Date: Wed Jul 2 17:25:03 2025 -0400 Define `MAX_WARP_EVENTS` commit 1e99747 Author: Rangi42 <[email protected]> Date: Mon Jun 30 13:42:56 2025 -0400 Use more audio constants commit 78e44a8 Author: Rangi42 <[email protected]> Date: Mon Jun 30 13:30:57 2025 -0400 Use combined hardware constants commit 56c405d Author: Rangi <[email protected]> Date: Mon Jun 30 12:47:22 2025 -0400 Replace hardware_constants.asm with hardware.inc (pret#511) commit fcb61ae Author: Rangi42 <[email protected]> Date: Wed Jun 25 23:59:47 2025 -0400 Distinguish single trainer pics section from Pokemon pics commit 5e5a498 Author: Rangi42 <[email protected]> Date: Wed Jun 25 11:27:38 2025 -0400 Fishing graphics make more sense horizontally commit 663b061 Author: Rangi42 <[email protected]> Date: Wed Jun 11 15:44:17 2025 -0400 Simplify `li` macro
1 parent b200d5a commit d36fe62

File tree

11 files changed

+254
-55
lines changed

11 files changed

+254
-55
lines changed

constants/event_constants.asm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
const_skip 2
99
const EVENT_PALLET_AFTER_GETTING_POKEBALLS
1010
const_skip 17
11-
const EVENT_GOT_TOWN_MAP
12-
const EVENT_ENTERED_BLUES_HOUSE
13-
const EVENT_DAISY_WALKING
14-
const_skip 5
11+
const EVENT_GOT_TOWN_MAP
12+
const EVENT_ENTERED_BLUES_HOUSE
13+
const EVENT_DAISY_WALKING
14+
const EVENT_BEAT_PROF_OAK
15+
const EVENT_OAK_BATTLE_COOLDOWN
16+
const_skip 3
1517
const EVENT_FOLLOWED_OAK_INTO_LAB_2
1618
const EVENT_OAK_ASKED_TO_CHOOSE_MON
1719
const EVENT_GOT_STARTER

constants/hide_show_constants.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,5 +236,6 @@ DEF SHOW EQU $15
236236
const HS_SEAFOAM_ISLANDS_B3F_BOULDER_4 ; E0
237237
const HS_SEAFOAM_ISLANDS_B4F_BOULDER_1 ; E1
238238
const HS_SEAFOAM_ISLANDS_B4F_BOULDER_2 ; E2
239-
const HS_ARTICUNO ; E3 X
239+
const HS_ARTICUNO ; E3 X
240+
const HS_BLUES_HOUSE_OAK ; E4
240241
DEF NUM_HS_OBJECTS EQU const_value

data/maps/hide_show_data.asm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,10 @@ Route24HS:
317317
Route25HS:
318318
db ROUTE_25, ROUTE25_TM_SEISMIC_TOSS, SHOW
319319
BluesHouseHS:
320-
db BLUES_HOUSE, BLUESHOUSE_DAISY1, SHOW
321-
db BLUES_HOUSE, BLUESHOUSE_DAISY2, HIDE
322-
db BLUES_HOUSE, BLUESHOUSE_TOWN_MAP, SHOW
320+
db BLUES_HOUSE, BLUESHOUSE_DAISY1, SHOW
321+
db BLUES_HOUSE, BLUESHOUSE_DAISY2, HIDE
322+
db BLUES_HOUSE, BLUESHOUSE_TOWN_MAP, SHOW
323+
db BLUES_HOUSE, BLUESHOUSE_OAK, HIDE
323324
OaksLabHS:
324325
db OAKS_LAB, OAKSLAB_RIVAL, SHOW
325326
db OAKS_LAB, OAKSLAB_CHARMANDER_POKE_BALL, SHOW

data/maps/objects/BluesHouse.asm

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
object_const_def
2-
const_export BLUESHOUSE_DAISY1
3-
const_export BLUESHOUSE_DAISY2
4-
const_export BLUESHOUSE_TOWN_MAP
1+
object_const_def
2+
const_export BLUESHOUSE_DAISY1
3+
const_export BLUESHOUSE_DAISY2
4+
const_export BLUESHOUSE_TOWN_MAP
5+
const_export BLUESHOUSE_OAK
56

67
BluesHouse_Object:
78
db $a ; border block
@@ -13,8 +14,9 @@ BluesHouse_Object:
1314
def_bg_events
1415

1516
def_object_events
16-
object_event 2, 3, SPRITE_DAISY, STAY, RIGHT, TEXT_BLUESHOUSE_DAISY_SITTING
17-
object_event 6, 4, SPRITE_DAISY, WALK, UP_DOWN, TEXT_BLUESHOUSE_DAISY_WALKING, 0
18-
object_event 3, 3, SPRITE_POKEDEX, STAY, NONE, TEXT_BLUESHOUSE_TOWN_MAP, 0
17+
object_event 2, 3, SPRITE_DAISY, STAY, RIGHT, TEXT_BLUESHOUSE_DAISY_SITTING
18+
object_event 6, 4, SPRITE_DAISY, WALK, UP_DOWN, TEXT_BLUESHOUSE_DAISY_WALKING, 0
19+
object_event 3, 3, SPRITE_POKEDEX, STAY, NONE, TEXT_BLUESHOUSE_TOWN_MAP, 0
20+
object_event 4, 3, SPRITE_OAK, STAY, LEFT, TEXT_BLUESHOUSE_OAK, OPP_PROF_OAK, 1
1921

2022
def_warps_to BLUES_HOUSE

data/text/text_4.asm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ _PlayerBlackedOutText::
1818
prompt
1919

2020
_RepelWoreOffText::
21-
text "REPEL's effect"
22-
line "wore off."
23-
done
21+
text "REPEL's effect"
22+
line "wore off."
23+
done
24+
25+
_UseRepelAgainText::
26+
text "Use Repel"
27+
line "Again?"
28+
done
2429

2530
_PokemartBuyingGreetingText::
2631
text "Take your time."

data/trainers/parties.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,9 @@ Rival1Data:
500500

501501
ProfOakData:
502502
; Unused
503-
db $FF, 66, TAUROS, 67, EXEGGUTOR, 68, ARCANINE, 69, BLASTOISE, 70, GYARADOS, 0
504-
db $FF, 66, TAUROS, 67, EXEGGUTOR, 68, ARCANINE, 69, VENUSAUR, 70, GYARADOS, 0
505-
db $FF, 66, TAUROS, 67, EXEGGUTOR, 68, ARCANINE, 69, CHARIZARD, 70, GYARADOS, 0
503+
db $FF, 70, BLASTOISE, 70, ELECTABUZZ, 70, TAUROS, 70, GYARADOS, 70, MACHAMP, 70, GENGAR, 0
504+
db $FF, 70, VENUSAUR, 70, ELECTABUZZ, 70, TAUROS, 70, GYARADOS, 70, MACHAMP, 70, GENGAR, 0
505+
db $FF, 70, CHARIZARD, 70, ELECTABUZZ, 70, TAUROS, 70, GYARADOS, 70, MACHAMP, 70, GENGAR, 0
506506

507507
ChiefData:
508508
; none

engine/items/item_effects.asm

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,12 +1535,15 @@ ItemUseRepel:
15351535
ld b, 100
15361536

15371537
ItemUseRepelCommon:
1538-
ld a, [wIsInBattle]
1539-
and a
1540-
jp nz, ItemUseNotTime
1541-
ld a, b
1542-
ld [wRepelRemainingSteps], a
1543-
jp PrintItemUseTextAndRemoveItem
1538+
ld a, [wIsInBattle]
1539+
and a
1540+
jp nz, ItemUseNotTime
1541+
ld a, [wCurItem]
1542+
ld [wLastRepelItem], a
1543+
ld a, b
1544+
ld [wLastRepelStepCount], a
1545+
ld [wRepelRemainingSteps], a
1546+
jp PrintItemUseTextAndRemoveItem
15441547

15451548
; handles X Accuracy item
15461549
ItemUseXAccuracy:

home/text_script.asm

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,77 @@ PlayerBlackedOutText::
207207
text_end
208208

209209
DisplayRepelWoreOffText::
210-
ld hl, RepelWoreOffText
211-
call PrintText
212-
jp AfterDisplayingTextID
210+
ld hl, RepelWoreOffText
211+
call PrintText
212+
call TryReuseRepel
213+
jp AfterDisplayingTextID
213214

214215
RepelWoreOffText::
215-
text_far _RepelWoreOffText
216-
text_end
216+
text_far _RepelWoreOffText
217+
text_end
218+
219+
UseRepelAgainText::
220+
text_far _UseRepelAgainText
221+
text_end
222+
223+
TryReuseRepel:
224+
ld a, [wLastRepelStepCount]
225+
and a
226+
ret z
227+
ld a, [wLastRepelItem]
228+
and a
229+
ret z
230+
ld b, a
231+
call GetQuantityOfItemInBag
232+
ld a, b
233+
and a
234+
ret z
235+
ld hl, UseRepelAgainText
236+
call PrintText
237+
call YesNoChoice
238+
ld a, [wCurrentMenuItem]
239+
and a
240+
ret nz
241+
ld a, [wLastRepelItem]
242+
ld [wCurItem], a
243+
call GetItemName
244+
call FindCurItemInBag
245+
ret nc
246+
ld a, 1
247+
ld [wItemQuantity], a
248+
ld hl, wNumBagItems
249+
call RemoveItemFromInventory
250+
ld a, [wLastRepelStepCount]
251+
ld [wRepelRemainingSteps], a
252+
ld [wLastRepelStepCount], a
253+
ld a, [wCurItem]
254+
ld [wLastRepelItem], a
255+
ld hl, ItemUseText00
256+
call PrintText
257+
ld a, SFX_HEAL_AILMENT
258+
call PlaySound
259+
call WaitForTextScrollButtonPress
260+
ret
261+
262+
FindCurItemInBag:
263+
ld a, [wCurItem]
264+
ld d, a
265+
ld hl, wBagItems
266+
ld c, 0
267+
.loop
268+
ld a, [hli]
269+
cp $ff
270+
jr z, .notFound
271+
cp d
272+
jr z, .found
273+
inc hl
274+
inc c
275+
jr .loop
276+
.found
277+
ld a, c
278+
ld [wWhichPokemon], a
279+
scf
280+
ret
281+
.notFound
282+
and a
283+
ret

ram/wram.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,8 @@ wDamage:: dw
15481548
ds 2
15491549

15501550
wRepelRemainingSteps:: db
1551+
wLastRepelStepCount:: db
1552+
wLastRepelItem:: db
15511553

15521554
; list of moves for FormatMovesString
15531555
wMoves:: ds NUM_MOVES

scripts/BluesHouse.asm

Lines changed: 110 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,90 @@
11
BluesHouse_Script:
2-
call EnableAutoTextBoxDrawing
3-
ld hl, BluesHouse_ScriptPointers
4-
ld a, [wBluesHouseCurScript]
5-
jp CallFunctionInTable
2+
call EnableAutoTextBoxDrawing
3+
ld hl, BluesHouseTrainerHeaders
4+
ld de, BluesHouse_ScriptPointers
5+
ld a, [wBluesHouseCurScript]
6+
call ExecuteCurMapScriptInTable
7+
ld [wBluesHouseCurScript], a
8+
ret
69

710
BluesHouse_ScriptPointers:
8-
def_script_pointers
9-
dw_const BluesHouseDefaultScript, SCRIPT_BLUESHOUSE_DEFAULT
10-
dw_const BluesHouseNoopScript, SCRIPT_BLUESHOUSE_NOOP
11+
def_script_pointers
12+
dw_const BluesHouseDefaultScript, SCRIPT_BLUESHOUSE_DEFAULT
13+
dw_const DisplayEnemyTrainerTextAndStartBattle, SCRIPT_BLUESHOUSE_START_BATTLE
14+
dw_const EndTrainerBattle, SCRIPT_BLUESHOUSE_END_BATTLE
15+
dw_const BluesHouseNoopScript, SCRIPT_BLUESHOUSE_NOOP
1116

1217
BluesHouseDefaultScript:
13-
SetEvent EVENT_ENTERED_BLUES_HOUSE
14-
ld a, SCRIPT_BLUESHOUSE_NOOP
15-
ld [wBluesHouseCurScript], a
16-
ret
18+
ld hl, wCurrentMapScriptFlags
19+
bit BIT_CUR_MAP_LOADED_1, [hl]
20+
jr z, .skip_init
21+
res BIT_CUR_MAP_LOADED_1, [hl]
22+
SetEvent EVENT_ENTERED_BLUES_HOUSE
23+
call BluesHouseUpdateOak
24+
.skip_init
25+
jp CheckFightingMapTrainers
26+
27+
BluesHouseUpdateOak:
28+
ld a, HS_BLUES_HOUSE_OAK
29+
ld [wMissableObjectIndex], a
30+
CheckEvent EVENT_BEAT_CHAMPION_RIVAL
31+
jr z, .hide_oak
32+
CheckEvent EVENT_BEAT_MEWTWO
33+
jr z, .hide_oak
34+
call BluesHouseSetOakTrainerSet
35+
predef ShowObject
36+
CheckEvent EVENT_OAK_BATTLE_COOLDOWN
37+
jr nz, .clear_cooldown
38+
ResetEvent EVENT_BEAT_PROF_OAK
39+
ret
40+
41+
.hide_oak
42+
ResetEvent EVENT_OAK_BATTLE_COOLDOWN
43+
ResetEvent EVENT_BEAT_PROF_OAK
44+
predef HideObject
45+
ret
46+
47+
.clear_cooldown
48+
ResetEvent EVENT_OAK_BATTLE_COOLDOWN
49+
ret
50+
51+
BluesHouseSetOakTrainerSet:
52+
ld a, [wPlayerStarter]
53+
cp STARTER1
54+
jr nz, .not_starter1
55+
ld b, $1
56+
jr .store_set
57+
58+
.not_starter1
59+
cp STARTER2
60+
jr nz, .not_starter2
61+
ld b, $2
62+
jr .store_set
63+
64+
.not_starter2
65+
ld b, $0
66+
67+
.store_set
68+
ld hl, wMapSpriteExtraData
69+
ld a, BLUESHOUSE_OAK
70+
dec a
71+
add a
72+
ld e, a
73+
ld d, 0
74+
add hl, de
75+
inc hl
76+
ld [hl], b
77+
ret
1778

1879
BluesHouseNoopScript:
19-
ret
80+
ret
2081

2182
BluesHouse_TextPointers:
22-
def_text_pointers
23-
dw_const BluesHouseDaisySittingText, TEXT_BLUESHOUSE_DAISY_SITTING
24-
dw_const BluesHouseDaisyWalkingText, TEXT_BLUESHOUSE_DAISY_WALKING
25-
dw_const BluesHouseTownMapText, TEXT_BLUESHOUSE_TOWN_MAP
83+
def_text_pointers
84+
dw_const BluesHouseDaisySittingText, TEXT_BLUESHOUSE_DAISY_SITTING
85+
dw_const BluesHouseDaisyWalkingText, TEXT_BLUESHOUSE_DAISY_WALKING
86+
dw_const BluesHouseTownMapText, TEXT_BLUESHOUSE_TOWN_MAP
87+
dw_const BluesHouseOakText, TEXT_BLUESHOUSE_OAK
2688

2789
BluesHouseDaisySittingText:
2890
text_asm
@@ -81,9 +143,37 @@ BluesHouseDaisyUseMapText:
81143
text_end
82144

83145
BluesHouseDaisyWalkingText:
84-
text_far _BluesHouseDaisyWalkingText
85-
text_end
146+
text_far _BluesHouseDaisyWalkingText
147+
text_end
86148

87149
BluesHouseTownMapText:
88-
text_far _BluesHouseTownMapText
89-
text_end
150+
text_far _BluesHouseTownMapText
151+
text_end
152+
153+
BluesHouseOakText:
154+
text_asm
155+
CheckEvent EVENT_BEAT_PROF_OAK
156+
jr nz, .already_defeated
157+
SetEvent EVENT_OAK_BATTLE_COOLDOWN
158+
.already_defeated
159+
ld hl, ProfOakTrainerHeader
160+
call TalkToTrainer
161+
jp TextScriptEnd
162+
163+
BluesHouseTrainerHeaders:
164+
def_trainers
165+
ProfOakTrainerHeader:
166+
trainer EVENT_BEAT_PROF_OAK, 0, BluesHouseOakBattleText, BluesHouseOakDefeatedText, BluesHouseOakAfterBattleText
167+
db -1 ; end
168+
169+
BluesHouseOakBattleText:
170+
text_far _BluesHouseOakBattleText
171+
text_end
172+
173+
BluesHouseOakDefeatedText:
174+
text_far _BluesHouseOakDefeatedText
175+
text_end
176+
177+
BluesHouseOakAfterBattleText:
178+
text_far _BluesHouseOakAfterBattleText
179+
text_end

0 commit comments

Comments
 (0)