This commit is contained in:
@@ -175,9 +175,8 @@ AI_TryItem:
|
||||
ld b, h
|
||||
ld c, l
|
||||
ld hl, AI_Items
|
||||
; BUG: AI might use its base reward value as an item (see docs/bugs_and_glitches.md)
|
||||
ld de, wEnemyTrainerItem1
|
||||
.loop
|
||||
ld de, wEnemyTrainerItem1
|
||||
ld a, [hl]
|
||||
and a
|
||||
inc a
|
||||
@@ -553,14 +552,9 @@ EnemyUsedMaxPotion:
|
||||
jr FullRestoreContinue
|
||||
|
||||
EnemyUsedFullRestore:
|
||||
; BUG: AI use of Full Heal does not cure confusion status (see docs/bugs_and_glitches.md)
|
||||
call AI_HealStatus
|
||||
ld a, FULL_RESTORE
|
||||
ld [wCurEnemyItem], a
|
||||
ld hl, wEnemySubStatus3
|
||||
res SUBSTATUS_CONFUSED, [hl]
|
||||
xor a
|
||||
ld [wEnemyConfuseCount], a
|
||||
; fallthrough
|
||||
|
||||
FullRestoreContinue:
|
||||
@@ -728,7 +722,6 @@ EnemyUsedFullHealRed: ; unreferenced
|
||||
jp PrintText_UsedItemOn_AND_AIUpdateHUD
|
||||
|
||||
AI_HealStatus:
|
||||
; BUG: AI use of Full Heal or Full Restore does not cure Nightmare status (see docs/bugs_and_glitches.md)
|
||||
ld a, [wCurOTMon]
|
||||
ld hl, wOTPartyMon1Status
|
||||
ld bc, PARTYMON_STRUCT_LENGTH
|
||||
@@ -736,6 +729,13 @@ AI_HealStatus:
|
||||
xor a
|
||||
ld [hl], a
|
||||
ld [wEnemyMonStatus], a
|
||||
; remove the Confusion status condition
|
||||
ld [wEnemyConfuseCount], a
|
||||
ld hl, wEnemySubStatus3
|
||||
res SUBSTATUS_CONFUSED, [hl]
|
||||
; remove the Nightmare substatus condition
|
||||
ld hl, wEnemySubStatus1
|
||||
res SUBSTATUS_NIGHTMARE, [hl]
|
||||
ld hl, wEnemySubStatus5
|
||||
res SUBSTATUS_TOXIC, [hl]
|
||||
ret
|
||||
|
@@ -176,9 +176,8 @@ AI_Redundant:
|
||||
ret
|
||||
|
||||
.FutureSight:
|
||||
; BUG: AI does not discourage Future Sight when it's already been used (see docs/bugs_and_glitches.md)
|
||||
ld a, [wEnemyScreens]
|
||||
bit SCREENS_UNUSED, a
|
||||
ld a, [wEnemyFutureSightCount]
|
||||
and a
|
||||
ret
|
||||
|
||||
.Heal:
|
||||
|
@@ -1665,10 +1665,9 @@ AI_Smart_Thief:
|
||||
ret
|
||||
|
||||
AI_Smart_Conversion2:
|
||||
; BUG: "Smart" AI discourages Conversion2 after the first turn (see docs/bugs_and_glitches.md)
|
||||
ld a, [wLastPlayerMove]
|
||||
and a
|
||||
jr nz, .discourage
|
||||
jr z, .discourage
|
||||
|
||||
push hl
|
||||
dec a
|
||||
@@ -1745,8 +1744,7 @@ AI_Smart_MeanLook:
|
||||
jp z, AIDiscourageMove
|
||||
|
||||
; 80% chance to greatly encourage this move if the enemy is badly poisoned.
|
||||
; BUG: "Smart" AI encourages Mean Look if its own Pokémon is badly poisoned (see docs/bugs_and_glitches.md)
|
||||
ld a, [wEnemySubStatus5]
|
||||
ld a, [wPlayerSubStatus5]
|
||||
bit SUBSTATUS_TOXIC, a
|
||||
jr nz, .encourage
|
||||
|
||||
@@ -3086,10 +3084,9 @@ AI_Cautious:
|
||||
pop hl
|
||||
jr nc, .loop
|
||||
|
||||
; BUG: "Cautious" AI may fail to discourage residual moves (see docs/bugs_and_glitches.md)
|
||||
call Random
|
||||
cp 90 percent + 1
|
||||
ret nc
|
||||
jr nc, .loop
|
||||
|
||||
inc [hl]
|
||||
jr .loop
|
||||
|
Reference in New Issue
Block a user