属性:次级属性102特殊处理

This commit is contained in:
luying
2021-03-04 15:33:24 +08:00
parent 0966f025cf
commit 41f65eadd0
3 changed files with 15 additions and 15 deletions
+8 -11
View File
@@ -24,9 +24,9 @@ import { STATUS, HERO_SYSTEM_TYPE } from '@consts';
import { ITID, COUNTER } from '@consts';
import { ItemModel } from '@db/Item';
import { gameData, getHeroExpByLv } from '@pubUtils/data';
import { calPlayerCeAndSave, calculatetopLineup, calEquipSeids, initRoleAtrr } from '@pubUtils/playerCe';
import { calPlayerCeAndSave, calculatetopLineup, calEquipSeids } from '@pubUtils/playerCe';
import { SchoolModel } from '@db/School';
import { CeAttrNumber } from '@domain/roleField/attribute';
import { Attribute } from '@domain/roleField/attribute';
import { smsModel } from '@db/Sms';
import { isString } from 'underscore';
import { FriendShipModel } from '@db/FriendShip';
@@ -436,22 +436,19 @@ export default class GMUsers extends Service {
if(!hero || !role) {
return ctx.service.utils.resResult(STATUS.GM_HERO_NOT_FOUND);
}
let { lv, ce, ceAttr } = hero;
let { globalCeAttr } = role;
let { lv, ce, attr: heroAttrs } = hero;
let { attr: roleAttrs } = role;
let dicHero = ctx.service.utils.getHeroById(hid);
let attribute = new CeAttrNumber();
for(let attrName in attribute) {
let { base, ratioUp, fixUp, equipUp } = ceAttr[attrName];
let { ratioUp: ratioUp2, fixUp: fixUp2 } = globalCeAttr[attrName];
attribute[attrName] += base * ( 1 + ratioUp + ratioUp2) + fixUp + fixUp2 + equipUp;
}
let attribute = new Attribute();
attribute.setByDbData(roleAttrs, heroAttrs);
let heroInfo = {
actorId: dicHero.heroId,
actorName: dicHero.name,
attribute: {...attribute, speed: 0, ap: 0}, lv,
attribute, lv,
ce
};