diff --git a/gm-server/app/service/users.ts b/gm-server/app/service/users.ts index 3d34079ec..fabac2afa 100644 --- a/gm-server/app/service/users.ts +++ b/gm-server/app/service/users.ts @@ -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 }; diff --git a/shared/pubUtils/dictionary/DicTitle.ts b/shared/pubUtils/dictionary/DicTitle.ts index 1e47f2dca..b9fd3c5a0 100644 --- a/shared/pubUtils/dictionary/DicTitle.ts +++ b/shared/pubUtils/dictionary/DicTitle.ts @@ -1,6 +1,6 @@ // 物品表 import { decodeArrayListStr, readJsonFile, parseGoodStr } from '../util' -import { FILENAME, ABI_STAGE, ABI_TYPE_TO_STAGE, ABI_TYPE} from '../../consts' +import { FILENAME, ABI_TYPE} from '../../consts' const _ = require('lodash'); export interface SpecialMaterial { diff --git a/shared/pubUtils/playerCe.ts b/shared/pubUtils/playerCe.ts index 1bd217fa2..3ca980812 100644 --- a/shared/pubUtils/playerCe.ts +++ b/shared/pubUtils/playerCe.ts @@ -2,7 +2,7 @@ * 体力系统 */ -import { HERO_SYSTEM_TYPE, ABI_TYPE } from '../consts'; +import { HERO_SYSTEM_TYPE, ABI_TYPE, HERO_CE_RATIO, HERO_SUB_ATTR_RATIO } from '../consts'; import { deepCopy, getAllAttrStage, reduceCe } from './util'; import { HeroModel, HeroType, HeroUpdate } from '../db/Hero'; @@ -16,7 +16,6 @@ import { DicRandomEffectPool } from './dictionary/DicRandomEffectPool'; import { SchoolModel } from '../db/School'; import { ABI_TYPE_TO_STAGE, ABI_TYPE_MAIN } from '../consts/constModules/abilityConst' import { PvpDefenseModel } from '../db/PvpDefense'; -const HERO_CE_RATIO = 100; import { findIndex } from 'underscore'; import { GuildModel } from '../db/Guild'; import { DicJob } from './dictionary/DicJob'; @@ -792,7 +791,11 @@ function addSeidEffect(heroAttrs: CeAttrData[], addSeidList: Array, remo if (type == SEID_TYPE.TYPE101) { // 加值 updateHeroAttr(heroAttrs, ability, { inc: {fixUp: value * multi * HERO_CE_RATIO} }); } else if (type == SEID_TYPE.TYPE102) { // 加百分比 - updateHeroAttr(heroAttrs, ability, { inc: {ratioUp: value * multi} }); + if(ABI_TYPE_MAIN.includes(ability)) { + updateHeroAttr(heroAttrs, ability, { inc: {ratioUp: value * multi} }); + } else { // 次级属性102特殊处理 + updateHeroAttr(heroAttrs, ability, { inc: {fixUp: value * multi * HERO_SUB_ATTR_RATIO } }); + } } } }