mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-11 07:44:47 +13:00
Document the byte before a trainer’s AI pointer.
hg-commit-id: 6b0145fce032
This commit is contained in:
parent
ef6eb622c4
commit
0152e33909
|
|
@ -54,6 +54,8 @@ TX_NULL: MACRO
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; wram locations
|
; wram locations
|
||||||
|
W_AICOUNT EQU $CCDF ; number of times remaining that AI action can occur
|
||||||
|
|
||||||
W_OPPONENTHP EQU $CFE6 ; active opponent's hp (16 bits)
|
W_OPPONENTHP EQU $CFE6 ; active opponent's hp (16 bits)
|
||||||
W_OPPONENTNUMBER EQU $CFE8 ; active opponent's position in team (0 to 5)
|
W_OPPONENTNUMBER EQU $CFE8 ; active opponent's position in team (0 to 5)
|
||||||
W_OPPONENTSTATUS EQU $CFE9 ; active opponent's status condition
|
W_OPPONENTSTATUS EQU $CFE9 ; active opponent's status condition
|
||||||
|
|
|
||||||
20
pokered.asm
20
pokered.asm
|
|
@ -5622,15 +5622,15 @@ TrainerAI: ; 652E
|
||||||
add hl,bc
|
add hl,bc
|
||||||
add hl,bc
|
add hl,bc
|
||||||
add hl,bc
|
add hl,bc
|
||||||
ld a,[$CCDF] ; XXX 340b0,3a548,3a553,3a696,3c943,3ef74
|
ld a,[W_AICOUNT]
|
||||||
and a
|
and a
|
||||||
ret z ; if XXX, we're done here
|
ret z ; if no AI uses left, we're done here
|
||||||
inc hl
|
inc hl
|
||||||
inc a
|
inc a
|
||||||
jr nz,.getpointer\@
|
jr nz,.getpointer\@
|
||||||
dec hl
|
dec hl
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
ld [$CCDF],a
|
ld [W_AICOUNT],a
|
||||||
.getpointer\@
|
.getpointer\@
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
ld h,[hl]
|
ld h,[hl]
|
||||||
|
|
@ -5640,7 +5640,7 @@ TrainerAI: ; 652E
|
||||||
|
|
||||||
TrainerAIPointers: ; 655C
|
TrainerAIPointers: ; 655C
|
||||||
; one entry per trainer class
|
; one entry per trainer class
|
||||||
; XXX first byte, ???
|
; first byte, number of times (per Pokémon) it can occur
|
||||||
; next two bytes, pointer to AI subroutine for trainer class
|
; next two bytes, pointer to AI subroutine for trainer class
|
||||||
dbw 3,GenericAI
|
dbw 3,GenericAI
|
||||||
dbw 3,GenericAI
|
dbw 3,GenericAI
|
||||||
|
|
@ -5816,9 +5816,9 @@ GenericAI:
|
||||||
|
|
||||||
; end of individual trainer AI routines
|
; end of individual trainer AI routines
|
||||||
|
|
||||||
Function6695: ; 6695
|
DecrementAICount: ; 6695
|
||||||
; XXX what does this do
|
; XXX what does this do
|
||||||
ld hl,$CCDF
|
ld hl,W_AICOUNT
|
||||||
dec [hl]
|
dec [hl]
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
@ -5918,7 +5918,7 @@ Function6718: ; 6718
|
||||||
ld [$CF94],a
|
ld [$CF94],a
|
||||||
ld a,$48
|
ld a,$48
|
||||||
call Predef
|
call Predef
|
||||||
jp $6695
|
jp DecrementAICount
|
||||||
|
|
||||||
Function672A: ; 672A
|
Function672A: ; 672A
|
||||||
ld a,[W_ENEMYMONCOUNT]
|
ld a,[W_ENEMYMONCOUNT]
|
||||||
|
|
@ -6091,12 +6091,12 @@ AIIncreaseStat:
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
pop af
|
pop af
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
jp $6695
|
jp DecrementAICount
|
||||||
|
|
||||||
AIPrintItemUse:
|
AIPrintItemUse:
|
||||||
ld [$CF05],a
|
ld [$CF05],a
|
||||||
call AIPrintItemUse_
|
call AIPrintItemUse_
|
||||||
jp $6695
|
jp DecrementAICount
|
||||||
|
|
||||||
AIPrintItemUse_:
|
AIPrintItemUse_:
|
||||||
; print "x used [$CF05] on z!"
|
; print "x used [$CF05] on z!"
|
||||||
|
|
@ -8321,7 +8321,7 @@ EnemySendOut: ; 490E
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
dec a
|
dec a
|
||||||
ld [$CCDF],a
|
ld [W_AICOUNT],a
|
||||||
ld hl,$D062
|
ld hl,$D062
|
||||||
res 5,[hl]
|
res 5,[hl]
|
||||||
ld hl,$C3B2
|
ld hl,$C3B2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue