好友:玩家武将详细信息

This commit is contained in:
luying
2021-02-04 13:57:58 +08:00
parent 50a472d8a5
commit aaeaf87324
21 changed files with 411 additions and 303 deletions
+16 -3
View File
@@ -1,7 +1,7 @@
import { PvpDefenseModel, Heroes, OppPlayers, Robot, PvpDefenseType, HeroScores, pvpUpdateInter } from '../db/PvpDefense';
import { RoleType, RoleModel } from '../db/Role';
import { PVP_HERO_POS, ROBOT_NAME, REDIS_KEY, PVP_CONST } from '../consts';
import { PVP_HERO_POS, ROBOT_NAME, REDIS_KEY, PVP_CONST, HERO_CE_RATIO } from '../consts';
import { setPvpDefResult } from '../services/timeTaskService';
import { dicPvpOpponent, DicPvpOpponent } from "../pubUtils/dictionary/DicPvpOpponent";
import { getRandomIndexByLen, genCode, getRandomByLen, shouldRefresh, reduceCe, getChineseName } from '../pubUtils/util';
@@ -14,7 +14,8 @@ import { setRank, getMyRank, getFieldByRank } from './redisService';
import { nowSeconds, checkTodayTime } from '../pubUtils/timeUtil';
import { HeroesRecord } from '../db/PvpRecord';
import { HeroModel, HeroType } from '../db/Hero';
import { CeAttrNumber, CeAttr, CeAttrRole, PvpEnemies, PvpHeroInfo, PvpOtherHeroes } from '../db/generalField';
import { CeAttrNumber, CeAttr, CeAttrRole, MainAttrNumber } from '../domain/roleField/attribute';
import { PvpEnemies, PvpHeroInfo, PvpOtherHeroes } from '../domain/dbGeneral';
import { DicWarJson } from '../pubUtils/dictionary/DicWarJson';
import { findWhere, findIndex } from 'underscore';
import { pinus } from 'pinus';
@@ -509,7 +510,7 @@ export function getPlayerAttribute(ceAttr: CeAttr, globalCeAttr: CeAttrRole) {
for(let attrName in newAttribute) {
let { base, ratioUp, fixUp, equipUp } = ceAttr[attrName];
let { ratioUp: ratioUp2, fixUp: fixUp2 } = globalCeAttr[attrName];
let result = base * ( 100 + ratioUp + ratioUp2) + (fixUp + fixUp2 + equipUp) *100;
let result = base * ( HERO_CE_RATIO + ratioUp + ratioUp2) + (fixUp + fixUp2 + equipUp) * HERO_CE_RATIO;
newAttribute[attrName] += reduceCe(result);
}
newAttribute['speed'] = 0;
@@ -518,6 +519,18 @@ export function getPlayerAttribute(ceAttr: CeAttr, globalCeAttr: CeAttrRole) {
return newAttribute;
}
/**
* @description 根据玩家数据获取到他的主属性
* @param ceAttr
* @param globalCeAttr
*/
export function getPlayerMainAttribute(ceAttr: CeAttr, globalCeAttr: CeAttrRole) {
let attribute = getPlayerAttribute(ceAttr, globalCeAttr);
let mainAttributes = new MainAttrNumber(attribute);
return mainAttributes;
}
// 获取我方战报记录
export async function generMyRecInfo(heroScores: HeroScores[], winStreakNum: number, role: RoleType, isSuccess: boolean, pos: number, myHeroes: pvpEndParamInter[]) {