From db59f75a6f283091468e52dacaff56d77936390b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Fri, 8 Apr 2022 22:09:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E6=8C=87=E5=AE=9A=E9=98=9F?= =?UTF-8?q?=E5=91=98=E6=94=BB=E5=87=BB=E5=8A=9B=E4=B8=8A=E5=8D=87=E7=9A=84?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- languages/zh.js | 4 +++- script-json_data.js | 22 ++++++---------------- script-skill-parser.js | 41 ++++++++++------------------------------- 3 files changed, 19 insertions(+), 48 deletions(-) diff --git a/languages/zh.js b/languages/zh.js index 9600eea8..7211b572 100644 --- a/languages/zh.js +++ b/languages/zh.js @@ -163,7 +163,9 @@ team: tp`队伍`, team_last: tp`队伍最后一位队员`, team_leader: tp`队长`, - team_sub: tp`队员`, + sub_monsters: tp`队员`, + leader_self: tp`左边队长`, + leader_helper: tp`右边队长`, enemy: tp`敌人`, enemy_all: tp`敌方全体`, enemy_one: tp`敌方1体`, diff --git a/script-json_data.js b/script-json_data.js index 73f82788..1385408d 100644 --- a/script-json_data.js +++ b/script-json_data.js @@ -179,7 +179,9 @@ let localTranslating = { team: tp`team`, team_last: tp`the lastest member`, team_leader: tp`leader`, - team_sub: tp`sub-monsters`, + sub_monsters: tp`sub-members`, + leader_self: tp`left leader`, + leader_helper: tp`right leader`, enemy: tp`Enemy`, enemy_all: tp`all enemys`, enemy_one: tp`1 enemy`, @@ -1977,21 +1979,9 @@ const specialSearchFunctions = (function() { const skill = getCardActiveSkill(card, searchTypeArray); const sk = skill.params; let str = ''; - switch (sk[1]) { - case 1: { - str+="自身"; - break; - } - case 2: { - str+="队长"; - break; - } - case 8: { - str+="队员"; - break; - } - } - str+=`${sk[2] / 100}倍×${sk[0]}T`; + const typeName = ['自身','左队长','右队长','队员']; + str += flags(sk[1]).map(n=>typeName[n]).join(','); + str +=`${sk[2] / 100}倍×${sk[0]}T`; return str; } }, diff --git a/script-skill-parser.js b/script-skill-parser.js index ab8c17bb..e8c0cfad 100644 --- a/script-skill-parser.js +++ b/script-skill-parser.js @@ -845,8 +845,8 @@ function powerUp(attrs, types, value, condition = null, reduceDamageValue = null if (hp === 1 && atk === 1 && rcv === 1 && !reduceDamage) return null; } - if (attrs?.target != undefined) { - return { kind: SkillKinds.PowerUp, target: attrs.target, attrs: null, types: null, condition: condition, value: value, reduceDamage: reduceDamageValue, additional: additional}; + if (attrs?.targets != undefined) { + return { kind: SkillKinds.PowerUp, targets: attrs.targets, attrs: null, types: null, condition: condition, value: value, reduceDamage: reduceDamageValue, additional: additional}; } return { kind: SkillKinds.PowerUp, attrs: attrs, types: types, condition: condition, value: value, reduceDamage: reduceDamageValue, additional: additional}; } @@ -1409,15 +1409,9 @@ const parsers = { "leader": Boolean(target & 1<<1), "sub-monsters": Boolean(target & 1<<3), }*/ - const targetType = (target=>{ - switch (target) { - case 1: return "self"; - case 2: return "leader"; - case 8: return "sub-monsters"; - default: return target; - } - })(target); - return activeTurns(turns, powerUp({target: targetType}, null, p.mul({ atk: mul }))); + const targetTypes = ["self","leader-self","leader-helper","sub-members"]; + const typeArr = flags(target).map(n => targetTypes[n]); + return activeTurns(turns, powerUp({targets: typeArr}, null, p.mul({ atk: mul }))); }, [231](turns, awoken1, awoken2, awoken3, awoken4, awoken5, atk, rcv) { return activeTurns(turns, powerUp(null, null, p.scaleStateKindCount([awoken1, awoken2, awoken3, awoken4, awoken5].filter(Boolean), null, null, p.mul({atk: atk, hp:0, rcv: rcv})))); @@ -2135,7 +2129,7 @@ function renderSkill(skill, option = {}) break; } case SkillKinds.PowerUp: { - let attrs = skill.attrs, types = skill.types, target = skill.target, condition = skill.condition, value = skill.value, reduceDamage = skill.reduceDamage, additional = skill.additional; + let attrs = skill.attrs, types = skill.types, targets = skill.targets, condition = skill.condition, value = skill.value, reduceDamage = skill.reduceDamage, additional = skill.additional; dict = { icon: createIcon(skill.kind), }; @@ -2152,26 +2146,11 @@ function renderSkill(skill, option = {}) targetDict.types = renderTypes(types || [], {affix: true}); attrs_types.push(targetDict.types); } - if (target != undefined) + if (targets != undefined) { - switch (target) { - case "self": { - targetDict.target = tsp.target.self(); - break; - } - case "leader": { - targetDict.target = tsp.target.team_leader(); - break; - } - case "sub-monsters": { - targetDict.target = tsp.target.team_sub(); - break; - } - default: { - targetDict.target = tsp.target.unknown(); - break; - } - } + targetDict.target = targets.map(target=> + tsp?.target[target.replaceAll("-","_")]()) + .nodeJoin(tsp.word.slight_pause()); attrs_types.push(targetDict.target); } if (attrs_types.length)