pvp数据结构上传

This commit is contained in:
mamengke01
2021-01-05 13:58:27 +08:00
parent 39cc099f43
commit 5cf6905b89
5 changed files with 44 additions and 13 deletions

View File

@@ -0,0 +1,13 @@
import {Application, BackendSession} from 'pinus';
const _ = require('underscore');
export default function(app: Application) {
return new PvpHandler(app);
}
export class PvpHandler {
constructor(private app: Application) {
}
}

View File

@@ -70,11 +70,11 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
if(resultRange.length > 0) {
let index = Math.floor(Math.random() * resultRange.length);
let result = resultRange[index];
let {roleId, heroes, ce } = result;
let {roleId, heroes, defCe } = result;
enemyObj.enemyFrom = 1;
enemyObj.enemyId = roleId;
enemyObj.ce = ce;
enemyObj.ce = defCe;
let heroIndex = 0;
for(let enemy of dicWarJson) {