重构了云函数
This commit is contained in:
@@ -2,7 +2,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HType } from "../common/config/heroSet";
|
||||
import { BuffAttr, SkillSet } from "../common/config/SkillSet";
|
||||
import {Attrs, SkillSet } from "../common/config/SkillSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { SkillCom } from "./SkillCom";
|
||||
@@ -82,20 +82,7 @@ export class Skill extends ecs.Entity {
|
||||
group: caster.box_group,
|
||||
fac: caster.fac,
|
||||
// 技能数值
|
||||
ap: caster.Attrs[BuffAttr.AP],
|
||||
caster_crit: caster.Attrs[BuffAttr.CRITICAL],
|
||||
caster_crit_d: caster.Attrs[BuffAttr.CRITICAL_DMG],
|
||||
puncture: caster.Attrs[BuffAttr.PUNCTURE],
|
||||
puncture_damage: caster.Attrs[BuffAttr.PUNCTURE_DMG],
|
||||
burn_count: caster.Attrs[BuffAttr.BURN_COUNT],
|
||||
burn_value: caster.Attrs[BuffAttr.BURN_VALUE],
|
||||
stun_time: caster.Attrs[BuffAttr.STUN_TIME],
|
||||
stun_ratio: caster.Attrs[BuffAttr.STUN_RATIO],
|
||||
frost_time: caster.Attrs[BuffAttr.FROST_TIME],
|
||||
frost_ratio: caster.Attrs[BuffAttr.FROST_RATIO],
|
||||
debuff_up: caster.Attrs[BuffAttr.DEBUFF_UP],
|
||||
debuff_value: caster.Attrs[BuffAttr.DEBUFF_VALUE],
|
||||
debuff_count: caster.Attrs[BuffAttr.DEBUFF_COUNT],
|
||||
|
||||
});
|
||||
|
||||
this.add(SComp);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { Attrs, AType, DTType, EType, SkillSet, SType, TGroup } from "../common/config/SkillSet";
|
||||
import { Attrs, DTType, EType, SkillSet, SType, TGroup } from "../common/config/SkillSet";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { BezierMove } from "../BezierMove/BezierMove";
|
||||
@@ -85,50 +85,50 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
let bm=this.node.getComponent(BezierMove)
|
||||
// //console.log(this.group +"技能 collider ",collider);
|
||||
switch(this.skillConfig.AType){
|
||||
case AType.parabolic:
|
||||
this.node.angle +=10
|
||||
// bm.speed=700
|
||||
if(this.group==BoxSet.MONSTER) {bm.controlPointSide=-1 }
|
||||
bm.rotationSmoothness=0.6
|
||||
bm.moveTo(this.targetPos)
|
||||
break;
|
||||
case AType.linear:
|
||||
let s_x=this.startPos.x
|
||||
let s_y=this.startPos.y
|
||||
let t_x=this.targetPos.x
|
||||
let t_y=this.targetPos.y
|
||||
// 设定目标x
|
||||
this.targetPos.x = 400;
|
||||
if(this.group == BoxSet.MONSTER) {
|
||||
bm.controlPointSide = -1;
|
||||
this.targetPos.x = -400;
|
||||
}
|
||||
// 计算斜率
|
||||
const k = (t_y - s_y) / (t_x - s_x);
|
||||
// 按直线公式计算新的y
|
||||
this.targetPos.y = k * (this.targetPos.x - s_x) + s_y;
|
||||
bm.controlPointOffset=0
|
||||
bm.rotationSmoothness=0.6
|
||||
bm.moveTo(this.targetPos);
|
||||
break;
|
||||
case AType.StartEnd:
|
||||
// 2段位移:先升高,然后移到目的地
|
||||
this.node.setPosition(this.startPos.x > 360?300:this.startPos.x,0,0)
|
||||
this.do_anim()
|
||||
break;
|
||||
case AType.fixedEnd:
|
||||
this.node.setPosition(this.targetPos.x > 360?300:this.targetPos.x,0,0)
|
||||
this.do_anim()
|
||||
break;
|
||||
case AType.fixedStart: //
|
||||
if(this.s_uuid==6001){
|
||||
console.log("skillcom startPos",this.startPos)
|
||||
}
|
||||
this.node.setPosition(this.startPos.x > 360?300:this.startPos.x,0,0)
|
||||
this.do_anim()
|
||||
break;
|
||||
}
|
||||
// switch(this.skillConfig.AType){
|
||||
// case AType.parabolic:
|
||||
// this.node.angle +=10
|
||||
// // bm.speed=700
|
||||
// if(this.group==BoxSet.MONSTER) {bm.controlPointSide=-1 }
|
||||
// bm.rotationSmoothness=0.6
|
||||
// bm.moveTo(this.targetPos)
|
||||
// break;
|
||||
// case AType.linear:
|
||||
// let s_x=this.startPos.x
|
||||
// let s_y=this.startPos.y
|
||||
// let t_x=this.targetPos.x
|
||||
// let t_y=this.targetPos.y
|
||||
// // 设定目标x
|
||||
// this.targetPos.x = 400;
|
||||
// if(this.group == BoxSet.MONSTER) {
|
||||
// bm.controlPointSide = -1;
|
||||
// this.targetPos.x = -400;
|
||||
// }
|
||||
// // 计算斜率
|
||||
// const k = (t_y - s_y) / (t_x - s_x);
|
||||
// // 按直线公式计算新的y
|
||||
// this.targetPos.y = k * (this.targetPos.x - s_x) + s_y;
|
||||
// bm.controlPointOffset=0
|
||||
// bm.rotationSmoothness=0.6
|
||||
// bm.moveTo(this.targetPos);
|
||||
// break;
|
||||
// case AType.StartEnd:
|
||||
// // 2段位移:先升高,然后移到目的地
|
||||
// this.node.setPosition(this.startPos.x > 360?300:this.startPos.x,0,0)
|
||||
// this.do_anim()
|
||||
// break;
|
||||
// case AType.fixedEnd:
|
||||
// this.node.setPosition(this.targetPos.x > 360?300:this.targetPos.x,0,0)
|
||||
// this.do_anim()
|
||||
// break;
|
||||
// case AType.fixedStart: //
|
||||
// if(this.s_uuid==6001){
|
||||
// console.log("skillcom startPos",this.startPos)
|
||||
// }
|
||||
// this.node.setPosition(this.startPos.x > 360?300:this.startPos.x,0,0)
|
||||
// this.do_anim()
|
||||
// break;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -170,12 +170,12 @@ export class SkillCom extends CCComp {
|
||||
if(this.hit_count > 0 &&!is_range ){
|
||||
ap=ap*(50+this.puncture_damage)/100
|
||||
}
|
||||
target.do_atked(ap,this.caster_crit,this.caster_crit_d,
|
||||
this.burn_count,this.burn_value,
|
||||
this.stun_time,this.stun_ratio,
|
||||
this.frost_time,this.frost_ratio,
|
||||
this.skillConfig.AtkedType
|
||||
) // ap 及暴击 属性已经在skill.ts 处理
|
||||
// target.do_atked(ap,this.caster_crit,this.caster_crit_d,
|
||||
// this.burn_count,this.burn_value,
|
||||
// this.stun_time,this.stun_ratio,
|
||||
// this.frost_time,this.frost_ratio,
|
||||
// this.skillConfig.AtkedType
|
||||
// ) // ap 及暴击 属性已经在skill.ts 处理
|
||||
// console.log("[SkillCom]:single_damage t:tp:rtp",this.node.position,this.targetPos,target.node.position)
|
||||
if(this.skillConfig.debuff>0){
|
||||
let debuff=this.skillConfig
|
||||
|
||||
Reference in New Issue
Block a user