Once support for optional win conditions (see #17) is merged via #34, we can start building on top of the feature by adding a win condition to reach multiple optional conditions. This is fun because we can set up optional conditions like:
And then define a win condition that requires reaching three optional conditions to win the game. Together with secret conditions, this opens up exciting possibilities for map scenarios where you might have to discover hidden optional conditions to win the game.
This task is about implementing a new win criteria and condition called "OptionalConditionAmount" which should have a players
and amount
field (next to the default fields like reward
and hidden
). I believe that based on #34, this condition should also be possible to be optional
, even though that might be slightly confusing when used.
WinConditions.tsx
for data structures and where to add a new win condition. Check out other win conditions that have an "amount" field. Ideally the validation for this win condition should verify that the number of optional conditions defined for the map is higher or equal to the "amount" specified on the win condition. For that validateWinCondition
should be changed to take the number of win conditions of the map.checkWinCondition.tsx
for checking whether a condition was meet. checkWinCondition
should look for an ActionResponse of type OptionalCondition
and then go through all win conditions to check if the player or any player within the team completed
enough win conditions.PlayerCard
to show how many optional conditions were reached by the team compared to the amount, similar to the other conditions that are shown there. Feel free to pick an icon from https://icones.js.org/collection/pixelarticons or otherwise use a placeholder and I'll make a fitting one.TypeScript via pnpm tsc
should guide you through adding various pieces of code once you add the win condition.
Note: This win condition should be triggered if enough optional conditions are fulfilled by the player or anyone on the same team. Therefore the check in checkWinCondition
should look for each condition's completed
set and check if the player id match the same team as the player who unlocked the optional condition via map.matchesTeam(actionResponse.toPlayer, completedPlayerID)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too