diff --git a/src/cross/protocols/serviceProto.ts b/src/cross/protocols/serviceProto.ts index f403b19..df68c39 100644 --- a/src/cross/protocols/serviceProto.ts +++ b/src/cross/protocols/serviceProto.ts @@ -1316,6 +1316,20 @@ export const serviceProto: ServiceProto = { } }, "optional": true + }, + { + "id": 38, + "name": "weiwang", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Number" + } + } + }, + "optional": true } ] }, diff --git a/src/monopoly/protocols/serviceProto.ts b/src/monopoly/protocols/serviceProto.ts index 3d8d36f..3a61fa6 100644 --- a/src/monopoly/protocols/serviceProto.ts +++ b/src/monopoly/protocols/serviceProto.ts @@ -2637,6 +2637,20 @@ export const serviceProto: ServiceProto = { } }, "optional": true + }, + { + "id": 38, + "name": "weiwang", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Number" + } + } + }, + "optional": true } ] }, diff --git a/src/shared/protocols/serviceProto.ts b/src/shared/protocols/serviceProto.ts index 638b116..2d6bc3f 100644 --- a/src/shared/protocols/serviceProto.ts +++ b/src/shared/protocols/serviceProto.ts @@ -4585,6 +4585,20 @@ export const serviceProto: ServiceProto = { } }, "optional": true + }, + { + "id": 38, + "name": "weiwang", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Number" + } + } + }, + "optional": true } ] }, @@ -5829,6 +5843,20 @@ export const serviceProto: ServiceProto = { } }, "optional": true + }, + { + "id": 38, + "name": "weiwang", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Number" + } + } + }, + "optional": true } ] }, @@ -24380,6 +24408,20 @@ export const serviceProto: ServiceProto = { } }, "optional": true + }, + { + "id": 38, + "name": "weiwang", + "type": { + "type": "Interface", + "indexSignature": { + "keyType": "String", + "type": { + "type": "Number" + } + } + }, + "optional": true } ] }, diff --git a/src/shared/protocols/user/PtlLogin.ts b/src/shared/protocols/user/PtlLogin.ts index 49f56e3..6be7445 100644 --- a/src/shared/protocols/user/PtlLogin.ts +++ b/src/shared/protocols/user/PtlLogin.ts @@ -1,4 +1,4 @@ -import {gonghuiLevel} from '../gonghui/type'; +import { gonghuiLevel } from '../gonghui/type'; /** * 登录 @@ -193,4 +193,6 @@ export type playerAppend = { chatFrames?: { [id: string]: number; }; + /**威望额外属性*/ + weiwang?: { [k: string]: number }; }; \ No newline at end of file diff --git a/src/shared/public/hero.ts b/src/shared/public/hero.ts index dbddc83..4b6a644 100644 --- a/src/shared/public/hero.ts +++ b/src/shared/public/hero.ts @@ -1,10 +1,10 @@ -import {ResGetList} from '../protocols/hero/PtlGetList'; -import {player} from '../protocols/user/type'; -import {EquipShared} from './equip'; -import {PeijianShared} from './peijian'; -import {PlayerShared} from './player'; -import {PublicShared} from './public'; -import {ShiwuShared} from './shiwu'; +import { ResGetList } from '../protocols/hero/PtlGetList'; +import { player } from '../protocols/user/type'; +import { EquipShared } from './equip'; +import { PeijianShared } from './peijian'; +import { PlayerShared } from './player'; +import { PublicShared } from './public'; +import { ShiwuShared } from './shiwu'; export type otherBuff = Partial; @@ -31,7 +31,7 @@ export class HeroShared { */ static getHeroBasicAttr(hero: heroDataType, otherBuff: otherBuff = G.otherBuff, pos = 0) { let jiban = 0; - let buff: k_v = {skillArr: []}; + let buff: k_v = { skillArr: [] }; let heroConf = G.gc.hero[hero.heroId]; let heroLv = G.gc.herolv[heroConf.lvup]; let heroGrow = G.gc.herogrow[heroConf.jjup]?.[hero.jieji]; @@ -40,7 +40,7 @@ export class HeroShared { for (let k in heroLv.buff) { let val = heroLv.buff[k]; 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}`)()); } @@ -135,7 +135,7 @@ export class HeroShared { PublicShared.mergeProperty(buff, PeijianShared.getAttr(p)); let conf = G.gc.peijian[p.peijianId]; 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++; if (!suitObj[conf.suit].minLv || p.lv < suitObj[conf.suit].minLv) suitObj[conf.suit].minLv = p.lv; } @@ -273,11 +273,16 @@ export class HeroShared { if (otherBuff?.skills) { for (let [id, lv] of Object.entries(otherBuff.skills)) { 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 })]))); } } } + // 威望加成计算 + if (otherBuff?.weiwang) { + PublicShared.mergeProperty(buff, otherBuff?.weiwang || {}); + } + //最后进行加成属性计算 for (let k in buff) { if (k.indexOf('pro') == -1) continue; @@ -368,8 +373,8 @@ export class HeroShared { static getHeroLvUpNeed(id: string | number, lv = 1): atn[] { return [ - {a: 'item', t: '1', n: G.gc.herolvup[lv].expneed}, - {a: 'attr', t: 'jinbi', n: G.gc.herolvup[lv].jinbineed} + { a: 'item', t: '1', n: G.gc.herolvup[lv].expneed }, + { a: 'attr', t: 'jinbi', n: G.gc.herolvup[lv].jinbineed } ]; }