属性:次级属性102特殊处理
This commit is contained in:
@@ -24,9 +24,9 @@ import { STATUS, HERO_SYSTEM_TYPE } from '@consts';
|
|||||||
import { ITID, COUNTER } from '@consts';
|
import { ITID, COUNTER } from '@consts';
|
||||||
import { ItemModel } from '@db/Item';
|
import { ItemModel } from '@db/Item';
|
||||||
import { gameData, getHeroExpByLv } from '@pubUtils/data';
|
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 { SchoolModel } from '@db/School';
|
||||||
import { CeAttrNumber } from '@domain/roleField/attribute';
|
import { Attribute } from '@domain/roleField/attribute';
|
||||||
import { smsModel } from '@db/Sms';
|
import { smsModel } from '@db/Sms';
|
||||||
import { isString } from 'underscore';
|
import { isString } from 'underscore';
|
||||||
import { FriendShipModel } from '@db/FriendShip';
|
import { FriendShipModel } from '@db/FriendShip';
|
||||||
@@ -436,22 +436,19 @@ export default class GMUsers extends Service {
|
|||||||
if(!hero || !role) {
|
if(!hero || !role) {
|
||||||
return ctx.service.utils.resResult(STATUS.GM_HERO_NOT_FOUND);
|
return ctx.service.utils.resResult(STATUS.GM_HERO_NOT_FOUND);
|
||||||
}
|
}
|
||||||
let { lv, ce, ceAttr } = hero;
|
let { lv, ce, attr: heroAttrs } = hero;
|
||||||
let { globalCeAttr } = role;
|
let { attr: roleAttrs } = role;
|
||||||
|
|
||||||
|
|
||||||
let dicHero = ctx.service.utils.getHeroById(hid);
|
let dicHero = ctx.service.utils.getHeroById(hid);
|
||||||
|
|
||||||
let attribute = new CeAttrNumber();
|
let attribute = new Attribute();
|
||||||
for(let attrName in attribute) {
|
attribute.setByDbData(roleAttrs, heroAttrs);
|
||||||
let { base, ratioUp, fixUp, equipUp } = ceAttr[attrName];
|
|
||||||
let { ratioUp: ratioUp2, fixUp: fixUp2 } = globalCeAttr[attrName];
|
|
||||||
attribute[attrName] += base * ( 1 + ratioUp + ratioUp2) + fixUp + fixUp2 + equipUp;
|
|
||||||
}
|
|
||||||
let heroInfo = {
|
let heroInfo = {
|
||||||
actorId: dicHero.heroId,
|
actorId: dicHero.heroId,
|
||||||
actorName: dicHero.name,
|
actorName: dicHero.name,
|
||||||
attribute: {...attribute, speed: 0, ap: 0}, lv,
|
attribute, lv,
|
||||||
ce
|
ce
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// 物品表
|
// 物品表
|
||||||
import { decodeArrayListStr, readJsonFile, parseGoodStr } from '../util'
|
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');
|
const _ = require('lodash');
|
||||||
|
|
||||||
export interface SpecialMaterial {
|
export interface SpecialMaterial {
|
||||||
|
|||||||
@@ -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 { deepCopy, getAllAttrStage, reduceCe } from './util';
|
||||||
import { HeroModel, HeroType, HeroUpdate } from '../db/Hero';
|
import { HeroModel, HeroType, HeroUpdate } from '../db/Hero';
|
||||||
@@ -16,7 +16,6 @@ import { DicRandomEffectPool } from './dictionary/DicRandomEffectPool';
|
|||||||
import { SchoolModel } from '../db/School';
|
import { SchoolModel } from '../db/School';
|
||||||
import { ABI_TYPE_TO_STAGE, ABI_TYPE_MAIN } from '../consts/constModules/abilityConst'
|
import { ABI_TYPE_TO_STAGE, ABI_TYPE_MAIN } from '../consts/constModules/abilityConst'
|
||||||
import { PvpDefenseModel } from '../db/PvpDefense';
|
import { PvpDefenseModel } from '../db/PvpDefense';
|
||||||
const HERO_CE_RATIO = 100;
|
|
||||||
import { findIndex } from 'underscore';
|
import { findIndex } from 'underscore';
|
||||||
import { GuildModel } from '../db/Guild';
|
import { GuildModel } from '../db/Guild';
|
||||||
import { DicJob } from './dictionary/DicJob';
|
import { DicJob } from './dictionary/DicJob';
|
||||||
@@ -792,7 +791,11 @@ function addSeidEffect(heroAttrs: CeAttrData[], addSeidList: Array<number>, remo
|
|||||||
if (type == SEID_TYPE.TYPE101) { // 加值
|
if (type == SEID_TYPE.TYPE101) { // 加值
|
||||||
updateHeroAttr(heroAttrs, ability, { inc: {fixUp: value * multi * HERO_CE_RATIO} });
|
updateHeroAttr(heroAttrs, ability, { inc: {fixUp: value * multi * HERO_CE_RATIO} });
|
||||||
} else if (type == SEID_TYPE.TYPE102) { // 加百分比
|
} 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 } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user