-
Notifications
You must be signed in to change notification settings - Fork 723
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shivers: Add events and fix require puzzle hints logic (#4018)
* Adds some events, renames things, fails for many players. * Adds entrance rules for requires hints. * Cleanup and add goal item. * Cleanup. * Add additional rule. * Event and regions additions. * Updates from merge. * Adds collect behavior option. * Fix missing generator location. * Fix whitespace and optimize imports. * Switch location order back. * Add name replacement for storage. * Fix test failure. * Improve puzzle hints required. * Add missing locations and cleanup indirect conditions. * Fix naming. * PR feedback. * Missed comment. * Cleanup imports, use strings for option equivalence, and update option description. * Fix rule. * Create rolling buffer goal items and remove goal items and location from default options. * Cleanup. * Removes dateutil. * Fixes Subterranean World information plaque.
- Loading branch information
1 parent
218f289
commit 3bcc86f
Showing
10 changed files
with
783 additions
and
461 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import os | ||
import json | ||
import os | ||
import pkgutil | ||
from datetime import datetime | ||
|
||
|
||
def load_data_file(*args) -> dict: | ||
fname = "/".join(["data", *args]) | ||
return json.loads(pkgutil.get_data(__name__, fname).decode()) | ||
|
||
location_id_offset: int = 27000 | ||
|
||
location_info = load_data_file("locations.json") | ||
location_name_to_id = {name: location_id_offset + index \ | ||
for index, name in enumerate(location_info["all_locations"])} | ||
def relative_years_from_today(dt2: datetime) -> int: | ||
today = datetime.now() | ||
years = today.year - dt2.year | ||
if today.month < dt2.month or (today.month == dt2.month and today.day < dt2.day): | ||
years -= 1 | ||
return years | ||
|
||
exclusion_info = load_data_file("excluded_locations.json") | ||
|
||
location_id_offset: int = 27000 | ||
location_info = load_data_file("locations.json") | ||
location_name_to_id = {name: location_id_offset + index for index, name in enumerate(location_info["all_locations"])} | ||
exclusion_info = load_data_file("excluded_locations.json") | ||
region_info = load_data_file("regions.json") | ||
years_since_sep_30_1980 = relative_years_from_today(datetime.fromisoformat("1980-09-30")) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.