Start commenting some AI layers

This commit is contained in:
xCrystal 2014-10-21 13:54:04 +02:00
parent c28be21260
commit df2d027501

View File

@ -389,6 +389,9 @@ AIScoring_Smart: ; 386be
AIScoring_Sleep: ; 387e3 AIScoring_Sleep: ; 387e3
; Greatly encourage sleep inducing moves if the enemy has either Dream Eater or Nightmare
; 50% chance to greatly encourage sleep inducing moves otherwise
ld b, EFFECT_DREAM_EATER ld b, EFFECT_DREAM_EATER
call AIHasMove call AIHasMove
jr c, .asm_387f0 jr c, .asm_387f0
@ -413,16 +416,20 @@ AIScoring_LeechHit: ; 387f7
callab Function347c8 callab Function347c8
pop hl pop hl
; 60% chance to discourage this move if not very effective
ld a, [$d265] ld a, [$d265]
cp 10 ; 1.0 cp 10 ; 1.0
jr c, .asm_38815 jr c, .asm_38815
; Do nothing if effectiveness is neutral
ret z ret z
; Do nothing if the enemy's health is full
call AICheckEnemyMaxHP call AICheckEnemyMaxHP
ret c ret c
call Function39521
; 80% chance to encourage this move otherwise
call Function39521
ret c ret c
dec [hl] dec [hl]
ret ret
@ -544,23 +551,30 @@ AIScoring_LockOn: ; 3881d
AIScoring_Explosion: ; 388a6 AIScoring_Explosion: ; 388a6
; Unless this is the enemy's last Pokemon...
push hl push hl
callba Function349f4 callba Function349f4
pop hl pop hl
jr nc, .asm_388b7 jr nc, .asm_388b7
; ...greatly discourage this move unless this is the player's last Pokemon too
push hl push hl
call AICheckLastPlayerMon call AICheckLastPlayerMon
pop hl pop hl
jr nz, .asm_388c6 jr nz, .asm_388c6
.asm_388b7 .asm_388b7
; Greatly discourage this move if enemy's health is higher than 50%
call AICheckEnemyHalfHP call AICheckEnemyHalfHP
jr c, .asm_388c6 jr c, .asm_388c6
; Do nothing if enemy's health is not higher than 25%
call AICheckEnemyQuarterHP call AICheckEnemyQuarterHP
ret nc ret nc
; If enemy's health is in-between 25% and 50%
; over 90% chance to greatly discourage this move
call Random call Random
cp 20 cp 20
ret c ret c