This commit is contained in:
walkpan
2025-01-08 23:59:41 +08:00
parent aa2d915bb3
commit 52cc268368
9 changed files with 213 additions and 142 deletions

View File

@@ -51,6 +51,7 @@ export class Skill extends ecs.Entity {
sv.debuff = SkillSet[uuid].debuff;
sv.depb = SkillSet[uuid].depb;
sv.derate = SkillSet[uuid].derate;
sv.run = SkillSet[uuid].run;
sv.is_crit=is_crit
sv.crit_add=crit_add
// node.setScale(v3(node.scale.x*scale,node.scale.y))

View File

@@ -35,6 +35,7 @@ export class SkillCom extends CCComp {
box_group:number = 0;
box_tag:number=0;
type:number = 1;
run:number = 0;
tg:number = 3;
in_time:number = 0.3; // 不动技能持续时间
enemys:any = [];
@@ -65,13 +66,9 @@ export class SkillCom extends CCComp {
// }
if(this.type==1 ){
if(this.run==1 ){
this.is_destroy=true
}
// console.log("skill onBeginContact",seCol.group,otCol.group)
// if(this.type==1 ){
// this.is_destroy=true
// }
}
if(otCol.group == seCol.group&&otCol.tag ==0&&this.tg==2){
this.to_console("skill onBeginContact 是对自己人的buff",seCol,otCol)

View File

@@ -1,60 +0,0 @@
import { _decorator, Component, Node, tween ,Vec3,v3,Collider2D,Contact2DType} from 'cc';
import { BoxSet } from '../common/config/BoxSet';
import { Timer } from 'db://oops-framework/core/common/timer/Timer';
const { ccclass, property } = _decorator;
@ccclass('baseCom')
export class baseCom extends Component {
s_uuid:number = 0;
speed:number = 200;
y_speed:number = 0;
x_speed:number = 0;
dis:number = 80;
scale:number = 1;
ap:number = 10;
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;
time:Timer = new Timer(0.01);
run_type:number = 0; // 0有目标 带方向1贝塞尔曲线 2 不动 ,3 直线
in_time:number = 0.3; // 不动技能持续时间
start() {
console.log("baseCom start")
let collider = this.getComponent(Collider2D);
collider.group = this.box_group;
collider.tag = this.box_tag;
collider.sensor = true;
if (collider) {
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
// collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);
collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
}
}
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D) {
if(otherCollider.group != selfCollider.group&&otherCollider.tag ==0){
this.atk_count+=1
// console.log("skill onBeginContact",selfCollider.group,otherCollider.group)
if(this.type==1 ){
this.is_destroy=true
}
}
}
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
}
reset() {
this.node.destroy();
}
update(deltaTime: number) {
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "89c1ceaf-2ca4-4954-88e7-542fae21fa14",
"files": [],
"subMetas": {},
"userData": {}
}