Browse Source

0 Fix baby pokemon showing up in the catch list instead of only in the breed section

master
Dan 1 year ago
parent
commit
23b9707059
  1. 9
      DBEditor/plan2.py
  2. 177
      Site/templates/index.html
  3. 400
      efficiency_plan.json

9
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)

177
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;
}
</style>
</head>
<body>
@ -575,72 +601,81 @@
placeholder="Search Pokémon..."
oninput="filterGamePokemon(this)">
</div>
{% for pokemon in game.pokemon %}
<div class="pokemon-entry" data-pfic="{{ pokemon.pfic }}">
<div class="pokemon-header" {% if (pokemon.evolve_to|length > 0) or (pokemon.breed_for|length > 0) %}onclick="togglePokemonDetails(this)"{% endif %}>
<img data-src="{{ url_for('static', filename='images/pokemon/' + pokemon.pfic + '.png') }}"
alt="{{ pokemon.name }}"
class="pokemon-thumbnail lazy-load"
src="{{ url_for('static', filename='images/placeholder.png') }}">
<div class="pokemon-header-content">
<h3 style="margin: 0;">
{{ pokemon.name }}{% if pokemon.form_name %} ({{ pokemon.form_name }}){% endif %}
</h3>
<div class="pokemon-header-right">
<div class="catch-count-container">
<img src="{{ url_for('static', filename='images/pokeball_color.png') }}"
alt="Catch count"
class="catch-count-pokeball"
data-pfic="{{ pokemon.pfic }}">
<span class="catch-count">{{ pokemon.catch_count }}</span>
</div>
{% if (pokemon.evolve_to|length > 0) or (pokemon.breed_for|length > 0) %}
<span class="toggle-icon"></span>
{% endif %}
</div>
</div>
</div>
<div class="pokemon-details">
{% if pokemon.evolve_to or pokemon.breed_for %}
<div class="pokemon-targets-grid">
{% if pokemon.evolve_to %}
{% for evolution in pokemon.evolve_to %}
<div class="target-card" data-pfic="{{ evolution.pfic }}" data-evolve="true">
<div class="target-name">
{{ evolution.name }}
{% if evolution.form_name %}({{ evolution.form_name }}){% endif %}
</div>
<img data-src="{{ url_for('static', filename='images/pokemon/' + evolution.pfic + '.png') }}"
alt="{{ evolution.name }}"
class="target-image lazy-load"
<div class="game-sections">
<div class="active-section">
{% for pokemon in game.pokemon %}
<div class="pokemon-entry" data-pfic="{{ pokemon.pfic }}">
<div class="pokemon-header" {% if (pokemon.evolve_to|length > 0) or (pokemon.breed_for|length > 0) %}onclick="togglePokemonDetails(this)"{% endif %}>
<img data-src="{{ url_for('static', filename='images/pokemon/' + pokemon.pfic + '.png') }}"
alt="{{ pokemon.name }}"
class="pokemon-thumbnail lazy-load"
src="{{ url_for('static', filename='images/placeholder.png') }}">
<span class="target-method">{{ evolution.method }}</span>
<span class="target-count">Need: {{ evolution.count }}</span>
<div class="pokemon-header-content">
<h3 style="margin: 0;">
{{ pokemon.name }}{% if pokemon.form_name %} ({{ pokemon.form_name }}){% endif %}
</h3>
<div class="pokemon-header-right">
<div class="catch-count-container">
<img src="{{ url_for('static', filename='images/pokeball_color.png') }}"
alt="Catch count"
class="catch-count-pokeball"
data-pfic="{{ pokemon.pfic }}">
<span class="catch-count">{{ pokemon.catch_count }}</span>
</div>
{% if (pokemon.evolve_to|length > 0) or (pokemon.breed_for|length > 0) %}
<span class="toggle-icon"></span>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% if pokemon.breed_for %}
{% for breeding in pokemon.breed_for %}
<div class="target-card" data-pfic="{{ breeding.pfic }}" data-breed="true">
<div class="target-name">
{{ breeding.name }}
{% if breeding.form_name %}({{ breeding.form_name }}){% endif %}
<div class="pokemon-details">
{% if pokemon.evolve_to or pokemon.breed_for %}
<div class="pokemon-targets-grid">
{% if pokemon.evolve_to %}
{% for evolution in pokemon.evolve_to %}
<div class="target-card" data-pfic="{{ evolution.pfic }}" data-evolve="true">
<div class="target-name">
{{ evolution.name }}
{% if evolution.form_name %}({{ evolution.form_name }}){% endif %}
</div>
<img data-src="{{ url_for('static', filename='images/pokemon/' + evolution.pfic + '.png') }}"
alt="{{ evolution.name }}"
class="target-image lazy-load"
src="{{ url_for('static', filename='images/placeholder.png') }}">
<span class="target-method">{{ evolution.method }}</span>
<span class="target-count">Need: {{ evolution.count }}</span>
</div>
{% endfor %}
{% endif %}
{% if pokemon.breed_for %}
{% for breeding in pokemon.breed_for %}
<div class="target-card" data-pfic="{{ breeding.pfic }}" data-breed="true">
<div class="target-name">
{{ breeding.name }}
{% if breeding.form_name %}({{ breeding.form_name }}){% endif %}
</div>
<img data-src="{{ url_for('static', filename='images/pokemon/' + breeding.pfic + '.png') }}"
alt="{{ breeding.name }}"
class="target-image lazy-load"
src="{{ url_for('static', filename='images/placeholder.png') }}">
<span class="target-method">Breed</span>
<span class="target-count">Need: {{ breeding.count }}</span>
</div>
{% endfor %}
{% endif %}
</div>
<img data-src="{{ url_for('static', filename='images/pokemon/' + breeding.pfic + '.png') }}"
alt="{{ breeding.name }}"
class="target-image lazy-load"
src="{{ url_for('static', filename='images/placeholder.png') }}">
<span class="target-method">Breed</span>
<span class="target-count">Need: {{ breeding.count }}</span>
{% endif %}
</div>
{% endfor %}
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
<div class="completed-section">
<h3 class="section-title">Completed</h3>
<div class="completed-pokemon"></div>
</div>
</div>
{% endfor %}
</div>
</div>
{% 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);
}

400
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",

Loading…
Cancel
Save