From f12d8e31684c31039d094b74af2f339748ddc5c0 Mon Sep 17 00:00:00 2001 From: woohoo Date: Sun, 14 Nov 2021 03:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0awards=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torn-trans-zhcn.user.js | 146 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 136 insertions(+), 10 deletions(-) diff --git a/torn-trans-zhcn.user.js b/torn-trans-zhcn.user.js index 7ff21d7..a347899 100644 --- a/torn-trans-zhcn.user.js +++ b/torn-trans-zhcn.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Torn翻译 // @namespace WOOH -// @version 0.1.1113a +// @version 0.1.1114a // @description UI翻译 // @author Woohoo-[2687093] sabrina_devil[2696209] // @match https://www.torn.com/* @@ -722,10 +722,11 @@ '新的勋章将随着你的进步解锁。勋章将显示在个人资料上(展示是否够牌面)。', 'You have': '你有 ', 'merits': '技能点', + 'merit': '技能点', 'medals': '勋章', 'honors': '荣誉', - 'Available Merits:': '可用技能点: ', - 'Merits Used:': ' 已用技能点: ',//      + 'Available Merits:': '可用技能点:', + 'Merits Used:': '已用技能点:', "to spend on anything you would like on\nthe list below.\nYou've earned these merits by attaining": ' 可用于升级以下列表中的任意技能。这些技能点是通过 ', 'and': ' 和 ', @@ -736,12 +737,113 @@ 'Progress':'升级进程', 'Expand All':'展开所有', 'Latest':'最新获得', + 'Defaults':'默认荣誉条', + 'Attacking':'攻击', + 'Camo':'迷彩', + 'Weapons':'武器', + 'Education':'教育', + 'Crimes':'犯罪', + 'Drugs':'药章', + 'Jail & Hospital':'监狱与医院', + 'Travel':'旅行', + 'Gym':'锻炼', + 'Level':'等级', + 'Competitions':'节日活动', + 'Money':'金钱', + 'Items':'物品', + 'Commitment':'', + 'Casino':'赌场', + 'Missions':'任务', + 'Misc':'杂项', + 'General':'一般', + // 'Attacking':'', + // 'Crimes':'', + 'Rank':'阶级', + // 'Level':'', + 'Networth':'身价', + 'Nerve Bar':'犯罪N上限', + 'Critical Hit Rate':'暴击率', + 'Life Points':'血量', + 'Crime Experience':'犯罪经验', + 'Education Length':'教育时长', + 'Awareness':'感知能力', + 'Bank Interest':'银行利润', + 'Masterful Looting':'大师掠夺', + 'Stealth':'隐身', + 'Hospitalizing':'送医时长', + 'Addiction Mitigation':'毒瘾缓解', + 'Employee Effectiveness':'员工效率', + 'Brawn':'臂力', + 'Protection':'保护', + 'Sharpness':'敏锐', + 'Evasion':'回避', + 'Heavy Artillery Mastery':'重炮精通 (Heavy Artillery)', + 'Machine Gun Mastery':'机枪精通 (Machine Gun)', + 'Rifle Mastery':'步枪精通', + 'SMG Mastery':'冲锋枪精通', + 'Shotgun Mastery':'霰弹枪精通', + 'Pistol Mastery':'手枪精通', + 'Club Mastery':'冲击武器精通 (Clubbing)', + 'Piercing Mastery':'穿刺武器精通', + 'Slashing Mastery':'切割武器精通', + 'Mechanical Mastery':'机械武器精通', + 'Temporary Mastery':'临时武器精通', + 'Increases maximum nerve bar by 1 point': '增加 1 点犯罪N上限', + 'Increases critical hit rate by 0.5%':'提高 0.5% 暴击率', + 'Increases maximum life by 5%':'提高 5% 血量上限', + 'Increases crime success rate':'提高犯罪成功率', + 'Decreases education course length by 2%':'降低教育课程 2% 时长', + 'Increases frequency of items found in the city':'增加城市中发现物品的频率', + 'Increases bank interest by 5%':'提高 5% 银行利息', + 'Increases money gained from mugging by 5%':'提高 5% 抢劫获得的金钱', + 'Increases ability to stealth attacks':'提高攻击后匿名的能力', + 'Increases hospitalization time by 5%':'提高被送往医院玩家 5% 的住院时长', + 'Reduces the negative effects of addiction by 2%':'降低 2% 毒瘾负面效果', + 'Increases employee effectiveness by +1':'增加 +1 员工效率', + 'Gives a passive bonus to strength of 3%':'获得力量 3% 被动增益', + 'Gives a passive bonus to defense of 3%':'获得防御 3% 被动增益', + 'Gives a passive bonus to speed of 3%':'获得速度 3% 被动增益', + 'Gives a passive bonus to dexterity of 3%':'获得敏捷 3% 被动增益', + 'Increases proficiency with heavy artillery':'提高重炮精通', + 'Increases proficiency with machine guns':'提高机枪精通', + 'Increases proficiency with rifles':'提高步枪精通', + 'Increases proficiency with submachine guns':'提高冲锋枪精通', + 'Increases proficiency with shotguns':'提高霰弹枪精通', + 'Increases proficiency with pistols':'提高手枪精通', + 'Increases proficiency with clubbing weapons':'提高冲击武器精通', + 'Increases proficiency with piercing weapons':'提高穿刺武器精通', + 'Increases proficiency with slashing weapons':'提高切割武器精通', + 'Increases proficiency with mechanical devices':'提高切割武器精通', + 'Increases proficiency with temporary weapons':'提高临时武器精通', + 'Increases damage and accuracy of heavy artillery weapons':'提高重炮伤害与命中', + 'Increases damage and accuracy of machine gun weapons':'提高机枪伤害与命中', + 'Increases damage and accuracy of rifle weapons':'提高步枪伤害与命中', + 'Increases damage and accuracy of submachine gun weapons':'提高冲锋枪伤害与命中', + 'Increases damage and accuracy of shotgun weapons':'提高霰弹枪伤害与命中', + 'Increases damage and accuracy of pistol weapons':'提高手枪伤害与命中', + 'Increases damage and accuracy of axe & clubbing weapons':'提高斧头和冲击武器的伤害与命中', + 'Increases damage and accuracy of piercing weapons':'提高穿刺武器的伤害与命中', + 'Increases damage and accuracy of slashing weapons':'提高切割武器的伤害与命中', + 'Increases damage and accuracy of mechanical devices':'提高机械武器的伤害与命中', + 'Increases damage and accuracy of temporary weapons':'提高临时武器的伤害与命中', 'Are you sure you want to spend':'确定要花费 ', - 'on\nyour Awareness upgrade?\nThis upgrade will increase the amount of items you can find in the city, however it will not necessarily increase their quality.': - ' 在感知能力升级上?该升级会增加你在城市中能找到的物品数量,但不一定能提高它们的质量。', - '- Increases maximum nerve bar by 1 point': - '- 增加 1 点犯罪N上限', + 'on':'在', + 'upgrade?':'升级上吗?', + 'You have upgraded this merit upgrade to the maximum already.': + '你已将该升级升满。', + 'This upgrade will give you one extra nerve point on your maximum nerve.': + '该升级会增加 1 犯罪N上限。', + "This upgrade will give you an extra 0.5% chance at getting a critical hit during attacks. Critical hits are blows made on an opponent's head, throat or heart during an attack.": + '这个升级将使你在攻击时有额外的 0.5% 几率获得暴击。暴击是指在攻击过程中击中对手的头部、喉咙或心脏。', + "This upgrade will increase your maximum life by 5%. This upgrade works great with your defense and might keep you going a little longer during attacks.": + '这个升级将使你的最大生命值增加 5%。这个升级对你的战斗有很大作用,可能会让你在攻击中坚持更久。', + "This upgrade will give you a continuous boost of 3% (per upgrade) to the effect of your crime experience resulting in increased success rates.": + '',// todo + "This upgrade will decrease the amount of days you have to wait to complete an education course. This upgrade will start working on the next education course you start.": + '这项升级将减少你完成教育课程所需的等待天数。这项升级将在你开始的下一个教育课程中开始生效。', + 'This upgrade will increase the amount of items you can find in the city, however it will not necessarily increase their quality.': + '该升级会增加你在城市中能找到的物品数量,但不一定能提高它们的质量。', }; /** @@ -1646,22 +1748,46 @@ }); // 技能点短描述 $('ul#merits-list span.desc span[class^="t-"]').each((i,e)=>{ - const slash = $(e).attr('class') === 't-show' ? '- ' : ''; - const isShow = $(e).attr('class') === 't-show'; + // const slash = $(e).attr('class') === 't-show' ? '- ' : ''; + const isShow = $(e).attr('class') === 't-hide'; const key = isShow?$(e).text().slice(2):$(e).text(); if (awDict[key]) $(e).text((isShow?'- ':'')+awDict[key]); }); // 技能点展开详细描述与确认 $('ul#merits-list div.msg').contents().each((i,e)=>{ + // x merit(s) if (e.nodeType === 1){ const spl=$(e).text().split(' '); if (awDict[spl[1]]) $(e).text(spl[0]+' '+awDict[spl[1]]); } + // 文字片段 else if (e.nodeType === 3){ - if(awDict[e.nodeValue.trim()]) + if (awDict[e.nodeValue.trim()]) { e.nodeValue = awDict[e.nodeValue.trim()]; + return; + } + const spl=e.nodeValue.trim().split('\n'); + // 未升级完成 + if(spl.length === 3) { + const upgradeName = spl[1].slice(5,-9); + const on=spl[0]; + const upgrade=spl[1].slice(-8); + const desc=spl[2]; + if (awDict[on] && awDict[upgrade] && awDict[upgradeName] && awDict[desc]) + e.nodeValue = ' ' + awDict[on] + awDict[upgradeName] + + awDict[upgrade] + awDict[desc]; + } + // 升级完成 + else if(spl.length===1){ + const upgraded=e.nodeValue.trim().slice(0,60); + const desc=e.nodeValue.trim().slice(61); + if (awDict[upgraded]) + e.nodeValue=awDict[upgraded]; + if (awDict[desc]) + e.nodeValue+=awDict[desc]; + } } }); };