| @@ -83,6 +83,9 @@ | |||
| .m-level-btn-max::before{ | |||
| content: "Max Lv."; | |||
| } | |||
| .m-level-exp::before{ | |||
| content: "Need Exp:"; | |||
| } | |||
| .edit-box .setting-box .row-mon-awoken::before{ | |||
| content: "▼Monster Awoken"; | |||
| } | |||
| @@ -82,6 +82,9 @@ | |||
| .m-level-btn-max::before{ | |||
| content: "最大Lv."; | |||
| } | |||
| .m-level-exp::before{ | |||
| content: "必要な経験値:"; | |||
| } | |||
| .edit-box .setting-box .row-mon-awoken::before{ | |||
| content: "▼モンスター覚醒"; | |||
| } | |||
| @@ -82,6 +82,9 @@ | |||
| .m-level-btn-max::before{ | |||
| content: "최대Lv."; | |||
| } | |||
| .m-level-exp::before{ | |||
| content: "필요한 Exp:"; | |||
| } | |||
| .edit-box .setting-box .row-mon-awoken::before{ | |||
| content: "▼몬스터 각성"; | |||
| } | |||
| @@ -1171,4 +1171,22 @@ function parseSkillDescription(skill) | |||
| } | |||
| //(skill.description.length?(descriptionToHTML(skill.description) + "<hr>"):"") + str | |||
| return str; | |||
| } | |||
| //大数字缩短长度 | |||
| function parseBigNumber(number) | |||
| { | |||
| if (number === 0) | |||
| { | |||
| return number; | |||
| }else if (number % 1e8 === 0) | |||
| { | |||
| return number / 1e8 + "亿"; | |||
| }else if (number % 1e4 === 0) | |||
| { | |||
| return number / 1e4 + "万"; | |||
| }else | |||
| { | |||
| return number; | |||
| } | |||
| } | |||
| @@ -85,6 +85,9 @@ | |||
| .m-level-btn-max::before{ | |||
| content: "最高Lv."; | |||
| } | |||
| .m-level-exp::before{ | |||
| content: "需要經驗值:"; | |||
| } | |||
| .edit-box .setting-box .row-mon-awoken::before{ | |||
| content: "▼怪物覺醒"; | |||
| } | |||
| @@ -85,6 +85,9 @@ | |||
| .m-level-btn-max::before{ | |||
| content: "最高Lv."; | |||
| } | |||
| .m-level-exp::before{ | |||
| content: "需要经验值:"; | |||
| } | |||
| .edit-box .setting-box .row-mon-awoken::before{ | |||
| content: "▼怪物觉醒"; | |||
| } | |||
| @@ -696,9 +696,12 @@ var formation = new Formation(teamsCount,5); | |||
| </div> | |||
| <div class="setting-row row-mon-level"> | |||
| <!--怪物等级--> | |||
| <input type="number" class="m-level" min=1 max=110/> | |||
| <button class="m-level-btn-min" value="1">1</button> | |||
| <button class="m-level-btn-max" value="99">99</button> | |||
| <div class="m-level-exp"></div> | |||
| <div class="subrow"> | |||
| <input type="number" class="m-level" min=1 max=110/> | |||
| <button class="m-level-btn-min" value="1">1</button> | |||
| <button class="m-level-btn-max" value="99">99</button> | |||
| </div> | |||
| </div> | |||
| <div class="setting-row row-mon-plus"> | |||
| <!--怪物加值--> | |||
| @@ -203,7 +203,7 @@ function toggleShowMonSkillCd() | |||
| //清除数据 | |||
| function clearData() | |||
| { | |||
| location.href=location.href.replace(location.search,''); | |||
| location.search = ""; | |||
| } | |||
| //轮换ABC队伍 | |||
| function swapABCteam() | |||
| @@ -877,13 +877,29 @@ function initialize() | |||
| } | |||
| //等级 | |||
| const monEditLv = settingBox.querySelector(".m-level"); | |||
| monEditLv.onchange = reCalculateAbility; | |||
| monEditLv.onchange = function(){ | |||
| reCalculateExp(); | |||
| reCalculateAbility(); | |||
| }; | |||
| const monEditLvMin = settingBox.querySelector(".m-level-btn-min"); | |||
| const monLvExp = settingBox.querySelector(".m-level-exp"); | |||
| monEditLvMin.ipt = monEditLv; | |||
| monEditLvMin.onclick = setIptToMyValue; | |||
| const monEditLvMax = settingBox.querySelector(".m-level-btn-max"); | |||
| monEditLvMax.ipt = monEditLv; | |||
| monEditLvMax.onclick = setIptToMyValue; | |||
| //编辑界面重新计算怪物的经验值 | |||
| function reCalculateExp(){ | |||
| const monid = parseInt(monstersID.value || 0, 10); | |||
| const level = parseInt(monEditLv.value || 0, 10); | |||
| const tempMon = { | |||
| id:monid, | |||
| level:level | |||
| } | |||
| const needExp = calculateExp(tempMon); | |||
| monLvExp.innerHTML = needExp ? parseBigNumber(needExp[0]) + (level>99?` + ${parseBigNumber(needExp[1])}` : "") : ""; | |||
| }; | |||
| editBox.reCalculateExp = reCalculateExp; | |||
| //加蛋 | |||
| const monEditAddHpLi = settingBox.querySelector(".row-mon-plus .m-plus-hp-li"); | |||
| const monEditAddAtkLi = settingBox.querySelector(".row-mon-plus .m-plus-atk-li"); | |||
| @@ -910,7 +926,7 @@ function initialize() | |||
| monEditAddHp.value = 99; | |||
| monEditAddAtk.value = 99; | |||
| monEditAddRcv.value = 99; | |||
| editBox.reCalculateAbility(); | |||
| reCalculateAbility(); | |||
| }; | |||
| //三维的计算值 | |||
| const monEditHpValue = monEditAddHpLi.querySelector(".ability-value"); | |||
| @@ -1569,6 +1585,7 @@ function editMon(teamNum,isAssist,indexInTeam) | |||
| rowMonLatent.classList.add("display-none"); | |||
| editBoxTitle.classList.add("edit-box-title-assist"); | |||
| } | |||
| editBox.reCalculateExp(); | |||
| editBox.reCalculateAbility(); | |||
| } | |||
| //编辑窗,修改怪物ID | |||
| @@ -1595,6 +1612,8 @@ function editBoxChangeMonId(id) | |||
| mRare.className = "monster-rare rare-" + card.rarity; | |||
| const mCost = monInfoBox.querySelector(".monster-cost"); | |||
| mCost.innerHTML = card.cost; | |||
| /*const mExp = monInfoBox.querySelector(".monster-exp"); | |||
| mExp.innerHTML = card.exp.max;*/ | |||
| const mName = monInfoBox.querySelector(".monster-name"); | |||
| mName.innerHTML = returnMonsterNameArr(card, currentLanguage.searchlist, currentDataSource.code)[0]; | |||
| const mCollabId = monInfoBox.querySelector(".monster-collabId"); | |||
| @@ -1785,6 +1804,7 @@ function editBoxChangeMonId(id) | |||
| } | |||
| editBox.latent.length = 0; | |||
| editBox.refreshLatent(editBox.latent,id); | |||
| editBox.reCalculateExp(); | |||
| editBox.reCalculateAbility(); | |||
| } | |||
| //搜索并显示合作 | |||
| @@ -392,6 +392,7 @@ var formation = new Formation(teamsCount,6); | |||
| <div class="monster-id"></div> | |||
| <div class="monster-rare"></div> | |||
| <div class="monster-cost"></div> | |||
| <!--<div class="monster-exp"></div>--> | |||
| </div> | |||
| <div class="monsterinfo-line"> | |||
| <div class="monster-name"></div> | |||
| @@ -644,9 +645,12 @@ var formation = new Formation(teamsCount,6); | |||
| </div> | |||
| <div class="setting-row row-mon-level"> | |||
| <!--怪物等级--> | |||
| <input type="number" class="m-level" min=1 max=110/> | |||
| <button class="m-level-btn-min" value="1">1</button> | |||
| <button class="m-level-btn-max" value="99">99</button> | |||
| <div class="m-level-exp"></div> | |||
| <div class="subrow"> | |||
| <input type="number" class="m-level" min=1 max=110/> | |||
| <button class="m-level-btn-min" value="1">1</button> | |||
| <button class="m-level-btn-max" value="99">99</button> | |||
| </div> | |||
| </div> | |||
| <div class="setting-row row-mon-plus"> | |||
| <!--怪物加值--> | |||
| @@ -910,7 +910,6 @@ ul{ | |||
| .edit-box .setting-box .row-mon-level::before{ | |||
| /*content: "▼怪物等级";*/ | |||
| display: block; | |||
| } | |||
| .edit-box .setting-box .m-level{ | |||
| font-size: 25px; | |||
| @@ -918,7 +917,9 @@ ul{ | |||
| width: calc(100% - 220px); | |||
| box-sizing: border-box; | |||
| } | |||
| .m-level-btn-min,.m-level-btn-max{ | |||
| .m-level-btn-min, | |||
| .m-level-btn-max | |||
| { | |||
| height: 40px; | |||
| box-sizing: border-box; | |||
| font-size: 25px; | |||
| @@ -930,12 +931,21 @@ ul{ | |||
| .m-level-btn-max{ | |||
| width: 145px; | |||
| } | |||
| /*.m-level-btn-max::before{ | |||
| .m-level-exp{ | |||
| margin-left: 10px; | |||
| display: inline-block; | |||
| } | |||
| /* | |||
| .m-level-exp::before{ | |||
| content: "需要经验:"; | |||
| } | |||
| .m-level-btn-max::before{ | |||
| content: "最高Lv"; | |||
| } | |||
| .edit-box .setting-box .row-mon-awoken::before{ | |||
| content: "▼怪物觉醒"; | |||
| }*/ | |||
| } | |||
| */ | |||
| .row-mon-awoken .awoken-ul, .row-mon-super-awoken .awoken-ul{ | |||
| font-size: 0; | |||
| height: 32px; | |||
| @@ -1281,9 +1281,12 @@ var formation = new Formation(teamsCount,6); | |||
| </div> | |||
| <div class="setting-row row-mon-level"> | |||
| <!--怪物等级--> | |||
| <input type="number" class="m-level" min=1 max=110/> | |||
| <button class="m-level-btn-min" value="1">1</button> | |||
| <button class="m-level-btn-max" value="99">99</button> | |||
| <div class="m-level-exp"></div> | |||
| <div class="subrow"> | |||
| <input type="number" class="m-level" min=1 max=110/> | |||
| <button class="m-level-btn-min" value="1">1</button> | |||
| <button class="m-level-btn-max" value="99">99</button> | |||
| </div> | |||
| </div> | |||
| <div class="setting-row row-mon-plus"> | |||
| <!--怪物加值--> | |||
| @@ -147,6 +147,35 @@ function returnMonsterNameArr(card, lsList, defaultCode) | |||
| } | |||
| return monNameArr; | |||
| } | |||
| //Code From pad-rikuu | |||
| function valueAt(level, maxLevel, curve) { | |||
| const f = (maxLevel === 1 || level >= maxLevel) ? 1 : ((level - 1) / (maxLevel - 1)); | |||
| return curve.min + (curve.max - curve.min) * Math.pow(f, curve.scale); | |||
| } | |||
| //Code From pad-rikuu | |||
| function curve(c, level, maxLevel, limitBreakIncr) { | |||
| let value = valueAt(level, maxLevel, { | |||
| min: c.min, | |||
| max: c.max || (c.min * maxLevel), | |||
| scale: c.scale || 1 | |||
| }); | |||
| if (level > maxLevel) { | |||
| const exceed = level - maxLevel; | |||
| value += c.max ? (c.max * (limitBreakIncr / 100) * (exceed / 11)) : c.min * exceed; | |||
| } | |||
| return value; | |||
| } | |||
| //计算怪物的经验值 | |||
| function calculateExp(member) | |||
| { | |||
| if (!member) return null; | |||
| const memberCard = Cards[member.id]; | |||
| if (!memberCard || memberCard.id == 0 || !memberCard.enabled) return null; | |||
| const v99Exp = valueAt(member.level, 99, memberCard.exp); | |||
| const v110Exp = member.level > 99 ? Math.max(0, member.level - memberCard.maxLevel - 1) * 5000000 : 0; | |||
| return [Math.round(v99Exp),v110Exp]; | |||
| } | |||
| //计算怪物的能力 | |||
| //function calculateAbility(monid = 0, level = 1, plus = [0,0,0], awoken = 0, latent = [], weaponId = null, weaponAwoken = null, solo = true) | |||
| function calculateAbility(member = null, assist = null, solo = true) | |||
| @@ -167,25 +196,6 @@ function calculateAbility(member = null, assist = null, solo = true) | |||
| const assistCard = assist ? Cards[assist.id] : null; | |||
| if (!memberCard || memberCard.id == 0 || !memberCard.enabled) return null; | |||
| //Code From pad-rikuu | |||
| function valueAt(level, maxLevel, curve) { | |||
| const f = (maxLevel === 1 || level >= maxLevel) ? 1 : ((level - 1) / (maxLevel - 1)); | |||
| return curve.min + (curve.max - curve.min) * Math.pow(f, curve.scale); | |||
| } | |||
| //Code From pad-rikuu | |||
| function curve(c, level, maxLevel, limitBreakIncr) { | |||
| let value = valueAt(level, maxLevel, { | |||
| min: c.min, | |||
| max: c.max || (c.min * maxLevel), | |||
| scale: c.scale || 1 | |||
| }); | |||
| if (level > maxLevel) { | |||
| const exceed = level - maxLevel; | |||
| value += c.max ? (c.max * (limitBreakIncr / 100) * (exceed / 11)) : c.min * exceed; | |||
| } | |||
| return value; | |||
| } | |||
| const bonusScale = [0.1,0.05,0.15]; //辅助宠物附加的属性倍率 | |||
| const plusAdd = [10,5,3]; //加值的增加值 | |||
| const awokenAdd = [ //对应加三维觉醒的序号与增加值 | |||
| @@ -335,15 +345,9 @@ function createCardA(id) | |||
| //将怪物的文字介绍解析为HTML | |||
| function descriptionToHTML(str) | |||
| { | |||
| str = str.replace(/\n/igm,"<br>"); | |||
| str = str.replace(/\^([a-fA-F0-9]{6})\^([^\^]+)\^p/igm,'<span style="color:#$1;">$2</span>'); | |||
| let monReg = /\%\{m([0-9]{1,4})\}/igm; | |||
| let monRegRes; | |||
| while((monRegRes = monReg.exec(str))!=null) { | |||
| str = str.replace(monRegRes[0],cardN(parseInt(monRegRes[1]))); | |||
| } | |||
| //str = str.replace(/\%\{m([0-9]{1,4})\}/igm,cardN(`$1`)); | |||
| str = str.replace(/\n/ig,"<br>"); //换行 | |||
| str = str.replace(/\^([a-fA-F0-9]{6})\^([^\^]+)\^p/igm,'<span style="color:#$1;">$2</span>'); //文字颜色 | |||
| str = str.replace(/\%\{m([0-9]{1,4})\}/g,function (str, p1, offset, s){return cardN(parseInt(p1,10));}); //怪物头像 | |||
| return str; | |||
| } | |||
| //返回怪物名 | |||
| @@ -366,4 +370,16 @@ function cardN(id){ | |||
| function parseSkillDescription(skill) | |||
| { | |||
| return descriptionToHTML(skill.description); | |||
| } | |||
| //大数字缩短长度,默认返回本地定义字符串 | |||
| function parseBigNumber(number) | |||
| { | |||
| /* //千位分隔符 | |||
| const res=number.toString().replace(/\d+/, function(n){ // 先提取整数部分 | |||
| return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){ | |||
| return $1+","; | |||
| }); | |||
| }) | |||
| */ | |||
| return number.toLocaleString(); | |||
| } | |||