Skip to content

Commit 062cad5

Browse files
authored
Merge pull request ArchipelagoMW#2 from gaithern/adding-journal-checks
Adding journal checks
2 parents 8e3ad14 + 91b4e73 commit 062cad5

File tree

8 files changed

+673
-720
lines changed

8 files changed

+673
-720
lines changed

data/lua/connector_khcom.lua

+174-227
Large diffs are not rendered by default.

worlds/khcom/Client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ async def game_watcher(ctx: KHCOMContext):
156156
for file in files:
157157
if file.find("send") > -1:
158158
st = file.split("send", -1)[1]
159-
sending = sending+[(int(st))]
159+
if st != "nil":
160+
sending = sending+[(int(st))]
160161
if file.find("victory") > -1:
161162
victory = True
162163
ctx.locations_checked = sending

worlds/khcom/Items.py

+119-121
Large diffs are not rendered by default.

worlds/khcom/Locations.py

+154-116
Large diffs are not rendered by default.

worlds/khcom/Options.py

-7
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
from Options import Choice, Range, Option, Toggle, DeathLink, DefaultOnToggle, OptionSet
44

5-
class EnemyCards(Toggle):
6-
"""
7-
Should progression checks be included for enemy cards?
8-
"""
9-
display_name = "Enemy Cards Checks Hold Progression"
10-
115
class PrioritizeBosses(Toggle):
126
"""
137
Should boss location prioritize holding friend cards?
@@ -16,6 +10,5 @@ class PrioritizeBosses(Toggle):
1610

1711

1812
khcom_options: Dict[str, type(Option)] = {
19-
"enemy_cards": EnemyCards,
2013
"prioritize_bosses": PrioritizeBosses,
2114
}

worlds/khcom/Regions.py

+156-173
Large diffs are not rendered by default.

worlds/khcom/Rules.py

+55-71
Large diffs are not rendered by default.

worlds/khcom/__init__.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from BaseClasses import Tutorial
44
from worlds.AutoWorld import WebWorld, World
55
from .Items import KHCOMItem, KHCOMItemData, event_item_table, get_items_by_category, item_table
6-
from .Locations import KHCOMLocation, location_table
6+
from .Locations import KHCOMLocation, location_table, get_locations_by_category
77
from .Options import khcom_options
88
from .Regions import create_regions
99
from .Rules import set_rules
1010
from worlds.LauncherComponents import Component, components, Type, launch_subprocess
11+
import random
1112

1213

1314

@@ -54,15 +55,23 @@ def fill_slot_data(self) -> dict:
5455

5556
def create_items(self):
5657
item_pool: List[KHCOMItem] = []
58+
starting_locations = get_locations_by_category("Starting")
59+
starting_locations = random.sample(list(starting_locations.keys()),3)
60+
starting_worlds = get_items_by_category("World Unlocks")
61+
starting_worlds = random.sample(list(starting_worlds.keys()),3)
62+
i = 0
63+
while i < 3:
64+
self.multiworld.get_location(starting_locations[i], self.player).place_locked_item(self.create_item(starting_worlds[i]))
65+
i = i + 1
5766
total_locations = len(self.multiworld.get_unfilled_locations(self.player))
5867
for name, data in item_table.items():
5968
quantity = data.max_quantity
6069

6170
# Ignore filler, it will be added in a later stage.
6271
if data.category == "Filler":
6372
continue
64-
65-
item_pool += [self.create_item(name) for _ in range(0, quantity)]
73+
if name not in starting_worlds:
74+
item_pool += [self.create_item(name) for _ in range(0, quantity)]
6675

6776
# Fill any empty locations with filler items.
6877
while len(item_pool) < total_locations:
@@ -74,7 +83,7 @@ def get_filler_item_name(self) -> str:
7483
fillers = get_items_by_category("Filler")
7584
weights = [data.weight for data in fillers.values()]
7685
return self.multiworld.random.choices([filler for filler in fillers.keys()], weights, k=1)[0]
77-
86+
7887
def create_item(self, name: str) -> KHCOMItem:
7988
data = item_table[name]
8089
return KHCOMItem(name, data.classification, data.code, self.player)

0 commit comments

Comments
 (0)