From 11468cf4931922c81ddea80fbb8cdb44a16809a0 Mon Sep 17 00:00:00 2001 From: tannerkrewson Date: Sun, 24 Jan 2021 10:53:15 -0600 Subject: [PATCH 1/2] Second attempt at allbad.cards --- config/games/allbadcards.ts | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 config/games/allbadcards.ts diff --git a/config/games/allbadcards.ts b/config/games/allbadcards.ts new file mode 100644 index 0000000..db28923 --- /dev/null +++ b/config/games/allbadcards.ts @@ -0,0 +1,39 @@ +import { randomBytes } from "crypto"; +import { ServerGame } from "../../types/types"; + +const game: ServerGame = { + id: "allbadcards", + name: "All Bad Cards", + author: "Jake Lauer", + basedOn: { + game: "Cards Against Humanity", + link: "https://cardsagainsthumanity.com/", + }, + description: + "Be rude. Be irreverent. Be hilarious! Select the card from your hand that you think is best described by a card played by the judge!", + displayUrlText: "allbad.cards", + displayUrlHref: "https://allbad.cards/", + donationUrlText: "Support Jake on Patreon!", + donationUrlHref: "https://www.patreon.com/Allbadcards", + category: ["easy"], + players: "4-20+", + familyFriendly: false, + connectToGame: async () => { + const roomId = "rocketcrab-" + randomBytes(8).toString("hex"); + return { + player: { + url: "https://allbad.cards/api/abc/external-create", + customQueryParams: { roomId: "external-room-" + roomId }, + }, + host: { + customQueryParams: { roomId }, + }, + }; + }, + renameParams: { + name: "userName", + ishost: "isHost", + }, +}; + +export default game; From a50dffa9c472fc20bc05acf303aa667f72a87d73 Mon Sep 17 00:00:00 2001 From: tannerkrewson Date: Sun, 21 Feb 2021 15:00:12 -0600 Subject: [PATCH 2/2] added all allbad games --- config/games/allbad.ts | 96 +++++++++++++++++++++++++++++++++++++ config/games/allbadcards.ts | 39 --------------- 2 files changed, 96 insertions(+), 39 deletions(-) create mode 100644 config/games/allbad.ts delete mode 100644 config/games/allbadcards.ts diff --git a/config/games/allbad.ts b/config/games/allbad.ts new file mode 100644 index 0000000..c067a6e --- /dev/null +++ b/config/games/allbad.ts @@ -0,0 +1,96 @@ +import { randomBytes } from "crypto"; +import { ServerGame } from "../../types/types"; + +const gameTemplate = ({ + id, + name, + description, + displayUrlText, + displayUrlHref, + basedOn, + category, + players, + familyFriendly, + guideUrl, + guideId, +}: //pictures, +Partial): ServerGame => ({ + id, + name: name, + author: "Jake Lauer", + basedOn, + description, + displayUrlText, + displayUrlHref, + donationUrlText: "Support Jake on Patreon!", + donationUrlHref: "https://www.patreon.com/Allbadcards", + category, + players, + familyFriendly, + //pictures, + ...(guideUrl ? { guideUrl } : {}), + ...(guideId ? { guideId } : {}), + connectToGame: async () => { + const roomId = "rocketcrab-" + randomBytes(8).toString("hex"); + return { + player: { + url: displayUrlHref + "api/external-create", + customQueryParams: { roomId }, + }, + }; + }, + renameParams: { + name: "userName", + ishost: "isHost", + }, +}); + +const games: Array = [ + gameTemplate({ + id: "allbadcards", + name: "All Bad Cards", + author: "Jake Lauer", + basedOn: { + game: "Cards Against Humanity", + link: "https://cardsagainsthumanity.com/", + }, + description: + "Be rude. Be irreverent. Be hilarious! Select the card from your hand that you think is best described by a card played by the judge!", + displayUrlText: "allbad.cards", + displayUrlHref: "https://allbad.cards/", + category: ["easy"], + players: "4-20+", + familyFriendly: false, + }), + gameTemplate({ + id: "notallbadcards", + name: "(not) All Bad Cards", + author: "Jake Lauer", + basedOn: { + game: "Apples to Apples", + link: + "https://www.mattelgames.com/games/en-us/family/apples-apples", + }, + description: + "PG Family-friendly edition! be hilarious! Select the card from your hand that you think is best described by a card played by the judge!", + displayUrlText: "not.allbad.cards", + displayUrlHref: "https://not.allbad.cards/", + category: ["easy"], + players: "4-20+", + familyFriendly: true, + }), + gameTemplate({ + id: "allbadmemes", + name: "All Bad Memes", + author: "Jake Lauer", + basedOn: undefined, + description: "Caption to your heart's content.", + displayUrlText: "memes.allbad.cards", + displayUrlHref: "https://memes.allbad.cards/", + category: ["easy"], + players: "4-20+", + familyFriendly: true, + }), +]; + +export default games; diff --git a/config/games/allbadcards.ts b/config/games/allbadcards.ts deleted file mode 100644 index db28923..0000000 --- a/config/games/allbadcards.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { randomBytes } from "crypto"; -import { ServerGame } from "../../types/types"; - -const game: ServerGame = { - id: "allbadcards", - name: "All Bad Cards", - author: "Jake Lauer", - basedOn: { - game: "Cards Against Humanity", - link: "https://cardsagainsthumanity.com/", - }, - description: - "Be rude. Be irreverent. Be hilarious! Select the card from your hand that you think is best described by a card played by the judge!", - displayUrlText: "allbad.cards", - displayUrlHref: "https://allbad.cards/", - donationUrlText: "Support Jake on Patreon!", - donationUrlHref: "https://www.patreon.com/Allbadcards", - category: ["easy"], - players: "4-20+", - familyFriendly: false, - connectToGame: async () => { - const roomId = "rocketcrab-" + randomBytes(8).toString("hex"); - return { - player: { - url: "https://allbad.cards/api/abc/external-create", - customQueryParams: { roomId: "external-room-" + roomId }, - }, - host: { - customQueryParams: { roomId }, - }, - }; - }, - renameParams: { - name: "userName", - ishost: "isHost", - }, -}; - -export default game;