76 lines
2.3 KiB
TypeScript
76 lines
2.3 KiB
TypeScript
import { _decorator,Collider2D ,Contact2DType,v3,IPhysics2DContact,Vec3, tween, math} from "cc";
|
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
|
import { BoxSet } from "../common/config/BoxSet";
|
|
import { smc } from "../common/SingletonModuleComp";
|
|
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
|
import { GameEvent } from "../common/config/GameEvent";
|
|
import { SkillSet } from "../common/config/SkillSet";
|
|
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
/** 视图层对象 */
|
|
@ccclass('SkillCom')
|
|
@ecs.register('SkillView', false)
|
|
export class SkillCom extends CCComp {
|
|
s_uuid:number = 0;
|
|
s_name:string = "";
|
|
hero:number = 0;
|
|
speed:number = 200;
|
|
scale:number = 1;
|
|
lv:number = 1;
|
|
ap:number = 10;
|
|
def:number = 10;
|
|
apup:number = 0;//
|
|
mhp:number = 0;
|
|
hp:number = 0; //治疗总量
|
|
shield:number = 0;//护甲总量
|
|
cd:number = 1;
|
|
debuff:number = 0;
|
|
debtime:number = 0;
|
|
depb:number = 0;
|
|
derate:number = 0;
|
|
atk_count:number = 0;
|
|
is_crit:boolean = false;
|
|
crit_add: number = 0;//暴击伤害加成
|
|
angle:number = 0;
|
|
t_pos:Vec3 = v3(0,0,0); // 目标增量
|
|
is_destroy:boolean = false;
|
|
box_group:number = 0;
|
|
box_tag:number=0;
|
|
type:number = 1;
|
|
run:number = 0;
|
|
tg:number = 3;
|
|
in_time:number = 0.3; // 不动技能持续时间
|
|
enemys:any = [];
|
|
start() {
|
|
oops.message.on(GameEvent.MissionEnd, this.doDestroy, this);
|
|
this.node.active=true
|
|
|
|
}
|
|
to_console(value:any,value2:any=null,value3:any=null){
|
|
console.log("["+this.s_name+this.s_uuid+"]:",value,value2,value3)
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
if(smc.mission.pause) return
|
|
this.toDestroy()
|
|
|
|
}
|
|
toDestroy() {
|
|
if(this.is_destroy){
|
|
this.ent.destroy()
|
|
}
|
|
}
|
|
doDestroy(){
|
|
this.is_destroy=true
|
|
}
|
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
|
reset() {
|
|
this.is_destroy=false
|
|
this.node.destroy();
|
|
}
|
|
|
|
} |