环境技能基本完成 todo 技能cd动画 技能执行
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
lv:1,
|
||||
victory:0,
|
||||
mskill:1001,
|
||||
mmskill:1001,
|
||||
mmskill:1002,
|
||||
|
||||
}
|
||||
/** 游戏主角 */
|
||||
@@ -77,8 +77,8 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
total:1, //总怪物数
|
||||
exp:0,
|
||||
exp_max:100,
|
||||
m_exp:0,
|
||||
m_exp_max:100,
|
||||
mexp:0,
|
||||
mexp_max:100,
|
||||
hp:0,
|
||||
ap:0,
|
||||
def:0,
|
||||
|
||||
@@ -28,47 +28,47 @@ run:number = 0; // 0有目标 带方向,1贝塞尔曲线 2 不动 ,3 直线
|
||||
|
||||
*/
|
||||
export const SkillSet={
|
||||
1001:{uuid: 1001,path: "1001",type: 1,tg:3,angle:true,exp:100,level: 1,name: "火球术",sp_name:"fire",info:"释放一个火球术攻击敌人",
|
||||
1001:{uuid: 1001,path: "1001",type: 1,tg:3,angle:true,exp:30,level: 1,name: "火球术",sp_name:"fire",info:"释放一个火球术攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:3,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
1002:{uuid: 1002,path: "1002",type: 1,tg:3,angle:true,exp:100,level: 3,name: "寒冰箭",sp_name:"ice",info:"释放一个寒冰箭攻击敌人",
|
||||
1002:{uuid: 1002,path: "1002",type: 1,tg:3,angle:true,exp:30,level: 3,name: "寒冰箭",sp_name:"ice",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
1003:{uuid: 1003,path: "1003",type: 1,tg:3,angle:true,exp:100,level: 3,name: "强效射击",sp_name:"b_arrow",info:"释放一个火球术攻击敌人",
|
||||
1003:{uuid: 1003,path: "1003",type: 1,tg:3,angle:true,exp:30,level: 3,name: "强效射击",sp_name:"b_arrow",info:"释放一个火球术攻击敌人",
|
||||
dis:1,count:1,in:0,run:1,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
1004:{uuid: 1004,path: "1004",type: 1,tg:3,angle:true,exp:100,level: 3,name: "奥术冲击",sp_name:"bm_ball",info:"释放一个寒冰箭攻击敌人",
|
||||
1004:{uuid: 1004,path: "1004",type: 1,tg:3,angle:true,exp:30,level: 3,name: "奥术冲击",sp_name:"bm_ball",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,ap:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
|
||||
2001:{uuid: 2001,path: "2001",type: 91,tg:1,angle:false,exp:100,level: 1,name: "治愈术",sp_name:"heath",info:"释放一个寒冰箭攻击敌人",
|
||||
2001:{uuid: 2001,path: "2001",type: 91,tg:1,angle:false,exp:30,level: 1,name: "治愈术",sp_name:"heath",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0,run:1,ap:0,hp:3,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
2002:{uuid: 2002,path: "2002",type: 91,tg:0,angle:false,exp:100,level: 1,name: "魔法盾",sp_name:"shield",info:"释放一个寒冰箭攻击敌人",
|
||||
2002:{uuid: 2002,path: "2002",type: 91,tg:0,angle:false,exp:30,level: 1,name: "魔法盾",sp_name:"shield",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0.2,run:2,ap:0,hp:0,shield:1,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
2003:{uuid: 2003,path: "2003",type: 91,tg:0,angle:false,exp:100,level: 1,name: "狂暴",sp_name:"atkup",info:"释放一个寒冰箭攻击敌人",
|
||||
2003:{uuid: 2003,path: "2003",type: 91,tg:0,angle:false,exp:30,level: 1,name: "狂暴",sp_name:"atkup",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0.2,run:2,ap:1,hp:0,shield:0,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
|
||||
|
||||
3001:{uuid: 3001,path: "3001",type: 1,tg:3,angle:true,exp:100,level: 1,name: "三连击",sp_name:"patk",info:"释放一个魔法球攻击敌人",
|
||||
3001:{uuid: 3001,path: "3001",type: 1,tg:3,angle:true,exp:30,level: 1,name: "三连击",sp_name:"patk",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:3,in:0.3,run:2,ap: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: 11,tg:3,angle:true,exp:100,level: 3,name: "火焰风暴",sp_name:"fire",info:"释放多个个火球术攻击敌人",
|
||||
4011:{uuid: 4011,path: "1011",type: 11,tg:3,angle:true,exp:30,level: 3,name: "火焰风暴",sp_name:"fire",info:"释放多个个火球术攻击敌人",
|
||||
dis:1,count:5,in:0,run:0,ap: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: 11,tg:3,angle:true,exp:100,level: 3,name: "冰晶风暴",sp_name:"ice",info:"释放多个个寒冰箭攻击敌人",
|
||||
4012:{uuid: 4012,path: "1012",type: 11,tg:3,angle:true,exp:30,level: 3,name: "冰晶风暴",sp_name:"ice",info:"释放多个个寒冰箭攻击敌人",
|
||||
dis:1,count:5,in:0,run:0,ap: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,exp:100,level: 1,name: "普攻",sp_name:"patk",info:"释放一个魔法球攻击敌人",
|
||||
9001:{uuid: 9001,path: "1001",type: 1,tg:3,angle:true,exp:30,level: 1,name: "普攻",sp_name:"patk",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:1000,},
|
||||
9002:{uuid: 9002,path: "1001",type: 1,tg:3,angle:true,exp:100,level: 1,name: "魔法小球",sp_name:"mball",info:"释放一个魔法球攻击敌人",
|
||||
9002:{uuid: 9002,path: "1001",type: 1,tg:3,angle:true,exp:30,level: 1,name: "魔法小球",sp_name:"mball",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
9003:{uuid: 9003,path: "1001",type: 1,tg:3,angle:true,exp:100,level: 1,name: "射击",sp_name:"arrow",info:"释放一个魔法球攻击敌人",
|
||||
9003:{uuid: 9003,path: "1001",type: 1,tg:3,angle:true,exp:30,level: 1,name: "射击",sp_name:"arrow",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:1,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600,},
|
||||
|
||||
|
||||
8001:{uuid: 8001,path: "8001",type: 1,tg:3,angle:true,exp:100,level: 1,name: "飞刀",sp_name:"sword1",info:"释放一个魔法球攻击敌人",
|
||||
8001:{uuid: 8001,path: "8001",type: 1,tg:3,angle:true,exp:30,level: 1,name: "飞刀",sp_name:"sword1",info:"释放一个魔法球攻击敌人",
|
||||
dis:1,count:1,in:0,run:0,ap:0,hp:0,shield:0,sd:0,cd:0,bsd:0,bcd:0,sk_uuid:8001,sk_count:0,speed:600,},
|
||||
|
||||
}
|
||||
|
||||
export const MSklist = [1001,1002]
|
||||
export const MSkillset={
|
||||
confirm_exp:10,
|
||||
confirmexp:10,
|
||||
}
|
||||
export const MSlist={
|
||||
1:[1101],
|
||||
|
||||
@@ -45,21 +45,21 @@ import { Talents } from "./TalentSet"
|
||||
**/
|
||||
export const HeroInfo = {
|
||||
9001: {
|
||||
uuid:9001,name: "圣盾骑士",path:"k1",type:1,hp: 100, 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:100,a_cd:1.5,
|
||||
uuid:9001,name: "圣盾骑士",path:"k1",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:100,a_cd:1.5,
|
||||
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002,2002],pw:0,pwm:150,pws:10,apw:10,uapw:10,cpw:10,dpw:10,dopw:10,
|
||||
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:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
|
||||
},
|
||||
9002: {
|
||||
uuid:9002,name: "狂暴骑士",path:"k2",type:1,hp: 100, 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:100,a_cd:1.5,
|
||||
uuid:9002,name: "狂暴骑士",path:"k2",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:100,a_cd:1.5,
|
||||
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002,2002],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:["这是一级说明","这是二级说明","这是三级说明","这是四级说明","这是五级说明"]
|
||||
},
|
||||
9003: {
|
||||
uuid:9003,name: "防御骑士",path:"k3",type:1,hp: 100, 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:100,a_cd:1.5,
|
||||
uuid:9003,name: "防御骑士",path:"k3",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:100,a_cd:1.5,
|
||||
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002,2002],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,
|
||||
|
||||
@@ -473,7 +473,7 @@ export class HeroViewComp extends CCComp {
|
||||
smc.vmdata.mission.exp +=exp
|
||||
}
|
||||
if(this.box_group==BoxSet.MONSTER){
|
||||
smc.vmdata.mission.m_exp +=exp
|
||||
smc.vmdata.mission.mexp +=exp
|
||||
}
|
||||
}
|
||||
power_add(p:number){
|
||||
|
||||
@@ -24,6 +24,7 @@ import { HCard } from "./HCard";
|
||||
import { HCardComp } from "./HCardComp";
|
||||
import { VictoryComp } from "./VictoryComp";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
import { MSkillComp } from "./MSkillComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -41,13 +42,20 @@ export class MissionComp extends CCComp {
|
||||
mission_buff_type:number = 1 // 1 攻击 2 防御 3 HP
|
||||
m_mission_buff_type:number = 1 // 1 攻击 2 防御 3 HP
|
||||
mission_buff_up_exp:number = 99999999
|
||||
msk:any=null
|
||||
mmsk:any=null
|
||||
MSComp:MSkillComp=null
|
||||
MMSComp:MSkillComp=null
|
||||
|
||||
onLoad(){
|
||||
|
||||
this.MSComp=this.node.getChildByName("msk").getComponent(MSkillComp)
|
||||
this.MMSComp=this.node.getChildByName("mmsk").getComponent(MSkillComp)
|
||||
this.MSComp.group=BoxSet.HERO
|
||||
this.MSComp.s_uuid=smc.mission.mskill
|
||||
this.MMSComp.group=BoxSet.MONSTER
|
||||
this.MMSComp.s_uuid=smc.mission.mmskill
|
||||
}
|
||||
start() {
|
||||
this.VictoryComp=this.node.getChildByName("victory").getComponent(VictoryComp)
|
||||
console.log("mission_start:",this.MSComp)
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
@@ -67,34 +75,12 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
mission_start(){
|
||||
/* todo 关卡设定完善*/
|
||||
|
||||
let mon_set=RandomManager.instance.getRandomByObjectList(MissionSet,1)
|
||||
this.mon_list=mon_set[0]
|
||||
console.log("mission_start:",this.mon_list)
|
||||
//局内数据初始化
|
||||
this.fight_start=false
|
||||
smc.mission.is_victory=false
|
||||
smc.mission.is_defeat=false
|
||||
smc.vmdata.mission.exp=0 //局内经验
|
||||
smc.vmdata.mission.m_exp=0 //敌方局内经验
|
||||
smc.vmdata.mission.ap=0
|
||||
smc.vmdata.mission.hp=0
|
||||
smc.vmdata.mission.def=0
|
||||
smc.vmdata.mission.crit=0
|
||||
smc.vmdata.mission.dodge=0
|
||||
smc.vmdata.mission.dead=0
|
||||
smc.vmdata.mission.map=0
|
||||
smc.vmdata.mission.mhp=0
|
||||
smc.vmdata.mission.mdef=0
|
||||
smc.vmdata.mission.mcrit=0
|
||||
smc.vmdata.mission.mdead=0
|
||||
smc.vmdata.mission.mdodge=0
|
||||
|
||||
this.msk=SkillSet[smc.mission.mskill]
|
||||
this.mmsk=SkillSet[smc.mission.mmskill]
|
||||
smc.vmdata.mission.exp_max=this.msk.exp;
|
||||
smc.vmdata.mission.m_exp_max=this.mmsk.exp;
|
||||
console.log("mission_start:",this.mon_list,this.MSComp,this.MMSComp)
|
||||
|
||||
this.mission_init()
|
||||
this.mskill_init()
|
||||
this.mon_refresh()
|
||||
this.heros_call()
|
||||
}
|
||||
@@ -128,15 +114,36 @@ export class MissionComp extends CCComp {
|
||||
rewards[i].ItemComp.ent.destroy()
|
||||
}
|
||||
}
|
||||
mission_init(){
|
||||
//局内数据初始化
|
||||
this.fight_start=false
|
||||
smc.mission.is_victory=false
|
||||
smc.mission.is_defeat=false
|
||||
smc.vmdata.mission.exp=0 //局内经验
|
||||
smc.vmdata.mission.mexp=0 //敌方局内经验
|
||||
smc.vmdata.mission.exp_max=99999 //局内经验
|
||||
smc.vmdata.mission.mexp_max=99999 //敌方局内经验
|
||||
smc.vmdata.mission.ap=0
|
||||
smc.vmdata.mission.hp=0
|
||||
smc.vmdata.mission.def=0
|
||||
smc.vmdata.mission.crit=0
|
||||
smc.vmdata.mission.dodge=0
|
||||
smc.vmdata.mission.dead=0
|
||||
smc.vmdata.mission.map=0
|
||||
smc.vmdata.mission.mhp=0
|
||||
smc.vmdata.mission.mdef=0
|
||||
smc.vmdata.mission.mcrit=0
|
||||
smc.vmdata.mission.mdead=0
|
||||
smc.vmdata.mission.mdodge=0
|
||||
}
|
||||
mskill_init(){
|
||||
this.MSComp.group=BoxSet.HERO
|
||||
this.MMSComp.group=BoxSet.MONSTER
|
||||
this.MSComp.init()
|
||||
this.MMSComp.init()
|
||||
}
|
||||
check_buff(){
|
||||
if(smc.vmdata.mission.exp >= smc.vmdata.mission.exp_max){
|
||||
smc.vmdata.mission.exp-=smc.vmdata.mission.exp_max
|
||||
console.log("tudo 局内技能")
|
||||
}
|
||||
if(smc.vmdata.mission.m_exp >= smc.vmdata.mission.m_exp_max){
|
||||
smc.vmdata.mission.m_exp-=smc.vmdata.mission.m_exp_max
|
||||
console.log("tudo 敌方局内技能")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
check_mon_num(){
|
||||
|
||||
@@ -39,6 +39,7 @@ export class MSCardComp extends CCComp {
|
||||
}
|
||||
select(){
|
||||
smc.mission.mskill=this.s_uuid
|
||||
this.mhc.select_skill()
|
||||
oops.message.dispatchEvent(GameEvent.MSSelected,{uuid:this.s_uuid})
|
||||
}
|
||||
update_select(){
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { _decorator } from "cc";
|
||||
import { _decorator, resources, Sprite, SpriteAtlas } 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 { SkillSet } from "../common/config/SkillSet";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -8,15 +11,58 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass('MSkillComp')
|
||||
@ecs.register('MSkillComp', false)
|
||||
export class MSkillComp extends CCComp {
|
||||
|
||||
s_uuid: number = 0;
|
||||
group: number = 0;
|
||||
lv:number = 0;
|
||||
skill_on:boolean = false;
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
console.log("MSkillComp start s_uuid:",this.s_uuid,this.group);
|
||||
}
|
||||
init(){
|
||||
console.log("MSkillComp init s_uuid:",this.s_uuid,this.group);
|
||||
if(SkillSet[this.s_uuid]==undefined){this.skill_on=false; return}
|
||||
|
||||
this.s_uuid=smc.mission.mskill
|
||||
smc.vmdata.mission.exp_max=SkillSet[this.s_uuid].exp
|
||||
|
||||
if(this.group == BoxSet.MONSTER){
|
||||
this.s_uuid=smc.mission.mmskill
|
||||
smc.vmdata.mission.mexp_max=SkillSet[this.s_uuid].exp
|
||||
}
|
||||
|
||||
var icon_path = "game/skills/skill_icon"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[this.s_uuid].path);
|
||||
});
|
||||
this.skill_on=true
|
||||
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(!this.skill_on) return
|
||||
this.check_exp()
|
||||
}
|
||||
check_exp(){
|
||||
switch(this.group){
|
||||
case BoxSet.HERO:
|
||||
if(smc.vmdata.mission.exp >= SkillSet[this.s_uuid].exp){
|
||||
console.log("hero MSkillComp check_exp s_uuid:",this.s_uuid,this.group);
|
||||
smc.vmdata.mission.exp-=SkillSet[this.s_uuid].exp
|
||||
this.lvup()
|
||||
}
|
||||
break;
|
||||
case BoxSet.MONSTER:
|
||||
if(smc.vmdata.mission.mexp >= SkillSet[this.s_uuid].exp){
|
||||
console.log("monster MSkillComp check_exp s_uuid:",this.s_uuid,this.group);
|
||||
smc.vmdata.mission.mexp-=SkillSet[this.s_uuid].exp
|
||||
this.lvup()
|
||||
}
|
||||
}
|
||||
}
|
||||
lvup(){
|
||||
console.log("MSkillComp lvup s_uuid:",this.s_uuid,this.group);
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { _decorator, instantiate, Prefab, UITransform } from "cc";
|
||||
import { _decorator, instantiate, Prefab, resources, Sprite, SpriteAtlas, UITransform } 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 { HeroInfo, HeroList } from "../common/config/heroSet";
|
||||
@@ -33,7 +33,24 @@ export class MissionHomeComp extends CCComp {
|
||||
this.load_hero_card()
|
||||
this.load_ui_heros()
|
||||
this.load_skill_card()
|
||||
|
||||
this.select_skill()
|
||||
}
|
||||
start_mission(e:any,args:any) {
|
||||
console.log("mission home start_mission")
|
||||
for(let i=0;i<this.heros.length;i++){
|
||||
this.heros[i].to_destroy()
|
||||
}
|
||||
this.heros=[]
|
||||
this.heros_pos=[
|
||||
{uuid:0,px:-300},
|
||||
{uuid:0,px:-200},
|
||||
{uuid:0,px:-100},
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:100},
|
||||
]
|
||||
if(args!=0){
|
||||
this.load_ui_heros()
|
||||
}
|
||||
}
|
||||
load_hero_card(){
|
||||
let hc:number =HeroList.length
|
||||
@@ -55,28 +72,19 @@ export class MissionHomeComp extends CCComp {
|
||||
msc.load(MSklist[i],parent,2)
|
||||
}
|
||||
}
|
||||
start_mission(e:any,args:any) {
|
||||
console.log("mission home start_mission")
|
||||
for(let i=0;i<this.heros.length;i++){
|
||||
this.heros[i].to_destroy()
|
||||
}
|
||||
this.heros=[]
|
||||
this.heros_pos=[
|
||||
{uuid:0,px:-300},
|
||||
{uuid:0,px:-200},
|
||||
{uuid:0,px:-100},
|
||||
{uuid:0,px:0},
|
||||
{uuid:0,px:100},
|
||||
]
|
||||
if(args!=0){
|
||||
this.load_ui_heros()
|
||||
}
|
||||
}
|
||||
load_ui_heros(){
|
||||
for(let i=0;i<smc.fight_heros.length;i++){
|
||||
this.select_hero(smc.fight_heros[i])
|
||||
}
|
||||
}
|
||||
select_skill(){
|
||||
if(SkillSet[smc.mission.mskill]==undefined) return
|
||||
var icon_path = "game/skills/skill_icon"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("msk").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[smc.mission.mskill].path);
|
||||
});
|
||||
}
|
||||
select_hero(h_uuid:number){
|
||||
for(let i=0;i<4;i++){
|
||||
if(this.heros_pos[i].uuid==0){
|
||||
@@ -115,7 +123,7 @@ export class MissionHomeComp extends CCComp {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
show_heros(){
|
||||
|
||||
Reference in New Issue
Block a user