Browse Source

也显示无觉醒的加盾血量。目前先不显示血线盾了。

tags/v10.0
枫谷剑仙 5 years ago
parent
commit
33adf72ade
7 changed files with 27 additions and 34 deletions
  1. +4
    -0
      languages/zh-CN.js
  2. +1
    -2
      multi.html
  3. +4
    -4
      script-universal_function.js
  4. +12
    -12
      script.js
  5. +1
    -2
      solo.html
  6. +2
    -8
      style.css
  7. +3
    -6
      triple.html

+ 4
- 0
languages/zh-CN.js View File

@@ -2011,6 +2011,10 @@ function parseSkillDescription(skill)
const skill = Skills[card.leaderSkillId];
return getReduceScale(skill, undefined, true) > 0;
})},
{name:"队长盾减伤-排除几率盾",function:cards=>cards.filter(card=>{
const skill = Skills[card.leaderSkillId];
return getReduceScale(skill, undefined, undefined, true) > 0;
})},
{name:"满血99重力不下半血-队长盾减伤[29%, 100%)",function:cards=>cards.filter(card=>{
const skill = Skills[card.leaderSkillId];
const reduceScale = getReduceScale(skill);


+ 1
- 2
multi.html View File

@@ -76,9 +76,8 @@ var formation = new Formation(teamsCount,5);
<div class="formation-total-info">
<div class="tIf-total-hp">
<span class="general"></span>
<span class="reduce"></span>
<span class="max-equal"></span>
<span class="awoken-bind"></span>
<span class="reduce"></span>
</div>
</div>
<ul class="teams">


+ 4
- 4
script-universal_function.js View File

@@ -796,7 +796,7 @@ function countMoveTime(team, leader1id, leader2id, teamIdx)
return moveTime;
}
//获取盾减伤比例
function getReduceScale(ls, allAttr = false, noHPneed = false)
function getReduceScale(ls, allAttr = false, noHPneed = false, noProbability = false)
{
const sk = ls.params;
let scale = 0;
@@ -811,9 +811,9 @@ function getReduceScale(ls, allAttr = false, noHPneed = false)
case 36: //2个属性盾
scale = allAttr ? 0 : sk[2]/100;
break;
case 38: //血线下 + 几率
case 43: //血线上 + 几率
scale = (noHPneed || allAttr) ? 0 : sk[2]/100;
case 38: //血线下 + 可能几率
case 43: //血线上 + 可能几率
scale = (noHPneed || noProbability && sk[1] !== 100) ? 0 : sk[2]/100;
break;
case 129: //无条件盾,属性个数不固定
case 163: //无条件盾,属性个数不固定


+ 12
- 12
script.js View File

@@ -2941,8 +2941,8 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) {
const leader2id = teamsCount===2 ? (teamIdx === 1 ? teams[0][0][0].id : teams[1][0][0].id) : team[0][5].id;

if (tHpDom) {
const reduceScale1 = getReduceScale(Skills[Cards[leader1id].leaderSkillId],true);
const reduceScale2 = getReduceScale(Skills[Cards[leader2id].leaderSkillId],true);
const reduceScale1 = getReduceScale(Skills[Cards[leader1id].leaderSkillId],true,true,true);
const reduceScale2 = getReduceScale(Skills[Cards[leader2id].leaderSkillId],true,true,true);
const totalReduce = 1 - (1 - reduceScale1) * (1 - reduceScale2);

const teamHPArr = countTeamHp(team[0], leader1id, leader2id, solo);
@@ -2965,18 +2965,18 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) {
tHP = Math.round(Math.round(tHP * (1 + 0.05 * teamHPAwoken)) * badgeHPScale);
tHPNoAwoken = Math.round(Math.round(tHPNoAwoken) * badgeHPScale);

const tReduceHP = tHP / (1 - reduceScale1) / (1 - reduceScale2); //队伍正常满血加上盾能承受的最大伤害
const tReduceHP = Math.round(tHP / (1 - reduceScale1) / (1 - reduceScale2)); //队伍正常满血加上盾能承受的最大伤害
const tReduceHPNoAwoken = Math.round(tHPNoAwoken / (1 - reduceScale1) / (1 - reduceScale2)); //队伍封觉醒满血加上盾能承受的最大伤害

const tHpDom_general = tHpDom.querySelector(".general");
const tHpDom_noAwoken = tHpDom.querySelector(".awoken-bind");
const tHpDom_maxEqual = tHpDom.querySelector(".max-equal");
const tHpDom_reduce = tHpDom.querySelector(".reduce");

setTextContentAndAttribute(tHpDom_general, tHP);
setTextContentAndAttribute(tHpDom_noAwoken, tHPNoAwoken);
setTextContentAndAttribute(tHpDom_reduce, (totalReduce * 100).toFixed(2));
tHpDom_reduce.setAttribute("data-max-equal", tReduceHP);
setTextContentAndAttribute(tHpDom_maxEqual, tReduceHP);
tHpDom_reduce.setAttribute("data-max-equal-general", tReduceHP);
tHpDom_reduce.setAttribute("data-max-equal-awoken-bind", tReduceHPNoAwoken);
}

if (tMoveDom) {
@@ -3009,8 +3009,8 @@ function refreshFormationTotalHP(totalDom, teams) {
const leader1id = teams[0][0][0].id;
const leader2id = teams[1][0][0].id;

const reduceScale1 = getReduceScale(Skills[Cards[leader1id].leaderSkillId],true);
const reduceScale2 = getReduceScale(Skills[Cards[leader2id].leaderSkillId],true);
const reduceScale1 = getReduceScale(Skills[Cards[leader1id].leaderSkillId],true,true,true);
const reduceScale2 = getReduceScale(Skills[Cards[leader2id].leaderSkillId],true,true,true);
const totalReduce = 1 - (1 - reduceScale1) * (1 - reduceScale2);

const tHPArr = teams.map(function(team) {
@@ -3031,18 +3031,18 @@ function refreshFormationTotalHP(totalDom, teams) {
const tHP = tHPArr.reduce((pv, v) => pv + v);
const tHPNoAwoken = tHPNoAwokenArr.reduce((pv, v) => pv + v);

const tReduceHP = tHP / (1 - reduceScale1) / (1 - reduceScale2); //队伍正常满血加上盾能承受的最大伤害
const tReduceHP = Math.round(tHP / (1 - reduceScale1) / (1 - reduceScale2)); //队伍正常满血加上盾能承受的最大伤害
const tReduceHPNoAwoken = Math.round(tHPNoAwoken / (1 - reduceScale1) / (1 - reduceScale2)); //队伍封觉醒满血加上盾能承受的最大伤害

const tHpDom_general = tHpDom.querySelector(".general");
const tHpDom_noAwoken = tHpDom.querySelector(".awoken-bind");
const tHpDom_maxEqual = tHpDom.querySelector(".max-equal");
const tHpDom_reduce = tHpDom.querySelector(".reduce");

setTextContentAndAttribute(tHpDom_general, tHP);
setTextContentAndAttribute(tHpDom_noAwoken, tHPNoAwoken);
setTextContentAndAttribute(tHpDom_reduce, (totalReduce * 100).toFixed(2));
tHpDom_reduce.setAttribute("data-max-equal", tReduceHP);
setTextContentAndAttribute(tHpDom_maxEqual, tReduceHP);
tHpDom_reduce.setAttribute("data-max-equal-general", tReduceHP);
tHpDom_reduce.setAttribute("data-max-equal-awoken-bind", tReduceHPNoAwoken);
}
}
//刷新单人技能CD


+ 1
- 2
solo.html View File

@@ -77,9 +77,8 @@ var formation = new Formation(teamsCount,6);
<div class="team-total-info">
<div class="tIf-total-hp">
<span class="general"></span>
<span class="reduce"></span>
<span class="max-equal"></span>
<span class="awoken-bind"></span>
<span class="reduce"></span>
</div>
<div class="tIf-total-move">
<span class="general"></span>


+ 2
- 8
style.css View File

@@ -588,8 +588,8 @@ ul{
.tIf-total-hp .reduce::after{
content: "%";
}
.tIf-total-hp .max-equal::before{
content: "⇔";
.tIf-total-hp .reduce:not([data-value="0.00"])::after{
content: "%⇔" attr(data-max-equal-general) "/" attr(data-max-equal-awoken-bind);
}

.tIf-total-move::before{
@@ -758,12 +758,6 @@ ul{
display: none;
content: "";
}
.show-team-name-left .team-ability::before{
display: inline-block;
}
.show-team-name-right .team-ability::after{
display: inline-block;
}
.abilitys .hp::before,
.abilitys .atk::before,
.abilitys .rcv::before


+ 3
- 6
triple.html View File

@@ -92,9 +92,8 @@ var formation = new Formation(teamsCount,6);
<div class="team-total-info">
<div class="tIf-total-hp">
<span class="general"></span>
<span class="reduce"></span>
<span class="max-equal"></span>
<span class="awoken-bind"></span>
<span class="reduce"></span>
</div>
<div class="tIf-total-move">
<span class="general"></span>
@@ -449,9 +448,8 @@ var formation = new Formation(teamsCount,6);
<div class="team-total-info">
<div class="tIf-total-hp">
<span class="general"></span>
<span class="reduce"></span>
<span class="max-equal"></span>
<span class="awoken-bind"></span>
<span class="reduce"></span>
</div>
<div class="tIf-total-move">
<span class="general"></span>
@@ -806,9 +804,8 @@ var formation = new Formation(teamsCount,6);
<div class="team-total-info">
<div class="tIf-total-hp">
<span class="general"></span>
<span class="reduce"></span>
<span class="max-equal"></span>
<span class="awoken-bind"></span>
<span class="reduce"></span>
</div>
<div class="tIf-total-move">
<span class="general"></span>


Loading…
Cancel
Save