You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Further split bank 4
This commit is contained in:
136
event/bug_contest_2.asm
Executable file
136
event/bug_contest_2.asm
Executable file
@@ -0,0 +1,136 @@
|
||||
Special_SelectRandomBugContestContestants: ; 139a8
|
||||
; Select five random people to participate in the current contest.
|
||||
|
||||
; First we have to make sure that any old data is cleared away.
|
||||
ld c, 10 ; Number of people to choose from.
|
||||
ld hl, BugCatchingContestantEventFlagTable
|
||||
.loop1
|
||||
push bc
|
||||
push hl
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld d, [hl]
|
||||
ld b, RESET_FLAG
|
||||
call EventFlagAction
|
||||
pop hl
|
||||
rept 2
|
||||
inc hl
|
||||
endr
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .loop1
|
||||
|
||||
; Now that that's out of the way, we can get on to the good stuff.
|
||||
ld c, 5
|
||||
.loop2
|
||||
push bc
|
||||
.next
|
||||
; Choose a flag at uniform random to be set.
|
||||
call Random
|
||||
cp $fa ; 250
|
||||
jr nc, .next
|
||||
ld c, $19 ; 25
|
||||
call SimpleDivide
|
||||
ld e, b
|
||||
ld d, 0
|
||||
ld hl, BugCatchingContestantEventFlagTable
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld d, [hl]
|
||||
push de
|
||||
; If we've already set it, it doesn't count.
|
||||
ld b, CHECK_FLAG
|
||||
call EventFlagAction
|
||||
pop de
|
||||
ld a, c
|
||||
and a
|
||||
jr nz, .next
|
||||
; Set the flag. This will cause that sprite to not be visible in the contest.
|
||||
ld b, SET_FLAG
|
||||
call EventFlagAction
|
||||
pop bc
|
||||
; Check if we're done. If so, return. Otherwise, choose the next victim.
|
||||
dec c
|
||||
jr nz, .loop2
|
||||
ret
|
||||
; 139ed
|
||||
|
||||
Special_CheckBugContestContestantFlag: ; 139ed
|
||||
; Checks the flag of the Bug Catching Contestant whose index is loaded in a.
|
||||
|
||||
; Bug: If a >= 10 when this is called, it will read beyond the table.
|
||||
|
||||
ld hl, BugCatchingContestantEventFlagTable
|
||||
ld e, a
|
||||
ld d, 0
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld d, [hl]
|
||||
ld b, CHECK_FLAG
|
||||
call EventFlagAction
|
||||
ret
|
||||
; 139fe
|
||||
|
||||
BugCatchingContestantEventFlagTable: ; 139fe
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_1A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_2A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_3A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_4A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_5A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_6A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_7A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_8A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_9A
|
||||
dw EVENT_BUG_CATCHING_CONTESTANT_10A
|
||||
; 13a12
|
||||
|
||||
ContestDropOffMons: ; 13a12
|
||||
ld hl, PartyMon1HP
|
||||
ld a, [hli]
|
||||
or [hl]
|
||||
jr z, .fainted
|
||||
; Mask the rest of your party by setting the count to 1...
|
||||
ld hl, PartyCount
|
||||
ld a, 1
|
||||
ld [hli], a
|
||||
inc hl
|
||||
; ... backing up the second mon index somewhere...
|
||||
ld a, [hl]
|
||||
ld [wBugContestSecondPartySpecies], a
|
||||
; ... and replacing it with the terminator byte
|
||||
ld [hl], $ff
|
||||
xor a
|
||||
ld [ScriptVar], a
|
||||
ret
|
||||
|
||||
.fainted
|
||||
ld a, $1
|
||||
ld [ScriptVar], a
|
||||
ret
|
||||
; 13a31
|
||||
|
||||
ContestReturnMons: ; 13a31
|
||||
; Restore the species of the second mon.
|
||||
ld hl, PartySpecies + 1
|
||||
ld a, [wBugContestSecondPartySpecies]
|
||||
ld [hl], a
|
||||
; Restore the party count, which must be recomputed.
|
||||
ld b, $1
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp $ff
|
||||
jr z, .done
|
||||
inc b
|
||||
jr .loop
|
||||
|
||||
.done
|
||||
ld a, b
|
||||
ld [PartyCount], a
|
||||
ret
|
||||
; 13a47
|
||||
480
event/bug_contest_judging.asm
Executable file
480
event/bug_contest_judging.asm
Executable file
@@ -0,0 +1,480 @@
|
||||
_BugContestJudging: ; 1369d
|
||||
call ContestScore
|
||||
callba MobileFn_105f79
|
||||
call Function13819
|
||||
ld a, [wd00a]
|
||||
call LoadContestantName
|
||||
ld a, [wd00b]
|
||||
ld [wd265], a
|
||||
call GetPokemonName
|
||||
ld hl, BugContest_ThirdPlaceText
|
||||
call PrintText
|
||||
ld a, [EndFlypoint]
|
||||
call LoadContestantName
|
||||
ld a, [MovementBuffer]
|
||||
ld [wd265], a
|
||||
call GetPokemonName
|
||||
ld hl, BugContest_SecondPlaceText
|
||||
call PrintText
|
||||
ld a, [wd002]
|
||||
call LoadContestantName
|
||||
ld a, [wd003]
|
||||
ld [wd265], a
|
||||
call GetPokemonName
|
||||
ld hl, BugContest_FirstPlaceText
|
||||
call PrintText
|
||||
jp Function13807
|
||||
; 136eb
|
||||
|
||||
BugContest_FirstPlaceText: ; 0x136eb
|
||||
text_jump ContestJudging_FirstPlaceText
|
||||
start_asm
|
||||
BugContest_FirstPlace: ; 136f0
|
||||
ld de, SFX_1ST_PLACE
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
ld hl, BugContest_FirstPlaceScoreText
|
||||
ret
|
||||
; 136fd
|
||||
|
||||
BugContest_FirstPlaceScoreText: ; 0x136fd
|
||||
; The winning score was @ points!
|
||||
text_jump ContestJudging_FirstPlaceScoreText
|
||||
db "@"
|
||||
; 0x13702
|
||||
|
||||
BugContest_SecondPlaceText: ; 0x13702
|
||||
; Placing second was @ , who caught a @ !@ @
|
||||
text_jump ContestJudging_SecondPlaceText
|
||||
start_asm
|
||||
BugContest_SecondPlace: ; 13707
|
||||
ld de, SFX_2ND_PLACE
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
ld hl, BugContest_SecondPlaceScoreText
|
||||
ret
|
||||
; 13714
|
||||
|
||||
BugContest_SecondPlaceScoreText: ; 0x13714
|
||||
; The score was @ points!
|
||||
text_jump ContestJudging_SecondPlaceScoreText
|
||||
db "@"
|
||||
; 0x13719
|
||||
|
||||
BugContest_ThirdPlaceText: ; 0x13719
|
||||
; Placing third was @ , who caught a @ !@ @
|
||||
text_jump ContestJudging_ThirdPlaceText
|
||||
start_asm
|
||||
; 0x1371e
|
||||
|
||||
BugContest_ThirdPlace: ; 1371e
|
||||
ld de, SFX_3RD_PLACE
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
ld hl, BugContest_ThirdPlaceScoreText
|
||||
ret
|
||||
; 1372b
|
||||
|
||||
BugContest_ThirdPlaceScoreText: ; 0x1372b
|
||||
; The score was @ points!
|
||||
text_jump ContestJudging_ThirdPlaceScoreText
|
||||
db "@"
|
||||
; 0x13730
|
||||
|
||||
LoadContestantName: ; 13730
|
||||
|
||||
; If a = 0, get your name.
|
||||
dec a
|
||||
jr z, .done
|
||||
; Find the pointer for the trainer class of the Bug Catching Contestant whose ID is in a.
|
||||
ld c, a
|
||||
ld b, 0
|
||||
ld hl, BugContestantPointers
|
||||
rept 2
|
||||
add hl, bc
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
; Copy the Trainer Class to c.
|
||||
ld a, [hli]
|
||||
ld c, a
|
||||
; Save hl and bc for later.
|
||||
push hl
|
||||
push bc
|
||||
; Get the Trainer Class name and copy it into wd016.
|
||||
callab GetTrainerClassName
|
||||
ld hl, StringBuffer1
|
||||
ld de, wd016
|
||||
ld bc, TRAINER_CLASS_NAME_LENGTH
|
||||
call CopyBytes
|
||||
ld hl, wd016
|
||||
; Delete the trailing terminator and replace it with a space.
|
||||
.next
|
||||
ld a, [hli]
|
||||
cp "@"
|
||||
jr nz, .next
|
||||
dec hl
|
||||
ld [hl], " "
|
||||
inc hl
|
||||
ld d, h
|
||||
ld e, l
|
||||
; Restore the Trainer Class ID and Trainer ID pointer. Save de for later.
|
||||
pop bc
|
||||
pop hl
|
||||
push de
|
||||
; Get the name of the trainer with class c and ID b.
|
||||
ld a, [hl]
|
||||
ld b, a
|
||||
callab GetTrainerName
|
||||
; Append the name to wd016.
|
||||
ld hl, StringBuffer1
|
||||
pop de
|
||||
ld bc, NAME_LENGTH - 1
|
||||
jp CopyBytes
|
||||
|
||||
.done
|
||||
ld hl, PlayerName
|
||||
ld de, wd016
|
||||
ld bc, NAME_LENGTH
|
||||
jp CopyBytes
|
||||
; 13783
|
||||
|
||||
BugContestantPointers: ; 13783
|
||||
dw BugContestant_BugCatcherDon ; This reverts back to the player
|
||||
dw BugContestant_BugCatcherDon
|
||||
dw BugContestant_BugCatcherEd
|
||||
dw BugContestant_CooltrainerMNick
|
||||
dw BugContestant_PokefanMWilliam
|
||||
dw BugContestant_BugCatcherBenny
|
||||
dw BugContestant_CamperBarry
|
||||
dw BugContestant_PicnickerCindy
|
||||
dw BugContestant_BugCatcherJosh
|
||||
dw BugContestant_YoungsterSamuel
|
||||
dw BugContestant_SchoolboyKipp
|
||||
; 13799
|
||||
|
||||
BugContestant_BugCatcherDon:
|
||||
db BUG_CATCHER, DON
|
||||
dbw KAKUNA, 300
|
||||
dbw METAPOD, 285
|
||||
dbw CATERPIE, 226
|
||||
|
||||
BugContestant_BugCatcherEd:
|
||||
db BUG_CATCHER, ED
|
||||
dbw BUTTERFREE, 286
|
||||
dbw BUTTERFREE, 251
|
||||
dbw CATERPIE, 237
|
||||
|
||||
BugContestant_CooltrainerMNick:
|
||||
db COOLTRAINERM, NICK
|
||||
dbw SCYTHER, 357
|
||||
dbw BUTTERFREE, 349
|
||||
dbw PINSIR, 368
|
||||
|
||||
BugContestant_PokefanMWilliam:
|
||||
db POKEFANM, WILLIAM
|
||||
dbw PINSIR, 332
|
||||
dbw BUTTERFREE, 324
|
||||
dbw VENONAT, 321
|
||||
|
||||
BugContestant_BugCatcherBenny:
|
||||
db BUG_CATCHER, BUG_CATCHER_BENNY
|
||||
dbw BUTTERFREE, 318
|
||||
dbw WEEDLE, 295
|
||||
dbw CATERPIE, 285
|
||||
|
||||
BugContestant_CamperBarry:
|
||||
db CAMPER, BARRY
|
||||
dbw PINSIR, 366
|
||||
dbw VENONAT, 329
|
||||
dbw KAKUNA, 314
|
||||
|
||||
BugContestant_PicnickerCindy:
|
||||
db PICNICKER, CINDY
|
||||
dbw BUTTERFREE, 341
|
||||
dbw METAPOD, 301
|
||||
dbw CATERPIE, 264
|
||||
|
||||
BugContestant_BugCatcherJosh:
|
||||
db BUG_CATCHER, JOSH
|
||||
dbw SCYTHER, 326
|
||||
dbw BUTTERFREE, 292
|
||||
dbw METAPOD, 282
|
||||
|
||||
BugContestant_YoungsterSamuel:
|
||||
db YOUNGSTER, SAMUEL
|
||||
dbw WEEDLE, 270
|
||||
dbw PINSIR, 282
|
||||
dbw CATERPIE, 251
|
||||
|
||||
BugContestant_SchoolboyKipp:
|
||||
db SCHOOLBOY, KIPP
|
||||
dbw VENONAT, 267
|
||||
dbw PARAS, 254
|
||||
dbw KAKUNA, 259
|
||||
; 13807
|
||||
|
||||
Function13807: ; 13807
|
||||
ld hl, wd00a
|
||||
ld de, -4
|
||||
ld b, 3
|
||||
.loop
|
||||
ld a, [hl]
|
||||
cp 1
|
||||
jr z, .done
|
||||
add hl, de
|
||||
dec b
|
||||
jr nz, .loop
|
||||
|
||||
.done
|
||||
ret
|
||||
; 13819
|
||||
|
||||
Function13819: ; 13819
|
||||
call Function13833
|
||||
call Function138b0
|
||||
ld hl, wd00e
|
||||
ld a, 1
|
||||
ld [hli], a
|
||||
ld a, [wContestMon]
|
||||
ld [hli], a
|
||||
ld a, [hProduct]
|
||||
ld [hli], a
|
||||
ld a, [hMultiplicand]
|
||||
ld [hl], a
|
||||
call Function1383e
|
||||
ret
|
||||
; 13833
|
||||
|
||||
Function13833: ; 13833
|
||||
ld hl, wd002
|
||||
ld b, 12
|
||||
xor a
|
||||
.loop
|
||||
ld [hli], a
|
||||
dec b
|
||||
jr nz, .loop
|
||||
ret
|
||||
; 1383e
|
||||
|
||||
Function1383e: ; 1383e
|
||||
ld de, wd010
|
||||
ld hl, wd004
|
||||
ld c, 2
|
||||
call StringCmp
|
||||
jr c, .next
|
||||
ld hl, EndFlypoint
|
||||
ld de, wd00a
|
||||
ld bc, 4
|
||||
call CopyBytes
|
||||
ld hl, wd002
|
||||
ld de, EndFlypoint
|
||||
ld bc, 4
|
||||
call CopyBytes
|
||||
ld hl, wd002
|
||||
call Function138a0
|
||||
jr .done
|
||||
|
||||
.next
|
||||
ld de, wd010
|
||||
ld hl, wd008
|
||||
ld c, 2
|
||||
call StringCmp
|
||||
jr c, .next2
|
||||
ld hl, EndFlypoint
|
||||
ld de, wd00a
|
||||
ld bc, 4
|
||||
call CopyBytes
|
||||
ld hl, EndFlypoint
|
||||
call Function138a0
|
||||
jr .done
|
||||
|
||||
.next2
|
||||
ld de, wd010
|
||||
ld hl, wd00c
|
||||
ld c, 2
|
||||
call StringCmp
|
||||
jr c, .done
|
||||
ld hl, wd00a
|
||||
call Function138a0
|
||||
|
||||
.done
|
||||
ret
|
||||
; 138a0
|
||||
|
||||
Function138a0: ; 138a0
|
||||
ld de, wd00e
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hl], a
|
||||
ret
|
||||
; 138b0
|
||||
|
||||
Function138b0: ; 138b0
|
||||
ld e, 0
|
||||
.loop
|
||||
push de
|
||||
call Special_CheckBugContestContestantFlag
|
||||
pop de
|
||||
jr nz, .done
|
||||
ld a, e
|
||||
rept 2
|
||||
inc a
|
||||
endr
|
||||
ld [wd00e], a
|
||||
dec a
|
||||
ld c, a
|
||||
ld b, 0
|
||||
ld hl, BugContestantPointers
|
||||
rept 2
|
||||
add hl, bc
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
rept 2
|
||||
inc hl
|
||||
endr
|
||||
.loop2
|
||||
call Random
|
||||
and 3
|
||||
cp 3
|
||||
jr z, .loop2
|
||||
ld c, a
|
||||
ld b, 0
|
||||
rept 3
|
||||
add hl, bc
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld [wd00f], a
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
call Random
|
||||
and 7
|
||||
ld c, a
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, h
|
||||
ld [wd010], a
|
||||
ld a, l
|
||||
ld [wd011], a
|
||||
push de
|
||||
call Function1383e
|
||||
pop de
|
||||
|
||||
.done
|
||||
inc e
|
||||
ld a, e
|
||||
cp 10
|
||||
jr nz, .loop
|
||||
ret
|
||||
; 13900
|
||||
|
||||
ContestScore: ; 13900
|
||||
; Determine the player's score in the Bug Catching Contest.
|
||||
|
||||
xor a
|
||||
ld [hProduct], a
|
||||
ld [hMultiplicand], a
|
||||
|
||||
ld a, [wContestMonSpecies] ; Species
|
||||
and a
|
||||
jr z, .done
|
||||
|
||||
; Tally the following:
|
||||
|
||||
; Max HP * 4
|
||||
ld a, [wContestMonMaxHP + 1]
|
||||
call .AddContestStat
|
||||
ld a, [wContestMonMaxHP + 1]
|
||||
call .AddContestStat
|
||||
ld a, [wContestMonMaxHP + 1]
|
||||
call .AddContestStat
|
||||
ld a, [wContestMonMaxHP + 1]
|
||||
call .AddContestStat
|
||||
|
||||
; Stats
|
||||
ld a, [wContestMonAttack + 1]
|
||||
call .AddContestStat
|
||||
ld a, [wContestMonDefense + 1]
|
||||
call .AddContestStat
|
||||
ld a, [wContestMonSpeed + 1]
|
||||
call .AddContestStat
|
||||
ld a, [wContestMonSpclAtk + 1]
|
||||
call .AddContestStat
|
||||
ld a, [wContestMonSpclDef + 1]
|
||||
call .AddContestStat
|
||||
|
||||
; DVs
|
||||
ld a, [wContestMonDVs + 0]
|
||||
ld b, a
|
||||
and 2
|
||||
rept 2
|
||||
add a
|
||||
endr
|
||||
ld c, a
|
||||
|
||||
swap b
|
||||
ld a, b
|
||||
and 2
|
||||
add a
|
||||
add c
|
||||
ld d, a
|
||||
|
||||
ld a, [wContestMonDVs + 1]
|
||||
ld b, a
|
||||
and 2
|
||||
ld c, a
|
||||
|
||||
swap b
|
||||
ld a, b
|
||||
and 2
|
||||
srl a
|
||||
rept 2
|
||||
add c
|
||||
endr
|
||||
rept 2
|
||||
add d
|
||||
endr
|
||||
|
||||
call .AddContestStat
|
||||
|
||||
; Remaining HP / 8
|
||||
ld a, [wContestMonHP + 1]
|
||||
srl a
|
||||
srl a
|
||||
srl a
|
||||
call .AddContestStat
|
||||
|
||||
; Whether it's holding an item
|
||||
ld a, [wContestMonItem]
|
||||
and a
|
||||
jr z, .done
|
||||
|
||||
ld a, 1
|
||||
call .AddContestStat
|
||||
|
||||
.done
|
||||
ret
|
||||
; 1397f
|
||||
|
||||
.AddContestStat: ; 1397f
|
||||
ld hl, hMultiplicand
|
||||
add [hl]
|
||||
ld [hl], a
|
||||
ret nc
|
||||
dec hl
|
||||
inc [hl]
|
||||
ret
|
||||
; 13988
|
||||
287
event/elevator.asm
Executable file
287
event/elevator.asm
Executable file
@@ -0,0 +1,287 @@
|
||||
Elevator:: ; 1342d
|
||||
call Function1344a
|
||||
call Function1347d
|
||||
jr c, .asm_13448
|
||||
ld [wd041], a
|
||||
call Function134dd
|
||||
jr c, .asm_13448
|
||||
ld hl, wd041
|
||||
cp [hl]
|
||||
jr z, .asm_13448
|
||||
call Function134c0
|
||||
and a
|
||||
ret
|
||||
|
||||
.asm_13448
|
||||
scf
|
||||
ret
|
||||
; 1344a
|
||||
|
||||
Function1344a: ; 1344a
|
||||
ld a, b
|
||||
ld [EngineBuffer1], a
|
||||
ld a, e
|
||||
ld [wd03f], a
|
||||
ld a, d
|
||||
ld [wd040], a
|
||||
call Function1345a
|
||||
ret
|
||||
; 1345a
|
||||
|
||||
Function1345a: ; 1345a
|
||||
ld de, OBPals + 8 * 6
|
||||
ld bc, 4
|
||||
ld hl, wd03f
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld a, [EngineBuffer1]
|
||||
call GetFarByte
|
||||
inc hl
|
||||
ld [de], a
|
||||
inc de
|
||||
.asm_1346f
|
||||
ld a, [EngineBuffer1]
|
||||
call GetFarByte
|
||||
ld [de], a
|
||||
inc de
|
||||
add hl, bc
|
||||
cp $ff
|
||||
jr nz, .asm_1346f
|
||||
ret
|
||||
; 1347d
|
||||
|
||||
Function1347d: ; 1347d
|
||||
ld hl, wd03f
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld a, [EngineBuffer1]
|
||||
call GetFarByte
|
||||
ld c, a
|
||||
inc hl
|
||||
ld a, [BackupMapGroup]
|
||||
ld d, a
|
||||
ld a, [BackupMapNumber]
|
||||
ld e, a
|
||||
ld b, $0
|
||||
.asm_13495
|
||||
ld a, [EngineBuffer1]
|
||||
call GetFarByte
|
||||
cp $ff
|
||||
jr z, .asm_134be
|
||||
rept 2
|
||||
inc hl
|
||||
endr
|
||||
ld a, [EngineBuffer1]
|
||||
call GetFarByte
|
||||
inc hl
|
||||
cp d
|
||||
jr nz, .asm_134b7
|
||||
ld a, [EngineBuffer1]
|
||||
call GetFarByte
|
||||
inc hl
|
||||
cp e
|
||||
jr nz, .asm_134b8
|
||||
jr .asm_134bb
|
||||
|
||||
.asm_134b7
|
||||
inc hl
|
||||
|
||||
.asm_134b8
|
||||
inc b
|
||||
jr .asm_13495
|
||||
|
||||
.asm_134bb
|
||||
xor a
|
||||
ld a, b
|
||||
ret
|
||||
|
||||
.asm_134be
|
||||
scf
|
||||
ret
|
||||
; 134c0
|
||||
|
||||
Function134c0: ; 134c0
|
||||
push af
|
||||
ld hl, wd03f
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
inc hl
|
||||
pop af
|
||||
ld bc, 4
|
||||
call AddNTimes
|
||||
inc hl
|
||||
ld de, wdcac
|
||||
ld a, [EngineBuffer1]
|
||||
ld bc, 3
|
||||
call FarCopyBytes
|
||||
ret
|
||||
; 134dd
|
||||
|
||||
Function134dd: ; 134dd
|
||||
call LoadStandardMenuDataHeader
|
||||
ld hl, Elevator_WhichFloorText
|
||||
call PrintText
|
||||
call Elevator_GetCurrentFloorText
|
||||
ld hl, Elevator_MenuDataHeader
|
||||
call CopyMenuDataHeader
|
||||
call Function352f
|
||||
call UpdateSprites
|
||||
xor a
|
||||
ld [wd0e4], a
|
||||
call HandleScrollingMenu
|
||||
call WriteBackup
|
||||
ld a, [wcf73]
|
||||
cp $2
|
||||
jr z, .asm_1350b
|
||||
xor a
|
||||
ld a, [wcf77]
|
||||
ret
|
||||
|
||||
.asm_1350b
|
||||
scf
|
||||
ret
|
||||
; 1350d
|
||||
|
||||
Elevator_WhichFloorText: ; 0x1350d
|
||||
; Which floor?
|
||||
text_jump UnknownText_0x1bd2bc
|
||||
db "@"
|
||||
; 0x13512
|
||||
|
||||
|
||||
Elevator_GetCurrentFloorText: ; 13512
|
||||
ld hl, Options
|
||||
ld a, [hl]
|
||||
push af
|
||||
set NO_TEXT_SCROLL, [hl]
|
||||
hlcoord 0, 0
|
||||
ld b, 4
|
||||
ld c, 8
|
||||
call TextBox
|
||||
hlcoord 1, 2
|
||||
ld de, Elevator_CurrentFloorText
|
||||
call PlaceString
|
||||
hlcoord 4, 4
|
||||
call Elevator_GetCurrentFloorString
|
||||
pop af
|
||||
ld [Options], a
|
||||
ret
|
||||
; 13537
|
||||
|
||||
Elevator_CurrentFloorText: ; 13537
|
||||
db "Now on:@"
|
||||
; 1353f
|
||||
|
||||
|
||||
Elevator_GetCurrentFloorString: ; 1353f
|
||||
push hl
|
||||
ld a, [wd041]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, wd0f1
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
pop de
|
||||
call GetFloorString
|
||||
ret
|
||||
; 13550
|
||||
|
||||
Elevator_MenuDataHeader: ; 0x13550
|
||||
db $40 ; flags
|
||||
db 01, 12 ; start coords
|
||||
db 09, 18 ; end coords
|
||||
dw Elevator_MenuData2
|
||||
db 1 ; default option
|
||||
; 0x13558
|
||||
|
||||
Elevator_MenuData2: ; 0x13558
|
||||
db $10 ; flags
|
||||
db 4, 0 ; rows, columns
|
||||
db 1 ; horizontal spacing
|
||||
dbw 0, OBPals + 8 * 6
|
||||
dba GetElevatorFlorStrings
|
||||
dba NULL
|
||||
dba NULL
|
||||
; 13568
|
||||
|
||||
GetElevatorFlorStrings: ; 13568
|
||||
ld a, [MenuSelection]
|
||||
|
||||
GetFloorString: ; 1356b
|
||||
push de
|
||||
call FloorToString
|
||||
ld d, h
|
||||
ld e, l
|
||||
pop hl
|
||||
jp PlaceString
|
||||
; 13575
|
||||
|
||||
FloorToString: ; 13575
|
||||
push de
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .floors
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
pop de
|
||||
ret
|
||||
; 13583
|
||||
|
||||
.floors
|
||||
dw .b4f
|
||||
dw .b3f
|
||||
dw .b2f
|
||||
dw .b1f
|
||||
dw ._1f
|
||||
dw ._2f
|
||||
dw ._3f
|
||||
dw ._4f
|
||||
dw ._5f
|
||||
dw ._6f
|
||||
dw ._7f
|
||||
dw ._8f
|
||||
dw ._9f
|
||||
dw ._10f
|
||||
dw ._11f
|
||||
dw .roof
|
||||
|
||||
.b4f
|
||||
db "B4F@"
|
||||
.b3f
|
||||
db "B3F@"
|
||||
.b2f
|
||||
db "B2F@"
|
||||
.b1f
|
||||
db "B1F@"
|
||||
._1f
|
||||
db "1F@"
|
||||
._2f
|
||||
db "2F@"
|
||||
._3f
|
||||
db "3F@"
|
||||
._4f
|
||||
db "4F@"
|
||||
._5f
|
||||
db "5F@"
|
||||
._6f
|
||||
db "6F@"
|
||||
._7f
|
||||
db "7F@"
|
||||
._8f
|
||||
db "8F@"
|
||||
._9f
|
||||
db "9F@"
|
||||
._10f
|
||||
db "10F@"
|
||||
._11f
|
||||
db "11F@"
|
||||
.roof
|
||||
db "ROOF@"
|
||||
; 135db
|
||||
68
event/forced_movement.asm
Executable file
68
event/forced_movement.asm
Executable file
@@ -0,0 +1,68 @@
|
||||
Script_ForcedMovement:: ; 0x1253d
|
||||
checkcode VAR_FACING
|
||||
if_equal DOWN, .down
|
||||
if_equal UP, .up
|
||||
if_equal LEFT, .left
|
||||
if_equal RIGHT, .right
|
||||
end
|
||||
; 0x12550
|
||||
|
||||
.up: ; 0x12550
|
||||
applymovement PLAYER, .MovementData_up
|
||||
end
|
||||
; 0x12555
|
||||
|
||||
.down: ; 0x12555
|
||||
applymovement PLAYER, .MovementData_down
|
||||
end
|
||||
; 0x1255a
|
||||
|
||||
.right: ; 0x1255a
|
||||
applymovement PLAYER, .MovementData_right
|
||||
end
|
||||
; 0x1255f
|
||||
|
||||
.left: ; 0x1255f
|
||||
applymovement PLAYER, .MovementData_left
|
||||
end
|
||||
; 0x12564
|
||||
|
||||
.MovementData_up: ; 0x12564
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_in_down
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_head_down
|
||||
step_end
|
||||
; 0x1256b
|
||||
|
||||
.MovementData_down: ; 0x1256b
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_in_up
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_head_up
|
||||
step_end
|
||||
; 0x12572
|
||||
|
||||
.MovementData_right: ; 0x12572
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_in_left
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_head_left
|
||||
step_end
|
||||
; 0x12579
|
||||
|
||||
.MovementData_left: ; 0x12579
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_in_right
|
||||
step_wait5
|
||||
big_step_down
|
||||
turn_head_right
|
||||
step_end
|
||||
; 0x12580
|
||||
54
event/itemball.asm
Executable file
54
event/itemball.asm
Executable file
@@ -0,0 +1,54 @@
|
||||
FindItemInBallScript:: ; 0x122ce
|
||||
callasm .TryReceiveItem
|
||||
iffalse .no_room
|
||||
disappear LAST_TALKED
|
||||
loadfont
|
||||
writetext .text_found
|
||||
playsound SFX_ITEM
|
||||
pause 60
|
||||
itemnotify
|
||||
loadmovesprites
|
||||
end
|
||||
; 0x122e3
|
||||
|
||||
.no_room: ; 0x122e3
|
||||
loadfont
|
||||
writetext .text_found
|
||||
closetext
|
||||
writetext .text_bag_full
|
||||
closetext
|
||||
loadmovesprites
|
||||
end
|
||||
; 0x122ee
|
||||
|
||||
.text_found: ; 0x122ee
|
||||
; found @ !
|
||||
text_jump UnknownText_0x1c0a1c
|
||||
db "@"
|
||||
; 0x122f3
|
||||
|
||||
.text_bag_full: ; 0x122f3
|
||||
; But can't carry any more items.
|
||||
text_jump UnknownText_0x1c0a2c
|
||||
db "@"
|
||||
; 0x122f8
|
||||
|
||||
.TryReceiveItem: ; 122f8
|
||||
xor a
|
||||
ld [ScriptVar], a
|
||||
ld a, [EngineBuffer1]
|
||||
ld [wd265], a
|
||||
call GetItemName
|
||||
ld hl, StringBuffer3
|
||||
call CopyName2
|
||||
ld a, [EngineBuffer1]
|
||||
ld [CurItem], a
|
||||
ld a, [CurFruit]
|
||||
ld [wItemQuantityChangeBuffer], a
|
||||
ld hl, NumItems
|
||||
call ReceiveItem
|
||||
ret nc
|
||||
ld a, $1
|
||||
ld [ScriptVar], a
|
||||
ret
|
||||
; 12324
|
||||
58
event/itemfinder.asm
Executable file
58
event/itemfinder.asm
Executable file
@@ -0,0 +1,58 @@
|
||||
ItemFinder: ; 12580
|
||||
callba CheckForSignpostItems
|
||||
jr c, .found_something
|
||||
ld hl, .Script_FoundNothing
|
||||
jr .resume
|
||||
|
||||
.found_something
|
||||
ld hl, .Script_FoundSomething
|
||||
|
||||
.resume
|
||||
call QueueScript
|
||||
ld a, $1
|
||||
ld [wd0ec], a
|
||||
ret
|
||||
; 12599
|
||||
|
||||
.ItemfinderSound: ; 12599
|
||||
ld c, $4
|
||||
.sfx_loop
|
||||
push bc
|
||||
ld de, SFX_SECOND_PART_OF_ITEMFINDER
|
||||
call WaitPlaySFX
|
||||
ld de, SFX_TRANSACTION
|
||||
call WaitPlaySFX
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .sfx_loop
|
||||
ret
|
||||
; 125ad
|
||||
|
||||
.Script_FoundSomething: ; 0x125ad
|
||||
reloadmappart
|
||||
special UpdateTimePals
|
||||
callasm .ItemfinderSound
|
||||
writetext .Text_FoundSomething
|
||||
loadmovesprites
|
||||
end
|
||||
; 0x125ba
|
||||
|
||||
.Script_FoundNothing: ; 0x125ba
|
||||
reloadmappart
|
||||
special UpdateTimePals
|
||||
writetext .Text_FoundNothing
|
||||
loadmovesprites
|
||||
end
|
||||
; 0x125c3
|
||||
|
||||
.Text_FoundSomething: ; 0x125c3
|
||||
; Yes! ITEMFINDER indicates there's an item nearby.
|
||||
text_jump UnknownText_0x1c0a77
|
||||
db "@"
|
||||
; 0x125c8
|
||||
|
||||
.Text_FoundNothing: ; 0x125c8
|
||||
; Nope! ITEMFINDER isn't responding.
|
||||
text_jump UnknownText_0x1c0aa9
|
||||
db "@"
|
||||
; 0x125cd
|
||||
@@ -23,7 +23,7 @@ UnknownText_0x88013: ; 0x88013
|
||||
; 0x88018
|
||||
|
||||
Special_SelectApricornForKurt: ; 88018
|
||||
call LoadPartyMenuDataHeader
|
||||
call LoadStandardMenuDataHeader
|
||||
ld c, $1
|
||||
xor a
|
||||
ld [wd0e4], a
|
||||
|
||||
@@ -103,7 +103,7 @@ endr
|
||||
.AccessBankOfMom: ; 162a8
|
||||
ld hl, UnknownText_0x1665d
|
||||
call PrintText
|
||||
call LoadPartyMenuDataHeader
|
||||
call LoadStandardMenuDataHeader
|
||||
ld hl, MenuDataHeader_0x166b5
|
||||
call CopyMenuDataHeader
|
||||
call InterpretMenu2
|
||||
@@ -148,7 +148,7 @@ endr
|
||||
ld [hl], a
|
||||
ld a, $5
|
||||
ld [wcf64], a
|
||||
call LoadPartyMenuDataHeader
|
||||
call LoadStandardMenuDataHeader
|
||||
call Function16517
|
||||
call Function1656b
|
||||
call Function16571
|
||||
@@ -216,7 +216,7 @@ endr
|
||||
ld [hl], a
|
||||
ld a, $5
|
||||
ld [wcf64], a
|
||||
call LoadPartyMenuDataHeader
|
||||
call LoadStandardMenuDataHeader
|
||||
call Function16512
|
||||
call Function1656b
|
||||
call Function16571
|
||||
|
||||
@@ -19,7 +19,7 @@ MoveDeletion:
|
||||
jr z, .asm_2c5ca
|
||||
ld hl, UnknownText_0x2c5ea
|
||||
call PrintText
|
||||
call LoadPartyMenuDataHeader
|
||||
call LoadStandardMenuDataHeader
|
||||
callba Function12f5b
|
||||
push af
|
||||
call Function2b74
|
||||
|
||||
84
event/whiteout.asm
Executable file
84
event/whiteout.asm
Executable file
@@ -0,0 +1,84 @@
|
||||
Script_BattleWhiteout:: ; 0x124c1
|
||||
callasm BattleBGMap
|
||||
jump Script_Whiteout
|
||||
; 0x124c8
|
||||
|
||||
Script_OverworldWhiteout:: ; 0x124c8
|
||||
refreshscreen $0
|
||||
callasm OverworldBGMap
|
||||
|
||||
Script_Whiteout: ; 0x124ce
|
||||
writetext .WhitedOutText
|
||||
closetext
|
||||
special FadeBlackBGMap
|
||||
pause 40
|
||||
special HealParty
|
||||
checkflag ENGINE_BUG_CONTEST_TIMER
|
||||
iftrue .bug_contest
|
||||
callasm HalveMoney
|
||||
callasm GetWhiteoutSpawn
|
||||
farscall Script_AbortBugContest
|
||||
special WarpToSpawnPoint
|
||||
newloadmap MAPSETUP_WARP
|
||||
resetfuncs
|
||||
|
||||
.bug_contest
|
||||
jumpstd bugcontestresultswarp
|
||||
; 0x124f5
|
||||
|
||||
.WhitedOutText: ; 0x124f5
|
||||
; is out of useable #MON! whited out!
|
||||
text_jump UnknownText_0x1c0a4e
|
||||
db "@"
|
||||
; 0x124fa
|
||||
|
||||
OverworldBGMap: ; 124fa
|
||||
call ClearPalettes
|
||||
call ClearScreen
|
||||
call Function3200
|
||||
call HideSprites
|
||||
call Function4f0
|
||||
ret
|
||||
; 1250a
|
||||
|
||||
BattleBGMap: ; 1250a
|
||||
ld b, $0
|
||||
call GetSGBLayout
|
||||
call SetPalettes
|
||||
ret
|
||||
; 12513
|
||||
|
||||
HalveMoney: ; 12513
|
||||
|
||||
; Empty function...
|
||||
callba MobileFn_1060c7
|
||||
|
||||
; Halve the player's money.
|
||||
ld hl, Money
|
||||
ld a, [hl]
|
||||
srl a
|
||||
ld [hli], a
|
||||
ld a, [hl]
|
||||
rra
|
||||
ld [hli], a
|
||||
ld a, [hl]
|
||||
rra
|
||||
ld [hl], a
|
||||
ret
|
||||
; 12527
|
||||
|
||||
|
||||
GetWhiteoutSpawn: ; 12527
|
||||
ld a, [wLastSpawnMapGroup]
|
||||
ld d, a
|
||||
ld a, [wLastSpawnMapNumber]
|
||||
ld e, a
|
||||
callba IsSpawnPoint
|
||||
ld a, c
|
||||
jr c, .yes
|
||||
xor a ; SPAWN_HOME
|
||||
|
||||
.yes
|
||||
ld [wd001], a
|
||||
ret
|
||||
; 1253d
|
||||
Reference in New Issue
Block a user