Expand the Bug Log

This commit is contained in:
MichailTalReborn 2026-02-10 17:17:20 +01:00
parent 05b6bd6c0e
commit b3c4d9f2cb

View File

@ -59,6 +59,7 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category
- [AI use of Full Heal or Full Restore does not cure Nightmare status](#ai-use-of-full-heal-or-full-restore-does-not-cure-nightmare-status)
- [AI use of Full Heal does not cure confusion status](#ai-use-of-full-heal-does-not-cure-confusion-status)
- [AI use of Full Heal or Full Restore does not cure Attack or Speed drops from burn or paralysis](#ai-use-of-full-heal-or-full-restore-does-not-cure-attack-or-speed-drops-from-Burn-or-Paralysis)
- [AI can use Nightmare on any status condition not only sleep](#ai-can-use-nightmare-on-any-status)
- [AI might use its base reward value as an item](#ai-might-use-its-base-reward-value-as-an-item)
- [Wild Pokémon can always Teleport regardless of level difference](#wild-pok%C3%A9mon-can-always-teleport-regardless-of-level-difference)
- [`RIVAL2` has lower DVs than `RIVAL1`](#rival2-has-lower-dvs-than-rival1)
@ -1480,6 +1481,24 @@ AI_Cautious:
ret
```
### AI can use Nightmare on any status condition
In the check for redundancy all status conditions are treated the same. That means the check is only passed when the player has no status.
**Fix** Edit redundancy check to consider anything except the sleep condition in [engine/battle/ai/redundant.asm](https://github.com/pret/pokecrystal/blob/master/engine/battle/ai/redundant.asm)
```diff
.Nightmare:
ld a, [wBattleMonStatus]
- and a
+ and SLP_MASK
jr z, .Redundant
ld a, [wPlayerSubStatus1]
bit SUBSTATUS_NIGHTMARE, a
ret
```
### AI might use its base reward value as an item
In the `AI_TryItem` routine, an item pointer is set to `wEnemyTrainerItem1` and then increments to `wEnemyTrainerItem2` to see if either of the AI's items are in the `AI_Items` list. However, if the AI has used its first item (or its first one is `ITEM_NONE`) and hasn't used its second item, the item pointer can increment from `wEnemyTrainerItem2` to `wEnemyTrainerBaseReward`. If the value at this address then matches an item in the `AI_Items` list, the AI could mistakenly use it.