From a09a9015450cf220c63841a1a508a5034d9dde7d Mon Sep 17 00:00:00 2001 From: hppeng Date: Sat, 8 Apr 2023 14:55:23 -0700 Subject: [PATCH] Minor cleanup, start item class --- js/build_utils.js | 4 ++-- js/c++/item.cpp | 3 +++ js/c++/item.h | 41 +++++++++++++++++++++++++++++++++++++++++ js/c++/js_types.h | 0 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 js/c++/item.cpp create mode 100644 js/c++/item.h delete mode 100644 js/c++/js_types.h diff --git a/js/build_utils.js b/js/build_utils.js index 0bc916d..b48f3e1 100644 --- a/js/build_utils.js +++ b/js/build_utils.js @@ -72,7 +72,7 @@ const all_types = armorTypes.concat(accessoryTypes).concat(weaponTypes).concat(c //console.log(types) let item_types = armorTypes.concat(accessoryTypes).concat(weaponTypes).concat(tome_types); -let elementIcons = ["\u2724","\u2726", "\u2749", "\u2739", "\u274b" ]; +let elementIcons = ["\u2724", "\u2726", "\u2749", "\u2739", "\u274b" ]; let skpReqs = skp_order.map(x => x + "Req"); let item_fields = [ "name", "displayName", "lore", "color", "tier", "set", "slots", "type", "material", "drop", "quest", "restrict", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "atkSpd", "hp", "fDef", "wDef", "aDef", "tDef", "eDef", "lvl", "classReq", "strReq", "dexReq", "intReq", "defReq", "agiReq", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "ref", "str", "dex", "int", "agi", "def", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "fixID", "category", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "rSdRaw", "sprint", "sprintReg", "jh", "lq", "gXp", "gSpd", "id", "majorIds", "damMobs", "defMobs", @@ -90,7 +90,7 @@ let item_fields = [ "name", "displayName", "lore", "color", "tier", "set", "slot "spPct1Final", "spPct2Final", "spPct3Final", "spPct4Final" ]; // Extra fake IDs (reserved for use in spell damage calculation) : damMult, defMult, poisonPct, activeMajorIDs -let str_item_fields = [ "name", "displayName", "lore", "color", "tier", "set", "type", "material", "drop", "quest", "restrict", "category", "atkSpd" ] +let str_item_fields = [ "name", "displayName", "lore", "color", "tier", "set", "type", "material", "drop", "quest", "restrict", "category", "atkSpd" ]; //File reading for ID translations for JSON purposes let reversetranslations = new Map(); diff --git a/js/c++/item.cpp b/js/c++/item.cpp new file mode 100644 index 0000000..f962cef --- /dev/null +++ b/js/c++/item.cpp @@ -0,0 +1,3 @@ +#include "item.h" + + diff --git a/js/c++/item.h b/js/c++/item.h new file mode 100644 index 0000000..749eee8 --- /dev/null +++ b/js/c++/item.h @@ -0,0 +1,41 @@ +#pragma once +#include +#include + +extern std::vector numeric_IDs; +extern const std::vector non_rolled_ids; + +// TODO enum? +#define item_tier_t std::string +#define item_type_t std::string +#define item_drop_t std::string + +class Item { + std::string name; + std::string display_name; + std::string lore; + std::string color; + item_tier_t tier; + std::string set; + int slots; + item_type_t type; + std::string material; + item_drop_t drop; + std::string quest; + +let item_fields = [ "name", "displayName", "lore", "color", "tier", "set", "slots", "type", "material", "drop", "quest", "restrict", "nDam", "fDam", "wDam", "aDam", "tDam", "eDam", "atkSpd", "hp", "fDef", "wDef", "aDef", "tDef", "eDef", "lvl", "classReq", "strReq", "dexReq", "intReq", "defReq", "agiReq", "hprPct", "mr", "sdPct", "mdPct", "ls", "ms", "xpb", "lb", "ref", "str", "dex", "int", "agi", "def", "thorns", "expd", "spd", "atkTier", "poison", "hpBonus", "spRegen", "eSteal", "hprRaw", "sdRaw", "mdRaw", "fDamPct", "wDamPct", "aDamPct", "tDamPct", "eDamPct", "fDefPct", "wDefPct", "aDefPct", "tDefPct", "eDefPct", "fixID", "category", "spPct1", "spRaw1", "spPct2", "spRaw2", "spPct3", "spRaw3", "spPct4", "spRaw4", "rSdRaw", "sprint", "sprintReg", "jh", "lq", "gXp", "gSpd", "id", "majorIds", "damMobs", "defMobs", + +// wynn2 damages. +"eMdPct","eMdRaw","eSdPct","eSdRaw",/*"eDamPct,"*/"eDamRaw","eDamAddMin","eDamAddMax", +"tMdPct","tMdRaw","tSdPct","tSdRaw",/*"tDamPct,"*/"tDamRaw","tDamAddMin","tDamAddMax", +"wMdPct","wMdRaw","wSdPct","wSdRaw",/*"wDamPct,"*/"wDamRaw","wDamAddMin","wDamAddMax", +"fMdPct","fMdRaw","fSdPct","fSdRaw",/*"fDamPct,"*/"fDamRaw","fDamAddMin","fDamAddMax", +"aMdPct","aMdRaw","aSdPct","aSdRaw",/*"aDamPct,"*/"aDamRaw","aDamAddMin","aDamAddMax", +"nMdPct","nMdRaw","nSdPct","nSdRaw","nDamPct","nDamRaw","nDamAddMin","nDamAddMax", // neutral which is now an element +/*"mdPct","mdRaw","sdPct","sdRaw",*/"damPct","damRaw","damAddMin","damAddMax", // These are the old ids. Become proportional. +"rMdPct","rMdRaw","rSdPct",/*"rSdRaw",*/"rDamPct","rDamRaw","rDamAddMin","rDamAddMax", // rainbow (the "element" of all minus neutral). rSdRaw is rainraw +"critDamPct", +"spPct1Final", "spPct2Final", "spPct3Final", "spPct4Final" +]; + +} diff --git a/js/c++/js_types.h b/js/c++/js_types.h deleted file mode 100644 index e69de29..0000000