Browse Source

支持新的限定地下城层数的技能

tags/v21.2
枫谷剑仙 4 years ago
parent
commit
428cef8709
4 changed files with 40 additions and 14 deletions
  1. +26
    -10
      script-json_data.js
  2. +2
    -1
      script-skill-parser.js
  3. +8
    -3
      script-universal_function.js
  4. +4
    -0
      style.css

+ 26
- 10
script-json_data.js View File

@@ -1674,18 +1674,34 @@ const specialSearchFunctions = (function() {
},
{name:"Enable require HP range",otLangName:{chs:"技能使用血线要求",cht:"技能使用血線要求"},
function:cards=>cards.filter(card=>{
const searchTypeArray = [225];
const skill = getCardActiveSkill(card, searchTypeArray);
return skill;
const searchTypeArray = [225];
const skill = getCardActiveSkill(card, searchTypeArray);
return skill;
}),
addition:card=>{
const searchTypeArray = [225];
const skill = getCardActiveSkill(card, searchTypeArray);
const sk = skill.params;
let strArr = [];
if (sk[0]) strArr.push(`≥${sk[0]}%`);
if (sk[1]) strArr.push(`≤${sk[1]}%`);
return `HP ${strArr.join(" ")}`;
const searchTypeArray = [225];
const skill = getCardActiveSkill(card, searchTypeArray);
const sk = skill.params;
let strArr = [];
if (sk[0]) strArr.push(`≥${sk[0]}%`);
if (sk[1]) strArr.push(`≤${sk[1]}%`);
return `HP ${strArr.join(" ")}`;
}
},
{name:"Enable require Dungeon Stage",otLangName:{chs:"技能使用地下城层数要求",cht:"技能使用地下城層數要求"},
function:cards=>cards.filter(card=>{
const searchTypeArray = [234];
const skill = getCardActiveSkill(card, searchTypeArray);
return skill;
}),
addition:card=>{
const searchTypeArray = [234];
const skill = getCardActiveSkill(card, searchTypeArray);
const sk = skill.params;
let strArr = [];
if (sk[0]) strArr.push(`≥${sk[0]}`);
if (sk[1]) strArr.push(`≤${sk[1]}`);
return `层 ${strArr.join(" ")}`;
}
},
]},


+ 2
- 1
script-skill-parser.js View File

@@ -1417,6 +1417,7 @@ const parsers = {
},
[232](...ids) { return evolvedSkills(false, ids.map(id => this.parser(id))); },
[233](...ids) { return evolvedSkills(true, ids.map(id => this.parser(id))); },
[234](min, max) { return skillProviso(c.stage(min ?? 0, max ?? 0)); },
[1000](type, pos, ...ids) {
const posType = (type=>{
switch (type) {
@@ -2502,7 +2503,7 @@ function renderCondition(cond) {
frg.ap(tsp.cond.heal(dict));
} else if (cond.stage) {
let dict = {
hp: renderStat('cstage'),
stage: renderStat('cstage'),
min: renderValue(v.constant(cond.stage.min)),
max: renderValue(v.constant(cond.stage.max)),
};


+ 8
- 3
script-universal_function.js View File

@@ -808,7 +808,7 @@ function descriptionToHTML(str)
for (let i = 0; i < subArr.length; i += (subMatchCount+1)) {
newArr.push(subArr[i]);
if (subArr[i+subMatchCount] !== undefined) {
newArr.push(returnFunc(...[subArr.slice(i + 1, i + subMatchCount + 1)]));
newArr.push(returnFunc(...subArr.slice(i + 1, i + subMatchCount + 1)));
}
}
return newArr;
@@ -818,11 +818,16 @@ function descriptionToHTML(str)
});
}
let nodeArr = [str];
nodeArr = formatParse(nodeArr, /\^([a-fA-F0-9]+?)\^([^\^]+?)\^p/igm, 2,
nodeArr = formatParse(nodeArr, /\^(\w+?)\^([^\^]+?)\^p/igm, 2,
(color, content)=>{
const sp = document.createElement("span");
sp.style.color = `#${color}`;
sp.textContent = content;
if (/^[a-fA-F0-9]+$/g.test(color)) {
sp.style.color = `#${color}`;
} else if (/qs/i.test(color)) {
sp.style.color = `blue`;
}
console.log(color, content)
return sp;
});
nodeArr = formatParse(nodeArr, /\%\{m([0-9]{1,5})\}/g, 1,


+ 4
- 0
style.css View File

@@ -3580,6 +3580,10 @@ table .orb-icon
color: #ff3600;
}
.card-skill-list .skill-proviso
{
color: blue;
}
.card-skill-list .skill-proviso
{
border-bottom: 1px brown dashed;
}


Loading…
Cancel
Save