清理之前文件 + 再次取消碰撞检测
This commit is contained in:
@@ -2,7 +2,7 @@ import { Node, Vec3 } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { HeroSkillsComp } from "./heroSkillsComp";
|
||||
import { SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet";
|
||||
import { endType, SkillSet, TargetGroup, TargetType } from "../common/config/SkillSet";
|
||||
import { CdType } from "../common/config/SkillSet";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
@@ -32,7 +32,7 @@ export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
if(skill.atk_count < 1){
|
||||
skill.atk_count++;
|
||||
// console.log("技能命中目标",skill.caster,skill.target,SkillSet[skill.s_uuid]);
|
||||
this.applySkillEffect(skill.caster,skill.target,SkillSet[skill.s_uuid]);
|
||||
this.applySkillEffect(skill.caster,skill.target,SkillSet[skill.s_uuid],e);
|
||||
}
|
||||
}
|
||||
this.processDamageQueue();
|
||||
@@ -56,14 +56,14 @@ export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
// 根据技能配置获取判定范围
|
||||
const config = SkillSet[skill.s_uuid];
|
||||
const rangeX = config?.rangeX || 20; // 默认值为10
|
||||
const rangeY = config?.rangeY || 20;
|
||||
const rangeY = config?.rangeY || 30;
|
||||
const distanceX = Math.abs(targetPos.x - skillPos.x);
|
||||
const distanceY = Math.abs(targetPos.y - skillPos.y);
|
||||
const distanceY = Math.abs(targetPos.y+40 - skillPos.y);
|
||||
const isInRange = distanceX < rangeX && distanceY < rangeY;
|
||||
return isInRange;
|
||||
}
|
||||
/** 应用技能效果 */
|
||||
private applySkillEffect(casterView:HeroViewComp, targetView: HeroViewComp, config: typeof SkillSet[keyof typeof SkillSet]) {
|
||||
private applySkillEffect(casterView:HeroViewComp, targetView: HeroViewComp, config: typeof SkillSet[keyof typeof SkillSet],e:ecs.Entity) {
|
||||
// 直接计算伤害(包含防御减免)
|
||||
const damageResult = this.calculateDamage(casterView, targetView, config);
|
||||
// 将施法者传入applyDamage方法
|
||||
@@ -71,6 +71,9 @@ export class SkillSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
// 播放技能特效
|
||||
casterView.playSkillEffect(config.uuid);
|
||||
console.log(`${casterView.hero_name} 对 ${targetView.hero_name} 造成 ${damageResult.value}伤害`);
|
||||
if(config.endType === endType.collision){
|
||||
e.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
private calculateDamage(caster: HeroViewComp, target: HeroViewComp, config: typeof SkillSet[keyof typeof SkillSet]) {
|
||||
|
||||
Reference in New Issue
Block a user