爵位
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { STATUS } from '../../../consts/statusCode';
|
import { STATUS } from '../../../consts/statusCode';
|
||||||
import { RoleModel } from './../../../db/Role';
|
import { RoleModel } from './../../../db/Role';
|
||||||
import { HeroModel } from '../../../db/Hero';
|
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 {Application, BackendSession} from 'pinus';
|
||||||
import { handleCost } from '../../../services/rewardService';
|
import { handleCost } from '../../../services/rewardService';
|
||||||
import { getTitle, getTeraph, gameData, getScollByStar } from '../../../pubUtils/data';
|
import { getTitle, getTeraph, gameData, getScollByStar } from '../../../pubUtils/data';
|
||||||
@@ -80,6 +80,7 @@ export class RoleHandler {
|
|||||||
async roleTitleLevelUp(msg: {}, session: BackendSession){
|
async roleTitleLevelUp(msg: {}, session: BackendSession){
|
||||||
let roleId = session.get('roleId');
|
let roleId = session.get('roleId');
|
||||||
let role = await RoleModel.findByRoleId(roleId);
|
let role = await RoleModel.findByRoleId(roleId);
|
||||||
|
let oldCe = role.ce;
|
||||||
let sid: string = session.get('sid');
|
let sid: string = session.get('sid');
|
||||||
let title = ++role.title;
|
let title = ++role.title;
|
||||||
let titleInfo = getTitle(role.title);
|
let titleInfo = getTitle(role.title);
|
||||||
@@ -92,8 +93,8 @@ export class RoleHandler {
|
|||||||
if (!result)
|
if (!result)
|
||||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||||
await RoleModel.updateRoleInfo(roleId, { title });
|
await RoleModel.updateRoleInfo(roleId, { title });
|
||||||
let {ce} = await calAllHeroCe( sid, roleId, 2, [title]);
|
let {ce} = await calAllHeroCe( sid, roleId, HERO_SYSTEM_TYPE.TITLE, [title]);
|
||||||
return resResult(STATUS.SUCCESS, { roleId, title, ce});
|
return resResult(STATUS.SUCCESS, { roleId, title, oldCe: reduceCe(oldCe), incRoleCe: ce - reduceCe(oldCe)});
|
||||||
}
|
}
|
||||||
|
|
||||||
//神像强化
|
//神像强化
|
||||||
|
|||||||
@@ -862,6 +862,7 @@ function calTitle(args: Array<number>, ceAttr: CeAttrRole) {
|
|||||||
}
|
}
|
||||||
for (let attr of titleInfo.assiAttrValue) {
|
for (let attr of titleInfo.assiAttrValue) {
|
||||||
let attrName = getAtrrNameById(attr.id);
|
let attrName = getAtrrNameById(attr.id);
|
||||||
|
if (!attrName) continue;
|
||||||
res[attrName] = res[attrName] || { fixUp: ceAttr[attrName].fixUp, ratioUp: ceAttr[attrName].ratioUp };
|
res[attrName] = res[attrName] || { fixUp: ceAttr[attrName].fixUp, ratioUp: ceAttr[attrName].ratioUp };
|
||||||
res[attrName].ratioUp += attr.number * HERO_CE_RATIO;
|
res[attrName].ratioUp += attr.number * HERO_CE_RATIO;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user