HOTFIX: tome patch
This commit is contained in:
parent
0e97dae2f9
commit
ef5dd8f6c6
3 changed files with 18 additions and 15 deletions
|
@ -105,7 +105,7 @@ class Build{
|
||||||
* In order: 2x Weapon Mastery Tome, 4x Armor Mastery Tome, 1x Guild Tome.
|
* In order: 2x Weapon Mastery Tome, 4x Armor Mastery Tome, 1x Guild Tome.
|
||||||
* 2x Slaying Mastery Tome, 2x Dungeoneering Mastery Tome, 2x Gathering Mastery Tome are in game, but do not have "useful" stats (those that affect damage calculations or building)
|
* 2x Slaying Mastery Tome, 2x Dungeoneering Mastery Tome, 2x Gathering Mastery Tome are in game, but do not have "useful" stats (those that affect damage calculations or building)
|
||||||
*/
|
*/
|
||||||
constructor(level, items, tomes, weapon){
|
constructor(level, items, weapon){
|
||||||
|
|
||||||
if (level < 1) { //Should these be constants?
|
if (level < 1) { //Should these be constants?
|
||||||
this.level = 1;
|
this.level = 1;
|
||||||
|
@ -123,13 +123,12 @@ class Build{
|
||||||
|
|
||||||
this.availableSkillpoints = levelToSkillPoints(this.level);
|
this.availableSkillpoints = levelToSkillPoints(this.level);
|
||||||
this.equipment = items;
|
this.equipment = items;
|
||||||
this.tomes = tomes;
|
|
||||||
this.weapon = weapon;
|
this.weapon = weapon;
|
||||||
this.items = this.equipment.concat([this.weapon]).concat(this.tomes);
|
this.items = this.equipment.concat([this.weapon]);
|
||||||
// return [equip_order, best_skillpoints, final_skillpoints, best_total];
|
// return [equip_order, best_skillpoints, final_skillpoints, best_total];
|
||||||
|
|
||||||
// calc skillpoints requires statmaps only
|
// calc skillpoints requires statmaps only
|
||||||
let result = calculate_skillpoints(this.equipment.concat(this.tomes).map((x) => x.statMap), this.weapon.statMap);
|
let result = calculate_skillpoints(this.equipment.map((x) => x.statMap), this.weapon.statMap);
|
||||||
this.equip_order = result[0];
|
this.equip_order = result[0];
|
||||||
// How many skillpoints the player had to assign (5 number)
|
// How many skillpoints the player had to assign (5 number)
|
||||||
this.base_skillpoints = result[1];
|
this.base_skillpoints = result[1];
|
||||||
|
@ -145,7 +144,7 @@ class Build{
|
||||||
/*Returns build in string format
|
/*Returns build in string format
|
||||||
*/
|
*/
|
||||||
toString(){
|
toString(){
|
||||||
return [this.equipment,this.weapon,this.tomes].flat();
|
return [this.equipment,this.weapon].flat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,11 +119,11 @@ function decodeBuild(url_tag) {
|
||||||
// Tomes.
|
// Tomes.
|
||||||
if (version == 6) {
|
if (version == 6) {
|
||||||
//tome values do not appear in anything before v6.
|
//tome values do not appear in anything before v6.
|
||||||
for (let i = 0; i < 7; ++i) {
|
|
||||||
let tome_str = info[1].charAt(i);
|
|
||||||
for (let i in tomes) {
|
for (let i in tomes) {
|
||||||
setValue(tomeInputs[i], getTomeNameFromID(Base64.toInt(tome_str)));
|
let tome_str = info[1].charAt(i);
|
||||||
}
|
let tome_name = getTomeNameFromID(Base64.toInt(tome_str));
|
||||||
|
console.log(tome_name);
|
||||||
|
setValue(tomeInputs[i], tome_name);
|
||||||
}
|
}
|
||||||
info[1] = info[1].slice(7);
|
info[1] = info[1].slice(7);
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,8 +382,6 @@ class URLUpdateNode extends ComputeNode {
|
||||||
* Create a "build" object from a set of equipments.
|
* Create a "build" object from a set of equipments.
|
||||||
* Returns a new Build object, or null if all items are NONE items.
|
* Returns a new Build object, or null if all items are NONE items.
|
||||||
*
|
*
|
||||||
* TODO: add tomes
|
|
||||||
*
|
|
||||||
* Signature: BuildAssembleNode(helmet-input: Item,
|
* Signature: BuildAssembleNode(helmet-input: Item,
|
||||||
* chestplate-input: Item,
|
* chestplate-input: Item,
|
||||||
* leggings-input: Item,
|
* leggings-input: Item,
|
||||||
|
@ -426,7 +424,7 @@ class BuildAssembleNode extends ComputeNode {
|
||||||
if (all_none && !location.hash) {
|
if (all_none && !location.hash) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Build(level, equipments, [], weapon);
|
return new Build(level, equipments, weapon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1007,8 +1005,6 @@ function builder_graph_init() {
|
||||||
|
|
||||||
let build_disp_node = new BuildDisplayNode()
|
let build_disp_node = new BuildDisplayNode()
|
||||||
build_disp_node.link_to(build_node, 'build');
|
build_disp_node.link_to(build_node, 'build');
|
||||||
let build_warnings_node = new DisplayBuildWarningsNode();
|
|
||||||
build_warnings_node.link_to(build_node, 'build');
|
|
||||||
|
|
||||||
// Create one node that will be the "aggregator node" (listen to all the editable id nodes, as well as the build_node (for non editable stats) and collect them into one statmap)
|
// Create one node that will be the "aggregator node" (listen to all the editable id nodes, as well as the build_node (for non editable stats) and collect them into one statmap)
|
||||||
let stat_agg_node = new AggregateStatsNode();
|
let stat_agg_node = new AggregateStatsNode();
|
||||||
|
@ -1026,14 +1022,15 @@ function builder_graph_init() {
|
||||||
edit_id_output = new EditableIDSetterNode(edit_input_nodes); // Makes shallow copy of list.
|
edit_id_output = new EditableIDSetterNode(edit_input_nodes); // Makes shallow copy of list.
|
||||||
edit_id_output.link_to(build_node);
|
edit_id_output.link_to(build_node);
|
||||||
|
|
||||||
|
let skp_inputs = [];
|
||||||
for (const skp of skp_order) {
|
for (const skp of skp_order) {
|
||||||
const elem = document.getElementById(skp+'-skp');
|
const elem = document.getElementById(skp+'-skp');
|
||||||
const node = new SumNumberInputNode('builder-'+skp+'-input', elem);
|
const node = new SumNumberInputNode('builder-'+skp+'-input', elem);
|
||||||
|
|
||||||
edit_agg_node.link_to(node, skp);
|
edit_agg_node.link_to(node, skp);
|
||||||
build_encode_node.link_to(node, skp);
|
build_encode_node.link_to(node, skp);
|
||||||
build_warnings_node.link_to(node, skp);
|
|
||||||
edit_input_nodes.push(node);
|
edit_input_nodes.push(node);
|
||||||
|
skp_inputs.push(node);
|
||||||
}
|
}
|
||||||
stat_agg_node.link_to(edit_agg_node);
|
stat_agg_node.link_to(edit_agg_node);
|
||||||
build_disp_node.link_to(stat_agg_node, 'stats');
|
build_disp_node.link_to(stat_agg_node, 'stats');
|
||||||
|
@ -1079,6 +1076,13 @@ function builder_graph_init() {
|
||||||
let skp_output = new SkillPointSetterNode(edit_input_nodes);
|
let skp_output = new SkillPointSetterNode(edit_input_nodes);
|
||||||
skp_output.link_to(build_node);
|
skp_output.link_to(build_node);
|
||||||
|
|
||||||
|
let build_warnings_node = new DisplayBuildWarningsNode();
|
||||||
|
build_warnings_node.link_to(build_node, 'build');
|
||||||
|
for (const [skp_input, skp] of zip2(skp_inputs, skp_order)) {
|
||||||
|
build_warnings_node.link_to(skp_input, skp);
|
||||||
|
}
|
||||||
|
build_warnings_node.update();
|
||||||
|
|
||||||
// call node.update() for each skillpoint node and stat edit listener node manually
|
// call node.update() for each skillpoint node and stat edit listener node manually
|
||||||
// NOTE: the text boxes for skill points are already filled out by decodeBuild() so this will fix them
|
// NOTE: the text boxes for skill points are already filled out by decodeBuild() so this will fix them
|
||||||
// this will propagate the update to the `stat_agg_node`, and then to damage calc
|
// this will propagate the update to the `stat_agg_node`, and then to damage calc
|
||||||
|
|
Loading…
Add table
Reference in a new issue