Browse Source

本来准备更改血量算法,每个队员的血量分别乘以全队觉醒倍率四舍五入后再加在一起,后来发现还是不对,所以就又还原了

pull/1/head
枫谷剑仙 2 years ago
parent
commit
606a5d3876
2 changed files with 26 additions and 33 deletions
  1. +13
    -20
      script.js
  2. +13
    -13
      service-worker.js

+ 13
- 20
script.js View File

@@ -6681,23 +6681,17 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) {
const teamHPArr = countTeamHp(team, leader1id, leader2id, solo);
const teamHPNoAwokenArr = countTeamHp(team, leader1id, leader2id, solo, true);
const teamHPAwoken = awokenCountInTeam(team, 46, solo, teamsCount), teamHPAwokenScale = (1 + 0.05 * teamHPAwoken); //全队大血包个数
const badgeHPScale = teamsCount == 2 ? 1 : (badge=>{ //徽章倍率
switch (badge) {
case 5: return 1.05; //小血
case 18: return 1.15; //大血
case 20: return 1.10; //全属性
}
})(badge);
let tHP = teamHPArr.reduce((pv, v) => pv + v, 0); //队伍计算的总HP
let tHPNoAwoken = teamHPNoAwokenArr.reduce((pv, v) => pv + v, 0); //队伍计算的总HP无觉醒
const teamHPAwoken = awokenCountInTeam(team, 46, solo, teamsCount); //全队大血包个数
let badgeHPScale = 1; //徽章倍率
if (badge === 5 && (solo || teamsCount === 3)) {
badgeHPScale = 1.05;
} else if (badge === 18 && (solo || teamsCount === 3)) {
badgeHPScale = 1.15;
} else if (badge === 20 && (solo || teamsCount === 3)) {
badgeHPScale = 1.10;
}
tHP = Math.round(tHP * (1 + 0.05 * teamHPAwoken) * badgeHPScale);
tHPNoAwoken = Math.round(tHPNoAwoken * badgeHPScale);
let tHP = Math.round(teamHPArr.reduce((pv, v) => pv + v * teamHPAwokenScale * badgeHPScale, 0)); //队伍计算的总HP
let tHPNoAwoken = Math.round(teamHPNoAwokenArr.reduce((pv, v) => pv + v * badgeHPScale, 0)); //队伍计算的总HP无觉醒
//记录到bar中,方便打开详情时调用
hpBar.reduceAttrRangesWithShieldAwoken = reduceAttrRangesWithShieldAwoken; //有盾觉醒的
@@ -6853,11 +6847,10 @@ function refreshFormationTotalHP(totalDom, teams) {
const tHPArr = teams.map(function(team) {
const teamHPArr = countTeamHp(team, leader1id, leader2id, solo);
const teamHPAwoken = awokenCountInTeam(team, 46, solo, teamsCount), teamHPAwokenScale = (1 + 0.05 * teamHPAwoken); //全队大血包个数
const teamTHP = Math.round(teamHPArr.reduce((pv, v) => pv + v * teamHPAwokenScale)); //队伍计算的总HP
const teamTHP = teamHPArr.reduce((pv, v) => pv + v); //队伍计算的总HP
const teamHPAwoken = awokenCountInTeam(team, 46, solo, teamsCount); //全队大血包个数
return Math.round(teamTHP * (1 + 0.05 * teamHPAwoken));
return teamTHP;
});
const tHPNoAwokenArr = teams.map(function(team) {
const teamHPArr = countTeamHp(team, leader1id, leader2id, solo, true);


+ 13
- 13
service-worker.js View File

@@ -23183,7 +23183,7 @@ const cachesMap = new Map([
],
[
"multi.html",
"5cac16be50a8c03405e2fab43d55f0f9"
"063d1442fc5c4eff9ea48f6fff52040e"
],
[
"script-custom_elements.js",
@@ -23191,7 +23191,7 @@ const cachesMap = new Map([
],
[
"script-json_data.js",
"13a004bccb210a80f3b59d41e405245d"
"6d0626ffc2851830c4a6bc7ee34d5480"
],
[
"script-skill-parser.js",
@@ -23203,11 +23203,11 @@ const cachesMap = new Map([
],
[
"script.js",
"1fe38dcd08b28379f7b1282e168f13ca"
"97bc738e6401a40c01f3f5497858d384"
],
[
"solo.html",
"f56623a3ca8532c775a632463f1b65fa"
"dfe186923662b30e1dcf541cba45c56a"
],
[
"style-monsterimages.css",
@@ -23215,7 +23215,7 @@ const cachesMap = new Map([
],
[
"style.css",
"ccf520aa5d5e653c9c874a4f6ef18dd5"
"44b13bc5f6a4207844d31bd5347ce19f"
],
[
"temp.js",
@@ -23223,11 +23223,11 @@ const cachesMap = new Map([
],
[
"triple.html",
"a864fcedfd62f8a10b4e32f37f487c27"
"2b81803875ee75bc1e5c1a339e1aa5e6"
],
[
"languages/en.css",
"890c22795207a7ce48d94b81cb1c2da9"
"2ead48b05d01156478ccc5d05591bf07"
],
[
"languages/en.js",
@@ -23235,7 +23235,7 @@ const cachesMap = new Map([
],
[
"languages/ja.css",
"60212f96389d2dcd52704ddefca000d4"
"80ac0fe1f0da5c4e15b60afb3c20c6e9"
],
[
"languages/ja.js",
@@ -23243,7 +23243,7 @@ const cachesMap = new Map([
],
[
"languages/ko.css",
"31800c79d96f2fbf0a1c36cf978e5282"
"fe096e4fdfa29fca334852e66f7e6dae"
],
[
"languages/ko.js",
@@ -23255,19 +23255,19 @@ const cachesMap = new Map([
],
[
"languages/zh-TW.css",
"a2fb307399710d6c9dc0a21b902a3e3d"
"a573e318265b8eceb7496fcf258c0daa"
],
[
"languages/zh-TW.js",
"a7eb3cd1b50dc07647e028fcae122180"
"79f8db66f79d0f3f6351a47d797dfe5d"
],
[
"languages/zh.css",
"b02ff6a7cffea9e8cc8ae869600e9775"
"eb05f11f197eb969907eb5221f7aaf64"
],
[
"languages/zh.js",
"007c91430840864f852949f9030f9db4"
"1514e5ac0e809c068a62c6a9f12f3039"
],
[
"images/attrs.png",


Loading…
Cancel
Save