From cca012f4d14db8c147f4fe676a10e8e62b8b18d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Tue, 17 Aug 2021 21:07:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=B8=89=E7=A7=8D=E5=B0=81?= =?UTF-8?q?=E7=9A=84=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- languages/en.js | 9 ++++--- script-json_data.js | 7 +++--- script-skill-parser.js | 56 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 58 insertions(+), 14 deletions(-) diff --git a/languages/en.js b/languages/en.js index 3dd820fb..a1e2f099 100644 --- a/languages/en.js +++ b/languages/en.js @@ -38,9 +38,10 @@ no_skyfall: tp`${'icon'}No Skyfall Combos`, self_harm: tp`${'icon'}Reduces ${'stats'} by ${'value'}`, heal: tp`${'icon'}Recover ${'value'} ${'stats'}`, - unbind_normal: tp`${'icon'}Recovery bind by ${'turns'} turns`, - unbind_awakenings: tp`${'icon'}Recovery awoken bind by ${'turns'} turns`, - unbind_matches: tp`${'icon'}Reduces unmatchable orb by ${'turns'} turns`, + unbind: tp`Recovery ${'stats'} by ${'turns'} turns`, + unbind_normal: tp`${'icon'}Bind`, + unbind_awakenings: tp`${'icon'}Awoken bind`, + unbind_matches: tp`${'icon'}Unmatchable orb`, bind_skill: tp`${'icon'}Unable to use skills`, defense_break: tp`${'icon'}Reduce enemy defense by ${'value'}`, poison: tp`${'icon'}Poisons ${'target'}, reduce ${'stats'} with ${'belong_to'} ${'value'} per turns`, @@ -82,7 +83,7 @@ rate_multiply_drop: tp`${'icon'}Drop rate`, rate_multiply_coin: tp`${'icon'}Coins`, rate_multiply_exp: tp`${'icon'}Rank EXP`, - reduce_damage: tp`${'condition'}${'icon'}Reduces${'attrs'} damage taken by ${'value'}`, + reduce_damage: tp`${'condition'}${'icon'}Reduces ${'attrs'} damage taken by ${'value'}`, power_up: tp`${'condition'}${'targets'}${'value'}${'reduceDamage'}${'addCombo'}${'followAttack'}`, power_up_targets: tp`[${'attrs_types'}]'s `, //attrs, types, attrs_types henshin: tp`Transforms into ${'card'}`, diff --git a/script-json_data.js b/script-json_data.js index baaad4f8..0a5d9478 100644 --- a/script-json_data.js +++ b/script-json_data.js @@ -52,9 +52,10 @@ let localTranslating = { no_skyfall: tp`${'icon'}天降的宝珠不会消除`, self_harm: tp`${'icon'}${'stats'}减少${'value'}`, heal: tp`${'icon'}回复 ${'value'} 的 ${'stats'}`, - unbind_normal: tp`${'icon'}封锁状态减少${'turns'}回合`, - unbind_awakenings: tp`${'icon'}觉醒无效状态减少${'turns'}回合`, - unbind_matches: tp`${'icon'}无法消除宝珠状态减少${'turns'}回合`, + unbind: tp`${'stats'}状态减少 ${'turns'} 回合`, + unbind_normal: tp`${'icon'}封锁`, + unbind_awakenings: tp`${'icon'}觉醒无效`, + unbind_matches: tp`${'icon'}无法消除宝珠`, bind_skill: tp`${'icon'}自身无法使用技能`, defense_break: tp`${'icon'}敌方的防御力减少${'value'}`, poison: tp`${'icon'}使${'target'}中毒,每回合损失${'belong_to'} ${'value'} 的 ${'stats'}`, diff --git a/script-skill-parser.js b/script-skill-parser.js index 7abd9ee5..6bb51f5e 100644 --- a/script-skill-parser.js +++ b/script-skill-parser.js @@ -1731,13 +1731,55 @@ function renderSkill(skill, option = {}) case SkillKinds.Unbind: { //解封 let normal = skill.normal, awakenings = skill.awakenings, matches = skill.matches; let effects = []; - if (normal) - effects.push(tsp.skill.unbind_normal({icon: createIcon("unbind-normal"), turns: normal})); - if (awakenings) - effects.push(tsp.skill.unbind_awakenings({icon: createIcon("unbind-awakenings"), turns: awakenings})); - if (matches) - effects.push(tsp.skill.unbind_matches({icon: createIcon("unbind-matches"), turns: matches})); - frg.ap(effects.nodeJoin(tsp.word.comma())); + let enabledStats = [normal, awakenings, matches].filter(Boolean); + if (merge_skill && enabledStats.length >= 2 && enabledStats.every((s,i,arr)=>s==arr[0])) + { + if (normal) + { + effects.push(tsp.skill.unbind_normal({icon: createIcon("unbind-normal")})); + } + if (awakenings) + { + effects.push(tsp.skill.unbind_awakenings({icon: createIcon("unbind-awakenings")})); + } + if (matches) + { + effects.push(tsp.skill.unbind_matches({icon: createIcon("unbind-matches")})); + } + let dict = { + turns: enabledStats[0], + stats: effects.nodeJoin(tsp.word.slight_pause()), + } + frg.ap(tsp.skill.unbind(dict)); + } + else + { + if (normal) + { + let dict = { + turns: normal, + stats: tsp.skill.unbind_normal({icon: createIcon("unbind-normal")}), + } + effects.push(tsp.skill.unbind(dict)); + } + if (awakenings) + { + let dict = { + turns: awakenings, + stats: tsp.skill.unbind_awakenings({icon: createIcon("unbind-awakenings")}), + } + effects.push(tsp.skill.unbind(dict)); + } + if (matches) + { + let dict = { + turns: matches, + stats: tsp.skill.unbind_matches({icon: createIcon("unbind-matches")}), + } + effects.push(tsp.skill.unbind(dict)); + } + frg.ap(effects.nodeJoin(tsp.word.comma())); + } break; } case SkillKinds.BindSkill: {