重做 局内经验的利用,加攻 加血,特殊技能,todo:先完成物品设定
This commit is contained in:
@@ -168,7 +168,7 @@ export class BossViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
if(smc.vmdata.game_over||smc.vmdata.game_pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
|
||||
@@ -51,8 +51,8 @@ export class Role extends ecs.Entity {
|
||||
}
|
||||
hero_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
|
||||
var rv = node.getComponent(RoleViewComp)!;
|
||||
let role=smc.vm_data.role;
|
||||
let role_talent= smc.vm_data.talent
|
||||
let role=smc.vmdata.role;
|
||||
let role_talent= smc.vmdata.talent
|
||||
let talents=Talents;
|
||||
rv.hero_uuid=uuid;
|
||||
rv.speed =rv.ospeed = role.speed;
|
||||
|
||||
@@ -112,7 +112,7 @@ export class RoleViewComp extends CCComp {
|
||||
// this.orginalFlashMaterial = this.sprite.getRenderMaterial(0);
|
||||
// 注册单个碰撞体的回调函数
|
||||
let collider = this.getComponent(Collider2D);
|
||||
smc.vm_data.role.atk_time=smc.vm_data.role.atk_cd;
|
||||
smc.vmdata.role.atk_time=smc.vmdata.role.atk_cd;
|
||||
collider.group = this.box_group;
|
||||
if (collider) {
|
||||
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
@@ -177,7 +177,7 @@ export class RoleViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause){
|
||||
if(!smc.vmdata.mission.play||smc.vmdata.pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
@@ -187,7 +187,7 @@ export class RoleViewComp extends CCComp {
|
||||
this.check_buff_atks(dt)
|
||||
this.in_shield(dt);
|
||||
this.in_stop(dt);
|
||||
smc.vm_data.role.atk_time -= dt;
|
||||
smc.vmdata.role.atk_time -= dt;
|
||||
this.in_atk();
|
||||
this.skill_cds(dt);
|
||||
this.move(dt);
|
||||
@@ -323,16 +323,16 @@ export class RoleViewComp extends CCComp {
|
||||
}
|
||||
}
|
||||
in_atk() {
|
||||
if(smc.vm_data.role.atk_time <= 0 ){
|
||||
if(smc.vmdata.role.atk_time <= 0 ){
|
||||
if(this.is_atking){
|
||||
smc.vm_data.role.atk_time = smc.vm_data.role.atk_cd;
|
||||
console.log("atk_cd:"+smc.vm_data.role.atk_cd);
|
||||
smc.vmdata.role.atk_time = smc.vmdata.role.atk_cd;
|
||||
console.log("atk_cd:"+smc.vmdata.role.atk_cd);
|
||||
this.as.atk();
|
||||
this.scheduleOnce(()=>{
|
||||
this.shoot(this.skill,0,30);
|
||||
},0.4)
|
||||
}
|
||||
// smc.vm_data.role.atk_time = 0;
|
||||
// smc.vmdata.role.atk_time = 0;
|
||||
// this.as.atk();
|
||||
// this.scheduleOnce(()=>{
|
||||
// this.shoot(this.skill,-30,45);
|
||||
@@ -373,7 +373,7 @@ export class RoleViewComp extends CCComp {
|
||||
this.dead();
|
||||
this.is_dead = true;
|
||||
this.ent.remove(MoveToComp)
|
||||
smc.vm_data.game_over = true;
|
||||
smc.vmdata.game_over = true;
|
||||
setTimeout(() => {
|
||||
this.ent.destroy();
|
||||
}, 15);
|
||||
|
||||
@@ -19,7 +19,7 @@ export class TalentComp extends CCComp {
|
||||
let cost =this.node.getChildByName("cost")
|
||||
let lv =this.node.getChildByName("lv")
|
||||
let talent= Talents[this.t_uuid]
|
||||
let role_talents = smc.vm_data.talent[talent.uuid]
|
||||
let role_talents = smc.vmdata.talent[talent.uuid]
|
||||
cost.getComponent(Label).string = (talent.cost*(1+role_talents.lv)).toString()
|
||||
name.getComponent(Label).string = talent.name
|
||||
info.getComponent(Label).string = talent.info
|
||||
|
||||
@@ -58,7 +58,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
heros_dead:any = []
|
||||
hero_pos:any=[]
|
||||
enemy_pos:any =[]
|
||||
vm_data: any = {
|
||||
vmdata: any = {
|
||||
name : "纸片精灵大乱斗",
|
||||
game_over:false,
|
||||
game_pause:false,
|
||||
@@ -71,14 +71,35 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
victory:0,
|
||||
once:6, //每波刷新怪物数量
|
||||
total:1, //总怪物数
|
||||
a_exp:0, //近战经验石
|
||||
b_exp:0, //远程经验石
|
||||
c_exp:0, //辅助经验石
|
||||
d_exp:0, //特殊经验石
|
||||
ma_exp:0, //敌方近战经验石
|
||||
mb_exp:0, //敌方远程经验石
|
||||
mc_exp:0, //敌方辅助经验石
|
||||
md_exp:0, //敌方特殊经验石
|
||||
a_exp:0, //攻击经验
|
||||
a_up_exp:10,
|
||||
a_up:5, //每次增加的ap量
|
||||
ap:0,
|
||||
h_exp:0, //生命值经验
|
||||
h_up_exp:10,
|
||||
h_up:5, //每次增加的hp量
|
||||
hp:0,
|
||||
s_exp:0, //场地技能经验
|
||||
s_up_exp:10,
|
||||
s_up:5,
|
||||
d_exp:0, //特殊经验
|
||||
d_up_exp:10,
|
||||
d_up:5,
|
||||
ma_exp:0, //敌方攻击经验
|
||||
ma_up_exp:10,
|
||||
ma_up:5,
|
||||
map:0,
|
||||
mh_exp:0, //敌方生命经验
|
||||
mh_up_exp:10,
|
||||
mh_up:5,
|
||||
mhp:0,
|
||||
ms_exp:0, //敌方场地技能经验
|
||||
ms_up_exp:10,
|
||||
ms_up:5,
|
||||
md_exp:0, //敌方特殊经验
|
||||
md_up_exp:10,
|
||||
md_up:5,
|
||||
|
||||
reward_num:0, //怪物死亡数
|
||||
reward_gold:0,
|
||||
reward_exp:0,
|
||||
@@ -119,12 +140,12 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
}
|
||||
};
|
||||
vmAdd() {
|
||||
VM.add(this.vm_data, "data");
|
||||
VM.add(this.vmdata, "data");
|
||||
|
||||
}
|
||||
reset() {
|
||||
for (var key in this.vm_data) {
|
||||
delete this.vm_data[key];
|
||||
for (var key in this.vmdata) {
|
||||
delete this.vmdata[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,21 +6,20 @@ type:
|
||||
*/
|
||||
|
||||
export const Items={
|
||||
1001:{uuid: 1001,path: "1001",type: 1,r_num:10,name: "近战经验卷轴",info:"提升普通近战英雄等级", },
|
||||
1002:{uuid: 1002,path: "1001",type: 1,r_num:10,name: "远程经验卷轴",info:"提升普通远程英雄等级", },
|
||||
1003:{uuid: 1003,path: "1001",type: 1,r_num:10,name: "辅助经验卷轴",info:"提升普通辅助英雄等级", },
|
||||
1004:{uuid: 1004,path: "1001",type: 1,r_num:10,name: "<传说>近战经验卷轴",info:"提升<传说>近战英雄等级", },
|
||||
1005:{uuid: 1005,path: "1001",type: 1,r_num:10,name: "<传说>远程经验卷轴",info:"提升<传说>远程英雄等级", },
|
||||
1006:{uuid: 1006,path: "1001",type: 1,r_num:10,name: "<传说>辅助经验卷轴",info:"提升<传说>辅助英雄等级", },
|
||||
1007:{uuid: 1007,path: "1001",type: 1,r_num:1,name: "近战英雄原石",info:"普通近战英雄升星", },
|
||||
1008:{uuid: 1008,path: "1001",type: 1,r_num:1,name: "远程英雄原石",info:"普通远程英雄升星", },
|
||||
1009:{uuid: 1009,path: "1001",type: 1,r_num:1,name: "辅助英雄原石",info:"普通辅助英雄升星", },
|
||||
1010:{uuid: 1010,path: "1001",type: 1,r_num:1,name: "<传说>近战英雄原石",info:"<传说>近战英雄升星", },
|
||||
1011:{uuid: 1011,path: "1001",type: 1,r_num:1,name: "<传说>远程英雄原石",info:"<传说>远程英雄升星", },
|
||||
1012:{uuid: 1012,path: "1001",type: 1,r_num:1,name: "<传说>辅助英雄原石",info:"<传说>辅助英雄升星", },
|
||||
1013:{uuid: 1013,path: "1001",type: 1,r_num:1,name: "英雄召唤券",info:"普通英雄召唤券,无法召唤传说英雄", },
|
||||
1014:{uuid: 1014,path: "1001",type: 1,r_num:1,name: "<高级>英雄召唤券",info:"<高级>英雄召唤券,召唤传说英雄机率提升", },
|
||||
1015:{uuid: 1015,path: "1001",type: 1,r_num:1,name: "<传说>英雄召唤券",info:"<传说>英雄召唤券,召唤传说英雄机率大幅提升", },
|
||||
|
||||
1001:{uuid: 1001,path: "1001",type: 1,r_num:10,name: "近战卷轴",info:"提升普通近战英雄等级", },
|
||||
1002:{uuid: 1002,path: "1001",type: 1,r_num:10,name: "远程卷轴",info:"提升普通远程英雄等级", },
|
||||
1003:{uuid: 1003,path: "1001",type: 1,r_num:10,name: "辅助卷轴",info:"提升普通辅助英雄等级", },
|
||||
1004:{uuid: 1004,path: "1001",type: 1,r_num:10,name: "<传说>近战卷轴",info:"提升<传说>近战英雄等级", },
|
||||
1005:{uuid: 1005,path: "1001",type: 1,r_num:10,name: "<传说>远程卷轴",info:"提升<传说>远程英雄等级", },
|
||||
1006:{uuid: 1006,path: "1001",type: 1,r_num:10,name: "<传说>辅助卷轴",info:"提升<传说>辅助英雄等级", },
|
||||
1007:{uuid: 1007,path: "1001",type: 1,r_num:1,name: "近战原石",info:"普通近战英雄升星", },
|
||||
1008:{uuid: 1008,path: "1001",type: 1,r_num:1,name: "远程原石",info:"普通远程英雄升星", },
|
||||
1009:{uuid: 1009,path: "1001",type: 1,r_num:1,name: "辅助原石",info:"普通辅助英雄升星", },
|
||||
1010:{uuid: 1010,path: "1001",type: 1,r_num:1,name: "<传说>近战原石",info:"<传说>近战英雄升星", },
|
||||
1011:{uuid: 1011,path: "1001",type: 1,r_num:1,name: "<传说>远程原石",info:"<传说>远程英雄升星", },
|
||||
1012:{uuid: 1012,path: "1001",type: 1,r_num:1,name: "<传说>辅助原石",info:"<传说>辅助英雄升星", },
|
||||
1013:{uuid: 1013,path: "1001",type: 1,r_num:1,name: "召唤券",info:"普通召唤券,无法召唤传说英雄", },
|
||||
1014:{uuid: 1014,path: "1001",type: 1,r_num:1,name: "<高级>召唤券",info:"<高级>英雄召唤券,召唤传说英雄机率提升", },
|
||||
1015:{uuid: 1015,path: "1001",type: 1,r_num:1,name: "<传说>召唤券",info:"<传说>英雄召唤券,召唤传说英雄机率大幅提升", },
|
||||
}
|
||||
|
||||
|
||||
@@ -71,8 +71,8 @@ export class Hero extends ecs.Entity {
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
// console.log("hero_init",buff)
|
||||
let HInf= smc.heros[uuid] // 角色数据
|
||||
let talent= smc.vm_data.talent
|
||||
let hero =smc.vm_data.heros[uuid]
|
||||
let talent= smc.vmdata.talent
|
||||
let hero =smc.vmdata.heros[uuid]
|
||||
let talents=Talents;
|
||||
hv.scale = scale;
|
||||
hv.box_group = box_group;
|
||||
|
||||
@@ -205,7 +205,7 @@ export class HeroViewComp extends CCComp {
|
||||
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
|
||||
}
|
||||
update(dt: number){
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause) return
|
||||
if(!smc.vmdata.mission.play||smc.vmdata.pause) return
|
||||
if(this.is_dead) {
|
||||
if(!this.in_grave()) this.to_grave()
|
||||
return
|
||||
@@ -279,7 +279,7 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
}
|
||||
move(dt: number){
|
||||
if(this.stop_cd > 0||smc.vm_data.mission.is_victory||smc.vm_data.mission.is_defeat){
|
||||
if(this.stop_cd > 0||smc.vmdata.mission.is_victory||smc.vmdata.mission.is_defeat){
|
||||
this.status_change("idle")
|
||||
return
|
||||
}
|
||||
@@ -436,14 +436,14 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
exp_add(exp:number){
|
||||
if(this.box_group==BoxSet.HERO){
|
||||
if(this.type == 1)smc.vm_data.mission.a_exp +=exp
|
||||
if(this.type == 2)smc.vm_data.mission.b_exp +=exp
|
||||
if(this.type == 3)smc.vm_data.mission.c_exp +=exp
|
||||
if(this.type == 1)smc.vmdata.mission.a_exp +=exp
|
||||
if(this.type == 2)smc.vmdata.mission.h_exp +=exp
|
||||
if(this.type == 3)smc.vmdata.mission.s_exp +=exp
|
||||
}
|
||||
if(this.box_group==BoxSet.MONSTER){
|
||||
if(this.type == 1)smc.vm_data.mission.ma_exp +=exp
|
||||
if(this.type == 2)smc.vm_data.mission.mb_exp +=exp
|
||||
if(this.type == 3)smc.vm_data.mission.mc_exp +=exp
|
||||
if(this.type == 1)smc.vmdata.mission.ma_exp +=exp
|
||||
if(this.type == 2)smc.vmdata.mission.mh_exp +=exp
|
||||
if(this.type == 3)smc.vmdata.mission.ms_exp +=exp
|
||||
}
|
||||
}
|
||||
//使用max_skill
|
||||
|
||||
@@ -157,13 +157,13 @@ export class CardControllerComp extends CCComp {
|
||||
// console.log("show_info",uuid)
|
||||
let node =this.node.getChildByName("item_box")
|
||||
if(type == 2){
|
||||
smc.vm_data.item_box.info = smc.sitems[uuid].info
|
||||
smc.vm_data.item_box.name = smc.sitems[uuid].name
|
||||
smc.vm_data.item_box.skillcd = smc.sitems[uuid].cd
|
||||
smc.vm_data.item_box.skillsd = smc.sitems[uuid].sd
|
||||
smc.vm_data.item_box.atk = smc.sitems[uuid].atk
|
||||
smc.vm_data.item_box.hp = smc.sitems[uuid].hp
|
||||
smc.vm_data.item_box.shield = smc.sitems[uuid].shield
|
||||
smc.vmdata.item_box.info = smc.sitems[uuid].info
|
||||
smc.vmdata.item_box.name = smc.sitems[uuid].name
|
||||
smc.vmdata.item_box.skillcd = smc.sitems[uuid].cd
|
||||
smc.vmdata.item_box.skillsd = smc.sitems[uuid].sd
|
||||
smc.vmdata.item_box.atk = smc.sitems[uuid].atk
|
||||
smc.vmdata.item_box.hp = smc.sitems[uuid].hp
|
||||
smc.vmdata.item_box.shield = smc.sitems[uuid].shield
|
||||
node.active=true
|
||||
if(smc.sitems[uuid].shield > 0){
|
||||
node.getChildByName("data").getChildByName("shield").active=true
|
||||
@@ -185,23 +185,23 @@ export class CardControllerComp extends CCComp {
|
||||
node.getChildByName("data").getChildByName("hp").active=false
|
||||
}
|
||||
shuaxin(dt: number) {
|
||||
smc.vm_data.shuaxin.min += smc.vm_data.shuaxin.speed*dt;
|
||||
if (smc.vm_data.shuaxin.min >= smc.vm_data.shuaxin.max) {
|
||||
smc.vm_data.shuaxin.min = 0;
|
||||
smc.vmdata.shuaxin.min += smc.vmdata.shuaxin.speed*dt;
|
||||
if (smc.vmdata.shuaxin.min >= smc.vmdata.shuaxin.max) {
|
||||
smc.vmdata.shuaxin.min = 0;
|
||||
this.load_cards()
|
||||
}
|
||||
}
|
||||
// cards_update(){
|
||||
// if(smc.vm_data.gold.min >= smc.vm_data.cards.up_cost){
|
||||
// smc.vm_data.gold.min -= smc.vm_data.cards.up_cost;
|
||||
// smc.vm_data.cards.level += 1;
|
||||
// smc.vm_data.gold.max +=2;
|
||||
// smc.vm_data.cards.up_cost += 2
|
||||
// if(smc.vm_data.cards.level >= smc.vm_data.cards.level_max){
|
||||
// smc.vm_data.cards.level = smc.vm_data.cards.level_max;
|
||||
// smc.vm_data.cards.up_cost = 11
|
||||
// if(smc.vmdata.gold.min >= smc.vmdata.cards.up_cost){
|
||||
// smc.vmdata.gold.min -= smc.vmdata.cards.up_cost;
|
||||
// smc.vmdata.cards.level += 1;
|
||||
// smc.vmdata.gold.max +=2;
|
||||
// smc.vmdata.cards.up_cost += 2
|
||||
// if(smc.vmdata.cards.level >= smc.vmdata.cards.level_max){
|
||||
// smc.vmdata.cards.level = smc.vmdata.cards.level_max;
|
||||
// smc.vmdata.cards.up_cost = 11
|
||||
// }
|
||||
// console.log("card _level:"+this.card_level+"cost:"+smc.vm_data.cards.up_cost)
|
||||
// console.log("card _level:"+this.card_level+"cost:"+smc.vmdata.cards.up_cost)
|
||||
// }else{
|
||||
// oops.gui.toast("金币不够");
|
||||
// }
|
||||
@@ -210,23 +210,23 @@ export class CardControllerComp extends CCComp {
|
||||
if (this.in_load) {
|
||||
return
|
||||
}
|
||||
if((smc.vm_data.shuaxin.max-smc.vm_data.shuaxin.min) < 0.5 ){
|
||||
if((smc.vmdata.shuaxin.max-smc.vmdata.shuaxin.min) < 0.5 ){
|
||||
oops.gui.toast("马上就要刷新了")
|
||||
return
|
||||
}
|
||||
if(smc.vm_data.shuaxin.min < 0.5){
|
||||
if(smc.vmdata.shuaxin.min < 0.5){
|
||||
oops.gui.toast("不要刷新太快哦")
|
||||
return
|
||||
}
|
||||
if (smc.vm_data.gold.min < smc.vm_data.cards.ref_cost) {
|
||||
if (smc.vmdata.gold.min < smc.vmdata.cards.ref_cost) {
|
||||
oops.gui.toast("金币不足")
|
||||
return
|
||||
}
|
||||
smc.vm_data.gold.min -= smc.vm_data.cards.ref_cost;
|
||||
smc.vmdata.gold.min -= smc.vmdata.cards.ref_cost;
|
||||
this.load_cards()
|
||||
smc.vm_data.shuaxin.min = -5
|
||||
if(smc.vm_data.shuaxin.min <=0 ){
|
||||
smc.vm_data.shuaxin.min = 0
|
||||
smc.vmdata.shuaxin.min = -5
|
||||
if(smc.vmdata.shuaxin.min <=0 ){
|
||||
smc.vmdata.shuaxin.min = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ export class CardControllerComp extends CCComp {
|
||||
// console.log("card_index:",index,"card_alive:",this.cards[index].alive)
|
||||
return;
|
||||
};
|
||||
if(smc.vm_data.gold.min >= this.cards[index].cost){
|
||||
if(smc.vmdata.gold.min >= this.cards[index].cost){
|
||||
this.cards[index].alive=false
|
||||
this.do_use_card(index)
|
||||
}else{
|
||||
@@ -333,7 +333,7 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
do_use_card(index:number){
|
||||
this.cards[index].alive=false
|
||||
smc.vm_data.gold.min -= this.cards[index].cost;
|
||||
smc.vmdata.gold.min -= this.cards[index].cost;
|
||||
oops.message.dispatchEvent("do_add_hero", { uuid: this.cards[index].uuid });
|
||||
// switch (this.cards[index].type) {
|
||||
// case 1:
|
||||
@@ -350,7 +350,7 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
|
||||
do_reward(){
|
||||
smc.vm_data.game_pause = true;
|
||||
smc.vmdata.game_pause = true;
|
||||
this.reward_lv+=1
|
||||
this.rewards_set=RewardSet[this.reward_lv]
|
||||
let i=RandomManager.instance.getRandomInt(0,this.rewards_set.length-1, 1)
|
||||
@@ -395,17 +395,17 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
colse_reward(value:number){
|
||||
this.node.getChildByName('rewards').active = false;
|
||||
smc.vm_data.game_pause = false;
|
||||
smc.vmdata.game_pause = false;
|
||||
let reward=this.rewards[value]
|
||||
if(reward.type==1){
|
||||
if(reward.atk > 0){
|
||||
smc.vm_data.mission.hero.atk += reward.atk / 100
|
||||
smc.vmdata.mission.hero.atk += reward.atk / 100
|
||||
}
|
||||
if(reward.atk_cd > 0){
|
||||
smc.vm_data.mission.hero.atk_cd -= reward.atk_cd/100
|
||||
smc.vmdata.mission.hero.atk_cd -= reward.atk_cd/100
|
||||
}
|
||||
if(reward.hp > 0){
|
||||
smc.vm_data.mission.hero.hp += reward.hp / 100;
|
||||
smc.vmdata.mission.hero.hp += reward.hp / 100;
|
||||
this.add_hero_hp_max(reward.hp / 100)
|
||||
}
|
||||
}
|
||||
@@ -430,7 +430,7 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
if(smc.vmdata.game_over||smc.vmdata.game_pause){
|
||||
return
|
||||
}
|
||||
this.shuaxin(dt)
|
||||
@@ -442,10 +442,10 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
|
||||
gold_add(dt: number) {
|
||||
smc.vm_data.gold.time += dt;
|
||||
if (smc.vm_data.gold.time >= smc.vm_data.gold.cd) {
|
||||
smc.vm_data.gold.min += 1;
|
||||
smc.vm_data.gold.time = 0;
|
||||
smc.vmdata.gold.time += dt;
|
||||
if (smc.vmdata.gold.time >= smc.vmdata.gold.cd) {
|
||||
smc.vmdata.gold.min += 1;
|
||||
smc.vmdata.gold.time = 0;
|
||||
}
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
|
||||
@@ -35,13 +35,13 @@ export class CardControllerComp extends CCComp {
|
||||
// console.log("show_info",uuid)
|
||||
let node =this.node.getChildByName("item_box")
|
||||
if(type == 2){
|
||||
smc.vm_data.item_box.info = smc.sitems[uuid].info
|
||||
smc.vm_data.item_box.name = smc.sitems[uuid].name
|
||||
smc.vm_data.item_box.skillcd = smc.sitems[uuid].cd
|
||||
smc.vm_data.item_box.skillsd = smc.sitems[uuid].sd
|
||||
smc.vm_data.item_box.atk = smc.sitems[uuid].atk
|
||||
smc.vm_data.item_box.hp = smc.sitems[uuid].hp
|
||||
smc.vm_data.item_box.shield = smc.sitems[uuid].shield
|
||||
smc.vmdata.item_box.info = smc.sitems[uuid].info
|
||||
smc.vmdata.item_box.name = smc.sitems[uuid].name
|
||||
smc.vmdata.item_box.skillcd = smc.sitems[uuid].cd
|
||||
smc.vmdata.item_box.skillsd = smc.sitems[uuid].sd
|
||||
smc.vmdata.item_box.atk = smc.sitems[uuid].atk
|
||||
smc.vmdata.item_box.hp = smc.sitems[uuid].hp
|
||||
smc.vmdata.item_box.shield = smc.sitems[uuid].shield
|
||||
node.active=true
|
||||
if(smc.sitems[uuid].shield > 0){
|
||||
node.getChildByName("data").getChildByName("shield").active=true
|
||||
@@ -53,7 +53,7 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
if(smc.vmdata.game_over||smc.vmdata.game_pause){
|
||||
return
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export class CardControllerComp extends CCComp {
|
||||
this.node.getChildByName("bar").active=false;
|
||||
this.node.getChildByName("mission_home").active=false
|
||||
this.node.getChildByName("mission").active=true
|
||||
smc.vm_data.mission.play = true;
|
||||
smc.vmdata.mission.play = true;
|
||||
// oops.message.dispatchEvent("mission_start")
|
||||
}
|
||||
to_home(){
|
||||
|
||||
@@ -7,22 +7,12 @@ import { HCardComp } from "./HCardComp";
|
||||
/** HCard 模块 */
|
||||
@ecs.register(`HCard`)
|
||||
export class HCard extends ecs.Entity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// HCardModel!: HCardModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// HCardBll!: HCardBllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
// HCardView!: HCardViewComp;
|
||||
|
||||
/** 实始添加的数据层组件 */
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
load(uuid:number=1001,index:number=-1,parent:any) {
|
||||
let box_group= 0
|
||||
|
||||
var path = "gui/element/hcard";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
|
||||
30
assets/script/game/map/Item.ts
Normal file
30
assets/script/game/map/Item.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { instantiate, Prefab } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
|
||||
/** Item 模块 */
|
||||
@ecs.register(`Item`)
|
||||
export class Item extends ecs.Entity {
|
||||
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
load(uuid:number=1001,num:number=0,praent:any=null) {
|
||||
var path = "game/gui/item";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = praent
|
||||
let iv = node.getComponent(ItemComp)!;
|
||||
iv.i_uuid = uuid
|
||||
iv.num=num
|
||||
this.add(iv)
|
||||
}
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/** Item 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
|
||||
9
assets/script/game/map/Item.ts.meta
Normal file
9
assets/script/game/map/Item.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6d44969e-0c5d-4ef2-8919-e9c18b012dec",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
24
assets/script/game/map/ItemComp.ts
Normal file
24
assets/script/game/map/ItemComp.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { _decorator, Label } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('ItemComp')
|
||||
@ecs.register('ItemComp', false)
|
||||
export class ItemComp extends CCComp {
|
||||
i_uuid:number = 0;
|
||||
num:number = 0;
|
||||
start() {
|
||||
this.node.getChildByName("num").getComponent(Label).string = this.num.toString();
|
||||
//todo 设定icon 显示
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
9
assets/script/game/map/ItemComp.ts.meta
Normal file
9
assets/script/game/map/ItemComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b3d7b41f-5185-4a0a-b690-897800e264ef",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause){
|
||||
if(!smc.vmdata.mission.play||smc.vmdata.pause){
|
||||
return
|
||||
}
|
||||
if(this.fight_start){
|
||||
@@ -69,10 +69,9 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
this.count_hero_pos()
|
||||
this.count_mon_pos()
|
||||
this.check_exp()
|
||||
this.check_m_exp()
|
||||
this.check_buff()
|
||||
// if (this.game_timer.update(dt)) {
|
||||
// smc.vm_data.game.g_time += 1;
|
||||
// smc.vmdata.game.g_time += 1;
|
||||
// }
|
||||
// this.shuaxin(dt)
|
||||
}
|
||||
@@ -83,27 +82,27 @@ export class MissionComp extends CCComp {
|
||||
console.log("mission_start:",this.mon_list)
|
||||
//局内数据初始化
|
||||
this.fight_start=false
|
||||
smc.vm_data.mission.is_victory=false
|
||||
smc.vm_data.mission.is_defeat=false
|
||||
smc.vm_data.mission.a_exp=0 //近战经验
|
||||
smc.vm_data.mission.b_exp=0 //远程经验
|
||||
smc.vm_data.mission.c_exp=0 //辅助经验
|
||||
smc.vm_data.mission.ma_exp=0 //敌方近战经验
|
||||
smc.vm_data.mission.mb_exp=0 //敌方远程经验
|
||||
smc.vm_data.mission.mc_exp=0 //敌方辅助经验
|
||||
smc.vmdata.mission.is_victory=false
|
||||
smc.vmdata.mission.is_defeat=false
|
||||
smc.vmdata.mission.a_exp=0 //近战经验
|
||||
smc.vmdata.mission.h_exp=0 //远程经验
|
||||
smc.vmdata.mission.s_exp=0 //辅助经验
|
||||
smc.vmdata.mission.ma_exp=0 //敌方近战经验
|
||||
smc.vmdata.mission.mh_exp=0 //敌方远程经验
|
||||
smc.vmdata.mission.ms_exp=0 //敌方辅助经验
|
||||
this.msk={ on :false, uuid:1001,type:1,lv: 1}
|
||||
this.mmsk={ on :false, uuid:1001,type:1,lv: 1}
|
||||
this.node.getChildByName("exp").getChildByName("a_exp").active = true
|
||||
this.node.getChildByName("exp").getChildByName("b_exp").active = true
|
||||
this.node.getChildByName("exp").getChildByName("c_exp").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("a_exp").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("b_exp").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("c_exp").active = true
|
||||
this.node.getChildByName("exp").getChildByName("ap").active = true
|
||||
this.node.getChildByName("exp").getChildByName("hp").active = true
|
||||
this.node.getChildByName("exp").getChildByName("mskill").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("ap").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("hp").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("mskill").active = true
|
||||
this.mon_refresh()
|
||||
this.heros_call()
|
||||
}
|
||||
mission_end(){
|
||||
smc.vm_data.mission.play=false
|
||||
smc.vmdata.mission.play=false
|
||||
let heros:any= this.get_heros();;
|
||||
let monsters:any= this.get_mons();
|
||||
let hcards:any= ecs.query(ecs.allOf(HCardComp));
|
||||
@@ -131,128 +130,56 @@ export class MissionComp extends CCComp {
|
||||
monsters[i].HeroView.ent.destroy()
|
||||
}
|
||||
}
|
||||
check_buff(){
|
||||
if(smc.vmdata.mission.a_exp >= smc.vmdata.mission.a_up_exp){
|
||||
smc.vmdata.mission.ap+=smc.vmdata.mission.a_up
|
||||
smc.vmdata.mission.a_exp-=smc.vmdata.mission.a_up_exp
|
||||
this.node.getChildByName("exp").getChildByName("ap").setScale(1.2,1)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("exp").getChildByName("ap").setScale(1,1)
|
||||
},0.1)
|
||||
}
|
||||
if(smc.vmdata.mission.h_exp >= smc.vmdata.mission.h_up_exp){
|
||||
smc.vmdata.mission.hp+=smc.vmdata.mission.h_up
|
||||
smc.vmdata.mission.h_exp-=smc.vmdata.mission.h_up_exp
|
||||
this.node.getChildByName("exp").getChildByName("hp").setScale(1.2,1)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("exp").getChildByName("hp").setScale(1,1)
|
||||
},0.1)
|
||||
}
|
||||
if(smc.vmdata.mission.ma_exp >= smc.vmdata.mission.ma_up_exp){
|
||||
smc.vmdata.mission.map+=smc.vmdata.mission.ma_up
|
||||
smc.vmdata.mission.ma_exp-=smc.vmdata.mission.ma_up_exp
|
||||
this.node.getChildByName("mexp").getChildByName("ap").setScale(1.2,1)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("mexp").getChildByName("ap").setScale(1,1)
|
||||
},0.1)
|
||||
}
|
||||
if(smc.vmdata.mission.mh_exp >= smc.vmdata.mission.mh_up_exp){
|
||||
smc.vmdata.mission.mhp+=smc.vmdata.mission.mh_up
|
||||
smc.vmdata.mission.mh_exp-=smc.vmdata.mission.mh_up_exp
|
||||
this.node.getChildByName("mexp").getChildByName("hp").setScale(1.2,1)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("mexp").getChildByName("hp").setScale(1,1)
|
||||
},0.1)
|
||||
}
|
||||
}
|
||||
|
||||
exp_move(ap: number,bp: number,cp: number){
|
||||
let a_pos=v3(ap,this.node.getChildByName("exp").getChildByName("a_exp").position.y)
|
||||
let b_pos=v3(bp,this.node.getChildByName("exp").getChildByName("b_exp").position.y)
|
||||
let c_pos=v3(cp,this.node.getChildByName("exp").getChildByName("c_exp").position.y)
|
||||
tween(this.node.getChildByName("exp").getChildByName("a_exp")).to(0.5,{position:a_pos}).start()
|
||||
tween(this.node.getChildByName("exp").getChildByName("b_exp")).to(0.5,{position:b_pos}).start()
|
||||
tween(this.node.getChildByName("exp").getChildByName("c_exp")).to(0.5,{position:c_pos}).start()
|
||||
}
|
||||
mexp_move(ap: number,bp: number,cp: number){
|
||||
let a_pos=v3(ap,this.node.getChildByName("mexp").getChildByName("a_exp").position.y)
|
||||
let b_pos=v3(bp,this.node.getChildByName("mexp").getChildByName("b_exp").position.y)
|
||||
let c_pos=v3(cp,this.node.getChildByName("mexp").getChildByName("c_exp").position.y)
|
||||
tween(this.node.getChildByName("mexp").getChildByName("a_exp")).to(0.5,{position:a_pos}).start()
|
||||
tween(this.node.getChildByName("mexp").getChildByName("b_exp")).to(0.5,{position:b_pos}).start()
|
||||
tween(this.node.getChildByName("mexp").getChildByName("c_exp")).to(0.5,{position:c_pos}).start()
|
||||
}
|
||||
check_exp(){
|
||||
if(!this.msk.on){
|
||||
if(smc.vm_data.mission.a_exp >= MSkillset.confirm_exp){
|
||||
this.msk.type = 1
|
||||
this.msk.on = true
|
||||
this.select_msk(1)
|
||||
this.exp_move(30,-100,-100)
|
||||
}
|
||||
if(smc.vm_data.mission.b_exp >= MSkillset.confirm_exp){
|
||||
this.msk.type = 2
|
||||
this.msk.on = true
|
||||
this.select_msk(2)
|
||||
this.exp_move(-100,30,-100)
|
||||
}
|
||||
if(smc.vm_data.mission.c_exp >= MSkillset.confirm_exp){
|
||||
this.msk.type = 3
|
||||
this.msk.on = true
|
||||
this.select_msk(3)
|
||||
this.exp_move(-100,-100,30)
|
||||
}
|
||||
}else{
|
||||
switch (this.msk.type){
|
||||
case 1:
|
||||
if(smc.vm_data.mission.a_exp >= MSkills[this.msk.uuid].up_exp){
|
||||
this.msk.lv += 1
|
||||
smc.vm_data.mission.a_exp = 0
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(smc.vm_data.mission.b_exp >= MSkills[this.msk.uuid].up_exp){
|
||||
this.msk.lv += 1
|
||||
smc.vm_data.mission.b_exp = 0
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(smc.vm_data.mission.c_exp >= MSkills[this.msk.uuid].up_exp){
|
||||
this.msk.lv += 1
|
||||
smc.vm_data.mission.c_exp = 0
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
check_m_exp(){
|
||||
if(!this.mmsk.on){
|
||||
if(smc.vm_data.mission.ma_exp >= MSkillset.confirm_exp){
|
||||
this.mmsk.type = 1
|
||||
this.mmsk.on = true
|
||||
this.select_mmsk(1)
|
||||
this.mexp_move(-30,100,100)
|
||||
}
|
||||
if(smc.vm_data.mission.mb_exp >= MSkillset.confirm_exp){
|
||||
this.mmsk.type = 2
|
||||
this.mmsk.on = true
|
||||
this.select_mmsk(2)
|
||||
this.mexp_move(100,-30,100)
|
||||
}
|
||||
if(smc.vm_data.mission.mc_exp >= MSkillset.confirm_exp){
|
||||
this.mmsk.type = 3
|
||||
this.mmsk.on = true
|
||||
this.select_mmsk(3)
|
||||
this.mexp_move(100,100,-30)
|
||||
}
|
||||
}else{
|
||||
switch (this.mmsk.type){
|
||||
case 1:
|
||||
if(smc.vm_data.mission.ma_exp >= MSkills[this.mmsk.uuid].up_exp){
|
||||
this.mmsk.lv += 1
|
||||
smc.vm_data.mission.ma_exp = 0
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(smc.vm_data.mission.mb_exp >= MSkills[this.mmsk.uuid].up_exp){
|
||||
this.mmsk.lv += 1
|
||||
smc.vm_data.mission.mb_exp = 0
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(smc.vm_data.mission.mc_exp >= MSkills[this.mmsk.uuid].up_exp){
|
||||
this.mmsk.lv += 1
|
||||
smc.vm_data.mission.mc_exp = 0
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
select_msk(type:number){
|
||||
smc.vm_data.mission.a_exp=0
|
||||
smc.vm_data.mission.b_exp=0
|
||||
smc.vm_data.mission.c_exp=0
|
||||
smc.vmdata.mission.s_exp=0
|
||||
let sk:any=RandomManager.instance.getRandomByObjectList(MSlist[type],1)
|
||||
this.msk.uuid=sk[0]
|
||||
let skill=ecs.getEntity<MSkill>(MSkill)
|
||||
skill.load(BoxSet.HERO,this.msk.uuid)
|
||||
}
|
||||
select_mmsk(type:number){
|
||||
smc.vm_data.mission.ma_exp=0
|
||||
smc.vm_data.mission.mb_exp=0
|
||||
smc.vm_data.mission.mc_exp=0
|
||||
smc.vmdata.mission.ms_exp=0
|
||||
let sk:any=RandomManager.instance.getRandomByObjectList(MSlist[type],1)
|
||||
this.mmsk.uuid=sk[0]
|
||||
let mskill=ecs.getEntity<MSkill>(MSkill)
|
||||
mskill.load(BoxSet.MONSTER,this.mmsk.uuid)
|
||||
}
|
||||
|
||||
do_reward(){
|
||||
console.log("do_reward")
|
||||
|
||||
@@ -272,15 +199,15 @@ export class MissionComp extends CCComp {
|
||||
m_alive=true
|
||||
}
|
||||
}
|
||||
if (!m_alive) smc.vm_data.mission.is_victory = true
|
||||
if (!h_alive) smc.vm_data.mission.is_defeat = true
|
||||
if (!m_alive) smc.vmdata.mission.is_victory = true
|
||||
if (!h_alive) smc.vmdata.mission.is_defeat = true
|
||||
this.to_end_mission()
|
||||
}
|
||||
to_end_mission(){
|
||||
if (smc.vm_data.mission.is_victory){
|
||||
if (smc.vmdata.mission.is_victory){
|
||||
this.VictoryComp.do_victiry()
|
||||
}
|
||||
if (smc.vm_data.mission.is_defeat){
|
||||
if (smc.vmdata.mission.is_defeat){
|
||||
this.VictoryComp.do_defeat()
|
||||
}
|
||||
}
|
||||
@@ -314,7 +241,7 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
}
|
||||
heros_call(){
|
||||
let heros=smc.vm_data.fight_heros
|
||||
let heros=smc.vmdata.fight_heros
|
||||
for(let i=0;i<heros.length;i++){
|
||||
this.addHero(heros[i],i)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { BossViewComp } from "../Boss/BossViewComp";
|
||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||
import { MissionReward } from "../common/config/MissionSet";
|
||||
import { Items } from "../common/config/Items";
|
||||
import { Item } from "./Item";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -20,38 +21,42 @@ export class VictoryComp extends CCComp {
|
||||
reward_lv:number=1
|
||||
reward_num:number=2
|
||||
rerawd_item:any={}
|
||||
if_show:boolean=false
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
}
|
||||
private do_victiry() {
|
||||
if(this.if_show) return
|
||||
this.node.getChildByName("Node").active = true;
|
||||
this.getReward()
|
||||
this.getReward(true)
|
||||
this.node.getChildByName("Node").getChildByName("defeat").active = false
|
||||
this.node.getChildByName("Node").getChildByName("victory").active = true;
|
||||
}
|
||||
private do_defeat() {
|
||||
if(this.if_show) return
|
||||
this.node.getChildByName("Node").active = true;
|
||||
this.getReward()
|
||||
this.getReward(false)
|
||||
this.node.getChildByName("Node").getChildByName("victory").active = false;
|
||||
this.node.getChildByName("Node").getChildByName("defeat").active = true
|
||||
}
|
||||
getReward(){
|
||||
let reward1:any = RandomManager.instance.getRandomByObjectList(MissionReward[this.reward_lv], 1);
|
||||
let reward2:any = RandomManager.instance.getRandomByObjectList(MissionReward[this.reward_lv], 1);
|
||||
let item1 =Items[reward1[0]]
|
||||
let item2 =Items[reward2[1]]
|
||||
let r1_num=0
|
||||
let r2_num=0
|
||||
console.log("getReward:",item1,item2)
|
||||
this.node.getChildByName("Node").getChildByName("item2").getChildByName("num").getComponent(Label).string=item1.r_num.toString()
|
||||
this.node.getChildByName("Node").getChildByName("item2").getChildByName("name").getComponent(Label).string=item1.name.toString()
|
||||
this.node.getChildByName("Node").getChildByName("item3").getChildByName("num").getComponent(Label).string=item2.r_num.toString()
|
||||
this.node.getChildByName("Node").getChildByName("item3").getChildByName("name").getComponent(Label).string=item2.r_num.toString()
|
||||
|
||||
|
||||
getReward(is_victory:boolean){
|
||||
let conut =2
|
||||
if(is_victory) conut=1
|
||||
let item1=ecs.getEntity<Item>(Item)
|
||||
let gold: number = Math.floor(RandomManager.instance.getRandomInt((3000 + smc.vmdata.mission.lv * 100) / 3 * 2, 3000 + smc.vmdata.mission.lv * 100));
|
||||
let parent = this.node.getChildByName("Node").getChildByName("items")
|
||||
item1.load(1001,gold,parent)
|
||||
for (let i = 0; i < conut; i++) {
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
let reward:any = RandomManager.instance.getRandomByObjectList(MissionReward[this.reward_lv], 1);
|
||||
let im =Items[reward[0]]
|
||||
item.load(im.uuid,im.r_num,parent)
|
||||
}
|
||||
this.if_show=true
|
||||
}
|
||||
end_mission(){
|
||||
this.node.getChildByName("Node").active=false
|
||||
this.if_show=false
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ export class MonViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause){
|
||||
if(!smc.vmdata.mission.play||smc.vmdata.pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
|
||||
@@ -27,7 +27,7 @@ export class MSkillComp extends CCComp {
|
||||
this.cd=this.cdt=this.skill.cd
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(!smc.vm_data.mission.play||smc.vm_data.pause||smc.vm_data.mission.is_victory||smc.vm_data.mission.is_defeat){
|
||||
if(!smc.vmdata.mission.play||smc.vmdata.pause||smc.vmdata.mission.is_victory||smc.vmdata.mission.is_defeat){
|
||||
return
|
||||
}
|
||||
this.check_cd(dt)
|
||||
|
||||
Reference in New Issue
Block a user