fix(game): 修复技能伤害应用时的空指针异常并调整英雄攻速

- 在 SkillView.apply_damage 中添加实体存在性安全检查,防止目标实体已销毁时访问属性
- 使用可选链操作符安全获取施法者和目标名称,避免日志记录时崩溃
- 将所有英雄的基础攻击速度(as)统一调整为 1,以平衡游戏性
This commit is contained in:
panw
2026-02-05 10:12:36 +08:00
parent 49b4bef033
commit 1ad7b70c45
2 changed files with 15 additions and 8 deletions

View File

@@ -148,37 +148,37 @@ export const CanSelectHeros: Record<number, number[]> = {
export const HeroInfo: Record<number, heroInfo> = {
// ========== 英雄角色 ==========
5001:{uuid:5001,name:"盾战士",icon:"1001",path:"hk1", fac:FacSet.HERO, kind:1,as:1.5,
5001:{uuid:5001,name:"盾战士",icon:"1001",path:"hk1", fac:FacSet.HERO, kind:1,as:1,
type:HType.warrior,lv:1,hp:300,mp:200,def:5,ap:25,speed:120,skills:[6001,6004],
rangeType: SkillRange.Melee,
buff:[],tal:[],info:"盾战士"},
5002:{uuid:5002,name:"奥术法师",icon:"1001",path:"hm2", fac:FacSet.HERO, kind:2,as:1.5,
5002:{uuid:5002,name:"奥术法师",icon:"1001",path:"hm2", fac:FacSet.HERO, kind:2,as:1,
type:HType.mage,lv:1,hp:150,mp:135,def:0,ap:40,speed:95,skills:[6003,6101],
rangeType: SkillRange.Long,
buff:[],tal:[],info:"奥术法师"},
5003:{uuid:5003,name:"射手",icon:"1001",path:"ha1", fac:FacSet.HERO, kind:2,as:1.2,
5003:{uuid:5003,name:"射手",icon:"1001",path:"ha1", fac:FacSet.HERO, kind:2,as:1,
type:HType.remote,lv:1,hp:180,mp:80,def:0,ap:30,speed:140,skills:[6002,6100],
rangeType: SkillRange.Long,
buff:[],tal:[],info:"射手"},
5005:{uuid:5005,name:"牧师",icon:"1001",path:"hh1", fac:FacSet.HERO, kind:2,as:1.5,
5005:{uuid:5005,name:"牧师",icon:"1001",path:"hh1", fac:FacSet.HERO, kind:2,as:1,
type:HType.mage,lv:1,hp:160,mp:135,def:0,ap:25,speed:100,skills:[6003,6100],
rangeType: SkillRange.Mid,
buff:[],tal:[],info:"牧师"},
5004:{uuid:5004,name:"火焰法师",icon:"1001",path:"hm1", fac:FacSet.HERO, kind:2,as:1.5,
5004:{uuid:5004,name:"火焰法师",icon:"1001",path:"hm1", fac:FacSet.HERO, kind:2,as:1,
type:HType.mage,lv:1,hp:150,mp:140,def:0,ap:45,speed:90,skills:[6003,6101],
rangeType: SkillRange.Mid,
buff:[],tal:[],info:"火焰法师"},
5006:{uuid:5006,name:"召唤法师",icon:"1001",path:"hz1", fac:FacSet.HERO, kind:2,as:1.5,
5006:{uuid:5006,name:"召唤法师",icon:"1001",path:"hz1", fac:FacSet.HERO, kind:2,as:1,
type:HType.support,lv:1,hp:200,mp:145,def:0,ap:20,speed:105,skills:[6003,6101],
rangeType: SkillRange.Mid,
buff:[],tal:[],info:"召唤法师"},
5007:{uuid:5007,name:"刺客",icon:"1001",path:"hc1", fac:FacSet.HERO, kind:1,as:1.2,
5007:{uuid:5007,name:"刺客",icon:"1001",path:"hc1", fac:FacSet.HERO, kind:1,as:1,
type:HType.assassin,lv:1,hp:140,mp:60,def:0,ap:50,speed:180,skills:[6001,6004],
rangeType: SkillRange.Melee,
buff:[],tal:[],info:"刺客"},