updated spell multipliers to 1.20, crafting now has attack speed tiers

This commit is contained in:
ferricles 2021-01-21 10:30:22 -08:00
parent c1e2753aa6
commit cb200279c4
6 changed files with 58 additions and 12 deletions

View file

@ -10,12 +10,12 @@ class Craft{
@param mat_tiers: [1->3, 1->3]. An array with 2 numbers.
@param ingreds: []. An array with 6 entries, each with an ingredient Map.
*/
constructor(recipe, mat_tiers, ingreds) {
constructor(recipe, mat_tiers, ingreds, attackSpeed) {
this.recipe = recipe;
this.mat_tiers = mat_tiers;
this.ingreds = ingreds;
this.statMap = new Map(); //can use the statMap as an expanded Item
this.atkSpd = attackSpeed;
this.initCraftStats();
}
@ -83,6 +83,7 @@ class Craft{
}
//statMap.set("damageBonus", [statMap.get("eDamPct"), statMap.get("tDamPct"), statMap.get("wDamPct"), statMap.get("fDamPct"), statMap.get("aDamPct")]);
statMap.set("category","weapon");
statMap.set("atkSpd",this.atkSpd);
}
statMap.set("powders","");
/* Change certain IDs based on material tier.
@ -142,9 +143,18 @@ class Craft{
}
}
//apply material tiers - the good thing is that this should be symmetric.
let matmult = 1;
for (const mat of this.mat_tiers) {
}
if (statMap.get("category") === "consumable") {
//duration modifier
} else {
//durability modifier
}
if (statMap.get("category") === "weapon") {
//attack damages oh boy
}
//apply ingredient effectivness - on ids, and reqs (itemIDs). NOT on durability, duration, or charges.
let eff_flat = eff.flat();

View file

@ -100,6 +100,26 @@
</td>
</tr>
</table>
<label for = "atkSpdChoices"> Attack Speed (weapons only):</label>
<table class = "center" id = "atkSpdChoices">
<tr>
<td class = "center">
<button class = "button" id = "slow-atk-button" onclick = "toggleAtkSpd('slow-atk-button')">
Slow
</button>
</td>
<td class = "center">
<button class = "button" id = "normal-atk-button" onclick = "toggleAtkSpd('normal-atk-button')">
Normal
</button>
</td>
<td class = "center">
<button class = "button" id = "fast-atk-button" onclick = "toggleAtkSpd('fast-atk-button')">
Fast
</button>
</td>
</tr>
</table>
<table class = "center">
<tr>
<td class = "center">

View file

@ -86,6 +86,18 @@ function updateMaterials() {
document.getElementById("mat-2").textContent = "Material 2 Tier:";
}
}
function toggleAtkSpd(buttonId) {
let buttons = ["slow-atk-button", "normal-atk-button", "fast-atk-button"];
let elem = document.getElementById(buttonId);
if (elem.classList.contains("toggleOn")) {
elem.classList.remove("toggleOn");
} else {
for (const button of buttons) {
document.getElementById(button).classList.remove("toggleOn");
}
elem.classList.add("toggleOn");
}
}
function calculateCraft() {
//Make things display.
@ -117,9 +129,15 @@ function calculateCraft() {
for (i = 1; i < 7; i++) {
getValue("ing-choice-" + i) === "" ? ingreds.push(expandIngredient(ingMap.get("No Ingredient"))) : ingreds.push(expandIngredient(ingMap.get(getValue("ing-choice-" + i))));
}
let atkSpd = "NORMAL"; //default attack speed will be normal.
for (const b of ["slow-atk-button", "normal-atk-button", "fast-atk-button"]) {
button = document.getElementById(b);
if (button.classList.contains("toggleOn")) {
atkSpd = b.split("-")[0].toUpperCase();
}
}
//create the craft
player_craft = new Craft(recipe,mat_tiers,ingreds);
player_craft = new Craft(recipe,mat_tiers,ingreds,atkSpd);
console.log(player_craft);
/*console.log(recipe)
console.log(levelrange)

View file

@ -146,7 +146,7 @@ const spell_table = {
{ title: "Charge", cost: 4, parts: [
{ subtitle: "Total Damage", type: "damage", multiplier: 150, conversion: [60, 0, 0, 0, 40, 0], summary: true },
] },
{ title: "Uppercut", cost: 10, parts: [
{ title: "Uppercut", cost: 9, parts: [
{ subtitle: "First Damage", type: "damage", multiplier: 300, conversion: [70, 20, 10, 0, 0, 0] },
{ subtitle: "Fireworks Damage", type: "damage", multiplier: 50, conversion: [60, 0, 40, 0, 0, 0] },
{ subtitle: "Crash Damage", type: "damage", multiplier: 50, conversion: [80, 0, 20, 0, 0, 0] },
@ -177,7 +177,7 @@ const spell_table = {
{ title: "Spin Attack", cost: 6, parts: [
{ subtitle: "Total Damage", type: "damage", multiplier: 150, conversion: [70, 0, 30, 0, 0, 0], summary: true},
] },
{ title: "Vanish", cost: 1, parts: [
{ title: "Vanish", cost: 2, parts: [
{ subtitle: "No Damage", type: "none", summary: true }
] },
{ title: "Multihit", cost: 8, parts: [
@ -194,7 +194,7 @@ const spell_table = {
{ title: "Totem", cost: 4, parts: [
{ subtitle: "Smash Damage", type: "damage", multiplier: 100, conversion: [80, 0, 0, 0, 20, 0]},
{ subtitle: "Damage Tick", type: "damage", multiplier: 20, conversion: [80, 0, 0, 0, 0, 20]},
{ subtitle: "Heal Tick", type: "heal", strength: 0.04, summary: true },
{ subtitle: "Heal Tick", type: "heal", strength: 0.03, summary: true },
] },
{ title: "Haul", cost: 1, parts: [
{ subtitle: "Total Damage", type: "damage", multiplier: 100, conversion: [80, 0, 20, 0, 0, 0], summary: true },
@ -203,7 +203,7 @@ const spell_table = {
{ subtitle: "One Wave", type: "damage", multiplier: 200, conversion: [70, 0, 0, 30, 0, 0], summary: true },
] },
{ title: "Uproot", cost: 6, parts: [
{ subtitle: "Total Damage", type: "damage", multiplier: 50, conversion: [70, 30, 0, 0, 0, 0], summary: true },
{ subtitle: "Total Damage", type: "damage", multiplier: 100, conversion: [70, 30, 0, 0, 0, 0], summary: true },
] },
],
"powder": [ //This is how instant-damage powder specials are implemented. To view time-boosted damage powder specials (curse, 2nd courage, air prison, view @TODO)

View file

@ -831,7 +831,6 @@ function displayRecipeStats(craft, parent_id) {
tooltip.classList.add("tooltiptext");
tooltip.classList.add("center");
tooltip.id = "tooltip-" + (2*i + j);
console.log(tooltip.id);
cell.appendChild(tooltip);
}
ingredTable.appendChild(row);
@ -848,7 +847,6 @@ function displayCraftStats(craft, parent_id) {
//Displays an ingredient in item format. However, an ingredient is too far from a normal item to display as one.
function displayExpandedIngredient(ingred, parent_id) {
console.log(ingred);
let parent_elem = document.getElementById(parent_id);
parent_elem.textContent = "";
let display_order = [

View file

@ -400,7 +400,7 @@ button.toggleOn:hover {
visibility: hidden;
width: 120px;
color: #aaa;
background: #1e2224;
background: #110110;
width: min(200%, 75vw);
text-align: center;
border: 5px solid #BCBCBC;