From 23b9707059d4fd4e2e2b37646b31e7eb997697c6 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 31 Oct 2024 13:21:31 +0000 Subject: [PATCH] 0 Fix baby pokemon showing up in the catch list instead of only in the breed section --- DBEditor/plan2.py | 9 +- Site/templates/index.html | 177 ++++++++++------- efficiency_plan.json | 400 +++++++++++++++----------------------- 3 files changed, 270 insertions(+), 316 deletions(-) diff --git a/DBEditor/plan2.py b/DBEditor/plan2.py index aef5190..2840ab3 100644 --- a/DBEditor/plan2.py +++ b/DBEditor/plan2.py @@ -263,13 +263,18 @@ class EfficiencyOriginDexPlanner: if not self.is_final_evolution(to_pfic, evolution_map) or (self.is_final_evolution(to_pfic, evolution_map) and not self.is_in_to_evolve(to_pfic, to_evolve)): to_evolve[from_pfic].append(to_pfic) else: - to_catch[encounter['pfic']] += -1 - planned_evolutions[base_form] += -1 + if encounter['pfic'] in to_catch: + to_catch[encounter['pfic']] += -1 + if base_form in planned_evolutions: + planned_evolutions[base_form] += -1 if from_pfic in baby_forms and from_pfic not in encounter_data[game['id']]: if to_pfic not in to_breed or from_pfic not in to_breed[to_pfic]: to_breed[to_pfic].append(from_pfic) + if from_pfic in to_catch: + del to_catch[from_pfic] + caught_pokemon.update(pfic for chain in evolution_chains for pfic in chain) needed_pokemon.difference_update(pfic for chain in evolution_chains for pfic in chain) diff --git a/Site/templates/index.html b/Site/templates/index.html index 4903a6e..8538e94 100644 --- a/Site/templates/index.html +++ b/Site/templates/index.html @@ -492,6 +492,32 @@ .pokemon-entry.hidden { display: none; } + + .game-sections { + display: flex; + flex-direction: column; + gap: 20px; + } + + .completed-section { + border-top: 2px solid #eee; + margin-top: 20px; + padding-top: 20px; + } + + .section-title { + color: #4CAF50; + margin: 0 0 15px 0; + font-size: 1.2em; + } + + .completed-pokemon { + opacity: 0.7; + } + + .completed-pokemon .pokemon-entry { + background-color: #f9f9f9; + } @@ -575,72 +601,81 @@ placeholder="Search Pokémon..." oninput="filterGamePokemon(this)"> - {% for pokemon in game.pokemon %} -
-
0) or (pokemon.breed_for|length > 0) %}onclick="togglePokemonDetails(this)"{% endif %}> - {{ pokemon.name }} -
-

- {{ pokemon.name }}{% if pokemon.form_name %} ({{ pokemon.form_name }}){% endif %} -

-
-
- Catch count - {{ pokemon.catch_count }} -
- {% if (pokemon.evolve_to|length > 0) or (pokemon.breed_for|length > 0) %} - - {% endif %} -
-
-
-
- {% if pokemon.evolve_to or pokemon.breed_for %} -
- {% if pokemon.evolve_to %} - {% for evolution in pokemon.evolve_to %} -
-
- {{ evolution.name }} - {% if evolution.form_name %}({{ evolution.form_name }}){% endif %} -
- {{ evolution.name }} +
+ {% for pokemon in game.pokemon %} +
+
0) or (pokemon.breed_for|length > 0) %}onclick="togglePokemonDetails(this)"{% endif %}> + {{ pokemon.name }} - {{ evolution.method }} - Need: {{ evolution.count }} +
+

+ {{ pokemon.name }}{% if pokemon.form_name %} ({{ pokemon.form_name }}){% endif %} +

+
+
+ Catch count + {{ pokemon.catch_count }} +
+ {% if (pokemon.evolve_to|length > 0) or (pokemon.breed_for|length > 0) %} + + {% endif %} +
+
- {% endfor %} - {% endif %} - - {% if pokemon.breed_for %} - {% for breeding in pokemon.breed_for %} -
-
- {{ breeding.name }} - {% if breeding.form_name %}({{ breeding.form_name }}){% endif %} +
+ {% if pokemon.evolve_to or pokemon.breed_for %} +
+ {% if pokemon.evolve_to %} + {% for evolution in pokemon.evolve_to %} +
+
+ {{ evolution.name }} + {% if evolution.form_name %}({{ evolution.form_name }}){% endif %} +
+ {{ evolution.name }} + {{ evolution.method }} + Need: {{ evolution.count }} +
+ {% endfor %} + {% endif %} + + {% if pokemon.breed_for %} + {% for breeding in pokemon.breed_for %} +
+
+ {{ breeding.name }} + {% if breeding.form_name %}({{ breeding.form_name }}){% endif %} +
+ {{ breeding.name }} + Breed + Need: {{ breeding.count }} +
+ {% endfor %} + {% endif %}
- {{ breeding.name }} - Breed - Need: {{ breeding.count }} + {% endif %}
- {% endfor %} - {% endif %} -
- {% endif %} +
+ {% endfor %} +
+ +
+

Completed

+
- {% endfor %}
{% endfor %} @@ -802,18 +837,28 @@ }); if (isCaught) { - initialCount = -1; + initialCount -= 1; } - - const pokemonImage = entry.querySelector('.pokemon-thumbnail'); - pokemonImage.classList.toggle('grayscale', isCaught); - + totalNeeded = initialCount + breedCount + evolveCount; // Update the catch count display catchCount.textContent = Math.max(0, totalNeeded); + + const pokemonImage = entry.querySelector('.pokemon-thumbnail'); + pokemonImage.classList.toggle('grayscale', totalNeeded == 0); + + // Move to completed section if count is 0 + const gameContent = entry.closest('.game-content'); + const completedSection = gameContent.querySelector('.completed-pokemon'); + const activeSection = gameContent.querySelector('.active-section'); + + if (parseInt(catchCount.textContent) === 0) { + completedSection.appendChild(entry); + } else if (entry.parentElement === completedSection) { + activeSection.appendChild(entry); + } - // Update game total if count changed updateGameTotal(entry, isCaught); } diff --git a/efficiency_plan.json b/efficiency_plan.json index f638b42..c5449b0 100644 --- a/efficiency_plan.json +++ b/efficiency_plan.json @@ -318,6 +318,12 @@ "form_name": "", "catch_count": 6, "evolve_to": [ + { + "pfic": "0044-01-000-2", + "name": "Gloom", + "form_name": "Female", + "count": 1 + }, { "pfic": "0044-01-000-1", "name": "Gloom", @@ -325,8 +331,8 @@ "count": 1 }, { - "pfic": "0044-01-000-2", - "name": "Gloom", + "pfic": "0045-01-000-2", + "name": "Vileplume", "form_name": "Female", "count": 1 }, @@ -341,12 +347,6 @@ "name": "Vileplume", "form_name": "Male", "count": 1 - }, - { - "pfic": "0045-01-000-2", - "name": "Vileplume", - "form_name": "Female", - "count": 1 } ], "breed_for": [] @@ -768,15 +768,15 @@ "catch_count": 3, "evolve_to": [ { - "pfic": "0097-01-000-1", + "pfic": "0097-01-000-2", "name": "Hypno", - "form_name": "Male", + "form_name": "Female", "count": 1 }, { - "pfic": "0097-01-000-2", + "pfic": "0097-01-000-1", "name": "Hypno", - "form_name": "Female", + "form_name": "Male", "count": 1 } ], @@ -1150,14 +1150,14 @@ "count": 1 }, { - "pfic": "0136-01-000-0", - "name": "Flareon", + "pfic": "0134-01-000-0", + "name": "Vaporeon", "form_name": "", "count": 1 }, { - "pfic": "0196-02-000-0", - "name": "Espeon", + "pfic": "0136-01-000-0", + "name": "Flareon", "form_name": "", "count": 1 }, @@ -1168,8 +1168,8 @@ "count": 1 }, { - "pfic": "0134-01-000-0", - "name": "Vaporeon", + "pfic": "0196-02-000-0", + "name": "Espeon", "form_name": "", "count": 1 } @@ -1395,38 +1395,6 @@ ], "breed_for": [] }, - { - "pfic": "0172-02-000-0", - "name": "Pichu", - "form_name": "", - "catch_count": -1, - "evolve_to": [], - "breed_for": [] - }, - { - "pfic": "0173-02-000-0", - "name": "Cleffa", - "form_name": "", - "catch_count": 0, - "evolve_to": [], - "breed_for": [] - }, - { - "pfic": "0174-02-000-0", - "name": "Igglybuff", - "form_name": "", - "catch_count": 0, - "evolve_to": [], - "breed_for": [] - }, - { - "pfic": "0175-02-000-0", - "name": "Togepi", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, { "pfic": "0177-02-000-0", "name": "Natu", @@ -2066,38 +2034,6 @@ "evolve_to": [], "breed_for": [] }, - { - "pfic": "0236-02-000-0", - "name": "Tyrogue", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, - { - "pfic": "0238-02-000-0", - "name": "Smoochum", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, - { - "pfic": "0239-02-000-0", - "name": "Elekid", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, - { - "pfic": "0240-02-000-0", - "name": "Magby", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, { "pfic": "0241-02-000-0", "name": "Miltank", @@ -2410,29 +2346,29 @@ "game_name": "Black 2", "pokemon": [ { - "pfic": "0190-02-000-2", - "name": "Aipom", - "form_name": "Female", + "pfic": "0221-02-000-1", + "name": "Piloswine", + "form_name": "Male", "catch_count": 1, "evolve_to": [ { - "pfic": "0424-04-000-2", - "name": "Ambipom", - "form_name": "Female", + "pfic": "0473-04-000-1", + "name": "Mamoswine", + "form_name": "Male", "count": 1 } ], "breed_for": [] }, { - "pfic": "0221-02-000-1", - "name": "Piloswine", + "pfic": "0190-02-000-1", + "name": "Aipom", "form_name": "Male", "catch_count": 1, "evolve_to": [ { - "pfic": "0473-04-000-1", - "name": "Mamoswine", + "pfic": "0424-04-000-1", + "name": "Ambipom", "form_name": "Male", "count": 1 } @@ -2440,24 +2376,24 @@ "breed_for": [] }, { - "pfic": "0198-02-000-2", - "name": "Murkrow", + "pfic": "0221-02-000-2", + "name": "Piloswine", "form_name": "Female", "catch_count": 1, "evolve_to": [ { - "pfic": "0430-04-000-0", - "name": "Honchkrow", - "form_name": "", + "pfic": "0473-04-000-2", + "name": "Mamoswine", + "form_name": "Female", "count": 1 } ], "breed_for": [] }, { - "pfic": "0133-01-000-2", + "pfic": "0133-01-000-1", "name": "Eevee", - "form_name": "Female", + "form_name": "Male", "catch_count": 2, "evolve_to": [ { @@ -2476,29 +2412,29 @@ "breed_for": [] }, { - "pfic": "0221-02-000-2", - "name": "Piloswine", - "form_name": "Female", + "pfic": "0082-01-000-0", + "name": "Magneton", + "form_name": "", "catch_count": 1, "evolve_to": [ { - "pfic": "0473-04-000-2", - "name": "Mamoswine", - "form_name": "Female", + "pfic": "0462-04-000-0", + "name": "Magnezone", + "form_name": "", "count": 1 } ], "breed_for": [] }, { - "pfic": "0108-01-000-0", - "name": "Lickitung", - "form_name": "", + "pfic": "0207-02-000-1", + "name": "Gligar", + "form_name": "Male", "catch_count": 1, "evolve_to": [ { - "pfic": "0463-04-000-0", - "name": "Lickilicky", + "pfic": "0472-04-000-0", + "name": "Gliscor", "form_name": "", "count": 1 } @@ -2506,35 +2442,50 @@ "breed_for": [] }, { - "pfic": "0215-02-000-2", - "name": "Sneasel", - "form_name": "Female", + "pfic": "0198-02-000-1", + "name": "Murkrow", + "form_name": "Male", "catch_count": 1, "evolve_to": [ { - "pfic": "0461-04-000-2", - "name": "Weavile", - "form_name": "Female", + "pfic": "0430-04-000-0", + "name": "Honchkrow", + "form_name": "", "count": 1 } ], "breed_for": [] }, { - "pfic": "0082-01-000-0", - "name": "Magneton", + "pfic": "0108-01-000-0", + "name": "Lickitung", "form_name": "", "catch_count": 1, "evolve_to": [ { - "pfic": "0462-04-000-0", - "name": "Magnezone", + "pfic": "0463-04-000-0", + "name": "Lickilicky", "form_name": "", "count": 1 } ], "breed_for": [] }, + { + "pfic": "0215-02-000-1", + "name": "Sneasel", + "form_name": "Male", + "catch_count": 1, + "evolve_to": [ + { + "pfic": "0461-04-000-1", + "name": "Weavile", + "form_name": "Male", + "count": 1 + } + ], + "breed_for": [] + }, { "pfic": "0193-02-000-0", "name": "Yanma", @@ -2551,30 +2502,30 @@ "breed_for": [] }, { - "pfic": "0207-02-000-2", - "name": "Gligar", + "pfic": "0190-02-000-2", + "name": "Aipom", "form_name": "Female", "catch_count": 1, "evolve_to": [ { - "pfic": "0472-04-000-0", - "name": "Gliscor", - "form_name": "", + "pfic": "0424-04-000-2", + "name": "Ambipom", + "form_name": "Female", "count": 1 } ], "breed_for": [] }, { - "pfic": "0190-02-000-1", - "name": "Aipom", - "form_name": "Male", + "pfic": "0215-02-000-2", + "name": "Sneasel", + "form_name": "Female", "catch_count": 1, "evolve_to": [ { - "pfic": "0424-04-000-1", - "name": "Ambipom", - "form_name": "Male", + "pfic": "0461-04-000-2", + "name": "Weavile", + "form_name": "Female", "count": 1 } ], @@ -2586,31 +2537,16 @@ "form_name": "", "catch_count": 2, "evolve_to": [ - { - "pfic": "0465-04-000-2", - "name": "Tangrowth", - "form_name": "Female", - "count": 1 - }, { "pfic": "0465-04-000-1", "name": "Tangrowth", "form_name": "Male", "count": 1 - } - ], - "breed_for": [] - }, - { - "pfic": "0215-02-000-1", - "name": "Sneasel", - "form_name": "Male", - "catch_count": 1, - "evolve_to": [ + }, { - "pfic": "0461-04-000-1", - "name": "Weavile", - "form_name": "Male", + "pfic": "0465-04-000-2", + "name": "Tangrowth", + "form_name": "Female", "count": 1 } ], @@ -3272,14 +3208,14 @@ "catch_count": 3, "evolve_to": [ { - "pfic": "0367-03-000-0", - "name": "Huntail", + "pfic": "0368-03-000-0", + "name": "Gorebyss", "form_name": "", "count": 1 }, { - "pfic": "0368-03-000-0", - "name": "Gorebyss", + "pfic": "0367-03-000-0", + "name": "Huntail", "form_name": "", "count": 1 } @@ -3414,14 +3350,6 @@ ], "breed_for": [] }, - { - "pfic": "0406-04-000-0", - "name": "Budew", - "form_name": "", - "catch_count": -1, - "evolve_to": [], - "breed_for": [] - }, { "pfic": "0408-04-000-0", "name": "Cranidos", @@ -3655,14 +3583,6 @@ "evolve_to": [], "breed_for": [] }, - { - "pfic": "0447-04-000-0", - "name": "Riolu", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, { "pfic": "0449-04-000-2", "name": "Hippopotas", @@ -4967,15 +4887,15 @@ "game_name": "Platinum", "pokemon": [ { - "pfic": "0112-01-000-2", - "name": "Rhydon", - "form_name": "Female", + "pfic": "0125-01-000-0", + "name": "Electabuzz", + "form_name": "", "catch_count": 1, "evolve_to": [ { - "pfic": "0464-04-000-2", - "name": "Rhyperior", - "form_name": "Female", + "pfic": "0466-04-000-0", + "name": "Electivire", + "form_name": "", "count": 1 } ], @@ -4997,15 +4917,15 @@ "breed_for": [] }, { - "pfic": "0125-01-000-0", - "name": "Electabuzz", - "form_name": "", + "pfic": "0112-01-000-2", + "name": "Rhydon", + "form_name": "Female", "catch_count": 1, "evolve_to": [ { - "pfic": "0466-04-000-0", - "name": "Electivire", - "form_name": "", + "pfic": "0464-04-000-2", + "name": "Rhyperior", + "form_name": "Female", "count": 1 } ], @@ -5534,14 +5454,6 @@ ], "breed_for": [] }, - { - "pfic": "0433-04-000-0", - "name": "Chingling", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, { "pfic": "0439-04-000-0", "name": "Mime Jr.", @@ -5612,14 +5524,6 @@ "evolve_to": [], "breed_for": [] }, - { - "pfic": "0489-04-000-0", - "name": "Phione", - "form_name": "", - "catch_count": 1, - "evolve_to": [], - "breed_for": [] - }, { "pfic": "0491-04-000-0", "name": "Darkrai", @@ -6073,15 +5977,15 @@ "catch_count": 3, "evolve_to": [ { - "pfic": "0668-06-000-2", + "pfic": "0668-06-000-1", "name": "Pyroar", - "form_name": "Female", + "form_name": "Male", "count": 1 }, { - "pfic": "0668-06-000-1", + "pfic": "0668-06-000-2", "name": "Pyroar", - "form_name": "Male", + "form_name": "Female", "count": 1 } ], @@ -7448,6 +7352,27 @@ { "game_name": "Sword", "pokemon": [ + { + "pfic": "0550-05-001-0", + "name": "Basculin", + "form_name": "Red-Striped Form", + "catch_count": 2, + "evolve_to": [ + { + "pfic": "0902-08-000-1", + "name": "Basculegion", + "form_name": "Male", + "count": 1 + }, + { + "pfic": "0902-08-000-2", + "name": "Basculegion", + "form_name": "Female", + "count": 1 + } + ], + "breed_for": [] + }, { "pfic": "0439-04-000-0", "name": "Mime Jr.", @@ -7484,27 +7409,6 @@ ], "breed_for": [] }, - { - "pfic": "0550-05-001-0", - "name": "Basculin", - "form_name": "Red-Striped Form", - "catch_count": 2, - "evolve_to": [ - { - "pfic": "0902-08-000-1", - "name": "Basculegion", - "form_name": "Male", - "count": 1 - }, - { - "pfic": "0902-08-000-2", - "name": "Basculegion", - "form_name": "Female", - "count": 1 - } - ], - "breed_for": [] - }, { "pfic": "0077-08-001-0", "name": "Ponyta", @@ -8719,14 +8623,14 @@ "breed_for": [] }, { - "pfic": "0234-02-000-0", - "name": "Stantler", - "form_name": "", + "pfic": "0123-01-000-1", + "name": "Scyther", + "form_name": "Male", "catch_count": 1, "evolve_to": [ { - "pfic": "0899-08-000-0", - "name": "Wyrdeer", + "pfic": "0900-08-000-0", + "name": "Kleavor", "form_name": "", "count": 1 } @@ -8734,14 +8638,14 @@ "breed_for": [] }, { - "pfic": "0123-01-000-1", - "name": "Scyther", - "form_name": "Male", + "pfic": "0234-02-000-0", + "name": "Stantler", + "form_name": "", "catch_count": 1, "evolve_to": [ { - "pfic": "0900-08-000-0", - "name": "Kleavor", + "pfic": "0899-08-000-0", + "name": "Wyrdeer", "form_name": "", "count": 1 } @@ -9020,6 +8924,21 @@ ], "breed_for": [] }, + { + "pfic": "0057-01-000-0", + "name": "Primeape", + "form_name": "", + "catch_count": 1, + "evolve_to": [ + { + "pfic": "0979-09-000-0", + "name": "Annihilape", + "form_name": "", + "count": 1 + } + ], + "breed_for": [] + }, { "pfic": "0203-02-000-1", "name": "Girafarig", @@ -9071,21 +8990,6 @@ ], "breed_for": [] }, - { - "pfic": "0057-01-000-0", - "name": "Primeape", - "form_name": "", - "catch_count": 1, - "evolve_to": [ - { - "pfic": "0979-09-000-0", - "name": "Annihilape", - "form_name": "", - "count": 1 - } - ], - "breed_for": [] - }, { "pfic": "0128-09-001-0", "name": "Tauros",