This commit is contained in:
2024-09-20 17:13:16 +08:00
parent 4baee558c5
commit 96c96da552
8 changed files with 146 additions and 46 deletions

View File

@@ -71,7 +71,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Arrow", "_name": "skill",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {

View File

@@ -20,28 +20,79 @@
"_children": [ "_children": [
{ {
"__id__": 2 "__id__": 2
},
{
"__id__": 8
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{ {
"__id__": 18 "__id__": 18
}, },
{ {
"__id__": 20 "__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
} }
], ],
"_prefab": { "_prefab": {
"__id__": 22 "__id__": 26
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "skill",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 15
}
],
"_prefab": {
"__id__": 17
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -78,24 +129,24 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 1 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 3 "__id__": 4
}, },
{ {
"__id__": 5 "__id__": 6
} }
], ],
"_prefab": { "_prefab": {
"__id__": 7 "__id__": 8
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -15.234, "x": -15.23399999999998,
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
@@ -128,11 +179,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 2 "__id__": 3
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 4 "__id__": 5
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -156,11 +207,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 2 "__id__": 3
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 6 "__id__": 7
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@@ -214,20 +265,20 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": { "_parent": {
"__id__": 1 "__id__": 2
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 10
}, },
{ {
"__id__": 11 "__id__": 12
} }
], ],
"_prefab": { "_prefab": {
"__id__": 13 "__id__": 14
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -264,11 +315,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 8 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 10 "__id__": 11
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -292,11 +343,11 @@
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"node": { "node": {
"__id__": 8 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 12 "__id__": 13
}, },
"_customMaterial": null, "_customMaterial": null,
"_srcBlendFactor": 2, "_srcBlendFactor": 2,
@@ -344,6 +395,47 @@
"targetOverrides": null, "targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "b9gy3JAZNKCrWBoQOxNeQ5"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e0ctKOHTNOX488RjpXen7k",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
@@ -354,7 +446,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 15 "__id__": 19
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -382,7 +474,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 17 "__id__": 21
}, },
"enabledContactListener": true, "enabledContactListener": true,
"bullet": true, "bullet": true,
@@ -416,7 +508,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 19 "__id__": 23
}, },
"tag": 8, "tag": 8,
"_group": 4, "_group": 4,
@@ -450,7 +542,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 21 "__id__": 25
}, },
"_id": "" "_id": ""
}, },

View File

@@ -78,7 +78,7 @@
"__id__": 1 "__id__": 1
}, },
"_children": [], "_children": [],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 3 "__id__": 3
@@ -199,7 +199,7 @@
"r": 255, "r": 255,
"g": 255, "g": 255,
"b": 255, "b": 255,
"a": 255 "a": 0
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "930f41c2-9ec2-4b26-a832-35e40bdf3afe@c30fb", "__uuid__": "930f41c2-9ec2-4b26-a832-35e40bdf3afe@c30fb",

View File

@@ -232,6 +232,10 @@ export class RoleViewComp extends CCComp {
let {pos,t_pos}=this.get_enemy_pos() let {pos,t_pos}=this.get_enemy_pos()
pos.y=pos.y + y pos.y=pos.y + y
pos.x=pos.x + x pos.x=pos.x + x
if(smc.skills[skill_uuid].type==11){
pos.y=300
t_pos.y=t_pos.y-300
}
skill.load(pos,BoxSet.HERO,this.node,skill_uuid,atk,t_pos); skill.load(pos,BoxSet.HERO,this.node,skill_uuid,atk,t_pos);
// this.tooltip(3,smc.skills[skill_uuid].name,this.skill_uuid); // this.tooltip(3,smc.skills[skill_uuid].name,this.skill_uuid);
} }

View File

@@ -102,8 +102,8 @@ export class SingletonModuleComp extends ecs.Comp {
skill:1004, skill:1004,
skills:[ skills:[
{uuid:1002,cd:2,alive:true }, {uuid:1002,cd:2,alive:true },
{uuid:1003,cd:3,alive:true}, {uuid:4012,cd:3,alive:true},
{uuid:1004,cd:4,alive:true}, {uuid:4011,cd:4,alive:true},
{uuid:0,cd:0,alive:false}, {uuid:0,cd:0,alive:false},
{uuid:0,cd:0,alive:false}, {uuid:0,cd:0,alive:false},
] ]

View File

@@ -1,6 +1,8 @@
/* /*
type type
1 远距离攻击,碰撞后 结束 1 远距离攻击,碰撞后 结束
11远距离攻击从天降下
12远距离攻击目标点显现
2 远距离攻击,碰撞后 持续,直到技能结束 2 远距离攻击,碰撞后 持续,直到技能结束
3 远距离攻击,碰撞后 持续,带击退功能 3 远距离攻击,碰撞后 持续,带击退功能
4 双技能技能1技能结束后触发2技能 4 双技能技能1技能结束后触发2技能
@@ -44,9 +46,9 @@ export const SkillSet={
3001:{uuid: 3001,path: "3001",type: 1,tg:3,angle:true,level: 1,name: "三连击",sp_name:"patk",info:"释放一个魔法球攻击敌人", 3001:{uuid: 3001,path: "3001",type: 1,tg:3,angle:true,level: 1,name: "三连击",sp_name:"patk",info:"释放一个魔法球攻击敌人",
dis:1,count:3,in:0.3,run:2,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,}, dis:1,count:3,in:0.3,run:2,atk:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
4011:{uuid: 4011,path: "1011",type: 1,tg:3,angle:true,level: 3,name: "火焰风暴",sp_name:"fire",info:"释放多个个火球术攻击敌人", 4011:{uuid: 4011,path: "1011",type: 11,tg:3,angle:true,level: 3,name: "火焰风暴",sp_name:"fire",info:"释放多个个火球术攻击敌人",
dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, }, dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
4012:{uuid: 4012,path: "1012",type: 1,tg:3,angle:true,level: 3,name: "冰晶风暴",sp_name:"ice",info:"释放多个个寒冰箭攻击敌人", 4012:{uuid: 4012,path: "1012",type: 11,tg:3,angle:true,level: 3,name: "冰晶风暴",sp_name:"ice",info:"释放多个个寒冰箭攻击敌人",
dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, }, dis:1,count:5,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:2,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
9001:{uuid: 9001,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "普攻",sp_name:"patk",info:"释放一个魔法球攻击敌人", 9001:{uuid: 9001,path: "1001",type: 1,tg:3,angle:true,level: 1,name: "普攻",sp_name:"patk",info:"释放一个魔法球攻击敌人",

View File

@@ -46,12 +46,12 @@ export class Skill extends ecs.Entity {
if(t_pos.x < pos.x){ if(t_pos.x < pos.x){
scale= - 1 scale= - 1
} }
let angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI; let angle=0
if(scale == -1){ if(smc.skills[uuid].angle){
angle = angle +180 angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
} if(scale == -1){
if(!smc.skills[uuid].angle){ angle = angle +180
angle=0 }
} }
sv.angle = angle; sv.angle = angle;
// console.log(smc.skills[uuid].name+"angle:"+angle) // console.log(smc.skills[uuid].name+"angle:"+angle)

View File

@@ -57,13 +57,15 @@ export class SkillCom extends CCComp {
if(this.run_type == 0){ //直线,默认直线,有特定目标 朝向目标直线 if(this.run_type == 0){ //直线,默认直线,有特定目标 朝向目标直线
let time = 720 / this.speed; let time = 720 / this.speed;
let squaredDistance = this.t_pos.x * this.t_pos.x + this.t_pos.y * this.t_pos.y; let squaredDistance = this.t_pos.x * this.t_pos.x + this.t_pos.y * this.t_pos.y;
let distance = Math.sqrt(squaredDistance); let distance = Math.sqrt(squaredDistance);
time = distance / this.speed; time = distance / this.speed;
let e_pos=v3(this.node.position.x+this.t_pos.x,this.node.position.y+this.t_pos.y) let e_pos=v3(this.node.position.x+this.t_pos.x,this.node.position.y+this.t_pos.y)
this.node.getChildByName("skill").setRotationFromEuler(0,0,this.angle)
tween(this.node).to( time,{ angle:this.angle,position: e_pos}, console.log("skill ",this.node.getRotation())
tween(this.node).to( time,{ position: e_pos},
{ {
easing: "linear", easing: "linear",
onUpdate: (target: Vec3, ratio: number) => { }, onUpdate: (target: Vec3, ratio: number) => { },