Skip to content

Commit

Permalink
Merge branch 'main' into StardewValley/stardew-text-client
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouramie authored Jul 4, 2024
2 parents 6168034 + 315e0c8 commit 0d11c51
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 15 deletions.
4 changes: 2 additions & 2 deletions MultiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ def _cmd_remaining(self) -> bool:
if self.ctx.remaining_mode == "enabled":
remaining_item_ids = get_remaining(self.ctx, self.client.team, self.client.slot)
if remaining_item_ids:
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.client.slot.game][item_id]
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.ctx.games[self.client.slot]][item_id]
for item_id in remaining_item_ids))
else:
self.output("No remaining items found.")
Expand All @@ -1365,7 +1365,7 @@ def _cmd_remaining(self) -> bool:
if self.ctx.client_game_state[self.client.team, self.client.slot] == ClientStatus.CLIENT_GOAL:
remaining_item_ids = get_remaining(self.ctx, self.client.team, self.client.slot)
if remaining_item_ids:
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.client.slot.game][item_id]
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.ctx.games[self.client.slot]][item_id]
for item_id in remaining_item_ids))
else:
self.output("No remaining items found.")
Expand Down
2 changes: 1 addition & 1 deletion worlds/generic/docs/setup_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Some steps also assume use of Windows, so may vary with your OS.
## Installing the Archipelago software

The most recent public release of Archipelago can be found on GitHub:
[Archipelago Lastest Release](https://github.com/ArchipelagoMW/Archipelago/releases/latest).
[Archipelago Latest Release](https://github.com/ArchipelagoMW/Archipelago/releases/latest).

Run the exe file, and after accepting the license agreement you will be asked which components you would like to
install.
Expand Down
6 changes: 3 additions & 3 deletions worlds/zillion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ def generate_early(self) -> None:
self._item_counts = item_counts

with redirect_stdout(self.lsi): # type: ignore
self.zz_system.make_randomizer(zz_op)

self.zz_system.seed(self.multiworld.seed)
self.zz_system.set_options(zz_op)
self.zz_system.seed(self.random.randrange(1999999999))
self.zz_system.make_map()
self.zz_system.make_randomizer()

# just in case the options changed anything (I don't think they do)
assert self.zz_system.randomizer, "init failed"
Expand Down
34 changes: 26 additions & 8 deletions worlds/zillion/options.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from collections import Counter
from dataclasses import dataclass
from typing import ClassVar, Dict, Tuple
from typing import ClassVar, Dict, Literal, Tuple
from typing_extensions import TypeGuard # remove when Python >= 3.10

from Options import Choice, DefaultOnToggle, NamedRange, OptionGroup, PerGameCommonOptions, Range, Toggle
from Options import Choice, DefaultOnToggle, NamedRange, OptionGroup, PerGameCommonOptions, Range, Removed, Toggle

from zilliandomizer.options import (
Options as ZzOptions, char_to_gun, char_to_jump, ID,
Expand Down Expand Up @@ -251,9 +251,25 @@ class ZillionStartingCards(NamedRange):
}


class ZillionRoomGen(Toggle):
""" whether to generate rooms with random terrain """
display_name = "room generation"
class ZillionMapGen(Choice):
"""
- none: vanilla map
- rooms: random terrain inside rooms, but path through base is vanilla
- full: random path through base
"""
display_name = "map generation"
option_none = 0
option_rooms = 1
option_full = 2
default = 0

def zz_value(self) -> Literal['none', 'rooms', 'full']:
if self.value == ZillionMapGen.option_none:
return "none"
if self.value == ZillionMapGen.option_rooms:
return "rooms"
assert self.value == ZillionMapGen.option_full
return "full"


@dataclass
Expand All @@ -276,7 +292,9 @@ class ZillionOptions(PerGameCommonOptions):
early_scope: ZillionEarlyScope
skill: ZillionSkill
starting_cards: ZillionStartingCards
room_gen: ZillionRoomGen
map_gen: ZillionMapGen

room_gen: Removed


z_option_groups = [
Expand Down Expand Up @@ -375,7 +393,7 @@ def validate(options: ZillionOptions) -> "Tuple[ZzOptions, Counter[str]]":

starting_cards = options.starting_cards

room_gen = options.room_gen
map_gen = options.map_gen.zz_value()

zz_item_counts = convert_item_counts(item_counts)
zz_op = ZzOptions(
Expand All @@ -393,7 +411,7 @@ def validate(options: ZillionOptions) -> "Tuple[ZzOptions, Counter[str]]":
bool(options.early_scope.value),
True, # balance defense
starting_cards.value,
bool(room_gen.value)
map_gen
)
zz_validate(zz_op)
return zz_op, item_counts
2 changes: 1 addition & 1 deletion worlds/zillion/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
zilliandomizer @ git+https://github.com/beauxq/zilliandomizer@1dd2ce01c9d818caba5844529699b3ad026d6a07#0.7.1
zilliandomizer @ git+https://github.com/beauxq/zilliandomizer@4a2fec0aa1c529df866e510cdfcf6dca4d53679b#0.8.0
typing-extensions>=4.7, <5

0 comments on commit 0d11c51

Please sign in to comment.