pvp排行榜展示
This commit is contained in:
@@ -8,14 +8,14 @@ import { startEvent } from "./eventSercive";
|
||||
|
||||
export async function eventOnPlayerLvUp(roleId: string, lv: number, addFuncs: Array<number>, dataFuncs: Array<number>) {
|
||||
|
||||
// if (!dataFuncs.includes(FUNCS_ID.PVP)) {//开启pvp
|
||||
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);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
if (!dataFuncs.includes(FUNCS_ID.EVENT)) {//开启奇遇
|
||||
let res = getFuncsSwitch(FUNCS_ID.EVENT);
|
||||
|
||||
@@ -242,7 +242,7 @@ export async function defaultHeroes ( role:RoleType, challengeCnt?:number, chall
|
||||
let { heroes } = await PvpDefenseModel.findByRoleId(role.roleId);
|
||||
var orders = [1, 2, 3, 4, 5];
|
||||
heroes.sort(function(a, b) {
|
||||
if (!!a.order) {
|
||||
if (!!a.order&& !!a.hero) {
|
||||
let index = orders.indexOf(a.order);
|
||||
orders.splice(index, 1);
|
||||
}
|
||||
@@ -278,6 +278,7 @@ export async function defaultHeroes ( role:RoleType, challengeCnt?:number, chall
|
||||
}
|
||||
} else {
|
||||
heroes[index].ce = item.ce;
|
||||
heroes[index].hero = item.hero;
|
||||
if (!heroes[index].order) {
|
||||
heroes[index].order = orders[0];
|
||||
orders.splice(0, 1);
|
||||
|
||||
Reference in New Issue
Block a user