summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendily <vendily1001@gmail.com>2021-11-21 20:48:54 -0500
committerVendily <vendily1001@gmail.com>2021-11-21 20:48:54 -0500
commitdb1e773b1887edbb8de5e514a7836ef2736d0639 (patch)
tree28e95c0445951adece718f70d9cf3640e2957310
parentc19814ea29cff4cd5d56d6f2344d60f9d0ef365e (diff)
adjusted code to be more efficient with fallthroughs and to take advantage of the percent macro.
-rw-r--r--SWSH-Friendship-Endure.md23
1 files 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