战力显示缩小

This commit is contained in:
luying
2020-12-24 10:53:23 +08:00
parent cc1a91ed09
commit 4bfc92f8cf
6 changed files with 66 additions and 28 deletions

View File

@@ -27,4 +27,7 @@ export const HERO_GROW_MAX = {
export const JOB_TYPE = {
PHYSIC: 1,
MAGIC: 2
}
}
// 武将战力放大系数
export const HERO_CE_RATIO = 100;

View File

@@ -70,6 +70,7 @@ export function calPlayerCe(globalCeAttr: CeAttr, hero: HeroType, type: number,
incCe += incArr[attrName] * getAttrCeRatio(attrName);
}
hero.ce += incCe;
if(hero.historyCe < hero.ce) hero.historyCe = hero.ce;
return incCe;
}

View File

@@ -1,7 +1,7 @@
import { STATUS } from './../consts/statusCode';
import { getGamedata } from './gamedata';
import { HeroModel } from '../db/Hero';
import { HeroModel, HeroType } from '../db/Hero';
import { RoleModel } from '../db/Role';
import { PvpDefenseModel } from '../db/PvpDefense';
import Actor from './actor';
@@ -9,6 +9,7 @@ import Actor from './actor';
import fs = require('fs');
import path = require('path');
import { DicRandomEffectPool } from './dictionary/DicRandomEffectPool';
import { HERO_CE_RATIO } from '../consts';
const _ = require('underscore');
const moment = require('moment');
@@ -516,4 +517,14 @@ export function mergeSameGoods(goods: Array<{id: number, count: number}>) {
}
}
return resGoods;
}
export function returnHeroCeRatio(hero: HeroType) {
let ce = reduceCe(hero.ce);
return Object.assign(hero, { ce });
}
// 缩小战力
export function reduceCe(ce: number = 0) {
return Math.floor(ce/HERO_CE_RATIO/HERO_CE_RATIO)
}