diff --git a/script-json_data.js b/script-json_data.js index 7ed9c9a2..ddb25a59 100644 --- a/script-json_data.js +++ b/script-json_data.js @@ -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(" ")}`; } }, ]}, diff --git a/script-skill-parser.js b/script-skill-parser.js index 4a123623..6d71ace6 100644 --- a/script-skill-parser.js +++ b/script-skill-parser.js @@ -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)), }; diff --git a/script-universal_function.js b/script-universal_function.js index c9b54aa9..fb259178 100644 --- a/script-universal_function.js +++ b/script-universal_function.js @@ -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, diff --git a/style.css b/style.css index 257acadc..fc27f10f 100644 --- a/style.css +++ b/style.css @@ -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; }