🐞 fix(优化): 羁绊溢出替换道具

This commit is contained in:
luying
2023-08-14 21:11:23 +08:00
parent 9a94762e46
commit 4be52d3dfe
3 changed files with 32 additions and 8 deletions

View File

@@ -197,8 +197,9 @@ const currencyArr = [
{ "gid": 72021, "name": "天机骰子", "type": CURRENCY_TYPE.SPECIAL_DICE },
{ "gid": 72030, "name": "主公经验", "type": CURRENCY_TYPE.KING_EXP },
{ "gid": 81000, "name": "英杰券", "type": CURRENCY_TYPE.VOUCHER},
{ "gid": 81001, "name": "英杰币", "type": CURRENCY_TYPE.VOUCHER_COIN},
{ "gid": 81001, "name": "英杰币", "type": CURRENCY_TYPE.VOUCHER_COIN}
];
export const CURRENCY = new Map<number, { gid: number, name: string, type: string }>();
export const CURRENCY_BY_TYPE = new Map<string, number>();
for (let obj of currencyArr) {
@@ -229,6 +230,7 @@ export function getSpineItid() {
return dicItid?.id;
}
export enum QUALITY_TYPE {
BLUE = 1, // 蓝
PURPLE = 2, // 紫
@@ -308,4 +310,6 @@ export enum QUENCH_TYPE {
export enum REFINE_TYPE {
ONCE = 1, // 精炼一次
ONE_LEVEL = 2, // 精炼一级
}
}
export const DELICACY_GID = 11011;

View File

@@ -422,12 +422,16 @@ export function getConnectMaxLv(actorId: number, shipId: number) {
*/
export function getConnectLvByExp(actorId: number, shipId: number, newExp: number) {
let exps = gameData.friendShips.get(`${actorId}_${shipId}`) || [];
let overExp = 0;
exps.sort((a, b) => a.level - b.level);
let newLv = 0;
for (let { level, shipExp } of exps) {
if (newExp >= shipExp) newLv = level;
if (newExp >= shipExp) {
newLv = level;
overExp = newExp - shipExp;
}
}
return newLv
return { newLv, overExp }
}
export function getBossHpByWarId(warId: number) {