mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
commented battle stuff
This commit is contained in:
parent
72265ab92a
commit
4fd7a42b23
26 changed files with 272 additions and 253 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
Func_525af: ; 525af (14:65af)
|
InitBattleVariables: ; 525af (14:65af)
|
||||||
ld a, [hTilesetType]
|
ld a, [hTilesetType]
|
||||||
ld [wd0d4], a
|
ld [wd0d4], a
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -9,7 +9,7 @@ Func_525af: ; 525af (14:65af)
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wListScrollOffset], a ; wcc36
|
ld [wListScrollOffset], a
|
||||||
ld [wCriticalHitOrOHKO], a
|
ld [wCriticalHitOrOHKO], a
|
||||||
ld [wBattleMonSpecies], a
|
ld [wBattleMonSpecies], a
|
||||||
ld [wPartyGainExpFlags], a
|
ld [wPartyGainExpFlags], a
|
||||||
|
|
@ -21,73 +21,73 @@ Func_525af: ; 525af (14:65af)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld hl, wccd3
|
ld hl, wccd3
|
||||||
ld b, $3c
|
ld b, $3c
|
||||||
.asm_525e1
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_525e1
|
jr nz, .loop
|
||||||
inc a
|
inc a
|
||||||
ld [wccd9], a
|
ld [wccd9], a
|
||||||
ld a, [W_CURMAP]
|
ld a, [W_CURMAP]
|
||||||
cp SAFARI_ZONE_EAST
|
cp SAFARI_ZONE_EAST
|
||||||
jr c, .asm_525f9
|
jr c, .notSafariBattle
|
||||||
cp SAFARI_ZONE_REST_HOUSE_1
|
cp SAFARI_ZONE_REST_HOUSE_1
|
||||||
jr nc, .asm_525f9
|
jr nc, .notSafariBattle
|
||||||
ld a, $2
|
ld a, $2 ; safari battle
|
||||||
ld [W_BATTLETYPE], a ; wd05a
|
ld [W_BATTLETYPE], a
|
||||||
.asm_525f9
|
.notSafariBattle
|
||||||
ld hl, PlayBattleMusic
|
ld hl, PlayBattleMusic
|
||||||
ld b, BANK(PlayBattleMusic)
|
ld b, BANK(PlayBattleMusic)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
ParalyzeEffect_: ; 52601 (14:6601)
|
ParalyzeEffect_: ; 52601 (14:6601)
|
||||||
ld hl, wEnemyMonStatus ; wcfe9
|
ld hl, wEnemyMonStatus
|
||||||
ld de, W_PLAYERMOVETYPE ; wcfd5
|
ld de, W_PLAYERMOVETYPE
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jp z, .asm_52613
|
jp z, .next
|
||||||
ld hl, wBattleMonStatus
|
ld hl, wBattleMonStatus
|
||||||
ld de, W_ENEMYMOVETYPE ; wcfcf
|
ld de, W_ENEMYMOVETYPE
|
||||||
|
.next
|
||||||
.asm_52613
|
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and a
|
and a ; does the target already have a status ailment?
|
||||||
jr nz, .asm_52659
|
jr nz, .didntAffect
|
||||||
|
; check if the target is immune due to types
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp EVASION_DOWN1_EFFECT
|
cp ELECTRIC
|
||||||
jr nz, .asm_5262a
|
jr nz, .hitTest
|
||||||
ld b, h
|
ld b, h
|
||||||
ld c, l
|
ld c, l
|
||||||
inc bc
|
inc bc
|
||||||
ld a, [bc]
|
ld a, [bc]
|
||||||
cp $4
|
cp GROUND
|
||||||
jr z, .asm_52666
|
jr z, .doesntAffect
|
||||||
inc bc
|
inc bc
|
||||||
ld a, [bc]
|
ld a, [bc]
|
||||||
cp $4
|
cp GROUND
|
||||||
jr z, .asm_52666
|
jr z, .doesntAffect
|
||||||
.asm_5262a
|
.hitTest
|
||||||
push hl
|
push hl
|
||||||
callab MoveHitTest
|
callab MoveHitTest
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [W_MOVEMISSED]
|
ld a, [W_MOVEMISSED]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_52659
|
jr nz, .didntAffect
|
||||||
set PAR, [hl]
|
set PAR, [hl]
|
||||||
callab QuarterSpeedDueToParalysis
|
callab QuarterSpeedDueToParalysis
|
||||||
ld c, $1e
|
ld c, 30
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, PrintMayNotAttackText
|
ld hl, PrintMayNotAttackText
|
||||||
ld b, BANK(PrintMayNotAttackText)
|
ld b, BANK(PrintMayNotAttackText)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
.asm_52659
|
.didntAffect
|
||||||
ld c, $32
|
ld c, 50
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintDidntAffectText
|
ld hl, PrintDidntAffectText
|
||||||
ld b, BANK(PrintDidntAffectText)
|
ld b, BANK(PrintDidntAffectText)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
.asm_52666
|
.doesntAffect
|
||||||
ld c, $32
|
ld c, 50
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintDoesntAffectText
|
ld hl, PrintDoesntAffectText
|
||||||
ld b, BANK(PrintDoesntAffectText)
|
ld b, BANK(PrintDoesntAffectText)
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ PrintBeginningBattleText: ; 58d99 (16:4d99)
|
||||||
ld hl, UnveiledGhostText
|
ld hl, UnveiledGhostText
|
||||||
call PrintText
|
call PrintText
|
||||||
callab LoadEnemyMonData
|
callab LoadEnemyMonData
|
||||||
callab Func_708ca
|
callab DoGhostMarowakRevelationAnimation
|
||||||
ld hl, WildMonAppearedText
|
ld hl, WildMonAppearedText
|
||||||
call PrintText
|
call PrintText
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,85 +1,90 @@
|
||||||
Func_708ca: ; 708ca (1c:48ca)
|
DoGhostMarowakRevelationAnimation: ; 708ca (1c:48ca)
|
||||||
ld a, $e4
|
ld a, $e4
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
call Func_7092a
|
call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same
|
||||||
|
; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap
|
||||||
hlCoord 12, 0
|
hlCoord 12, 0
|
||||||
ld bc, $707
|
ld bc, $707
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
call Delay3
|
call Delay3
|
||||||
xor a
|
xor a
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
|
ld [H_AUTOBGTRANSFERENABLED], a ; disable BG transfer so we don't see the Marowak too soon
|
||||||
ld a, $91
|
; replace ghost pic with Marowak in BG
|
||||||
|
ld a, MAROWAK
|
||||||
ld [wHPBarMaxHP], a
|
ld [wHPBarMaxHP], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_WHOSETURN], a ; $fff3
|
ld [H_WHOSETURN], a
|
||||||
callab Func_79793
|
callab Func_79793
|
||||||
|
; alternate between black and light grey 8 times.
|
||||||
|
; this makes the ghost's body appear to flash
|
||||||
ld d, $80
|
ld d, $80
|
||||||
call Func_704f3
|
call FlashSprite8Times
|
||||||
.asm_708f6
|
.fadeOutGhostLoop
|
||||||
ld c, $a
|
ld c, 10
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld a, [rOBP1] ; $ff49
|
ld a, [rOBP1]
|
||||||
sla a
|
sla a
|
||||||
sla a
|
sla a
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
jr nz, .asm_708f6
|
jr nz, .fadeOutGhostLoop
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
call Func_7092a
|
call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM
|
||||||
ld b, $e4
|
ld b, $e4
|
||||||
.asm_7090d
|
.fadeInMarowakLoop
|
||||||
ld c, $a
|
ld c, 10
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld a, [rOBP1] ; $ff49
|
ld a, [rOBP1]
|
||||||
srl b
|
srl b
|
||||||
rra
|
rra
|
||||||
srl b
|
srl b
|
||||||
rra
|
rra
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
ld a, b
|
ld a, b
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_7090d
|
jr nz, .fadeInMarowakLoop
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a ; $ffba
|
ld [H_AUTOBGTRANSFERENABLED], a ; enable BG transfer so the BG Marowak pic will be visible after the sprite one is cleared
|
||||||
call Delay3
|
call Delay3
|
||||||
jp ClearSprites
|
jp ClearSprites
|
||||||
|
|
||||||
Func_7092a: ; 7092a (1c:492a)
|
; copies a mon pic's from background VRAM to sprite VRAM and sets up OAM
|
||||||
|
CopyMonPicFromBGToSpriteVRAM: ; 7092a (1c:492a)
|
||||||
ld de, vFrontPic
|
ld de, vFrontPic
|
||||||
ld hl, vSprites
|
ld hl, vSprites
|
||||||
ld bc, 7 * 7
|
ld bc, 7 * 7
|
||||||
call CopyVideoData
|
call CopyVideoData
|
||||||
ld a, $10
|
ld a, $10
|
||||||
ld [W_BASECOORDY], a ; wd082
|
ld [W_BASECOORDY], a
|
||||||
ld a, $70
|
ld a, $70
|
||||||
ld [W_BASECOORDX], a ; wd081
|
ld [W_BASECOORDX], a
|
||||||
ld hl, wOAMBuffer
|
ld hl, wOAMBuffer
|
||||||
ld bc, $606
|
ld bc, $606
|
||||||
ld d, $8
|
ld d, $8
|
||||||
.asm_70948
|
.oamLoop
|
||||||
push bc
|
push bc
|
||||||
ld a, [W_BASECOORDY] ; wd082
|
ld a, [W_BASECOORDY]
|
||||||
ld e, a
|
ld e, a
|
||||||
.asm_7094d
|
.oamInnerLoop
|
||||||
ld a, e
|
ld a, e
|
||||||
add $8
|
add $8
|
||||||
ld e, a
|
ld e, a
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, [W_BASECOORDX] ; wd081
|
ld a, [W_BASECOORDX]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, d
|
ld a, d
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld a, $10
|
ld a, $10 ; use OBP1
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
inc d
|
inc d
|
||||||
dec c
|
dec c
|
||||||
jr nz, .asm_7094d
|
jr nz, .oamInnerLoop
|
||||||
inc d
|
inc d
|
||||||
ld a, [W_BASECOORDX] ; wd081
|
ld a, [W_BASECOORDX]
|
||||||
add $8
|
add $8
|
||||||
ld [W_BASECOORDX], a ; wd081
|
ld [W_BASECOORDX], a
|
||||||
pop bc
|
pop bc
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_70948
|
jr nz, .oamLoop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
BattleTransition: ; 7096d (1c:496d)
|
BattleTransition: ; 7096d (1c:496d)
|
||||||
|
|
@ -270,9 +275,9 @@ BattleTransitionTile: ; 70a59 (1c:4a59)
|
||||||
|
|
||||||
BattleTransition_BlackScreen: ; 70a69 (1c:4a69)
|
BattleTransition_BlackScreen: ; 70a69 (1c:4a69)
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
ld [rBGP], a ; $ff47
|
ld [rBGP], a
|
||||||
ld [rOBP0], a ; $ff48
|
ld [rOBP0], a
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; for non-dungeon trainer battles
|
; for non-dungeon trainer battles
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
Func_128d8: ; 128d8 (4:68d8)
|
; returns whether the player is one tile outside the map in Z
|
||||||
ld a, [W_YCOORD] ; wd361
|
IsPlayerJustOutsideMap: ; 128d8 (4:68d8)
|
||||||
|
ld a, [W_YCOORD]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_CURMAPHEIGHT] ; wd368
|
ld a, [W_CURMAPHEIGHT]
|
||||||
call Func_128ea
|
call .compareCoordWithMapDimension
|
||||||
ret z
|
ret z
|
||||||
ld a, [W_XCOORD] ; wd362
|
ld a, [W_XCOORD]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_CURMAPWIDTH] ; wd369
|
ld a, [W_CURMAPWIDTH]
|
||||||
|
.compareCoordWithMapDimension
|
||||||
Func_128ea: ; 128ea (4:68ea)
|
|
||||||
add a
|
add a
|
||||||
cp b
|
cp b
|
||||||
ret z
|
ret z
|
||||||
|
|
@ -24,7 +24,7 @@ Func_128f6: ; 128f6 (4:68f6)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
ld a, $2
|
ld a, $2
|
||||||
asm_128fb: ; 128fb (4:68fb)
|
asm_128fb: ; 128fb (4:68fb)
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wListMenuID], a
|
||||||
push hl
|
push hl
|
||||||
ld a, [wcf99]
|
ld a, [wcf99]
|
||||||
ld b, a
|
ld b, a
|
||||||
|
|
@ -37,7 +37,7 @@ asm_128fb: ; 128fb (4:68fb)
|
||||||
ld e, a
|
ld e, a
|
||||||
ld a, $6
|
ld a, $6
|
||||||
ld d, a
|
ld d, a
|
||||||
jp Func_12924
|
jp DrawHPBarAndFraction
|
||||||
.asm_12913
|
.asm_12913
|
||||||
ld a, [wcfba]
|
ld a, [wcfba]
|
||||||
ld d, a
|
ld d, a
|
||||||
|
|
@ -48,21 +48,21 @@ asm_128fb: ; 128fb (4:68fb)
|
||||||
ld d, a
|
ld d, a
|
||||||
ld c, a
|
ld c, a
|
||||||
|
|
||||||
Func_12924: ; 12924 (4:6924)
|
DrawHPBarAndFraction: ; 12924 (4:6924)
|
||||||
pop hl
|
pop hl
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
push hl
|
push hl
|
||||||
call DrawHPBar
|
call DrawHPBar
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jr z, .asm_12937
|
jr z, .printFractionBelowBar
|
||||||
ld bc, $9
|
ld bc, $9 ; right of bar
|
||||||
jr .asm_1293a
|
jr .printHPFraction
|
||||||
.asm_12937
|
.printFractionBelowBar
|
||||||
ld bc, $15
|
ld bc, SCREEN_WIDTH + 1 ; below bar
|
||||||
.asm_1293a
|
.printHPFraction
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld de, wcf99
|
ld de, wcf99
|
||||||
ld bc, $203
|
ld bc, $203
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,9 @@ PickUpPayDayMoneyText: ; 1386b (4:786b)
|
||||||
TX_FAR _PickUpPayDayMoneyText
|
TX_FAR _PickUpPayDayMoneyText
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
Func_13870: ; 13870 (4:7870)
|
; try to initiate a wild pokemon encounter
|
||||||
|
; returns success in Z
|
||||||
|
TryDoWildEncounter: ; 13870 (4:7870)
|
||||||
ld a, [wNPCMovementScriptPointerTableNum]
|
ld a, [wNPCMovementScriptPointerTableNum]
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
|
|
@ -95,14 +97,14 @@ Func_13870: ; 13870 (4:7870)
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
callab IsPlayerStandingOnDoorTileOrWarpTile
|
callab IsPlayerStandingOnDoorTileOrWarpTile
|
||||||
jr nc, .asm_13888
|
jr nc, .notStandingOnDoorOrWarpTile
|
||||||
.asm_13884
|
.CantEncounter
|
||||||
ld a, $1
|
ld a, $1
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
.asm_13888
|
.notStandingOnDoorOrWarpTile
|
||||||
callab Func_128d8
|
callab IsPlayerJustOutsideMap
|
||||||
jr z, .asm_13884
|
jr z, .CantEncounter
|
||||||
ld a, [wRepelRemainingSteps]
|
ld a, [wRepelRemainingSteps]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_1389e
|
jr z, .asm_1389e
|
||||||
|
|
@ -110,8 +112,8 @@ Func_13870: ; 13870 (4:7870)
|
||||||
jr z, .lastRepelStep
|
jr z, .lastRepelStep
|
||||||
ld [wRepelRemainingSteps], a
|
ld [wRepelRemainingSteps], a
|
||||||
.asm_1389e
|
.asm_1389e
|
||||||
; determine if wild pokémon can appear in the half-block we’re standing
|
; determine if wild pokémon can appear in the half-block we’re standing in
|
||||||
; is the bottom right tile (9,9) of the half-block are we standing a grass/water tile?
|
; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
|
||||||
hlCoord 9, 9
|
hlCoord 9, 9
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
ld a, [W_GRASSTILE]
|
ld a, [W_GRASSTILE]
|
||||||
|
|
@ -127,17 +129,17 @@ Func_13870: ; 13870 (4:7870)
|
||||||
; …as long as it’s not Viridian Forest or Safari Zone.
|
; …as long as it’s not Viridian Forest or Safari Zone.
|
||||||
ld a, [W_CURMAP]
|
ld a, [W_CURMAP]
|
||||||
cp REDS_HOUSE_1F ; is this an indoor map?
|
cp REDS_HOUSE_1F ; is this an indoor map?
|
||||||
jr c, .CantEncounter
|
jr c, .CantEncounter2
|
||||||
ld a, [W_CURMAPTILESET]
|
ld a, [W_CURMAPTILESET]
|
||||||
cp FOREST ; Viridian Forest/Safari Zone
|
cp FOREST ; Viridian Forest/Safari Zone
|
||||||
jr z, .CantEncounter
|
jr z, .CantEncounter2
|
||||||
ld a, [W_GRASSRATE]
|
ld a, [W_GRASSRATE]
|
||||||
.CanEncounter
|
.CanEncounter
|
||||||
; weigh encounter chance to a random number to determine if there will be an encounter
|
; compare encounter chance with a random number to determine if there will be an encounter
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [hRandomAdd]
|
ld a, [hRandomAdd]
|
||||||
cp b
|
cp b
|
||||||
jr nc, .CantEncounter
|
jr nc, .CantEncounter2
|
||||||
ld a, [hRandomSub]
|
ld a, [hRandomSub]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld hl, WildMonEncounterSlotChances
|
ld hl, WildMonEncounterSlotChances
|
||||||
|
|
@ -148,15 +150,15 @@ Func_13870: ; 13870 (4:7870)
|
||||||
inc hl
|
inc hl
|
||||||
jr .determineEncounterSlot
|
jr .determineEncounterSlot
|
||||||
.gotEncounterSlot
|
.gotEncounterSlot
|
||||||
; determine which wild pokémon (grass or water) can appear in the half-block we’re standing
|
; determine which wild pokémon (grass or water) can appear in the half-block we’re standing in
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
ld hl, W_GRASSMONS
|
ld hl, W_GRASSMONS
|
||||||
aCoord 8, 9
|
aCoord 8, 9
|
||||||
cp $14 ; is the bottom left tile (8,9) of the half-block are we standing a water tile?
|
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
|
||||||
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
|
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
|
||||||
ld hl, W_WATERMONS
|
ld hl, W_WATERMONS
|
||||||
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
|
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
|
||||||
; "left shore" half-blocks (such as the one in the east coast of Cinnabar), load grass encounters.
|
; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
|
||||||
.gotWildEncounterType
|
.gotWildEncounterType
|
||||||
ld b, $0
|
ld b, $0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
@ -172,15 +174,15 @@ Func_13870: ; 13870 (4:7870)
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_CURENEMYLVL]
|
ld a, [W_CURENEMYLVL]
|
||||||
cp b
|
cp b
|
||||||
jr c, .CantEncounter
|
jr c, .CantEncounter2 ; repel prevents encounters if the leading party mon's level is higher than the wild mon
|
||||||
jr .willEncounter
|
jr .willEncounter
|
||||||
.lastRepelStep
|
.lastRepelStep
|
||||||
ld [wRepelRemainingSteps], a
|
ld [wRepelRemainingSteps], a
|
||||||
ld a, $d2
|
ld a, $d2
|
||||||
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
|
ld [H_DOWNARROWBLINKCNT2], a
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
call DisplayTextID
|
call DisplayTextID
|
||||||
.CantEncounter
|
.CantEncounter2
|
||||||
ld a, $1
|
ld a, $1
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
|
|
@ -293,8 +295,8 @@ ConversionEffect_: ; 139a3 (4:79a3)
|
||||||
inc de
|
inc de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld hl, Func_3fba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call Func_139d5
|
call CallBankF
|
||||||
ld hl, ConvertedTypeText
|
ld hl, ConvertedTypeText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
||||||
|
|
@ -304,22 +306,22 @@ ConvertedTypeText: ; 139cd (4:79cd)
|
||||||
|
|
||||||
PrintButItFailedText: ; 139d2 (4:79d2)
|
PrintButItFailedText: ; 139d2 (4:79d2)
|
||||||
ld hl, PrintButItFailedText_
|
ld hl, PrintButItFailedText_
|
||||||
Func_139d5: ; 139d5 (4:79d5)
|
CallBankF: ; 139d5 (4:79d5)
|
||||||
ld b, BANK(PrintButItFailedText_)
|
ld b, BANK(PrintButItFailedText_)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
HazeEffect_: ; 139da (4:79da)
|
HazeEffect_: ; 139da (4:79da)
|
||||||
ld a, $7
|
ld a, $7
|
||||||
ld hl, wPlayerMonAttackMod
|
ld hl, wPlayerMonAttackMod
|
||||||
call Func_13a43
|
call ResetStatMods
|
||||||
ld hl, wEnemyMonAttackMod
|
ld hl, wEnemyMonAttackMod
|
||||||
call Func_13a43
|
call ResetStatMods
|
||||||
ld hl, wPlayerMonUnmodifiedAttack
|
ld hl, wPlayerMonUnmodifiedAttack
|
||||||
ld de, wBattleMonAttack
|
ld de, wBattleMonAttack
|
||||||
call Func_13a4a
|
call ResetStats
|
||||||
ld hl, wEnemyMonUnmodifiedAttack
|
ld hl, wEnemyMonUnmodifiedAttack
|
||||||
ld de, wEnemyMonAttack
|
ld de, wEnemyMonAttack
|
||||||
call Func_13a4a
|
call ResetStats
|
||||||
ld hl, wEnemyMonStatus
|
ld hl, wEnemyMonStatus
|
||||||
ld de, wEnemySelectedMove
|
ld de, wEnemySelectedMove
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
|
|
@ -347,8 +349,8 @@ HazeEffect_: ; 139da (4:79da)
|
||||||
call CureStatuses
|
call CureStatuses
|
||||||
ld hl, W_ENEMYBATTSTATUS1
|
ld hl, W_ENEMYBATTSTATUS1
|
||||||
call CureStatuses
|
call CureStatuses
|
||||||
ld hl, Func_3fba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call Func_139d5
|
call CallBankF
|
||||||
ld hl, StatusChangesEliminatedText
|
ld hl, StatusChangesEliminatedText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
||||||
|
|
@ -363,7 +365,7 @@ CureStatuses: ; 13a37 (4:7a37)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_13a43: ; 13a43 (4:7a43)
|
ResetStatMods: ; 13a43 (4:7a43)
|
||||||
ld b, $8
|
ld b, $8
|
||||||
.loop
|
.loop
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -371,7 +373,7 @@ Func_13a43: ; 13a43 (4:7a43)
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_13a4a: ; 13a4a (4:7a4a)
|
ResetStats: ; 13a4a (4:7a4a)
|
||||||
ld b, $8
|
ld b, $8
|
||||||
.loop
|
.loop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ SubstituteEffectHandler: ; 17dad (5:7dad)
|
||||||
ld hl, wBattleMonMaxHP
|
ld hl, wBattleMonMaxHP
|
||||||
ld de, wPlayerSubstituteHP
|
ld de, wPlayerSubstituteHP
|
||||||
ld bc, W_PLAYERBATTSTATUS2
|
ld bc, W_PLAYERBATTSTATUS2
|
||||||
ld a, [$fff3] ;whose turn?
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .notEnemy
|
jr z, .notEnemy
|
||||||
ld hl, wEnemyMonMaxHP
|
ld hl, wEnemyMonMaxHP
|
||||||
|
|
@ -23,8 +23,8 @@ SubstituteEffectHandler: ; 17dad (5:7dad)
|
||||||
srl a
|
srl a
|
||||||
rr b
|
rr b
|
||||||
push de
|
push de
|
||||||
ld de, $fff2 ;subtract 8 to point to [current hp] instead of [max hp]
|
ld de, wBattleMonHP - wBattleMonMaxHP
|
||||||
add hl, de ;HL -= 8
|
add hl, de ; point hl to current HP
|
||||||
pop de
|
pop de
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [de], a ;save copy of HP to subtract in ccd7/ccd8 [how much HP substitute has]
|
ld [de], a ;save copy of HP to subtract in ccd7/ccd8 [how much HP substitute has]
|
||||||
|
|
@ -44,8 +44,8 @@ SubstituteEffectHandler: ; 17dad (5:7dad)
|
||||||
set HasSubstituteUp, [hl] ;set bit 4 of flags, user now has substitute
|
set HasSubstituteUp, [hl] ;set bit 4 of flags, user now has substitute
|
||||||
ld a, [W_OPTIONS] ;load options
|
ld a, [W_OPTIONS] ;load options
|
||||||
bit 7, a ;battle animation is enabled?
|
bit 7, a ;battle animation is enabled?
|
||||||
ld hl, Func_3fba8 ;animation enabled: 0F:7BA8
|
ld hl, PlayCurrentMoveAnimation ;animation enabled: 0F:7BA8
|
||||||
ld b, BANK(Func_3fba8)
|
ld b, BANK(PlayCurrentMoveAnimation)
|
||||||
jr z, .animationEnabled
|
jr z, .animationEnabled
|
||||||
ld hl, AnimationSubstitute ;animation disabled: 1E:56E0
|
ld hl, AnimationSubstitute ;animation disabled: 1E:56E0
|
||||||
ld b, BANK(AnimationSubstitute)
|
ld b, BANK(AnimationSubstitute)
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,43 @@
|
||||||
Func_27d6b: ; 27d6b (9:7d6b)
|
; [wd0b5] = pokemon ID
|
||||||
|
; hl = dest addr
|
||||||
|
PrintMonType: ; 27d6b (9:7d6b)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
push hl
|
push hl
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
pop hl
|
pop hl
|
||||||
push hl
|
push hl
|
||||||
ld a, [W_MONHTYPE1]
|
ld a, [W_MONHTYPE1]
|
||||||
call Func_27d89
|
call PrintType
|
||||||
ld a, [W_MONHTYPE1]
|
ld a, [W_MONHTYPE1]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [W_MONHTYPE2]
|
ld a, [W_MONHTYPE2]
|
||||||
cp b
|
cp b
|
||||||
pop hl
|
pop hl
|
||||||
jr z, asm_27d8c
|
jr z, EraseType2Text
|
||||||
ld bc, $28
|
ld bc, SCREEN_WIDTH * 2
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
||||||
Func_27d89: ; 27d89 (9:7d89)
|
; a = type
|
||||||
|
; hl = dest addr
|
||||||
|
PrintType: ; 27d89 (9:7d89)
|
||||||
push hl
|
push hl
|
||||||
jr asm_27d9f
|
jr PrintType_
|
||||||
asm_27d8c: ; 27d8c (9:7d8c)
|
|
||||||
ld a, $7f
|
; erase "TYPE2/" if the mon only has 1 type
|
||||||
|
EraseType2Text: ; 27d8c (9:7d8c)
|
||||||
|
ld a, " "
|
||||||
ld bc, $13
|
ld bc, $13
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld bc, $6
|
ld bc, $6
|
||||||
jp FillMemory
|
jp FillMemory
|
||||||
|
|
||||||
Func_27d98: ; 27d98 (9:7d98)
|
PrintMoveType: ; 27d98 (9:7d98)
|
||||||
call GetPredefRegisters
|
call GetPredefRegisters
|
||||||
push hl
|
push hl
|
||||||
ld a, [W_PLAYERMOVETYPE] ; wcfd5
|
ld a, [W_PLAYERMOVETYPE]
|
||||||
asm_27d9f: ; 27d9f (9:7d9f)
|
; fall through
|
||||||
|
|
||||||
|
PrintType_: ; 27d9f (9:7d9f)
|
||||||
add a
|
add a
|
||||||
ld hl, TypeNames
|
ld hl, TypeNames
|
||||||
ld e, a
|
ld e, a
|
||||||
|
|
@ -157,19 +165,19 @@ CooltrainerFName: ; 27f79 (9:7f79)
|
||||||
db "COOLTRAINER♀@"
|
db "COOLTRAINER♀@"
|
||||||
|
|
||||||
FocusEnergyEffect_: ; 27f86 (9:7f86)
|
FocusEnergyEffect_: ; 27f86 (9:7f86)
|
||||||
ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
|
ld hl, W_PLAYERBATTSTATUS2
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_27f91
|
jr z, .notEnemy
|
||||||
ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
|
ld hl, W_ENEMYBATTSTATUS2
|
||||||
.asm_27f91
|
.notEnemy
|
||||||
bit GettingPumped, [hl] ; is mon already using focus energy?
|
bit GettingPumped, [hl] ; is mon already using focus energy?
|
||||||
jr nz, .asm_27fa5
|
jr nz, .alreadyUsing
|
||||||
set GettingPumped, [hl] ; mon is now using focus energy
|
set GettingPumped, [hl] ; mon is now using focus energy
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, GettingPumpedText ; $7fb2
|
ld hl, GettingPumpedText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_27fa5
|
.alreadyUsing
|
||||||
ld c, $32
|
ld c, $32
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintButItFailedText_
|
ld hl, PrintButItFailedText_
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ LeechSeedEffect_: ; 2bea9 (a:7ea9)
|
||||||
bit Seeded, [hl]
|
bit Seeded, [hl]
|
||||||
jr nz, .asm_2bee7
|
jr nz, .asm_2bee7
|
||||||
set Seeded, [hl]
|
set Seeded, [hl]
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, WasSeededText ; $7ef2
|
ld hl, WasSeededText ; $7ef2
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_2bee7
|
.asm_2bee7
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ MistEffect_: ; 33f2b (c:7f2b)
|
||||||
bit ProtectedByMist, [hl] ; is mon protected by mist?
|
bit ProtectedByMist, [hl] ; is mon protected by mist?
|
||||||
jr nz, .asm_33f4a
|
jr nz, .asm_33f4a
|
||||||
set ProtectedByMist, [hl] ; mon is now protected by mist
|
set ProtectedByMist, [hl] ; mon is now protected by mist
|
||||||
callab Func_3fba8
|
callab PlayCurrentMoveAnimation
|
||||||
ld hl, ShroudedInMistText
|
ld hl, ShroudedInMistText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_33f4a
|
.asm_33f4a
|
||||||
|
|
|
||||||
|
|
@ -2541,13 +2541,13 @@ MoveSelectionMenu: ; 3d219 (f:5219)
|
||||||
|
|
||||||
.writemoves
|
.writemoves
|
||||||
ld de, wd0e1
|
ld de, wd0e1
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
set 2, a
|
set 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
res 2, a
|
res 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.regularmenu
|
.regularmenu
|
||||||
|
|
@ -2666,10 +2666,10 @@ SelectMenuItem: ; 3d2fe (f:52fe)
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld [hl], $ec
|
ld [hl], $ec
|
||||||
.select
|
.select
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
bit 6, a
|
bit 6, a
|
||||||
jp nz, CursorUp ; up
|
jp nz, CursorUp ; up
|
||||||
|
|
@ -2959,7 +2959,7 @@ PrintMenuItem: ; 3d4b6 (f:54b6)
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
call GetCurrentMove
|
call GetCurrentMove
|
||||||
hlCoord 2, 10
|
hlCoord 2, 10
|
||||||
predef Func_27d98
|
predef PrintMoveType
|
||||||
.moveDisabled
|
.moveDisabled
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [H_AUTOBGTRANSFERENABLED], a
|
ld [H_AUTOBGTRANSFERENABLED], a
|
||||||
|
|
@ -6814,7 +6814,7 @@ asm_3ef23: ; 3ef23 (f:6f23)
|
||||||
ld a, [wNumberOfNoRandomBattleStepsLeft]
|
ld a, [wNumberOfNoRandomBattleStepsLeft]
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
callab Func_13870
|
callab TryDoWildEncounter
|
||||||
ret nz
|
ret nz
|
||||||
asm_3ef3d: ; 3ef3d (f:6f3d)
|
asm_3ef3d: ; 3ef3d (f:6f3d)
|
||||||
ld a, [wMapPalOffset]
|
ld a, [wMapPalOffset]
|
||||||
|
|
@ -6823,7 +6823,7 @@ asm_3ef3d: ; 3ef3d (f:6f3d)
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
callab Func_525af
|
callab InitBattleVariables
|
||||||
ld a, [wEnemyMonSpecies2]
|
ld a, [wEnemyMonSpecies2]
|
||||||
sub $c8
|
sub $c8
|
||||||
jp c, InitWildBattle
|
jp c, InitWildBattle
|
||||||
|
|
@ -7637,7 +7637,7 @@ UpdateStatDone: ; 3f4ca (f:74ca)
|
||||||
call nz, Bankswitch ; play Minimize animation unless there's Substitute involved
|
call nz, Bankswitch ; play Minimize animation unless there's Substitute involved
|
||||||
pop de
|
pop de
|
||||||
.asm_3f4f9
|
.asm_3f4f9
|
||||||
call Func_3fba8
|
call PlayCurrentMoveAnimation
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp MINIMIZE
|
cp MINIMIZE
|
||||||
jr nz, .applyBadgeBoostsAndStatusPenalties
|
jr nz, .applyBadgeBoostsAndStatusPenalties
|
||||||
|
|
@ -8451,7 +8451,7 @@ MimicEffect: ; 3f9ed (f:79ed)
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
call GetMoveName
|
call GetMoveName
|
||||||
call Func_3fba8
|
call PlayCurrentMoveAnimation
|
||||||
ld hl, MimicLearnedMoveText
|
ld hl, MimicLearnedMoveText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.asm_3fa74
|
.asm_3fa74
|
||||||
|
|
@ -8467,7 +8467,7 @@ LeechSeedEffect: ; 3fa7c (f:7a7c)
|
||||||
jp Bankswitch
|
jp Bankswitch
|
||||||
|
|
||||||
SplashEffect: ; 3fa84 (f:7a84)
|
SplashEffect: ; 3fa84 (f:7a84)
|
||||||
call Func_3fba8
|
call PlayCurrentMoveAnimation
|
||||||
jp PrintNoEffectText
|
jp PrintNoEffectText
|
||||||
|
|
||||||
DisableEffect: ; 3fa8a (f:7a8a)
|
DisableEffect: ; 3fa8a (f:7a8a)
|
||||||
|
|
@ -8662,15 +8662,15 @@ Func_3fb96: ; 3fb96 (f:7b96)
|
||||||
ld [wcc5b], a
|
ld [wcc5b], a
|
||||||
jp Func_3fbbc
|
jp Func_3fbbc
|
||||||
|
|
||||||
Func_3fba8: ; 3fba8 (f:7ba8)
|
PlayCurrentMoveAnimation: ; 3fba8 (f:7ba8)
|
||||||
xor a
|
xor a
|
||||||
ld [wcc5b], a
|
ld [wcc5b], a
|
||||||
ld a, [H_WHOSETURN]
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld a, [W_PLAYERMOVENUM]
|
ld a, [W_PLAYERMOVENUM]
|
||||||
jr z, .asm_3fbb7
|
jr z, .notEnemyTurn
|
||||||
ld a, [W_ENEMYMOVENUM]
|
ld a, [W_ENEMYMOVENUM]
|
||||||
.asm_3fbb7
|
.notEnemyTurn
|
||||||
and a
|
and a
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
HealEffect_: ; 3b9ec (e:79ec)
|
HealEffect_: ; 3b9ec (e:79ec)
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
ld de, wBattleMonHP ; wd015
|
ld de, wBattleMonHP
|
||||||
ld hl, wBattleMonMaxHP ; wd023
|
ld hl, wBattleMonMaxHP
|
||||||
ld a, [W_PLAYERMOVENUM] ; wcfd2
|
ld a, [W_PLAYERMOVENUM]
|
||||||
jr z, .asm_3ba03
|
jr z, .asm_3ba03
|
||||||
ld de, wEnemyMonHP ; wEnemyMonHP
|
ld de, wEnemyMonHP
|
||||||
ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
|
ld hl, wEnemyMonMaxHP
|
||||||
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
|
ld a, [W_ENEMYMOVENUM]
|
||||||
.asm_3ba03
|
.asm_3ba03
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
|
@ -16,27 +16,27 @@ HealEffect_: ; 3b9ec (e:79ec)
|
||||||
inc hl
|
inc hl
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
sbc [hl]
|
sbc [hl]
|
||||||
jp z, Func_3ba97
|
jp z, .failed
|
||||||
ld a, b
|
ld a, b
|
||||||
cp REST
|
cp REST
|
||||||
jr nz, .asm_3ba37
|
jr nz, .asm_3ba37
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push af
|
push af
|
||||||
ld c, $32
|
ld c, 50
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, wBattleMonStatus ; wBattleMonStatus
|
ld hl, wBattleMonStatus
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3ba25
|
jr z, .asm_3ba25
|
||||||
ld hl, wEnemyMonStatus ; wcfe9
|
ld hl, wEnemyMonStatus
|
||||||
.asm_3ba25
|
.asm_3ba25
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and a
|
and a
|
||||||
ld [hl], 2 ; Number of turns from Rest
|
ld [hl], 2 ; Number of turns from Rest
|
||||||
ld hl, StartedSleepingEffect ; $7aa2
|
ld hl, StartedSleepingEffect
|
||||||
jr z, .asm_3ba31
|
jr z, .asm_3ba31
|
||||||
ld hl, FellAsleepBecameHealthyText ; $7aa7
|
ld hl, FellAsleepBecameHealthyText
|
||||||
.asm_3ba31
|
.asm_3ba31
|
||||||
call PrintText
|
call PrintText
|
||||||
pop af
|
pop af
|
||||||
|
|
@ -81,9 +81,9 @@ HealEffect_: ; 3b9ec (e:79ec)
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld [wHPBarNewHP], a
|
ld [wHPBarNewHP], a
|
||||||
.asm_3ba6f
|
.asm_3ba6f
|
||||||
ld hl, Func_3fba8 ; $7ba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call BankswitchEtoF
|
call BankswitchEtoF
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
hlCoord 10, 9
|
hlCoord 10, 9
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -91,15 +91,14 @@ HealEffect_: ; 3b9ec (e:79ec)
|
||||||
hlCoord 2, 2
|
hlCoord 2, 2
|
||||||
xor a
|
xor a
|
||||||
.asm_3ba83
|
.asm_3ba83
|
||||||
ld [wListMenuID], a ; wListMenuID
|
ld [wListMenuID], a
|
||||||
predef UpdateHPBar2
|
predef UpdateHPBar2
|
||||||
ld hl, DrawHUDsAndHPBars ; $4d5a
|
ld hl, DrawHUDsAndHPBars
|
||||||
call BankswitchEtoF
|
call BankswitchEtoF
|
||||||
ld hl, RegainedHealthText ; $7aac
|
ld hl, RegainedHealthText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
.failed
|
||||||
Func_3ba97: ; 3ba97 (e:7a97)
|
ld c, 50
|
||||||
ld c, $32
|
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintButItFailedText_
|
ld hl, PrintButItFailedText_
|
||||||
jp BankswitchEtoF
|
jp BankswitchEtoF
|
||||||
|
|
@ -119,37 +118,37 @@ RegainedHealthText: ; 3baac (e:7aac)
|
||||||
TransformEffect_: ; 3bab1 (e:7ab1)
|
TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
ld hl, wBattleMonSpecies
|
ld hl, wBattleMonSpecies
|
||||||
ld de, wEnemyMonSpecies
|
ld de, wEnemyMonSpecies
|
||||||
ld bc, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
|
ld bc, W_ENEMYBATTSTATUS3
|
||||||
ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1
|
ld a, [W_ENEMYBATTSTATUS1]
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_3bad1
|
jr nz, .asm_3bad1
|
||||||
ld hl, wEnemyMonSpecies
|
ld hl, wEnemyMonSpecies
|
||||||
ld de, wBattleMonSpecies
|
ld de, wBattleMonSpecies
|
||||||
ld bc, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
|
ld bc, W_PLAYERBATTSTATUS3
|
||||||
ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex
|
ld [wPlayerMoveListIndex], a
|
||||||
ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1
|
ld a, [W_PLAYERBATTSTATUS1]
|
||||||
.asm_3bad1
|
.asm_3bad1
|
||||||
bit Invulnerable, a ; is mon invulnerable to typical attacks? (fly/dig)
|
bit Invulnerable, a ; is mon invulnerable to typical attacks? (fly/dig)
|
||||||
jp nz, Func_3bb8c
|
jp nz, .failed
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
push bc
|
push bc
|
||||||
ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
|
ld hl, W_PLAYERBATTSTATUS2
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bae4
|
jr z, .asm_3bae4
|
||||||
ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
|
ld hl, W_ENEMYBATTSTATUS2
|
||||||
.asm_3bae4
|
.asm_3bae4
|
||||||
bit HasSubstituteUp, [hl]
|
bit HasSubstituteUp, [hl]
|
||||||
push af
|
push af
|
||||||
ld hl, Func_79747
|
ld hl, Func_79747
|
||||||
ld b, BANK(Func_79747)
|
ld b, BANK(Func_79747)
|
||||||
call nz, Bankswitch
|
call nz, Bankswitch
|
||||||
ld a, [W_OPTIONS] ; W_OPTIONS
|
ld a, [W_OPTIONS]
|
||||||
add a
|
add a
|
||||||
ld hl, Func_3fba8 ; $7ba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
ld b, BANK(Func_3fba8)
|
ld b, BANK(PlayCurrentMoveAnimation)
|
||||||
jr nc, .asm_3baff
|
jr nc, .asm_3baff
|
||||||
ld hl, AnimationTransformMon
|
ld hl, AnimationTransformMon
|
||||||
ld b, BANK(AnimationTransformMon)
|
ld b, BANK(AnimationTransformMon)
|
||||||
|
|
@ -178,7 +177,7 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
inc bc
|
inc bc
|
||||||
inc bc
|
inc bc
|
||||||
call CopyData
|
call CopyData
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bb32
|
jr z, .asm_3bb32
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
|
@ -228,15 +227,15 @@ TransformEffect_: ; 3bab1 (e:7ab1)
|
||||||
call GetMonName
|
call GetMonName
|
||||||
ld hl, wEnemyMonUnmodifiedAttack
|
ld hl, wEnemyMonUnmodifiedAttack
|
||||||
ld de, wPlayerMonUnmodifiedAttack
|
ld de, wPlayerMonUnmodifiedAttack
|
||||||
call Func_3bb7d
|
call .copyBasedOnTurn
|
||||||
ld hl, wEnemyMonStatMods ; wcd2e
|
ld hl, wEnemyMonStatMods
|
||||||
ld de, wPlayerMonStatMods ; wcd1a
|
ld de, wPlayerMonStatMods
|
||||||
call Func_3bb7d
|
call .copyBasedOnTurn
|
||||||
ld hl, TransformedText ; $7b92
|
ld hl, TransformedText
|
||||||
jp PrintText
|
jp PrintText
|
||||||
|
|
||||||
Func_3bb7d: ; 3bb7d (e:7b7d)
|
.copyBasedOnTurn
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bb86
|
jr z, .asm_3bb86
|
||||||
push hl
|
push hl
|
||||||
|
|
@ -247,8 +246,8 @@ Func_3bb7d: ; 3bb7d (e:7b7d)
|
||||||
ld bc, $8
|
ld bc, $8
|
||||||
jp CopyData
|
jp CopyData
|
||||||
|
|
||||||
Func_3bb8c: ; 3bb8c (e:7b8c)
|
.failed
|
||||||
ld hl, PrintButItFailedText_ ; $7b53
|
ld hl, PrintButItFailedText_
|
||||||
jp BankswitchEtoF
|
jp BankswitchEtoF
|
||||||
|
|
||||||
TransformedText: ; 3bb92 (e:7b92)
|
TransformedText: ; 3bb92 (e:7b92)
|
||||||
|
|
@ -256,13 +255,13 @@ TransformedText: ; 3bb92 (e:7b92)
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
ReflectLightScreenEffect_: ; 3bb97 (e:7b97)
|
ReflectLightScreenEffect_: ; 3bb97 (e:7b97)
|
||||||
ld hl, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
|
ld hl, W_PLAYERBATTSTATUS3
|
||||||
ld de, W_PLAYERMOVEEFFECT ; wcfd3
|
ld de, W_PLAYERMOVEEFFECT
|
||||||
ld a, [H_WHOSETURN] ; $fff3
|
ld a, [H_WHOSETURN]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3bba8
|
jr z, .asm_3bba8
|
||||||
ld hl, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
|
ld hl, W_ENEMYBATTSTATUS3
|
||||||
ld de, W_ENEMYMOVEEFFECT ; W_ENEMYMOVEEFFECT
|
ld de, W_ENEMYMOVEEFFECT
|
||||||
.asm_3bba8
|
.asm_3bba8
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
cp LIGHT_SCREEN_EFFECT
|
cp LIGHT_SCREEN_EFFECT
|
||||||
|
|
@ -270,23 +269,23 @@ ReflectLightScreenEffect_: ; 3bb97 (e:7b97)
|
||||||
bit HasLightScreenUp, [hl] ; is mon already protected by light screen?
|
bit HasLightScreenUp, [hl] ; is mon already protected by light screen?
|
||||||
jr nz, .moveFailed
|
jr nz, .moveFailed
|
||||||
set HasLightScreenUp, [hl] ; mon is now protected by light screen
|
set HasLightScreenUp, [hl] ; mon is now protected by light screen
|
||||||
ld hl, LightScreenProtectedText ; $7bd7
|
ld hl, LightScreenProtectedText
|
||||||
jr .asm_3bbc1
|
jr .asm_3bbc1
|
||||||
.reflect
|
.reflect
|
||||||
bit HasReflectUp, [hl] ; is mon already protected by reflect?
|
bit HasReflectUp, [hl] ; is mon already protected by reflect?
|
||||||
jr nz, .moveFailed
|
jr nz, .moveFailed
|
||||||
set HasReflectUp, [hl] ; mon is now protected by reflect
|
set HasReflectUp, [hl] ; mon is now protected by reflect
|
||||||
ld hl, ReflectGainedArmorText ; $7bdc
|
ld hl, ReflectGainedArmorText
|
||||||
.asm_3bbc1
|
.asm_3bbc1
|
||||||
push hl
|
push hl
|
||||||
ld hl, Func_3fba8 ; $7ba8
|
ld hl, PlayCurrentMoveAnimation
|
||||||
call BankswitchEtoF
|
call BankswitchEtoF
|
||||||
pop hl
|
pop hl
|
||||||
jp PrintText
|
jp PrintText
|
||||||
.moveFailed
|
.moveFailed
|
||||||
ld c, $32
|
ld c, $32
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld hl, PrintButItFailedText_ ; $7b53
|
ld hl, PrintButItFailedText_
|
||||||
jp BankswitchEtoF
|
jp BankswitchEtoF
|
||||||
|
|
||||||
LightScreenProtectedText: ; 3bbd7 (e:7bd7)
|
LightScreenProtectedText: ; 3bbd7 (e:7bd7)
|
||||||
|
|
|
||||||
|
|
@ -338,10 +338,10 @@ TradeCenter_SelectMon:
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ld [wTopMenuItemX], a
|
ld [wTopMenuItemX], a
|
||||||
.enemyMonMenu_HandleInput
|
.enemyMonMenu_HandleInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
and a
|
and a
|
||||||
jp z, .getNewInput
|
jp z, .getNewInput
|
||||||
|
|
@ -403,10 +403,10 @@ TradeCenter_SelectMon:
|
||||||
ld bc, $0601
|
ld bc, $0601
|
||||||
call ClearScreenArea
|
call ClearScreenArea
|
||||||
.playerMonMenu_HandleInput
|
.playerMonMenu_HandleInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
and a ; was anything pressed?
|
and a ; was anything pressed?
|
||||||
jr nz, .playerMonMenu_SomethingPressed
|
jr nz, .playerMonMenu_SomethingPressed
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ Func_702f0: ; 702f0 (1c:42f0)
|
||||||
ld a, [wWhichTrade] ; wWhichTrade
|
ld a, [wWhichTrade] ; wWhichTrade
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
hlCoord 3, 9
|
hlCoord 3, 9
|
||||||
predef Func_27d6b
|
predef PrintMonType
|
||||||
ld a, [wWhichTrade] ; wWhichTrade
|
ld a, [wWhichTrade] ; wWhichTrade
|
||||||
jp PlayCry
|
jp PlayCry
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ UpdateHPBar_PrintHPNumber: ; faf5 (3:7af5)
|
||||||
ld a, [wHPBarOldHP+1]
|
ld a, [wHPBarOldHP+1]
|
||||||
ld [wcef0], a
|
ld [wcef0], a
|
||||||
push hl
|
push hl
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jr z, .asm_fb15
|
jr z, .asm_fb15
|
||||||
ld de, $9
|
ld de, $9
|
||||||
|
|
|
||||||
|
|
@ -919,15 +919,15 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled
|
call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled
|
||||||
ld a,(SFX_02_3d - SFX_Headers_02) / 3
|
ld a,(SFX_02_3d - SFX_Headers_02) / 3
|
||||||
call PlaySoundWaitForCurrent ; play sound
|
call PlaySoundWaitForCurrent ; play sound
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
set 0,a
|
set 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
ld a,$02
|
ld a,$02
|
||||||
ld [wListMenuID],a
|
ld [wListMenuID],a
|
||||||
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
|
predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
res 0,a
|
res 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
pop af
|
pop af
|
||||||
ld b,a ; store heal amount (1/5 of max HP)
|
ld b,a ; store heal amount (1/5 of max HP)
|
||||||
ld hl,wHPBarOldHP + 1
|
ld hl,wHPBarOldHP + 1
|
||||||
|
|
@ -1069,15 +1069,15 @@ ItemUseMedicine: ; dabb (3:5abb)
|
||||||
jr z,.playStatusAilmentCuringSound
|
jr z,.playStatusAilmentCuringSound
|
||||||
ld a,(SFX_02_3d - SFX_Headers_02) / 3 ; HP healing sound
|
ld a,(SFX_02_3d - SFX_Headers_02) / 3 ; HP healing sound
|
||||||
call PlaySoundWaitForCurrent ; play sound
|
call PlaySoundWaitForCurrent ; play sound
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
set 0,a
|
set 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
ld a,$02
|
ld a,$02
|
||||||
ld [wListMenuID],a
|
ld [wListMenuID],a
|
||||||
predef UpdateHPBar2 ; animate the HP bar lengthening
|
predef UpdateHPBar2 ; animate the HP bar lengthening
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
res 0,a
|
res 0,a
|
||||||
ld [$fff6],a
|
ld [hFlags_0xFFF6],a
|
||||||
ld a,$f7 ; revived message
|
ld a,$f7 ; revived message
|
||||||
ld [wd07d],a
|
ld [wd07d],a
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
|
|
|
||||||
|
|
@ -126,13 +126,13 @@ TryingToLearn: ; 6f07 (1:6f07)
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
hlCoord 6, 8
|
hlCoord 6, 8
|
||||||
ld de, wd0e1
|
ld de, wd0e1
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
set 2, a
|
set 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld a, [$fff6]
|
ld a, [hFlags_0xFFF6]
|
||||||
res 2, a
|
res 2, a
|
||||||
ld [$fff6], a
|
ld [hFlags_0xFFF6], a
|
||||||
ld hl, wTopMenuItemY
|
ld hl, wTopMenuItemY
|
||||||
ld a, $8
|
ld a, $8
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
|
|
@ -146,10 +146,10 @@ TryingToLearn: ; 6f07 (1:6f07)
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
ld [hl], $0
|
ld [hl], $0
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
push af
|
push af
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
|
|
|
||||||
|
|
@ -88,14 +88,14 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
|
||||||
pop hl
|
pop hl
|
||||||
push hl
|
push hl
|
||||||
ld bc,20 + 1 ; down 1 row and right 1 column
|
ld bc,20 + 1 ; down 1 row and right 1 column
|
||||||
ld a,[$FFF6]
|
ld a,[hFlags_0xFFF6]
|
||||||
set 0,a
|
set 0,a
|
||||||
ld [$FFF6],a
|
ld [hFlags_0xFFF6],a
|
||||||
add hl,bc
|
add hl,bc
|
||||||
predef Func_128f6 ; draw HP bar and prints current / max HP
|
predef Func_128f6 ; draw HP bar and prints current / max HP
|
||||||
ld a,[$FFF6]
|
ld a,[hFlags_0xFFF6]
|
||||||
res 0,a
|
res 0,a
|
||||||
ld [$FFF6],a
|
ld [hFlags_0xFFF6],a
|
||||||
call SetPartyMenuHealthBarColor ; color the HP bar (on SGB)
|
call SetPartyMenuHealthBarColor ; color the HP bar (on SGB)
|
||||||
pop hl
|
pop hl
|
||||||
jr .printLevel
|
jr .printLevel
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ StatusScreen: ; 12953 (4:6953)
|
||||||
ld bc, $8103 ; Zero-padded, 3
|
ld bc, $8103 ; Zero-padded, 3
|
||||||
call PrintNumber ; Pokémon no.
|
call PrintNumber ; Pokémon no.
|
||||||
hlCoord 11, 10
|
hlCoord 11, 10
|
||||||
predef Func_27d6b ; Prints the type (?)
|
predef PrintMonType
|
||||||
ld hl, NamePointers2 ; $6a9d
|
ld hl, NamePointers2 ; $6a9d
|
||||||
call .unk_12a7e
|
call .unk_12a7e
|
||||||
ld d, h
|
ld d, h
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ AnimateHealingMachine: ; 70433 (1c:4433)
|
||||||
ld [wc0ee], a
|
ld [wc0ee], a
|
||||||
call PlaySound
|
call PlaySound
|
||||||
ld d, $28
|
ld d, $28
|
||||||
call Func_704f3
|
call FlashSprite8Times
|
||||||
.asm_704a2
|
.asm_704a2
|
||||||
ld a, [wc026]
|
ld a, [wc026]
|
||||||
cp MUSIC_PKMN_HEALED
|
cp MUSIC_PKMN_HEALED
|
||||||
|
|
@ -74,16 +74,17 @@ PokeCenterOAMData: ; 704d7 (1c:44d7)
|
||||||
db $35,$30,$7D,$10
|
db $35,$30,$7D,$10
|
||||||
db $35,$38,$7D,$30
|
db $35,$38,$7D,$30
|
||||||
|
|
||||||
Func_704f3: ; 704f3 (1c:44f3)
|
; d = value to xor with palette
|
||||||
ld b, $8
|
FlashSprite8Times: ; 704f3 (1c:44f3)
|
||||||
.asm_704f5
|
ld b, 8
|
||||||
ld a, [rOBP1] ; $ff49
|
.loop
|
||||||
|
ld a, [rOBP1]
|
||||||
xor d
|
xor d
|
||||||
ld [rOBP1], a ; $ff49
|
ld [rOBP1], a
|
||||||
ld c, $a
|
ld c, 10
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_704f5
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_70503: ; 70503 (1c:4503)
|
Func_70503: ; 70503 (1c:4503)
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef UpdateHPBar2
|
add_predef UpdateHPBar2
|
||||||
add_predef DrawEnemyHUDAndHPBar
|
add_predef DrawEnemyHUDAndHPBar
|
||||||
add_predef LoadTownMap_Nest
|
add_predef LoadTownMap_Nest
|
||||||
add_predef Func_27d6b
|
add_predef PrintMonType
|
||||||
add_predef EmotionBubble; 4C player exclamation
|
add_predef EmotionBubble; 4C player exclamation
|
||||||
add_predef EmptyFunc3; return immediately
|
add_predef EmptyFunc3; return immediately
|
||||||
add_predef AskName
|
add_predef AskName
|
||||||
|
|
@ -145,7 +145,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
|
||||||
add_predef CheckForCollisionWhenPushingBoulder
|
add_predef CheckForCollisionWhenPushingBoulder
|
||||||
add_predef PrintStrengthTxt
|
add_predef PrintStrengthTxt
|
||||||
add_predef PickupItem
|
add_predef PickupItem
|
||||||
add_predef Func_27d98
|
add_predef PrintMoveType
|
||||||
add_predef LoadMovePPs
|
add_predef LoadMovePPs
|
||||||
add_predef DrawHP ; 5F
|
add_predef DrawHP ; 5F
|
||||||
add_predef Func_128f6
|
add_predef Func_128f6
|
||||||
|
|
|
||||||
|
|
@ -346,10 +346,10 @@ ChangeBox:: ; 738a1 (1c:78a1)
|
||||||
call z, Func_73a29
|
call z, Func_73a29
|
||||||
call Func_7393f
|
call Func_7393f
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 1, [hl]
|
set 1, [hl]
|
||||||
call HandleMenuInput
|
call HandleMenuInput
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 1, [hl]
|
res 1, [hl]
|
||||||
bit 1, a
|
bit 1, a
|
||||||
ret nz
|
ret nz
|
||||||
|
|
@ -436,12 +436,12 @@ Func_7393f: ; 7393f (1c:793f)
|
||||||
ld b, $c
|
ld b, $c
|
||||||
ld c, $7
|
ld c, $7
|
||||||
call TextBoxBorder
|
call TextBoxBorder
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
set 2, [hl]
|
set 2, [hl]
|
||||||
ld de, BoxNames ; $79d9
|
ld de, BoxNames ; $79d9
|
||||||
hlCoord 13, 1
|
hlCoord 13, 1
|
||||||
call PlaceString
|
call PlaceString
|
||||||
ld hl, $fff6
|
ld hl, hFlags_0xFFF6
|
||||||
res 2, [hl]
|
res 2, [hl]
|
||||||
ld a, [wd5a0]
|
ld a, [wd5a0]
|
||||||
and $7f
|
and $7f
|
||||||
|
|
|
||||||
4
home.asm
4
home.asm
|
|
@ -4046,7 +4046,7 @@ PlaceMenuCursor:: ; 3b7c (0:3b7c)
|
||||||
and a ; was the previous menu id 0?
|
and a ; was the previous menu id 0?
|
||||||
jr z,.checkForArrow1
|
jr z,.checkForArrow1
|
||||||
push af
|
push af
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
bit 1,a ; is the menu double spaced?
|
bit 1,a ; is the menu double spaced?
|
||||||
jr z,.doubleSpaced1
|
jr z,.doubleSpaced1
|
||||||
ld bc,20
|
ld bc,20
|
||||||
|
|
@ -4072,7 +4072,7 @@ PlaceMenuCursor:: ; 3b7c (0:3b7c)
|
||||||
and a
|
and a
|
||||||
jr z,.checkForArrow2
|
jr z,.checkForArrow2
|
||||||
push af
|
push af
|
||||||
ld a,[$fff6]
|
ld a,[hFlags_0xFFF6]
|
||||||
bit 1,a ; is the menu double spaced?
|
bit 1,a ; is the menu double spaced?
|
||||||
jr z,.doubleSpaced2
|
jr z,.doubleSpaced2
|
||||||
ld bc,20
|
ld bc,20
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ PlaceNextChar:: ; 1956 (0:1956)
|
||||||
cp $4E
|
cp $4E
|
||||||
jr nz,.next
|
jr nz,.next
|
||||||
ld bc,$0028
|
ld bc,$0028
|
||||||
ld a,[$FFF6]
|
ld a,[hFlags_0xFFF6]
|
||||||
bit 2,a
|
bit 2,a
|
||||||
jr z,.next2
|
jr z,.next2
|
||||||
ld bc,$14
|
ld bc,$14
|
||||||
|
|
|
||||||
3
hram.asm
3
hram.asm
|
|
@ -151,5 +151,8 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
|
||||||
|
|
||||||
H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn
|
H_WHOSETURN EQU $FFF3 ; 0 on player’s turn, 1 on enemy’s turn
|
||||||
|
|
||||||
|
; bit 0: draw HP fraction to the right of bar instead of below (for party menu)
|
||||||
|
hFlags_0xFFF6 EQU $FFF6
|
||||||
|
|
||||||
hJoyInput EQU $FFF8
|
hJoyInput EQU $FFF8
|
||||||
|
|
||||||
|
|
|
||||||
2
main.asm
2
main.asm
|
|
@ -126,7 +126,7 @@ LoadMonData_:
|
||||||
|
|
||||||
.copyMonData
|
.copyMonData
|
||||||
ld de, wcf98
|
ld de, wcf98
|
||||||
ld bc, 44
|
ld bc, wPartyMon2 - wPartyMon1
|
||||||
jp CopyData
|
jp CopyData
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
1
wram.asm
1
wram.asm
|
|
@ -824,6 +824,7 @@ wcfbc:: ds 2
|
||||||
wcfbe:: ds 2
|
wcfbe:: ds 2
|
||||||
wcfc0:: ds 2
|
wcfc0:: ds 2
|
||||||
wcfc2:: ds 2
|
wcfc2:: ds 2
|
||||||
|
|
||||||
wcfc4:: ds 1
|
wcfc4:: ds 1
|
||||||
|
|
||||||
wWalkCounter:: ; cfc5
|
wWalkCounter:: ; cfc5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue