武将养成
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import {Application, BackendSession, createTcpMailBox, ChannelService} from 'pinus';
|
||||
import { handleCost } from '../../../services/rewardService';
|
||||
import { calPlayerCeAndSave } from '../../../services/playerCeService';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
|
||||
import {HeroModel} from '../../../db/Hero';
|
||||
import { getJobInfoById, getMaxGradeByjobClass , updateHeroInfo} from '../../../pubUtils/gamedata';
|
||||
export default function(app: Application) {
|
||||
return new HeroHandler(app);
|
||||
}
|
||||
@@ -74,5 +76,49 @@ export class HeroHandler {
|
||||
// 升品,满品3级
|
||||
// handleCost
|
||||
}
|
||||
//训练 TODO
|
||||
async heroJobTrain (msg: {hid:number}, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
let { hid } = msg;
|
||||
let hero = await HeroModel.findByHidAndRole(hid, roleId);
|
||||
if (!hero)
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
let heroJob = getJobInfoById(hero.job);
|
||||
if (hero.jobStage >= 6)
|
||||
return resResult(STATUS.HERO_JOB_STAGE_REACH_MAX_STAGE);
|
||||
if (hero.job >= getMaxGradeByjobClass(heroJob.job_class))
|
||||
return resResult(STATUS.HERO_JOB_REACH_MAX_STAGE);
|
||||
//消耗物品TODO
|
||||
|
||||
hero.jobStage = hero.jobStage ++;
|
||||
//重算战力并下发
|
||||
let sid: string = session.get('sid');
|
||||
let heros = await calPlayerCeAndSave(sid, roleId, [hero]);
|
||||
return resResult(STATUS.SUCCESS, { hid : heros[0].hid, job : heros[0].job, jobStage : heros[0].jobStage});
|
||||
}
|
||||
//进阶 TODO
|
||||
async heroJobStageUp() {
|
||||
|
||||
}
|
||||
|
||||
//激活羁绊 TODO
|
||||
async heroConectionActivate() {
|
||||
|
||||
}
|
||||
|
||||
//赠送(包括一键赠送)TODO
|
||||
async heroGiveFavor() {
|
||||
|
||||
}
|
||||
|
||||
//购买时装
|
||||
async buyHeroSkin() {
|
||||
|
||||
}
|
||||
|
||||
//穿带时装
|
||||
async heroWearSkin() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user