diff options
Diffstat (limited to 'battle/ai/scoring.asm')
-rw-r--r-- | battle/ai/scoring.asm | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/battle/ai/scoring.asm b/battle/ai/scoring.asm index b52f37311..6391e3b29 100644 --- a/battle/ai/scoring.asm +++ b/battle/ai/scoring.asm @@ -1,3 +1,5 @@ +AIScoring: ; 38591 + AI_Basic: ; 38591 ; Don't do anything redundant: ; -Using status-only moves if the player can't be statused @@ -27,7 +29,7 @@ AI_Basic: ; 38591 push hl push de push bc - callba AI_Redundant + farcall AI_Redundant pop bc pop de pop hl @@ -174,7 +176,7 @@ AI_Types: ; 38635 push de ld a, 1 ld [hBattleTurn], a - callab BattleCheckTypeMatchup + callfar BattleCheckTypeMatchup pop de pop bc pop hl @@ -427,7 +429,7 @@ AI_Smart_LeechHit: ; 387f7 push hl ld a, 1 ld [hBattleTurn], a - callab BattleCheckTypeMatchup + callfar BattleCheckTypeMatchup pop hl ; 60% chance to discourage this move if not very effective. @@ -508,7 +510,7 @@ AI_Smart_LockOn: ; 3881d push hl push bc - callba BattleCheckTypeMatchup + farcall BattleCheckTypeMatchup ld a, [wd265] cp $a pop bc @@ -570,7 +572,7 @@ AI_Smart_Selfdestruct: ; 388a6 ; Unless this is the enemy's last Pokemon... push hl - callba FindAliveEnemyMons + farcall FindAliveEnemyMons pop hl jr nc, .asm_388b7 @@ -968,7 +970,7 @@ AI_Smart_ForceSwitch: ; 38a2a ; Consider player's type(s) if its moves are unknown. push hl - callab CheckPlayerMoveTypeMatchups + callfar CheckPlayerMoveTypeMatchups ld a, [wEnemyAISwitchScore] cp 10 ; neutral pop hl @@ -1366,7 +1368,7 @@ AI_Smart_Mimic: ; 38ba8 ld a, $1 ld [hBattleTurn], a - callab BattleCheckTypeMatchup + callfar BattleCheckTypeMatchup ld a, [wd265] cp $a @@ -1761,9 +1763,9 @@ AI_Smart_PriorityHit: ; 38d5a ld a, $1 ld [hBattleTurn], a push hl - callab EnemyAttackDamage - callab BattleCommand_DamageCalc - callab BattleCommand_Stab + callfar EnemyAttackDamage + callfar BattleCommand_DamageCalc + callfar BattleCommand_Stab pop hl ld a, [CurDamage + 1] ld c, a @@ -1809,7 +1811,7 @@ AI_Smart_Conversion2: ; 38d98 xor a ld [hBattleTurn], a - callab BattleCheckTypeMatchup + callfar BattleCheckTypeMatchup ld a, [wd265] cp $a @@ -1874,7 +1876,8 @@ AI_Smart_MeanLook: ; 38dfb pop hl jp z, AIDiscourageMove -; 80% chance to greatly encourage this move if the enemy is badly poisoned (weird). +; 80% chance to greatly encourage this move if the enemy is badly poisoned (buggy). +; Should check PlayerSubStatus5 instead. ld a, [EnemySubStatus5] bit SUBSTATUS_TOXIC, a jr nz, .asm_38e26 @@ -1887,7 +1890,7 @@ AI_Smart_MeanLook: ; 38dfb ; Otherwise, discourage this move unless the player only has not very effective moves against the enemy. push hl - callab CheckPlayerMoveTypeMatchups + callfar CheckPlayerMoveTypeMatchups ld a, [wEnemyAISwitchScore] cp $b ; not very effective pop hl @@ -2005,7 +2008,7 @@ AI_Smart_Curse: ; 38e5c jp nz, AIDiscourageMove push hl - callba FindAliveEnemyMons + farcall FindAliveEnemyMons pop hl jr nc, .asm_38eb0 @@ -2134,7 +2137,7 @@ AI_Smart_Foresight: ; 38f1d AI_Smart_PerishSong: ; 38f4a push hl - callab FindAliveEnemyMons + callfar FindAliveEnemyMons pop hl jr c, .no @@ -2143,7 +2146,7 @@ AI_Smart_PerishSong: ; 38f4a jr nz, .yes push hl - callab CheckPlayerMoveTypeMatchups + callfar CheckPlayerMoveTypeMatchups ld a, [wEnemyAISwitchScore] cp 10 ; 1.0 pop hl @@ -2401,7 +2404,7 @@ AI_Smart_BatonPass: ; 39062 ; Consider player's type(s) if its moves are unknown. push hl - callab CheckPlayerMoveTypeMatchups + callfar CheckPlayerMoveTypeMatchups ld a, [wEnemyAISwitchScore] cp 10 ; neutral pop hl @@ -2463,8 +2466,8 @@ AI_Smart_HiddenPower: ; 3909e ld [hBattleTurn], a ; Calculate Hidden Power's type and base power based on enemy's DVs. - callab HiddenPowerDamage - callab BattleCheckTypeMatchup + callfar HiddenPowerDamage + callfar BattleCheckTypeMatchup pop hl ; Discourage Hidden Power if not very effective. @@ -3333,13 +3336,13 @@ AIDamageCalc: ; 393e7 ld hl, .ConstantDamageEffects call IsInArray jr nc, .asm_39400 - callab BattleCommand_ConstantDamage + callfar BattleCommand_ConstantDamage ret .asm_39400 - callab EnemyAttackDamage - callab BattleCommand_DamageCalc - callab BattleCommand_Stab + callfar EnemyAttackDamage + callfar BattleCommand_DamageCalc + callfar BattleCommand_Stab ret .ConstantDamageEffects: @@ -3456,7 +3459,7 @@ AI_Status: ; 39453 push de ld a, 1 ld [hBattleTurn], a - callab BattleCheckTypeMatchup + callfar BattleCheckTypeMatchup pop de pop bc pop hl |