feat(i18n): 为英雄、技能和成就添加本地化支持

在多个配置文件中引入本地化函数,将硬编码的文本替换为从语言文件获取的键值。
添加了对应的中文字符串到语言文件,支持游戏内多语言切换。
This commit is contained in:
panw
2026-04-29 09:47:32 +08:00
parent a36516db60
commit 958aa0a9d2
6 changed files with 582 additions and 407 deletions

View File

@@ -1,5 +1,8 @@
// ========== 从 HeroAttrs.ts 导入属性相关定义 ==========
import { Attrs } from "./HeroAttrs";
import { oops } from "db://oops-framework/core/Oops";
const t = (key: string) => oops.language.getLangByID(key);
export enum HSSet {
atk = 0, // 普通攻击
@@ -172,134 +175,134 @@ export const SkillUpList = {
export const SkillSet: Record<number, SkillConfig> = {
// ========== 基础技能 ==========
6001: {
uuid:6001,name:"攻击",sp_name:"atk",icon:"1026",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
uuid:6001,get name(){return t("skill_name_6001")},sp_name:"atk",icon:"1026",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.Melee,
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个造成100%攻击的伤害",
RType:RType.linear,EType:EType.collision,buffs:[],get info(){return t("skill_info_6001")},
},
6002: {
uuid:6002,name:"火球",sp_name:"ball_fire",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
uuid:6002,get name(){return t("skill_name_6002")},sp_name:"ball_fire",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
DTType:DTType.single,frz:0,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.bezier,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害,冰冻率20%",
RType:RType.bezier,EType:EType.collision,buffs:[],get info(){return t("skill_info_6002")},
},
6003: {
uuid:6003,name:"飓风",sp_name:"ball_winds",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
uuid:6003,get name(){return t("skill_name_6003")},sp_name:"ball_winds",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.bezier,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
RType:RType.bezier,EType:EType.collision,buffs:[],get info(){return t("skill_info_6003")},
},
6004: {
uuid:6004,name:"紫球",sp_name:"ball_zi",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
uuid:6004,get name(){return t("skill_name_6004")},sp_name:"ball_zi",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
RType:RType.linear,EType:EType.collision,buffs:[],get info(){return t("skill_info_6004")},
},
6005: {
uuid:6005,name:"射击",sp_name:"arrow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
uuid:6005,get name(){return t("skill_name_6005")},sp_name:"arrow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.bezier,EType:EType.collision,bezier_start_y:20,bezier_mid_y:140,bezier_arc:1.05,buffs:[],info:"对单个目标造成100%攻击的伤害",
RType:RType.bezier,EType:EType.collision,bezier_start_y:20,bezier_mid_y:140,bezier_arc:1.05,buffs:[],get info(){return t("skill_info_6005")},
},
6007: {
uuid:6007,name:"冰锥",sp_name:"ball_forst",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
uuid:6007,get name(){return t("skill_name_6007")},sp_name:"ball_forst",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.bezier,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
RType:RType.bezier,EType:EType.collision,buffs:[],get info(){return t("skill_info_6007")},
},
6008: {
uuid:6007,name:"水波",sp_name:"ball_water",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
uuid:6007,get name(){return t("skill_name_6008")},sp_name:"ball_water",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk",
DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.bezier,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害",
RType:RType.bezier,EType:EType.collision,buffs:[],get info(){return t("skill_info_6008")},
},
//大招
6101: {
uuid:6101,name:"火焰攻击",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
uuid:6101,get name(){return t("skill_name_6101")},sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
DTType:DTType.single,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.Melee,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害,击退率20%",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6101")},
},
6102: {
uuid:6102,name:"闪电攻击",sp_name:"atk_s4",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"yellow",endAnm:"",act:"max",
uuid:6102,get name(){return t("skill_name_6102")},sp_name:"atk_s4",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"yellow",endAnm:"",act:"max",
DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.Melee,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害,暴击率20%",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6102")},
},
6103: {
uuid:6103,name:"陨石术",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
uuid:6103,get name(){return t("skill_name_6103")},sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
DTType:DTType.range,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,暴击率20%",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6103")},
},
6104: {
uuid:6104,name:"闪光射击",sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"yellow",endAnm:"",act:"max",
uuid:6104,get name(){return t("skill_name_6104")},sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"yellow",endAnm:"",act:"max",
DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.linear,EType:EType.collision,buffs:[],info:"对多个目标造成100%攻击的伤害,暴击",
RType:RType.linear,EType:EType.collision,buffs:[],get info(){return t("skill_info_6104")},
},
6105: {
uuid:6105,name:"冰刺",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"max",
uuid:6105,get name(){return t("skill_name_6105")},sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"max",
DTType:DTType.range,frz:0,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,冰冻率20%",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6105")},
},
6106: {
uuid:6106,name:"火墙",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
uuid:6106,get name(){return t("skill_name_6106")},sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max",
DTType:DTType.range,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.remote,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,击退率20%",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6106")},
},
//============================= ====== 辅助技能 ====== ==========================
6301:{
uuid:6301,name:"魔法盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_blue",endAnm:"",act:"atk",
uuid:6301,get name(){return t("skill_name_6301")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_blue",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"获得3次伤害免疫",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6301")},
},
6302: {
uuid:6302,name:"治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"up_green",endAnm:"",act:"atk",
uuid:6302,get name(){return t("skill_name_6302")},sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"up_green",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Heal,ap:500,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"治疗1个友方300%攻击力的生命值",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6302")},
},
6303:{
uuid:6303,name:"护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_blue",endAnm:"",act:"atk",
uuid:6303,get name(){return t("skill_name_6303")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_blue",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Shield,ap:3,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机1个友方获得3次伤害免疫",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6303")},
},
6304: {
uuid:6304,name:"群体治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"up_green",endAnm:"",act:"atk",
uuid:6304,get name(){return t("skill_name_6304")},sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"up_green",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Heal,ap:200,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机治疗3个友方200%攻击力的生命值",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6304")},
},
6305:{
uuid:6305,name:"群体护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_blue",endAnm:"",act:"atk",
uuid:6305,get name(){return t("skill_name_6305")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_blue",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Shield,ap:2,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机3个友方获得2次伤害免疫",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6305")},
},
//==========================buff 技能=====================
6401:{
uuid:6401,name:"单体攻击",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
uuid:6401,get name(){return t("skill_name_6401")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5}],info:"随机1个友方+5攻击",
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5}],get info(){return t("skill_info_6401")},
},
6402:{
uuid:6402,name:"单体生命",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
uuid:6402,get name(){return t("skill_name_6402")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:20}],info:"随机1个友方+20最大生命值",
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:20}],get info(){return t("skill_info_6402")},
},
6403:{
uuid:6403,name:"单体全能",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
uuid:6403,get name(){return t("skill_name_6403")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5},{buff:Attrs.hp_max,value:20}],info:"随机1个友方+2攻击,+10最大生命值",
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5},{buff:Attrs.hp_max,value:20}],get info(){return t("skill_info_6403")},
},
6404:{
uuid:6404,name:"群体攻击",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
uuid:6404,get name(){return t("skill_name_6404")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2}],info:"随机3个友方+2攻击",
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2}],get info(){return t("skill_info_6404")},
},
6405:{
uuid:6405,name:"群体生命",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
uuid:6405,get name(){return t("skill_name_6405")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_hp",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:10}],info:"随机3个友方+10最大生命值",
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:10}],get info(){return t("skill_info_6405")},
},
6406:{
uuid:6406,name:"群体全能",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
uuid:6406,get name(){return t("skill_name_6406")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"up_ap",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],info:"随机3个友方+2攻击,+10最大生命值",
RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],get info(){return t("skill_info_6406")},
},
6501:{
uuid:6501,name:"复活",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_ap",endAnm:"",act:"atk",
uuid:6501,get name(){return t("skill_name_6501")},sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"up_ap",endAnm:"",act:"atk",
DTType:DTType.single,kind:SkillKind.Support,ap:50,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support,
RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"立即复活获得50%生命",
RType:RType.fixed,EType:EType.animationEnd,buffs:[],get info(){return t("skill_info_6501")},
}
};
@@ -324,13 +327,13 @@ export interface FieldSkillConfig {
}
export const FieldSkillSet: Record<number, FieldSkillConfig> = {
7001: { uuid: 7001, name: "召唤精通", type: FieldSkillType.SummonCount, value: 1, info: "场上所有友方召唤触发技能触发次数+1" },
7002: { uuid: 7002, name: "亡灵统御", type: FieldSkillType.DeadCount, value: 1, info: "场上所有友方死亡触发技能触发次数+1" },
7003: { uuid: 7003, name: "先发制人", type: FieldSkillType.StartCount, value: 1, info: "场上所有友方战斗开始触发技能触发次数+1" },
7004: { uuid: 7004, name: "余音绕梁", type: FieldSkillType.EndCount, value: 1, info: "场上所有友方战斗结束触发技能触发次数+1" },
7005: { uuid: 7005, name: "理财专家", type: FieldSkillType.WaveGold, value: 10, info: "每回合结束时金币收益提升10" },
7006: { uuid: 7006, name: "商业大亨", type: FieldSkillType.SellGold, value: 5, info: "卖出英雄时金币收益提升5" },
7007: { uuid: 7007, name: "神圣恢复", type: FieldSkillType.WaveHeal, value: 0.3, info: "战斗结束时全队恢复效果+30%" },
7008: { uuid: 7008, name: "战鼓激昂", type: FieldSkillType.HeroAtk, value: 0.2, info: "场上所有友方攻击力提升20%" },
7001: { uuid: 7001, get name(){return t("fskill_name_7001")}, type: FieldSkillType.SummonCount, value: 1, get info(){return t("fskill_info_7001")} },
7002: { uuid: 7002, get name(){return t("fskill_name_7002")}, type: FieldSkillType.DeadCount, value: 1, get info(){return t("fskill_info_7002")} },
7003: { uuid: 7003, get name(){return t("fskill_name_7003")}, type: FieldSkillType.StartCount, value: 1, get info(){return t("fskill_info_7003")} },
7004: { uuid: 7004, get name(){return t("fskill_name_7004")}, type: FieldSkillType.EndCount, value: 1, get info(){return t("fskill_info_7004")} },
7005: { uuid: 7005, get name(){return t("fskill_name_7005")}, type: FieldSkillType.WaveGold, value: 10, get info(){return t("fskill_info_7005")} },
7006: { uuid: 7006, get name(){return t("fskill_name_7006")}, type: FieldSkillType.SellGold, value: 5, get info(){return t("fskill_info_7006")} },
7007: { uuid: 7007, get name(){return t("fskill_name_7007")}, type: FieldSkillType.WaveHeal, value: 0.3, get info(){return t("fskill_info_7007")} },
7008: { uuid: 7008, get name(){return t("fskill_name_7008")}, type: FieldSkillType.HeroAtk, value: 0.2, get info(){return t("fskill_info_7008")} },
};