expanded Pokemon size

Rhyperior files are dummies and will need to be properly edited with sprites, Rhydon evo data, etc, but it (and the other files included) show that the trainer and pokemon sprite indexes have been separated, which allows us to add the other KEP mons
This commit is contained in:
emaskyesmogon 2022-08-31 20:47:02 -06:00
parent b33e266d44
commit 1893b4c7cf
28 changed files with 160 additions and 24 deletions

View file

@ -22,3 +22,19 @@ CopyData::
or b
jr nz, CopyData
ret
FarCopyData2::
; Identical to FarCopyData, but uses hROMBankTemp
; as temp space instead of wBuffer.
ldh [hROMBankTemp], a
ldh a, [hLoadedROMBank]
push af
ldh a, [hROMBankTemp]
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
call CopyData
pop af
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
ret

View file

@ -1,18 +1,3 @@
FarCopyData2::
; Identical to FarCopyData, but uses hROMBankTemp
; as temp space instead of wBuffer.
ldh [hROMBankTemp], a
ldh a, [hLoadedROMBank]
push af
ldh a, [hROMBankTemp]
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
call CopyData
pop af
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
ret
FarCopyData3::
; Copy bc bytes from a:de to hl.
ldh [hROMBankTemp], a

View file

@ -143,6 +143,8 @@ DisplayListMenuIDLoop::
ld [wd0b5], a
ld a, BANK(ItemNames)
ld [wPredefBank], a
ld a, ITEM_NAME
ld [wNameListType], a
call GetName
jr .storeChosenEntry
.pokemonList

View file

@ -190,16 +190,20 @@ EndTrainerBattle::
res 0, [hl] ; player is no longer engaged by any trainer
ld a, [wIsInBattle]
cp $ff
jp z, ResetButtonPressedAndMapScript
jr z, EndTrainerBattleWhiteout
ld a, $2
call ReadTrainerHeaderInfo
ld a, [wTrainerHeaderFlagBit]
ld c, a
ld b, FLAG_SET
call TrainerFlagAction ; flag trainer as fought
ld a, [wEnemyMonOrTrainerClass]
cp OPP_ID_OFFSET
jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite)
ld a, [wWasTrainerBattle]
and a
jr nz, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite)
ld a, [wCurMap]
cp POKEMON_TOWER_7F
jr z, .skipRemoveSprite ; the tower 7f scripts call EndTrainerBattle manually after
; wIsTrainerBattle has been unset
ld hl, wMissableObjectList
ld de, $2
ld a, [wSpriteIndex]
@ -209,11 +213,19 @@ EndTrainerBattle::
ld [wMissableObjectIndex], a ; load corresponding missable object index and remove it
predef HideObject
.skipRemoveSprite
xor a
ld [wWasTrainerBattle], a
ld hl, wd730
bit 4, [hl]
res 4, [hl]
ret nz
EndTrainerBattleWhiteout:
xor a
ld [wIsTrainerBattle], a
ld [wWasTrainerBattle], a
; fallthrough to original routine
ResetButtonPressedAndMapScript::
xor a
ld [wJoyIgnore], a
@ -232,12 +244,14 @@ InitBattleEnemyParameters::
ld a, [wEngagedTrainerClass]
ld [wCurOpponent], a
ld [wEnemyMonOrTrainerClass], a
cp OPP_ID_OFFSET
ld a, [wIsTrainerBattle]
and a
jr z, .noTrainer
ld a, [wEngagedTrainerSet]
jr c, .noTrainer
ld [wTrainerNo], a
ret
.noTrainer
ld a, [wEngagedTrainerSet]
ld [wCurEnemyLVL], a
ret
@ -333,7 +347,17 @@ EngageMapTrainer::
ld a, [hli] ; load trainer class
ld [wEngagedTrainerClass], a
ld a, [hl] ; load trainer mon set
bit 7, a
jr nz, .pokemon
ld [wEngagedTrainerSet], a
ld a, 1
ld [wIsTrainerBattle], a
jp PlayTrainerMusic
.pokemon
and $7F
ld [wEngagedTrainerSet], a
xor a
ld [wIsTrainerBattle], a
jp PlayTrainerMusic
PrintEndBattleText::