23 lines
785 B
TypeScript
23 lines
785 B
TypeScript
/**
|
|
* 体力系统
|
|
*/
|
|
|
|
import { pinus } from 'pinus';
|
|
import { STATUS } from '../consts/statusCode';
|
|
|
|
import { resResult } from '../pubUtils/util';
|
|
import { calPlayerCeAndSave as pubCalPlayerCeAndSave } from '../pubUtils/playerCe';
|
|
import { HeroType } from '../db/Hero';
|
|
const _ = require('underscore');
|
|
|
|
|
|
//修改并下发战力
|
|
export async function calPlayerCeAndSave(sid: string, roleId: string, heros: Array<HeroType>, type?: number, args?: Array<number>) {
|
|
let {role, pushHeros} = await pubCalPlayerCeAndSave(roleId, heros, type, args);
|
|
|
|
//下发战力
|
|
let uids = [{ uid: roleId, sid }];
|
|
pinus.app.get('channelService').pushMessageByUids('onPlayerCeUpdate', resResult(STATUS.SUCCESS, { ce: role.ce, heros: pushHeros, topFiveCe: 0 }), uids);
|
|
return heros;
|
|
}
|