Compare commits

..

No commits in common. "a5ad7ee2cf81812b7086b45c280f9b475cca7df2" and "ea179c2a3cb4f3639f9b6027f514527d0f960625" have entirely different histories.

View File

@ -1,10 +1,10 @@
import {ResGetList} from '../protocols/hero/PtlGetList'; import { ResGetList } from '../protocols/hero/PtlGetList';
import {player} from '../protocols/user/type'; import { player } from '../protocols/user/type';
import {EquipShared} from './equip'; import { EquipShared } from './equip';
import {PeijianShared} from './peijian'; import { PeijianShared } from './peijian';
import {PlayerShared} from './player'; import { PlayerShared } from './player';
import {PublicShared} from './public'; import { PublicShared } from './public';
import {ShiwuShared} from './shiwu'; import { ShiwuShared } from './shiwu';
export type otherBuff = Partial<player & { export type otherBuff = Partial<player & {
allBuff: k_v<number>; allBuff: k_v<number>;
@ -23,7 +23,6 @@ export class HeroShared {
return allBuff; return allBuff;
} }
/** /**
* *
* @param hero * @param hero
@ -31,7 +30,7 @@ export class HeroShared {
*/ */
static getHeroBasicAttr(hero: heroDataType, otherBuff: otherBuff = G.otherBuff, pos = 0) { static getHeroBasicAttr(hero: heroDataType, otherBuff: otherBuff = G.otherBuff, pos = 0) {
let jiban = 0; let jiban = 0;
let buff: k_v<any> = {skillArr: []}; let buff: k_v<any> = { skillArr: [] };
let heroConf = G.gc.hero[hero.heroId]; let heroConf = G.gc.hero[hero.heroId];
let heroLv = G.gc.herolv[heroConf.lvup]; let heroLv = G.gc.herolv[heroConf.lvup];
let heroGrow = G.gc.herogrow[heroConf.jjup]?.[hero.jieji]; let heroGrow = G.gc.herogrow[heroConf.jjup]?.[hero.jieji];
@ -40,7 +39,7 @@ export class HeroShared {
for (let k in heroLv.buff) { for (let k in heroLv.buff) {
let val = heroLv.buff[k]; let val = heroLv.buff[k];
if (typeof val == 'number') buff[k] = val; if (typeof val == 'number') buff[k] = val;
else buff[k] = PublicShared.eval(val, {lv: hero.lv}); else buff[k] = PublicShared.eval(val, { lv: hero.lv });
// else buff[k] = Math.floor(new Function(`let lv=${hero.lv}; return ${val}`)()); // else buff[k] = Math.floor(new Function(`let lv=${hero.lv}; return ${val}`)());
} }
@ -127,7 +126,7 @@ export class HeroShared {
PublicShared.mergeProperty(buff, PeijianShared.getAttr(p)); PublicShared.mergeProperty(buff, PeijianShared.getAttr(p));
let conf = G.gc.peijian[p.peijianId]; let conf = G.gc.peijian[p.peijianId];
if (conf.suit) { if (conf.suit) {
if (!suitObj[conf.suit]) suitObj[conf.suit] = {num: 0, minLv: 0}; if (!suitObj[conf.suit]) suitObj[conf.suit] = { num: 0, minLv: 0 };
suitObj[conf.suit].num++; suitObj[conf.suit].num++;
if (!suitObj[conf.suit].minLv || p.lv < suitObj[conf.suit].minLv) suitObj[conf.suit].minLv = p.lv; if (!suitObj[conf.suit].minLv || p.lv < suitObj[conf.suit].minLv) suitObj[conf.suit].minLv = p.lv;
} }
@ -173,7 +172,7 @@ export class HeroShared {
if (hero.qiannneg) { if (hero.qiannneg) {
for (let type in hero.qiannneg) { for (let type in hero.qiannneg) {
// console.log(PublicShared.mergeProperty(buff, G.gc.hero_qianneng[type]?.[hero.qiannneg[type]].buff)) // console.log(PublicShared.mergeProperty(buff, G.gc.hero_qianneng[type]?.[hero.qiannneg[type]].buff))
for (let i = 1; i <= hero.qiannneg[type]; i++) { for(let i = 1; i <= hero.qiannneg[type]; i++) {
G.gc.hero_qianneng[type]?.[i] && PublicShared.mergeProperty(buff, G.gc.hero_qianneng[type]?.[i].buff); G.gc.hero_qianneng[type]?.[i] && PublicShared.mergeProperty(buff, G.gc.hero_qianneng[type]?.[i].buff);
} }
} }
@ -261,7 +260,7 @@ export class HeroShared {
if (otherBuff?.skills) { if (otherBuff?.skills) {
for (let [id, lv] of Object.entries(otherBuff.skills)) { for (let [id, lv] of Object.entries(otherBuff.skills)) {
if (lv && G.gc.xunlianjihua[id].use == 0) { if (lv && G.gc.xunlianjihua[id].use == 0) {
PublicShared.mergeProperty(buff, Object.fromEntries([G.gc.xunlianjihua[id].skill].map(k => [k, PublicShared.eval(G.gc.xunlianjihua[id].v[0], {slv: lv})]))); PublicShared.mergeProperty(buff, Object.fromEntries([G.gc.xunlianjihua[id].skill].map(k => [k, PublicShared.eval(G.gc.xunlianjihua[id].v[0], { slv: lv })])));
} }
} }
} }
@ -287,7 +286,6 @@ export class HeroShared {
return buff; return buff;
}; };
/**修正属性 数值取整*/ /**修正属性 数值取整*/
static amendAttr(buff: k_v<number>) { static amendAttr(buff: k_v<number>) {
for (let k in buff) { for (let k in buff) {
@ -296,7 +294,6 @@ export class HeroShared {
buff[k] = Math.floor(buff[k]); buff[k] = Math.floor(buff[k]);
} }
} }
/** /**
* *
* @param hero * @param hero
@ -306,7 +303,6 @@ export class HeroShared {
let buff = this.getHeroBasicAttr(hero, otherBuff, pos); let buff = this.getHeroBasicAttr(hero, otherBuff, pos);
return this.computeHeroZhanLi(buff); return this.computeHeroZhanLi(buff);
} }
/** /**
* *
*/ */
@ -317,7 +313,6 @@ export class HeroShared {
let def = buff.def || 0; let def = buff.def || 0;
let hp = buff.hp || 0; let hp = buff.hp || 0;
let speed = buff.speed || 0; let speed = buff.speed || 0;
let speedpro = buff.speedpro || 0;
let hppro = buff.hppro || 0; let hppro = buff.hppro || 0;
let dpspro = buff.dpspro || 0; let dpspro = buff.dpspro || 0;
let undpspro = buff.undpspro || 0; let undpspro = buff.undpspro || 0;
@ -334,11 +329,11 @@ export class HeroShared {
(maxdps * .75) + (maxdps * .75) +
(def * 1.03) + (def * 1.03) +
(hp * 1) + (hp * 1) +
(speed * 21.28) +
(hp * hppro * .5) + (hp * hppro * .5) +
(speed * (speedpro + 1) * 21.28) +
((mindps + maxdps) / 2 * dpspro * .75) + ((mindps + maxdps) / 2 * dpspro * .75) +
(hp * undpspro * .6) + (hp * undpspro * .6) +
((mindps + maxdps) / 2 * xixuepro) + ((mindps + maxdps) / 2 * xixuepro * 1) +
((mindps + maxdps) / 2 * baoshangpro * .75) + ((mindps + maxdps) / 2 * baoshangpro * .75) +
((mindps + maxdps) / 2 * shanbipro * .5) + ((mindps + maxdps) / 2 * shanbipro * .5) +
((mindps + maxdps) / 2 * mingzhongpro * .5) + ((mindps + maxdps) / 2 * mingzhongpro * .5) +
@ -346,7 +341,6 @@ export class HeroShared {
(hp * pvpdpsdrop * .5) (hp * pvpdpsdrop * .5)
); );
} }
/** /**
* *
* @param id id * @param id id
@ -355,11 +349,10 @@ export class HeroShared {
static getHeroLvUpNeed(id: string | number, lv = 1): atn[] { static getHeroLvUpNeed(id: string | number, lv = 1): atn[] {
return [ return [
{a: 'item', t: '1', n: G.gc.herolvup[lv].expneed}, { a: 'item', t: '1', n: G.gc.herolvup[lv].expneed },
{a: 'attr', t: 'jinbi', n: G.gc.herolvup[lv].jinbineed} { a: 'attr', t: 'jinbi', n: G.gc.herolvup[lv].jinbineed }
]; ];
} }
/** /**
* *
* @param id id * @param id id