重做 局内经验的利用,加攻 加血,特殊技能,todo:先完成物品设定
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user