增加更多队长技能特性的显示

This commit is contained in:
枫谷剑仙 2021-03-12 17:15:22 +08:00
parent 407aa9cdc7
commit 79d6cd1d33
13 changed files with 302 additions and 10 deletions

BIN
images/icon-76board.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

BIN
images/icon-add-combo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/icon-inflicts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icon-no-skyfall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icon-poison.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -19,7 +19,7 @@ Number.prototype.bigNumberToString = function()
let numPartsStr = numParts.map((num,idx)=>{ let numPartsStr = numParts.map((num,idx)=>{
if (num > 0) if (num > 0)
{ {
return (num < 1e3 ? "零" : "") + num.toLocaleString() + unit[idx]; return (num < 1e3 ? "零" : "") + num + unit[idx];
}else }else
return "零"; return "零";
}); });

View File

@ -83,6 +83,13 @@ var formation = new Formation(teamsCount,5);
<span class="awoken-bind"></span> <span class="awoken-bind"></span>
</span> </span>
</div> </div>
<div class="tIf-effect">
<icon class="_76board"></icon>
<icon class="no-skyfall"></icon>
<icon class="poison-no-effect"></icon>
<icon class="add-combo"></icon>
<icon class="inflicts"></icon>
</div>
</div> </div>
<ul class="teams"> <ul class="teams">
<li class="team-bigbox team-1 show-team-name-right"> <li class="team-bigbox team-1 show-team-name-right">

View File

@ -690,6 +690,113 @@ function countTeamHp(memberArr, leader1id, leader2id, solo, noAwoken=false)
} }
return mHpArr; return mHpArr;
} }
//返回卡片的队长技能
function getCardLeaderSkill(card, skillTypes)
{
return getActuallySkill(Skills[card.leaderSkillId], skillTypes, false);
}
//查找到真正起作用的那一个技能
function getActuallySkill(skill, skillTypes, searchRandom = true)
{
if (skillTypes.includes(skill.type))
{
return skill;
}else if (skill.type == 116 || (searchRandom && skill.type == 118) || skill.type == 138)
{
const subSkills = skill.params.map(id=>Skills[id]);
for(let i = 0;i < subSkills.length; i++)
{ //因为可能有多层调用特别是随机118再调用组合116的所以需要递归
let foundSubSkill = getActuallySkill(subSkills[i], skillTypes, searchRandom);
if (foundSubSkill)
{
return foundSubSkill;
}
}
return null;
}else
{
return null;
}
}
//计算队伍是否为76
function tIf_Effect_76board(leader1id, leader2id)
{
const searchTypeArray = [162, 186];
const ls1 = getCardLeaderSkill(Cards[leader1id], searchTypeArray);
const ls2 = getCardLeaderSkill(Cards[leader2id], searchTypeArray);
return Boolean(ls1 || ls2);
}
//计算队伍是否为无天降
function tIf_Effect_noSkyfall(leader1id, leader2id)
{
const searchTypeArray = [163, 177];
const ls1 = getCardLeaderSkill(Cards[leader1id], searchTypeArray);
const ls2 = getCardLeaderSkill(Cards[leader2id], searchTypeArray);
return Boolean(ls1 || ls2);
}
//计算队伍是否为毒无效
function tIf_Effect_poisonNoEffect(leader1id, leader2id)
{
const searchTypeArray = [197];
const ls1 = getCardLeaderSkill(Cards[leader1id], searchTypeArray);
const ls2 = getCardLeaderSkill(Cards[leader2id], searchTypeArray);
return Boolean(ls1 || ls2);
}
//计算队伍的+C
function tIf_Effect_addCombo(leader1id, leader2id)
{
const searchTypeArray = [192,194,206,209,210];
const ls1 = getCardLeaderSkill(Cards[leader1id], searchTypeArray);
const ls2 = getCardLeaderSkill(Cards[leader2id], searchTypeArray);
function getSkillAddCombo(skill)
{
if (!skill) return 0;
switch (skill.type)
{
case 192: case 194:
return skill.params[3];
case 206:
return skill.params[6];
case 209:
return skill.params[0];
case 210:
return skill.params[2];
default:
return 0;
}
}
return [getSkillAddCombo(ls1),getSkillAddCombo(ls2)];
}
//计算队伍的追打
function tIf_Effect_inflicts(leader1id, leader2id)
{
const searchTypeArray = [199,200,201];
const ls1 = getCardLeaderSkill(Cards[leader1id], searchTypeArray);
const ls2 = getCardLeaderSkill(Cards[leader2id], searchTypeArray);
function getSkillFixedDamage(skill)
{
if (!skill) return 0;
switch (skill.type)
{
case 199: case 200:
return skill.params[2];
case 201:
return skill.params[5];
default:
return 0;
}
}
return [getSkillFixedDamage(ls1),getSkillFixedDamage(ls2)];
}
//计算队伍操作时间 //计算队伍操作时间
function countMoveTime(team, leader1id, leader2id, teamIdx) function countMoveTime(team, leader1id, leader2id, teamIdx)
{ {

View File

@ -3073,6 +3073,7 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) {
if (!totalDom) return; if (!totalDom) return;
const tHpDom = totalDom.querySelector(".tIf-total-hp"); const tHpDom = totalDom.querySelector(".tIf-total-hp");
const tMoveDom = totalDom.querySelector(".tIf-total-move"); const tMoveDom = totalDom.querySelector(".tIf-total-move");
const tEffectDom = totalDom.querySelector(".tIf-effect");
const teams = formation.teams; const teams = formation.teams;
@ -3139,18 +3140,67 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) {
setTextContentAndAttribute(tMoveDom_noAwoken, Math.round((moveTime.duration.default + moveTime.duration.leader + moveTime.duration.badge) * 100) / 100); setTextContentAndAttribute(tMoveDom_noAwoken, Math.round((moveTime.duration.default + moveTime.duration.leader + moveTime.duration.badge) * 100) / 100);
} }
} }
if (tEffectDom) {
const _76board = tEffectDom.querySelector("._76board");
if (tIf_Effect_76board(leader1id,leader2id))
{
_76board.classList.remove(className_displayNone);
}else
{
_76board.classList.add(className_displayNone);
}
const noSkyfall = tEffectDom.querySelector(".no-skyfall");
if (tIf_Effect_noSkyfall(leader1id,leader2id))
{
noSkyfall.classList.remove(className_displayNone);
}else
{
noSkyfall.classList.add(className_displayNone);
}
const poisonNoEffect = tEffectDom.querySelector(".poison-no-effect");
if (tIf_Effect_poisonNoEffect(leader1id,leader2id))
{
poisonNoEffect.classList.remove(className_displayNone);
}else
{
poisonNoEffect.classList.add(className_displayNone);
}
const addCombo = tEffectDom.querySelector(".add-combo");
const addComboValue = tIf_Effect_addCombo(leader1id,leader2id);
if ((addComboValue[0] | addComboValue[1]) > 0)
{
addCombo.classList.remove(className_displayNone);
addCombo.setAttribute("data-add-combo", addComboValue.filter(v=>v).join("/"));
}else
{
addCombo.classList.add(className_displayNone);
}
const inflicts = tEffectDom.querySelector(".inflicts");
const inflictsValue = tIf_Effect_inflicts(leader1id,leader2id);
if ((inflictsValue[0] | inflictsValue[1]) > 0)
{
inflicts.classList.remove(className_displayNone);
inflicts.setAttribute("data-inflicts", inflictsValue.filter(v=>v).map(v=>v.bigNumberToString()).join("/"));
}else
{
inflicts.classList.add(className_displayNone);
}
}
} }
//刷新所有队伍能力值合计 //刷新所有队伍能力值合计
function refreshFormationTotalHP(totalDom, teams) { function refreshFormationTotalHP(totalDom, teams) {
//计算总的生命值 //计算总的生命值
if (!totalDom) return; if (!totalDom) return;
const tHpDom = totalDom.querySelector(".tIf-total-hp"); const tHpDom = totalDom.querySelector(".tIf-total-hp");
const tEffectDom = totalDom.querySelector(".tIf-effect");
if (tHpDom) {
//因为目前仅用于2P所以直接在外面固定写了 //因为目前仅用于2P所以直接在外面固定写了
const leader1id = teams[0][0][0].id; const leader1id = teams[0][0][0].id;
const leader2id = teams[1][0][0].id; const leader2id = teams[1][0][0].id;
if (tHpDom) {
const reduceScale1 = getReduceScale(Skills[Cards[leader1id].leaderSkillId],true,true,true); const reduceScale1 = getReduceScale(Skills[Cards[leader1id].leaderSkillId],true,true,true);
const reduceScale2 = getReduceScale(Skills[Cards[leader2id].leaderSkillId],true,true,true); const reduceScale2 = getReduceScale(Skills[Cards[leader2id].leaderSkillId],true,true,true);
const totalReduce = 1 - (1 - reduceScale1) * (1 - reduceScale2); const totalReduce = 1 - (1 - reduceScale1) * (1 - reduceScale2);
@ -3190,6 +3240,53 @@ function refreshFormationTotalHP(totalDom, teams) {
setTextContentAndAttribute(tHpDom_reduce.querySelector(".general"), tReduceHP.bigNumberToString()); setTextContentAndAttribute(tHpDom_reduce.querySelector(".general"), tReduceHP.bigNumberToString());
setTextContentAndAttribute(tHpDom_reduce.querySelector(".awoken-bind"), tReduceHPNoAwoken.bigNumberToString()); setTextContentAndAttribute(tHpDom_reduce.querySelector(".awoken-bind"), tReduceHPNoAwoken.bigNumberToString());
} }
if (tEffectDom) {
const _76board = tEffectDom.querySelector("._76board");
if (tIf_Effect_76board(leader1id,leader2id))
{
_76board.classList.remove(className_displayNone);
}else
{
_76board.classList.add(className_displayNone);
}
const noSkyfall = tEffectDom.querySelector(".no-skyfall");
if (tIf_Effect_noSkyfall(leader1id,leader2id))
{
noSkyfall.classList.remove(className_displayNone);
}else
{
noSkyfall.classList.add(className_displayNone);
}
const poisonNoEffect = tEffectDom.querySelector(".poison-no-effect");
if (tIf_Effect_poisonNoEffect(leader1id,leader2id))
{
poisonNoEffect.classList.remove(className_displayNone);
}else
{
poisonNoEffect.classList.add(className_displayNone);
}
const addCombo = tEffectDom.querySelector(".add-combo");
const addComboValue = tIf_Effect_addCombo(leader1id,leader2id);
if ((addComboValue[0] | addComboValue[1]) > 0)
{
addCombo.classList.remove(className_displayNone);
addCombo.setAttribute("data-add-combo", addComboValue.filter(v=>v).join("/"));
}else
{
addCombo.classList.add(className_displayNone);
}
const inflicts = tEffectDom.querySelector(".inflicts");
const inflictsValue = tIf_Effect_inflicts(leader1id,leader2id);
if ((inflictsValue[0] | inflictsValue[1]) > 0)
{
inflicts.classList.remove(className_displayNone);
inflicts.setAttribute("data-inflicts", inflictsValue.filter(v=>v).map(v=>v.bigNumberToString()).join("/"));
}else
{
inflicts.classList.add(className_displayNone);
}
}
} }
//刷新单人技能CD //刷新单人技能CD
function refreshMemberSkillCD(teamDom, team, idx) { function refreshMemberSkillCD(teamDom, team, idx) {

View File

@ -89,6 +89,13 @@ var formation = new Formation(teamsCount,6);
<span class="general"></span> <span class="general"></span>
<span class="awoken-bind"></span> <span class="awoken-bind"></span>
</div> </div>
<div class="tIf-effect">
<icon class="_76board"></icon>
<icon class="no-skyfall"></icon>
<icon class="poison-no-effect"></icon>
<icon class="add-combo"></icon>
<icon class="inflicts"></icon>
</div>
</div> </div>
</ul> </ul>
<div class="team-box-name"> <div class="team-box-name">

View File

@ -580,6 +580,11 @@ ul{
display: inline-block; display: inline-block;
} }
/*各种信息统计的图标*/ /*各种信息统计的图标*/
.tIf-total-move,
.tIf-effect
{
display: inline-block;
}
.tIf-total-hp .general::before, .tIf-total-hp .general::before,
.tIf-total-hp .awoken-bind::before, .tIf-total-hp .awoken-bind::before,
.tIf-total-hp .reduce .reduce-scale::before, .tIf-total-hp .reduce .reduce-scale::before,
@ -587,13 +592,16 @@ ul{
.tIf-total-hp .reduce .awoken-bind::before, .tIf-total-hp .reduce .awoken-bind::before,
.tIf-total-move .general::before, .tIf-total-move .general::before,
.tIf-total-move .awoken-bind::before, .tIf-total-move .awoken-bind::before,
.tIf-total-move.fixed-move-time::after .tIf-total-move.fixed-move-time::after,
.tIf-effect icon::before,
icon.poison-no-effect::after
{ {
content: " "; content: " ";
background-size: cover; background-size: cover;
display: inline-block; display: inline-block;
width: 16px; width: 20px;
height: 16px; height: 20px;
vertical-align: top;
} }
.tIf-total-hp .awoken-bind::before, .tIf-total-hp .awoken-bind::before,
.tIf-total-hp .reduce .awoken-bind::before, .tIf-total-hp .reduce .awoken-bind::before,
@ -642,12 +650,13 @@ ul{
opacity: 0; opacity: 0;
} }
} }
.tIf-total-move.fixed-move-time::after .tIf-total-move.fixed-move-time::after,
icon.poison-no-effect::after
{ {
background-image: url(images/icon-bind.png); background-image: url(images/icon-bind.png);
position: absolute; position: absolute;
left:0; left: 0;
top:2px; top: 0;
animation: hidden-visible-animate 0.5s infinite ease-in alternate; animation: hidden-visible-animate 0.5s infinite ease-in alternate;
} }
/*单人时的协力觉醒和多人时的掉落觉醒显示无效*/ /*单人时的协力觉醒和多人时的掉落觉醒显示无效*/
@ -663,6 +672,50 @@ body:not(.solo) .awoken-icon[data-awoken-icon="64"]::after
animation: hidden-visible-animate 0.5s infinite ease-in alternate; animation: hidden-visible-animate 0.5s infinite ease-in alternate;
} }
.tIf-effect icon
{
position: relative;
}
icon._76board::before
{
background-image: url(images/icon-76board.png);
}
icon.no-skyfall::before
{
background-image: url(images/icon-no-skyfall.png);
}
icon.poison-no-effect::before
{
background-image: url(images/icon-poison.png);
}
icon.add-combo
{
margin-right: 7px;
}
icon.add-combo::before
{
background-image: url(images/icon-add-combo.png);
}
icon.add-combo::after
{
color: white;
text-shadow: black 1px 1px 0,black -1px 0px 0,black 0 0 1px;
font-family: var(--game-font-family);
font-size: 12px;
position: absolute;
top: -7px;
left: 10px;
content: attr(data-add-combo);
}
icon.inflicts::before
{
background-image: url(images/icon-inflicts.png);
}
icon.inflicts::after
{
content: attr(data-inflicts);
}
/*队伍的潜觉*/ /*队伍的潜觉*/
.team-latents .latents{ .team-latents .latents{
width: var(--head-block-width); width: var(--head-block-width);

View File

@ -104,6 +104,13 @@ var formation = new Formation(teamsCount,6);
<span class="general"></span> <span class="general"></span>
<span class="awoken-bind"></span> <span class="awoken-bind"></span>
</div> </div>
<div class="tIf-effect">
<icon class="_76board"></icon>
<icon class="no-skyfall"></icon>
<icon class="poison-no-effect"></icon>
<icon class="add-combo"></icon>
<icon class="inflicts"></icon>
</div>
</div> </div>
</ul> </ul>
<div class="team-box-name"> <div class="team-box-name">
@ -517,6 +524,13 @@ var formation = new Formation(teamsCount,6);
<span class="general"></span> <span class="general"></span>
<span class="awoken-bind"></span> <span class="awoken-bind"></span>
</div> </div>
<div class="tIf-effect">
<icon class="_76board"></icon>
<icon class="no-skyfall"></icon>
<icon class="poison-no-effect"></icon>
<icon class="add-combo"></icon>
<icon class="inflicts"></icon>
</div>
</div> </div>
</ul> </ul>
<div class="team-box-name"> <div class="team-box-name">
@ -930,6 +944,13 @@ var formation = new Formation(teamsCount,6);
<span class="general"></span> <span class="general"></span>
<span class="awoken-bind"></span> <span class="awoken-bind"></span>
</div> </div>
<div class="tIf-effect">
<icon class="_76board"></icon>
<icon class="no-skyfall"></icon>
<icon class="poison-no-effect"></icon>
<icon class="add-combo"></icon>
<icon class="inflicts"></icon>
</div>
</div> </div>
</ul> </ul>
<div class="team-box-name"> <div class="team-box-name">