summaryrefslogtreecommitdiff
path: root/engine/battle/effects.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-11-02 19:57:08 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2021-11-02 19:57:08 -0400
commit58d08bff4386815b83c9260bd831719507acfcec (patch)
tree7fcfd0dbf93b2c4e7253c2f7e445c0c2c22e46b4 /engine/battle/effects.asm
parentfc899e1906a9a245e94dafa7c0da2ef1697b7335 (diff)
Identify some percentage constant values
Diffstat (limited to 'engine/battle/effects.asm')
-rw-r--r--engine/battle/effects.asm14
1 files changed, 7 insertions, 7 deletions
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index 91bb9ee0..c68d6731 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -98,10 +98,10 @@ PoisonEffect:
jr z, .noEffect
ld a, [de]
cp POISON_SIDE_EFFECT1
- ld b, $34 ; ~20% chance of poisoning
+ ld b, 20 percent + 1 ; chance of poisoning
jr z, .sideEffectTest
cp POISON_SIDE_EFFECT2
- ld b, $67 ; ~40% chance of poisoning
+ ld b, 40 percent + 1 ; chance of poisoning
jr z, .sideEffectTest
push hl
push de
@@ -548,7 +548,7 @@ StatModifierDownEffect:
cp LINK_STATE_BATTLING
jr z, .statModifierDownEffect
call BattleRandom
- cp $40 ; 1/4 chance to miss by in regular battle
+ cp 25 percent + 1 ; chance to miss by in regular battle
jp c, MoveMissed
.statModifierDownEffect
call CheckTargetSubstitute ; can't hit through substitute
@@ -557,7 +557,7 @@ StatModifierDownEffect:
cp ATTACK_DOWN_SIDE_EFFECT
jr c, .nonSideEffect
call BattleRandom
- cp $55 ; 85/256 chance for side effects
+ cp 33 percent + 1 ; chance for side effects
jp nc, CantLowerAnymore
ld a, [de]
sub ATTACK_DOWN_SIDE_EFFECT ; map each stat to 0-3
@@ -979,9 +979,9 @@ FlinchSideEffect:
.flinchSideEffect
ld a, [de]
cp FLINCH_SIDE_EFFECT1
- ld b, $1a ; ~10% chance of flinch
+ ld b, 10 percent + 1 ; chance of flinch (FLINCH_SIDE_EFFECT1)
jr z, .gotEffectChance
- ld b, $4d ; ~30% chance of flinch
+ ld b, 30 percent + 1 ; chance of flinch otherwise
.gotEffectChance
call BattleRandom
cp b
@@ -1111,7 +1111,7 @@ RecoilEffect:
ConfusionSideEffect:
call BattleRandom
- cp $19 ; ~10% chance
+ cp 10 percent ; chance of confusion
ret nc
jr ConfusionSideEffectSuccess