From 7a70be13b657d33f26f41062f39dcdc978710825 Mon Sep 17 00:00:00 2001 From: Miguel Campos Date: Fri, 4 Oct 2024 21:45:18 -0700 Subject: [PATCH] raffles: add keymunity tasks --- .vscode/settings.json | 1 + apps/charity/pages/api/cron/spawn-raffle.ts | 29 +++++++++++-- libs/data/tasks/src/index.ts | 47 +++++++++++++++++++++ 3 files changed, 74 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a0b13e03..bdcfecac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -60,6 +60,7 @@ "INDIEFOLD", "itchio", "Jeeble", + "Keymunity", "Kunoichi", "Larian", "lastmod", diff --git a/apps/charity/pages/api/cron/spawn-raffle.ts b/apps/charity/pages/api/cron/spawn-raffle.ts index cd69999b..cf3c74ec 100644 --- a/apps/charity/pages/api/cron/spawn-raffle.ts +++ b/apps/charity/pages/api/cron/spawn-raffle.ts @@ -69,6 +69,18 @@ const prizes = { numWinners: [5, 7, 10], imageUrl: undefined, }, + '102': { + itemId: '102', + premium: false, + numWinners: [1, 2, 3], + imageUrl: undefined, + }, + '103': { + itemId: '103', + premium: false, + numWinners: [1, 1, 1, 2, 3], + imageUrl: undefined, + }, '1000': { itemId: '1000', premium: false, @@ -104,7 +116,18 @@ const generateRaffle = (): Prisma.RaffleUncheckedCreateInput => { const maxEntries = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]; - const dropChance: PrizeId[] = ['5', '8', '1000', '4', '4', '4', '4']; + const dropChance: PrizeId[] = [ + '5', + '8', + '1000', + '102', + '103', + '4', + '4', + '4', + '4', + '4', + ]; const prizeId = randomArrayElement(dropChance); const prize = prizes[prizeId]; @@ -156,14 +179,14 @@ const selectActions = ( ] ); - if (isLucky(0.25)) { + if (isLucky(0.75)) { actions.push({ order: 5, reward: randomArrayElement([1, 2, 3, 4, 5]), taskId: randomArrayElement(primarySocial), }); } - if (isLucky(0.25)) { + if (isLucky(0.75)) { actions.push({ order: 6, reward: randomArrayElement([1, 2, 3, 4, 5]), diff --git a/libs/data/tasks/src/index.ts b/libs/data/tasks/src/index.ts index d6f05657..b9415dc8 100644 --- a/libs/data/tasks/src/index.ts +++ b/libs/data/tasks/src/index.ts @@ -397,6 +397,22 @@ export const TASKS: Prisma.TaskUncheckedCreateInput[] = [ label: 'Visit Water.org', }, }, + { + version: 1, + id: 'INSTAGRAM_VISIT_KEYMUNITY_ONCE', + type: TaskType.VISIT_INSTAGRAM, + category: TaskCategory.TASK, + frequency: TaskFrequency.ONCE, + requiredRepetitions: 1, + maxRepetitions: 1, + name: 'Visit Keymunity on Instagram', + description: + 'View an account on Instagram. Stay up to date on the latest news and updates.', + data: { + url: 'https://www.instagram.com/keymunityofficial', + label: 'Visit Keymunity', + }, + }, // visit facebook { version: 2, @@ -414,6 +430,22 @@ export const TASKS: Prisma.TaskUncheckedCreateInput[] = [ label: 'Visit Charity Games', }, }, + { + version: 1, + id: 'FACEBOOK_VISIT_KEYMUNITY_ONCE', + type: TaskType.VISIT_FACEBOOK, + category: TaskCategory.TASK, + frequency: TaskFrequency.ONCE, + requiredRepetitions: 1, + maxRepetitions: 1, + name: 'Visit Keymunity on Facebook', + description: + 'View an account on Facebook. Stay up to date on the latest news and updates.', + data: { + url: 'https://www.facebook.com/share/1WAaj2zugnW45Qu2/', + label: 'Visit Keymunity', + }, + }, // visit tiktok { version: 1, @@ -432,6 +464,21 @@ export const TASKS: Prisma.TaskUncheckedCreateInput[] = [ }, }, // follow twitter + { + version: 1, + id: 'FOLLOW_KEYMUNITY_TWITTER_ONCE', + type: TaskType.FOLLOW_TWITTER, + category: TaskCategory.TASK, + frequency: TaskFrequency.ONCE, + requiredRepetitions: 1, + maxRepetitions: 1, + name: 'Follow Keymunity', + description: + 'Follow Keymunity on Twitter. Stay up to date on the latest news and updates.', + data: { + handle: 'TheKeymunity', + }, + }, { version: 1, id: 'FOLLOW_CHARITY_GAMES_TWITTER_ONCE',