feat(活动): 节日活动-火神祭祀

This commit is contained in:
luying
2023-03-16 17:25:31 +08:00
parent f6a19fdc01
commit 04cecc2d5d
24 changed files with 566 additions and 14 deletions

View File

@@ -12,6 +12,7 @@ export function sortItems(goods: ItemInter[], handleType: HANDLE_REWARD_TYPE) {
let ap: number = 0;
let skins: number[] = [];
let figures: number[] = [];
let activityItems: { id: number, count: number, expireTime?: number }[] = []; // 可叠加道具
for(let good of goods) {
if(good.count == 0) continue;
@@ -85,11 +86,18 @@ export function sortItems(goods: ItemInter[], handleType: HANDLE_REWARD_TYPE) {
artifacts.push({ seqId: good.seqId });
}
}
} else if (table == ITEM_TABLE.ACTIVITY_ITEM) { // 活动道具,限时,可堆叠
let index = activityItems.findIndex(cur => cur.id == good.id);
if(index >= 0) {
activityItems[index].count += good.count;
} else {
activityItems.push({ id: good.id, count: good.count, expireTime: good.expireTime });
}
}
}
return { items, jewels, gold, coin, ap, skins, figures, artifacts }
return { items, jewels, gold, coin, ap, skins, figures, artifacts, activityItems }
}
export function getGoldEventProperties(inc: number, count: number, reason: ITEM_CHANGE_REASON) {