feat: 添加冰冻效果并移除调试组件

- 在 GameSet 中添加冰冻时间常量 FROST_TIME
- 在 HeroAttrsComp 中新增 toFrost 方法用于处理冰冻状态
- 在 HeroAtkSystem 中增加冰冻判定,命中时触发冰冻效果并显示冰冻特效
- 简化 HeroViewComp 中的冰冻特效方法,移除眩晕特效方法
- 删除调试用的 HSkillComp 组件及其 meta 文件
- 调整 HeroBuffSystem 的计时器间隔,使冰冻状态更平滑地递减
This commit is contained in:
walkpan
2026-03-19 19:08:50 +08:00
parent 08fbb72d19
commit a08cca9cc3
7 changed files with 19 additions and 224 deletions

View File

@@ -117,6 +117,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
// 暴击判定
// 使用施法者的暴击率属性damageEvent.Attrs 快照),- 被攻击者的暴击抗性属
const isCrit = this.checkChance(damageEvent.Attrs[Attrs.critical]);
// 计算基础伤害
let damage = this.dmgCount(damageEvent,TAttrsComp);
@@ -147,17 +148,16 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
mLogger.log(this.debugMode, 'HeroAtkSystem', ` 英雄${TAttrsComp.hero_name} (uuid: ${TAttrsComp.hero_uuid}) 受到 eid:${casterEid} 的 伤害 ${damage},${isCrit?"暴击":"普通"}攻击,技能ID ${damageEvent.s_uuid}`);
// 击退判定
// 使用施法者的击退概率属性damageEvent.Attrs 快照) - 被攻击者的控制抗性
// 击退成功后需要清理施法者的相关天赋buff
// 击退和冰冻判定
const isBack = this.checkChance((damageEvent.Attrs[Attrs.back_chance] || 0));
// ✅ 触发视图层表现(伤害数字、受击动画、后退)
const isFrost = this.checkChance(damageEvent.Attrs[Attrs.freeze_chance]);
// ✅ 触发视图层表现(伤害数字、受击动画、后退,冰冻)
if (targetView) {
targetView.do_atked(damage, isCrit, damageEvent.s_uuid, isBack);
targetView.playEnd(skillConf.endAnm);
}
if(isFrost) TAttrsComp.toFrost();
targetView.in_iced(TAttrsComp.frost_end_time);
}
// 检查死亡

View File

@@ -4,6 +4,7 @@ import { BuffConf } from "../common/config/SkillSet";
import { HeroDisVal, HType } from "../common/config/heroSet";
import { mLogger } from "../common/Logger";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { FightSet } from "../common/config/GameSet";
@ecs.register('HeroAttrs')
export class HeroAttrsComp extends ecs.Comp {
public debugMode: boolean = false;
@@ -133,14 +134,11 @@ export class HeroAttrsComp extends ecs.Comp {
mLogger.log(this.debugMode, 'HeroAttrs', `添加属性: ${buffConf.name}, 属性:${buffConf.buff}, 值:${buffConf.value}`);
}
}
/**
* 把配置值统一转换为“可直接写入容器和结算”的数值
* - RATIO 会在写入前转换为 VALUE
* - BOOLEAN 保持原类型
*/
toFrost(time: number=1) {
this.frost_end_time += FightSet.FROST_TIME*time;
}
/**
* 通用属性修改应用
* @param attr 属性名
@@ -291,7 +289,7 @@ export class HeroAttrsComp extends ecs.Comp {
@ecs.register('HeroBuffSystem')
export class HeroBuffSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
private timer =new Timer(0.2)
private timer =new Timer(0.1)
filter(): ecs.IMatcher {
return ecs.allOf(HeroAttrsComp);
}
@@ -300,7 +298,7 @@ export class HeroBuffSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
if(this.timer.update(this.dt)){
const attrsComp = e.get(HeroAttrsComp);
if(attrsComp.frost_end_time > 0){
attrsComp.frost_end_time -= 0.2;
attrsComp.frost_end_time -= 0.1;
if(attrsComp.frost_end_time <= 0){
attrsComp.frost_end_time = 0;
}

View File

@@ -261,17 +261,8 @@ export class HeroViewComp extends CCComp {
}
/** 冰冻特效 */
private in_iced(t: number = 1, ap: number = 0) {
const node = this.spawnTimedFx("game/skill/buff/iced", this.node, t);
}
/** 眩晕特效 */
private in_yun(t: number = 1, ap: number = 0) {
const node = this.spawnTimedFx("game/skill/buff/buff_yun", this.node, t);
if (!node) return;
let height = this.node.getComponent(UITransform).height;
node.setPosition(v3(0, height));
in_iced(t: number = 1) {
this.spawnTimedFx("game/skill/buff/iced", this.node, t);
}
/** 技能提示 */