14 lines
670 B
TypeScript
14 lines
670 B
TypeScript
/** 普通抽猫池;签到等活动猫不参与费用、进度和集齐判断。 */
|
|
export const DRAWABLE_CAT_IDS: ReadonlyArray<number> = [4, 5, 6, 7, 8, 9, 10, 11];
|
|
const FILM_COSTS = [5, 10, 25, 35, 55, 70, 100, 120];
|
|
|
|
export function getOwnedDrawableCats(catArr: any): number[] {
|
|
const owned = Array.isArray(catArr) ? catArr.map(id => Number(id)) : [];
|
|
return DRAWABLE_CAT_IDS.filter(id => owned.indexOf(id) !== -1);
|
|
}
|
|
|
|
/** 集齐时保留最后一档展示费用;是否可抽由拥有数量单独判断。 */
|
|
export function getCatDrawCost(ownedCount: number): number {
|
|
return FILM_COSTS[Math.min(Math.max(0, ownedCount), FILM_COSTS.length - 1)];
|
|
}
|