全局:属性修改

This commit is contained in:
luying
2021-03-04 15:33:24 +08:00
parent d4561c2e3d
commit 0966f025cf
35 changed files with 1186 additions and 1130 deletions
+7 -10
View File
@@ -3,9 +3,9 @@ import { ExpeditionPointModel } from '../db/ExpeditionPoint';
import Role, { RoleModel, RoleType } from '../db/Role';
import { PvpDefenseModel } from '../db/PvpDefense';
import { getWarJsons, getGamedata, getExpeditionById } from '../pubUtils/gamedata';
import { decodeStr, resResult, shouldRefresh } from '../pubUtils/util';
import { EXPEDITION_CONST, HERO_CE_RATIO, getAttrCeRatio } from '../consts';
import { getWarJsons, getGamedata } from '../pubUtils/gamedata';
import { decodeStr, shouldRefresh } from '../pubUtils/util';
import { EXPEDITION_CONST, HERO_CE_RATIO } from '../consts';
import { getAtrrNameById} from '../consts';
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
import { HeroType } from '../db/Hero';
@@ -75,7 +75,7 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
let result = resultRange[index];
let {roleId, heroes, defCe } = result;
let role = <RoleType>result.role;
let { globalCeAttr } = role;
let { attr: roleAttrs } = role;
enemyObj.enemyFrom = 1;
enemyObj.enemyId = roleId;
@@ -87,9 +87,9 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
let hero = heroes[heroIndex];
if(hero) {
let h = <HeroType>hero.hero;
let { star, lv, ceAttr } = h;
let { star, lv, attr: heroAttrs } = h;
let dicHero = gameData.hero.get(hero.actorId);
let newAttribute = getPlayerAttribute(ceAttr, globalCeAttr);
let newAttribute = getPlayerAttribute(heroAttrs, roleAttrs);
let heroInfo = {
actorId: hero.actorId,
actorName: dicHero.name,
@@ -127,10 +127,7 @@ export async function matchRobots(scale: number, myCe: number, robotCe: number,
const { attribute } = json;
let newAttribute = getRobotAttribute(attribute, myCe, robotCe, scale);
let ce = 0;
for(let attrName in newAttribute) {
ce += newAttribute[attrName] * getAttrCeRatio(attrName)||0;
}
let ce = newAttribute.calCe();
enemyObj.enemies.push({...json, attribute: newAttribute, lv});
allCe += ce;
}