summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorSnorlaxMonster <snorlaxmonster+github@gmail.com>2021-06-14 21:47:19 +1000
committerSnorlaxMonster <snorlaxmonster+github@gmail.com>2021-06-14 21:47:19 +1000
commit319c29c751ea23bed8d57587500e73bb2a599656 (patch)
tree4a0dfc4b295fc1d1632b516d0020e606f394d3ae /engine
parent9c93fb0b7559e9d657a91d2b508ecebe58eee544 (diff)
Correct comments on SwitchAndTeleportEffect
The comments in the SwitchAndTeleportEffect section incorrectly stated that the random number was generated in the half-open interval [0, playerLevel + enemyLevel), instead of the closed interval [0, playerLevel + enemyLevel].
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/effects.asm4
1 files changed, 2 insertions, 2 deletions
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index 067c096e..d86a4cbf 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -819,14 +819,14 @@ SwitchAndTeleportEffect:
jr nc, .playerMoveWasSuccessful ; if so, teleport will always succeed
add b
ld c, a
- inc c ; c = sum of player level and enemy level
+ inc c ; c = playerLevel + enemyLevel + 1
.rejectionSampleLoop1
call BattleRandom
cp c ; get a random number between 0 and c
jr nc, .rejectionSampleLoop1
srl b
srl b ; b = enemyLevel / 4
- cp b ; is rand[0, playerLevel + enemyLevel) >= (enemyLevel / 4)?
+ cp b ; is rand[0, playerLevel + enemyLevel] >= (enemyLevel / 4)?
jr nc, .playerMoveWasSuccessful ; if so, allow teleporting
ld c, 50
call DelayFrames