Skip to content

Commit

Permalink
Add more cards to common actions
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaMulein committed Nov 10, 2024
1 parent 7fc03fe commit 4b26662
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ Join our community of developers.
## Changelog
### Sun Nov 10 12:20:00 2024
- Version 0.11.1
- Add more common actions
### Sun Nov 10 00:53:00 2024
- Version 0.11.0
Expand Down
210 changes: 209 additions & 1 deletion src/components/Recipes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ import {
faHatWitch,
faWave,
faWarehouse,
faOliveBranch,
faPersonSimple,
faBook,
faCandleHolder,
faHorse,
faShoePrints,
} from '@fortawesome/pro-solid-svg-icons';
import { RecipeSection } from '@/game/interfaces/recipe-section';
import { IGame } from '@/game/interfaces/game';
Expand All @@ -49,7 +55,8 @@ export type RecipeSections =
| 'Empires'
| 'Menagerie'
| 'CornucopiaGuilds'
| 'Renaissance';
| 'Renaissance'
| 'Allies';

export const Recipes: Record<RecipeSections, RecipeSection> = {
General: {
Expand Down Expand Up @@ -267,6 +274,30 @@ export const Recipes: Record<RecipeSections, RecipeSection> = {
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
Library: {
name: 'Library',
icon: <FontAwesomeIcon icon={faBook} />,
actions: {
[GroupedActionDest.CurrentPlayerIndex]: [
{
action: GameLogAction.REMOVE_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_CARDS,
count: (game: IGame, playerIndex: number) => {
// draw until hand has 7 cards
const currentCards = game.players[playerIndex].turn.cards;
return currentCards < 7 ? 7 - currentCards : 0;
},
},
],
[GroupedActionDest.SelectedPlayerIndex]: [],
[GroupedActionDest.AllPlayers]: [],
[GroupedActionDest.AllPlayersExceptCurrent]: [],
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
Smithy: {
name: 'Smithy',
icon: <FontAwesomeIcon icon={faHammer} />,
Expand Down Expand Up @@ -357,6 +388,31 @@ export const Recipes: Record<RecipeSections, RecipeSection> = {
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
Witch: {
name: 'Witch',
icon: <FontAwesomeIcon icon={faHatWitch} />,
actions: {
[GroupedActionDest.CurrentPlayerIndex]: [
{
action: GameLogAction.REMOVE_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_CARDS,
count: 2,
},
],
[GroupedActionDest.SelectedPlayerIndex]: [],
[GroupedActionDest.AllPlayers]: [],
[GroupedActionDest.AllPlayersExceptCurrent]: [
{
action: GameLogAction.ADD_CURSES,
count: 1,
},
],
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
},
},
Seaside: {
Expand Down Expand Up @@ -939,6 +995,91 @@ export const Recipes: Record<RecipeSections, RecipeSection> = {
title: 'Cornucopia & Guilds',
icon: <FontAwesomeIcon icon={faHammer} />,
recipes: {
CandleStickMaker: {
name: 'Candlestick Maker',
icon: <FontAwesomeIcon icon={faCandleHolder} />,
actions: {
[GroupedActionDest.CurrentPlayerIndex]: [
{
action: GameLogAction.REMOVE_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_BUYS,
count: 1,
},
{
action: GameLogAction.ADD_COFFERS,
count: 1,
},
],
[GroupedActionDest.SelectedPlayerIndex]: [],
[GroupedActionDest.AllPlayers]: [],
[GroupedActionDest.AllPlayersExceptCurrent]: [],
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
Farrier: {
name: 'Farrier',
icon: <FontAwesomeIcon icon={faHorse} />,
actions: {
[GroupedActionDest.CurrentPlayerIndex]: [
{
action: GameLogAction.REMOVE_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_CARDS,
count: 1,
},
{
action: GameLogAction.ADD_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_BUYS,
count: 1,
},
],
[GroupedActionDest.SelectedPlayerIndex]: [],
[GroupedActionDest.AllPlayers]: [],
[GroupedActionDest.AllPlayersExceptCurrent]: [],
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
Footpad: {
name: 'Footpad',
icon: <FontAwesomeIcon icon={faShoePrints} />,
actions: {
[GroupedActionDest.CurrentPlayerIndex]: [
{
action: GameLogAction.REMOVE_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_COFFERS,
count: 1,
},
],
[GroupedActionDest.SelectedPlayerIndex]: [],
[GroupedActionDest.AllPlayers]: [],
[GroupedActionDest.AllPlayersExceptCurrent]: [
{
action: GameLogAction.ADD_NEXT_TURN_DISCARD,
count: (game: IGame, playerIndex: number) => {
// discard down to 3 cards
const cardsToDiscard = Math.max(0, game.players[playerIndex].turn.cards - 3);
return cardsToDiscard;
},
},
],
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
Demesne: {
name: 'Demesne',
icon: <FontAwesomeIcon icon={faLandmark} />,
Expand Down Expand Up @@ -1013,6 +1154,73 @@ export const Recipes: Record<RecipeSections, RecipeSection> = {
},
},
},
Allies: {
title: 'Allies',
icon: <FontAwesomeIcon icon={faOliveBranch} />,
recipes: {
Underling: {
name: 'Underling',
icon: <FontAwesomeIcon icon={faPersonSimple} />,
actions: {
[GroupedActionDest.CurrentPlayerIndex]: [
{
action: GameLogAction.REMOVE_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_CARDS,
count: 1,
},
{
action: GameLogAction.ADD_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_FAVORS,
count: 1,
},
],
[GroupedActionDest.SelectedPlayerIndex]: [],
[GroupedActionDest.AllPlayers]: [],
[GroupedActionDest.AllPlayersExceptCurrent]: [],
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
Marquis: {
name: 'Marquis',
actions: {
[GroupedActionDest.CurrentPlayerIndex]: [
{
action: GameLogAction.REMOVE_ACTIONS,
count: 1,
},
{
action: GameLogAction.ADD_BUYS,
count: 1,
},
{
action: GameLogAction.ADD_CARDS,
count: (game: IGame, playerIndex: number) => {
return game.players[playerIndex].turn.cards;
},
},
{
action: GameLogAction.ADD_DISCARD,
count: (game: IGame, playerIndex: number) => {
const currentCards = game.players[playerIndex].turn.cards;
// Calculate how many cards to discard to get down to 10
return currentCards > 10 ? currentCards - 10 : 0;
},
},
],
[GroupedActionDest.SelectedPlayerIndex]: [],
[GroupedActionDest.AllPlayers]: [],
[GroupedActionDest.AllPlayersExceptCurrent]: [],
[GroupedActionDest.AllPlayersExceptSelected]: [],
},
},
},
},
};

type RecipeKeysFromSection<T> = T extends { actions: Record<infer K, IGroupedAction> } ? K : never;
Expand Down
2 changes: 1 addition & 1 deletion src/game/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { IRisingSunFeatures } from '@/game/interfaces/set-features/rising-sun';
import { IExpansionsEnabled } from '@/game/interfaces/expansions-enabled';
import { calculateInitialSunTokens } from '@/game/interfaces/set-mats/prophecy';

export const VERSION_NUMBER = '0.11.0';
export const VERSION_NUMBER = '0.11.1';
export const LAST_COMPATIBLE_SAVE_VERSION = '0.11.0';

export const MIN_PLAYERS = 2;
Expand Down

0 comments on commit 4b26662

Please sign in to comment.