pvp创建获取

This commit is contained in:
mamengke01
2021-01-06 16:05:15 +08:00
parent d2f76c9198
commit a785a4733a
17 changed files with 189 additions and 71 deletions

View File

@@ -0,0 +1,19 @@
/**
* 体力系统
*/
import { fromCallback } from 'bluebird';
import { checkPvp } from '../pubUtils/pvpUtil'
import { getFuncsSwitch } from '../pubUtils/data';
import { FUNCS_ID, FUNC_OPT_TYPE } from '../consts/constModules/sysConst';
import { RoleModel } from '../db/Role'
export async function eventOnPlayerLvUp(roleId: string, lv: number, addFuncs: Array<number>, dataFuncs: Array<number>) {
if (!dataFuncs.includes(FUNCS_ID.PVP)) {//开启pvp
let res = getFuncsSwitch(FUNCS_ID.PVP);
if (!res || lv >= res.param) {
let role = await RoleModel.findByRoleId(roleId);
await checkPvp(role);
addFuncs.push(FUNCS_ID.PVP);
}
}
}