summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Remove-the-25%-failure-chance-for-AI-status-moves.md104
1 files changed, 53 insertions, 51 deletions
diff --git a/Remove-the-25%-failure-chance-for-AI-status-moves.md b/Remove-the-25%-failure-chance-for-AI-status-moves.md
index f6a74cf..5be6719 100644
--- a/Remove-the-25%-failure-chance-for-AI-status-moves.md
+++ b/Remove-the-25%-failure-chance-for-AI-status-moves.md
@@ -1,4 +1,54 @@
-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 a number of different clauses in [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm), all of which will need deleting.
+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.
+
+In `BattleCommand_StatDown`:
+
+```diff
+; Sharply lower the stat if applicable.
+ ld a, [LoweredStat]
+ 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.
+- ld a, [hBattleTurn]
+- and a
+- jr z, .DidntMiss
+-
+- ld a, [wLinkMode]
+- and a
+- jr nz, .DidntMiss
+-
+- ld a, [InBattleTowerBattle]
+- and a
+- jr nz, .DidntMiss
+-
+-; Lock-On still always works.
+- ld a, [PlayerSubStatus5]
+- 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
+
+ ...
+```
In `BattleCommand_SleepTarget`:
@@ -65,56 +115,6 @@ In `BattleCommand_Poison`:
...
```
-In `BattleCommand_StatDown`:
-
-```diff
-; Sharply lower the stat if applicable.
- ld a, [LoweredStat]
- 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.
-- ld a, [hBattleTurn]
-- and a
-- jr z, .DidntMiss
--
-- ld a, [wLinkMode]
-- and a
-- jr nz, .DidntMiss
--
-- ld a, [InBattleTowerBattle]
-- and a
-- jr nz, .DidntMiss
--
--; Lock-On still always works.
-- ld a, [PlayerSubStatus5]
-- 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
-
- ...
-```
-
In `BattleCommand_Paralyze`:
```diff
@@ -142,3 +142,5 @@ In `BattleCommand_Paralyze`:
-.dont_sample_failure
...
```
+
+Note that there is no `BattleCommand_Burn` or `BattleCommand_Freeze`.