diff options
Diffstat (limited to 'engine/battle/ai')
-rw-r--r-- | engine/battle/ai/items.asm | 6 | ||||
-rwxr-xr-x | engine/battle/ai/move.asm | 6 | ||||
-rw-r--r-- | engine/battle/ai/scoring.asm | 26 | ||||
-rwxr-xr-x | engine/battle/ai/switch.asm | 16 |
4 files changed, 27 insertions, 27 deletions
diff --git a/engine/battle/ai/items.asm b/engine/battle/ai/items.asm index 09595077a..5bdc070ec 100644 --- a/engine/battle/ai/items.asm +++ b/engine/battle/ai/items.asm @@ -291,7 +291,7 @@ AI_Items: ; 39196 dbw X_DEFEND, .XDefend dbw X_SPEED, .XSpeed dbw X_SPECIAL, .XSpecial - db $ff + db -1 ; end ; 381be .FullHeal: ; 381be @@ -545,7 +545,7 @@ AI_Items: ; 39196 AIUpdateHUD: ; 38387 call UpdateEnemyMonInParty - farcall UpdateEnemyHUD + farcall Predef_UpdateEnemyHUD ld a, $1 ld [hBGMapMode], a ld hl, wEnemyItemState @@ -664,7 +664,7 @@ EnemyPotionFinish: ; 38436 xor a ld [wWhichHPBar], a call AIUsedItemSound - predef AnimateHPBar + predef Predef_AnimateHPBar jp AIUpdateHUD diff --git a/engine/battle/ai/move.asm b/engine/battle/ai/move.asm index 11586c0da..d04fb9930 100755 --- a/engine/battle/ai/move.asm +++ b/engine/battle/ai/move.asm @@ -56,7 +56,7 @@ AIChooseMove: ; 440ce inc hl ld a, [de] inc de - and $3f + and PP_MASK jr nz, .CheckMovePP ld [hl], 80 jr .CheckMovePP @@ -92,7 +92,7 @@ AIChooseMove: ; 440ce push bc ld d, BANK(TrainerClassAttributes) - predef FlagPredef + predef Predef_SmallFarFlagAction ld d, c pop bc @@ -186,7 +186,7 @@ AIChooseMove: ; 440ce .ChooseMove: ld hl, Buffer1 call Random - and 3 + maskbits NUM_MOVES +- 1 ld c, a ld b, 0 add hl, bc diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm index 44194d6f7..c1d175c38 100644 --- a/engine/battle/ai/scoring.asm +++ b/engine/battle/ai/scoring.asm @@ -68,7 +68,7 @@ AI_Basic: ; 38591 db EFFECT_TOXIC db EFFECT_POISON db EFFECT_PARALYZE - db $ff + db -1 ; end ; 385e0 @@ -400,7 +400,7 @@ AI_Smart: ; 386be dbw EFFECT_SOLARBEAM, AI_Smart_Solarbeam dbw EFFECT_THUNDER, AI_Smart_Thunder dbw EFFECT_FLY, AI_Smart_Fly - db $ff + db -1 ; end ; 387e3 @@ -1488,7 +1488,7 @@ AI_Smart_Encore: ; 38c3b push hl ld a, [wEnemyMoveStruct + MOVE_TYPE] ld hl, EnemyMonType1 - predef CheckTypeMatchup + predef Predef_CheckTypeMatchup pop hl ld a, [wd265] @@ -1553,7 +1553,7 @@ AI_Smart_Encore: ; 38c3b db AEROBLAST db COTTON_SPORE db POWDER_SNOW - db $ff + db -1 ; end ; 38ca4 @@ -2214,7 +2214,7 @@ AI_Smart_Sandstorm: ; 38f7a db ROCK db GROUND db STEEL - db $ff + db -1 ; end ; 38fac @@ -2533,7 +2533,7 @@ RainDanceMoves: ; 390e7 db CRABHAMMER db OCTAZOOKA db WHIRLPOOL - db $ff + db -1 ; end ; 390f3 @@ -2622,7 +2622,7 @@ SunnyDayMoves: ; 39134 db SACRED_FIRE db MORNING_SUN db SYNTHESIS - db $ff + db -1 ; end ; 3913d @@ -3125,7 +3125,7 @@ UsefulMoves: ; 39301 db FIRE_BLAST db SOFTBOILED db SUPER_FANG - db $ff + db -1 ; end ; 39315 @@ -3209,7 +3209,7 @@ AI_Opportunist: ; 39315 db CONVERSION db SUBSTITUTE db FLAME_WHEEL - db $ff + db -1 ; end ; 39369 @@ -3324,7 +3324,7 @@ AI_Aggressive: ; 39369 db EFFECT_RAMPAGE db EFFECT_MULTI_HIT db EFFECT_DOUBLE_HIT - db $ff + db -1 ; end ; 393e7 @@ -3350,7 +3350,7 @@ AIDamageCalc: ; 393e7 db EFFECT_STATIC_DAMAGE db EFFECT_LEVEL_DAMAGE db EFFECT_PSYWAVE - db $ff + db -1 ; end ; 39418 @@ -3406,7 +3406,7 @@ AI_Cautious: ; 39418 db CONVERSION db SUBSTITUTE db SPIKES - db $ff + db -1 ; end ; 39453 @@ -3544,7 +3544,7 @@ endr .RiskyMoves: db EFFECT_SELFDESTRUCT db EFFECT_OHKO - db $ff + db -1 ; end ; 39502 diff --git a/engine/battle/ai/switch.asm b/engine/battle/ai/switch.asm index c2f83fa1f..cb278676e 100755 --- a/engine/battle/ai/switch.asm +++ b/engine/battle/ai/switch.asm @@ -28,7 +28,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e inc hl call GetMoveByte ld hl, EnemyMonType - call CheckTypeMatchup + call Predef_CheckTypeMatchup ld a, [wTypeMatchup] cp 10 + 1 ; 1.0 + 0.1 jr nc, .super_effective @@ -73,7 +73,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e ld a, [BattleMonType1] ld b, a ld hl, EnemyMonType1 - call CheckTypeMatchup + call Predef_CheckTypeMatchup ld a, [wTypeMatchup] cp 10 + 1 ; 1.0 + 0.1 jr c, .ok @@ -82,7 +82,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e ld a, [BattleMonType2] cp b jr z, .ok2 - call CheckTypeMatchup + call Predef_CheckTypeMatchup ld a, [wTypeMatchup] cp 10 + 1 ; 1.0 + 0.1 jr c, .ok2 @@ -123,7 +123,7 @@ CheckPlayerMoveTypeMatchups: ; 3484e inc hl call GetMoveByte ld hl, BattleMonType1 - call CheckTypeMatchup + call Predef_CheckTypeMatchup ld a, [wTypeMatchup] ; immune @@ -390,7 +390,7 @@ FindEnemyMonsImmuneToLastCounterMove: ; 34a2a inc hl call GetMoveByte ld hl, BaseType - call CheckTypeMatchup + call Predef_CheckTypeMatchup ld a, [wTypeMatchup] and a jr nz, .next @@ -481,7 +481,7 @@ FindEnemyMonsWithASuperEffectiveMove: ; 34aa7 inc hl call GetMoveByte ld hl, BattleMonType1 - call CheckTypeMatchup + call Predef_CheckTypeMatchup ; if immune or not very effective: continue ld a, [wTypeMatchup] @@ -585,7 +585,7 @@ FindEnemyMonsThatResistPlayer: ; 34b20 .skip_move ld a, [BattleMonType1] ld hl, BaseType - call CheckTypeMatchup + call Predef_CheckTypeMatchup ld a, [wTypeMatchup] cp 10 + 1 jr nc, .dont_choose_mon @@ -593,7 +593,7 @@ FindEnemyMonsThatResistPlayer: ; 34b20 .check_type ld hl, BaseType - call CheckTypeMatchup + call Predef_CheckTypeMatchup ld a, [wTypeMatchup] cp 10 + 1 jr nc, .dont_choose_mon |