diff options
author | dannye <33dannye@gmail.com> | 2021-02-21 11:50:23 -0600 |
---|---|---|
committer | dannye <33dannye@gmail.com> | 2021-02-21 11:50:23 -0600 |
commit | 780931886d20291747e0553904d321cbdf8b60ad (patch) | |
tree | da37dcb01ee818dcf8ff85aab512b29d6ecb2b84 | |
parent | 205fd1ac81c2d1dcec010c478979bd6159edc72d (diff) | |
parent | 5c9c7bf3625cfa4a4bf68ef27b5671cba5fc5d1d (diff) |
Merge branch 'master' of https://github.com/pret/pokered
-rw-r--r-- | engine/battle/effects.asm | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index 7573ce8d..3762caea 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -226,17 +226,18 @@ FreezeBurnParalyzeEffect: ld a, [wUnknownSerialFlag_d499] and a ld a, FREEZE_SIDE_EFFECT - ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance - jr z, .next1 - ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance - jr .next1 + ld b, 30 percent + 1 + jr z, .regular_effectiveness + ld b, 10 percent + 1 + jr .regular_effectiveness .asm_3f2c7 - cp PARALYZE_SIDE_EFFECT1 + 1 ; 10% status effects are 04, 05, 06 so 07 will set carry for those - ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance - jr c, .next1 ; branch ahead if this is a 10% chance effect.. - ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance - sub $1e ; subtract $1E to map to equivalent 10% chance effects -.next1 + cp PARALYZE_SIDE_EFFECT1 + 1 + ld b, 10 percent + 1 + jr c, .regular_effectiveness +; extra effectiveness + ld b, 30 percent + 1 + sub BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 ; treat extra effective as regular from now on +.regular_effectiveness push af call BattleRandom ; get random 8bit value for probability test cp b @@ -288,17 +289,18 @@ FreezeBurnParalyzeEffect: ld a, [wUnknownSerialFlag_d499] and a ld a, FREEZE_SIDE_EFFECT - ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance - jr z, .next2 - ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance - jr .next2 + ld b, 30 percent + 1 + jr z, .regular_effectiveness2 + ld b, 10 percent + 1 + jr .regular_effectiveness2 .asm_3f341 cp PARALYZE_SIDE_EFFECT1 + 1 - ld b, $1a - jr c, .next2 - ld b, $4d - sub $1e -.next2 + ld b, 10 percent + 1 + jr c, .regular_effectiveness2 +; extra effectiveness + ld b, 30 percent + 1 + sub BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 ; treat extra effective as regular from now on +.regular_effectiveness2 push af call BattleRandom cp b |