Identify some percentage constant values

This commit is contained in:
Rangi 2021-11-02 19:57:08 -04:00
parent fc899e1906
commit 58d08bff43
3 changed files with 22 additions and 22 deletions

View file

@ -653,7 +653,7 @@ INCLUDE "data/battle_anims/special_effects.asm"
DoBallTossSpecialEffects: DoBallTossSpecialEffects:
ld a, [wcf91] ld a, [wcf91]
cp 3 ; is it a Master Ball or Ultra Ball? cp ULTRA_BALL + 1 ; is it a Master Ball or Ultra Ball?
jr nc, .skipFlashingEffect jr nc, .skipFlashingEffect
.flashingEffect ; do a flashing effect if it's Master Ball or Ultra Ball .flashingEffect ; do a flashing effect if it's Master Ball or Ultra Ball
ldh a, [rOBP0] ldh a, [rOBP0]
@ -668,7 +668,7 @@ DoBallTossSpecialEffects:
call PlaySound call PlaySound
.skipPlayingSound .skipPlayingSound
ld a, [wIsInBattle] ld a, [wIsInBattle]
cp 02 ; is it a trainer battle? cp 2 ; is it a trainer battle?
jr z, .isTrainerBattle jr z, .isTrainerBattle
ld a, [wd11e] ld a, [wd11e]
cp $10 ; is the enemy pokemon the Ghost Marowak? cp $10 ; is the enemy pokemon the Ghost Marowak?

View file

@ -402,12 +402,12 @@ MainInBattleLoop:
cp USING_INTERNAL_CLOCK cp USING_INTERNAL_CLOCK
jr z, .invertOutcome jr z, .invertOutcome
call BattleRandom call BattleRandom
cp $80 cp 50 percent + 1
jr c, .playerMovesFirst jr c, .playerMovesFirst
jr .enemyMovesFirst jr .enemyMovesFirst
.invertOutcome .invertOutcome
call BattleRandom call BattleRandom
cp $80 cp 50 percent + 1
jr c, .enemyMovesFirst jr c, .enemyMovesFirst
jr .playerMovesFirst jr .playerMovesFirst
.enemyMovesFirst .enemyMovesFirst
@ -1319,7 +1319,7 @@ EnemySendOutFirstMon:
ld [wWhichPokemon], a ld [wWhichPokemon], a
jr .next3 jr .next3
.next .next
ld b, $FF ld b, $ff
.next2 .next2
inc b inc b
ld a, [wEnemyMonPartyPos] ld a, [wEnemyMonPartyPos]
@ -2962,19 +2962,19 @@ SelectEnemyMove:
.chooseRandomMove .chooseRandomMove
push hl push hl
call BattleRandom call BattleRandom
ld b, $1 ld b, 1 ; 25% chance to select move 1
cp $3f ; select move 1, [0,3e] (63/256 chance) cp 25 percent
jr c, .moveChosen jr c, .moveChosen
inc hl inc hl
inc b inc b ; 25% chance to select move 2
cp $7f ; select move 2, [3f,7e] (64/256 chance) cp 50 percent
jr c, .moveChosen jr c, .moveChosen
inc hl inc hl
inc b inc b ; 25% chance to select move 3
cp $be ; select move 3, [7f,bd] (63/256 chance) cp 75 percent - 1
jr c, .moveChosen jr c, .moveChosen
inc hl inc hl
inc b ; select move 4, [be,ff] (66/256 chance) inc b ; 25% chance to select move 4
.moveChosen .moveChosen
ld a, b ld a, b
dec a dec a
@ -3398,7 +3398,7 @@ CheckPlayerStatusConditions:
ld a, CONF_ANIM - 1 ld a, CONF_ANIM - 1
call PlayMoveAnimation call PlayMoveAnimation
call BattleRandom call BattleRandom
cp $80 ; 50% chance to hurt itself cp 50 percent + 1 ; chance to hurt itself
jr c, .TriedToUseDisabledMoveCheck jr c, .TriedToUseDisabledMoveCheck
ld hl, wPlayerBattleStatus1 ld hl, wPlayerBattleStatus1
ld a, [hl] ld a, [hl]
@ -5932,7 +5932,7 @@ CheckEnemyStatusConditions:
bit PAR, [hl] bit PAR, [hl]
jr z, .checkIfUsingBide jr z, .checkIfUsingBide
call BattleRandom call BattleRandom
cp $3f ; 25% to be fully paralysed cp 25 percent ; chance to be fully paralysed
jr nc, .checkIfUsingBide jr nc, .checkIfUsingBide
ld hl, FullyParalyzedText ld hl, FullyParalyzedText
call PrintText call PrintText

View file

@ -98,10 +98,10 @@ PoisonEffect:
jr z, .noEffect jr z, .noEffect
ld a, [de] ld a, [de]
cp POISON_SIDE_EFFECT1 cp POISON_SIDE_EFFECT1
ld b, $34 ; ~20% chance of poisoning ld b, 20 percent + 1 ; chance of poisoning
jr z, .sideEffectTest jr z, .sideEffectTest
cp POISON_SIDE_EFFECT2 cp POISON_SIDE_EFFECT2
ld b, $67 ; ~40% chance of poisoning ld b, 40 percent + 1 ; chance of poisoning
jr z, .sideEffectTest jr z, .sideEffectTest
push hl push hl
push de push de
@ -548,7 +548,7 @@ StatModifierDownEffect:
cp LINK_STATE_BATTLING cp LINK_STATE_BATTLING
jr z, .statModifierDownEffect jr z, .statModifierDownEffect
call BattleRandom 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 jp c, MoveMissed
.statModifierDownEffect .statModifierDownEffect
call CheckTargetSubstitute ; can't hit through substitute call CheckTargetSubstitute ; can't hit through substitute
@ -557,7 +557,7 @@ StatModifierDownEffect:
cp ATTACK_DOWN_SIDE_EFFECT cp ATTACK_DOWN_SIDE_EFFECT
jr c, .nonSideEffect jr c, .nonSideEffect
call BattleRandom call BattleRandom
cp $55 ; 85/256 chance for side effects cp 33 percent + 1 ; chance for side effects
jp nc, CantLowerAnymore jp nc, CantLowerAnymore
ld a, [de] ld a, [de]
sub ATTACK_DOWN_SIDE_EFFECT ; map each stat to 0-3 sub ATTACK_DOWN_SIDE_EFFECT ; map each stat to 0-3
@ -979,9 +979,9 @@ FlinchSideEffect:
.flinchSideEffect .flinchSideEffect
ld a, [de] ld a, [de]
cp FLINCH_SIDE_EFFECT1 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 jr z, .gotEffectChance
ld b, $4d ; ~30% chance of flinch ld b, 30 percent + 1 ; chance of flinch otherwise
.gotEffectChance .gotEffectChance
call BattleRandom call BattleRandom
cp b cp b
@ -1111,7 +1111,7 @@ RecoilEffect:
ConfusionSideEffect: ConfusionSideEffect:
call BattleRandom call BattleRandom
cp $19 ; ~10% chance cp 10 percent ; chance of confusion
ret nc ret nc
jr ConfusionSideEffectSuccess jr ConfusionSideEffectSuccess