When the AI uses stat-lowering or status-inflicting moves, like Screech or Sleep Powder, it has an additional 25% chance to fail on top of the usual accuracy and evasion modifiers. This is caused by four different clauses in [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm), all of which will need deleting. ## Contents 1. [`BattleCommand_StatDown`](#1-battlecommand_statdown) 2. [`BattleCommand_SleepTarget`](#2-battlecommand_sleeptarget) 3. [`BattleCommand_Poison`](#3-battlecommand_poison) 4. [`BattleCommand_Paralyze`](#4-battlecommand_paralyze) ## 1. `BattleCommand_StatDown` ```diff ; Sharply lower the stat if applicable. ld a, [wLoweredStat] and $f0 - jr z, .ComputerMiss + jr z, .GotAmountToLower dec b - jr nz, .ComputerMiss + jr nz, .GotAmountToLower inc b -.ComputerMiss: -; Computer opponents have a 25% chance of failing. - ldh a, [hBattleTurn] - and a - jr z, .DidntMiss - - ld a, [wLinkMode] - and a - jr nz, .DidntMiss - - ld a, [wInBattleTowerBattle] - and a - jr nz, .DidntMiss - -; Lock-On still always works. - ld a, [wPlayerSubStatus5] - bit SUBSTATUS_LOCK_ON, a - jr nz, .DidntMiss - -; Attacking moves that also lower accuracy are unaffected. - ld a, BATTLE_VARS_MOVE_EFFECT - call GetBattleVar - cp EFFECT_ACCURACY_DOWN_HIT - jr z, .DidntMiss - - call BattleRandom - cp 25 percent + 1 ; 25% chance AI fails - jr c, .Failed -.DidntMiss: +.GotAmountToLower: call CheckSubstituteOpp jr nz, .Failed ... ``` ## 2. `BattleCommand_SleepTarget` ```diff ld hl, DidntAffect1Text - call .CheckAIRandomFail - jr c, .fail ... -.CheckAIRandomFail: - ; Enemy turn - ldh a, [hBattleTurn] - and a - jr z, .dont_fail - - ; Not in link battle - ld a, [wLinkMode] - and a - jr nz, .dont_fail - - ld a, [wInBattleTowerBattle] - and a - jr nz, .dont_fail - - ; Not locked-on by the enemy - ld a, [wPlayerSubStatus5] - bit SUBSTATUS_LOCK_ON, a - jr nz, .dont_fail - - call BattleRandom - cp 25 percent + 1 ; 25% chance AI fails - ret c - -.dont_fail - xor a - ret ``` ## 3. `BattleCommand_Poison` ```diff - ldh a, [hBattleTurn] - and a - jr z, .dont_sample_failure - - ld a, [wLinkMode] - and a - jr nz, .dont_sample_failure - - ld a, [wInBattleTowerBattle] - and a - jr nz, .dont_sample_failure - - ld a, [wPlayerSubStatus5] - bit SUBSTATUS_LOCK_ON, a - jr nz, .dont_sample_failure - - call BattleRandom - cp 25 percent + 1 ; 25% chance AI fails - jr c, .failed - -.dont_sample_failure ... ``` ## 4. `BattleCommand_Paralyze` ```diff .no_item_protection - ldh a, [hBattleTurn] - and a - jr z, .dont_sample_failure - - ld a, [wLinkMode] - and a - jr nz, .dont_sample_failure - - ld a, [wInBattleTowerBattle] - and a - jr nz, .dont_sample_failure - - ld a, [wPlayerSubStatus5] - bit SUBSTATUS_LOCK_ON, a - jr nz, .dont_sample_failure - - call BattleRandom - cp 25 percent + 1 ; 25% chance AI fails - jr c, .failed - -.dont_sample_failure ... ``` That's it! Note that there is no `BattleCommand_Burn` or `BattleCommand_Freeze`.