From 72ffd2ee476e68ee9fc6b80a525bdb6a57af7aeb Mon Sep 17 00:00:00 2001 From: Waleed Hassan Date: Fri, 6 Oct 2023 22:04:04 +0300 Subject: [PATCH] UI: Fix Loaded Dice & Skill Link --- src/js/shared_controls.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/js/shared_controls.js b/src/js/shared_controls.js index 6e800621f..ad1afe604 100644 --- a/src/js/shared_controls.js +++ b/src/js/shared_controls.js @@ -248,7 +248,10 @@ $(".percent-hp").keyup(function () { }); $(".ability").bind("keyup change", function () { - $(this).closest(".poke-info").find(".move-hits").val($(this).val() === 'Skill Link' ? 5 : 3); + var moveHits = + $(this).val() === 'Skill Link' ? 5 : + $(this).closest(".poke-info").find(".item").val() === 'Loaded Dice' ? 4 : 3; + $(this).closest(".poke-info").find(".move-hits").val(moveHits); var ability = $(this).closest(".poke-info").find(".ability").val(); @@ -523,7 +526,10 @@ $(".item").change(function () { } else { $metronomeControl.hide(); } - $(this).closest(".poke-info").find(".move-hits").val($(this).val() === 'Loaded Dice' ? 4 : 3); + var moveHits = + $(this).closest(".poke-info").find(".ability").val() === 'Skill Link' ? 5 : + itemName === 'Loaded Dice' ? 4 : 3; + $(this).closest(".poke-info").find(".move-hits").val(moveHits); autosetQP($(this).closest(".poke-info")); });