增加更多队长技能特性的显示
This commit is contained in:
parent
407aa9cdc7
commit
79d6cd1d33
Binary file not shown.
After Width: | Height: | Size: 847 B |
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
|
@ -19,7 +19,7 @@ Number.prototype.bigNumberToString = function()
|
|||
let numPartsStr = numParts.map((num,idx)=>{
|
||||
if (num > 0)
|
||||
{
|
||||
return (num < 1e3 ? "零" : "") + num.toLocaleString() + unit[idx];
|
||||
return (num < 1e3 ? "零" : "") + num + unit[idx];
|
||||
}else
|
||||
return "零";
|
||||
});
|
||||
|
|
|
@ -83,6 +83,13 @@ var formation = new Formation(teamsCount,5);
|
|||
<span class="awoken-bind"></span>
|
||||
</span>
|
||||
</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>
|
||||
<ul class="teams">
|
||||
<li class="team-bigbox team-1 show-team-name-right">
|
||||
|
|
|
@ -690,6 +690,113 @@ function countTeamHp(memberArr, leader1id, leader2id, solo, noAwoken=false)
|
|||
}
|
||||
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)
|
||||
{
|
||||
|
|
99
script.js
99
script.js
|
@ -3073,6 +3073,7 @@ function refreshTeamTotalHP(totalDom, team, teamIdx) {
|
|||
if (!totalDom) return;
|
||||
const tHpDom = totalDom.querySelector(".tIf-total-hp");
|
||||
const tMoveDom = totalDom.querySelector(".tIf-total-move");
|
||||
const tEffectDom = totalDom.querySelector(".tIf-effect");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
//计算总的生命值
|
||||
if (!totalDom) return;
|
||||
const tHpDom = totalDom.querySelector(".tIf-total-hp");
|
||||
const tEffectDom = totalDom.querySelector(".tIf-effect");
|
||||
|
||||
if (tHpDom) {
|
||||
//因为目前仅用于2P,所以直接在外面固定写了
|
||||
const leader1id = teams[0][0][0].id;
|
||||
const leader2id = teams[1][0][0].id;
|
||||
|
||||
if (tHpDom) {
|
||||
|
||||
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);
|
||||
|
@ -3190,6 +3240,53 @@ function refreshFormationTotalHP(totalDom, teams) {
|
|||
setTextContentAndAttribute(tHpDom_reduce.querySelector(".general"), tReduceHP.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
|
||||
function refreshMemberSkillCD(teamDom, team, idx) {
|
||||
|
|
|
@ -89,6 +89,13 @@ var formation = new Formation(teamsCount,6);
|
|||
<span class="general"></span>
|
||||
<span class="awoken-bind"></span>
|
||||
</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>
|
||||
</ul>
|
||||
<div class="team-box-name">
|
||||
|
|
63
style.css
63
style.css
|
@ -580,6 +580,11 @@ ul{
|
|||
display: inline-block;
|
||||
}
|
||||
/*各种信息统计的图标*/
|
||||
.tIf-total-move,
|
||||
.tIf-effect
|
||||
{
|
||||
display: inline-block;
|
||||
}
|
||||
.tIf-total-hp .general::before,
|
||||
.tIf-total-hp .awoken-bind::before,
|
||||
.tIf-total-hp .reduce .reduce-scale::before,
|
||||
|
@ -587,13 +592,16 @@ ul{
|
|||
.tIf-total-hp .reduce .awoken-bind::before,
|
||||
.tIf-total-move .general::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: " ";
|
||||
background-size: cover;
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.tIf-total-hp .awoken-bind::before,
|
||||
.tIf-total-hp .reduce .awoken-bind::before,
|
||||
|
@ -642,12 +650,13 @@ ul{
|
|||
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);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top:2px;
|
||||
top: 0;
|
||||
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;
|
||||
}
|
||||
|
||||
.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{
|
||||
width: var(--head-block-width);
|
||||
|
|
21
triple.html
21
triple.html
|
@ -104,6 +104,13 @@ var formation = new Formation(teamsCount,6);
|
|||
<span class="general"></span>
|
||||
<span class="awoken-bind"></span>
|
||||
</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>
|
||||
</ul>
|
||||
<div class="team-box-name">
|
||||
|
@ -517,6 +524,13 @@ var formation = new Formation(teamsCount,6);
|
|||
<span class="general"></span>
|
||||
<span class="awoken-bind"></span>
|
||||
</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>
|
||||
</ul>
|
||||
<div class="team-box-name">
|
||||
|
@ -930,6 +944,13 @@ var formation = new Formation(teamsCount,6);
|
|||
<span class="general"></span>
|
||||
<span class="awoken-bind"></span>
|
||||
</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>
|
||||
</ul>
|
||||
<div class="team-box-name">
|
||||
|
|
Loading…
Reference in New Issue