Merge pull request #141 from hppeng-wynn/misc_bugfix

Misc bugfix
This commit is contained in:
hppeng-wynn 2022-07-17 13:26:42 -07:00 committed by GitHub
commit e4ab47c636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 70 additions and 59 deletions

File diff suppressed because one or more lines are too long

View file

@ -1371,7 +1371,6 @@
</div> </div>
</div> </div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.6/dist/autoComplete.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.6/dist/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/macy@2"></script> <script src="https://cdn.jsdelivr.net/npm/macy@2"></script>
<script type="text/javascript" src="../js/utils.js"></script> <script type="text/javascript" src="../js/utils.js"></script>
@ -1385,8 +1384,6 @@
<script type="text/javascript" src="../js/atree_constants_min.js"></script> <script type="text/javascript" src="../js/atree_constants_min.js"></script>
<script type="text/javascript" src="../js/display_constants.js"></script> <script type="text/javascript" src="../js/display_constants.js"></script>
<script type="text/javascript" src="../js/display.js"></script> <script type="text/javascript" src="../js/display.js"></script>
<script type="text/javascript" src="../js/query.js"></script>
<script type="text/javascript" src="../js/query_2.js"></script>
<script type="text/javascript" src="../js/load.js"></script> <script type="text/javascript" src="../js/load.js"></script>
<script type="text/javascript" src="../js/load_ing.js"></script> <script type="text/javascript" src="../js/load_ing.js"></script>
<script type="text/javascript" src="../js/load_tome.js"></script> <script type="text/javascript" src="../js/load_tome.js"></script>

View file

@ -58,6 +58,7 @@
<script type="text/javascript" src="/js/build_utils.js"></script> <script type="text/javascript" src="/js/build_utils.js"></script>
<script type="text/javascript" src="/js/icons.js"></script> <script type="text/javascript" src="/js/icons.js"></script>
<script type="text/javascript" src="/js/damage_calc.js"></script> <script type="text/javascript" src="/js/damage_calc.js"></script>
<script type="text/javascript" src="/js/powders.js"></script>
<!-- <script type="text/javascript" src="/js/powders.js"></script> --> <!-- <script type="text/javascript" src="/js/powders.js"></script> -->
<script type="text/javascript" src="/js/load.js"></script> <script type="text/javascript" src="/js/load.js"></script>
<script type="text/javascript" src="/js/load_ing.js"></script> <script type="text/javascript" src="/js/load_ing.js"></script>

View file

@ -1,5 +1,6 @@
How to convert: How to convert:
0. start in the `js` directory
1. edit `atree_constants.js` 1. edit `atree_constants.js`
2. run `python3 ../py_script/atree-generateID.py 2. run `python3 ../py_script/atree-generateID.py
3. check that the site still works 3. check that the site still works

View file

@ -750,6 +750,7 @@ const atree_stats = new (class extends ComputeNode {
for (const [scaling, input] of zip2(effect.scaling, effect.inputs)) { for (const [scaling, input] of zip2(effect.scaling, effect.inputs)) {
total += scaling * item_stats.get(input.name); total += scaling * item_stats.get(input.name);
} }
if (total < 0) { total = 0; } // Normal stat scaling will not go negative.
if ('max' in effect && total > effect.max) { total = effect.max; } if ('max' in effect && total > effect.max) { total = effect.max; }
// TODO: output (list...) // TODO: output (list...)
if (Array.isArray(effect.output)) { if (Array.isArray(effect.output)) {

View file

@ -4968,7 +4968,7 @@ const atrees = {
"behavior": "modify", "behavior": "modify",
"target_part": "Total Damage", "target_part": "Total Damage",
"base_spell": 2, "base_spell": 2,
"hits": {"Wind Slash": 1} "hits": {"Wind Slash": 1, "Explosion Damage": 1}
} }
] ]
}, },
@ -5061,30 +5061,48 @@ const atrees = {
"type": "stat_scaling", "type": "stat_scaling",
"slider": true, "slider": true,
"slider_name": "Winded", "slider_name": "Winded",
"output": { "output": [
{
"type": "stat", "type": "stat",
"name": "nConvBase:2.Wind Slash" "name": "nConvBase:2.Wind Slash"
}, },
{
"type": "stat",
"name": "nConvBase:2.Explosion Damage"
}
],
"scaling": [30] "scaling": [30]
}, },
{ {
"type": "stat_scaling", "type": "stat_scaling",
"slider": true, "slider": true,
"slider_name": "Winded", "slider_name": "Winded",
"output": { "output": [
{
"type": "stat", "type": "stat",
"name": "tConvBase:2.Wind Slash" "name": "tConvBase:2.Wind Slash"
}, },
{
"type": "stat",
"name": "tConvBase:2.Explosion Damage"
}
],
"scaling": [10] "scaling": [10]
}, },
{ {
"type": "stat_scaling", "type": "stat_scaling",
"slider": true, "slider": true,
"slider_name": "Winded", "slider_name": "Winded",
"output": { "output": [
{
"type": "stat", "type": "stat",
"name": "aConvBase:2.Wind Slash" "name": "aConvBase:2.Wind Slash"
}, },
{
"type": "stat",
"name": "aConvBase:2.Explosion Damage"
}
],
"scaling": [5] "scaling": [5]
} }
] ]
@ -5406,7 +5424,7 @@ const atrees = {
"effects": [ "effects": [
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
"target_part": "Ice Snake", "target_part": "Ice Snake Damage",
"base_spell": 4, "base_spell": 4,
"multipliers": [0, 0, 0, 0, 0, 20] "multipliers": [0, 0, 0, 0, 0, 20]
} }
@ -5711,6 +5729,7 @@ const atrees = {
{ {
"type": "add_spell_prop", "type": "add_spell_prop",
"target_part": "Orb Damage", "target_part": "Orb Damage",
"base_spell": 5,
"hits": { "Single Orb": 2 } "hits": { "Single Orb": 2 }
} }
] ]

File diff suppressed because one or more lines are too long

View file

@ -5,13 +5,10 @@ function apply_elemental_format(p_elem, id, suffix) {
let parts = idPrefixes[id].split(/ (.*)/); let parts = idPrefixes[id].split(/ (.*)/);
let element_prefix = parts[0]; let element_prefix = parts[0];
let desc = parts[1]; let desc = parts[1];
let i_elem = document.createElement('span'); let i_elem = make_elem('span', [element_prefix], {textContent: element_prefix});
i_elem.classList.add(element_prefix);
i_elem.textContent = element_prefix;
p_elem.appendChild(i_elem); p_elem.appendChild(i_elem);
let i_elem2 = document.createElement('span'); let i_elem2 = make_elem('span', [], {textContent: " "+desc+suffix});
i_elem2.textContent = " " + desc + suffix;
p_elem.appendChild(i_elem2); p_elem.appendChild(i_elem2);
} }
@ -19,17 +16,14 @@ function displaySetBonuses(parent_id,build) {
setHTML(parent_id, ""); setHTML(parent_id, "");
let parent_div = document.getElementById(parent_id); let parent_div = document.getElementById(parent_id);
let set_summary_elem = document.createElement('p'); let set_summary_elem = make_elem('p', ['text-center'], {textContent: "Set Bonuses"});
set_summary_elem.classList.add('text-center');
set_summary_elem.textContent = "Set Bonuses";
parent_div.append(set_summary_elem); parent_div.append(set_summary_elem);
for (const [setName, count] of build.activeSetCounts) { for (const [setName, count] of build.activeSetCounts) {
const active_set = sets.get(setName); const active_set = sets.get(setName);
if (active_set["hidden"]) { continue; } if (active_set["hidden"]) { continue; }
let set_elem = document.createElement('p'); let set_elem = make_elem('p', [], {id: "set-"+setName});
set_elem.id = "set-"+setName;
set_summary_elem.append(set_elem); set_summary_elem.append(set_elem);
const bonus = active_set.bonuses[count-1]; const bonus = active_set.bonuses[count-1];
@ -111,36 +105,28 @@ function displayBuildStats(parent_id,build,command_group,stats){
} }
displayFixedID(parent_div, id, id_val, elemental_format, style); displayFixedID(parent_div, id, id_val, elemental_format, style);
if (id === "poison" && id_val > 0) { if (id === "poison" && id_val > 0) {
let row = document.createElement('div'); let row = make_elem('div', ['row']);
row.classList.add("row") let value_elem = make_elem('div', ['col', 'text-end']);
let value_elem = document.createElement('div');
value_elem.classList.add('col');
value_elem.classList.add('text-end');
let prefix_elem = document.createElement('b'); let prefix_elem = make_elem('b', [], {textContent: "\u279C With Strength: "});
prefix_elem.textContent = "\u279C With Strength: "; let number_elem = make_elem('b', [style], {
let number_elem = document.createElement('b'); textContent: (id_val * (1+skillPointsToPercentage(stats.get('str'))) ).toFixed(0) + idSuffixes[id]
number_elem.classList.add(style); });
number_elem.textContent = (id_val * (1+skillPointsToPercentage(stats.get('str'))) ).toFixed(0) + idSuffixes[id];
value_elem.append(prefix_elem); value_elem.append(prefix_elem);
value_elem.append(number_elem); value_elem.append(number_elem);
row.appendChild(value_elem); row.appendChild(value_elem);
parent_div.appendChild(row); parent_div.appendChild(row);
} }
else if (id === "ls" && id_val != 0) { else if (id === "ls" && id_val != 0) {
let row = document.createElement('div'); let row = make_elem('div', ['row']);
row.classList.add("row") let value_elem = make_elem('div', ['col', 'text-end']);
let value_elem = document.createElement('div');
value_elem.classList.add('col');
value_elem.classList.add('text-end');
let prefix_elem = document.createElement('b'); let prefix_elem = make_elem('b', [], {textContent: "\u279C Effective LS: "});
prefix_elem.textContent = "\u279C Effective LS: ";
let defStats = getDefenseStats(stats); let defStats = getDefenseStats(stats);
let number_elem = document.createElement('b'); let number_elem = ('b', [style], {
number_elem.classList.add(style); textContent: Math.round(defStats[1][0]*id_val/defStats[0]) + "/3s"
number_elem.textContent = Math.round(defStats[1][0]*id_val/defStats[0]) + "/3s"; });
value_elem.append(prefix_elem); value_elem.append(prefix_elem);
value_elem.append(number_elem); value_elem.append(number_elem);
row.appendChild(value_elem); row.appendChild(value_elem);
@ -1891,6 +1877,7 @@ function displayIDProbabilities(parent_id, item, amp) {
parent_elem.appendChild(table_elem); parent_elem.appendChild(table_elem);
for (const [id,val] of Object.entries(itemMap.get(item_name))) { for (const [id,val] of Object.entries(itemMap.get(item_name))) {
if (rolledIDs.includes(id)) { if (rolledIDs.includes(id)) {
if (!item.get("maxRolls").get(id)) { continue; }
let min = item.get("minRolls").get(id); let min = item.get("minRolls").get(id);
let max = item.get("maxRolls").get(id); let max = item.get("maxRolls").get(id);
//Apply corkian amps //Apply corkian amps

View file

@ -20,14 +20,17 @@ function init_itempage() {
//displayExpandedItem(expandItem(itemMap.get(item_url_tag).statMap, []), "item-view"); //displayExpandedItem(expandItem(itemMap.get(item_url_tag).statMap, []), "item-view");
try{ try{
item = expandItem(itemMap.get(item_url_tag.replaceAll("%20"," ")), []); item = expandItem(itemMap.get(item_url_tag.replaceAll("%20"," ")), []);
displaysq2ExpandedItem(item, "item-view"); if (item.get('category') === 'weapon') {
displaysq2AdditionalInfo("additional-info", item); item.set('powders', []);
displaysq2IDCosts("identification-costs", item); apply_weapon_powders(item);
if (item.get("set") && sets[item.get("set")]) {
displaysq2AllSetBonuses("set-bonus-info",item.get("set"));
} }
console.log(item); displayExpandedItem(item, "item-view");
displaysq2IDProbabilities("identification-probabilities", item, amp_state); displayAdditionalInfo("additional-info", item);
displayIDCosts("identification-costs", item);
if (item.get("set") && sets[item.get("set")]) {
displayAllSetBonuses("set-bonus-info",item.get("set"));
}
displayIDProbabilities("identification-probabilities", item, amp_state);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
console.log(error.stack); console.log(error.stack);
@ -56,6 +59,8 @@ function toggleAmps(button_id) {
} }
(async function() {
load_init(init_itempage); let load_promises = [ load_init() ];
//load_ing_init(init); await Promise.all(load_promises);
init_itempage();
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB