Use monster struct macros in wram. Rename related labels for consistency.

This commit is contained in:
yenatch 2014-06-14 04:12:40 -07:00
parent 9eefed45f7
commit 53ae0e93fa
53 changed files with 860 additions and 1018 deletions

View file

@ -11,13 +11,13 @@ DrainHPEffect_: ; 783f (1:783f)
inc hl
inc [hl]
.asm_784f
ld hl, W_PLAYERMONCURHP ; wd015
ld de, W_PLAYERMONMAXHP ; wd023
ld hl, wBattleMonHP ; wd015
ld de, wBattleMonMaxHP ; wd023
ld a, [H_WHOSETURN] ; $fff3
and a
jp z, Func_7861
ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
ld de, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
ld hl, wEnemyMonHP ; wEnemyMonHP
ld de, wEnemyMonMaxHP ; wEnemyMonMaxHP
Func_7861: ; 7861 (1:7861)
ld bc, wHPBarOldHP+1

View file

@ -11,8 +11,8 @@ Func_525af: ; 525af (14:65af)
ld [hl], a
ld [wListScrollOffset], a ; wcc36
ld [wd05e], a
ld [W_PLAYERMONID], a
ld [W_PLAYERMONSALIVEFLAGS], a
ld [wBattleMonSpecies], a
ld [wPartyAliveFlags], a
ld [wPlayerMonNumber], a ; wPlayerMonNumber
ld [wd078], a
ld [wd35d], a
@ -40,12 +40,12 @@ Func_525af: ; 525af (14:65af)
jp Bankswitch
ParalyzeEffect_: ; 52601 (14:6601)
ld hl, W_ENEMYMONSTATUS ; wcfe9
ld hl, wEnemyMonStatus ; wcfe9
ld de, W_PLAYERMOVETYPE ; wcfd5
ld a, [H_WHOSETURN] ; $fff3
and a
jp z, .asm_52613
ld hl, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS
ld hl, wBattleMonStatus ; wBattleMonStatus
ld de, W_ENEMYMOVETYPE ; wcfcf
.asm_52613

View file

@ -1,11 +1,11 @@
GainExperience: ; 5524f (15:524f)
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
ld a, [W_ISLINKBATTLE]
cp $4
ret z
call Func_5546c
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
ld hl, wPartyMons
xor a
ld [wWhichPokemon], a ; wWhichPokemon
ld [wWhichPokemon], a
Func_5525f: ; 5525f (15:525f)
inc hl
@ -13,8 +13,8 @@ Func_5525f: ; 5525f (15:525f)
or [hl]
jp z, Func_55436
push hl
ld hl, W_PLAYERMONSALIVEFLAGS
ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, wPartyAliveFlags
ld a, [wWhichPokemon]
ld c, a
ld b, $2
ld a, $10 ; FlagActionPredef
@ -56,26 +56,26 @@ Func_5525f: ; 5525f (15:525f)
jr .asm_55285
.asm_552a1
xor a
ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
ld [$ff97], a
ld [H_MULTIPLICAND], a
ld [H_MULTIPLICAND + 1], a
ld a, [wd008]
ld [$ff98], a
ld a, [W_ENEMYMONLEVEL] ; W_ENEMYMONLEVEL
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
ld [H_MULTIPLICAND + 2], a
ld a, [wEnemyMonLevel]
ld [H_MULTIPLIER], a
call Multiply
ld a, $7
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
ld b, $4
ld a, 7
ld [H_DIVISOR], a
ld b, 4
call Divide
ld hl, $fff2
add hl, de
ld b, [hl]
inc hl
ld a, [wPlayerID] ; wPlayerID
ld a, [wPlayerID]
cp b
jr nz, .asm_552d1
ld b, [hl]
ld a, [wPlayerID + 1] ; wd35a
ld a, [wPlayerID + 1]
cp b
ld a, $0
jr z, .asm_552d6
@ -84,7 +84,7 @@ Func_5525f: ; 5525f (15:525f)
ld a, $1
.asm_552d6
ld [wcf4d], a
ld a, [W_ISINBATTLE] ; W_ISINBATTLE
ld a, [W_ISINBATTLE]
dec a
call nz, Func_5549f
inc hl
@ -107,17 +107,17 @@ Func_5525f: ; 5525f (15:525f)
.asm_552f8
inc hl
push hl
ld a, [wWhichPokemon] ; wWhichPokemon
ld a, [wWhichPokemon]
ld c, a
ld b, $0
ld hl, W_PARTYMON1 ; W_PARTYMON1
ld b, 0
ld hl, wPartySpecies
add hl, bc
ld a, [hl]
ld [wd0b5], a
call GetMonHeader
ld d, MAX_LEVEL
callab CalcExperience
ld a, [H_NUMTOPRINT] ; $ff96 (aliases: H_MULTIPLICAND)
ld a, [$ff96]
ld b, a
ld a, [$ff97]
ld c, a
@ -140,8 +140,8 @@ Func_5525f: ; 5525f (15:525f)
dec hl
.asm_5532e
push hl
ld a, [wWhichPokemon] ; wWhichPokemon
ld hl, W_PARTYMON1NAME ; W_PARTYMON1NAME
ld a, [wWhichPokemon]
ld hl, wPartyMonNicks
call GetPartyMonName
ld hl, GainedText
call PrintText
@ -157,11 +157,11 @@ Func_5525f: ; 5525f (15:525f)
ld a, [hl]
cp d
jp z, Func_55436
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
ld a, [W_CURENEMYLVL]
push af
push hl
ld a, d
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
ld [W_CURENEMYLVL], a
ld [hl], a
ld bc, $ffdf
add hl, bc
@ -198,12 +198,12 @@ Func_5525f: ; 5525f (15:525f)
ld a, [hl]
adc b
ld [hl], a
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
ld a, [wPlayerMonNumber]
ld b, a
ld a, [wWhichPokemon] ; wWhichPokemon
ld a, [wWhichPokemon]
cp b
jr nz, .asm_553f7
ld de, W_PLAYERMONCURHP ; wd015
ld de, wBattleMonHP
ld a, [hli]
ld [de], a
inc de
@ -212,7 +212,7 @@ Func_5525f: ; 5525f (15:525f)
ld bc, $1f
add hl, bc
push hl
ld de, W_PLAYERMONLEVEL ; W_PLAYERMONLEVEL
ld de, wBattleMonLevel ; wBattleMonLevel
ld bc, $b
call CopyData
pop hl
@ -258,7 +258,7 @@ Func_5525f: ; 5525f (15:525f)
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
Func_55436: ; 55436 (15:5436)
ld a, [W_NUMINPARTY] ; W_NUMINPARTY
ld a, [wPartyCount] ; wPartyCount
ld b, a
ld a, [wWhichPokemon] ; wWhichPokemon
inc a
@ -266,11 +266,11 @@ Func_55436: ; 55436 (15:5436)
jr z, .asm_55450
ld [wWhichPokemon], a ; wWhichPokemon
ld bc, $2c
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
call AddNTimes
jp Func_5525f
.asm_55450
ld hl, W_PLAYERMONSALIVEFLAGS
ld hl, wPartyAliveFlags
xor a
ld [hl], a
ld a, [wPlayerMonNumber] ; wPlayerMonNumber
@ -287,7 +287,7 @@ Func_55436: ; 55436 (15:5436)
jp Predef
Func_5546c: ; 5546c (15:546c)
ld a, [W_PLAYERMONSALIVEFLAGS]
ld a, [wPartyAliveFlags]
ld b, a
xor a
ld c, $8

View file

@ -8,7 +8,7 @@ PrintBeginningBattleText: ; 58d99 (16:4d99)
cp LAVENDER_HOUSE_1
jr c, .pokemonTower
.notPokemonTower
ld a, [W_ENEMYMONID]
ld a, [wEnemyMonSpecies2]
call PlayCry
ld hl, WildMonAppearedText
ld a, [W_MOVEMISSED] ; W_MOVEMISSED
@ -31,7 +31,7 @@ PrintBeginningBattleText: ; 58d99 (16:4d99)
.pokemonTower
ld b, SILPH_SCOPE
call IsItemInBag
ld a, [W_ENEMYMONID]
ld a, [wEnemyMonSpecies2]
ld [wcf91], a
cp MAROWAK
jr z, .isMarowak
@ -95,14 +95,14 @@ GhostCantBeIDdText: ; 58e54 (16:4e54)
db "@"
SendOutMon: ; 58e59 (16:4e59)
ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
or [hl]
ld hl, GoText
jr z, .printText
xor a
ld [H_NUMTOPRINT], a ; $ff96 (aliases: H_MULTIPLICAND)
ld hl, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
ld hl, wEnemyMonHP ; wEnemyMonHP
ld a, [hli]
ld [wcce3], a
ld [$ff97], a
@ -112,7 +112,7 @@ SendOutMon: ; 58e59 (16:4e59)
ld a, $19
ld [H_REMAINDER], a ; $ff99 (aliases: H_DIVISOR, H_MULTIPLIER, H_POWEROFTEN)
call Multiply
ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [hli]
ld b, [hl]
srl a
@ -173,7 +173,7 @@ PlayerMon2Text: ; 58ed7 (16:4ed7)
db $08 ; asm
push de
push bc
ld hl, W_ENEMYMONCURHP + 1
ld hl, wEnemyMonHP + 1
ld de, wcce4
ld b, [hl]
dec hl
@ -188,7 +188,7 @@ PlayerMon2Text: ; 58ed7 (16:4ed7)
ld a, $19
ld [H_POWEROFTEN], a
call Multiply
ld hl, W_ENEMYMONMAXHP
ld hl, wEnemyMonMaxHP
ld a, [hli]
ld b, [hl]
srl a

View file

@ -11,7 +11,7 @@ DecrementPP: ; 68000 (1a:4000)
ret nz ; if any of these statuses are true, don't decrement PP
bit 6, [hl] ; check 6th bit status flag on W_PLAYERBATTSTATUS2
ret nz ; and return if it is set
ld hl, W_PLAYERMONPP ; PP of first move (in battle)
ld hl, wBattleMonPP ; PP of first move (in battle)
call .DecrementPP
ld a, [W_PLAYERBATTSTATUS3] ; load pokemon status bits?
@ -26,7 +26,7 @@ DecrementPP: ; 68000 (1a:4000)
; its opponent, which is *not* the same as its real PP as part of your
; party. So we return, and don't do that part.
ld hl, W_PARTYMON1_MOVE1PP ; PP of first move (in party)
ld hl, wPartyMon1PP ; PP of first move (in party)
ld a, [wPlayerMonNumber] ; which mon in party is active
ld bc, $2C ; XXX probably size of party pokemon's data structure
call AddNTimes ; calculate address of the mon to modify

View file

@ -170,16 +170,16 @@ GetBattleTransitionID_WildOrTrainer: ; 709e2 (1c:49e2)
ret
GetBattleTransitionID_CompareLevels: ; 709ef (1c:49ef)
ld hl, W_PARTYMON1_HP
ld hl, wPartyMon1HP
.faintedLoop
ld a, [hli]
or [hl]
jr nz, .notFainted
ld de, W_PARTYMON2DATA - (W_PARTYMON1DATA + 1)
ld de, wPartyMon2 - (wPartyMon1 + 1)
add hl, de
jr .faintedLoop
.notFainted
ld de, W_PARTYMON1_LEVEL - (W_PARTYMON1_HP + 1)
ld de, wPartyMon1Level - (wPartyMon1HP + 1)
add hl, de
ld a, [hl]
add $3

View file

@ -2,11 +2,11 @@ Func_137aa: ; 137aa (4:77aa)
ld a, [W_ISLINKBATTLE] ; W_ISLINKBATTLE
cp $4
jr nz, .asm_137eb
ld a, [W_ENEMYMONNUMBER] ; W_ENEMYMONNUMBER
ld hl, wd8a8
ld bc, $2c
ld a, [wEnemyMonPartyPos]
ld hl, wEnemyMon1Status
ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
ld a, [W_ENEMYMONSTATUS] ; wcfe9
ld a, [wEnemyMonStatus] ; wcfe9
ld [hl], a
call ClearScreen
callab Func_372d6
@ -151,7 +151,7 @@ Func_13870: ; 13870 (4:7870)
ld a, [Coord]
cp $14
jr nz, .asm_138e5
ld hl, W_WATERMONS ; wd8a5 (aliases: W_ENEMYMON1HP)
ld hl, W_WATERMONS ; wd8a5 (aliases: wEnemyMon1HP)
.asm_138e5
ld b, $0
add hl, bc
@ -159,11 +159,11 @@ Func_13870: ; 13870 (4:7870)
ld [W_CURENEMYLVL], a ; W_CURENEMYLVL
ld a, [hl]
ld [wcf91], a
ld [W_ENEMYMONID], a
ld [wEnemyMonSpecies2], a
ld a, [wd0db]
and a
jr z, .asm_13916
ld a, [W_PARTYMON1_LEVEL] ; W_PARTYMON1_LEVEL
ld a, [wPartyMon1Level] ; wPartyMon1Level
ld b, a
ld a, [W_CURENEMYLVL] ; W_CURENEMYLVL
cp b
@ -203,10 +203,10 @@ RecoilEffect_: ; 1392c (4:792c)
ld a, [H_WHOSETURN] ; $fff3
and a
ld a, [W_PLAYERMOVENUM] ; wcfd2
ld hl, W_PLAYERMONMAXHP ; wd023
ld hl, wBattleMonMaxHP ; wd023
jr z, .asm_1393d
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
.asm_1393d
ld d, a
ld a, [W_DAMAGE] ; W_DAMAGE
@ -272,8 +272,8 @@ HitWithRecoilText: ; 1399e (4:799e)
db "@"
ConversionEffect_: ; 139a3 (4:79a3)
ld hl, W_ENEMYMONTYPE1
ld de, W_PLAYERMONTYPE1
ld hl, wEnemyMonType1
ld de, wBattleMonType1
ld a, [H_WHOSETURN]
and a
ld a, [W_ENEMYBATTSTATUS1]
@ -313,17 +313,17 @@ HazeEffect_: ; 139da (4:79da)
ld hl, wEnemyMonAttackMod
call Func_13a43
ld hl, wcd12
ld de, W_PLAYERMONATK
ld de, wBattleMonAttack
call Func_13a4a
ld hl, wcd26
ld de, W_ENEMYMONATTACK
ld de, wEnemyMonAttack
call Func_13a4a
ld hl, W_ENEMYMONSTATUS
ld hl, wEnemyMonStatus
ld de, wEnemySelectedMove
ld a, [H_WHOSETURN]
and a
jr z, .asm_13a09
ld hl, W_PLAYERMONSTATUS
ld hl, wBattleMonStatus
dec de
.asm_13a09

View file

@ -1,13 +1,13 @@
SubstituteEffectHandler: ; 17dad (5:7dad)
ld c, 50
call DelayFrames
ld hl, W_PLAYERMONMAXHP
ld hl, wBattleMonMaxHP
ld de, wPlayerSubstituteHP
ld bc, W_PLAYERBATTSTATUS2
ld a, [$fff3] ;whose turn?
and a
jr z, .notEnemy
ld hl, W_ENEMYMONMAXHP
ld hl, wEnemyMonMaxHP
ld de, wEnemySubstituteHP
ld bc, W_ENEMYBATTSTATUS2
.notEnemy

View file

@ -4,12 +4,12 @@ LeechSeedEffect_: ; 2bea9 (a:7ea9)
and a
jr nz, .asm_2bee7
ld hl, W_ENEMYBATTSTATUS2 ; W_ENEMYBATTSTATUS2
ld de, W_ENEMYMONTYPE1 ; wcfea (aliases: W_ENEMYMONTYPES)
ld de, wEnemyMonType1 ; wcfea (aliases: wEnemyMonType)
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_2bec8
ld hl, W_PLAYERBATTSTATUS2 ; W_PLAYERBATTSTATUS2
ld de, W_PLAYERMONTYPE1 ; wd019 (aliases: W_PLAYERMONTYPES)
ld de, wBattleMonType1 ; wd019 (aliases: wBattleMonType)
.asm_2bec8
ld a, [de]
cp GRASS

View file

@ -1488,9 +1488,9 @@ AnimationBlinkMon: ; 7936f (1e:536f)
AnimationFlashMonPic: ; 79389 (1e:5389)
; Flashes the mon's sprite on and off
ld a, [W_PLAYERMONID]
ld a, [wBattleMonSpecies]
ld [wHPBarMaxHP + 1], a
ld a, [wcfe5]
ld a, [wEnemyMonSpecies]
ld [wHPBarMaxHP], a
jp Func_79793
@ -2117,9 +2117,9 @@ AnimationBoundUpAndDown: ; 7977a (1e:577a)
AnimationTransformMon: ; 79787 (1e:5787)
; Redraws this mon's sprite as the back/front sprite of the opposing mon.
; Used in Transform.
ld a, [wcfe5]
ld a, [wEnemyMonSpecies]
ld [wHPBarMaxHP + 1], a
ld a, [W_PLAYERMONID]
ld a, [wBattleMonSpecies]
ld [wHPBarMaxHP], a
Func_79793: ; 79793 (1e:5793)
@ -2137,10 +2137,10 @@ Func_79793: ; 79793 (1e:5793)
call LoadFrontSpriteByMonIndex
jr .asm_797d3
.asm_797b0
ld a, [wcfd9]
ld a, [wBattleMonSpecies2]
push af
ld a, [wHPBarMaxHP + 1]
ld [wcfd9], a
ld [wBattleMonSpecies2], a
ld [wd0b5], a
call GetMonHeader
ld a, $4
@ -2150,7 +2150,7 @@ Func_79793: ; 79793 (1e:5793)
call Func_79820
call Func_79aae
pop af
ld [wcfd9], a
ld [wBattleMonSpecies2], a
.asm_797d3
ld b, $1
jp GoPAL_SET
@ -2291,10 +2291,10 @@ Func_7986f: ; 7986f (1e:586f)
ld a,[H_WHOSETURN]
and a
jr nz,.next
ld a,[W_PLAYERMONID] ; get number of current monster
ld a,[wBattleMonSpecies] ; get number of current monster
jr .Continue
.next
ld a,[wcfe5]
ld a,[wEnemyMonSpecies]
.Continue
push hl
call GetCryData

View file

@ -90,9 +90,9 @@ PayDayEffect_ ; 2feb8 (b:7eb8)
ld [hli], a
ld a, [$fff3]
and a
ld a, [W_PLAYERMONLEVEL]
ld a, [wBattleMonLevel]
jr z, .asm_2fec8 ; 0x2fec3 $3
ld a, [W_ENEMYMONLEVEL]
ld a, [wEnemyMonLevel]
.asm_2fec8
add a
ld [$ff98], a

View file

@ -27,13 +27,13 @@ OneHitKOEffect_: ; 33f57 (c:7f57)
ld [hl], a ; set the damage output to zero
dec a
ld [wd05e], a
ld hl, W_PLAYERMONSPEED + 1
ld de, W_ENEMYMONSPEED + 1
ld hl, wBattleMonSpeed + 1
ld de, wEnemyMonSpeed + 1
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_33f72
ld hl, W_ENEMYMONSPEED + 1
ld de, W_PLAYERMONSPEED + 1
ld hl, wEnemyMonSpeed + 1
ld de, wBattleMonSpeed + 1
.asm_33f72
ld a, [de]
dec de

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@ Func_372d6: ; 372d6 (d:72d6)
call TextBoxBorder
FuncCoord 4, 5
ld hl, Coord
ld de, W_PLAYERNAME ; wd158
ld de, wPlayerName ; wd158
call PlaceString
FuncCoord 4, 10
ld hl, Coord

View file

@ -2,10 +2,10 @@ Func_39680: ; 39680 (e:5680)
ld a, [H_WHOSETURN] ; $fff3
and a
ld a, [wd060]
ld hl, W_PLAYERMONATK + 1
ld hl, wBattleMonAttack + 1
jr z, .asm_39691
ld a, [wd065]
ld hl, W_ENEMYMONATTACK + 1
ld hl, wEnemyMonAttack + 1
.asm_39691
ld c, $4
ld b, a
@ -31,10 +31,10 @@ Func_396a7: ; 396a7 (e:56a7)
ld a, [H_WHOSETURN] ; $fff3
and a
ld a, [wd061]
ld hl, W_PLAYERMONATK
ld hl, wBattleMonAttack
jr z, .asm_396b8
ld a, [wd066]
ld hl, W_ENEMYMONATTACK
ld hl, wEnemyMonAttack
.asm_396b8
ld c, $4
ld b, a
@ -63,7 +63,7 @@ _ScrollTrainerPicAfterBattle: ; 396d3 (e:56d3)
; Load the enemy trainer's pic and scrolls it into
; the screen from the right.
xor a
ld [W_ENEMYMONID], a
ld [wEnemyMonSpecies2], a
ld b, $1
call GoPAL_SET
callab _LoadTrainerPic
@ -166,7 +166,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719)
jp [hl] ; execute modification function
.loopFindMinimumEntries ; all entries will be decremented sequentially until one of them is zero
ld hl, wHPBarMaxHP ; temp move selection array
ld de, W_ENEMYMONMOVES ; enemy moves
ld de, wEnemyMonMoves ; enemy moves
ld c, $4
.loopDecrementEntries
ld a, [de]
@ -188,7 +188,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719)
cp $5
jr nz, .loopUndoPartialIteration
ld hl, wHPBarMaxHP ; temp move selection array
ld de, W_ENEMYMONMOVES ; enemy moves
ld de, wEnemyMonMoves ; enemy moves
ld c, $4
.filterMinimalEntries ; all minimal entries now have value 1. All other slots will be disabled (move set to 0)
ld a, [de]
@ -212,7 +212,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719)
ld hl, wHPBarMaxHP ; use created temporary array as move set
ret
.useOriginalMoveSet
ld hl, W_ENEMYMONMOVES ; use original move set
ld hl, wEnemyMonMoves ; use original move set
ret
AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3)
@ -223,11 +223,11 @@ AIMoveChoiceModificationFunctionPointers: ; 397a3 (e:57a3)
; discourages moves that cause no damage but only a status ailment if player's mon already has one
AIMoveChoiceModification1: ; 397ab (e:57ab)
ld a, [W_PLAYERMONSTATUS]
ld a, [wBattleMonStatus]
and a
ret z ; return if no status ailment on player's mon
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest)
ld de, W_ENEMYMONMOVES ; enemy moves
ld de, wEnemyMonMoves ; enemy moves
ld b, $5
.nextMove
dec b
@ -270,7 +270,7 @@ AIMoveChoiceModification2: ; 397e7 (e:57e7)
cp $1
ret nz
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest)
ld de, W_ENEMYMONMOVES ; enemy moves
ld de, wEnemyMonMoves ; enemy moves
ld b, $5
.nextMove
dec b
@ -298,7 +298,7 @@ AIMoveChoiceModification2: ; 397e7 (e:57e7)
; encourages moves that are effective against the player's mon
AIMoveChoiceModification3: ; 39817 (e:5817)
ld hl, wBuffer - 1 ; temp move selection array (-1 byte offest)
ld de, W_ENEMYMONMOVES ; enemy moves
ld de, wEnemyMonMoves ; enemy moves
ld b, $5
.nextMove
dec b
@ -328,7 +328,7 @@ AIMoveChoiceModification3: ; 39817 (e:5817)
push bc
ld a, [W_ENEMYMOVETYPE]
ld d, a
ld hl, W_ENEMYMONMOVES ; enemy moves
ld hl, wEnemyMonMoves ; enemy moves
ld b, $5
ld c, $0
.loopMoves
@ -635,14 +635,14 @@ Func_39bd5: ; 39bd5 (e:5bd5)
cp $1
jr nz, .asm_39be6
ld hl, wEnemyPartyCount ; wEnemyPartyCount
ld de, W_ENEMYMON1OT ; wd9ac OT names of other player
ld de, wEnemyMonOT ; wd9ac OT names of other player
ld a, $6
jr .asm_39c18
.asm_39be6
cp $4
jr nz, .calcAttackStat4
ld hl, W_NUMINPARTY ; W_NUMINPARTY
ld de, W_PARTYMON1OT ; wd273
ld hl, wPartyCount ; wPartyCount
ld de, wPartyMonOT ; wd273
ld a, $5
jr .asm_39c18
.calcAttackStat4
@ -681,13 +681,13 @@ Func_39bd5: ; 39bd5 (e:5bd5)
ret
Func_39c37: ; 39c37 (e:5c37)
ld hl, W_PARTYMON1 ; W_PARTYMON1
ld hl, wPartySpecies
ld a, [wcc49]
and a
jr z, .asm_39c4b
dec a
jr z, .asm_39c48
ld hl, wda81
ld hl, wBoxSpecies
jr .asm_39c4b
.asm_39c48
ld hl, wEnemyPartyMons
@ -791,8 +791,8 @@ ReadTrainer: ; 39c53 (e:5c53)
add hl,bc
ld a,[hli]
ld d,[hl]
ld hl,W_ENEMYMON1MOVE3
ld bc,W_ENEMYMON2MOVE3 - W_ENEMYMON1MOVE3
ld hl,wEnemyMon1Moves + 2
ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
ld [hl],d
jr .FinishUp
@ -821,13 +821,13 @@ ReadTrainer: ; 39c53 (e:5c53)
jr .FinishUp ; nope
.GiveTeamMoves
ld a,[hl]
ld [W_ENEMYMON5MOVE3],a
ld [wEnemyMon5Moves + 2],a
jr .FinishUp
.ChampionRival ; give moves to his team
; pidgeot
ld a,SKY_ATTACK
ld [W_ENEMYMON1MOVE3],a
ld [wEnemyMon1Moves + 2],a
; starter
ld a,[W_RIVALSTARTER]
@ -840,7 +840,7 @@ ReadTrainer: ; 39c53 (e:5c53)
ld b,BLIZZARD ; must be squirtle
.GiveStarterMove
ld a,b
ld [W_ENEMYMON6MOVE3],a
ld [wEnemyMon6Moves + 2],a
.FinishUp ; XXX this needs documenting
xor a ; clear D079-D07B
ld de,wd079
@ -985,7 +985,7 @@ CooltrainerFAI: ; 3a601 (e:6601)
BrockAI: ; 3a614 (e:6614)
; if his active monster has a status condition, use a full heal
ld a,[W_ENEMYMONSTATUS]
ld a,[wEnemyMonStatus]
and a
ret z
jp AIUseFullHeal
@ -1094,23 +1094,23 @@ AIUseFullRestore: ; 3a6a0 (e:66a0)
ld a,FULL_RESTORE
ld [wcf05],a
ld de,wHPBarOldHP
ld hl,W_ENEMYMONCURHP + 1
ld hl,wEnemyMonHP + 1
ld a,[hld]
ld [de],a
inc de
ld a,[hl]
ld [de],a
inc de
ld hl,W_ENEMYMONMAXHP + 1
ld hl,wEnemyMonMaxHP + 1
ld a,[hld]
ld [de],a
inc de
ld [wHPBarMaxHP],a
ld [W_ENEMYMONCURHP + 1],a
ld [wEnemyMonHP + 1],a
ld a,[hl]
ld [de],a
ld [wHPBarMaxHP+1],a
ld [W_ENEMYMONCURHP],a
ld [wEnemyMonHP],a
jr Func_3a718
AIUsePotion: ; 3a6ca (e:66ca)
@ -1134,7 +1134,7 @@ AIUseHyperPotion: ; 3a6d6 (e:66d6)
AIRecoverHP: ; 3a6da (e:66da)
; heal b HP and print "trainer used $(a) on pokemon!"
ld [wcf05],a
ld hl,W_ENEMYMONCURHP + 1
ld hl,wEnemyMonHP + 1
ld a,[hl]
ld [wHPBarOldHP],a
add b
@ -1151,7 +1151,7 @@ AIRecoverHP: ; 3a6da (e:66da)
inc hl
ld a,[hld]
ld b,a
ld de,W_ENEMYMONMAXHP + 1
ld de,wEnemyMonMaxHP + 1
ld a,[de]
dec de
ld [wHPBarMaxHP],a
@ -1185,7 +1185,7 @@ Func_3a718: ; 3a718 (e:6718)
Func_3a72a: ; 3a72a (e:672a)
ld a,[wEnemyPartyCount]
ld c,a
ld hl,W_ENEMYMON1HP
ld hl,wEnemyMon1HP
ld d,0 ; keep count of unfainted monsters
@ -1215,13 +1215,13 @@ Func_3a74b: ; 3a74b (e:674b)
; prepare to withdraw the active monster: copy hp, number, and status to roster
ld a,[W_ENEMYMONNUMBER]
ld hl,W_ENEMYMON1HP
ld bc,$2C
ld a,[wEnemyMonPartyPos]
ld hl,wEnemyMon1HP
ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
ld d,h
ld e,l
ld hl,W_ENEMYMONCURHP
ld hl,wEnemyMonHP
ld bc,4
call CopyData
@ -1252,13 +1252,13 @@ AIUseFullHeal: ; 3a786 (e:6786)
AICureStatus: ; 3a791 (e:6791)
; cures the status of enemy's active pokemon
ld a,[W_ENEMYMONNUMBER]
ld hl,wd8a8
ld bc,$2C
ld a,[wEnemyMonPartyPos]
ld hl,wEnemyMon1Status
ld bc,wEnemyMon2 - wEnemyMon1
call AddNTimes
xor a
ld [hl],a ; clear status in enemy team roster
ld [W_ENEMYMONSTATUS],a ; clear status of active enemy
ld [wEnemyMonStatus],a ; clear status of active enemy
ld hl,W_ENEMYBATTSTATUS3
res 0,[hl]
ret
@ -1286,7 +1286,7 @@ AIUseDireHit: ; 0x3a7c2 unused
Func_3a7cf: ; 3a7cf (e:67cf)
ld [H_DIVISOR],a
ld hl,W_ENEMYMONMAXHP
ld hl,wEnemyMonMaxHP
ld a,[hli]
ld [H_DIVIDEND],a
ld a,[hl]
@ -1297,7 +1297,7 @@ Func_3a7cf: ; 3a7cf (e:67cf)
ld c,a
ld a,[H_QUOTIENT + 2]
ld b,a
ld hl,W_ENEMYMONCURHP + 1
ld hl,wEnemyMonHP + 1
ld a,[hld]
ld e,a
ld a,[hl]
@ -1388,8 +1388,8 @@ LoadPartyPokeballGfx: ; 3a85d (e:685d)
SetupOwnPartyPokeballs: ; 3a869 (e:6869)
call PlacePlayerHUDTiles
ld hl, W_PARTYMON1DATA
ld de, W_NUMINPARTY ; W_NUMINPARTY
ld hl, wPartyMon1
ld de, wPartyCount ; wPartyCount
call SetupPokeballs
ld a, $60
ld hl, W_BASECOORDX ; wd081
@ -1537,8 +1537,8 @@ PlaceHUDTiles: ; 3a930 (e:6930)
SetupPlayerAndEnemyPokeballs: ; 3a948 (e:6948)
call LoadPartyPokeballGfx
ld hl, W_PARTYMON1_NUM ; W_PARTYMON1_NUM (aliases: W_PARTYMON1DATA)
ld de, W_NUMINPARTY ; W_NUMINPARTY
ld hl, wPartyMon1Species ; wPartyMon1Species (aliases: wPartyMon1)
ld de, wPartyCount ; wPartyCount
call SetupPokeballs
ld hl, W_BASECOORDX ; wd081
ld a, $50

View file

@ -1,12 +1,12 @@
HealEffect_: ; 3b9ec (e:79ec)
ld a, [H_WHOSETURN] ; $fff3
and a
ld de, W_PLAYERMONCURHP ; wd015
ld hl, W_PLAYERMONMAXHP ; wd023
ld de, wBattleMonHP ; wd015
ld hl, wBattleMonMaxHP ; wd023
ld a, [W_PLAYERMOVENUM] ; wcfd2
jr z, .asm_3ba03
ld de, W_ENEMYMONCURHP ; W_ENEMYMONCURHP
ld hl, W_ENEMYMONMAXHP ; W_ENEMYMONMAXHP
ld de, wEnemyMonHP ; wEnemyMonHP
ld hl, wEnemyMonMaxHP ; wEnemyMonMaxHP
ld a, [W_ENEMYMOVENUM] ; W_ENEMYMOVENUM
.asm_3ba03
ld b, a
@ -25,11 +25,11 @@ HealEffect_: ; 3b9ec (e:79ec)
push af
ld c, $32
call DelayFrames
ld hl, W_PLAYERMONSTATUS ; W_PLAYERMONSTATUS
ld hl, wBattleMonStatus ; wBattleMonStatus
ld a, [H_WHOSETURN] ; $fff3
and a
jr z, .asm_3ba25
ld hl, W_ENEMYMONSTATUS ; wcfe9
ld hl, wEnemyMonStatus ; wcfe9
.asm_3ba25
ld a, [hl]
and a
@ -120,15 +120,15 @@ RegainedHealthText: ; 3baac (e:7aac)
db "@"
TransformEffect_: ; 3bab1 (e:7ab1)
ld hl, W_PLAYERMONID
ld de, wcfe5
ld hl, wBattleMonSpecies
ld de, wEnemyMonSpecies
ld bc, W_ENEMYBATTSTATUS3 ; W_ENEMYBATTSTATUS3
ld a, [W_ENEMYBATTSTATUS1] ; W_ENEMYBATTSTATUS1
ld a, [H_WHOSETURN] ; $fff3
and a
jr nz, .asm_3bad1
ld hl, wcfe5
ld de, W_PLAYERMONID
ld hl, wEnemyMonSpecies
ld de, wBattleMonSpecies
ld bc, W_PLAYERBATTSTATUS3 ; W_PLAYERBATTSTATUS3
ld [wPlayerMoveListIndex], a ; wPlayerMoveListIndex
ld a, [W_PLAYERBATTSTATUS1] ; W_PLAYERBATTSTATUS1

View file

@ -15,7 +15,7 @@ PrintSafariZoneBattleText: ; 4277 (1:4277)
ld hl, SafariZoneAngryText
jr nz, .asm_429f
push hl
ld a, [wcfe5]
ld a, [wEnemyMonSpecies]
ld [wd0b5], a
call GetMonHeader
ld a, [W_MONHCATCHRATE]