diff options
author | dannye <corrnondacqb@yahoo.com> | 2016-01-12 18:45:02 -0600 |
---|---|---|
committer | dannye <corrnondacqb@yahoo.com> | 2016-01-12 18:45:02 -0600 |
commit | 5914540ba780d7936fd6624d6fde2d67a9f7a773 (patch) | |
tree | a1ce27018f39d98f49d89468df426d0291e18560 /engine/battle/trainer_ai.asm | |
parent | ccf4fe54a8e444aaf966fac7b38bc9452c494222 (diff) | |
parent | 8a5a7d8e68538b727e0c166488265f395603366e (diff) |
Merge branch 'master' of https://github.com/pret/pokered into rgbgfxrgbgfx
Diffstat (limited to 'engine/battle/trainer_ai.asm')
-rw-r--r-- | engine/battle/trainer_ai.asm | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/engine/battle/trainer_ai.asm b/engine/battle/trainer_ai.asm index 9102b2d8..bab4c253 100644 --- a/engine/battle/trainer_ai.asm +++ b/engine/battle/trainer_ai.asm @@ -7,7 +7,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719) ld [hli], a ; move 2 ld [hli], a ; move 3 ld [hl], a ; move 4 - ld a, [W_ENEMYDISABLEDMOVE] ; forbid disabled move (if any) + ld a, [wEnemyDisabledMove] ; forbid disabled move (if any) swap a and $f jr z, .noMoveDisabled @@ -19,7 +19,7 @@ AIEnemyTrainerChooseMoves: ; 39719 (e:5719) ld [hl], $50 ; forbid (highly discourage) disabled move .noMoveDisabled ld hl, TrainerClassMoveChoiceModifications - ld a, [W_TRAINERCLASS] + ld a, [wTrainerClass] ld b, a .loopTrainerClasses dec b @@ -126,10 +126,10 @@ AIMoveChoiceModification1: ; 397ab (e:57ab) ret z ; no more moves in move set inc de call ReadMove - ld a, [W_ENEMYMOVEPOWER] + ld a, [wEnemyMovePower] and a jr nz, .nextMove - ld a, [W_ENEMYMOVEEFFECT] + ld a, [wEnemyMoveEffect] push hl push de push bc @@ -171,7 +171,7 @@ AIMoveChoiceModification2: ; 397e7 (e:57e7) ret z ; no more moves in move set inc de call ReadMove - ld a, [W_ENEMYMOVEEFFECT] + ld a, [wEnemyMoveEffect] cp ATTACK_UP1_EFFECT jr c, .nextMove cp BIDE_EFFECT @@ -191,7 +191,7 @@ AIMoveChoiceModification2: ; 397e7 (e:57e7) AIMoveChoiceModification3: ; 39817 (e:5817) ld hl, wBuffer - 1 ; temp move selection array (-1 byte offset) ld de, wEnemyMonMoves ; enemy moves - ld b, $5 + ld b, NUM_MOVES + 1 .nextMove dec b ret z ; processed all 4 moves @@ -208,7 +208,7 @@ AIMoveChoiceModification3: ; 39817 (e:5817) pop de pop bc pop hl - ld a, [wd11e] + ld a, [wTypeEffectiveness] cp $10 jr z, .nextMove jr c, .notEffectiveMove @@ -218,7 +218,7 @@ AIMoveChoiceModification3: ; 39817 (e:5817) push hl push de push bc - ld a, [W_ENEMYMOVETYPE] + ld a, [wEnemyMoveType] ld d, a ld hl, wEnemyMonMoves ; enemy moves ld b, NUM_MOVES + 1 @@ -230,17 +230,17 @@ AIMoveChoiceModification3: ; 39817 (e:5817) and a jr z, .done call ReadMove - ld a, [W_ENEMYMOVEEFFECT] + ld a, [wEnemyMoveEffect] cp SUPER_FANG_EFFECT jr z, .betterMoveFound ; Super Fang is considered to be a better move cp SPECIAL_DAMAGE_EFFECT jr z, .betterMoveFound ; any special damage moves are considered to be better moves cp FLY_EFFECT jr z, .betterMoveFound ; Fly is considered to be a better move - ld a, [W_ENEMYMOVETYPE] + ld a, [wEnemyMoveType] cp d jr z, .loopMoves - ld a, [W_ENEMYMOVEPOWER] + ld a, [wEnemyMovePower] and a jr nz, .betterMoveFound ; damaging moves of a different type are considered to be better moves jr .loopMoves @@ -264,9 +264,9 @@ ReadMove: ; 39884 (e:5884) push bc dec a ld hl,Moves - ld bc,6 + ld bc,MoveEnd - Moves call AddNTimes - ld de,W_ENEMYMOVENUM + ld de,wEnemyMoveNum call CopyData pop bc pop de @@ -280,8 +280,8 @@ TrainerClassMoveChoiceModifications: ; 3989b (e:589b) db 1,0 ; BUG CATCHER db 1,0 ; LASS db 1,3,0 ; SAILOR - db 1,0 ; JR__TRAINER_M - db 1,0 ; JR__TRAINER_F + db 1,0 ; JR_TRAINER_M + db 1,0 ; JR_TRAINER_F db 1,2,3,0; POKEMANIAC db 1,2,0 ; SUPER_NERD db 1,0 ; HIKER @@ -311,7 +311,7 @@ TrainerClassMoveChoiceModifications: ; 3989b (e:589b) db 1,0 ; BRUNO db 1,0 ; BROCK db 1,3,0 ; MISTY - db 1,3,0 ; LT__SURGE + db 1,3,0 ; LT_SURGE db 1,3,0 ; ERIKA db 1,3,0 ; KOGA db 1,3,0 ; BLAINE @@ -338,13 +338,13 @@ INCLUDE "data/trainer_parties.asm" TrainerAI: ; 3a52e (e:652e) and a - ld a,[W_ISINBATTLE] + ld a,[wIsInBattle] dec a ret z ; if not a trainer, we're done here ld a,[wLinkState] cp LINK_STATE_BATTLING ret z - ld a,[W_TRAINERCLASS] ; what trainer class is this? + ld a,[wTrainerClass] ; what trainer class is this? dec a ld c,a ld b,0 @@ -727,27 +727,27 @@ AICureStatus: ; 3a791 (e:6791) xor a ld [hl],a ; clear status in enemy team roster ld [wEnemyMonStatus],a ; clear status of active enemy - ld hl,W_ENEMYBATTSTATUS3 + ld hl,wEnemyBattleStatus3 res 0,[hl] ret AIUseXAccuracy: ; 0x3a7a8 unused call AIPlayRestoringSFX - ld hl,W_ENEMYBATTSTATUS2 + ld hl,wEnemyBattleStatus2 set 0,[hl] ld a,X_ACCURACY jp AIPrintItemUse AIUseGuardSpec: ; 3a7b5 (e:67b5) call AIPlayRestoringSFX - ld hl,W_ENEMYBATTSTATUS2 + ld hl,wEnemyBattleStatus2 set 1,[hl] - ld a,GUARD_SPEC_ + ld a,GUARD_SPEC jp AIPrintItemUse AIUseDireHit: ; 0x3a7c2 unused call AIPlayRestoringSFX - ld hl,W_ENEMYBATTSTATUS2 + ld hl,wEnemyBattleStatus2 set 2,[hl] ld a,DIRE_HIT jp AIPrintItemUse @@ -803,7 +803,7 @@ AIIncreaseStat: ; 3a808 (e:6808) push bc call AIPrintItemUse_ pop bc - ld hl,W_ENEMYMOVEEFFECT + ld hl,wEnemyMoveEffect ld a,[hld] push af ld a,[hl] |