增加星级强化设定
This commit is contained in:
parent
c80ffacd94
commit
7e5b9a22e1
|
@ -593,6 +593,10 @@ label[for="qr-data-type-pdchu"]::before {
|
|||
{
|
||||
content: "Confirm";
|
||||
}
|
||||
.dialog-dungeon-enchance .rare-list::before
|
||||
{
|
||||
content: "Effective Rarity:";
|
||||
}
|
||||
.dialog-dungeon-enchance .attr-list::before
|
||||
{
|
||||
content: "Effective Attr.:";
|
||||
|
|
|
@ -557,6 +557,10 @@ label[for="qr-data-type-pdchu"]::before {
|
|||
{
|
||||
content: "確認";
|
||||
}
|
||||
.dialog-dungeon-enchance .rare-list::before
|
||||
{
|
||||
content: "有効な希少性:";
|
||||
}
|
||||
.dialog-dungeon-enchance .attr-list::before
|
||||
{
|
||||
content: "有効な属性:";
|
||||
|
|
|
@ -551,6 +551,10 @@ label[for="qr-data-type-pdchu"]::before {
|
|||
{
|
||||
content: "확인";
|
||||
}
|
||||
.dialog-dungeon-enchance .rare-list::before
|
||||
{
|
||||
content: "유효한 희귀도:";
|
||||
}
|
||||
.dialog-dungeon-enchance .attr-list::before
|
||||
{
|
||||
content: "유효한 속성:";
|
||||
|
|
|
@ -550,6 +550,10 @@ label[for="qr-data-type-pdchu"]::before {
|
|||
{
|
||||
content: "確認";
|
||||
}
|
||||
.dialog-dungeon-enchance .rare-list::before
|
||||
{
|
||||
content: "生效稀有度:";
|
||||
}
|
||||
.dialog-dungeon-enchance .attr-list::before
|
||||
{
|
||||
content: "生效属性:";
|
||||
|
|
|
@ -550,6 +550,10 @@ label[for="qr-data-type-pdchu"]::before {
|
|||
{
|
||||
content: "確認";
|
||||
}
|
||||
.dialog-dungeon-enchance .rare-list::before
|
||||
{
|
||||
content: "生效稀有度:";
|
||||
}
|
||||
.dialog-dungeon-enchance .attr-list::before
|
||||
{
|
||||
content: "生效属性:";
|
||||
|
|
|
@ -91,7 +91,7 @@ Number.prototype.keepCounts = function(decimalDigits = 2, plusSign = false)
|
|||
return (plusSign && this > 0 ? '+' : '') + newNumber.bigNumberToString();
|
||||
}
|
||||
//数组删除自己尾部的空元素
|
||||
Array.prototype.DeleteLatter = function(item = null) {
|
||||
Array.prototype.deleteLatter = function(item = null) {
|
||||
let index = this.length - 1;
|
||||
for (; index >= 0; index--) {
|
||||
if (this[index] !== item) {
|
||||
|
@ -407,7 +407,7 @@ function calculateAbility(member, assist = null, solo = true, teamsCount = 1) {
|
|||
|
||||
const dge = formation.dungeonEnchance;
|
||||
const dgeRate = [dge.rate.hp, dge.rate.atk, dge.rate.rcv];
|
||||
const isDge = memberCard.attrs.some(attr=>dge.attrs.includes(attr)) || memberCard.types.some(type=>dge.types.includes(type));
|
||||
const isDge = dge.rarities.includes(memberCard.rarity) || memberCard.attrs.some(attr=>dge.attrs.includes(attr)) || memberCard.types.some(type=>dge.types.includes(type));
|
||||
|
||||
const abilitys = memberCurves.map((ab, idx) => {
|
||||
const n_base = Math.round(curve(ab, member.level, memberCard.maxLevel, memberCard.limitBreakIncr, limitBreakIncr120[idx])); //等级基础三维
|
||||
|
@ -899,7 +899,7 @@ function tIf_Effect_noSkyfall(leader1id, leader2id) {
|
|||
const searchTypeArray = [163, 177];
|
||||
const ls1 = getCardLeaderSkills(Cards[leader1id], searchTypeArray)[0];
|
||||
const ls2 = getCardLeaderSkills(Cards[leader2id], searchTypeArray)[0];
|
||||
[0]
|
||||
|
||||
return Boolean(ls1 || ls2);
|
||||
}
|
||||
//计算队伍是否为毒无效
|
||||
|
|
56
script.js
56
script.js
|
@ -252,6 +252,7 @@ var Formation = function(teamCount, memberCount) {
|
|||
this.dungeonEnchance = {
|
||||
attrs: [],
|
||||
types: [],
|
||||
rarities: [],
|
||||
rate: {
|
||||
hp: 1,
|
||||
atk: 1,
|
||||
|
@ -280,21 +281,18 @@ Formation.prototype.outObj = function() {
|
|||
const teamArr = [];
|
||||
teamArr[0] = t[0].map(m =>
|
||||
m.outObj()
|
||||
).DeleteLatter();
|
||||
).deleteLatter();
|
||||
teamArr[1] = t[1].map(m =>
|
||||
m.outObj()
|
||||
).DeleteLatter();
|
||||
).deleteLatter();
|
||||
if (t[2]) teamArr[2] = t[2];
|
||||
if (t[3]) teamArr[3] = t[3];
|
||||
return teamArr;
|
||||
});
|
||||
let dge = this.dungeonEnchance;
|
||||
if (Object.values(dge.rate).some(rate => rate != 1)) obj.r = [
|
||||
reflags(dge.attrs), //属性
|
||||
reflags(dge.types), //类型
|
||||
dge.rate.hp,
|
||||
dge.rate.atk,
|
||||
dge.rate.rcv
|
||||
[reflags(dge.types),reflags(dge.attrs),reflags(dge.rarities)].deleteLatter(0), //类型,属性,星级
|
||||
[dge.rate.hp,dge.rate.atk,dge.rate.rcv].deleteLatter(1)
|
||||
];
|
||||
obj.v = dataStructure;
|
||||
/*if (obj.f.every(team=>team[0].length == 0 && team[1].length == 0 && team[2] == undefined) &&
|
||||
|
@ -319,6 +317,7 @@ Formation.prototype.loadObj = function(f) {
|
|||
t[2] = 0;
|
||||
t[3] = 0;
|
||||
});
|
||||
dge.rarities.length = 0;
|
||||
dge.attrs.length = 0;
|
||||
dge.types.length = 0;
|
||||
dge.rate.hp = 1;
|
||||
|
@ -347,11 +346,23 @@ Formation.prototype.loadObj = function(f) {
|
|||
});
|
||||
if (f.r)
|
||||
{
|
||||
dge.attrs = flags(f.r[0] ?? 0);
|
||||
dge.types = flags(f.r[1] ?? 0);
|
||||
dge.rate.hp = f.r[2] ?? 1;
|
||||
dge.rate.atk = f.r[3] ?? 1;
|
||||
dge.rate.rcv = f.r[4] ?? 1;
|
||||
if (Array.isArray(f.r[0])) {
|
||||
let effective = f.r[0];
|
||||
let rates = f.r[1];
|
||||
dge.types = flags(effective[0] ?? 0);
|
||||
dge.attrs = flags(effective[1] ?? 0);
|
||||
dge.rarities = flags(effective[2] ?? 0);
|
||||
dge.rate.hp = rates[0] ?? 1;
|
||||
dge.rate.atk = rates[1] ?? 1;
|
||||
dge.rate.rcv = rates[2] ?? 1;
|
||||
} else {
|
||||
dge.attrs = flags(f.r[0] ?? 0);
|
||||
dge.types = flags(f.r[1] ?? 0);
|
||||
dge.rarities.length = 0;
|
||||
dge.rate.hp = f.r[2] ?? 1;
|
||||
dge.rate.atk = f.r[3] ?? 1;
|
||||
dge.rate.rcv = f.r[4] ?? 1;
|
||||
}
|
||||
}
|
||||
if (f.b)
|
||||
this.teams[0][2] = f.b; //原来模式的徽章
|
||||
|
@ -1966,10 +1977,15 @@ function initialize() {
|
|||
dungeonEnchanceDialog.show = function(formation)
|
||||
{
|
||||
const dialogContent = this.querySelector(".dialog-content");
|
||||
const rareDoms = Array.from(dialogContent.querySelectorAll(".rare-list .rare-check"));
|
||||
const attrDoms = Array.from(dialogContent.querySelectorAll(".attr-list .attr-check"));
|
||||
const typeDoms = Array.from(dialogContent.querySelectorAll(".type-list .type-check"));
|
||||
|
||||
let dge = formation.dungeonEnchance;
|
||||
for (const rareDom of rareDoms)
|
||||
{
|
||||
rareDom.checked = dge.rarities.includes(parseInt(rareDom.value));
|
||||
}
|
||||
for (const attrDom of attrDoms)
|
||||
{
|
||||
attrDom.checked = dge.attrs.includes(parseInt(attrDom.value));
|
||||
|
@ -1991,14 +2007,16 @@ function initialize() {
|
|||
const dungeonEnchanceDialogConfirm = dungeonEnchanceDialog.querySelector(".dialog-confirm");
|
||||
dungeonEnchanceDialogConfirm.onclick = function(){
|
||||
const dialogContent = dungeonEnchanceDialog.querySelector(".dialog-content");
|
||||
const rareDoms = Array.from(dialogContent.querySelectorAll(".rare-list .rare-check"));
|
||||
const attrDoms = Array.from(dialogContent.querySelectorAll(".attr-list .attr-check"));
|
||||
const typeDoms = Array.from(dialogContent.querySelectorAll(".type-list .type-check"));
|
||||
const rarities = rareDoms.map(rareDom=>rareDom.checked ? parseInt(rareDom.value) : undefined).filter(v=>!isNaN(v));
|
||||
const attrs = attrDoms.map(attrDom=>attrDom.checked ? parseInt(attrDom.value) : undefined).filter(v=>!isNaN(v));
|
||||
const types = typeDoms.map(typeDom=>typeDom.checked ? parseInt(typeDom.value) : undefined).filter(v=>!isNaN(v));
|
||||
|
||||
let dge = formation.dungeonEnchance;
|
||||
dge.rarities = rarities;
|
||||
dge.attrs = attrs;
|
||||
console.log(attrs, types);
|
||||
dge.types = types;
|
||||
dge.rate.hp = parseInt(dialogContent.querySelector("#dungeon-hp").value);
|
||||
dge.rate.atk = parseInt(dialogContent.querySelector("#dungeon-atk").value);
|
||||
|
@ -2010,8 +2028,13 @@ function initialize() {
|
|||
const dungeonEnchanceDialogClear = dungeonEnchanceDialog.querySelector(".dialog-clear");
|
||||
dungeonEnchanceDialogClear.onclick = function(){
|
||||
const dialogContent = dungeonEnchanceDialog.querySelector(".dialog-content");
|
||||
const rareDoms = Array.from(dialogContent.querySelectorAll(".rare-list .rare-check"));
|
||||
const attrDoms = Array.from(dialogContent.querySelectorAll(".attr-list .attr-check"));
|
||||
const typeDoms = Array.from(dialogContent.querySelectorAll(".type-list .type-check"));
|
||||
for (const rareDom of rareDoms)
|
||||
{
|
||||
rareDom.checked = false;
|
||||
}
|
||||
for (const attrDom of attrDoms)
|
||||
{
|
||||
attrDom.checked = false;
|
||||
|
@ -3835,6 +3858,13 @@ function refreshAll(formationData) {
|
|||
if (Object.values(dge.rate).some(rate => rate != 1))
|
||||
{
|
||||
dungeonEnchanceDom.innerHTML = '';
|
||||
if (dge.rarities.length > 0) {
|
||||
for (const rarity of dge.rarities) {
|
||||
const icon = dungeonEnchanceDom.appendChild(document.createElement("icon"));
|
||||
icon.className = "rare-icon";
|
||||
icon.setAttribute("data-rare-icon", rarity);
|
||||
}
|
||||
}
|
||||
let skill = powerUp(dge.attrs, dge.types, p.mul({hp: dge.rate.hp * 100, atk: dge.rate.atk * 100, rcv: dge.rate.rcv * 100}));
|
||||
dungeonEnchanceDom.appendChild(renderSkill(skill));
|
||||
dungeonEnchanceDom.classList.remove(className_displayNone);
|
||||
|
|
12
solo.html
12
solo.html
|
@ -1051,6 +1051,18 @@ var formation = new Formation(teamsCount,6);
|
|||
<div class="dialog dialog-dungeon-enchance display-none">
|
||||
<div class="dialog-title"></div>
|
||||
<div class="dialog-content">
|
||||
<ul class="rare-list">
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="1" id="dungeon-rare-1" /><label class="rare-icon" data-rare-icon="1" for="dungeon-rare-1"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="2" id="dungeon-rare-2" /><label class="rare-icon" data-rare-icon="3" for="dungeon-rare-2"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="3" id="dungeon-rare-3" /><label class="rare-icon" data-rare-icon="4" for="dungeon-rare-3"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="4" id="dungeon-rare-4" /><label class="rare-icon" data-rare-icon="5" for="dungeon-rare-4"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="5" id="dungeon-rare-5" /><label class="rare-icon" data-rare-icon="5" for="dungeon-rare-5"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="6" id="dungeon-rare-6" /><label class="rare-icon" data-rare-icon="6" for="dungeon-rare-6"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="7" id="dungeon-rare-7" /><label class="rare-icon" data-rare-icon="7" for="dungeon-rare-7"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="8" id="dungeon-rare-8" /><label class="rare-icon" data-rare-icon="8" for="dungeon-rare-8"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="9" id="dungeon-rare-9" /><label class="rare-icon" data-rare-icon="9" for="dungeon-rare-9"></label></li>
|
||||
<li><input type="checkbox" class="rare-check" name="dungeon-rare" value="10" id="dungeon-rare-10" /><label class="rare-icon" data-rare-icon="10" for="dungeon-rare-10"></label></li>
|
||||
</ul>
|
||||
<ul class="attr-list">
|
||||
<li><input type="checkbox" class="attr-check" name="dungeon-attrs" value="0" id="dungeon-attr-0" /><label class="attr" data-attr-icon="0" for="dungeon-attr-0"></label></li><!--火-->
|
||||
<li><input type="checkbox" class="attr-check" name="dungeon-attrs" value="1" id="dungeon-attr-1" /><label class="attr" data-attr-icon="1" for="dungeon-attr-1"></label></li><!--水-->
|
||||
|
|
13
style.css
13
style.css
|
@ -1471,6 +1471,7 @@ icon.inflicts::after
|
|||
content: "限制属性1为主属性,属性2为副属性";
|
||||
}*/
|
||||
.attr-radio,
|
||||
.attr-check,
|
||||
.type-check,
|
||||
.rare-check,
|
||||
.sawoken-check
|
||||
|
@ -1598,7 +1599,7 @@ icon.inflicts::after
|
|||
margin-top: -3px;
|
||||
margin-bottom: -5px;
|
||||
}
|
||||
.rare-div .rare-icon
|
||||
.rare-icon
|
||||
{
|
||||
font-family: var(--game-font-family);
|
||||
color: white;
|
||||
|
@ -1628,7 +1629,7 @@ icon.inflicts::after
|
|||
opacity: var(--search-icon-unchecked);
|
||||
}
|
||||
|
||||
.rare-div .rare-icon::before
|
||||
.rare-icon::before
|
||||
{
|
||||
content: "★";
|
||||
color: gold;
|
||||
|
@ -1638,7 +1639,7 @@ icon.inflicts::after
|
|||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.rare-div .rare-icon::after
|
||||
.rare-icon::after
|
||||
{
|
||||
color: white;
|
||||
text-shadow: black 0 0 4px;
|
||||
|
@ -1647,7 +1648,7 @@ icon.inflicts::after
|
|||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.rare-div .rare-icon::after
|
||||
.rare-icon::after
|
||||
{
|
||||
content: attr(data-rare-icon);
|
||||
}
|
||||
|
@ -3182,9 +3183,7 @@ table .orb-icon
|
|||
margin-top: 100px;
|
||||
margin-left: calc(50% - 270px);
|
||||
}
|
||||
.dialog-dungeon-enchance .attr-list>li,
|
||||
.dialog-dungeon-enchance .type-list>li,
|
||||
.dialog-dungeon-enchance .stats-list>li
|
||||
.dialog-dungeon-enchance .dialog-content>ul>li
|
||||
{
|
||||
display: inline-block;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue