Skip to content

Commit

Permalink
Merge pull request #113 from communitycenter/update-recipe-data
Browse files Browse the repository at this point in the history
Apparently the cooking air date math was off
  • Loading branch information
Esummins committed Jun 1, 2024
2 parents 322f6ce + 5865c2c commit cc4b146
Show file tree
Hide file tree
Showing 3 changed files with 845 additions and 212 deletions.
4 changes: 3 additions & 1 deletion scripts/cooking.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

# Purpose: Get all the recipes needed to cook for achievement, along with their
# unlock conditions and ingredients
# Result is saved to data/cooking.json
Expand All @@ -16,7 +18,7 @@
# load the content files
OBJECTS: dict[str, Object] = load_data("objects.json")
COOKING_RECIPES: dict[str, str] = load_content("CookingRecipes.json")
TV_RECIPES: dict[str, str] = load_content("CookingChannel.json")
TV_RECIPES: dict[str, str] = load_content("TV/CookingChannel.json")

# hardcoded checks for recipes with unusual unlock conditions
# l 100, null
Expand Down
13 changes: 7 additions & 6 deletions scripts/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,16 @@ def get_tv_airing_date(key: int) -> str:
Returns:
str: A string in the format "Spring 7, Year 1".
"""
seasons = ["Spring", "Summer", "Fall", "Winter"]
day = (key * 7) % 28
if day == 0:
day = 28
# Dropping key from 1 indexed to 0 indexed
key_idx = key - 1
day_key = key_idx % 4
day = (day_key + 1) * 7

season_idx = (key - 1) // 4
seasons = ["Spring", "Summer", "Fall", "Winter"]
season_idx = key_idx // 4
season = seasons[season_idx % 4]

year = (key * 7) // 112 + 1
year = key_idx // 16 + 1

return f"{season} {day}, Year {year}"

Expand Down
Loading

0 comments on commit cc4b146

Please sign in to comment.