kep-hack/scripts/HallOfFame.asm
Llinos Evans 83483f035b The Great Constant Compression of June 2023
This is a large-scale compression of KEP's current hide/show constants. RBY's works extremely oddly and is limited to 256 entries.

The problem with how RBY's hide/show stuff works, is that even though there are tons of unused constants, you...can't actually remove them. The constant list is tied to the hide/show data entries, so if you replace it with something else, well, now you just have two objects tied to the same constant. If you made the Route 2 item a boss, and someone picked up the item on Route 2, the boss would also disappear, and vice versa. So, we have to get creative.

I have reduced what we have to 248, but I think I miscounted when doing the funny list somewhere in the actual list when making sure the hex stuff is ok. Either that, or there's an error somewhere that Martha will, by some obscene miracle of humanity, discover. Anyway, this was achieved by turning multiple current overworld items into hidden ones, keeping them in the game whilst keeping to that all-important limit.

I also removed the items in Pokemon Tower 4F for this, just needed a little boost. Well, as you can see by the number, I technically didn't, I just miscounted like 20 times. Look, it's 10:11 PM, my stomach is in pain from an insane injection, and I don't even know if that map will come back, cut me some slack. Or add it back. You definitely can.
2023-06-27 22:17:07 +01:00

149 lines
2.9 KiB
NASM

HallOfFame_Script:
call EnableAutoTextBoxDrawing
ld hl, HallOfFame_ScriptPointers
ld a, [wHallOfFameCurScript]
jp CallFunctionInTable
HallofFameRoomScript_5a4aa:
xor a
ld [wJoyIgnore], a
ld [wHallOfFameCurScript], a
ret
HallOfFame_ScriptPointers:
dw HallofFameRoomScript0
dw HallofFameRoomScript1
dw HallofFameRoomScript2
dw HallofFameRoomScript3
HallofFameRoomScript3:
ret
HallofFameRoomScript2:
call Delay3
ld a, [wLetterPrintingDelayFlags]
push af
xor a
ld [wJoyIgnore], a
predef HallOfFamePC
pop af
ld [wLetterPrintingDelayFlags], a
ld hl, wFlags_D733
res 1, [hl]
inc hl
set 0, [hl]
xor a
ld hl, wLoreleisRoomCurScript
ld [hli], a ; wLoreleisRoomCurScript
ld [hli], a ; wBrunosRoomCurScript
ld [hl], a ; wAgathasRoomCurScript
ld [wLancesRoomCurScript], a
ld [wHallOfFameCurScript], a
; Elite 4 events
ResetEventRange INDIGO_PLATEAU_EVENTS_START, INDIGO_PLATEAU_EVENTS_END, 1
xor a
ld [wHallOfFameCurScript], a
ld a, PALLET_TOWN
ld [wLastBlackoutMap], a
farcall SaveSAVtoSRAM
ld b, 5
.delayLoop
ld c, 600 / 5
call DelayFrames
dec b
jr nz, .delayLoop
call WaitForTextScrollButtonPress
jp Init
HallofFameRoomScript0:
ld a, $ff
ld [wJoyIgnore], a
ld hl, wSimulatedJoypadStatesEnd
ld de, RLEMovement5a528
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
ld a, $1
ld [wHallOfFameCurScript], a
ret
RLEMovement5a528:
db D_UP, 5
db -1 ; end
HallofFameRoomScript1:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
ld a, PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
ld a, $1
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
ld a, SPRITE_FACING_LEFT
ldh [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call Delay3
xor a
ld [wJoyIgnore], a
inc a ; PLAYER_DIR_RIGHT
ld [wPlayerMovingDirection], a
ld a, $1
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wJoyIgnore], a
call PostGameSetup
ld a, $2
ld [wHallOfFameCurScript], a
ret
HallOfFame_TextPointers:
dw HallofFameRoomText1
HallofFameRoomText1:
text_far _HallofFameRoomText1
text_end
; Post-Game Functionality
; This script is adapted from the Silph Co. 11F script that reforms Saffron City.
; It replaces the Cerulean Cave Guard bit, adapting him into the whole ordeal.
PostGameSetup:
SetEvent EVENT_POST_GAME_ATTAINED
ld hl, ObjectsToHide
.loop1
ld a, [hli]
cp $ff
jr z, .skip
push hl
ld [wMissableObjectIndex], a
predef HideObject
pop hl
jr .loop1
.skip
ld hl, ObjectsToShow
.loop2
ld a, [hli]
cp -1
ret z
push hl
ld [wMissableObjectIndex], a
predef ShowObject
pop hl
jr .loop2
ObjectsToShow:
db HS_ROUTE_1_OAK ; Oak post-game fight
db -1 ; end
ObjectsToHide:
db HS_BILLS_NIDORINO ; Bill's Garden access
db HS_MANSION_GUARD ; Pokemon Mansion basement access
db HS_MT_MOON_CRATER_GUARD ; Mt. Moon Crater access
db HS_CERULEAN_CAVE_GUY ; Cerulean Cave access
db -1 ; end