mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
named misc functions
This commit is contained in:
parent
1347023128
commit
3870f5e10a
|
@ -60,7 +60,7 @@ EndOfBattle: ; 137aa (4:77aa)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wListScrollOffset], a
|
ld [wListScrollOffset], a
|
||||||
ld hl, wd060
|
ld hl, wPlayerStatsToDouble
|
||||||
ld b, $18
|
ld b, $18
|
||||||
.loop
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
@ -402,7 +402,7 @@ GetTrainerName_: ; 13a58 (4:7a58)
|
||||||
jr z, .rival
|
jr z, .rival
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
ld a, TRAINER_NAME
|
ld a, TRAINER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, BANK(TrainerNames)
|
ld a, BANK(TrainerNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
call GetName
|
call GetName
|
||||||
|
|
|
@ -839,7 +839,7 @@ FaintEnemyPokemon ; 0x3c567
|
||||||
res AttackingMultipleTimes, [hl]
|
res AttackingMultipleTimes, [hl]
|
||||||
xor a
|
xor a
|
||||||
ld [wPlayerNumHits], a
|
ld [wPlayerNumHits], a
|
||||||
ld hl, wd065 ; clear enemy statuses
|
ld hl, wEnemyStatsToDouble ; clear enemy statuses
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
@ -1366,7 +1366,7 @@ EnemySendOut: ; 3c90e (f:490e)
|
||||||
; don't change wPartyGainExpFlags or wPartyFoughtCurrentEnemyFlags
|
; don't change wPartyGainExpFlags or wPartyFoughtCurrentEnemyFlags
|
||||||
EnemySendOutFirstMon: ; 3c92a (f:492a)
|
EnemySendOutFirstMon: ; 3c92a (f:492a)
|
||||||
xor a
|
xor a
|
||||||
ld hl,wd065 ; clear enemy statuses
|
ld hl,wEnemyStatsToDouble ; clear enemy statuses
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
|
@ -1815,7 +1815,7 @@ SendOutMon: ; 3cc91 (f:4c91)
|
||||||
ld hl, wPlayerUsedMove
|
ld hl, wPlayerUsedMove
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wd060
|
ld hl, wPlayerStatsToDouble
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
@ -5671,7 +5671,7 @@ EnemyCanExecuteChargingMove: ; 3e70b (f:670b)
|
||||||
ld a, BANK(MoveNames)
|
ld a, BANK(MoveNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
ld a, MOVE_NAME
|
ld a, MOVE_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call GetName
|
call GetName
|
||||||
ld de, wcd6d
|
ld de, wcd6d
|
||||||
call CopyStringToCF4B
|
call CopyStringToCF4B
|
||||||
|
@ -6148,7 +6148,7 @@ GetCurrentMove: ; 3eabe (f:6abe)
|
||||||
ld a, BANK(MoveNames)
|
ld a, BANK(MoveNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
ld a, MOVE_NAME
|
ld a, MOVE_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call GetName
|
call GetName
|
||||||
ld de, wcd6d
|
ld de, wcd6d
|
||||||
jp CopyStringToCF4B
|
jp CopyStringToCF4B
|
||||||
|
@ -6339,7 +6339,7 @@ DoBattleTransitionAndInitBattleVariables: ; 3ec32 (f:6c32)
|
||||||
ld [hWY], a
|
ld [hWY], a
|
||||||
ld [rWY], a
|
ld [rWY], a
|
||||||
ld [hTilesetType], a
|
ld [hTilesetType], a
|
||||||
ld hl, wd060
|
ld hl, wPlayerStatsToDouble
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
@ -6423,10 +6423,11 @@ LoadPlayerBackPic: ; 3ec92 (f:6c92)
|
||||||
hlCoord 1, 5
|
hlCoord 1, 5
|
||||||
predef_jump Func_3f0c6
|
predef_jump Func_3f0c6
|
||||||
|
|
||||||
Func_3ed02: ; 3ed02 (f:6d02)
|
; does nothing since no stats are ever selected (barring glitches)
|
||||||
callab Func_39680
|
DoubleOrHalveSelectedStats: ; 3ed02 (f:6d02)
|
||||||
ld hl, Func_396a7
|
callab DoubleSelectedStats
|
||||||
ld b, BANK(Func_396a7)
|
ld hl, HalveSelectedStats
|
||||||
|
ld b, BANK(HalveSelectedStats)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
ScrollTrainerPicAfterBattle: ; 3ed12 (f:6d12)
|
ScrollTrainerPicAfterBattle: ; 3ed12 (f:6d12)
|
||||||
|
|
|
@ -1,24 +1,25 @@
|
||||||
Func_39680: ; 39680 (e:5680)
|
; does nothing since no stats are ever selected (barring glitches)
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
DoubleSelectedStats: ; 39680 (e:5680)
|
||||||
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [wd060]
|
ld a, [wPlayerStatsToDouble]
|
||||||
ld hl, wBattleMonAttack + 1
|
ld hl, wBattleMonAttack + 1
|
||||||
jr z, .asm_39691
|
jr z, .notEnemyTurn
|
||||||
ld a, [wd065]
|
ld a, [wEnemyStatsToDouble]
|
||||||
ld hl, wEnemyMonAttack + 1
|
ld hl, wEnemyMonAttack + 1
|
||||||
.asm_39691
|
.notEnemyTurn
|
||||||
ld c, $4
|
ld c, 4
|
||||||
ld b, a
|
ld b, a
|
||||||
.asm_39694
|
.loop
|
||||||
srl b
|
srl b
|
||||||
call c, Func_3969f
|
call c, .doubleStat
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
dec c
|
dec c
|
||||||
ret z
|
ret z
|
||||||
jr .asm_39694
|
jr .loop
|
||||||
|
|
||||||
Func_3969f: ; 3969f (e:569f)
|
.doubleStat
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
add a
|
add a
|
||||||
ld [hld], a
|
ld [hld], a
|
||||||
|
@ -27,35 +28,36 @@ Func_3969f: ; 3969f (e:569f)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_396a7: ; 396a7 (e:56a7)
|
; does nothing since no stats are ever selected (barring glitches)
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
HalveSelectedStats: ; 396a7 (e:56a7)
|
||||||
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [wd061]
|
ld a, [wPlayerStatsToHalve]
|
||||||
ld hl, wBattleMonAttack
|
ld hl, wBattleMonAttack
|
||||||
jr z, .asm_396b8
|
jr z, .notEnemyTurn
|
||||||
ld a, [wd066]
|
ld a, [wEnemyStatsToHalve]
|
||||||
ld hl, wEnemyMonAttack
|
ld hl, wEnemyMonAttack
|
||||||
.asm_396b8
|
.notEnemyTurn
|
||||||
ld c, $4
|
ld c, 4
|
||||||
ld b, a
|
ld b, a
|
||||||
.asm_396bb
|
.loop
|
||||||
srl b
|
srl b
|
||||||
call c, Func_396c6
|
call c, .halveStat
|
||||||
inc hl
|
inc hl
|
||||||
inc hl
|
inc hl
|
||||||
dec c
|
dec c
|
||||||
ret z
|
ret z
|
||||||
jr .asm_396bb
|
jr .loop
|
||||||
|
|
||||||
Func_396c6: ; 396c6 (e:56c6)
|
.halveStat
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
srl a
|
srl a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
rr [hl]
|
rr [hl]
|
||||||
or [hl]
|
or [hl]
|
||||||
jr nz, .asm_396d1
|
jr nz, .nonzeroStat
|
||||||
ld [hl], $1
|
ld [hl], 1
|
||||||
.asm_396d1
|
.nonzeroStat
|
||||||
dec hl
|
dec hl
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -69,41 +71,42 @@ _ScrollTrainerPicAfterBattle: ; 396d3 (e:56d3)
|
||||||
callab _LoadTrainerPic
|
callab _LoadTrainerPic
|
||||||
hlCoord 19, 0
|
hlCoord 19, 0
|
||||||
ld c, $0
|
ld c, $0
|
||||||
.asm_396e9
|
.scrollLoop
|
||||||
inc c
|
inc c
|
||||||
ld a, c
|
ld a, c
|
||||||
cp $7
|
cp 7
|
||||||
ret z
|
ret z
|
||||||
ld d, $0
|
ld d, $0
|
||||||
push bc
|
push bc
|
||||||
push hl
|
push hl
|
||||||
.asm_396f2
|
.drawTrainerPicLoop
|
||||||
call Func_39707
|
call DrawTrainerPicColumn
|
||||||
inc hl
|
inc hl
|
||||||
ld a, $7
|
ld a, 7
|
||||||
add d
|
add d
|
||||||
ld d, a
|
ld d, a
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_396f2
|
jr nz, .drawTrainerPicLoop
|
||||||
ld c, $4
|
ld c, 4
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
pop hl
|
pop hl
|
||||||
pop bc
|
pop bc
|
||||||
dec hl
|
dec hl
|
||||||
jr .asm_396e9
|
jr .scrollLoop
|
||||||
|
|
||||||
Func_39707: ; 39707 (e:5707)
|
; write one 7-tile column of the trainer pic to the tilemap
|
||||||
|
DrawTrainerPicColumn: ; 39707 (e:5707)
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
ld e, $7
|
ld e, 7
|
||||||
.asm_3970c
|
.loop
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
ld bc, $14
|
ld bc, SCREEN_WIDTH
|
||||||
add hl, bc
|
add hl, bc
|
||||||
inc d
|
inc d
|
||||||
dec e
|
dec e
|
||||||
jr nz, .asm_3970c
|
jr nz, .loop
|
||||||
pop bc
|
pop bc
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
|
@ -591,7 +594,7 @@ FormatMovesString: ; 39b87 (e:5b87)
|
||||||
ld a, BANK(MoveNames)
|
ld a, BANK(MoveNames)
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
ld a, MOVE_NAME
|
ld a, MOVE_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call GetName
|
call GetName
|
||||||
ld hl, wcd6d
|
ld hl, wcd6d
|
||||||
.copyNameLoop
|
.copyNameLoop
|
||||||
|
@ -630,41 +633,42 @@ FormatMovesString: ; 39b87 (e:5b87)
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
; XXX this is called in a few places, but it doesn't appear to do anything useful
|
||||||
Func_39bd5: ; 39bd5 (e:5bd5)
|
Func_39bd5: ; 39bd5 (e:5bd5)
|
||||||
ld a, [wd11b]
|
ld a, [wd11b]
|
||||||
cp $1
|
cp $1
|
||||||
jr nz, .asm_39be6
|
jr nz, .asm_39be6
|
||||||
ld hl, wEnemyPartyCount ; wEnemyPartyCount
|
ld hl, wEnemyPartyCount
|
||||||
ld de, wEnemyMonOT ; wd9ac OT names of other player
|
ld de, wEnemyMonOT
|
||||||
ld a, $6
|
ld a, ENEMYOT_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.asm_39be6
|
.asm_39be6
|
||||||
cp $4
|
cp $4
|
||||||
jr nz, .calcAttackStat4
|
jr nz, .calcAttackStat4
|
||||||
ld hl, wPartyCount ; wPartyCount
|
ld hl, wPartyCount
|
||||||
ld de, wPartyMonOT ; wd273
|
ld de, wPartyMonOT
|
||||||
ld a, $5
|
ld a, PLAYEROT_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.calcAttackStat4
|
.calcAttackStat4
|
||||||
cp $5
|
cp $5
|
||||||
jr nz, .asm_39c02
|
jr nz, .asm_39c02
|
||||||
ld hl, wStringBuffer2 + 11
|
ld hl, wStringBuffer2 + 11
|
||||||
ld de, MonsterNames ; $421e
|
ld de, MonsterNames
|
||||||
ld a, $1
|
ld a, MONSTER_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.asm_39c02
|
.asm_39c02
|
||||||
cp $2
|
cp $2
|
||||||
jr nz, .asm_39c10
|
jr nz, .asm_39c10
|
||||||
ld hl, wNumBagItems ; wNumBagItems
|
ld hl, wNumBagItems
|
||||||
ld de, ItemNames ; $472b
|
ld de, ItemNames
|
||||||
ld a, $4
|
ld a, ITEM_NAME
|
||||||
jr .asm_39c18
|
jr .asm_39c18
|
||||||
.asm_39c10
|
.asm_39c10
|
||||||
ld hl, wStringBuffer2 + 11
|
ld hl, wStringBuffer2 + 11
|
||||||
ld de, ItemNames ; $472b
|
ld de, ItemNames
|
||||||
ld a, ITEM_NAME
|
ld a, ITEM_NAME
|
||||||
.asm_39c18
|
.asm_39c18
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wList], a
|
ld [wList], a
|
||||||
ld a, h
|
ld a, h
|
||||||
|
@ -680,19 +684,20 @@ Func_39bd5: ; 39bd5 (e:5bd5)
|
||||||
ld [wItemPrices + 1], a
|
ld [wItemPrices + 1], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_39c37: ; 39c37 (e:5c37)
|
; get species of mon e in list [wcc49] for LoadMonData
|
||||||
|
GetMonSpecies: ; 39c37 (e:5c37)
|
||||||
ld hl, wPartySpecies
|
ld hl, wPartySpecies
|
||||||
ld a, [wcc49]
|
ld a, [wcc49]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_39c4b
|
jr z, .getSpecies
|
||||||
dec a
|
dec a
|
||||||
jr z, .asm_39c48
|
jr z, .enemyParty
|
||||||
ld hl, wBoxSpecies
|
ld hl, wBoxSpecies
|
||||||
jr .asm_39c4b
|
jr .getSpecies
|
||||||
.asm_39c48
|
.enemyParty
|
||||||
ld hl, wEnemyPartyMons
|
ld hl, wEnemyPartyMons
|
||||||
.asm_39c4b
|
.getSpecies
|
||||||
ld d, $0
|
ld d, 0
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
|
@ -955,7 +960,7 @@ TrainerAIPointers: ; 3a55c (e:655c)
|
||||||
JugglerAI: ; 3a5e9 (e:65e9)
|
JugglerAI: ; 3a5e9 (e:65e9)
|
||||||
cp $40
|
cp $40
|
||||||
ret nc
|
ret nc
|
||||||
jp Func_3a72a
|
jp AISwitchIfEnoughMons
|
||||||
|
|
||||||
BlackbeltAI: ; 3a5ef (e:65ef)
|
BlackbeltAI: ; 3a5ef (e:65ef)
|
||||||
cp $20
|
cp $20
|
||||||
|
@ -975,12 +980,12 @@ CooltrainerMAI: ; 3a5fb (e:65fb)
|
||||||
CooltrainerFAI: ; 3a601 (e:6601)
|
CooltrainerFAI: ; 3a601 (e:6601)
|
||||||
cp $40
|
cp $40
|
||||||
ld a,$A
|
ld a,$A
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
jp c,AIUseHyperPotion
|
jp c,AIUseHyperPotion
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp Func_3a72a
|
jp AISwitchIfEnoughMons
|
||||||
|
|
||||||
BrockAI: ; 3a614 (e:6614)
|
BrockAI: ; 3a614 (e:6614)
|
||||||
; if his active monster has a status condition, use a full heal
|
; if his active monster has a status condition, use a full heal
|
||||||
|
@ -1003,7 +1008,7 @@ ErikaAI: ; 3a628 (e:6628)
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,$A
|
ld a,$A
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseSuperPotion
|
jp AIUseSuperPotion
|
||||||
|
|
||||||
|
@ -1021,7 +1026,7 @@ SabrinaAI: ; 3a640 (e:6640)
|
||||||
cp $40
|
cp $40
|
||||||
ret nc
|
ret nc
|
||||||
ld a,$A
|
ld a,$A
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseHyperPotion
|
jp AIUseHyperPotion
|
||||||
|
|
||||||
|
@ -1029,7 +1034,7 @@ Sony2AI: ; 3a64c (e:664c)
|
||||||
cp $20
|
cp $20
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUsePotion
|
jp AIUsePotion
|
||||||
|
|
||||||
|
@ -1037,7 +1042,7 @@ Sony3AI: ; 3a658 (e:6658)
|
||||||
cp $20
|
cp $20
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseFullRestore
|
jp AIUseFullRestore
|
||||||
|
|
||||||
|
@ -1045,7 +1050,7 @@ LoreleiAI: ; 3a664 (e:6664)
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseSuperPotion
|
jp AIUseSuperPotion
|
||||||
|
|
||||||
|
@ -1056,11 +1061,11 @@ BrunoAI: ; 3a670 (e:6670)
|
||||||
|
|
||||||
AgathaAI: ; 3a676 (e:6676)
|
AgathaAI: ; 3a676 (e:6676)
|
||||||
cp $14
|
cp $14
|
||||||
jp c,Func_3a72a
|
jp c,AISwitchIfEnoughMons
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,4
|
ld a,4
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseSuperPotion
|
jp AIUseSuperPotion
|
||||||
|
|
||||||
|
@ -1068,7 +1073,7 @@ LanceAI: ; 3a687 (e:6687)
|
||||||
cp $80
|
cp $80
|
||||||
ret nc
|
ret nc
|
||||||
ld a,5
|
ld a,5
|
||||||
call Func_3a7cf
|
call AICheckIfHPBelowFraction
|
||||||
ret nc
|
ret nc
|
||||||
jp AIUseHyperPotion
|
jp AIUseHyperPotion
|
||||||
|
|
||||||
|
@ -1110,7 +1115,7 @@ AIUseFullRestore: ; 3a6a0 (e:66a0)
|
||||||
ld [de],a
|
ld [de],a
|
||||||
ld [wHPBarMaxHP+1],a
|
ld [wHPBarMaxHP+1],a
|
||||||
ld [wEnemyMonHP],a
|
ld [wEnemyMonHP],a
|
||||||
jr Func_3a718
|
jr AIPrintItemUseAndUpdateHPBar
|
||||||
|
|
||||||
AIUsePotion: ; 3a6ca (e:66ca)
|
AIUsePotion: ; 3a6ca (e:66ca)
|
||||||
; enemy trainer heals his monster with a potion
|
; enemy trainer heals his monster with a potion
|
||||||
|
@ -1160,7 +1165,7 @@ AIRecoverHP: ; 3a6da (e:66da)
|
||||||
ld a,[de]
|
ld a,[de]
|
||||||
ld [wHPBarMaxHP+1],a
|
ld [wHPBarMaxHP+1],a
|
||||||
sbc b
|
sbc b
|
||||||
jr nc,Func_3a718
|
jr nc,AIPrintItemUseAndUpdateHPBar
|
||||||
inc de
|
inc de
|
||||||
ld a,[de]
|
ld a,[de]
|
||||||
dec de
|
dec de
|
||||||
|
@ -1171,7 +1176,7 @@ AIRecoverHP: ; 3a6da (e:66da)
|
||||||
ld [wHPBarNewHP+1],a
|
ld [wHPBarNewHP+1],a
|
||||||
; fallthrough
|
; fallthrough
|
||||||
|
|
||||||
Func_3a718: ; 3a718 (e:6718)
|
AIPrintItemUseAndUpdateHPBar: ; 3a718 (e:6718)
|
||||||
call AIPrintItemUse_
|
call AIPrintItemUse_
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
xor a
|
xor a
|
||||||
|
@ -1179,7 +1184,8 @@ Func_3a718: ; 3a718 (e:6718)
|
||||||
predef UpdateHPBar2
|
predef UpdateHPBar2
|
||||||
jp DecrementAICount
|
jp DecrementAICount
|
||||||
|
|
||||||
Func_3a72a: ; 3a72a (e:672a)
|
AISwitchIfEnoughMons: ; 3a72a (e:672a)
|
||||||
|
; enemy trainer switches if there are 3 or more unfainted mons in party
|
||||||
ld a,[wEnemyPartyCount]
|
ld a,[wEnemyPartyCount]
|
||||||
ld c,a
|
ld c,a
|
||||||
ld hl,wEnemyMon1HP
|
ld hl,wEnemyMon1HP
|
||||||
|
@ -1281,7 +1287,8 @@ AIUseDireHit: ; 0x3a7c2 unused
|
||||||
ld a,DIRE_HIT
|
ld a,DIRE_HIT
|
||||||
jp AIPrintItemUse
|
jp AIPrintItemUse
|
||||||
|
|
||||||
Func_3a7cf: ; 3a7cf (e:67cf)
|
AICheckIfHPBelowFraction: ; 3a7cf (e:67cf)
|
||||||
|
; return carry if enemy trainer's current HP is below 1 / a of the maximum
|
||||||
ld [H_DIVISOR],a
|
ld [H_DIVISOR],a
|
||||||
ld hl,wEnemyMonMaxHP
|
ld hl,wEnemyMonMaxHP
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
|
@ -1395,7 +1402,7 @@ SetupOwnPartyPokeballs: ; 3a869 (e:6869)
|
||||||
ld a, $8
|
ld a, $8
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wTrainerEngageDistance], a
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
jp Func_3a8e1
|
jp WritePokeballOAMData
|
||||||
|
|
||||||
SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
|
SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
|
||||||
call PlaceEnemyHUDTiles
|
call PlaceEnemyHUDTiles
|
||||||
|
@ -1409,7 +1416,7 @@ SetupEnemyPartyPokeballs: ; 3a887 (e:6887)
|
||||||
ld a, $f8
|
ld a, $f8
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wTrainerEngageDistance], a
|
||||||
ld hl, wOAMBuffer + PARTY_LENGTH * 4
|
ld hl, wOAMBuffer + PARTY_LENGTH * 4
|
||||||
jp Func_3a8e1
|
jp WritePokeballOAMData
|
||||||
|
|
||||||
SetupPokeballs: ; 0x3a8a6
|
SetupPokeballs: ; 0x3a8a6
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
@ -1421,7 +1428,7 @@ SetupPokeballs: ; 0x3a8a6
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
dec c
|
dec c
|
||||||
jr nz, .emptyloop ; 0x3a8b2 $fb
|
jr nz, .emptyloop
|
||||||
pop af
|
pop af
|
||||||
ld de, wBuffer
|
ld de, wBuffer
|
||||||
.monloop
|
.monloop
|
||||||
|
@ -1461,10 +1468,10 @@ PickPokeball: ; 3a8c2 (e:68c2)
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_3a8e1: ; 3a8e1 (e:68e1)
|
WritePokeballOAMData: ; 3a8e1 (e:68e1)
|
||||||
ld de, wHPBarMaxHP
|
ld de, wBuffer
|
||||||
ld c, PARTY_LENGTH
|
ld c, PARTY_LENGTH
|
||||||
.asm_3a8e6
|
.loop
|
||||||
ld a, [W_BASECOORDY] ; wd082
|
ld a, [W_BASECOORDY] ; wd082
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [W_BASECOORDX] ; wd081
|
ld a, [W_BASECOORDX] ; wd081
|
||||||
|
@ -1480,7 +1487,7 @@ Func_3a8e1: ; 3a8e1 (e:68e1)
|
||||||
ld [W_BASECOORDX], a ; wd081
|
ld [W_BASECOORDX], a ; wd081
|
||||||
inc de
|
inc de
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_3a8e6
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
PlacePlayerHUDTiles: ; 3a902 (e:6902)
|
PlacePlayerHUDTiles: ; 3a902 (e:6902)
|
||||||
|
@ -1542,7 +1549,7 @@ SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
|
||||||
ld a, $8
|
ld a, $8
|
||||||
ld [wTrainerEngageDistance], a
|
ld [wTrainerEngageDistance], a
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
call Func_3a8e1
|
call WritePokeballOAMData
|
||||||
ld hl, wEnemyMons ; wEnemyMon1Species
|
ld hl, wEnemyMons ; wEnemyMon1Species
|
||||||
ld de, wEnemyPartyCount ; wEnemyPartyCount
|
ld de, wEnemyPartyCount ; wEnemyPartyCount
|
||||||
call SetupPokeballs
|
call SetupPokeballs
|
||||||
|
@ -1551,7 +1558,7 @@ SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], $68
|
ld [hl], $68
|
||||||
ld hl, wOAMBuffer + $18
|
ld hl, wOAMBuffer + $18
|
||||||
jp Func_3a8e1
|
jp WritePokeballOAMData
|
||||||
|
|
||||||
; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (faited) and pokeball slot (no mon)
|
; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (faited) and pokeball slot (no mon)
|
||||||
PokeballTileGraphics:: ; 3a97e (e:697e)
|
PokeballTileGraphics:: ; 3a97e (e:697e)
|
||||||
|
|
|
@ -139,7 +139,7 @@ Evolution_PartyMonLoop: ; loop over party mons
|
||||||
ld [wLoadedMonSpecies], a
|
ld [wLoadedMonSpecies], a
|
||||||
ld [wHPBarMaxHP + 1], a
|
ld [wHPBarMaxHP + 1], a
|
||||||
ld a, MONSTER_NAME
|
ld a, MONSTER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, BANK(TrainerNames) ; bank is not used for monster names
|
ld a, BANK(TrainerNames) ; bank is not used for monster names
|
||||||
ld [wPredefBank], a
|
ld [wPredefBank], a
|
||||||
call GetName
|
call GetName
|
||||||
|
|
|
@ -777,7 +777,7 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
ld de,wBattleMonMaxHP
|
ld de,wBattleMonMaxHP
|
||||||
ld bc,10
|
ld bc,10
|
||||||
call CopyData ; copy party stats to in-battle stat data
|
call CopyData ; copy party stats to in-battle stat data
|
||||||
predef Func_3ed02
|
predef DoubleOrHalveSelectedStats
|
||||||
jp .doneHealing
|
jp .doneHealing
|
||||||
.healHP
|
.healHP
|
||||||
inc hl ; hl = address of current HP
|
inc hl ; hl = address of current HP
|
||||||
|
|
|
@ -101,7 +101,7 @@ BillsPC_:: ; 0x214c2
|
||||||
xor a
|
xor a
|
||||||
ld [wccd3], a
|
ld [wccd3], a
|
||||||
inc a ; MONSTER_NAME
|
inc a ; MONSTER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call LoadHpBarAndStatusTilePatterns
|
call LoadHpBarAndStatusTilePatterns
|
||||||
ld a, [wListScrollOffset]
|
ld a, [wListScrollOffset]
|
||||||
push af
|
push af
|
||||||
|
@ -332,7 +332,7 @@ Func_216be: ; 216be (8:56be)
|
||||||
ld [wcf93], a
|
ld [wcf93], a
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
inc a ; MONSTER_NAME
|
inc a ; MONSTER_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
ld a, [wcc2b]
|
ld a, [wcc2b]
|
||||||
ld [wCurrentMenuItem], a
|
ld [wCurrentMenuItem], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
|
|
|
@ -2,7 +2,7 @@ PlayerPC: ; 78e6 (1:78e6)
|
||||||
ld hl, wd730
|
ld hl, wd730
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
ld a, ITEM_NAME
|
ld a, ITEM_NAME
|
||||||
ld [W_LISTTYPE], a
|
ld [wNameListType], a
|
||||||
call SaveScreenTilesToBuffer1
|
call SaveScreenTilesToBuffer1
|
||||||
xor a
|
xor a
|
||||||
ld [wcc2c], a
|
ld [wcc2c], a
|
||||||
|
|
|
@ -92,7 +92,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef UpdateHPBar
|
add_predef UpdateHPBar
|
||||||
add_predef HPBarLength
|
add_predef HPBarLength
|
||||||
add_predef Diploma_TextBoxBorder
|
add_predef Diploma_TextBoxBorder
|
||||||
add_predef Func_3ed02
|
add_predef DoubleOrHalveSelectedStats
|
||||||
add_predef ShowPokedexMenu
|
add_predef ShowPokedexMenu
|
||||||
add_predef EvolutionAfterBattle
|
add_predef EvolutionAfterBattle
|
||||||
add_predef SaveSAVtoSRAM0
|
add_predef SaveSAVtoSRAM0
|
||||||
|
|
10
home.asm
10
home.asm
|
@ -1931,7 +1931,7 @@ GetItemName:: ; 2fcf (0:2fcf)
|
||||||
|
|
||||||
ld [wd0b5],a
|
ld [wd0b5],a
|
||||||
ld a,ITEM_NAME
|
ld a,ITEM_NAME
|
||||||
ld [W_LISTTYPE],a
|
ld [wNameListType],a
|
||||||
ld a,BANK(ItemNames)
|
ld a,BANK(ItemNames)
|
||||||
ld [wPredefBank],a
|
ld [wPredefBank],a
|
||||||
call GetName
|
call GetName
|
||||||
|
@ -2028,7 +2028,7 @@ HMMoves:: ; 3052 (0:3052)
|
||||||
GetMoveName:: ; 3058 (0:3058)
|
GetMoveName:: ; 3058 (0:3058)
|
||||||
push hl
|
push hl
|
||||||
ld a,MOVE_NAME
|
ld a,MOVE_NAME
|
||||||
ld [W_LISTTYPE],a
|
ld [wNameListType],a
|
||||||
ld a,[wd11e]
|
ld a,[wd11e]
|
||||||
ld [wd0b5],a
|
ld [wd0b5],a
|
||||||
ld a,BANK(MoveNames)
|
ld a,BANK(MoveNames)
|
||||||
|
@ -3252,7 +3252,7 @@ NamePointers:: ; 375d (0:375d)
|
||||||
GetName:: ; 376b (0:376b)
|
GetName:: ; 376b (0:376b)
|
||||||
; arguments:
|
; arguments:
|
||||||
; [wd0b5] = which name
|
; [wd0b5] = which name
|
||||||
; [wd0b6] = which list (W_LISTTYPE)
|
; [wNameListType] = which list
|
||||||
; [wPredefBank] = bank of list
|
; [wPredefBank] = bank of list
|
||||||
;
|
;
|
||||||
; returns pointer to name in de
|
; returns pointer to name in de
|
||||||
|
@ -3269,7 +3269,7 @@ GetName:: ; 376b (0:376b)
|
||||||
push hl
|
push hl
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
ld a,[W_LISTTYPE] ;List3759_entrySelector
|
ld a,[wNameListType] ;List3759_entrySelector
|
||||||
dec a
|
dec a
|
||||||
jr nz,.otherEntries
|
jr nz,.otherEntries
|
||||||
;1 = MON_NAMES
|
;1 = MON_NAMES
|
||||||
|
@ -3284,7 +3284,7 @@ GetName:: ; 376b (0:376b)
|
||||||
ld a,[wPredefBank]
|
ld a,[wPredefBank]
|
||||||
ld [H_LOADEDROMBANK],a
|
ld [H_LOADEDROMBANK],a
|
||||||
ld [$2000],a
|
ld [$2000],a
|
||||||
ld a,[W_LISTTYPE] ;VariousNames' entryID
|
ld a,[wNameListType] ;VariousNames' entryID
|
||||||
dec a
|
dec a
|
||||||
add a
|
add a
|
||||||
ld d,0
|
ld d,0
|
||||||
|
|
2
main.asm
2
main.asm
|
@ -96,7 +96,7 @@ LoadMonData_:
|
||||||
|
|
||||||
ld a, [wWhichPokemon]
|
ld a, [wWhichPokemon]
|
||||||
ld e, a
|
ld e, a
|
||||||
callab Func_39c37 ; get pokemon ID
|
callab GetMonSpecies
|
||||||
|
|
||||||
.GetMonHeader
|
.GetMonHeader
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
|
|
20
wram.asm
20
wram.asm
|
@ -979,8 +979,13 @@ wCriticalHitOrOHKO:: ; d05e
|
||||||
W_MOVEMISSED:: ; d05f
|
W_MOVEMISSED:: ; d05f
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd060:: ds 1
|
wPlayerStatsToDouble:: ; d060
|
||||||
wd061:: ds 1
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wPlayerStatsToHalve:: ; d061
|
||||||
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
W_PLAYERBATTSTATUS1:: ; d062
|
W_PLAYERBATTSTATUS1:: ; d062
|
||||||
; bit 0 - bide
|
; bit 0 - bide
|
||||||
|
@ -1010,8 +1015,13 @@ W_PLAYERBATTSTATUS3:: ; d064
|
||||||
; bit 3 - tranformed
|
; bit 3 - tranformed
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd065:: ds 1
|
wEnemyStatsToDouble:: ; d065
|
||||||
wd066:: ds 1
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wEnemyStatsToHalve:: ; d066
|
||||||
|
; always 0
|
||||||
|
ds 1
|
||||||
|
|
||||||
W_ENEMYBATTSTATUS1:: ; d067
|
W_ENEMYBATTSTATUS1:: ; d067
|
||||||
ds 1
|
ds 1
|
||||||
|
@ -1213,7 +1223,7 @@ W_SPRITEDECODETABLE1PTR:: ; d0b3
|
||||||
|
|
||||||
wd0b5:: ds 1
|
wd0b5:: ds 1
|
||||||
|
|
||||||
W_LISTTYPE:: ; d0b6
|
wNameListType:: ; d0b6
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wPredefBank:: ; d0b7
|
wPredefBank:: ; d0b7
|
||||||
|
|
Loading…
Reference in a new issue