[Sudoku] Added new BK mode game (#910)

Co-authored-by: Hussein Farran <hmfarran@gmail.com>
Co-authored-by: SoldierofOrder <107806872+SoldierofOrder@users.noreply.github.com>
This commit is contained in:
Jarno 2022-10-13 07:55:00 +02:00 committed by GitHub
parent b014ce082b
commit e708bea819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 3 deletions

View File

@ -82,7 +82,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
longest_name = max(len(text) for text in AutoWorld.AutoWorldRegister.world_types)
numlength = 8
for name, cls in AutoWorld.AutoWorldRegister.world_types.items():
if not cls.hidden:
if not cls.hidden and len(cls.item_names) > 0:
logger.info(f" {name:{longest_name}}: {len(cls.item_names):3} "
f"Items (IDs: {min(cls.item_id_to_name):{numlength}} - "
f"{max(cls.item_id_to_name):{numlength}}) | "

View File

@ -8,7 +8,7 @@ class TestImplemented(unittest.TestCase):
def testCompletionCondition(self):
"""Ensure a completion condition is set that has requirements."""
for gamename, world_type in AutoWorldRegister.world_types.items():
if not world_type.hidden and gamename not in {"ArchipIDLE", "Final Fantasy"}:
if not world_type.hidden and gamename not in {"ArchipIDLE", "Final Fantasy", "Sudoku"}:
with self.subTest(gamename):
world = setup_default_world(world_type)
self.assertFalse(world.completion_condition[1](world.state))

View File

@ -28,7 +28,7 @@ class TestBase(unittest.TestCase):
def testEmptyStateCanReachSomething(self):
for game_name, world_type in AutoWorldRegister.world_types.items():
# Final Fantasy logic is controlled by finalfantasyrandomizer.com
if game_name != "Archipelago" and game_name != "Final Fantasy":
if game_name not in {"Archipelago", "Final Fantasy", "Sudoku"}:
with self.subTest("Game", game=game_name):
world = setup_default_world(world_type)
state = CollectionState(world)

View File

@ -0,0 +1,33 @@
from BaseClasses import Tutorial
from ..AutoWorld import World, WebWorld
from typing import Dict
class Bk_SudokuWebWorld(WebWorld):
settings_page = "games/Sudoku/info/en"
theme = 'partyTime'
tutorials = [
Tutorial(
tutorial_name='Setup Guide',
description='A guide to playing BK Sudoku',
language='English',
file_name='setup_en.md',
link='guide/en',
authors=['Jarno']
)
]
class Bk_SudokuWorld(World):
"""
Play a little Sudoku while you're in BK mode to maybe get some useful hints
"""
game = "Sudoku"
web = Bk_SudokuWebWorld()
item_name_to_id: Dict[str, int] = {}
location_name_to_id: Dict[str, int] = {}
@classmethod
def stage_assert_generate(cls, world):
raise Exception("BK Sudoku cannot be used for generating worlds, the client can instead connect to any other world")

View File

@ -0,0 +1,13 @@
# Bk Sudoku
## What is this game?
BK Sudoku is not a typical Archipelago game; instead, it is a generic Sudoku client that can connect to any existing multiworld. When connected, you can play Sudoku to unlock random hints for your game. While slow, it will give you something to do when you can't reach the checks in your game.
## What hints are unlocked?
After completing a Sudoku puzzle, the game will unlock 1 random hint for an unchecked location in the slot you are connected to. It is possible to hint the same location repeatedly if that location is still unchecked.
## Where is the settings page?
There is no settings page; this game cannot be used in your .yamls. Instead, the client can connect to any slot in a multiworld.

View File

@ -0,0 +1,24 @@
# BK Sudoku Setup Guide
## Required Software
- [Bk Sudoku](https://github.com/Jarno458/sudoku)
- [.Net 6](https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net60)
## General Concept
This is a client that can connect to any multiworld slot, and lets you play Sudoku to unlock random hints for that slot's locations.
Due to the fact that the Sudoku client may connect to any slot, it is not necessary to generate a YAML for this game as it does not generate any new slots in the multiworld session.
## Installation Procedures
Go to the latest release on [BK Sudoku Releases](https://github.com/Jarno458/sudoku/releases). Download and extract the `Bk_Sudoku.zip` file.
## Joining a MultiWorld Game
1. Run Bk_Sudoku.exe
2. Enter the name of the slot you wish to connect to
3. Enter the server url & port number
4. Press connect
5. Choose difficulty
6. Try to solve the Sudoku