diff --git a/.travis.yml b/.travis.yml index 0c77f3061..17463e00f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,3 +3,6 @@ node_js: - 8 before_install: - "npm update -g npm" +script: + - npm test + - npm run production-build diff --git a/src/chara.js b/src/chara.js index 991682b5e..a202eab87 100644 --- a/src/chara.js +++ b/src/chara.js @@ -277,6 +277,7 @@ var Chara = CreateClass({ isConsideredInAverage: true, openBufflist: false, openLBlist: false, + openEXLBlist: false, normalBuff: 0, elementBuff: 0, otherBuff: 0, @@ -297,6 +298,15 @@ var Chara = CreateClass({ LBCritical2: "none", LBCritical3: "none", LBCritical4: "none", + EXLBATK: 0, + EXLBHP: 0, + EXLBOugiDamage: 0, + EXLBOugiDamageLimit: 0, + EXLBCritical: 0, + EXLBHaisui: 0, + EXLBKonshin: 0, + EXLBDA: 0, + EXLBTA: 0, }; }, componentDidMount: function () { @@ -419,6 +429,9 @@ var Chara = CreateClass({ switchLBlist: function (e) { this.setState({openLBlist: !(this.state.openLBlist)}) }, + switchEXLBlist: function (e) { + this.setState({openEXLBlist: !(this.state.openEXLBlist)}) + }, render: function () { var locale = this.props.locale; @@ -511,9 +524,9 @@ var Chara = CreateClass({ {intl.translate("奥義倍率", locale)} - % - + + {intl.translate("サポアビ", locale)}1 @@ -699,6 +712,99 @@ var Chara = CreateClass({ ] : null} + + + + + + + + {this.state.openEXLBlist ? + [ + + {intl.translate("攻撃力", locale)} + + + {selector.EXlimitBonusAttackList} + + + , + + HP + + + {selector.EXlimitBonusHPList} + + + , + + {intl.translate("奥義ダメージ", locale)} + + + {selector.EXlimitBonusOugiDamageList} + + % + , + + {intl.translate("奥義ダメージ上限", locale)} + + + {selector.EXlimitBonusOugiDamageLimitList} + + % + , + + {intl.translate("クリティカル確率", locale)} + + + {selector.EXlimitBonusCriticalList} + + % + , + + {intl.translate("背水", locale)} + + + {selector.EXlimitBonusHaisuiList} + + + , + + {intl.translate("渾身", locale)} + + + {selector.EXlimitBonusKonshinList} + + + , + + {intl.translate("DA", locale)} + + + {selector.EXlimitBonusDAList} + + % + , + + {intl.translate("TA", locale)} + + + {selector.EXlimitBonusTAList} + + % + + ] + : null} + diff --git a/src/global_const.js b/src/global_const.js index 35f36d9cd..c5ecdfb73 100644 --- a/src/global_const.js +++ b/src/global_const.js @@ -383,6 +383,17 @@ var limitBonusCriticalList = { }, }; +// Chara EX limitBonus +var EXlimitBonusAttackList = [0, 300, 600, 900, 1200, 1500, 1800, 2100, 2400, 2700, 3000]; +var EXlimitBonusHPList = [0, 150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500]; +var EXlimitBonusOugiDamageList = [0, 10, 12, 14, 16, 18, 20, 22, 24, 27, 30]; +var EXlimitBonusOugiDamageLimitList = [0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; +var EXlimitBonusCriticalList = [0, 10, 12, 14, 16, 18, 20, 22, 24, 27, 30]; +var EXlimitBonusHaisuiList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +var EXlimitBonusKonshinList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +var EXlimitBonusDAList = [0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; +var EXlimitBonusTAList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var enemyDefenseType = { 10.0: { "name": "敵防御10.0" }, 10.5: { "name": "敵防御10.5" }, @@ -2224,7 +2235,7 @@ module.exports.selector.skilllevel20Limit = Object.keys(skillLevelList20Limit).m return }); -// Limit Bonus Selectors +// Chara Limit Bonus Selectors module.exports.selector.limitBonusAttackList = limitBonusAttackList.map(function (opt) { return ; }); @@ -2244,6 +2255,36 @@ module.exports.selector.limitBonusCriticalList = Object.keys(limitBonusCriticalL return }); +// Chara EX Limit Bonus Selectors +module.exports.selector.EXlimitBonusAttackList = EXlimitBonusAttackList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusHPList = EXlimitBonusHPList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusOugiDamageList = EXlimitBonusOugiDamageList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusOugiDamageLimitList = EXlimitBonusOugiDamageLimitList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusCriticalList = EXlimitBonusCriticalList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusHaisuiList = EXlimitBonusHaisuiList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusKonshinList = EXlimitBonusKonshinList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusDAList = EXlimitBonusDAList.map(function (opt) { + return ; +}); +module.exports.selector.EXlimitBonusTAList = EXlimitBonusTAList.map(function (opt) { + return ; +}); + + module.exports.selector.ja.supported_chartsortkeys = Object.keys(supportedChartSortkeys).map(function (opt) { return }); diff --git a/src/global_logic.js b/src/global_logic.js index 058a2c011..006dbd89f 100644 --- a/src/global_logic.js +++ b/src/global_logic.js @@ -404,6 +404,9 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { var normalKonshinCoeff = 1.0 + 0.01 * totals[key]["normalKonshin"] * totalSummon["zeus"]; normalKonshinCoeff += 0.01 * totals[key]["normalOtherKonshin"]; + + var LBKonshinCoeff = 1.0 + module.exports.calcLBHaisuiValue("EXLBKonshin", totals[key]["EXLB"]["Konshin"], totals[key]["remainHP"]); + // Also calculate the attribute (elapsed turn) with the maximum value 属性(経過ターン)も最大値で計算する var elementCoeff = totals[key]["typeBonus"]; elementCoeff += totalSummon["element"] - 1.0; @@ -426,6 +429,9 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { // Character Emnity var charaHaisuiCoeff = 1.0 + 0.01 * totals[key]["charaHaisui"]; + //chara LB Emnity + var LBHaisuiCoeff = 1.0 + module.exports.calcLBHaisuiValue("EXLBHaisui", totals[key]["EXLB"]["Haisui"], totals[key]["remainHP"]); + // hp magnification var hpCoeff = 1.0; hpCoeff += 0.01 * totals[key]["normalHP"] * totalSummon["zeus"]; @@ -468,8 +474,10 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { summedAttack += totals[key]["armAttack"]; summedAttack += totalSummon["attack"]; summedAttack += totals[key]["LB"].ATK; + summedAttack += totals[key]["EXLB"].ATK; // HP displayHP += totals[key]["LB"].HP; + displayHP += totals[key]["EXLB"].HP; var totalHP = displayHP * hpCoeff } @@ -479,6 +487,8 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { totalSkillCoeff *= elementCoeff; totalSkillCoeff *= otherCoeff; totalSkillCoeff *= charaHaisuiCoeff; + totalSkillCoeff *= LBHaisuiCoeff; + totalSkillCoeff *= LBKonshinCoeff; totalSkillCoeff *= 1.0 - totals[key]["ATKDebuff"]; var totalAttack = summedAttack * totalSkillCoeff; @@ -506,6 +516,7 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { // unknown never reaches 50% of the current situation var totalDA = 0.01 * totals[key]["baseDA"]; totalDA += 0.01 * totals[key]["LB"]["DA"]; + totalDA += 0.01 * totals[key]["EXLB"]["DA"]; totalDA += buff["da"]; totalDA += totals[key]["DABuff"]; totalDA += totalSummon["da"]; @@ -529,6 +540,7 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { var armTAupOther = totals[key]["TAbuff"] <= 50.0 ? totals[key]["TAbuff"] : 50.0; var totalTA = 0.01 * totals[key]["baseTA"]; totalTA += 0.01 * totals[key]["LB"]["TA"]; + totalTA += 0.01 * totals[key]["EXLB"]["TA"]; totalTA += buff["ta"]; totalTA += totals[key]["TABuff"]; totalTA += totalSummon["ta"]; @@ -553,8 +565,9 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { // Generate normal critical skill arrays. var LBCriticalArray = getLBCriticalArray(totals[key]["LB"]); + var EXLBCriticalArray = getEXLBCriticalArray(totals[key]["EXLB"]["Critical"]); var normalOtherCriticalBuffArray = totals[key]["normalOtherCriticalBuff"]; - var normalOtherCriticalArray = totals[key]["normalOtherCritical"].concat(LBCriticalArray, normalOtherCriticalBuffArray); + var normalOtherCriticalArray = totals[key]["normalOtherCritical"].concat(LBCriticalArray, EXLBCriticalArray, normalOtherCriticalBuffArray); var criticalArray = module.exports.calcCriticalArray(totals[key]["normalCritical"], totals[key]["magnaCritical"], normalOtherCriticalArray, totalSummon); var criticalRatio = module.exports.calcCriticalRatio(criticalArray) @@ -563,8 +576,9 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { var damageUP = 0.0; var LBCriticalArray = getLBCriticalArray(totals[key]["LB"]); + var EXLBCriticalArray = getEXLBCriticalArray(totals[key]["EXLB"]["Critical"]); var normalOtherCriticalBuffArray = totals[key]["normalOtherCriticalBuff"]; - var normalOtherCriticalArray = totals[key]["normalOtherCritical"].concat(LBCriticalArray, normalOtherCriticalBuffArray); + var normalOtherCriticalArray = totals[key]["normalOtherCritical"].concat(LBCriticalArray, EXLBCriticalArray, normalOtherCriticalBuffArray); var criticalArray = module.exports.calcCriticalArray(totals[key]["normalCritical"], totals[key]["magnaCritical"], normalOtherCriticalArray, totalSummon); var criticalRatio = module.exports.calcCriticalRatio(criticalArray) @@ -604,7 +618,8 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { ougiDamageLimit += Math.min(0.15, totals[key]["omegaOugiDamageLimit"]); ougiDamageLimit += buff["ougiDamageLimit"] + totals[key]["ougiDamageLimitBuff"]; ougiDamageLimit += 0.01 * totalSummon["damageLimit"]; - + ougiDamageLimit += 0.01 * totals[key]["EXLB"]["OugiDamageLimit"]; + // Chain Burst var chainDamageLimit = 0.01 * (totals[key]["chainDamageLimit"] + (totals[key]["normalChainDamageLimit"] * totalSummon["zeus"])); @@ -633,6 +648,8 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { var ougiDamageSkill = 0.01 * (ougiDamageByCosmosAT + ougiDamageByMagna + ougiDamageByNormal + ougiDamageByMystery); var ougiDamageExceptSkill = totals[key]["ougiDamageBuff"] + totalSummon["ougiDamage"] + buff['ougiDamage']; + ougiDamageExceptSkill += 0.01 * totals[key]["EXLB"]["OugiDamage"]; + if (key == "Djeeta") { ougiDamageExceptSkill += buff["zenithOugiDamage"]; } @@ -669,7 +686,7 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { if (expectedTurn === Infinity) { expectedCycleDamagePerTurn = expectedAttack * damage; } - + // Display array var coeffs = {}; @@ -684,6 +701,8 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { coeffs["ex"] = exCoeff; coeffs["exHaisui"] = exHaisuiCoeff; coeffs["charaHaisui"] = charaHaisuiCoeff; + coeffs["LBHaisui"] = LBHaisuiCoeff; + coeffs["LBKonshin"] = LBKonshinCoeff; coeffs["other"] = otherCoeff; coeffs["hpRatio"] = hpCoeff; coeffs["additionalDamage"] = additionalDamage; @@ -743,6 +762,8 @@ module.exports.calcBasedOneSummon = function (summonind, prof, buff, totals) { chainBurst: chainBurst, expectedTurn: expectedTurn, expectedCycleDamagePerTurn: expectedCycleDamagePerTurn, + exlbHaisui: totals[key]["EXLB"]["Haisui"], + exlbKonshin: totals[key]["EXLB"]["Konshin"], }; } @@ -946,6 +967,111 @@ module.exports.calcHaisuiValue = function (haisuiType, haisuiAmount, haisuiSLv, return 0.0; }; +module.exports.calcLBHaisuiValue = function (haisuiType, haisuiAmount, haisuiRemainHP) { + var remainHP = haisuiRemainHP; + var value = 0.0; + + if (haisuiType == 'EXLBHaisui' || haisuiType == 'LBHaisui') { + if (haisuiAmount == "1") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.0104 * remainHP + 0.0278; + } else { + value = -0.0548 * remainHP + 0.05; + } + } else if (haisuiAmount == "2") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.0132 * remainHP + 0.0299; + } else { + value = -0.0734 * remainHP + 0.06; + } + } else if (haisuiAmount == "3") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.0148 * remainHP + 0.0411; + } else { + value = -0.0826 * remainHP + 0.075; + } + } else if (haisuiAmount == "4") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.02 * remainHP + 0.045; + } else { + value = -0.11 * remainHP + 0.09; + } + } else if (haisuiAmount == "5") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.016 * remainHP + 0.052; + } else { + value = -0.112 * remainHP + 0.1; + } + } else if (haisuiAmount == "6") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.02 * remainHP + 0.055; + } else { + value = -0.13 * remainHP + 0.11; + } + } else if (haisuiAmount == "7") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.0268 * remainHP + 0.0601; + } else { + value = -0.1466 * remainHP + 0.12; + } + } else if (haisuiAmount == "8") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.024 * remainHP + 0.068; + } else { + value = -0.138 * remainHP + 0.125; + } + } else if (haisuiAmount == "9") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.0292 * remainHP + 0.0719; + } else { + value = -0.1604 * remainHP + 0.1375; + } + } else if (haisuiAmount == "10") { + if (remainHP > 0.75 && remainHP <= 1) { + value = 0.01; + } else if (remainHP > 0.5 && remainHP <= 0.75) { + value = -0.0332 * remainHP + 0.0749; + } else { + value = -0.1834 * remainHP + 0.15; + } + } + } + + if (haisuiType == 'EXLBKonshin' || haisuiType == 'LBKonshin') { + switch (haisuiAmount) { + case 1: value = Math.min(0.03, 0.03 * remainHP + 0.01); break; + case 2: value = Math.min(0.04, 0.03 * remainHP + 0.01); break; + case 3: value = Math.min(0.05, 0.04 * remainHP + 0.02); break; + case 4: value = Math.min(0.06, 0.04 * remainHP + 0.02); break; + case 5: value = Math.min(0.07, 0.06 * remainHP + 0.03); break; + case 6: value = Math.min(0.08, 0.06 * remainHP + 0.03); break; + case 7: value = Math.min(0.09, 0.06 * remainHP + 0.03); break; + case 8: value = Math.min(0.10, 0.08 * remainHP + 0.04); break; + case 9: value = Math.min(0.11, 0.08 * remainHP + 0.04); break; + case 10: value = Math.min(0.12, 0.08 * remainHP + 0.04); break; + } + } + + return value; +}; function* eachSkill(arm) { const _skill_element_keys = [ @@ -1679,6 +1805,42 @@ function getLBCriticalArray(charaLB) { return criticalArray; } +function getCharaEXLB(chara) { + var EXLB = { + "ATK": 0, + "HP": 0, + "OugiDamage": 0, + "OugiDamageLimit": 0, + "Critical": "0", + "Haisui": "0", + "Konshin": "0", + "DA": 0.0, + "TA": 0.0, + }; + + Object.keys(EXLB).map((key) => { + var exactKey = "EXLB" + key; + if (exactKey in chara) { + EXLB[key] = parseInt(chara[exactKey], 10); + } + }); + + return EXLB; +} + +function getEXLBCriticalArray(charaEXLB) { + var criticalArray = []; + + if (charaEXLB != "0") { + criticalArray.push({ + "value": charaEXLB * 0.01, + "attackRatio": 0.30 + }); + } + + return criticalArray; +} + module.exports.getInitialTotals = function (prof, chara, summon) { var baseAttack = module.exports.calcBaseATK(parseInt(prof.rank)); var baseHP = module.exports.calcBaseHP(parseInt(prof.rank)); @@ -1730,6 +1892,7 @@ module.exports.getInitialTotals = function (prof, chara, summon) { type: job.type, element: element, LB: getCharaLB({}), + EXLB: getCharaEXLB({}), HPdebuff: 0.00, magna: 0, magnaSoka: 0, @@ -1861,6 +2024,7 @@ module.exports.getInitialTotals = function (prof, chara, summon) { } var charaLB = getCharaLB(chara[i]); + var charaEXLB = getCharaEXLB(chara[i]); totals[charakey] = { baseAttack: parseInt(chara[i].attack), @@ -1877,6 +2041,7 @@ module.exports.getInitialTotals = function (prof, chara, summon) { type: chara[i].type, element: charaelement, LB: charaLB, + EXLB: charaEXLB, HPdebuff: 0.00, magna: 0, magnaSoka: 0, @@ -2347,7 +2512,7 @@ module.exports.generateHaisuiData = function (res, arml, summon, prof, chara, st // Because the character formation is unchanged every weapon organization, it can be calculated earlier var charaHaisuiBuff = []; for (var k = 0; k < 100; ++k) { - var charaHaisuiValue = module.exports.recalcCharaHaisui(chara, 0.01 * (k + 1)); + let charaHaisuiValue = module.exports.recalcCharaHaisui(chara, 0.01 * (k + 1)); charaHaisuiBuff.push(charaHaisuiValue); } @@ -2403,7 +2568,19 @@ module.exports.generateHaisuiData = function (res, arml, summon, prof, chara, st var charaHaisuiOrig = onedata[key].skilldata.charaHaisui; var normalKonshinOrig = onedata[key].skilldata.normalKonshin; var exHaisuiOrig = onedata[key].skilldata.exHaisui; - var totalSkillWithoutHaisui = onedata[key].totalSkillCoeff / (normalHaisuiOrig * magnaHaisuiOrig * normalKonshinOrig * charaHaisuiOrig * exHaisuiOrig * magnaKonshinOrig); + var lbHaisuiOrig = onedata[key].skilldata.LBHaisui; + var lbKonshinOrig = onedata[key].skilldata.LBKonshin; + var totalSkillWithoutHaisui = onedata[key].totalSkillCoeff / (normalHaisuiOrig * magnaHaisuiOrig * normalKonshinOrig * charaHaisuiOrig * exHaisuiOrig * magnaKonshinOrig * lbHaisuiOrig * lbKonshinOrig); + + var lbHaisuiBuff = [], + lbKonshinBuff = []; + for (let k = 0; k < 100; ++k) { + let hp = 0.01 * (k + 1); + let exlbHaisuiValue = 1.0 + module.exports.calcLBHaisuiValue("EXLBHaisui", onedata[key].exlbHaisui, hp); + let exlbKonshinValue = 1.0 + module.exports.calcLBHaisuiValue("EXLBKonshin", onedata[key].exlbKonshin, hp); + lbHaisuiBuff.push(exlbHaisuiValue); + lbKonshinBuff.push(exlbKonshinValue); + } var haisuiBuff = []; // Character emnity should be calculated for each character @@ -2414,7 +2591,9 @@ module.exports.generateHaisuiData = function (res, arml, summon, prof, chara, st normalKonshin: 1.0, magnaKonshin: 1.0, exHaisui: 1.0, - charaHaisui: charaHaisuiBuff[k] + charaHaisui: charaHaisuiBuff[k], + lbHaisui: lbHaisuiBuff[k], + lbKonshin: lbKonshinBuff[k], }) } @@ -2480,7 +2659,7 @@ module.exports.generateHaisuiData = function (res, arml, summon, prof, chara, st } for (var k = 0; k < 100; k++) { - var newTotalSkillCoeff = totalSkillWithoutHaisui * haisuiBuff[k].normalHaisui * haisuiBuff[k].magnaHaisui * haisuiBuff[k].normalKonshin * haisuiBuff[k].magnaKonshin * haisuiBuff[k].charaHaisui * haisuiBuff[k].exHaisui; + var newTotalSkillCoeff = totalSkillWithoutHaisui * haisuiBuff[k].normalHaisui * haisuiBuff[k].magnaHaisui * haisuiBuff[k].normalKonshin * haisuiBuff[k].magnaKonshin * haisuiBuff[k].charaHaisui * haisuiBuff[k].exHaisui * haisuiBuff[k].lbHaisui * haisuiBuff[k].lbKonshin; var summedAttack = onedata[key].displayAttack; var newTotalAttack = summedAttack * newTotalSkillCoeff; var newTotalExpected = newTotalAttack * onedata[key].criticalRatio * onedata[key].expectedAttack; diff --git a/src/global_logic.test.js b/src/global_logic.test.js index f4c34e805..e58143a51 100644 --- a/src/global_logic.test.js +++ b/src/global_logic.test.js @@ -1,9 +1,9 @@ -var {getTypeBonus, calcDefenseDebuff} = require('./global_logic.js'); +var {getTypeBonus, calcDefenseDebuff, calcLBHaisuiValue} = require('./global_logic.js'); describe('#getTypeBonus', () => { test('when self element and enemy element is not set, type bonus is 1', () => { expect(getTypeBonus(undefined, undefined)).toBe(1) - }) + }); }); @@ -28,5 +28,81 @@ describe('#calcDefenseDebuff', () => { test('when defense debuff is over 100, defense is 1', () => { expect(calcDefenseDebuff(10, 100)).toBe(1); - }) + }); +}); + + +describe('#calcLBHaisui', () => { + const haisui = calcLBHaisuiValue.bind(null, 'EXLBHaisui'); + const konshin = calcLBHaisuiValue.bind(null, 'EXLBKonshin'); + + const exlbHaisuiMaxTable = [ + [1, 0.05], + [2, 0.06], + [3, 0.075], + [4, 0.09], + [5, 0.10], + [6, 0.11], + [7, 0.12], + [8, 0.125], + [9, 0.1375], + [10, 0.15], + ]; + const exlbHaisuiMinTable = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + const exlbKonshinMaxTable = [ + [1, 0.03], + [2, 0.04], + [3, 0.05], + [4, 0.06], + [5, 0.07], + [6, 0.08], + [7, 0.09], + [8, 0.10], + [9, 0.11], + [10, 0.12], + ]; + const exlbKonshinMinTable = [ + [1, 0.01], + [2, 0.01], + [3, 0.02], + [4, 0.02], + [5, 0.03], + [6, 0.03], + [7, 0.03], + [8, 0.04], + [9, 0.04], + [10, 0.04], + ]; + + test.each(exlbHaisuiMaxTable, 'Haisui max value', (amount, expected) => { + expect(haisui(amount, 0.0)).toBeCloseTo(expected); + }); + + test.each(exlbHaisuiMinTable, 'Haisui min value (until HP 75.1%)', (amount) => { + expect(haisui(amount, 1.0)).toBeCloseTo(0.01); + expect(haisui(amount, 0.751)).toBeCloseTo(0.01); + }); + + test.each(exlbKonshinMaxTable, 'konshin max value', (amount, expected) => { + expect(konshin(amount, 1.0)).toBeCloseTo(expected); + }); + + test.each(exlbKonshinMinTable, 'konshin min value', (amount, expected) => { + expect(konshin(amount, 0.0)).toBeCloseTo(expected); + }); + + test('ignore unknown type arguments', () => { + expect(calcLBHaisuiValue('unknown-type', 10, 0.0)).toBeCloseTo(0.0); + }); + + test('illegal amount numbers return 0.0', () => { + expect(haisui(0, 0.0)).toBeCloseTo(0.0); + expect(haisui(11, 0.0)).toBeCloseTo(0.0); + expect(konshin(0, 0.0)).toBeCloseTo(0.0); + expect(konshin(11, 0.0)).toBeCloseTo(0.0); + }); + + test.skip('illegal remainHP return ?', () => { + // TODO: what illegal remainHP should return? + }); }); \ No newline at end of file diff --git a/src/result.js b/src/result.js index f17ea77db..12e8a9642 100644 --- a/src/result.js +++ b/src/result.js @@ -1211,6 +1211,8 @@ var Result = CreateClass({ pushSkillInfoElement1("ex", "EX", "primary"); pushSkillInfoElement1("exHaisui", "EX背水", "light"); pushSkillInfoElement1("charaHaisui", "キャラ背水", "light"); + pushSkillInfoElement1("LBHaisui", "LB背水ラベル", "light"); + pushSkillInfoElement1("LBKonshin", "LB渾身ラベル", "light"); pushSkillInfoElement1("hpRatio", "HP増加", "success"); pushSkillInfoElement1("other", "その他バフ", "primary"); pushSkillInfoElement1("ATKDebuff", "攻撃力減少(特殊)", "primary"); diff --git a/src/translate.js b/src/translate.js index 509a9dabe..cfa86b61f 100644 --- a/src/translate.js +++ b/src/translate.js @@ -635,6 +635,43 @@ var multiLangData = { "zh": "Other Perk", }, + "指輪": { + "en": "Over Mastery", + "ja": "EXLB", + "zh": "Over Mastery", + }, + "奥義ダメージ上限": { + "en": "C.A. DMG Cap", + "ja": "奥義ダメージ上限", + "zh": "奧義上限", + }, + "クリティカル確率": { + "en": "Critical Hit", + "ja": "クリティカル確率", + "zh": "暴擊率", + }, + "背水": { + "en": "Enmity", + "ja": "背水", + "zh": "背水", + }, + "渾身": { + "en": "Stamina", + "ja": "渾身", + "zh": "渾身", + }, + "DA": { + "en": "DA", + "ja": "DA", + "zh": "DA", + }, + "TA": { + "en": "TA", + "ja": "TA", + "zh": "TA", + }, + + "ジータさんマスターボーナス": { "en": "Player's Master Bonuses", "ja": "ジータさんマスターボーナス", @@ -1431,6 +1468,19 @@ var multiLangData = { "ja": "TA上昇(その他)", "zh": "TA上升(其他)", }, + "LB背水ラベル": { + "en": "Enmity Perk", + "ja": "LB背水", + "zh": "LB背水", + }, + "LB渾身ラベル": { + "en": "Stamina Perk", + "ja": "LB渾身", + "zh": "LB渾身", + }, + + + "グラフに加える": { "en": "Add to \ngraphs", "ja": "グラフに\n加える",