132 lines
5.7 KiB
TypeScript
132 lines
5.7 KiB
TypeScript
export type DailyTaskState = 0 | 1 | 2;
|
|
|
|
export type RewardItem = {
|
|
type: "coin" | "freeze" | "hammer" | "magic_wand" | "infinite_health"
|
|
| "hourglass" | "rocket" | "infinite_hourglass" | "infinite_rocket";
|
|
count: number;
|
|
};
|
|
|
|
export type DailyTask = {
|
|
slot: number;
|
|
taskId: string;
|
|
metric: string;
|
|
target: number;
|
|
value: number;
|
|
stars: number;
|
|
state: DailyTaskState;
|
|
locked: boolean;
|
|
rewards: RewardItem[];
|
|
params?: Record<string, string | number | boolean>;
|
|
};
|
|
|
|
export type WeeklyReward = {
|
|
rewardId: string;
|
|
target: number;
|
|
state: DailyTaskState;
|
|
rewards: RewardItem[];
|
|
};
|
|
|
|
export type DailyWeeklyTaskData = {
|
|
version: 2;
|
|
dayKey: string;
|
|
weekKey: string;
|
|
dailyTasks: DailyTask[];
|
|
weeklyStars: number;
|
|
weeklyRewards: WeeklyReward[];
|
|
previousTaskIds: string[];
|
|
};
|
|
|
|
type Candidate = {
|
|
taskId: string;
|
|
metric: string;
|
|
target: number;
|
|
minLevel?: number;
|
|
requiredFeature?: string;
|
|
params?: Record<string, string | number | boolean>;
|
|
};
|
|
|
|
const clear = (target: number): Candidate => ({ taskId: `clear_${target}`, metric: "clear_blocks", target });
|
|
const size = (id: string, target: number, width: number, height: number): Candidate => ({
|
|
taskId: id, metric: "clear_size", target, params: { width, height },
|
|
});
|
|
const color = (id: string, target: number, colorId: number): Candidate => ({
|
|
taskId: id, metric: "clear_color", target, params: { colorId },
|
|
});
|
|
const prop = (id: string, target: number, propType?: string, minLevel = 8): Candidate => ({
|
|
taskId: id, metric: propType ? "use_specific_prop" : "use_prop", target, minLevel,
|
|
requiredFeature: propType || "props",
|
|
...(propType ? { params: { propType } } : {}),
|
|
});
|
|
|
|
export const DAILY_TASK_POOLS: Record<number, Candidate[]> = {
|
|
2: [
|
|
clear(15), size("clear_1x1_8", 8, 1, 1), size("clear_1x2_8", 8, 1, 2),
|
|
color("clear_green_3", 3, 2), { taskId: "pass_1", metric: "pass_levels", target: 1 },
|
|
{ taskId: "no_prop_pass_1", metric: "no_prop_pass", target: 1 },
|
|
{ taskId: "first_try_pass_1", metric: "first_try_pass", target: 1 },
|
|
{ taskId: "collect_coin_40", metric: "collect_coin", target: 40 },
|
|
{ taskId: "spend_coin_600", metric: "spend_coin", target: 600 },
|
|
prop("use_prop_1", 1), prop("use_freeze_1", 1, "freeze", 11),
|
|
prop("use_magic_1", 1, "magic_wand", 16), prop("use_hammer_1", 1, "hammer", 8),
|
|
{ taskId: "online_5", metric: "online_seconds", target: 300 },
|
|
{ taskId: "login_1", metric: "login", target: 1 },
|
|
{ taskId: "share_1", metric: "share", target: 1 },
|
|
],
|
|
3: [
|
|
clear(30), size("clear_1x1_20", 20, 1, 1), size("clear_1x2_10", 10, 1, 2),
|
|
color("clear_yellow_5", 5, 1), { taskId: "collect_coin_120", metric: "collect_coin", target: 120 },
|
|
{ taskId: "spend_coin_900", metric: "spend_coin", target: 900 },
|
|
prop("use_prop_2", 2), prop("use_freeze_2", 2, "freeze", 11),
|
|
prop("use_magic_2", 2, "magic_wand", 16), prop("use_hammer_2", 2, "hammer", 8),
|
|
{ taskId: "online_10", metric: "online_seconds", target: 600 },
|
|
],
|
|
4: [
|
|
clear(50), size("clear_1x2_15", 15, 1, 2), color("clear_orange_8", 8, 5),
|
|
{ taskId: "pass_5", metric: "pass_levels", target: 5 },
|
|
{ taskId: "no_prop_pass_3", metric: "no_prop_pass", target: 3 },
|
|
{ taskId: "win_streak_3", metric: "win_streak", target: 3 },
|
|
{ taskId: "first_try_pass_3", metric: "first_try_pass", target: 3 },
|
|
{ taskId: "collect_coin_200", metric: "collect_coin", target: 200 },
|
|
{ taskId: "spend_coin_1800", metric: "spend_coin", target: 1800 },
|
|
prop("use_prop_3", 3), prop("use_freeze_3", 3, "freeze", 11),
|
|
prop("use_magic_3", 3, "magic_wand", 16), prop("use_hammer_3", 3, "hammer", 8),
|
|
{ taskId: "online_20", metric: "online_seconds", target: 1200 },
|
|
],
|
|
5: [
|
|
clear(75), color("clear_blue_12", 12, 3),
|
|
{ taskId: "collect_coin_320", metric: "collect_coin", target: 320 },
|
|
{ taskId: "spend_coin_3000", metric: "spend_coin", target: 3000 },
|
|
prop("use_prop_5", 5), prop("use_freeze_5", 5, "freeze", 11),
|
|
prop("use_magic_5", 5, "magic_wand", 16), prop("use_hammer_5", 5, "hammer", 8),
|
|
{ taskId: "online_30", metric: "online_seconds", target: 1800 },
|
|
],
|
|
6: [
|
|
clear(100), color("clear_pink_20", 20, 4),
|
|
{ taskId: "pass_10", metric: "pass_levels", target: 10 },
|
|
{ taskId: "no_prop_pass_5", metric: "no_prop_pass", target: 5 },
|
|
{ taskId: "win_streak_5", metric: "win_streak", target: 5 },
|
|
{ taskId: "first_try_pass_5", metric: "first_try_pass", target: 5 },
|
|
{ taskId: "collect_coin_600", metric: "collect_coin", target: 600 },
|
|
{ taskId: "spend_coin_5000", metric: "spend_coin", target: 5000 },
|
|
prop("use_prop_8", 8), prop("use_freeze_8", 8, "freeze", 11),
|
|
prop("use_magic_8", 8, "magic_wand", 16), prop("use_hammer_8", 8, "hammer", 8),
|
|
{ taskId: "online_45", metric: "online_seconds", target: 2700 },
|
|
],
|
|
};
|
|
|
|
export const DAILY_REWARDS: Record<number, RewardItem[]> = {
|
|
2: [{ type: "hourglass", count: 1 }],
|
|
3: [{ type: "coin", count: 200 }],
|
|
4: [{ type: "hourglass", count: 1 }, { type: "rocket", count: 1 }],
|
|
5: [{ type: "infinite_rocket", count: 900 }],
|
|
6: [{ type: "hammer", count: 1 }],
|
|
};
|
|
|
|
export const WEEKLY_REWARDS: WeeklyReward[] = [
|
|
{ rewardId: "weekly_35", target: 35, state: 0, rewards: [{ type: "infinite_hourglass", count: 900 }, { type: "magic_wand", count: 1 }] },
|
|
{ rewardId: "weekly_70", target: 70, state: 0, rewards: [{ type: "infinite_rocket", count: 900 }, { type: "freeze", count: 1 }] },
|
|
{ rewardId: "weekly_105", target: 105, state: 0, rewards: [{ type: "infinite_health", count: 3600 }, { type: "hammer", count: 1 }] },
|
|
{ rewardId: "weekly_140", target: 140, state: 0, rewards: [{ type: "infinite_rocket", count: 900 }, { type: "infinite_hourglass", count: 900 }, { type: "coin", count: 1500 }] },
|
|
];
|
|
|