基础主将添加+ 修复第一次伤害计算为穿刺伤害bug

This commit is contained in:
2025-07-06 23:58:10 +08:00
parent 9ebf620ed8
commit f7c231de00
60 changed files with 9355 additions and 414 deletions

View File

@@ -1,6 +1,6 @@
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { BoxSet } from "../common/config/BoxSet";
import { BoxSet, FacSet } from "../common/config/BoxSet";
import { SkillSet } from "../common/config/SkillSet";
import { smc } from "../common/SingletonModuleComp";
import { HeroViewComp } from "../hero/HeroViewComp";
@@ -58,6 +58,9 @@ export class Skill extends ecs.Entity {
// 设置节点属性
node.parent = parent;
node.setPosition(startPos);
if(caster.fac==FacSet.MON){
node.scale=v3(node.scale.x*-1,1,1)
}
node.angle+=angle
// 添加技能组件
const SComp = node.getComponent(SkillCom); // 初始化技能参数
@@ -97,6 +100,7 @@ export class Skill extends ecs.Entity {
prefabName: config.sp_name,
group: caster.box_group,
fac: caster.fac,
scale: caster.scale,
animName: config.animName
});

View File

@@ -88,19 +88,6 @@ export class SkillCom extends CCComp {
if(this.group==BoxSet.MONSTER) bm.controlPointSide=-1
bm.moveTo(this.targetPos)
break;
case AType.linear:
// this.distance_x=SkillSet[this.s_uuid].in*this.speed
// this.t_end_x =400
// if(this.group==BoxSet.MONSTER){
// this.t_end_x=-400
// this.node.scale=v3(this.node.scale.x*-1,1,1)
// }
// this.tweenInstance = tween(this.node).to(SkillSet[this.s_uuid].in, { position:v3(this.t_end_x,this.node.position.y,0)},{
// onComplete: (target?: object) => {
// // this.node.setPosition(tx,this.node.position.y-300,0)
// }
// }).start()
break;
case AType.fixedStart:
break;
@@ -126,7 +113,6 @@ export class SkillCom extends CCComp {
}
onAnimationFinished(){
if(SkillSet[this.s_uuid].EType==EType.timeEnd) return
this.is_destroy=true
@@ -146,12 +132,11 @@ export class SkillCom extends CCComp {
}
//单体伤害
single_damage(target:HeroViewComp){
this.hit_count++
console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit)
if(this.hit_count>=(SkillSet[this.s_uuid].hit+this.puncture)) this.is_destroy=true // 技能命中次数
if(target == null) return;
// console.log("[SkillCom]:onBeginContact hit_count:",this.hit_count,SkillSet[this.s_uuid].hit)
if(this.hit_count > 0) this.ap=this.ap*(50+this.puncture_damage)/100 // 穿刺后 伤害减半
if(target == null) return;
target.do_atked(this.ap,this.caster_crit,this.caster_crit_d) // ap 及暴击 属性已经在skill.ts 处理
console.log("[SkillCom]:single_damage",this.ap,this.caster_crit,this.caster_crit_d)
if(SkillSet[this.s_uuid].debuff>0){
let deUP =this.get_debuff() // 因为不是每个技能都需要,debuff的增益在这里处理, ap 及暴击 属性已经在skill.ts 处理
let debuff=SkillSet[this.s_uuid]
@@ -162,6 +147,8 @@ export class SkillCom extends CCComp {
console.log("[SkillCom]:debuff",SkillSet[this.s_uuid].name,debuff.debuff,deUP.deV,deUP.deC)
target.add_debuff(debuff.debuff,dev,deC,deR)
}
this.hit_count++
if(this.hit_count>=(SkillSet[this.s_uuid].hit+this.puncture)) this.is_destroy=true // 技能命中次数
}
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
@@ -188,9 +175,11 @@ export class SkillCom extends CCComp {
private startLinearMove(dt: number) {
if (!this.speed || this.is_destroy) return;
if(this.s_uuid == 6005){
console.log("[SkillCom]:startLinearMove",this.node.position.x)
}
// 使用角度方向移动
const newX = this.node.position.x + this.speed * dt;
const newX = this.node.position.x + this.speed * dt*this.scale;
const newY = this.node.position.y;
this.node.setPosition(newX, this.node.position.y, this.node.position.z);