战斗经验统一,由站前选择局内buff

This commit is contained in:
2024-12-08 23:29:38 +08:00
parent 59f965dc1c
commit 6d518794f4
12 changed files with 4183 additions and 4161 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -72,22 +72,36 @@ export class SingletonModuleComp extends ecs.Comp {
victory:0,
once:6, //每波刷新怪物数量
total:1, //总怪物数
a_exp:0, //攻击经验
a_up_exp:10,
a_up:5, //每次增加的ap量
ap:0,
h_exp:0, //生命值经验
h_up_exp:10,
h_up:5, //每次增加的hp量
mbt:1, //局内buff类型
mmbt:1,//敌方局内buff类型
exp:0,
exp_max:100,
m_exp:0,
m_exp_max:100,
hp:0,
ma_exp:0, //敌方攻击经验
ma_up_exp:10,
ma_up:5,
map:0,
mh_exp:0, //敌方生命经验
mh_up_exp:10,
mh_up:5,
ap:0,
def:0,
mhp:0,
map:0,
mdef:0,
hp_up:0,
ap_up:0,
def_up:0,
mhp_up:0,
map_up:0,
mdef_up:0,
hp_exp:0,
ap_exp:0,
def_exp:0,
mhp_exp:0,
map_exp:0,
mdef_exp:0,
reward_num:0, //怪物死亡数
reward_gold:0,
reward_exp:0,

View File

@@ -24,3 +24,11 @@ export const MissionReward = {
2:[1001,1002,1003,1004,1005,1006,1021,1022,1023,1024,1025,1026,1027,1028],
3:[1001,1002,1003,1004,1005,1006,1021,1022,1023,1024,1025,1026,1027,1028],
}
export const MBSet = {
ap_exp:10,
def_exp:10,
hp_exp:10,
ap_add:10,
def_add:10,
hp_add:10,
}

View File

@@ -20,15 +20,20 @@ import { Talents } from "./TalentSet"
* uauc 被攻击后增加攻击次数
* cua 暴击后增加攻击
* cuc 暴击后增加攻击次数
* aep 攻击经验
* uaep 受伤经验
* dep 死亡经验
* aexp 攻击经验
* uaexp 受伤经验
* dexp 死亡经验
* sk1 普通攻击,根据星级变化
* sk2 技能,根据星级变化
* sk3 技能,根据星级变化
* pw 能量初始值
* pwm 能量最大值
* pws 能量每秒增值
* apw:攻击能量增值,
* uapw:受伤能量增值,
* cpw:暴击能量增值,
* dopw:闪避能量增值,
* dpw:死亡能量增值,
* akc 攻击触发sk3需要次数
* akr 攻击触发sk3机率
* uac 受伤触发sk3需要次数
@@ -40,22 +45,22 @@ import { Talents } from "./TalentSet"
**/
export const HeroInfo = {
9001: {
uuid:9001,name: "圣盾骑士",path:"k1",type:1,hp: 10, 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,aep:5,uaep:1,cep:10,doep:10,dep:20,sk1:[9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,
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,
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002],sk3:[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],akc:[1,1,1,1,1],uar:[10,20,30,40,50],uac:[1,1,1,1,1],dgr:[10,20,30,40,50],dgc:[1,1,1,1,1],crr:[10,20,30,40,50],crc:[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:9001,name: "狂暴骑士",path:"k2",type:1,hp: 10, 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,aep:5,uaep:1,cep:10,doep:10,dep:20,sk1:[9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,
uuid:9001,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,
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002],sk3:[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],akc:[1,1,1,1,1],uar:[10,20,30,40,50],uac:[1,1,1,1,1],dgr:[10,20,30,40,50],dgc:[1,1,1,1,1],crr:[10,20,30,40,50],crc:[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:9001,name: "防御骑士",path:"k3",type:1,hp: 10, 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,aep:5,uaep:1,cep:10,doep:10,dep:20,sk1:[9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002],sk3:[2002,2002,2002,2002,2002],pw:0,pwm:150,pws:10,apw:0,uapw:0,cpw:0,dpw:0,
uuid:9001,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,
lvexp:0,slvexp:0, speed: 100,aexp:5,uaexp:1,cexp:10,doexp:10,dexp:20,sk1:[9001,9001,9001,9001,9001],sk2:[2002,2002,2002,2002,2002],sk3:[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],akc:[1,1,1,1,1],uar:[10,20,30,40,50],uac:[1,1,1,1,1],dgr:[10,20,30,40,50],dgc:[1,1,1,1,1],crr:[10,20,30,40,50],crc:[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

@@ -69,44 +69,53 @@ export class Hero extends ecs.Entity {
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO){
var hv = node.getComponent(HeroViewComp)!;
// console.log("hero_init",buff)
let HInf= HeroInfo[uuid] // 角色数据
let talent= smc.vmdata.talent
let hero =smc.heros[uuid]
let hero= HeroInfo[uuid] // 共用英雄数据
let talent= smc.vmdata.talent //角色英雄数据
let role =smc.heros[uuid]
let talents=Talents;
hv.scale = scale;
hv.box_group = box_group;
hv.hero_uuid= uuid;
hv.hero_name= HInf.name;
hv.hero_type= HInf.type;
hv.speed =hv.ospeed = HInf.speed;
hv.dis = HInf.dis;
hv.pw = HInf.pw;
hv.pwm= HInf.pwm;
hv.pws= HInf.pws
hv.lv = hero.lv;
hv.slv = hero.slv;
hv.type = HInf.type;
hv.sk1 = HInf.sk1[hero.slv];
hv.sk2 = HInf.sk2[hero.slv];
hv.akc = HInf.akc[hero.slv];
hv.uac = HInf.uac[hero.slv];
hv.crc = HInf.crc[hero.slv];
hv.dgc = HInf.dgc[hero.slv];
hv.akr = HInf.akr[hero.slv];
hv.uar = HInf.uar[hero.slv];
hv.crr = HInf.crr[hero.slv];
hv.dgr = HInf.dgr[hero.slv];
hv.type = HInf.type;
hv.hp= hv.hp_max =HInf.hp+HInf.hp_up*hero.lv ;
hv.ap = HInf.ap+HInf.ap_up*hero.lv ;
hv.def= HInf.def+HInf.def_up*hero.lv;
hv.cd = HInf.a_cd
hv.crit = HInf.crit; //暴击率
hv.crit_add = HInf.crit_add;//暴击伤害加成
hv.dodge = HInf.dodge; //闪避率
hv.aep=HInf.aep;
hv.uaep=HInf.uaep;
hv.dep=HInf.dep;
hv.hero_name= hero.name;
hv.hero_type= hero.type;
hv.speed =hv.ospeed = hero.speed;
hv.dis = hero.dis;
hv.pw = hero.pw;
hv.pwm= hero.pwm;
hv.pws= hero.pws
hv.apw=hero.apw;
hv.uapw=hero.uapw;
hv.cpw=hero.cpw;
hv.dpw=hero.dpw;
hv.dopw=hero.dopw;
hv.lv = role.lv;
hv.slv = role.slv;
hv.type = hero.type;
hv.sk1 = hero.sk1[role.slv];
hv.sk2 = hero.sk2[role.slv];
hv.sk3 = hero.sk3[role.slv];
hv.akc = hero.akc[role.slv];
hv.uac = hero.uac[role.slv];
hv.crc = hero.crc[role.slv];
hv.dgc = hero.dgc[role.slv];
hv.akr = hero.akr[role.slv];
hv.uar = hero.uar[role.slv];
hv.crr = hero.crr[role.slv];
hv.dgr = hero.dgr[role.slv];
hv.type = hero.type;
hv.hp= hv.hp_max =hero.hp+hero.hp_up*role.lv ;
hv.ap = hero.ap+hero.ap_up*role.lv ;
hv.def= hero.def+hero.def_up*role.lv;
hv.cd = hero.a_cd
hv.crit = hero.crit; //暴击率
hv.crit_add = hero.crit_add;//暴击伤害加成
hv.dodge = hero.dodge; //闪避率
hv.aexp=hero.aexp;
hv.uaexp=hero.uaexp;
hv.cexp=hero.cexp
hv.doexp=hero.doexp
hv.dexp=hero.dexp;
this.add(hv);
}

View File

@@ -60,10 +60,16 @@ export class HeroViewComp extends CCComp {
pw: number = 0; /**能量**/
pwm: number = 15; /** 能量最大值 */
pws: number = 1; //能量回复速度每0.1秒回复量
apw:number=0;
uapw:number=0;
cpw:number=0;
dopw:number=0;
dpw:number=0;
pwt:Timer = new Timer(1); //计时器
sk1:number = 9001;
sk2:number = 1001;
sk3:number = 1001;
akr:number=0; //攻击触发机率
uar:number=0; //受伤触发机率
dgr:number=0; //闪避触发机率
@@ -72,9 +78,12 @@ export class HeroViewComp extends CCComp {
uac:number=0; //受伤次数触发
dgc:number=0; //闪避次数触发
crc:number=0; //暴击次数触发
aep:number=0;
uaep:number=0;
dep:number=0;
aexp:number=0; //攻击经验
uaexp:number=0; //受伤经验
cexp:number=0; //暴击经验 */
doexp:number=0; //闪避经验 */
dexp:number=0; //死亡经验 */
ap: number = 10; /**攻击力 */
ap_buff: number = 0;
@@ -153,28 +162,8 @@ export class HeroViewComp extends CCComp {
if(selfCollider.group != otherCollider.group){
let skill = otherCollider.node.getComponent(SkillCom)!;
// console.log('onPostSolve',skill);
if(this.hp <= 0 ){
return
}
if(this.shield > 0){
this.shield -= 1
if(this.shield <= 0){
this.shield = 0
this.node.getChildByName("shielded").active = false
}
return
}
if(this.check_dodge()) return
this.in_atked();
let l_hp=(skill.ap-this.def)*-1
if(skill.is_crit){
l_hp = l_hp * (150+skill.crit_add)/100
}
if(l_hp >= 0){
l_hp=-1 //最低1点伤害
}
this.hp_change(l_hp,skill.is_crit);
if(this.hp <= 0 ) return
this.check_uatk(skill);
}
}
@@ -258,6 +247,7 @@ export class HeroViewComp extends CCComp {
this.is_atking=false
}
}
//进入墓地
to_grave(){
let pos =v3(-999,this.node.position.y)
if(this.box_group == BoxSet.MONSTER){
@@ -265,9 +255,11 @@ export class HeroViewComp extends CCComp {
}
this.node.setPosition(pos)
}
//是否在墓地
in_grave(){
return this.node.position.x < -900 || this.node.position.x > 900;
}
//状态切换
status_change(type:string){
this.status=type
if(type == "idle"){
@@ -279,6 +271,7 @@ export class HeroViewComp extends CCComp {
// this.as.change_default("move")
}
}
//移动
move(dt: number){
if(this.stop_cd > 0||smc.vmdata.mission.is_victory||smc.vmdata.mission.is_defeat){
this.status_change("idle")
@@ -328,6 +321,27 @@ export class HeroViewComp extends CCComp {
return {pos,t_pos}
}
//受伤判断
check_uatk(skill:any){
if(this.shield > 0){
this.shield -= 1
if(this.shield <= 0){
this.shield = 0
this.node.getChildByName("shielded").active = false
}
return
}
if(this.check_dodge()) return
this.in_atked();
let l_hp=(skill.ap-this.def)*-1
if(skill.is_crit){
l_hp = l_hp * (150+skill.crit_add)/100
}
if(l_hp >= 0){
l_hp=-1 //最低1点伤害
}
this.hp_change(l_hp,skill.is_crit);
}
//能量判断
check_power(){
if(this.pw >= this.pwm){
@@ -348,6 +362,8 @@ export class HeroViewComp extends CCComp {
if(i < this.crit){
this.tooltip(5,"*会心一击*");
this.crit_count += 1
this.exp_add(this.cexp) // 暴击经验
this.power_add(this.cpw)
return true
}else{
return false
@@ -359,6 +375,8 @@ export class HeroViewComp extends CCComp {
if(i < this.dodge){
console.log("闪避触发: i="+i+":dodge="+this.dodge);
this.tooltip(5,"闪避");
this.exp_add(this.doexp) // 闪避经验
this.power_add(this.dopw)
this.dodge_count += 1
return true
}else{
@@ -377,7 +395,7 @@ export class HeroViewComp extends CCComp {
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.handle_skill(this.sk2)
this.handle_skill(this.sk3)
}
}
if(this.dodge_count >= this.dgc){
@@ -391,7 +409,7 @@ export class HeroViewComp extends CCComp {
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.handle_skill(this.sk2)
this.handle_skill(this.sk3)
}
}
if(this.crit_count >= this.crc){
@@ -400,12 +418,13 @@ export class HeroViewComp extends CCComp {
let i = RandomManager.instance.getRandomInt(0,100,3)
// console.log("暴击判断: i="+i+":crr="+this.crr);
if(i < this.crr){
// console.log("闪避触发: i="+i+":crr="+this.crr);
// console.log("暴击触发: i="+i+":crr="+this.crr);
this.node.getChildByName("max").active=true
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.handle_skill(this.sk2)
this.handle_skill(this.sk3)
}
}
if(this.atked_count >= this.uac){
@@ -418,7 +437,7 @@ export class HeroViewComp extends CCComp {
this.scheduleOnce(()=>{
this.node.getChildByName("max").active=false
},0.8)
this.handle_skill(this.sk2)
this.handle_skill(this.sk3)
}
}
}
@@ -427,7 +446,8 @@ export class HeroViewComp extends CCComp {
if(this.is_atking){
this.at = 0;
this.atk_count++
this.exp_add(this.aep)
this.exp_add(this.aexp) //攻击经验
this.power_add(this.apw)
// console.log("cd:"+this.cd);
this.as.atk();
this.scheduleOnce(()=>{
@@ -436,24 +456,17 @@ export class HeroViewComp extends CCComp {
}
}
}
exp_add(exp:number){
exp_add(exp:number=0){
if(this.box_group==BoxSet.HERO){
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.a_exp +=exp
smc.vmdata.mission.h_exp +=exp
}
smc.vmdata.mission.exp +=exp
}
if(this.box_group==BoxSet.MONSTER){
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.ma_exp +=exp
smc.vmdata.mission.mh_exp +=exp
}
smc.vmdata.mission.m_exp +=exp
}
}
power_add(p:number){
this.pw+= p
}
//使用max_skill
handle_skill(skill:number){
this.as.max()
@@ -678,7 +691,8 @@ export class HeroViewComp extends CCComp {
node.parent = this.node;
// this.as.atked();
this.atked_count++;
this.exp_add(this.uaep)
this.exp_add(this.uaexp)
this.power_add(this.uapw)
}
dead(){
var path = "game/skills/dead";
@@ -687,7 +701,8 @@ export class HeroViewComp extends CCComp {
let pos = v3(this.node.position.x,this.node.position.y+30,this.node.position.z);
node.parent = this.node.parent;
node.setPosition(pos);
this.exp_add(this.dep)
this.exp_add(this.dexp)
this.power_add(this.dpw)
}
toDestroy(){

View File

@@ -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})
}

View File

@@ -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;
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "96c600ef-79ab-4952-a5c8-a3bbc7a7d15f",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -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(){