feat(i18n): 为英雄、技能和成就添加本地化支持
在多个配置文件中引入本地化函数,将硬编码的文本替换为从语言文件获取的键值。 添加了对应的中文字符串到语言文件,支持游戏内多语言切换。
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
* 每个亮点都包含5个递进等级,奖励分随等级增加。
|
||||
*/
|
||||
|
||||
import { oops } from "db://oops-framework/core/Oops"
|
||||
|
||||
const t = (key: string) => oops.language.getLangByID(key);
|
||||
|
||||
export enum HighlightType {
|
||||
CritMaster = "CritMaster", // 暴击大师
|
||||
DeathExpert = "DeathExpert", // 送死达人
|
||||
@@ -37,95 +41,95 @@ export const HighlightSet: Record<HighlightType, HighlightConfig> = {
|
||||
type: HighlightType.CritMaster,
|
||||
icon: "🔥",
|
||||
levels: [
|
||||
{ level: 1, threshold: 20, scoreBonus: 50, title: "初级暴击者", desc: "暴击{0}次" },
|
||||
{ level: 2, threshold: 40, scoreBonus: 100, title: "暴击大师", desc: "暴击{0}次" },
|
||||
{ level: 3, threshold: 60, scoreBonus: 150, title: "致命猎手", desc: "暴击{0}次" },
|
||||
{ level: 4, threshold: 80, scoreBonus: 200, title: "无情处决", desc: "暴击{0}次" },
|
||||
{ level: 5, threshold: 100, scoreBonus: 300, title: "刀刀烈火", desc: "暴击{0}次" },
|
||||
{ level: 1, threshold: 20, scoreBonus: 50, get title(){return t("hl_title_CritMaster_1")}, get desc(){return t("hl_desc_CritMaster")} },
|
||||
{ level: 2, threshold: 40, scoreBonus: 100, get title(){return t("hl_title_CritMaster_2")}, get desc(){return t("hl_desc_CritMaster")} },
|
||||
{ level: 3, threshold: 60, scoreBonus: 150, get title(){return t("hl_title_CritMaster_3")}, get desc(){return t("hl_desc_CritMaster")} },
|
||||
{ level: 4, threshold: 80, scoreBonus: 200, get title(){return t("hl_title_CritMaster_4")}, get desc(){return t("hl_desc_CritMaster")} },
|
||||
{ level: 5, threshold: 100, scoreBonus: 300, get title(){return t("hl_title_CritMaster_5")}, get desc(){return t("hl_desc_CritMaster")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.DeathExpert]: {
|
||||
type: HighlightType.DeathExpert,
|
||||
icon: "💀",
|
||||
levels: [
|
||||
{ level: 1, threshold: 15, scoreBonus: 50, title: "不怕死", desc: "死亡触发{0}次" },
|
||||
{ level: 2, threshold: 25, scoreBonus: 100, title: "送死达人", desc: "死亡触发{0}次" },
|
||||
{ level: 3, threshold: 40, scoreBonus: 150, title: "亡灵舞者", desc: "死亡触发{0}次" },
|
||||
{ level: 4, threshold: 60, scoreBonus: 200, title: "向死而生", desc: "死亡触发{0}次" },
|
||||
{ level: 5, threshold: 80, scoreBonus: 300, title: "不死灾厄", desc: "死亡触发{0}次" },
|
||||
{ level: 1, threshold: 15, scoreBonus: 50, get title(){return t("hl_title_DeathExpert_1")}, get desc(){return t("hl_desc_DeathExpert")} },
|
||||
{ level: 2, threshold: 25, scoreBonus: 100, get title(){return t("hl_title_DeathExpert_2")}, get desc(){return t("hl_desc_DeathExpert")} },
|
||||
{ level: 3, threshold: 40, scoreBonus: 150, get title(){return t("hl_title_DeathExpert_3")}, get desc(){return t("hl_desc_DeathExpert")} },
|
||||
{ level: 4, threshold: 60, scoreBonus: 200, get title(){return t("hl_title_DeathExpert_4")}, get desc(){return t("hl_desc_DeathExpert")} },
|
||||
{ level: 5, threshold: 80, scoreBonus: 300, get title(){return t("hl_title_DeathExpert_5")}, get desc(){return t("hl_desc_DeathExpert")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.IronWall]: {
|
||||
type: HighlightType.IronWall,
|
||||
icon: "🛡️",
|
||||
levels: [
|
||||
{ level: 1, threshold: 15, scoreBonus: 50, title: "坚固盾牌", desc: "格挡{0}次" },
|
||||
{ level: 2, threshold: 30, scoreBonus: 100, title: "铁壁铜墙", desc: "格挡{0}次" },
|
||||
{ level: 3, threshold: 50, scoreBonus: 150, title: "叹息之墙", desc: "格挡{0}次" },
|
||||
{ level: 4, threshold: 70, scoreBonus: 200, title: "不破之阵", desc: "格挡{0}次" },
|
||||
{ level: 5, threshold: 100, scoreBonus: 300, title: "绝对防御", desc: "格挡{0}次" },
|
||||
{ level: 1, threshold: 15, scoreBonus: 50, get title(){return t("hl_title_IronWall_1")}, get desc(){return t("hl_desc_IronWall")} },
|
||||
{ level: 2, threshold: 30, scoreBonus: 100, get title(){return t("hl_title_IronWall_2")}, get desc(){return t("hl_desc_IronWall")} },
|
||||
{ level: 3, threshold: 50, scoreBonus: 150, get title(){return t("hl_title_IronWall_3")}, get desc(){return t("hl_desc_IronWall")} },
|
||||
{ level: 4, threshold: 70, scoreBonus: 200, get title(){return t("hl_title_IronWall_4")}, get desc(){return t("hl_desc_IronWall")} },
|
||||
{ level: 5, threshold: 100, scoreBonus: 300, get title(){return t("hl_title_IronWall_5")}, get desc(){return t("hl_desc_IronWall")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.WindStorm]: {
|
||||
type: HighlightType.WindStorm,
|
||||
icon: "⚡",
|
||||
levels: [
|
||||
{ level: 1, threshold: 10, scoreBonus: 50, title: "迅捷之风", desc: "风怒{0}次" },
|
||||
{ level: 2, threshold: 20, scoreBonus: 100, title: "风暴之王", desc: "风怒{0}次" },
|
||||
{ level: 3, threshold: 35, scoreBonus: 150, title: "狂风骤雨", desc: "风怒{0}次" },
|
||||
{ level: 4, threshold: 50, scoreBonus: 200, title: "无影之手", desc: "风怒{0}次" },
|
||||
{ level: 5, threshold: 70, scoreBonus: 300, title: "神速幻影", desc: "风怒{0}次" },
|
||||
{ level: 1, threshold: 10, scoreBonus: 50, get title(){return t("hl_title_WindStorm_1")}, get desc(){return t("hl_desc_WindStorm")} },
|
||||
{ level: 2, threshold: 20, scoreBonus: 100, get title(){return t("hl_title_WindStorm_2")}, get desc(){return t("hl_desc_WindStorm")} },
|
||||
{ level: 3, threshold: 35, scoreBonus: 150, get title(){return t("hl_title_WindStorm_3")}, get desc(){return t("hl_desc_WindStorm")} },
|
||||
{ level: 4, threshold: 50, scoreBonus: 200, get title(){return t("hl_title_WindStorm_4")}, get desc(){return t("hl_desc_WindStorm")} },
|
||||
{ level: 5, threshold: 70, scoreBonus: 300, get title(){return t("hl_title_WindStorm_5")}, get desc(){return t("hl_desc_WindStorm")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.OneHitKill]: {
|
||||
type: HighlightType.OneHitKill,
|
||||
icon: "🎯",
|
||||
levels: [
|
||||
{ level: 1, threshold: 100, scoreBonus: 50, title: "重击", desc: "单次伤害{0}" },
|
||||
{ level: 2, threshold: 200, scoreBonus: 100, title: "一击必杀", desc: "单次伤害{0}" },
|
||||
{ level: 3, threshold: 400, scoreBonus: 150, title: "毁天灭地", desc: "单次伤害{0}" },
|
||||
{ level: 4, threshold: 800, scoreBonus: 200, title: "核弹打击", desc: "单次伤害{0}" },
|
||||
{ level: 5, threshold: 1500, scoreBonus: 300, title: "弑神一击", desc: "单次伤害{0}" },
|
||||
{ level: 1, threshold: 100, scoreBonus: 50, get title(){return t("hl_title_OneHitKill_1")}, get desc(){return t("hl_desc_OneHitKill")} },
|
||||
{ level: 2, threshold: 200, scoreBonus: 100, get title(){return t("hl_title_OneHitKill_2")}, get desc(){return t("hl_desc_OneHitKill")} },
|
||||
{ level: 3, threshold: 400, scoreBonus: 150, get title(){return t("hl_title_OneHitKill_3")}, get desc(){return t("hl_desc_OneHitKill")} },
|
||||
{ level: 4, threshold: 800, scoreBonus: 200, get title(){return t("hl_title_OneHitKill_4")}, get desc(){return t("hl_desc_OneHitKill")} },
|
||||
{ level: 5, threshold: 1500, scoreBonus: 300, get title(){return t("hl_title_OneHitKill_5")}, get desc(){return t("hl_desc_OneHitKill")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.HealingLight]: {
|
||||
type: HighlightType.HealingLight,
|
||||
icon: "💊",
|
||||
levels: [
|
||||
{ level: 1, threshold: 200, scoreBonus: 50, title: "急救员", desc: "治疗总量{0}" },
|
||||
{ level: 2, threshold: 500, scoreBonus: 100, title: "治愈之光", desc: "治疗总量{0}" },
|
||||
{ level: 3, threshold: 1000, scoreBonus: 150, title: "生命之泉", desc: "治疗总量{0}" },
|
||||
{ level: 4, threshold: 2000, scoreBonus: 200, title: "起死回生", desc: "治疗总量{0}" },
|
||||
{ level: 5, threshold: 4000, scoreBonus: 300, title: "移动泉水", desc: "治疗总量{0}" },
|
||||
{ level: 1, threshold: 200, scoreBonus: 50, get title(){return t("hl_title_HealingLight_1")}, get desc(){return t("hl_desc_HealingLight")} },
|
||||
{ level: 2, threshold: 500, scoreBonus: 100, get title(){return t("hl_title_HealingLight_2")}, get desc(){return t("hl_desc_HealingLight")} },
|
||||
{ level: 3, threshold: 1000, scoreBonus: 150, get title(){return t("hl_title_HealingLight_3")}, get desc(){return t("hl_desc_HealingLight")} },
|
||||
{ level: 4, threshold: 2000, scoreBonus: 200, get title(){return t("hl_title_HealingLight_4")}, get desc(){return t("hl_desc_HealingLight")} },
|
||||
{ level: 5, threshold: 4000, scoreBonus: 300, get title(){return t("hl_title_HealingLight_5")}, get desc(){return t("hl_desc_HealingLight")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.PerfectClear]: {
|
||||
type: HighlightType.PerfectClear,
|
||||
icon: "🏆",
|
||||
levels: [
|
||||
{ level: 1, threshold: 1, scoreBonus: 500, title: "完美通关", desc: "20回合全胜且全存活" },
|
||||
{ level: 1, threshold: 1, scoreBonus: 500, get title(){return t("hl_title_PerfectClear_1")}, get desc(){return t("hl_desc_PerfectClear")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.LuckyKing]: {
|
||||
type: HighlightType.LuckyKing,
|
||||
icon: "🎲",
|
||||
levels: [
|
||||
{ level: 1, threshold: 0.6, scoreBonus: 50, title: "手气不错", desc: "刷新命中率{0}%" },
|
||||
{ level: 2, threshold: 0.7, scoreBonus: 100, title: "心想事成", desc: "刷新命中率{0}%" },
|
||||
{ level: 3, threshold: 0.8, scoreBonus: 150, title: "欧皇附体", desc: "刷新命中率{0}%" },
|
||||
{ level: 4, threshold: 0.9, scoreBonus: 200, title: "天选之子", desc: "刷新命中率{0}%" },
|
||||
{ level: 5, threshold: 1.0, scoreBonus: 300, title: "言出法随", desc: "刷新命中率{0}%" },
|
||||
{ level: 1, threshold: 0.6, scoreBonus: 50, get title(){return t("hl_title_LuckyKing_1")}, get desc(){return t("hl_desc_LuckyKing")} },
|
||||
{ level: 2, threshold: 0.7, scoreBonus: 100, get title(){return t("hl_title_LuckyKing_2")}, get desc(){return t("hl_desc_LuckyKing")} },
|
||||
{ level: 3, threshold: 0.8, scoreBonus: 150, get title(){return t("hl_title_LuckyKing_3")}, get desc(){return t("hl_desc_LuckyKing")} },
|
||||
{ level: 4, threshold: 0.9, scoreBonus: 200, get title(){return t("hl_title_LuckyKing_4")}, get desc(){return t("hl_desc_LuckyKing")} },
|
||||
{ level: 5, threshold: 1.0, scoreBonus: 300, get title(){return t("hl_title_LuckyKing_5")}, get desc(){return t("hl_desc_LuckyKing")} },
|
||||
]
|
||||
},
|
||||
[HighlightType.ThriftyPlayer]: {
|
||||
type: HighlightType.ThriftyPlayer,
|
||||
icon: "💰",
|
||||
levels: [
|
||||
{ level: 1, threshold: 0.75, scoreBonus: 50, title: "精打细算", desc: "金币使用率{0}%" },
|
||||
{ level: 2, threshold: 0.85, scoreBonus: 100, title: "勤俭持家", desc: "金币使用率{0}%" },
|
||||
{ level: 3, threshold: 0.95, scoreBonus: 150, title: "节俭玩家", desc: "金币使用率{0}%" },
|
||||
{ level: 4, threshold: 0.98, scoreBonus: 200, title: "一毛不拔", desc: "金币使用率{0}%" },
|
||||
{ level: 5, threshold: 1.00, scoreBonus: 300, title: "理财大师", desc: "金币使用率{0}%" },
|
||||
{ level: 1, threshold: 0.75, scoreBonus: 50, get title(){return t("hl_title_ThriftyPlayer_1")}, get desc(){return t("hl_desc_ThriftyPlayer")} },
|
||||
{ level: 2, threshold: 0.85, scoreBonus: 100, get title(){return t("hl_title_ThriftyPlayer_2")}, get desc(){return t("hl_desc_ThriftyPlayer")} },
|
||||
{ level: 3, threshold: 0.95, scoreBonus: 150, get title(){return t("hl_title_ThriftyPlayer_3")}, get desc(){return t("hl_desc_ThriftyPlayer")} },
|
||||
{ level: 4, threshold: 0.98, scoreBonus: 200, get title(){return t("hl_title_ThriftyPlayer_4")}, get desc(){return t("hl_desc_ThriftyPlayer")} },
|
||||
{ level: 5, threshold: 1.00, scoreBonus: 300, get title(){return t("hl_title_ThriftyPlayer_5")}, get desc(){return t("hl_desc_ThriftyPlayer")} },
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user