Compare commits
No commits in common. "2ad44b5620cb1d62f26d0832a8e03461fb1f6b67" and "a53d7887fd597d1850c64302a12f7809401ebd7e" have entirely different histories.
2ad44b5620
...
a53d7887fd
|
@ -2,6 +2,7 @@ name = "Air Pirate"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Neverland"
|
name = "Neverland"
|
||||||
|
room = ""
|
||||||
|
|
||||||
[[drops]]
|
[[drops]]
|
||||||
name = "Hi-Potion"
|
name = "Hi-Potion"
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
name = "Air Soldier"
|
name = "Air Soldier"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Wonderland"
|
name = ""
|
||||||
|
room = ""
|
||||||
|
|
||||||
[[drops]]
|
[[drops]]
|
||||||
name = "Potion"
|
name = "Potion"
|
||||||
|
|
|
@ -2,7 +2,6 @@ name = "Bandit"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Agrabah"
|
name = "Agrabah"
|
||||||
room = ["Desert: Cave", "Treasure Room", "Lamp Chamber"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Monstro"
|
name = "Monstro"
|
||||||
|
|
|
@ -3,10 +3,6 @@ name = "Bouncywild"
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Deep Jungle"
|
name = "Deep Jungle"
|
||||||
|
|
||||||
[[world]]
|
|
||||||
name = "Monstro"
|
|
||||||
room = ["Bowels", "Stomach"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "End of the World"
|
name = "End of the World"
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,6 @@ name = "Darkball"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Traverse Town"
|
name = "Traverse Town"
|
||||||
room = ["3rd District", "Gizmo Shop"]
|
|
||||||
|
|
||||||
[[world]]
|
|
||||||
name = "Agrabah"
|
|
||||||
room = ["Bazaar", "Palace Gates"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Hollow Bastion"
|
name = "Hollow Bastion"
|
||||||
|
@ -14,10 +9,6 @@ name = "Hollow Bastion"
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "End of the World"
|
name = "End of the World"
|
||||||
|
|
||||||
[[world]]
|
|
||||||
name = "Neverland"
|
|
||||||
room = ["Ship: Freezer", "Captain's Cabin"]
|
|
||||||
|
|
||||||
[[drops]]
|
[[drops]]
|
||||||
name = "Hi-Potion"
|
name = "Hi-Potion"
|
||||||
kind = "item"
|
kind = "item"
|
||||||
|
|
|
@ -2,7 +2,6 @@ name = "Defender"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Traverse Town"
|
name = "Traverse Town"
|
||||||
room = ["3rd District", "Hotel Hallway", "Gizmo Shop"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Hollow Bastion"
|
name = "Hollow Bastion"
|
||||||
|
|
|
@ -11,7 +11,6 @@ name = "Monstro"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Deep Jungle"
|
name = "Deep Jungle"
|
||||||
room = ["Jungle: Cliff"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Hollow Bastion"
|
name = "Hollow Bastion"
|
||||||
|
|
|
@ -2,7 +2,6 @@ name = "Pirate"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Neverland"
|
name = "Neverland"
|
||||||
room = ["Captain's Cabin"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Monstro"
|
name = "Monstro"
|
||||||
|
|
|
@ -5,7 +5,6 @@ name = "Deep Jungle"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Monstro"
|
name = "Monstro"
|
||||||
room = ["Chamber 5", "Chamber 6"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "End of the World"
|
name = "End of the World"
|
||||||
|
|
|
@ -1,8 +1,19 @@
|
||||||
name = "Red Nocturne"
|
name = "Red Nocturne"
|
||||||
|
|
||||||
|
[[world]]
|
||||||
|
name = "Traverse Town"
|
||||||
|
|
||||||
|
[[world]]
|
||||||
|
name = "Wonderland"
|
||||||
|
|
||||||
|
[[world]]
|
||||||
|
name = "Agrabah"
|
||||||
|
|
||||||
|
[[world]]
|
||||||
|
name = "Hollow Bastion"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Monstro"
|
name = "Monstro"
|
||||||
room = ["Chamber 6"]
|
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "End of the World"
|
name = "End of the World"
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
name = "Shadow"
|
name = "Shadow"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Wonderland"
|
name = "Traverse Town"
|
||||||
|
room = ""
|
||||||
[[world]]
|
|
||||||
name = "Neverland"
|
|
||||||
room = ["Ship: Freezer"]
|
|
||||||
|
|
||||||
[[drops]]
|
[[drops]]
|
||||||
name = "Potion"
|
name = "Potion"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
name = "Soldier"
|
name = "Soldier"
|
||||||
|
|
||||||
[[world]]
|
[[world]]
|
||||||
name = "Agrabah"
|
name = "Traverse Town"
|
||||||
room = ["Main Street"]
|
room = ""
|
||||||
|
|
||||||
[[drops]]
|
[[drops]]
|
||||||
name = "Spirit Shard"
|
name = "Spirit Shard"
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
Array.prototype.remove = function (element) {
|
|
||||||
this.forEach((item, index) => {
|
|
||||||
if (item === element) {
|
|
||||||
this.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return this;
|
|
||||||
};
|
|
|
@ -1,37 +1,29 @@
|
||||||
import "../common/prototypes.js";
|
|
||||||
|
|
||||||
let markedNeededMaterials = [];
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", (event) => {
|
document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
const recipes = document.querySelectorAll(".recipe");
|
const recipes = document.querySelectorAll(".recipe");
|
||||||
|
|
||||||
for (const recipe of recipes) {
|
for (const recipe of recipes) {
|
||||||
recipe.checked =
|
recipe.checked =
|
||||||
localStorage.getItem("kh1-synth-" + recipe.id) === "true" ?? false;
|
localStorage.getItem("kh1-synth-" + recipe.id) === "true" ?? false;
|
||||||
updateSynthRecipeState(recipe);
|
update_synth_completions(recipe);
|
||||||
|
|
||||||
recipe.addEventListener("input", function () {
|
recipe.addEventListener("input", function () {
|
||||||
localStorage.setItem("kh1-synth-" + this.id, this.checked);
|
localStorage.setItem("kh1-synth-" + this.id, this.checked);
|
||||||
updateSynthRecipeState(this);
|
update_synth_completions(this);
|
||||||
calcNeededMats();
|
calc_total_ingredients();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const recipesLabels = document.querySelectorAll(".recipe-wrapper > label");
|
const recipes_labels = document.querySelectorAll(".recipe-wrapper > label");
|
||||||
for (const label of recipesLabels) {
|
for (const label of recipes_labels) {
|
||||||
label.addEventListener("mouseenter", function () {
|
label.addEventListener("mouseenter", function () {
|
||||||
highlightNeededMats(this);
|
highlight_ingredients(this);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
markedNeededMaterials = Array(
|
calc_total_ingredients();
|
||||||
localStorage.getItem("kh1-synth-needed-mats") ?? [],
|
|
||||||
);
|
|
||||||
|
|
||||||
calcNeededMats();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateSynthRecipeState(recipe) {
|
function update_synth_completions(recipe) {
|
||||||
if (recipe.checked) {
|
if (recipe.checked) {
|
||||||
recipe.parentElement.classList.add("complete");
|
recipe.parentElement.classList.add("complete");
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,17 +31,25 @@ function updateSynthRecipeState(recipe) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function highlightNeededMats(label) {
|
function highlight_ingredients(label) {
|
||||||
let mats = [];
|
let mats = [];
|
||||||
const ingredients = label.querySelectorAll("ul li");
|
const ingredients = label.querySelectorAll("ul li");
|
||||||
const checkbox = label.parentElement.querySelectorAll(".recipe")[0];
|
const checkbox = label.parentElement.querySelectorAll(".recipe")[0];
|
||||||
|
|
||||||
|
const elems = document.querySelectorAll("#mats ul li");
|
||||||
|
|
||||||
|
if (checkbox.checked) {
|
||||||
|
for (const elem of elems) {
|
||||||
|
elem.style.color = "#fff";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const ingredient of ingredients) {
|
for (const ingredient of ingredients) {
|
||||||
const name = ingredient.dataset["synthItemName"];
|
const name = ingredient.dataset["synthItemName"];
|
||||||
mats.push(name);
|
mats.push(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const elems = document.querySelectorAll("#mats ul li");
|
|
||||||
for (const elem of elems) {
|
for (const elem of elems) {
|
||||||
const isCrossed = elem.style.textDecoration === "line-through";
|
const isCrossed = elem.style.textDecoration === "line-through";
|
||||||
if (isCrossed) {
|
if (isCrossed) {
|
||||||
|
@ -64,7 +64,7 @@ function highlightNeededMats(label) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function calcNeededMats() {
|
function calc_total_ingredients() {
|
||||||
const needed = new Map();
|
const needed = new Map();
|
||||||
const recipes = document.querySelectorAll(".recipe");
|
const recipes = document.querySelectorAll(".recipe");
|
||||||
|
|
||||||
|
@ -81,8 +81,8 @@ function calcNeededMats() {
|
||||||
let amount = Number(ingredient.dataset["synthItemAmount"]);
|
let amount = Number(ingredient.dataset["synthItemAmount"]);
|
||||||
|
|
||||||
if (needed.has(name)) {
|
if (needed.has(name)) {
|
||||||
let newAmount = Number(needed.get(name)) + amount;
|
let new_amount = Number(needed.get(name)) + amount;
|
||||||
needed.set(name, newAmount);
|
needed.set(name, new_amount);
|
||||||
} else {
|
} else {
|
||||||
needed.set(name, amount);
|
needed.set(name, amount);
|
||||||
}
|
}
|
||||||
|
@ -99,30 +99,12 @@ function calcNeededMats() {
|
||||||
const liElem = document.createElement("li");
|
const liElem = document.createElement("li");
|
||||||
liElem.innerHTML = entry[0] + " x" + entry[1];
|
liElem.innerHTML = entry[0] + " x" + entry[1];
|
||||||
liElem.addEventListener("click", function () {
|
liElem.addEventListener("click", function () {
|
||||||
updateMarkedNeededMats(entry[0]);
|
const isCrossed = this.style.textDecoration === "line-through";
|
||||||
markNeededMat(this);
|
this.style.textDecoration = isCrossed ? "none" : "line-through";
|
||||||
|
this.style.color = isCrossed ? "#fff" : "#f00";
|
||||||
});
|
});
|
||||||
|
|
||||||
if (markedNeededMaterials.includes(entry[0])) {
|
|
||||||
markNeededMat(liElem);
|
|
||||||
}
|
|
||||||
|
|
||||||
uiList.appendChild(liElem);
|
uiList.appendChild(liElem);
|
||||||
}
|
}
|
||||||
matsList.appendChild(uiList);
|
matsList.appendChild(uiList);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateMarkedNeededMats(ingredient) {
|
|
||||||
if (markedNeededMaterials.includes(ingredient)) {
|
|
||||||
markedNeededMaterials.remove(ingredient);
|
|
||||||
} else {
|
|
||||||
markedNeededMaterials.push(ingredient);
|
|
||||||
}
|
|
||||||
localStorage.setItem("kh1-synth-needed-mats", markedNeededMaterials);
|
|
||||||
}
|
|
||||||
|
|
||||||
function markNeededMat(mat) {
|
|
||||||
const isCrossed = mat.style.textDecoration === "line-through";
|
|
||||||
mat.style.textDecoration = isCrossed ? "none" : "line-through";
|
|
||||||
mat.style.color = isCrossed ? "#fff" : "#f00";
|
|
||||||
}
|
|
||||||
|
|
|
@ -87,6 +87,5 @@ impl Display for EnemyDropChance {
|
||||||
#[derive(Debug, Deserialize, PartialEq, Eq)]
|
#[derive(Debug, Deserialize, PartialEq, Eq)]
|
||||||
pub struct SpawnLocation {
|
pub struct SpawnLocation {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
#[serde(default)]
|
pub room: Option<String>,
|
||||||
pub rooms: Vec<String>,
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue