技能动画添加

This commit is contained in:
2025-01-05 09:10:21 +08:00
parent 66f4a0de82
commit 511459c66c
118 changed files with 22272 additions and 8796 deletions

View File

@@ -13,12 +13,12 @@ const { ccclass, property } = _decorator;
@ccclass('Main')
export class Main extends Root {
start() {
if (DEBUG) profiler.showStats();
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
// if (DEBUG) profiler.showStats();
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
// // | EPhysics2DDrawFlags.Pair
// |EPhysics2DDrawFlags.CenterOfMass
// |EPhysics2DDrawFlags.Joint
|EPhysics2DDrawFlags.Shape;
// |EPhysics2DDrawFlags.Shape;
// console.log("PhysicsSystem2D",PhysicsSystem2D.instance.gravity)
}
protected async run() {

View File

@@ -25,40 +25,53 @@ sk_count:子技能个数
sp_name : 预制体名称
path: 图片地址
run:number = 0; // 0有目标 带方向1贝塞尔曲线 2 不动 ,3 直线
debuff: 0:无12灼烧3眩晕4沉默5减速6中毒7吸血8护盾
*/
export const SkillSet={
6001:{uuid: 6001,path: "6001",type: 1,tg:3,debuff:0,decd:2,name: "寒冰弹",sp_name:"ball_blue",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50 },
6001:{uuid: 6001,path: "6001",type: 1,tg:3,angle:true,upcost:2,name: "寒冰弹",sp_name:"ball_blue",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300, },
6002:{uuid: 6002,path: "6002",type: 1,tg:3,debuff:0,decd:2,name: "火焰弹",sp_name:"ball_red",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50 },
6002:{uuid: 6002,path: "6002",type: 1,tg:3,angle:true,upcost:2,name: "火焰弹",sp_name:"ball_red",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300, },
6003:{uuid: 6003,path: "6003",type: 1,tg:3,debuff:0,decd:2,name: "魔法弹",sp_name:"ball_green",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50 },
6003:{uuid: 6003,path: "6003",type: 1,tg:3,angle:true,upcost:2,name: "魔法弹",sp_name:"ball_green",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300, },
6004:{uuid: 6004,path: "6004",type: 1,tg:3,debuff:0,decd:2,name: "圣光弹",sp_name:"ball_yellow",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50 },
6004:{uuid: 6004,path: "6004",type: 1,tg:3,angle:true,upcost:2,name: "圣光弹",sp_name:"ball_yellow",info:"释放一个火球术攻击敌人",
in:0.2,count:1,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300, },
6005:{uuid: 6005,path: "6005",type: 1,tg:3,debuff:0,decd:2,name: "无形剑气",sp_name:"patk",info:"释放无形剑气攻击前方直线100码的敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50},
6005:{uuid: 6005,path: "6005",type: 1,tg:3,angle:true,upcost:2,name: "无形剑气",sp_name:"patk",info:"释放无形剑气攻击前方直线100码的敌人",
in:0.2,count:1,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300,},
6006:{uuid: 6006,path: "6006",type: 1,tg:3,debuff:0,decd:2,name: "射击",sp_name:"arrow",info:"释放无形剑气攻击前方直线100码的敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50},
6006:{uuid: 6006,path: "6006",type: 1,tg:3,angle:true,upcost:2,name: "射击",sp_name:"arrow",info:"释放形剑气攻击前方直线100码的敌人",
in:0.2,count:1,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300,},
6011:{uuid: 6011,path: "6011",type: 2,tg:3,debuff:0,decd:2,name: "有形剑气",sp_name:"dadao",info:"释放形剑气攻击前方直线300码的敌人",
in:1,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50},
6011:{uuid: 6011,path: "6011",type: 1,tg:3,angle:true,upcost:2,name: "有形剑气",sp_name:"dadao",info:"释放有形剑气攻击前方直线300码的敌人",
in:0.5,count:1,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300,},
6012:{uuid: 6012,path: "6012",type: 2,tg:3,debuff:0,decd:2,name: "大火球",sp_name:"fire",info:"释放有形剑气攻击前方直线300码的敌人",
in:1,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50},
6101:{uuid: 6101,path: "6101",type: 91,tg:1,angle:false,upcost:2,name: "治愈术",sp_name:"heath",info:"释放一个寒冰箭攻击敌人",
in:0.5,count:1,ap:0,hp:3,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:6001,sk_count:0,speed:300, },
6013:{uuid: 6013,path: "6013",type: 2,tg:3,debuff:0,decd:2,name: "火墙",sp_name:"fires",info:"释放有形剑气攻击前方直线300码的敌人",
in:5,count:1,ap:1,hp:0,cd:2,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50},
6102:{uuid: 6102,path: "6102",type: 91,tg:0,angle:false,upcost:2,name: "魔法盾",sp_name:"shield",info:"释放一个寒冰箭攻击敌人",
in:0.2,count:1,ap:0,hp:0,shield:1,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:6001,sk_count:0,speed:300, },
6014:{uuid: 6014,path: "6014",type: 2,tg:3,debuff:1,decd:2,name: "冰破术",sp_name:"ice",info:"释放有形剑气攻击前方直线300码的敌人",
in:1,count:1,ap:2,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50},
6103:{uuid: 6103,path: "6103",type: 91,tg:0,angle:false,upcost:2,name: "狂暴",sp_name:"atkup",info:"释放一个寒冰箭攻击敌人",
in:0.2,count:1,ap:1,hp:0,shield:0,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:6001,sk_count:0,speed:300, },
6015:{uuid: 6015,path: "6015",type: 2,tg:3,debuff:3,decd:6,name: "火焰射击",sp_name:"arrow_yellow",info:"释放有形剑气攻击前方直线300码的敌人",
in:1,count:1,ap:2,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:400,rate:50},
6016:{uuid: 6016,path: "6016",type: 2,tg:3,debuff:3,decd:6,name: "龙卷风",sp_name:"bwind",info:"释放有形剑气攻击前方直线300码的敌人",
in:1,count:1,ap:2,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:400,rate:50},
6101:{uuid: 6101,path: "6101",type: 91,tg:1,debuff:0,decd:2,name: "治愈术",sp_name:"heath",info:"释放一个寒冰箭攻击敌人",
in:0.5,count:1,ap:1,hp:3,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50 },
6102:{uuid: 6102,path: "6102",type: 91,tg:0,debuff:0,decd:2,name: "魔法盾",sp_name:"shield",info:"释放一个寒冰箭攻击敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:1,sk_uuid:0,sk_count:0,speed:300,rate:50 },
6103:{uuid: 6103,path: "6103",type: 91,tg:0,debuff:0,decd:2,name: "狂暴",sp_name:"atkup",info:"释放一个寒冰箭攻击敌人",
in:0.2,count:1,ap:1,hp:0,cd:1,shield:0,sk_uuid:0,sk_count:0,speed:300,rate:50 },
}

View File

@@ -73,14 +73,14 @@ export const HeroInfo = {
},
5004: {
uuid:5004,name: "绿箭",path:"a1",quality:3,kind:1,type:1,hp:200,hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:300,a_cd:1.5,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6006,6006,6006,6006,6006,6006],sk2:[6102,6102,6102,6102,6102,6102],sk3:[6102,6102,6102,6102,6102,6102],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6006,6006,6006,6006,6006,6006],sk2:[6015,6015,6015,6015,6015,6015],sk3:[6015,6015,6015,6015,6015,6015],pw:140,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
},
5005: {
uuid:5005,name: "罗宾汉",path:"a2",quality:2,kind:1,type:1,hp:200,hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:300,a_cd:1.5,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6006,6006,6006,6006,6006,6006],sk2:[6102,6102,6102,6102,6102,6102],sk3:[6102,6102,6102,6102,6102,6102],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6006,6006,6006,6006,6006,6006],sk2:[6016,6016,6016,6016,6016,6016],sk3:[6016,6016,6016,6016,6016,6016],pw:140,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
@@ -94,7 +94,7 @@ export const HeroInfo = {
},
5007: {
uuid:5007,name: "冰法",path:"m1",quality:3,kind:2,type:1,hp:200,hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:300,a_cd:1.5,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6001,6001,6001,6001,6001,6001],sk2:[6001,6001,6001,6001,6001,6001],sk3:[6102,6102,6102,6102,6102,6102],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6001,6001,6001,6001,6001,6001],sk2:[6014,6014,6014,6014,6014,6014],sk3:[6014,6014,6014,6014,6014,6014],pw:100,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
@@ -108,7 +108,7 @@ export const HeroInfo = {
},
5009: {
uuid:5009,name: "火法",path:"m3",quality:3,kind:2,type:1,hp:200,hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:300,a_cd:1.5,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6002,6002,6002,6002,6002,6002],sk2:[6002,6002,6002,6002,6002,6002],sk3:[6102,6102,6102,6102,6102,6102],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6002,6002,6002,6002,6002,6002],sk2:[6012,6012,6012,6012,6012,6012],sk3:[6012,6012,6012,6012,6012,6012],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
@@ -150,7 +150,7 @@ export const HeroInfo = {
},
5015: {
uuid:5015,name: "死灵法师",path:"zh2",quality:3,kind:2,type:1,hp:200,hp_up:10, shp_up:20,def:10,def_up:1,sdef_up:20,ap:20,ap_up:2,sap_up:20,atp:1,vun:0,crit:20,crit_add:0,ucr:0,dodge:0,dis:300,a_cd:1.5,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6003,6003,6003,6003,6003,6003],sk2:[6102,6102,6102,6102,6102,6102],sk3:[6102,6102,6102,6102,6102,6102],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
lvexp:100,slvexp:10,slv:0, speed: 50,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[6003,6003,6003,6003,6003,6003],sk2:[6013,6013,6013,6013,6013,6013],sk3:[6013,6013,6013,6013,6013,6013],pw:100,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,dopw:0,
akr:[10,20,30,40,50,60],akc:[1,1,1,1,1,1],uar:[10,20,30,40,50,60],uac:[1,1,1,1,1,1],dgr:[10,20,30,40,50,60],dgc:[1,1,1,1,1,1],crr:[10,20,30,40,50,60],crc:[1,1,1,1,1,1],
abh:0,abc:0,uabh:0,uabc:0,cbh:0,cbc:0,aua:0,auc:0,uaua:0,uauc:0,cua:0,cuc:0,wp:1001,arm:2001,ring:3001,shoes:4001,
tals:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]

View File

@@ -3,6 +3,7 @@ import { HeroViewComp } from './HeroViewComp';
import { oops } from 'db://oops-framework/core/Oops';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { Tooltip } from '../skills/Tooltip';
import { timedCom } from '../skills/timedCom';
const { ccclass, property } = _decorator;
@ccclass('BuffComp')
@@ -25,9 +26,7 @@ export class BuffComp extends Component {
dehp_cd:number=0;
decrit_cd:number=0;
iced_cd:number=0;
buff_cd:number=0;
yun_cd:number=0;
wind_cd:number=0;
speek_time:number=0;
@@ -108,16 +107,6 @@ export class BuffComp extends Component {
}
if(this.yun_cd > 0 ) this.yun_cd -= deltaTime;
if(this.yun_cd <= 0 && this.node.getChildByName("yun").active){
this.node.getChildByName("yun").active = false;
}
if(this.iced_cd > 0 ) this.iced_cd -= deltaTime;
if(this.iced_cd <= 0 && this.node.getChildByName("iced").active){
this.node.getChildByName("iced").active = false;
}
if(this.buff_cd > 0 ) this.buff_cd -= deltaTime;
if(this.buff_cd <= 0 && this.node.getChildByName("buff").active){
this.node.getChildByName("buff").active = false;
@@ -175,14 +164,6 @@ export class BuffComp extends Component {
this.node.getChildByName("top").getChildByName("buff").getChildByName("crit").active = true;
}
show_iced(t:number=1){
this.iced_cd = t;
this.node.getChildByName("iced").active = true;
}
show_yun(t:number=1){
this.iced_cd = t;
this.node.getChildByName("yun").active = true;
}
show_wind(t:number=1){
this.wind_cd = t;
@@ -226,7 +207,21 @@ export class BuffComp extends Component {
node.setPosition(pos)
node.parent = this.node;
}
in_iced(t:number=1) {
var path = "game/skills/iced";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.getComponent(timedCom).time = t;
node.parent = this.node;
}
in_yun(t:number=1) {
var path = "game/skills/yun";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.setPosition(v3(0,90));
node.getComponent(timedCom).time = t;
node.parent = this.node;
}
to_speek(words:string,time:number=0.5){
this.speek_time=0.5
this.node.getChildByName("tooltip").active=true

View File

@@ -116,9 +116,9 @@ export class HeroViewComp extends CCComp {
crit_count: number = 0;
stop_cd: number = 0.5; /*停止倒计时*/
yun_cd: number = 0.5; //眩晕倒计时
ice_cd: number = 0.5; //冰冻倒计时
stop_cd: number = 0; /*停止倒计时*/
yun_cd: number = 0; //眩晕倒计时
ice_cd: number = 0; //冰冻倒计时
dir_y:number = 0;
speek_time:number = 0;
@@ -131,7 +131,6 @@ export class HeroViewComp extends CCComp {
this.as.idle()
this.BUFFCOMP=this.node.getComponent(BuffComp);
/** 方向 */
this.node.setScale(this.scale,1);
this.node.getChildByName("top").setScale(this.scale,1);
@@ -164,47 +163,48 @@ export class HeroViewComp extends CCComp {
}
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D) {
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
if(otherCollider.tag==BoxSet.SKILL_TAG &&selfCollider.tag!=BoxSet.SKILL_TAG){
if(selfCollider.group != otherCollider.group){
let skill = otherCollider.node.getComponent(SkillCom)!;
console.log(Date.now()+this.hero_name+":"+this.uuid+' onBeginContact: '+skill.uuid);
if(oCol.tag==BoxSet.SKILL_TAG &&seCol.tag!=BoxSet.SKILL_TAG){
if(seCol.group != oCol.group){
let skill = oCol.node.getComponent(SkillCom)!;
console.log(Date.now()+this.hero_name+":"+this.uuid+' onBeginContact: '+skill.s_name+skill.uuid);
if(this.hp <= 0 ) return
this.check_uatk(skill);
}
}
}
onEndContact (selfCollider: Collider2D, otherCollider: Collider2D) {
onEndContact (seCol: Collider2D, oCol: Collider2D) {
}
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
let self_x = selfCollider.node.position.x;
let other_x = otherCollider.node.position.x;
if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){
onPreSolve (seCol: Collider2D, oCol: Collider2D) {
let se_x = seCol.node.position.x;
let ot_x = oCol.node.position.x;
let oCom= oCol.node.getComponent(HeroViewComp)
if(seCol.group == oCol.group&&seCol.tag==oCol.tag){
if(selfCollider.group==BoxSet.HERO){
if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x < other_x && Math.abs(other_x-self_x) < 40 ){
// this.node.setSiblingIndex(otherCollider.node.getSiblingIndex()-10)
if(seCol.group==BoxSet.HERO){
if(oCom.type == this.type&&oCom.yun_cd<=0&&oCom.ice_cd<=0 && se_x < ot_x && Math.abs(ot_x-se_x) < 40 ){
// this.node.setSiblingIndex(oCol.node.getSiblingIndex()-10)
this.stop_cd = 0.1;
}
}
if(selfCollider.group==BoxSet.MONSTER){
if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x > other_x && Math.abs(other_x-self_x) < 40 ){
// this.node.setSiblingIndex(otherCollider.node.getSiblingIndex()-10)
if(seCol.group==BoxSet.MONSTER){
if(oCom.type == this.type&&oCom.yun_cd<=0&&oCom.ice_cd<=0 && se_x > ot_x && Math.abs(ot_x-se_x) < 40 ){
// this.node.setSiblingIndex(oCol.node.getSiblingIndex()-10)
this.stop_cd = 0.1;
}
}
}
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
if(seCol.group != oCol.group&&oCol.tag == 0){
this.stop_cd = 0.1;
this.is_atking=true
}
}
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
onPostSolve (seCol: Collider2D, oCol: Collider2D) {
}
update(dt: number){
if(!smc.mission.play||smc.mission.pause) return
@@ -222,10 +222,15 @@ export class HeroViewComp extends CCComp {
this.check_enemy_alive()
this.check_mission_buff()
if(this.ice_cd > 0){ this.ice_cd -=dt; return }
if(this.yun_cd > 0){ this.yun_cd -=dt; return }
if(this.ice_cd > 0){
this.ice_cd -=dt;
return
}
if(this.yun_cd > 0){
this.yun_cd -=dt;
return
}
this.at += dt;
this.in_stop(dt);
this.in_atk(dt);
this.move(dt);
@@ -336,6 +341,7 @@ export class HeroViewComp extends CCComp {
}
return
}
this.check_debuff(skill)
if(this.check_dodge()) return
this.in_atked();
let d=this.def/skill.ap
@@ -347,6 +353,44 @@ export class HeroViewComp extends CCComp {
l_hp=Math.ceil(l_hp)
this.hp_less(l_hp,skill.is_crit);
}
check_debuff(skill:any){
console.log(this.hero_name+":"+this.uuid+"check_debuff "+skill.debuff);
if(skill.debuff == 0) return
let num=RandomManager.instance.getRandomInt(0,100)
switch (skill.debuff){
case 1:
// console.log(this.hero_name+":"+this.uuid+"冰冻触判断: i="+num+":rate="+skill.rate);
if(num > skill.rate) return
// console.log(this.hero_name+":"+this.uuid+"冰冻触成功: i="+num+":decd="+skill.decd);
this.ice_cd = skill.decd
this.BUFFCOMP.in_iced(skill.decd)
break;
case 2:
if(num > skill.rate) return
break;
case 3:
if(num > skill.rate) return
this.yun_cd = skill.decd
this.BUFFCOMP.in_yun(skill.decd)
break;
case 4:
if(num > skill.rate) return
break;
case 5:
if(num > skill.rate) return
break;
case 6:
if(num > skill.rate) return
break;
case 7:
if(num > skill.rate) return
break;
case 8:
if(num > skill.rate) return
break;
}
}
//能量判断
check_power(){
if(this.pw >= this.pwm){

View File

@@ -128,7 +128,7 @@ export class HeroHomeComp extends CCComp {
lvup.getChildByName("info").getChildByName("hp").getComponent(Label).string = "+"+this.hero.hp_up
// lvup.getChildByName("item").getChildByName("btn").getChildByName("bar").getComponent(ProgressBar).progress = smc.vmdata.exp.num/((LvUp[0]+this.hero.lvexp)*this.role.lv)
// slvup.getChildByName("gold").getChildByName("btn").getChildByName("need").getComponent(Label).string = (UpGold.SlvUp*(this.role.slv+1)).toString()
let slvneed=HeroInfo[this.h_uuid].slvexp*this.role.slv
let slvneed=HeroInfo[this.h_uuid].slvexp
let slvnum=smc.heros[this.h_uuid].num
slvup.getChildByName("up").active=slvnum>=slvneed
if( slvnum>=slvneed) {
@@ -246,15 +246,15 @@ export class HeroHomeComp extends CCComp {
this.update_data()
}
slv_up(){
if(this.role.slv>=5){
oops.gui.toast("已经满星,升阶失败");
return
}
if(smc.heros[this.h_uuid].num < (HeroInfo[this.h_uuid].slvexp*this.role.slv)){
// if(this.role.slv>=5){
// oops.gui.toast("已经满星,升阶失败");
// return
// }
if(smc.heros[this.h_uuid].num < HeroInfo[this.h_uuid].slvexp){
oops.gui.toast("资源不足,升阶失败");
return
}
smc.heros[this.h_uuid].num -= (HeroInfo[this.h_uuid].slvexp*this.role.slv)
smc.heros[this.h_uuid].num -= HeroInfo[this.h_uuid].slvexp
this.role.slv++
this.update_data()
}

View File

@@ -78,7 +78,7 @@ export class MissionHomeComp extends CCComp {
let hc:number =HeroList.length
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
let height=Math.ceil(hc / 4)*140 +100
let height=Math.ceil(hc / 4)*160 +100
parent.getComponent(UITransform).height=height
for (let i = 0; i < hc; i++) {

View File

@@ -4,29 +4,17 @@ const { ccclass, property } = _decorator;
@ccclass('LineCom')
export class LineCom extends Component {
base:SkillCom = null
start() {
let base =this.node.getComponent(SkillCom)
let time = 720 / base.speed;
let squaredDistance = base.t_pos.x * base.t_pos.x + base.t_pos.y * base.t_pos.y;
let distance = Math.sqrt(squaredDistance);
time = distance / base.speed;
let e_pos=v3(this.node.position.x+base.t_pos.x,this.node.position.y+base.t_pos.y)
// console.log("skill tx:"+e_pos.x+" node :"+this.node.position.x)
this.node.getChildByName("skill").setRotationFromEuler(0,0,base.angle)
// console.log("skill ",this.node.getRotation())
tween(this.node).to( time,{ position: e_pos},
{
easing: "linear",
onUpdate: (target: Vec3, ratio: number) => { },
onComplete: (target?: object) => {
base.is_destroy=true
},
}
).start();
this.base =this.node.getComponent(SkillCom)
}
update(deltaTime: number) {
this.node.setPosition(this.node.position.x+this.base.speed*deltaTime,this.node.position.y,this.node.position.z)
if(this.node.position.x>1000||this.node.position.x<-1000){
this.base.is_destroy = true
}
}
}

View File

@@ -31,18 +31,23 @@ export class Skill extends ecs.Entity {
pos=v3(pos.x,pos.y)
node.parent = parent;
node.setPosition(pos)
var sv = node.getComponent(SkillCom)!;
let angle=0
if(SkillSet[uuid].angle){
angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
if(t_pos.x<0){
angle+=180
}
}
sv.angle = angle;
console.log(group+" "+SkillSet[uuid].name+"angle:"+angle)
var sv = node.getComponent(SkillCom);
// let angle=0
// if(SkillSet[uuid].angle){
// angle = Math.atan2(t_pos.y,t_pos.x) * 180 / Math.PI;
// if(t_pos.x<0){
// angle+=180
// }
// }
// sv.angle = angle;
// console.log(group+" "+SkillSet[uuid].name+"angle:"+angle)
sv.s_uuid = uuid;
sv.ap = ap;
sv.s_name = SkillSet[uuid].name;
sv.ap = ap*SkillSet[uuid].ap;
sv.cd = SkillSet[uuid].cd;
sv.decd = SkillSet[uuid].decd;
sv.debuff = SkillSet[uuid].debuff;
sv.rate = SkillSet[uuid].rate;
sv.is_crit=is_crit
sv.crit_add=crit_add
// node.setScale(v3(node.scale.x*scale,node.scale.y))

View File

@@ -14,9 +14,14 @@ const { ccclass, property } = _decorator;
@ecs.register('SkillView', false)
export class SkillCom extends CCComp {
s_uuid:number = 0;
s_name:string = "";
speed:number = 200;
scale:number = 1;
ap:number = 10;
cd:number = 1;
debuff:number = 0;
decd:number = 0;
rate:number = 0;
atk_count:number = 0;
is_crit:boolean = false;
crit_add: number = 0;//暴击伤害加成
@@ -54,9 +59,9 @@ export class SkillCom extends CCComp {
// }
// if(this.type==1 ){
// this.is_destroy=true
// }
if(this.type==1 ){
this.is_destroy=true
}
// console.log("skill onBeginContact",selfCollider.group,otherCollider.group)
// if(this.type==1 ){
// this.is_destroy=true

View File

@@ -0,0 +1,30 @@
import { _decorator, Component, Node, v3 } from 'cc';
import { SkillCom } from './SkillCom';
const { ccclass, property } = _decorator;
@ccclass('TgCom')
export class TgCom extends Component {
time:number = 0
cd:number = 0
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
this.node.setPosition(this.base.t_pos)
}
update(deltaTime: number) {
this.cd+=deltaTime
if(this.cd>=this.base.cd){
// this.node.setPosition(v3(-1000,0,0))
this.node.active = false
this.node.active = true
this.cd=0
}
this.time+=deltaTime
if(this.time>=this.base.in_time){
this.base.is_destroy = true
}
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "2e2390b0-a0cd-459a-847c-409e5e3ad3f3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,20 @@
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('timedCom')
export class timedCom extends Component {
time = 0.3;
start() {
}
update(deltaTime: number) {
this.time = this.time - deltaTime;
if(this.time <= 0)
{
this.node.destroy()
}
}
}

View File

@@ -0,0 +1 @@
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"f140b15c-7345-4364-818e-787001fb1c19","files":[],"subMetas":{},"userData":{}}