pvp保存阵容
This commit is contained in:
@@ -16,7 +16,7 @@ import { DicRandomEffectPool } from './dictionary/DicRandomEffectPool';
|
||||
import { getGoodById } from './gamedata';
|
||||
import { SchoolModel } from '../db/School';
|
||||
import { getTeraphAttr, HEROTARIN } from '../consts/constModules/abilityConst'
|
||||
import { PvpDefenseModel } from '../db/PvpDefense';
|
||||
// import { PvpDefenseModel } from '../db/PvpDefense';
|
||||
const HERO_CE_RATIO = 100;
|
||||
const _ = require('underscore');
|
||||
//战力计算TODO
|
||||
@@ -108,7 +108,7 @@ export async function calPlayerCeAndSave(roleId: string, heros: Array<HeroType>,
|
||||
incPlayerCe += incHeroCe;
|
||||
await calculateTopFive(role, hero.hid, hero.ce, hero._id); // 计算更新最强五人战力
|
||||
await HeroModel.updateHeroInfo(roleId, hero.hid, hero);
|
||||
await PvpDefenseModel.updateCe(roleId, hero.hid, hero.ce); // 更新pvp防守阵最强五人战力
|
||||
//await PvpDefenseModel.updateCe(roleId, hero.hid, hero.ce); // 更新pvp防守阵最强五人战力
|
||||
pushHeros.push({
|
||||
hid: hero.hid,
|
||||
ce: reduceCe(hero.ce),
|
||||
@@ -152,7 +152,6 @@ async function calculateTopFive(role: RoleType, hid: number, ce: number, heroId:
|
||||
|
||||
role.topFive = topFive;
|
||||
role.topFiveCe = topFiveCe;
|
||||
|
||||
return role;
|
||||
}
|
||||
|
||||
|
||||
@@ -496,7 +496,7 @@ export function reduceCe(ce: number = 0) {
|
||||
}
|
||||
|
||||
export function getRandNum(min, max) {
|
||||
let randNum = min + Math.floor(Math.random()*(max - min + 1));
|
||||
let randNum = min + Math.floor(Math.random() * (max - min + 1));
|
||||
return randNum;
|
||||
}
|
||||
|
||||
@@ -516,10 +516,10 @@ export function getRandomArr(allarr, ranNum) {
|
||||
|
||||
|
||||
// 获取全部属性
|
||||
export function getAllAttrStage () {
|
||||
export function getAllAttrStage() {
|
||||
let attrs = new Array<number>(); // 有升级的属性 1-hp 2-atk 3-def 4-mdef 5-agi 6-luk
|
||||
for(let stage = ABI_STAGE.START + 1; stage <= ABI_STAGE.END; stage++) {
|
||||
attrs.push(stage)
|
||||
for (let stage = ABI_STAGE.START + 1; stage <= ABI_STAGE.END; stage++) {
|
||||
attrs.push(stage)
|
||||
};
|
||||
return attrs;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user