fix 训练
This commit is contained in:
@@ -280,14 +280,19 @@ export class HeroHandler {
|
||||
return resResult(STATUS.HERO_JOB_STAGE_REACH_MAX_STAGE);
|
||||
if (hero.job >= getMaxGradeByjobClass(heroJob.job_class))
|
||||
return resResult(STATUS.HERO_JOB_REACH_MAX_STAGE);
|
||||
let result = await handleCost(roleId, sid, heroJob.trainingConsume);
|
||||
|
||||
let consume = new Array<RewardInter>();
|
||||
if(heroJob.trainingConsume[hero.jobStage]) {
|
||||
consume.push(heroJob.trainingConsume[hero.jobStage]);
|
||||
}
|
||||
let result = await handleCost(roleId, sid, consume);
|
||||
if(!result) {
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
}
|
||||
hero.jobStage = hero.jobStage ++;
|
||||
hero.jobStage = hero.jobStage +1;
|
||||
//重算战力并下发
|
||||
let heros = await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.TRAIN);
|
||||
return resResult(STATUS.SUCCESS, { hid : heros[0].hid, job : heros[0].job, jobStage: heros[0].jobStage});
|
||||
return resResult(STATUS.SUCCESS, { curHero: {hid : heros[0].hid, job : heros[0].job, jobStage: heros[0].jobStage}});
|
||||
}
|
||||
|
||||
//进阶
|
||||
@@ -313,7 +318,7 @@ export class HeroHandler {
|
||||
hero.jobStage = 0;
|
||||
//重算战力并下发
|
||||
let heros = await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.STAGEUP, [curJob]);
|
||||
return resResult(STATUS.SUCCESS, { hid : heros[0].hid, job : heros[0].job, jobStage : heros[0].jobStage});
|
||||
return resResult(STATUS.SUCCESS, { curHero: {hid : heros[0].hid, job : heros[0].job, jobStage : heros[0].jobStage}});
|
||||
}
|
||||
|
||||
//激活羁绊
|
||||
@@ -362,7 +367,7 @@ export class HeroHandler {
|
||||
}
|
||||
//重算战力并下发
|
||||
let heros = await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.CONNECT, [shipId, level]);
|
||||
return resResult(STATUS.SUCCESS, { hid : heros[0].hid, connections : heros[0].connections});
|
||||
return resResult(STATUS.SUCCESS, { curHero: {hid : heros[0].hid, connections : heros[0].connections}});
|
||||
}
|
||||
|
||||
//赠送(包括一键赠送)
|
||||
@@ -407,7 +412,7 @@ export class HeroHandler {
|
||||
} else {
|
||||
await HeroModel.updateHeroInfo(roleId, hero.hid, hero);
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { hid : hero.hid, favour : hero.favour, favourLv : hero.favourLv});
|
||||
return resResult(STATUS.SUCCESS, { curHero: {hid : hero.hid, favour : hero.favour, favourLv : hero.favourLv}});
|
||||
}
|
||||
|
||||
//穿带时装
|
||||
@@ -441,7 +446,7 @@ export class HeroHandler {
|
||||
return resResult(STATUS.HERO_SKIN_NOT_FIND);
|
||||
}
|
||||
await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.SKIN, [id, lastSkinId]);
|
||||
return resResult(STATUS.SUCCESS, { hid : hero.hid, skins : hero.skins});
|
||||
return resResult(STATUS.SUCCESS, {curHero: {hid : hero.hid, skins : hero.skins} });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user