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>
<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/macy@2"></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/display_constants.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_ing.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/icons.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/load.js"></script>
<script type="text/javascript" src="/js/load_ing.js"></script>

View file

@ -1,5 +1,6 @@
How to convert:
0. start in the `js` directory
1. edit `atree_constants.js`
2. run `python3 ../py_script/atree-generateID.py
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)) {
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; }
// TODO: output (list...)
if (Array.isArray(effect.output)) {

View file

@ -4968,7 +4968,7 @@ const atrees = {
"behavior": "modify",
"target_part": "Total Damage",
"base_spell": 2,
"hits": {"Wind Slash": 1}
"hits": {"Wind Slash": 1, "Explosion Damage": 1}
}
]
},
@ -5061,30 +5061,48 @@ const atrees = {
"type": "stat_scaling",
"slider": true,
"slider_name": "Winded",
"output": {
"type": "stat",
"name": "nConvBase:2.Wind Slash"
},
"output": [
{
"type": "stat",
"name": "nConvBase:2.Wind Slash"
},
{
"type": "stat",
"name": "nConvBase:2.Explosion Damage"
}
],
"scaling": [30]
},
{
"type": "stat_scaling",
"slider": true,
"slider_name": "Winded",
"output": {
"type": "stat",
"name": "tConvBase:2.Wind Slash"
},
"output": [
{
"type": "stat",
"name": "tConvBase:2.Wind Slash"
},
{
"type": "stat",
"name": "tConvBase:2.Explosion Damage"
}
],
"scaling": [10]
},
{
"type": "stat_scaling",
"slider": true,
"slider_name": "Winded",
"output": {
"type": "stat",
"name": "aConvBase:2.Wind Slash"
},
"output": [
{
"type": "stat",
"name": "aConvBase:2.Wind Slash"
},
{
"type": "stat",
"name": "aConvBase:2.Explosion Damage"
}
],
"scaling": [5]
}
]
@ -5406,7 +5424,7 @@ const atrees = {
"effects": [
{
"type": "add_spell_prop",
"target_part": "Ice Snake",
"target_part": "Ice Snake Damage",
"base_spell": 4,
"multipliers": [0, 0, 0, 0, 0, 20]
}
@ -5711,6 +5729,7 @@ const atrees = {
{
"type": "add_spell_prop",
"target_part": "Orb Damage",
"base_spell": 5,
"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 element_prefix = parts[0];
let desc = parts[1];
let i_elem = document.createElement('span');
i_elem.classList.add(element_prefix);
i_elem.textContent = element_prefix;
let i_elem = make_elem('span', [element_prefix], {textContent: element_prefix});
p_elem.appendChild(i_elem);
let i_elem2 = document.createElement('span');
i_elem2.textContent = " " + desc + suffix;
let i_elem2 = make_elem('span', [], {textContent: " "+desc+suffix});
p_elem.appendChild(i_elem2);
}
@ -19,17 +16,14 @@ function displaySetBonuses(parent_id,build) {
setHTML(parent_id, "");
let parent_div = document.getElementById(parent_id);
let set_summary_elem = document.createElement('p');
set_summary_elem.classList.add('text-center');
set_summary_elem.textContent = "Set Bonuses";
let set_summary_elem = make_elem('p', ['text-center'], {textContent: "Set Bonuses"});
parent_div.append(set_summary_elem);
for (const [setName, count] of build.activeSetCounts) {
const active_set = sets.get(setName);
if (active_set["hidden"]) { continue; }
let set_elem = document.createElement('p');
set_elem.id = "set-"+setName;
let set_elem = make_elem('p', [], {id: "set-"+setName});
set_summary_elem.append(set_elem);
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);
if (id === "poison" && id_val > 0) {
let row = document.createElement('div');
row.classList.add("row")
let value_elem = document.createElement('div');
value_elem.classList.add('col');
value_elem.classList.add('text-end');
let row = make_elem('div', ['row']);
let value_elem = make_elem('div', ['col', 'text-end']);
let prefix_elem = document.createElement('b');
prefix_elem.textContent = "\u279C With Strength: ";
let number_elem = document.createElement('b');
number_elem.classList.add(style);
number_elem.textContent = (id_val * (1+skillPointsToPercentage(stats.get('str'))) ).toFixed(0) + idSuffixes[id];
let prefix_elem = make_elem('b', [], {textContent: "\u279C With Strength: "});
let number_elem = make_elem('b', [style], {
textContent: (id_val * (1+skillPointsToPercentage(stats.get('str'))) ).toFixed(0) + idSuffixes[id]
});
value_elem.append(prefix_elem);
value_elem.append(number_elem);
row.appendChild(value_elem);
parent_div.appendChild(row);
}
else if (id === "ls" && id_val != 0) {
let row = document.createElement('div');
row.classList.add("row")
let value_elem = document.createElement('div');
value_elem.classList.add('col');
value_elem.classList.add('text-end');
let row = make_elem('div', ['row']);
let value_elem = make_elem('div', ['col', 'text-end']);
let prefix_elem = document.createElement('b');
prefix_elem.textContent = "\u279C Effective LS: ";
let prefix_elem = make_elem('b', [], {textContent: "\u279C Effective LS: "});
let defStats = getDefenseStats(stats);
let number_elem = document.createElement('b');
number_elem.classList.add(style);
number_elem.textContent = Math.round(defStats[1][0]*id_val/defStats[0]) + "/3s";
let number_elem = ('b', [style], {
textContent: Math.round(defStats[1][0]*id_val/defStats[0]) + "/3s"
});
value_elem.append(prefix_elem);
value_elem.append(number_elem);
row.appendChild(value_elem);
@ -1891,6 +1877,7 @@ function displayIDProbabilities(parent_id, item, amp) {
parent_elem.appendChild(table_elem);
for (const [id,val] of Object.entries(itemMap.get(item_name))) {
if (rolledIDs.includes(id)) {
if (!item.get("maxRolls").get(id)) { continue; }
let min = item.get("minRolls").get(id);
let max = item.get("maxRolls").get(id);
//Apply corkian amps

View file

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