ref: bc3cc697494d1212b8fed9273d72f0448f24b1d5
parent: d6b00d0cc177b3a94b477735fd165232614a6cee
author: Rangi <[email protected]>
date: Sun Feb 4 16:21:34 EST 2018
Consistent "X percent [+/- Y]" order
--- a/engine/battle/ai/items.asm
+++ b/engine/battle/ai/items.asm
@@ -52,7 +52,7 @@
cp $10
jr nz, .not_10
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jr c, .switch
jp DontSwitch
.not_10
@@ -60,7 +60,7 @@
cp $20
jr nz, .not_20
call Random
- cp -1 + 79 percent
+ cp 79 percent - 1
jr c, .switch
jp DontSwitch
.not_20
@@ -103,7 +103,7 @@
; $30
call Random
- cp -1 + 79 percent
+ cp 79 percent - 1
jp c, DontSwitch
.switch
@@ -123,7 +123,7 @@
cp $10
jr nz, .not_10
call Random
- cp -1 + 20 percent
+ cp 20 percent - 1
jr c, .switch
jp DontSwitch
.not_10
@@ -131,7 +131,7 @@
cp $20
jr nz, .not_20
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jr c, .switch
jp DontSwitch
.not_20
@@ -138,7 +138,7 @@
; $30
call Random
- cp -1 + 20 percent
+ cp 20 percent - 1
jp c, DontSwitch
.switch
@@ -313,7 +313,7 @@
bit ALWAYS_USE_F, a
jp nz, .Use
call Random
- cp -1 + 20 percent
+ cp 20 percent - 1
jp c, .Use
jp .DontUse
@@ -325,7 +325,7 @@
cp 4
jr c, .FailToxicCheck
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jp c, .Use
.FailToxicCheck:
ld a, [wEnemyMonStatus]
@@ -366,7 +366,7 @@
callfar AICheckEnemyQuarterHP
jp nc, .UseHealItem
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jp c, .UseHealItem
jp .DontUse
@@ -374,7 +374,7 @@
callfar AICheckEnemyQuarterHP
jp c, .DontUse
call Random
- cp -1 + 20 percent
+ cp 20 percent - 1
jp c, .DontUse
jr .UseHealItem
@@ -384,7 +384,7 @@
callfar AICheckEnemyQuarterHP
jp nc, .UseHealItem
call Random
- cp -1 + 20 percent
+ cp 20 percent - 1
jp nc, .DontUse
.UseHealItem: ; 38281 (e:4281)
@@ -442,7 +442,7 @@
bit UNKNOWN_USE_F, a
jp z, .Use
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jp c, .Use
.dont_use
@@ -454,7 +454,7 @@
bit UNKNOWN_USE_F, a
jp z, .DontUse
call Random
- cp 1 + 39 percent
+ cp 39 percent + 1
jp c, .Use
jp .DontUse
; 382f9
@@ -516,13 +516,13 @@
bit ALWAYS_USE_F, a
jp nz, .Use
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jp c, .DontUse
ld a, [bc]
bit CONTEXT_USE_F, a
jp nz, .Use
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jp c, .DontUse
jp .Use
.notfirstturnout
@@ -530,7 +530,7 @@
bit ALWAYS_USE_F, a
jp z, .DontUse
call Random
- cp -1 + 20 percent
+ cp 20 percent - 1
jp nc, .DontUse
jp .Use
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -463,13 +463,13 @@
jr z, .player_2
call BattleRandom
- cp 1 + (50 percent)
+ cp 50 percent + 1
jp c, .player_first
jp .enemy_first
.player_2
call BattleRandom
- cp 1 + (50 percent)
+ cp 50 percent + 1
jp c, .enemy_first
jp .player_first
@@ -549,13 +549,13 @@
cp USING_INTERNAL_CLOCK
jr z, .player_2c
call BattleRandom
- cp 1 + (50 percent)
+ cp 50 percent + 1
jp c, .player_first
jp .enemy_first
.player_2c
call BattleRandom
- cp 1 + (50 percent)
+ cp 50 percent + 1
jp c, .enemy_first
.player_first
scf
@@ -791,7 +791,7 @@
call BattleRandom
ld b, a
- cp 1 + (50 percent)
+ cp 50 percent + 1
jr nc, .Stay
push bc
@@ -803,7 +803,7 @@
jr c, .Flee
ld a, b
- cp 1 + (10 percent)
+ cp 10 percent + 1
jr nc, .Stay
ld a, [wTempEnemyMonSpecies]
@@ -6177,7 +6177,7 @@
; 25% chance of getting an item
call BattleRandom
- cp 1 + (75 percent)
+ cp 75 percent + 1
ld a, NO_ITEM
jr c, .UpdateItem
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -532,7 +532,7 @@
; 50% chance of hitting itself
call BattleRandom
- cp 1 + 50 percent
+ cp 50 percent + 1
jr nc, .not_confused
; clear confusion-dependent substatus
@@ -578,7 +578,7 @@
; 50% chance of infatuation
call BattleRandom
- cp 1 + 50 percent
+ cp 50 percent + 1
jr c, .not_infatuated
ld hl, InfatuationText
--- a/engine/events/daycare.asm
+++ b/engine/events/daycare.asm
@@ -665,7 +665,7 @@
cp NIDORAN_F
jr nz, .GotEggSpecies
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
ld a, NIDORAN_F
jr c, .GotEggSpecies
ld a, NIDORAN_M