From db1e773b1887edbb8de5e514a7836ef2736d0639 Mon Sep 17 00:00:00 2001 From: Vendily Date: Sun, 21 Nov 2021 20:48:54 -0500 Subject: adjusted code to be more efficient with fallthroughs and to take advantage of the percent macro. --- SWSH-Friendship-Endure.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/SWSH-Friendship-Endure.md b/SWSH-Friendship-Endure.md index b373d7e..89a1ea3 100644 --- a/SWSH-Friendship-Endure.md +++ b/SWSH-Friendship-Endure.md @@ -48,20 +48,19 @@ BattleCommand_ApplyDamage: + + ld a, [hl] + cp 255 -+ jr z, .endure_64 -+ cp 220-1 -+ jr nc, .endure_48 -+ cp 180-1 ++ jr z, .endure_high ++ cp 220 ++ jr nc, .endure_mid ++ cp 180 + jr c, .focus_band -+; 12.5% of 256 -+ ld b, 32 -+ jp .friendship_endure_checks -+.endure_64 ; 25% of 256 -+ ld b, 64 -+ jp .friendship_endure_checks -+.endure_48 ; 18.75% of 256 -+ ld b, 48 ++; fallthrough ++ ld b, 12 percent + jp .friendship_endure_checks ++.endure_mid ++ ld b, 18 percent ++ jr .friendship_endure_checks ++.endure_high ++ ld b, 25 percent + +.friendship_endure_checks + call BattleRandom -- cgit v1.2.3