summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxCrystal <rgr.crystal@gmail.com>2014-10-21 13:54:04 +0200
committerxCrystal <rgr.crystal@gmail.com>2014-10-21 13:54:04 +0200
commitdf2d027501512bd6311f8d44c21b687e3d1b1f21 (patch)
tree7b916ef08e40761a9cfc0dc6e13062d53b5e3ed3
parentc28be212607ded804539975ae6905f218b73bcca (diff)
Start commenting some AI layers
-rw-r--r--battle/ai/scoring.asm18
1 files changed, 16 insertions, 2 deletions
diff --git a/battle/ai/scoring.asm b/battle/ai/scoring.asm
index e7498886f..79afdcd68 100644
--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -389,6 +389,9 @@ AIScoring_Smart: ; 386be
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
call AIHasMove
jr c, .asm_387f0
@@ -413,16 +416,20 @@ AIScoring_LeechHit: ; 387f7
callab Function347c8
pop hl
+; 60% chance to discourage this move if not very effective
ld a, [$d265]
cp 10 ; 1.0
jr c, .asm_38815
+; Do nothing if effectiveness is neutral
ret z
- call AICheckEnemyMaxHP
+; Do nothing if the enemy's health is full
+ call AICheckEnemyMaxHP
ret c
- call Function39521
+; 80% chance to encourage this move otherwise
+ call Function39521
ret c
dec [hl]
ret
@@ -544,23 +551,30 @@ AIScoring_LockOn: ; 3881d
AIScoring_Explosion: ; 388a6
+
+; Unless this is the enemy's last Pokemon...
push hl
callba Function349f4
pop hl
jr nc, .asm_388b7
+; ...greatly discourage this move unless this is the player's last Pokemon too
push hl
call AICheckLastPlayerMon
pop hl
jr nz, .asm_388c6
.asm_388b7
+; Greatly discourage this move if enemy's health is higher than 50%
call AICheckEnemyHalfHP
jr c, .asm_388c6
+; Do nothing if enemy's health is not higher than 25%
call AICheckEnemyQuarterHP
ret nc
+; If enemy's health is in-between 25% and 50%
+; over 90% chance to greatly discourage this move
call Random
cp 20
ret c