爵位
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import { RoleModel } from './../../../db/Role';
|
||||
import { HeroModel } from '../../../db/Hero';
|
||||
import { resResult, decodeIdCntArrayStr, parseGoodStr } from '../../../pubUtils/util';
|
||||
import { resResult, decodeIdCntArrayStr, parseGoodStr, reduceCe } from '../../../pubUtils/util';
|
||||
import {Application, BackendSession} from 'pinus';
|
||||
import { handleCost } from '../../../services/rewardService';
|
||||
import { getTitle, getTeraph, gameData, getScollByStar } from '../../../pubUtils/data';
|
||||
@@ -80,6 +80,7 @@ export class RoleHandler {
|
||||
async roleTitleLevelUp(msg: {}, session: BackendSession){
|
||||
let roleId = session.get('roleId');
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
let oldCe = role.ce;
|
||||
let sid: string = session.get('sid');
|
||||
let title = ++role.title;
|
||||
let titleInfo = getTitle(role.title);
|
||||
@@ -92,8 +93,8 @@ export class RoleHandler {
|
||||
if (!result)
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
await RoleModel.updateRoleInfo(roleId, { title });
|
||||
let {ce} = await calAllHeroCe( sid, roleId, 2, [title]);
|
||||
return resResult(STATUS.SUCCESS, { roleId, title, ce});
|
||||
let {ce} = await calAllHeroCe( sid, roleId, HERO_SYSTEM_TYPE.TITLE, [title]);
|
||||
return resResult(STATUS.SUCCESS, { roleId, title, oldCe: reduceCe(oldCe), incRoleCe: ce - reduceCe(oldCe)});
|
||||
}
|
||||
|
||||
//神像强化
|
||||
|
||||
Reference in New Issue
Block a user