7 894
edições
Sem resumo de edição |
Sem resumo de edição |
||
Linha 143: | Linha 143: | ||
const hunts = { | const hunts = { | ||
"NW": [ | "NW": [ | ||
{ name: "Grimer", difficulty: " | { name: "Grimer", difficulty: "Baixa", local: "Cinnabar", classes: ["Orebound", "Psycraft"], imageUrl: "https://wiki.pokexgames.com/images/e/ee/Banner_Hunts_-_NW_Grimer.png", hasType: true, huntTypes: ["Poison"], huntTipo: "Elemental", link: "https://wiki.pokexgames.com/index.php/Cosmic_Quest_-_Boss_Solrock" }, | ||
{ name: "Grimer", difficulty: " | { name: "Grimer", difficulty: "Baixa", local: "Cinnabar", classes: ["Orebound", "Psycraft"], imageUrl: "https://wiki.pokexgames.com/images/e/ee/Banner_Hunts_-_NW_Grimer.png", hasType: true, huntTypes: ["Poison"], huntTipo: "Elemental", link: "https://wiki.pokexgames.com/index.php/Cosmic_Quest_-_Boss_Solrock" }, | ||
{ name: "Grimer", difficulty: " | { name: "Grimer", difficulty: "Baixa", local: "Cinnabar", classes: ["Orebound", "Psycraft"], imageUrl: "https://wiki.pokexgames.com/images/e/ee/Banner_Hunts_-_NW_Grimer.png", hasType: true, huntTypes: ["Poison"], huntTipo: "Elemental", link: "https://wiki.pokexgames.com/index.php/Cosmic_Quest_-_Boss_Solrock" }, | ||
{ name: "Grimer", difficulty: " | { name: "Grimer", difficulty: "Baixa", local: "Cinnabar", classes: ["Orebound", "Psycraft"], imageUrl: "https://wiki.pokexgames.com/images/e/ee/Banner_Hunts_-_NW_Grimer.png", hasType: true, huntTypes: ["Poison"], huntTipo: "Elemental", link: "https://wiki.pokexgames.com/index.php/Cosmic_Quest_-_Boss_Solrock" }, | ||
{ name: "Grimer", difficulty: " | { name: "Grimer", difficulty: "Baixa", local: "Cinnabar", classes: ["Orebound", "Psycraft"], imageUrl: "https://wiki.pokexgames.com/images/e/ee/Banner_Hunts_-_NW_Grimer.png", hasType: true, huntTypes: ["Poison"], huntTipo: "Elemental", link: "https://wiki.pokexgames.com/index.php/Cosmic_Quest_-_Boss_Solrock" }, | ||
{ name: "Petilil", difficulty: " | { name: "Petilil", difficulty: "ssss", local: "Fuchsia", classes: ["Volcanic", "Naturia", "Malefic", "Seavell", "Wingeon"], imageUrl: "https://wiki.pokexgames.com/images/7/70/Nightmare_Hunt_Petilil.png", hasType: true, huntTypes: ["Grass"], huntTipo: "Neutro", link: "https://exemplo.com/hunt2" } | ||
], | ], | ||
}; | }; | ||
Linha 178: | Linha 178: | ||
huntTipoSelect.innerHTML = '<option value="">Selecione um tipo</option>'; | huntTipoSelect.innerHTML = '<option value="">Selecione um tipo</option>'; | ||
difficultySelect.innerHTML = '<option value="">Selecione uma Dificuldade</option>'; | difficultySelect.innerHTML = '<option value="">Selecione uma Dificuldade</option>'; | ||
if (huntList) { | if (huntList) { | ||
const types = new Set(); | |||
huntList.forEach(hunt => { | |||
if (hunt.huntTipo) { | |||
types.add(hunt.huntTipo); // Pega "Elemental", "Legendary", etc. | |||
} | |||
}); | |||
types.forEach(type => { | |||
const option = document.createElement("option"); | |||
option.value = type; | |||
option.textContent = type; | |||
huntTipoSelect.appendChild(option); | |||
}); | |||
huntTipoSelect.classList.remove("disabled"); | |||
} else { | } else { | ||
huntTipoSelect.classList.add("disabled"); | |||
} | } | ||
} | |||
huntTipoSelect.addEventListener("change", function () { | |||
const selectedMap = mapTypeSelect.value; | |||
const selectedHuntType = huntTipoSelect.value; | |||
const huntList = hunts[selectedMap]; | |||
difficultySelect.innerHTML = '<option value="">Selecione uma Dificuldade</option>'; | |||
if (huntList) { | if (huntList && selectedHuntType) { | ||
const difficulties = new Set(); | |||
huntList.forEach(hunt => { | |||
if (hunt.huntTipo === selectedHuntType && hunt.difficulty) { | |||
difficulties.add(hunt.difficulty); // Pega "Baixa", "Média", etc. | |||
} | |||
}); | |||
difficulties.forEach(difficulty => { | |||
const option = document.createElement("option"); | |||
option.value = difficulty; | |||
option.textContent = difficulty; | |||
difficultySelect.appendChild(option); | |||
}); | |||
difficultySelect.classList.remove("disabled"); | |||
} else { | } else { | ||
difficultySelect.classList.add("disabled"); | |||
} | } | ||
} | filterHunts(); // Filtra as hunts ao mudar o tipo | ||
}); | |||
// Filtra e exibe as hunts | // Filtra e exibe as hunts |