feat: 新增闪避与命中属性系统,完善战斗判定逻辑
1. 新增全局默认闪避/命中率配置,为英雄和怪物提供缺省属性兜底 2. 扩展英雄属性组件,添加闪避、命中率属性与对应计算接口 3. 实现闪避判定逻辑,修正伤害流程,添加闪避提示效果 4. 新增闪避/命中相关buff、技能与光环配置 5. 完善属性值计算与 tooltip 显示逻辑
This commit is contained in:
@@ -287,4 +287,20 @@ export const BuffList: Record<number, BuffConfig> = {
|
||||
modifiers: [{ attr: Attrs.hp_max, op: ModOp.PercentAdd, value: 30 }],
|
||||
info: "最大生命值提升 30%,并立即回复等量生命,持续 5 秒",
|
||||
},
|
||||
|
||||
// ==================== 闪避 / 命中系 ====================
|
||||
// 闪避爆发(限时提升闪避概率,百分点累加)
|
||||
7030: {
|
||||
id: 7030, name: "闪避爆发", icon: "98-Enchant-Wind",
|
||||
category: BuffCategory.Buff, duration: 5, max_stack: 1,
|
||||
modifiers: [{ attr: Attrs.dodge, op: ModOp.PercentAdd, value: 20 }],
|
||||
info: "闪避概率提升 20%,持续 5 秒",
|
||||
},
|
||||
// 命中强化(限时提升命中概率,百分点累加)
|
||||
7031: {
|
||||
id: 7031, name: "命中强化", icon: "27-Hawkeye",
|
||||
category: BuffCategory.Buff, duration: 5, max_stack: 1,
|
||||
modifiers: [{ attr: Attrs.accuracy, op: ModOp.PercentAdd, value: 20 }],
|
||||
info: "命中概率提升 20%,持续 5 秒",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -76,6 +76,10 @@ export enum FightSet {
|
||||
INIT_REFRESH_STONE = 3, // 初始刷新石数量
|
||||
/** 单次刷新消耗的刷新石数量 */
|
||||
REFRESH_STONE_COST = 1,
|
||||
/** 全局默认闪避率(百分点),heroSet 未配置时生效 */
|
||||
DEFAULT_DODGE = 15,
|
||||
/** 全局默认命中率(百分点),heroSet 未配置时生效 */
|
||||
DEFAULT_ACCURACY = 10,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,6 +147,7 @@ export const TooltipTypes = {
|
||||
hpup: 8,
|
||||
addmp: 9,
|
||||
shield: 10,
|
||||
miss: 11,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -455,6 +455,16 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
DTType: DTType.single, kind: SkillKind.Support, ap: 10, 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, buff_type: Attrs.thorns_rate, info: "全体友方比例反伤提升10%, 永久生效",
|
||||
},
|
||||
6415: {
|
||||
uuid: 6415, name: "闪避强化", sp_name: "buff_wind", icon: "98-Enchant-Wind", TGroup: TGroup.Team, readyAnm: "up_blue", endAnm: "", act: "atk",
|
||||
DTType: DTType.single, kind: SkillKind.Support, ap: 5, 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, buff_type: Attrs.dodge, info: "全体友方闪避概率提升5%, 永久生效",
|
||||
},
|
||||
6416: {
|
||||
uuid: 6416, name: "命中强化", sp_name: "buff_wind", icon: "27-Hawkeye", TGroup: TGroup.Team, readyAnm: "up_blue", endAnm: "", act: "atk",
|
||||
DTType: DTType.single, kind: SkillKind.Support, ap: 5, 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, buff_type: Attrs.accuracy, info: "全体友方命中概率提升5%, 永久生效",
|
||||
},
|
||||
6501: {
|
||||
uuid: 6501, name: "复活", sp_name: "buff_wind", icon: "40-Holy", 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,
|
||||
@@ -546,6 +556,16 @@ export const SkillSet: Record<number, SkillConfig> = {
|
||||
uuid: 6517, name: "生命爆发", sp_name: "buff_wind", icon: "29-Endure", TGroup: TGroup.Team, readyAnm: "up_green", 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, buff_type: Attrs.hp_max, timed_buff_id: 7029, info: "全体友方最大生命值提升30%, 持续5秒",
|
||||
},
|
||||
6518: {
|
||||
uuid: 6518, name: "闪避爆发", sp_name: "buff_wind", icon: "98-Enchant-Wind", TGroup: TGroup.Team, readyAnm: "up_blue", 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, buff_type: Attrs.dodge, timed_buff_id: 7030, info: "全体友方闪避概率提升20%, 持续5秒",
|
||||
},
|
||||
6519: {
|
||||
uuid: 6519, name: "命中强化", sp_name: "buff_wind", icon: "27-Hawkeye", TGroup: TGroup.Team, readyAnm: "up_blue", 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, buff_type: Attrs.accuracy, timed_buff_id: 7031, info: "全体友方命中概率提升20%, 持续5秒",
|
||||
}
|
||||
};
|
||||
//***************驻场技能配置***************
|
||||
@@ -569,6 +589,8 @@ export enum FieldSkillType {
|
||||
HeroPunctureDmg = 21, // 英雄穿透后伤害加成(百分点;乘算:PUNCTURE_DMG_RATIO * (1 + bonus/100))
|
||||
HeroThornsDmg = 22, // 英雄固定反伤加成
|
||||
HeroThornsRate = 23, // 英雄比例反伤加成(百分点)
|
||||
HeroDodge = 24, // 英雄闪避率加成(百分点)
|
||||
HeroHit = 25, // 英雄命中率加成(百分点)
|
||||
}
|
||||
|
||||
export interface FieldSkillConfig {
|
||||
@@ -607,4 +629,6 @@ export const FieldSkillSet: Record<number, FieldSkillConfig> = {
|
||||
7016: { uuid: 7016, name: "鼓舞光环", icon: "64-Prominance", type: FieldSkillType.StartCount, info: "战斗开始触发技能次数提升" },
|
||||
7018: { uuid: 7018, name: "连击光环", icon: "74-Satisfaction", type: FieldSkillType.AtkCount, info: "攻击触发技能次数提升" },
|
||||
7019: { uuid: 7019, name: "受击光环", icon: "84-Termor", type: FieldSkillType.BeAtkCount, info: "被攻击触发技能次数提升" },
|
||||
7023: { uuid: 7023, name: "闪避光环", icon: "98-Enchant-Wind", type: FieldSkillType.HeroDodge, info: "英雄闪避概率提升" },
|
||||
7024: { uuid: 7024, name: "命中光环", icon: "27-Hawkeye", type: FieldSkillType.HeroHit, info: "英雄命中概率提升" },
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { v3 } from "cc"
|
||||
import { v3 } from "cc"
|
||||
import { BoxSet, FacSet, FightSet } from "./GameSet"
|
||||
import { SkillOverrides, TGroup, SkillSet, FieldSkillSet, SkillConfig, SkillKind, FieldSkillConfig, FieldSkillType, mergeSkillParams } from "./SkillSet"
|
||||
import { BuffList, BuffConfig, ModOp } from "./BuffSet"
|
||||
@@ -414,6 +414,8 @@ export interface heroInfo {
|
||||
[SkillTriggerType.Atked]?: TriggerGrouped; // 受击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的受击次数
|
||||
dis?: number; // 攻击距离(像素)
|
||||
speed?: number; // 移动速度(像素/秒)
|
||||
dodge?: number; // 闪避率(百分点,缺省由初始化处兜底为全局默认值)
|
||||
accuracy?: number; // 命中率(百分点,缺省由初始化处兜底为全局默认值)
|
||||
skills: Record<number, HSkillInfo>; // 携带技能ID列表
|
||||
ap_bonus?: LvBonusEntry[]; // 额外攻击加成(按 lv 升序,运行时累加 ≤英雄等级 的所有档)
|
||||
hp_bonus?: LvBonusEntry[]; // 额外生命加成(按 lv 升序,运行时累加 ≤英雄等级 的所有档)
|
||||
@@ -1257,6 +1259,10 @@ function calcBuffPermanentEquivalent(buff: BuffConfig, apEff: number, cd: number
|
||||
case Attrs.speed:
|
||||
value += (modValue / 100) * dps * weights.W_DPS_PER_SEC * seconds;
|
||||
break;
|
||||
case Attrs.dodge:
|
||||
case Attrs.accuracy:
|
||||
value += modValue * weights.W_control;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1298,6 +1304,8 @@ function calcSupportEffectValue(config: SkillConfig, hpEff: number, apEff: numbe
|
||||
return (value / 100) * (apEff / cd) * 0.05 * weights.W_DPS_PER_SEC * seconds;
|
||||
case Attrs.stun_chance:
|
||||
case Attrs.freeze_chance:
|
||||
case Attrs.dodge:
|
||||
case Attrs.accuracy:
|
||||
return value * weights.W_control;
|
||||
case Attrs.knockback_chance:
|
||||
// 击退强化已改为击退距离增量,按距离价值折算
|
||||
|
||||
Reference in New Issue
Block a user