Haunted House groundwork

Adds the Haunted House with wild data, warps, and most of the house itself done.

Gengar Doll is set to be a boss fight, needs walking sprites among other things.

BG events need a bit more fleshing out.

Needs integration for the loose board mechanic.

Otherwise extremely fleshed-out.
This commit is contained in:
Llinos Evans 2024-08-15 20:49:25 +01:00
parent 4905e4246f
commit 6e832f06d8
25 changed files with 587 additions and 53 deletions

View file

@ -65,6 +65,8 @@ StdScripts::
add_stdscript GenericStoveScript
add_stdscript GenericFridgeScript
add_stdscript Nintendo64Script
add_stdscript OldMagazinesScript ; Used for the Haunted House, keeping here for potential other uses.
add_stdscript OldBooksScript
PokecenterNurseScript:
; EVENT_WELCOMED_TO_POKECOM_CENTER is never set
@ -175,6 +177,12 @@ PokecenterNurseScript:
specialphonecall SPECIALCALL_POKERUS
end
OldMagazinesScript:
farjumptext OldMagazinesText
OldBooksScript:
farjumptext OldBooksText
DifficultBookshelfScript:
farjumptext DifficultBookshelfText

View file

@ -44,8 +44,8 @@ FindNest:
jr z, .sevii ; these areas are small enough to that we shouldn't need two separate tables for these regions.
cp SEVII_REGION_1
jr z, .sevii
and a
jr nz, .kanto
cp KANTO_REGION
jr z, .kanto
decoord 0, 0
ld hl, JohtoGrassWildMons
call .FindGrass
@ -448,24 +448,6 @@ _GrassWildmonLookup:
call _SwarmWildmonCheck
ret c
ld hl, JohtoGrassWildMons
; Old Nihon Check from 2023.
; it's painfully broken and bad, don't use it unless you have brighter ideas for the below
; Nihon Check
; Basically, conditionally load Nihon or Kanto into de, depending on region check.
; IsInJohto returns 1 if Kanto, 2 if Nihon.
; This way, when _JohtoWildmonCheck loads, it'll have Nihon's spliced in if you're there.
; This is INCREDIBLY suboptimal. Consider revising.
; As of 3rd Nov '23, this works correctly for Johto and Kanto, but Nihon routes will return nothing.
; call IsInJohto ; Run IsInJohto
; cp 1 ; If we're in Kanto...
; jr z, .skip ; Skip the splicing.
; ld de, NihonGrassWildMons ; No? Splice in Nihon.
; jr .skip2 ; Now skip loading Kanto.
;.skip ; If you skip here, you're in Kanto.
; ld de, KantoGrassWildMons ; So take this as normal.
; ; fallthrough
;.skip2 ; If you skip here, you're in Nihon or Johto.
ld de, NihonGrassWildMons
ld a, [wMapGroup]
@ -474,20 +456,20 @@ _GrassWildmonLookup:
ld c, a
call GetWorldMapLocation
cp NIHON_LANDMARK
jr nc, .johto
jr nc, .foundRegion
; account for sevii
ld de, SeviiGrassWildMons
cp SEVII_LANDMARK_2 ; I am 90% sure this check is unnecessary when in tandem with landmark 1.
jr nc, .johto
jr nc, .foundRegion
cp SEVII_LANDMARK_1
jr nc, .johto
jr nc, .foundRegion
ld de, KantoGrassWildMons
.johto
.foundRegion
call _JohtoWildmonCheck ; So run this check. More commentary there.
ld bc, GRASS_WILDDATA_LENGTH
jr _NormalWildmonOK
jp _NormalWildmonOK
_WaterWildmonLookup:
ld hl, SwarmWaterWildMons
@ -504,17 +486,17 @@ _WaterWildmonLookup:
ld c, a
call GetWorldMapLocation
cp NIHON_LANDMARK
jr nc, .johto
jr nc, .foundRegion
; account for sevii
ld de, SeviiWaterWildMons
cp SEVII_LANDMARK_2
jr nc, .johto
jr nc, .foundRegion
cp SEVII_LANDMARK_1
jr nc, .johto
jr nc, .foundRegion
ld de, KantoWaterWildMons
.johto
ld de, KantoWaterWildMons ; if all else fails, you are here.
.foundRegion
call _JohtoWildmonCheck
ld bc, WATER_WILDDATA_LENGTH
@ -527,9 +509,13 @@ _WaterWildmonLookup:
; We've already decided what de is before between Kanto and Nihon.
; Nothing fancy, but don't worry about it.
_JohtoWildmonCheck:
call IsInJohto ; Check if we're in Johto or not.
and a ; Are we?
ret z ; If zero, skip. This means you're in Johto, so you take what's in hl.
ld a, [wMapGroup]
ld b, a
ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp KANTO_LANDMARK -1
ret c ; If under Kanto Landmarks, you're in Johto. The added regions made the old function break for some reason?
ld h, d ; If you're not, though, you take what's in d...
ld l, e ; and e.