diff --git a/Site/templates/index.html b/Site/templates/index.html index 8538e94..c2185a4 100644 --- a/Site/templates/index.html +++ b/Site/templates/index.html @@ -802,17 +802,17 @@ // Update for evolution targets entry.querySelectorAll('.target-card').forEach(card => { if (card.dataset.pfic === pfic) { - updateTargetDisplay(card, entry, isCaught); + updateTargetDisplay(card, entry, isCaught, pfic); } }); // Update for direct matches if (entry.dataset.pfic === pfic) { - updateEntryDisplay(entry, isCaught); + updateEntryDisplay(entry, isCaught, pfic); } }); } - function updateEntryDisplay(entry, isCaught) { + function updateEntryDisplay(entry, isCaught, pfic) { const catchCount = entry.querySelector('.catch-count'); const targetCards = entry.querySelectorAll('.target-card'); let totalNeeded = 0; @@ -836,7 +836,7 @@ } }); - if (isCaught) { + if (isCaught && pfic == entry.dataset.pfic) { initialCount -= 1; } @@ -862,10 +862,10 @@ updateGameTotal(entry, isCaught); } - function updateTargetDisplay(card, parentEntry, isCaught) { + function updateTargetDisplay(card, parentEntry, isCaught, pfic) { const targetImage = card.querySelector('.target-image'); targetImage.classList.toggle('grayscale', isCaught); - updateEntryDisplay(parentEntry, isCaught); + updateEntryDisplay(parentEntry, isCaught, pfic); } function updateGameTotal(entry, isCaught) {