战斗经验统一,由站前选择局内buff
This commit is contained in:
@@ -106,11 +106,11 @@ export class HeroHomeComp extends CCComp {
|
||||
attr2.getChildByName("ca").getChildByName("val").getComponent(Label).string = (150+this.hero.crit_add).toString()+"%"
|
||||
attr2.getChildByName("ucr").getChildByName("val").getComponent(Label).string = this.hero.ucr+"%"
|
||||
attr2.getChildByName("dod").getChildByName("val").getComponent(Label).string = this.hero.dodge+"%"
|
||||
attr2.getChildByName("aep").getChildByName("val").getComponent(Label).string = this.hero.aep
|
||||
attr2.getChildByName("uaep").getChildByName("val").getComponent(Label).string = this.hero.uaep
|
||||
attr2.getChildByName("cep").getChildByName("val").getComponent(Label).string = this.hero.cep
|
||||
attr2.getChildByName("doep").getChildByName("val").getComponent(Label).string = this.hero.doep
|
||||
attr2.getChildByName("dep").getChildByName("val").getComponent(Label).string = this.hero.dep
|
||||
attr2.getChildByName("aexp").getChildByName("val").getComponent(Label).string = this.hero.aexp
|
||||
attr2.getChildByName("uaexp").getChildByName("val").getComponent(Label).string = this.hero.uaexp
|
||||
attr2.getChildByName("cexp").getChildByName("val").getComponent(Label).string = this.hero.cexp
|
||||
attr2.getChildByName("doexp").getChildByName("val").getComponent(Label).string = this.hero.doexp
|
||||
attr2.getChildByName("dexp").getChildByName("val").getComponent(Label).string = this.hero.dexp
|
||||
|
||||
oops.message.dispatchEvent("hero_card_update_info",{uuid:this.h_uuid})
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
|
||||
/** 策划 Excel 导出的 Json 静态数据 */
|
||||
export class HeroList {
|
||||
static TableName: string = "config/game/heros";
|
||||
|
||||
/** 静态表中一条数据 */
|
||||
private data: any;
|
||||
|
||||
init() {
|
||||
var table = oops.res.get(HeroList.TableName);
|
||||
this.data = table['json']['list'];
|
||||
|
||||
}
|
||||
|
||||
/** 数据唯一编号 */
|
||||
id: number = 0;
|
||||
|
||||
/** 数据 */
|
||||
get list(): number {
|
||||
let res:any = []
|
||||
for(let i=0;i<this.data.length;i++)
|
||||
{
|
||||
res[this.data[i].uuid] = this.data[i];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "96c600ef-79ab-4952-a5c8-a3bbc7a7d15f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import { Hero } from "../hero/Hero";
|
||||
import { HeroInfo, HeroSet } from "../common/config/heroSet";
|
||||
import { Boss } from "../Boss/Boss";
|
||||
import { MonModelComp } from "../hero/MonModelComp";
|
||||
import { BossList, MissionNum, MissionSet, MonsetList } from "../common/config/MissionSet";
|
||||
import { BossList, MBSet, MissionNum, MissionSet, MonsetList } from "../common/config/MissionSet";
|
||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
import { HCard } from "./HCard";
|
||||
import { HCardComp } from "./HCardComp";
|
||||
@@ -40,6 +40,9 @@ export class MissionComp extends CCComp {
|
||||
reward_num:number = 0;
|
||||
game_over:boolean = false;
|
||||
fight_start:boolean = false;
|
||||
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={
|
||||
on :false,
|
||||
uuid:1001,
|
||||
@@ -76,36 +79,73 @@ 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)
|
||||
console.log("mission_start:",this.mon_list,smc.vmdata.mission.mbt ,smc.vmdata.mission.mmbt)
|
||||
//局内数据初始化
|
||||
this.fight_start=false
|
||||
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.ma_exp=0 //敌方近战经验
|
||||
smc.vmdata.mission.mh_exp=0 //敌方远程经验
|
||||
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.map=0
|
||||
smc.vmdata.mission.mhp=0
|
||||
smc.vmdata.mission.mdef=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("ap").active = true
|
||||
this.node.getChildByName("exp").getChildByName("hp").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("ap").active = true
|
||||
this.node.getChildByName("mexp").getChildByName("hp").active = true
|
||||
let exp_n=this.node.getChildByName("exp")
|
||||
let nexp_n=this.node.getChildByName("mexp")
|
||||
|
||||
exp_n.getChildByName("ap").active = false;
|
||||
nexp_n.getChildByName("ap").active = false;
|
||||
exp_n.getChildByName("def").active = false;
|
||||
nexp_n.getChildByName("def").active = false;
|
||||
exp_n.getChildByName("hp").active = false;
|
||||
nexp_n.getChildByName("hp").active = false;
|
||||
switch(smc.vmdata.mission.mbt){
|
||||
case 1:
|
||||
exp_n.getChildByName("ap").active = true;
|
||||
smc.vmdata.mission.exp_max=MBSet.ap_exp-smc.vmdata.mission.ap_exp;
|
||||
break;
|
||||
case 2:
|
||||
exp_n.getChildByName("def").active = true;
|
||||
smc.vmdata.mission.exp_max=MBSet.def_exp-smc.vmdata.mission.def_exp;
|
||||
break;
|
||||
case 3:
|
||||
exp_n.getChildByName("hp").active = true;
|
||||
smc.vmdata.mission.exp_max=MBSet.hp_exp-smc.vmdata.mission.hp_exp;
|
||||
break;
|
||||
}
|
||||
switch(smc.vmdata.mission.mmbt){
|
||||
case 1:
|
||||
nexp_n.getChildByName("ap").active = true;
|
||||
smc.vmdata.mission.m_exp_max=MBSet.ap_exp+smc.vmdata.mission.map_exp;
|
||||
break;
|
||||
case 2:
|
||||
nexp_n.getChildByName("def").active = true;
|
||||
smc.vmdata.mission.m_exp_max=MBSet.def_exp+smc.vmdata.mission.mdef_exp;
|
||||
break;
|
||||
case 3:
|
||||
nexp_n.getChildByName("hp").active = true;
|
||||
smc.vmdata.mission.m_exp_max=MBSet.hp_exp+smc.vmdata.mission.mhp_exp;
|
||||
break;
|
||||
}
|
||||
|
||||
this.mon_refresh()
|
||||
this.heros_call()
|
||||
}
|
||||
do_x10(){
|
||||
|
||||
}
|
||||
|
||||
mission_end(){
|
||||
smc.vmdata.mission.play=false
|
||||
smc.vmdata.mission.pause=false
|
||||
smc.vmdata.mission.mmbt=1
|
||||
smc.vmdata.mission.mbt=1
|
||||
let heros:any= this.get_heros();;
|
||||
let monsters:any= this.get_mons();
|
||||
let hcards:any= ecs.query(ecs.allOf(HCardComp));
|
||||
@@ -120,10 +160,8 @@ export class MissionComp extends CCComp {
|
||||
// hcns.children[i].destroy()
|
||||
// }
|
||||
for(let i=0;i<heros.length;i++){
|
||||
|
||||
heros[i].HeroView.reset()
|
||||
heros[i].HeroView.ent.destroy()
|
||||
|
||||
}
|
||||
for(let i=0;i<hcards.length;i++){
|
||||
hcards[i].HCardComp.reset()
|
||||
@@ -139,38 +177,52 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
}
|
||||
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.2)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("exp").getChildByName("ap").setScale(1,1)
|
||||
},0.2)
|
||||
if(smc.vmdata.mission.exp >= smc.vmdata.mission.exp_max){
|
||||
smc.vmdata.mission.exp-=smc.vmdata.mission.exp_max
|
||||
|
||||
switch(smc.vmdata.mission.mbt){
|
||||
case 1:
|
||||
smc.vmdata.mission.ap+=smc.vmdata.mission.ap_up+MBSet.ap_add
|
||||
this.node.getChildByName("exp").getChildByName("ap").getChildByName("data").setScale(1.3,1.3)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("exp").getChildByName("ap").getChildByName("data").setScale(1,1)
|
||||
},0.2)
|
||||
break;
|
||||
case 2:
|
||||
smc.vmdata.mission.def+=smc.vmdata.mission.def_up+MBSet.def_add
|
||||
this.node.getChildByName("exp").getChildByName("def").getChildByName("data").setScale(1.3,1.3)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("exp").getChildByName("def").getChildByName("data").setScale(1,1)
|
||||
},0.2)
|
||||
break;
|
||||
case 3:
|
||||
smc.vmdata.mission.hp+=smc.vmdata.mission.hp_up+MBSet.hp_add
|
||||
this.node.getChildByName("exp").getChildByName("hp").getChildByName("data").setScale(1.3,1.3)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("exp").getChildByName("hp").getChildByName("data").setScale(1,1)
|
||||
},0.2)
|
||||
break;
|
||||
}
|
||||
}
|
||||
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.2)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("exp").getChildByName("hp").setScale(1,1)
|
||||
},0.2)
|
||||
}
|
||||
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.2)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("mexp").getChildByName("ap").setScale(1,1)
|
||||
},0.2)
|
||||
}
|
||||
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.2)
|
||||
this.scheduleOnce(function(){
|
||||
this.node.getChildByName("mexp").getChildByName("hp").setScale(1,1)
|
||||
},0.2)
|
||||
if(smc.vmdata.mission.m_exp >= smc.vmdata.mission.m_exp_max){
|
||||
smc.vmdata.mission.m_exp-=smc.vmdata.mission.m_exp_max
|
||||
// this.node.getChildByName("mexp").setScale(1.2,1.2)
|
||||
// this.scheduleOnce(function(){
|
||||
// this.node.getChildByName("mexp").setScale(1,1)
|
||||
// },0.2)
|
||||
switch(smc.vmdata.mission.mmbt){
|
||||
case 1:
|
||||
smc.vmdata.mission.map+=smc.vmdata.mission.map_up+MBSet.ap_add
|
||||
break;
|
||||
case 2:
|
||||
smc.vmdata.mission.mdef+=smc.vmdata.mission.mdef_up+MBSet.def_add
|
||||
break;
|
||||
case 3:
|
||||
smc.vmdata.mission.mhp+=smc.vmdata.mission.mhp_up+MBSet.hp_add
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
check_mon_num(){
|
||||
|
||||
Reference in New Issue
Block a user