全站通知:

Widget:修正者属性

来自深空之眼WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索
基础属性
当前等级 <input id="level" type="number" value="1" data-val="1" min="1" max="100" oninput="if (value < 1) value = 1;if(value>100)value=100"/> 当前超越
           <select name="rare" id="rare">
               <option value="2">S</option>
               <option value="2">S - Ⅰ</option>
               <option value="2">S - Ⅱ</option>
               <option value="2">S - Ⅲ</option>
               <option value="2">S - Ⅳ</option>
               <option value="3">SS</option>
               <option value="3">SS - Ⅰ</option>
               <option value="3">SS - Ⅱ</option>
               <option value="3">SS - Ⅲ</option>
               <option value="3">SS - Ⅳ</option>
               <option value="4">SSS</option>
               <option value="4">SSS - Ⅰ</option>
               <option value="4">SSS - Ⅱ</option>
               <option value="4">SSS - Ⅲ</option>
               <option value="4">SSS - Ⅳ</option>
               <option value="5">Ω</option>
           </select>
最终面板
攻击力
角色超越增加攻击力
合计
防御力
角色超越增加防御力
合计
生命值
角色超越增加生命值
合计
会心率
角色超越增加会心率
合计
   <script>
       document.getElementById('calc').addEventListener('input', function(e){
           calc(e);
       })
   
       function calc(e){
           level_input = parseInt(level.value);
           
           selectedIndex = document.getElementById('rare').selectedIndex
           index = document.getElementById('rare').options[selectedIndex].value
           rare_level = document.getElementById('rare').options[selectedIndex].innerText
   
           base_atk = [50.87,113.55,182.51,258.36,341.8,433.57]
           atk_ratio = [6.52,7.65,9.18,11.26,14,18.44]
           base_arm = [15.51,47.36,82.39,120.93,163.33,209.96]
           arm_ratio = [1.84,2.03,2.33,2.78,3.41,4.69]
           base_sta = [656,1180.59,1757.65,2392.42,3090.66,3858.73]
           sta_ratio = [67.41,81.46,99.91,123.97,155.12,200.51]
           base_crit = [10,20,30,42,54,69,90,100,110]
   
           let atk = base_atk[index] + ( level_input - 1 ) * atk_ratio[index]
           let arm = base_arm[index] + ( level_input - 1 ) * arm_ratio[index]
           let sta = base_sta[index] + ( level_input - 1 ) * sta_ratio[index]
           let crit = base_crit[ Math.ceil( ( ( level_input < 20 ? 19 : level_input == 100 ? 99 : level_input) - 19 ) / 10 ) ] / 10
           
           let atk_add = 0
           let arm_add = 0
           let sta_add = 0
           let crit_add = 0
           switch (rare_level) {
               case "Ω":
               case "SSS - Ⅳ":
               case "SSS - Ⅲ":
               case "SSS - Ⅱ":
               case "SSS - Ⅰ": sta_add = sta_add + 450;
               case "SSS":
               case "SS - Ⅳ":
               case "SS - Ⅲ": atk_add = atk_add + 60;
               case "SS - Ⅱ":
               case "SS - Ⅰ": arm_add = arm_add + 30;
               case "SS":
               case "S - Ⅳ":
               case "S - Ⅲ": arm_add = arm_add + 30;
               case "S - Ⅱ": atk_add = atk_add + 60;
               case "S - Ⅰ": sta_add = sta_add + 450;
               case "S": crit_add = crit_add + 5;
               case "A - Ⅳ": atk_add = atk_add + 20;
               case "A - Ⅲ": atk_add = atk_add + 20;
               case "A - Ⅱ": arm_add = arm_add + 10;
               case "A - Ⅰ": sta_add = sta_add + 150;
               case "A": arm_add = arm_add + 10;
               case "B - Ⅳ": sta_add = sta_add + 150;
               case "B - Ⅲ": atk_add = atk_add + 40;
               case "B - Ⅱ": atk_add = atk_add + 20;
               case "B - Ⅰ": arm_add = arm_add + 10;
               case "B":
           }
           
           let atk_fin = atk + atk_add
           let arm_fin = arm + arm_add
           let sta_fin = sta + sta_add
           let crit_fin = crit + crit_add
           document.getElementsByClassName("atk")[0].innerText = atk.toFixed(2)
           document.getElementsByClassName("arm")[0].innerText = arm.toFixed(2)
           document.getElementsByClassName("sta")[0].innerText = sta.toFixed(2)
           document.getElementsByClassName("crit")[0].innerText = new String(crit + "%")
           document.getElementsByClassName("atk_add")[0].innerText = atk_add.toFixed(2)
           document.getElementsByClassName("arm_add")[0].innerText = arm_add.toFixed(2)
           document.getElementsByClassName("sta_add")[0].innerText = sta_add.toFixed(2)
           document.getElementsByClassName("crit_add")[0].innerText = new String(crit_add + "%")
           document.getElementsByClassName("atk_fin")[0].innerText = atk_fin.toFixed(2)
           document.getElementsByClassName("arm_fin")[0].innerText = arm_fin.toFixed(2)
           document.getElementsByClassName("sta_fin")[0].innerText = sta_fin.toFixed(2)
           document.getElementsByClassName("crit_fin")[0].innerText = new String(crit_fin + "%")
       }
   
       calc();
   </script>