✨ feat(宝物): 宝物seqId修改

This commit is contained in:
luying
2023-03-31 13:41:00 +08:00
parent da747a7fba
commit 2caf169055
10 changed files with 36 additions and 32 deletions
@@ -149,7 +149,7 @@ export async function handleCost(roleId: string, sid: string, goods: Array<ItemI
export async function addItems(roleId: string, roleName: string, sid: string, goods: Array<ItemInter>, reason: ITEM_CHANGE_REASON) {
goods = filterGoods(goods, obj => obj.id, roleId, reason);
let { items, jewels, gold, coin, ap, skins, figures, artifacts, activityItems } = sortItems(goods, HANDLE_REWARD_TYPE.RECEIVE);
let showItems: { id: number, seqId?: number, count: number, isBag?: boolean, expireTime?: number }[] = [];
let showItems: { id: number, seqId?: number|string, count: number, isBag?: boolean, expireTime?: number }[] = [];
let role = await RoleModel.findByRoleId(roleId, '-warCount -topLineup');
// 1. 装备处理
if(jewels.length > 0) {
@@ -266,7 +266,7 @@ export async function addItems(roleId: string, roleName: string, sid: string, go
if(artifacts.length > 0) {
let { artifactCount = 0 } = role;
let incArtifacts = artifacts, mailArtifacts: { id?: number, seqId?: number }[] = [];
let incArtifacts = artifacts, mailArtifacts: { id?: number, seqId?: number|string }[] = [];
if(artifacts.length + artifactCount > BAG.BAG_ARTIFACT_UPLIMITED) { // 装备上限
let inc = BAG.BAG_ARTIFACT_UPLIMITED - artifactCount;
if(inc < 0) inc = 0;