✨ feat(宝物): 添加宝物系统
This commit is contained in:
@@ -6,6 +6,7 @@ import { errlogger } from '../../util/logger';
|
||||
export function sortItems(goods: ItemInter[], handleType: HANDLE_REWARD_TYPE) {
|
||||
let items: { id: number, count: number }[] = []; // 可叠加道具
|
||||
let jewels: { seqId?: number, id?: number, hid?: number }[] = []; // 不可叠加装备
|
||||
let artifacts: { seqId?: number, id?: number }[] = []; // 不可叠加宝物
|
||||
let gold: { count: number, isPay: boolean }[] = []; // 金币
|
||||
let coin: number[] = [];
|
||||
let ap: number = 0;
|
||||
@@ -74,11 +75,21 @@ export function sortItems(goods: ItemInter[], handleType: HANDLE_REWARD_TYPE) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (table == ITEM_TABLE.ARTIFACT) {
|
||||
if(handleType == HANDLE_REWARD_TYPE.RECEIVE) {
|
||||
for(let i = 0; i < good.count; i++) {
|
||||
artifacts.push({ id: good.id })
|
||||
}
|
||||
} else {
|
||||
if(!!good.seqId) {
|
||||
artifacts.push({ seqId: good.seqId });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return { items, jewels, gold, coin, ap, skins, figures }
|
||||
return { items, jewels, gold, coin, ap, skins, figures, artifacts }
|
||||
}
|
||||
|
||||
export function getGoldEventProperties(inc: number, count: number, reason: ITEM_CHANGE_REASON) {
|
||||
@@ -98,7 +109,7 @@ export function combineItems(items: { id?: number, count?: number, seqId?: numbe
|
||||
for(let { id, count = 1, seqId, isBag } of items) {
|
||||
let dicGoods = gameData.goods.get(id);
|
||||
let dicItid = ITID.get(dicGoods.itid);
|
||||
if(dicItid.table != 'jewel') {
|
||||
if(dicItid.table != 'jewel' && dicItid.table != 'artifact') {
|
||||
let index = result.findIndex(cur => cur.id == id);
|
||||
if(index == -1) {
|
||||
result.push({ id, count, seqId, isBag });
|
||||
|
||||
Reference in New Issue
Block a user