Move powder ingreds to ing load sequence

not used anywhere else
also, remove extra prints in crafter
This commit is contained in:
hppeng 2023-04-03 11:33:37 -07:00
parent f75383dd98
commit c6549fffbb
3 changed files with 11 additions and 34 deletions

View file

@ -136,8 +136,6 @@ function calculateCraft() {
}
let ingreds = [];
for (i = 1; i < 7; i++) {
console.log("ing-choice-"+i);
// console.log(getValue("ing-choice-"+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.

View file

@ -201,39 +201,29 @@ function init_ing_maps() {
ingList.push(ing.displayName);
ingIDMap.set(ing.id, ing.displayName);
let numerals = new Map([[1, "I"], [2, "II"], [3, "III"], [4, "IV"], [5, "V"], [6, "VI"]]);
// pairs of (dura, req)
let powder_ing_info = [
[-35,0],[-52.5,0],[-70,10],[-91,20],[-112,28],[-133,36]
];
for (let i = 0; i < 5; i ++) {
for (const powderIng of powderIngreds) {
for (let powder_tier = 0; powder_tier < 6; ++powder_tier) {
powder_info = powder_ing_info[powder_tier];
let ing = {
name: "" + damageClasses[i+1] + " Powder " + numerals.get(powderIngreds.indexOf(powderIng) + 1),
name: "" + damageClasses[i+1] + " Powder " + numerals.get(powder_tier + 1),
tier: 0,
lvl: 0,
skills: ["ARMOURING", "TAILORING", "WEAPONSMITHING", "WOODWORKING", "JEWELING"],
ids: {},
isPowder: true,
pid: 6*i + powderIngreds.indexOf(powderIng),
itemIDs: {"dura": powderIng["durability"], "strReq": 0, "dexReq": 0,"intReq": 0,"defReq": 0,"agiReq": 0},
pid: 6*i + powder_tier,
itemIDs: {"dura": powder_info[0], "strReq": 0, "dexReq": 0,"intReq": 0,"defReq": 0,"agiReq": 0},
consumableIDs: {"dura": 0, "charges": 0},
posMods: {"left": 0, "right": 0, "above": 0, "under": 0, "touching": 0, "notTouching": 0}
};
ing.id = 4001 + ing.pid;
ing.displayName = ing.name;
switch(i) {
case 0:
ing.itemIDs["strReq"] = powderIng["skpReq"];
break;
case 1:
ing.itemIDs["dexReq"] = powderIng["skpReq"];
break;
case 2:
ing.itemIDs["intReq"] = powderIng["skpReq"];
break;
case 3:
ing.itemIDs["defReq"] = powderIng["skpReq"];
break;
case 4:
ing.itemIDs["agiReq"] = powderIng["skpReq"];
break;
}
ing.itemIDs[skp_order[i] + "Req"] = powder_info[1];
ingMap.set(ing.displayName, ing);
ingList.push(ing.displayName);
ingIDMap.set(ing.id, ing.displayName);

View file

@ -31,17 +31,6 @@ let powderStats = [
_p(2,6,11,3,1), _p(3,10,14,6,2), _p(4,11,17,10,3), _p(5,11,22,16,5), _p(7,12,28,24,9), _p(8,14,35,34,13)
];
class PowderIngredient {
constructor(durability, skpReq) {
this.durability = durability;
this.skpReq = skpReq;
}
}
function _pi(a,b) { return new PowderIngredient(a,b)}
let powderIngreds = [
_pi(-35,0),_pi(-52.5,0),_pi(-70,10),_pi(-91,20),_pi(-112,28),_pi(-133,36)
];
//Ordering: [weapon special name, weapon special effects, armor special name, armor special effects]
class PowderSpecial{
constructor(wSpName, wSpEff, aSpName, aSpEff, cap){