FightConComp 的效用已经取消,下一步 进一步 精简,去掉临时 buff debuff 因为本身就是 当局游戏 没必要加零时debuff 直接当局永久debuff

This commit is contained in:
2025-07-22 16:42:42 +08:00
parent e45ebd524b
commit b17de4a2ac
5 changed files with 55 additions and 114 deletions

View File

@@ -4,14 +4,12 @@ import { BoxSet, FacSet } from "../common/config/BoxSet";
import { SkillSet } from "../common/config/SkillSet";
import { smc } from "../common/SingletonModuleComp";
import { HeroViewComp } from "../hero/HeroViewComp";
import { FightConComp } from "../map/FightConComp";
import { SkillCom } from "./SkillCom";
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite} from "cc";
/** Skill 模块 */
@ecs.register(`Skill`)
export class Skill extends ecs.Entity {
FIGHTCON:FightConComp=null!
SkillView!: SkillCom;
/** 实始添加的数据层组件 */
protected init() {
@@ -33,7 +31,6 @@ export class Skill extends ecs.Entity {
dmg:number=0
) {
let FIGHTCON=parent.getComponent(FightConComp);
const config = SkillSet[uuid];
if (!config) {
console.error("[Skill] 技能配置不存在:", uuid);
@@ -82,7 +79,7 @@ export class Skill extends ecs.Entity {
return;
}
let ap_data = this.get_ap(caster,dmg,uuid,FIGHTCON)
let ap_data = this.get_ap(caster,dmg,uuid)
SComp.ap = ap_data.ap
SComp.caster_crit = ap_data.crit
SComp.caster_crit_d = ap_data.crit_d
@@ -115,12 +112,11 @@ export class Skill extends ecs.Entity {
this.add(SComp);
}
get_ap(view:HeroViewComp,dmg:number=0,uuid:number=0,FIGHTCON:FightConComp=null!){
get_ap(view:HeroViewComp,dmg:number=0,uuid:number=0){
let ap=0
let crit=0
let crit_d=0
let buffap=1
let buff=null
let puncture=0
let puncture_damage=0
let burn_count=0
@@ -129,12 +125,6 @@ export class Skill extends ecs.Entity {
let stun_ratto=0
let frost_time=0
let frost_ratto=0
if(view.is_master) buff=FIGHTCON.hero_buff
if(view.is_boss) buff=FIGHTCON.enemy_buff
if(view.is_kalami) buff=FIGHTCON.enemy_buff
if(buff!==null) {
buffap=(100+buff.ATK)/100 //装备区 总加成
}
// 汇总DEBUFF_DECD并处理count值
let BUFF_ATK = 0
let DEBUFF_DEATK = 0
@@ -158,17 +148,17 @@ export class Skill extends ecs.Entity {
}
let BUFF_AP=(100-DEBUFF_DEATK+BUFF_ATK+dmg)/100 //buff区 总加成
puncture =buff.PUNCTURE+view.puncture
puncture_damage=buff.PUNCTURE_DMG+view.puncture_damage
puncture =view.puncture
puncture_damage=view.puncture_damage
ap=view.ap*buffap*BUFF_AP*SkillSet[uuid].ap/100
crit=view.crit+buff.CRITICAL
crit_d=view.crit_d+buff.CRITICAL_DMG
burn_count=buff.BURN_COUNT+view.burn_count
burn_value=buff.BURN_VALUE+view.burn_value
stun_time=buff.STUN_TIME+view.stun_time
stun_ratto=buff.STUN_RATTO+view.stun_ratto
frost_time=buff.FROST_TIME+view.frost_time
frost_ratto=buff.FROST_RATTO+view.frost_ratto
crit=view.crit
crit_d=view.crit_d
burn_count=view.burn_count
burn_value=view.burn_value
stun_time=view.stun_time
stun_ratto=view.stun_ratto
frost_time=view.frost_time
frost_ratto=view.frost_ratto
return {ap,crit,crit_d,puncture,puncture_damage,burn_count,burn_value,stun_time,stun_ratto,frost_time,frost_ratto}
}
}

View File

@@ -8,7 +8,6 @@ import { AType, DTType, EType, RType, SkillSet, SType, TGroup } from "../common/
import { BoxSet, FacSet } from "../common/config/BoxSet";
import { HeroViewComp } from "../hero/HeroViewComp";
import { BezierMove } from "../BezierMove/BezierMove";
import { FightConComp } from "../map/FightConComp";
import { MonModelComp } from "../hero/MonModelComp";
import { FightSet } from "../common/config/Mission";
import { HeroModelComp } from "../hero/HeroModelComp";
@@ -49,7 +48,6 @@ export class SkillCom extends CCComp {
stun_ratto:number=0;
frost_ratto:number=0;
frost_time:number=0;
FIGHTCON:FightConComp=null;
run_time:number=0;
hited_time:number=0;
hit_count:number=0;
@@ -65,7 +63,6 @@ export class SkillCom extends CCComp {
private moveDirection: Vec3 | null = null; // 添加一个属性来存储移动方向
protected onLoad(): void {
this.FIGHTCON=this.node.parent.getComponent(FightConComp)
}
@@ -183,12 +180,11 @@ export class SkillCom extends CCComp {
this.frost_time,this.frost_ratto) // ap 及暴击 属性已经在skill.ts 处理
// console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position)
if(SkillSet[this.s_uuid].debuff>0){
let deUP =this.get_debuff() // 因为不是每个技能都需要,debuff的增益在这里处理, ap 及暴击 属性已经在skill.ts 处理
let debuff=SkillSet[this.s_uuid]
let dev=debuff.deV*(100+deUP.deV)/100
let deR=debuff.deR+deUP.deR
let dev=debuff.deV*(100+this.caster.DEBUFF_VALUE)/100
let deR=debuff.deR+this.caster.DEBUFF_UP
dev=Math.round(dev*100)/100
let deC=debuff.deC+deUP.deC //dec只作为次数叠加
let deC=debuff.deC+this.caster.DEBUFF_COUNT //dec只作为次数叠加
// //console.log("[SkillCom]:debuff",SkillSet[this.s_uuid].name,debuff.debuff,deUP.deV,deUP.deC)
target.add_debuff(debuff.debuff,dev,deC,deR)
}
@@ -208,18 +204,8 @@ export class SkillCom extends CCComp {
// this.ent.destroy()
}
}
get_debuff(){ //debuff 加成
let debuff = {deV:0,deC:0,deR:0}
let buff=null
if(this.caster.is_master) buff = this.FIGHTCON.hero_buff
if(this.caster.is_boss||this.caster.is_kalami) buff = this.FIGHTCON.enemy_buff
if(buff==null) return debuff
debuff.deV=buff.DEBUFF_VALUE
debuff.deC=buff.DEBUFF_COUNT
debuff.deR=buff.DEBUFF_UP
return debuff
}
/**
* 执行2段位移先升高然后移到目的地
*/