mirror of https://github.com/pret/pokecrystal.git
Rename CheckTrainerBattle
Renamed to be more in line with our current coding standards. Hopefully this is slightly more readable.
This commit is contained in:
parent
e68713d20e
commit
f52f20edb7
|
@ -248,7 +248,7 @@ PlayerEvents:
|
||||||
|
|
||||||
call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time
|
call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time
|
||||||
|
|
||||||
call CheckTrainerBattle3
|
call CheckTrainerBattle_GetPlayerEvent
|
||||||
jr c, .ok
|
jr c, .ok
|
||||||
|
|
||||||
call CheckTileEvent
|
call CheckTileEvent
|
||||||
|
@ -289,10 +289,10 @@ PlayerEvents:
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckTrainerBattle3:
|
CheckTrainerBattle_GetPlayerEvent:
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
call CheckTrainerBattle2
|
call CheckTrainerBattle
|
||||||
jr nc, .nope
|
jr nc, .nope
|
||||||
|
|
||||||
ld a, PLAYEREVENT_SEENBYTRAINER
|
ld a, PLAYEREVENT_SEENBYTRAINER
|
||||||
|
|
|
@ -38,7 +38,7 @@ FlagAction::
|
||||||
; 1 SET_FLAG set bit
|
; 1 SET_FLAG set bit
|
||||||
; 2 CHECK_FLAG check bit
|
; 2 CHECK_FLAG check bit
|
||||||
; de: bit number
|
; de: bit number
|
||||||
; hl: index within bit table
|
; hl: pointer to the flag array
|
||||||
|
|
||||||
; get index within the byte
|
; get index within the byte
|
||||||
ld a, e
|
ld a, e
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
CheckTrainerBattle2::
|
CheckTrainerBattle::
|
||||||
ldh a, [hROMBank]
|
ldh a, [hROMBank]
|
||||||
push af
|
push af
|
||||||
|
|
||||||
call SwitchToMapScriptsBank
|
call SwitchToMapScriptsBank
|
||||||
call CheckTrainerBattle
|
call _CheckTrainerBattle
|
||||||
|
|
||||||
pop bc
|
pop bc
|
||||||
ld a, b
|
ld a, b
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
ret
|
ret
|
||||||
|
|
||||||
CheckTrainerBattle::
|
_CheckTrainerBattle::
|
||||||
; Check if any trainer on the map sees the player and wants to battle.
|
; Check if any trainer on the map sees the player and wants to battle.
|
||||||
|
|
||||||
; Skip the player object.
|
; Skip the player object.
|
||||||
|
@ -35,7 +35,7 @@ CheckTrainerBattle::
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and $f
|
and $f
|
||||||
cp $2
|
cp OBJECTTYPE_TRAINER
|
||||||
jr nz, .next
|
jr nz, .next
|
||||||
|
|
||||||
; Is visible on the map
|
; Is visible on the map
|
||||||
|
|
4
hram.asm
4
hram.asm
|
@ -126,9 +126,7 @@ hWY:: db ; ffd2
|
||||||
hTilesPerCycle:: db ; ffd3
|
hTilesPerCycle:: db ; ffd3
|
||||||
hBGMapMode:: db ; ffd4
|
hBGMapMode:: db ; ffd4
|
||||||
hBGMapThird:: db ; ffd5
|
hBGMapThird:: db ; ffd5
|
||||||
hBGMapAddress:: db ; ffd6
|
hBGMapAddress:: dw ; ffd6
|
||||||
|
|
||||||
ds 1
|
|
||||||
|
|
||||||
hOAMUpdate:: db ; ffd8
|
hOAMUpdate:: db ; ffd8
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue