Merge branch 'dev' of https://github.com/hppeng-wynn/hppeng-wynn.github.io into dev
This commit is contained in:
commit
33da3b89e7
4 changed files with 116 additions and 100 deletions
138
display.js
138
display.js
|
@ -227,7 +227,25 @@ function displayBuildStats(build, parent_id){
|
|||
style = "negative";
|
||||
}
|
||||
}
|
||||
displayFixedID(active_elem, id, stats.get(id), elemental_format, style);
|
||||
let id_val = stats.get(id);
|
||||
displayFixedID(active_elem, id, id_val, elemental_format, style);
|
||||
if (id === "poison" && id_val > 0) {
|
||||
let style = "positive";
|
||||
let row = document.createElement('tr');
|
||||
let value_elem = document.createElement('td');
|
||||
value_elem.classList.add('right');
|
||||
value_elem.setAttribute("colspan", "2");
|
||||
let prefix_elem = document.createElement('b');
|
||||
prefix_elem.textContent = "-> With Strength: ";
|
||||
let number_elem = document.createElement('b');
|
||||
number_elem.classList.add(style);
|
||||
number_elem.textContent = (id_val * (1+skillPointsToPercentage(build.total_skillpoints[0]))).toFixed(0) + idSuffixes[id];
|
||||
value_elem.append(prefix_elem);
|
||||
value_elem.append(number_elem);
|
||||
row.appendChild(value_elem);
|
||||
|
||||
active_elem.appendChild(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -332,72 +350,62 @@ function displayExpandedItem(item, parent_id){
|
|||
else {
|
||||
let id = command;
|
||||
if(nonRolledIDs.includes(id) && item.get(id)){//nonRolledID & non-0/non-null/non-und ID
|
||||
let p_elem = displayFixedID(active_elem, id, item.get(id), elemental_format);
|
||||
if (id === "slots") {
|
||||
let p_elem = document.createElement("p");
|
||||
// PROPER POWDER DISPLAYING EZ CLAP
|
||||
p_elem.textContent = "";
|
||||
let powderMap = new Map([ ["e", "Earth"], ["t", "Thunder"], ["w", "Water"], ["f", "Fire"], ["a", "Air"]]);
|
||||
let numerals = new Map([["1", "I"], ["2", "II"], ["3", "III"], ["4", "IV"], ["5", "V"], ["6", "VI"]]);
|
||||
let numerals = new Map([[1, "I"], [2, "II"], [3, "III"], [4, "IV"], [5, "V"], [6, "VI"]]);
|
||||
/*p_elem.textContent = idPrefixes[id].concat(item.get(id), idSuffixes[id]) +
|
||||
" [ " + item.get("powders").map(x => powderNames.get(x)) + " ]";*/
|
||||
let wrapper = document.createElement("p");
|
||||
p_elem.classList.add("itemtable");
|
||||
let row = document.createElement("tr");
|
||||
|
||||
let powderPrefix = document.createElement("td");
|
||||
let powderPrefix = document.createElement("b");
|
||||
powderPrefix.classList.add("itemp");
|
||||
powderPrefix.classList.add("left");
|
||||
powderPrefix.textContent = "Powders: [";
|
||||
row.appendChild(powderPrefix);
|
||||
powderPrefix.textContent = "Powder Slots: " + item.get(id) + " [";
|
||||
p_elem.appendChild(powderPrefix);
|
||||
|
||||
let spaceElem = document.createElement("td");
|
||||
//spaceElem.textContent = " ";
|
||||
spaceElem.classList.add("itemp");
|
||||
|
||||
|
||||
let powderList = item.get("powders").map(x => powderNames.get(x))
|
||||
for(let i = 0; i < powderList.length; i++){
|
||||
let powder = document.createElement("td");
|
||||
let powderStr = powderList[i];
|
||||
powder.textContent = numerals.get(powderStr.charAt(1), 10);
|
||||
powder.classList.add(powderMap.get(powderStr.charAt(0)));
|
||||
powder.classList.add("nopadding");
|
||||
row.appendChild(powder);
|
||||
let powders = item.get("powders");
|
||||
console.log(powders);
|
||||
for (let i = 0; i < powders.length; i++) {
|
||||
let powder = document.createElement("b");
|
||||
powder.textContent = numerals.get((powders[i]%6)+1)+" ";
|
||||
powder.classList.add(damageClasses[Math.floor(powders[i]/6)+1]+"_powder");
|
||||
p_elem.appendChild(powder);
|
||||
}
|
||||
|
||||
let powderSuffix = document.createElement("td");
|
||||
let powderSuffix = document.createElement("b");
|
||||
powderSuffix.classList.add("itemp");
|
||||
powderSuffix.classList.add("left");
|
||||
powderSuffix.classList.add("nopadding");
|
||||
powderSuffix.textContent = "]";
|
||||
row.appendChild(powderSuffix);
|
||||
|
||||
wrapper.appendChild(row);
|
||||
p_elem.appendChild(wrapper);
|
||||
}else if(id === "displayName"){
|
||||
p_elem.classList.add("title");
|
||||
if(item.get("tier") !== " "){
|
||||
p_elem.classList.add(item.get("tier"));
|
||||
p_elem.appendChild(powderSuffix);
|
||||
active_elem.appendChild(p_elem);
|
||||
}
|
||||
else {
|
||||
let p_elem = displayFixedID(active_elem, id, item.get(id), elemental_format);
|
||||
if (id === "displayName") {
|
||||
p_elem.classList.add("title");
|
||||
if (item.get("tier") !== " ") {
|
||||
p_elem.classList.add(item.get("tier"));
|
||||
}
|
||||
} else if (skp_order.includes(id)) { //id = str, dex, int, def, or agi
|
||||
p_elem.textContent = "";
|
||||
p_elem.classList.add("itemtable");
|
||||
let row = document.createElement("tr");
|
||||
let title = document.createElement("td");
|
||||
title.textContent = idPrefixes[id] + " ";
|
||||
let boost = document.createElement("td");
|
||||
if (item.get(id) < 0) {
|
||||
boost.classList.add("negative");
|
||||
} else { //boost = 0 SHOULD not come up
|
||||
boost.classList.add("positive");
|
||||
}
|
||||
boost.classList.add("spaceLeft");
|
||||
boost.textContent = item.get(id);
|
||||
row.appendChild(title);
|
||||
row.appendChild(boost);
|
||||
p_elem.appendChild(row);
|
||||
} else if (id === "restrict") {
|
||||
p_elem.classList.add("restrict");
|
||||
}
|
||||
}else if(skp_order.includes(id)){ //id = str, dex, int, def, or agi
|
||||
p_elem.textContent = "";
|
||||
p_elem.classList.add("itemtable");
|
||||
let row = document.createElement("tr");
|
||||
let title = document.createElement("td");
|
||||
title.textContent = idPrefixes[id] + " ";
|
||||
let boost = document.createElement("td");
|
||||
if(item.get(id) < 0){
|
||||
boost.classList.add("negative");
|
||||
}else{ //boost = 0 SHOULD not come up
|
||||
boost.classList.add("positive");
|
||||
}
|
||||
boost.classList.add("spaceLeft");
|
||||
boost.textContent = item.get(id);
|
||||
row.appendChild(title);
|
||||
row.appendChild(boost);
|
||||
p_elem.appendChild(row);
|
||||
}else if(id === "restrict"){
|
||||
p_elem.classList.add("restrict");
|
||||
}
|
||||
}
|
||||
else if (rolledIDs.includes(id) && item.get("minRolls").get(id)){ // && item.get("maxRolls").get(id) ){//rolled ID & non-0/non-null/non-und ID
|
||||
|
@ -580,6 +588,24 @@ function displayEquipOrder(parent_elem,buildOrder){
|
|||
}
|
||||
}
|
||||
|
||||
function displayPoisonDamage(overallparent_elem, build) {
|
||||
overallparent_elem.textContent = "";
|
||||
|
||||
//Title
|
||||
let title_elemavg = document.createElement("p");
|
||||
title_elemavg.classList.add("smalltitle");
|
||||
title_elemavg.classList.add("Normal");
|
||||
title_elemavg.textContent = "Poison Stats";
|
||||
overallparent_elem.append(title_elemavg);
|
||||
|
||||
let overallpoisonDamage = document.createElement("p");
|
||||
overallpoisonDamage.classList.add("itemp");
|
||||
let poison_tick = Math.floor(build.statMap.get("poison") * (1+skillPointsToPercentage(build.total_skillpoints[0]))/3);
|
||||
overallpoisonDamage.textContent = "Poison Tick: " + poison_tick;
|
||||
overallparent_elem.append(overallpoisonDamage);
|
||||
overallparent_elem.append(document.createElement("br"));
|
||||
}
|
||||
|
||||
function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats){
|
||||
let attackSpeeds = ["Super Slow", "Very Slow", "Slow", "Normal", "Fast", "Very Fast", "Super Fast"];
|
||||
//let damagePrefixes = ["Neutral Damage: ","Earth Damage: ","Thunder Damage: ","Water Damage: ","Fire Damage: ","Air Damage: "];
|
||||
|
@ -612,7 +638,7 @@ function displayMeleeDamage(parent_elem, overallparent_elem, meleeStats){
|
|||
|
||||
//overall title
|
||||
let title_elemavg = document.createElement("p");
|
||||
title_elemavg.classList.add("title");
|
||||
title_elemavg.classList.add("smalltitle");
|
||||
title_elemavg.classList.add("Normal");
|
||||
title_elemavg.textContent = "Melee Stats";
|
||||
overallparent_elem.append(title_elemavg);
|
||||
|
@ -873,12 +899,12 @@ function displaySpellDamage(parent_elem, overallparent_elem, build, spell, spell
|
|||
|
||||
const stats = build.statMap;
|
||||
let title_elem = document.createElement("p");
|
||||
title_elem.classList.add("title");
|
||||
title_elem.classList.add("smalltitle");
|
||||
title_elem.classList.add("Normal");
|
||||
|
||||
overallparent_elem.textContent = "";
|
||||
let title_elemavg = document.createElement("p");
|
||||
title_elemavg.classList.add('title');
|
||||
title_elemavg.classList.add('smalltitle');
|
||||
title_elemavg.classList.add('Normal');
|
||||
|
||||
if (spellIdx != 0) {
|
||||
|
|
|
@ -185,6 +185,9 @@
|
|||
<div class="spell-info">
|
||||
<div class="center" id="spell3-infoAvg">spell4</div>
|
||||
</div>
|
||||
<div class="spell-info">
|
||||
<div class="center" id="build-poison-stats">poison</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="skillpoints">
|
||||
|
|
70
styles.css
70
styles.css
|
@ -60,6 +60,10 @@ a.link{
|
|||
text-align: center;
|
||||
font-size: 150%;
|
||||
}
|
||||
.smalltitle{
|
||||
text-align: center;
|
||||
font-size: 125%;
|
||||
}
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -134,53 +138,33 @@ a.link{
|
|||
/*text-shadow: 2px 2px 0 #1f1515;*/
|
||||
}
|
||||
|
||||
.Earth {
|
||||
color: #0a0;
|
||||
/*text-shadow: 2px 2px 0 #002a00;*/
|
||||
}
|
||||
.Earth:before {
|
||||
content: "\2724" ' ';
|
||||
}
|
||||
.Earth { color: #0a0; }
|
||||
.Earth:before { content: "\2724" ' '; }
|
||||
.Earth_powder { color: #0a0; }
|
||||
.Earth_powder:before { content: "\2724"; }
|
||||
|
||||
.Thunder {
|
||||
color: #ff5;
|
||||
/*text-shadow: 2px 2px 0 #3f3f15;*/
|
||||
}
|
||||
.Thunder:before {
|
||||
content: "\2726" ' ';
|
||||
}
|
||||
.Thunder { color: #ff5; }
|
||||
.Thunder:before { content: "\2726" ' '; }
|
||||
.Thunder_powder { color: #ff5; }
|
||||
.Thunder_powder:before { content: "\2726"; }
|
||||
|
||||
.Water {
|
||||
color: #5ff;
|
||||
/*text-shadow: 2px 2px 0 #153f3f;*/
|
||||
}
|
||||
.Water:before {
|
||||
content: "\2749" ' ';
|
||||
}
|
||||
.Water { color: #5ff; }
|
||||
.Water:before { content: "\2749" ' '; }
|
||||
.Water_powder { color: #5ff; }
|
||||
.Water_powder:before { content: "\2749"; }
|
||||
|
||||
.Fire {
|
||||
color: #f55;
|
||||
/*text-shadow: 2px 2px 0 #1f1515;*/
|
||||
}
|
||||
.Fire:before {
|
||||
content: "\2739" ' ';
|
||||
}
|
||||
.Fire { color: #f55; }
|
||||
.Fire:before { content: "\2739" ' '; }
|
||||
.Fire_powder { color: #f55; }
|
||||
.Fire_powder:before { content: "\2739"; }
|
||||
|
||||
.Air {
|
||||
color: #fff;
|
||||
/*text-shadow: 2px 2px 0 #3f3f3f;*/
|
||||
}
|
||||
.Air:before {
|
||||
content: "\274b" ' ';
|
||||
}
|
||||
.Air { color: #fff; }
|
||||
.Air:before { content: "\274b" ' '; }
|
||||
.Air_powder { color: #fff; }
|
||||
.Air_powder:before { content: "\274b"; }
|
||||
|
||||
.Neutral {
|
||||
color: #fa0;
|
||||
/*text-shadow: 2px 2px 0 #2a2a00;*/
|
||||
}
|
||||
.Neutral:before {
|
||||
content: "\2724" ' ';
|
||||
}
|
||||
.Neutral { color: #fa0; }
|
||||
.Neutral:before { content: "\2724" ' '; }
|
||||
|
||||
.Health {
|
||||
color: #a00;
|
||||
|
@ -266,6 +250,6 @@ input {
|
|||
.Set{
|
||||
color:#5f5;
|
||||
}
|
||||
.restrict{
|
||||
.restrict {
|
||||
color: #ff006a;
|
||||
}
|
||||
|
|
5
test.js
5
test.js
|
@ -11,7 +11,7 @@ console.log(url_tag);
|
|||
* END testing section
|
||||
*/
|
||||
|
||||
const BUILD_VERSION = "5.2";
|
||||
const BUILD_VERSION = "5.3";
|
||||
|
||||
document.getElementById("header").textContent = "Wynn build calculator "+BUILD_VERSION+" (db version "+DB_VERSION+")";
|
||||
|
||||
|
@ -543,6 +543,8 @@ function calculateBuildStats() {
|
|||
|
||||
//setHTML("build-defense-stats", "".concat(defenseStats));
|
||||
|
||||
displayPoisonDamage(document.getElementById("build-poison-stats"),player_build);
|
||||
|
||||
let spells = spell_table[player_build.weapon.get("type")];
|
||||
for (let i = 0; i < 4; ++i) {
|
||||
let parent_elem = document.getElementById("spell"+i+"-info");
|
||||
|
@ -565,6 +567,7 @@ function resetFields(){
|
|||
setValue("int-skp", "0");
|
||||
setValue("def-skp", "0");
|
||||
setValue("agi-skp", "0");
|
||||
setValue("level-choice", "");
|
||||
location.hash = "";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue