buff 重设 英雄和伙伴 改为公用debuff

This commit is contained in:
2025-06-13 16:42:01 +08:00
parent 8ea55fd99e
commit d01b98f9c3
6 changed files with 60 additions and 35 deletions

View File

@@ -28,7 +28,8 @@ export class Skill extends ecs.Entity {
uuid: number, // 技能ID
targetPos: Vec3, // 目标位置
caster:any=null, // 施法者
angle:number=0
angle:number=0,
dmg:number=0
) {
let FIGHTCON=parent.getComponent(FightConComp);
const config = SkillSet[uuid];
@@ -42,10 +43,11 @@ export class Skill extends ecs.Entity {
// 设置节点属性
node.parent = parent;
node.setPosition(startPos);
node.angle+=angle
// console.log("加载预制体:",startPos,targetPos)
// 添加技能组件
const skillComp = node.getComponent(SkillCom); // 初始化技能参数
skillComp.ap = caster.ap;
skillComp.ap = caster.ap+dmg;
if(caster.fac==0){
if(caster.is_master){
skillComp.ap=Math.floor(skillComp.ap*(100+FIGHTCON.hero.ATK+FIGHTCON.ally.ATK)/100);

View File

@@ -10,6 +10,7 @@ import { BoxSet } from "../common/config/BoxSet";
import { HeroFac, HeroSet } from "../common/config/heroSet";
import { HeroViewComp } from "../hero/HeroViewComp";
import { BezierMove } from "../BezierMove/BezierMove";
import { FightConComp } from "../map/FightConComp";
const { ccclass, property } = _decorator;
@@ -41,10 +42,11 @@ export class SkillCom extends CCComp {
distance_x:number=0;
distance_y:number=0;
ap:number=0;
FIGHTCON:FightConComp=null;
private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向
protected onLoad(): void {
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
}
@@ -115,6 +117,9 @@ export class SkillCom extends CCComp {
if(oCol.group!=this.group){
if(target == null) return;
let remainingDamage = this.ap;
if(target.fac == BoxSet.HERO ){
remainingDamage=remainingDamage*(100-this.FIGHTCON.hero.DEF+this.FIGHTCON.hero_debuff.BURN)/100
}
target.do_atked(remainingDamage)
this.ent.destroy()
}