Skip to content

Commit

Permalink
fixed dream eater ai bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RainbowMetalPigeon committed Dec 27, 2024
1 parent b8b0046 commit 6087281
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions data/trainers/special_moves.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2164,10 +2164,10 @@ SpecialTrainerMoves:

db LORELEI, 1
; DEWGONG
db 1, 1, THUNDER_WAVE ; AQUA_JET
db 1, 2, DREAM_EATER ; WATERFALL
db 1, 3, SPORE ; BLIZZARD
db 1, 4, ENERGY_BALL ; REST
db 1, 1, AQUA_JET
db 1, 2, WATERFALL
db 1, 3, BLIZZARD
db 1, 4, REST
; CLOYSTER
db 2, 1, EXPLOSION
db 2, 2, PIN_MISSILE
Expand Down
7 changes: 4 additions & 3 deletions engine/battle/trainer_ai.asm
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,20 @@ AIMoveChoiceModification1:
; check if it is one of the debuffing AND damaging moves, otherwise ignore all damaging moves here
; treat the accuracy one, i.e. Mud Slap, differently from the other two,
; Mud Shot and Rock Tomb, which are stronger but reduce less useful stats in Speed
; Dream Eater goes here too as it does deal damage
ld a, [wEnemyMoveEffect]
cp ACCURACY_DOWN_SIDE_EFFECT_CERT
jp z, .debuff_Accuracy
cp SPEED_DOWN_SIDE_EFFECT_CERT
jp z, .debuff_Speed
; if it is not the move above, check if it deals damage
cp DREAM_EATER_EFFECT
jp z, .dreamEaterEffect
; if it is not the move above, check if it deals damage; if yes, don't process to save time
ld a, [wEnemyMovePower]
cp 5 ; this is here to include OHKO moves
jr nc, .nextMove ; we only care about non-damaging and OHKO moves right now
; read the effect and start comparing with a list of to-be-checked ones --------
ld a, [wEnemyMoveEffect]
cp DREAM_EATER_EFFECT
jp z, .dreamEaterEffect
cp CURSE_EFFECT
jp z, .curseEffect
cp LEECH_SEED_EFFECT
Expand Down

0 comments on commit 6087281

Please sign in to comment.