Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stardew Valley 6.x.x: The Content Update #3478

Merged
merged 328 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
328 commits
Select commit Hold shift + click to select a range
4002fd7
- Added missing commas in csv 3
agilbert1412 May 3, 2024
89356ec
- Removed deprecated test
agilbert1412 May 6, 2024
fa75f9a
- Add pans
agilbert1412 May 7, 2024
1793061
- Fixed duplicate ID
agilbert1412 May 7, 2024
5a6c799
- Fixed gold quality seaweed
agilbert1412 May 7, 2024
ab3672f
- Fixed quality bundles amounts and added related test
agilbert1412 May 7, 2024
be28203
- Added art of crabbing as a festival reward
agilbert1412 May 8, 2024
1276913
- Fixes and additions related to the new Pan tool and its upgrades
agilbert1412 May 8, 2024
23f89c5
- Add meadowlands farm and related start inventory
agilbert1412 May 8, 2024
4591470
- Don't forget, & is not and
agilbert1412 May 8, 2024
d36541c
add forageable as wineable
Jouramie May 8, 2024
8eb0d3c
remove all fruits from str
Jouramie May 8, 2024
4c5685f
- Added disabled mods for 1.6
agilbert1412 May 8, 2024
5865aa5
- Add prize tickets for help wanted quests
agilbert1412 May 8, 2024
b7d823c
- Add Mr Qi's Plane ride
agilbert1412 May 8, 2024
d89f0bf
- Added booksanity locations
agilbert1412 May 9, 2024
bc4a090
- Set booksanity rules
agilbert1412 May 9, 2024
cf5d116
- Added booksanity items
agilbert1412 May 9, 2024
6d16009
- Add booksanity to real presets and test presets
agilbert1412 May 9, 2024
7fc4e35
- Fixed some tests
agilbert1412 May 9, 2024
bf7fdc8
- Fixed an intermittent failure on meadowlands farm
agilbert1412 May 9, 2024
cd4584d
juice/
Jouramie May 10, 2024
39fde94
fix coffee
Jouramie May 10, 2024
0a2964d
- Lost books should be received as progressive instead
agilbert1412 May 11, 2024
1de3b4d
- First lost book starts unlocked, apparently
agilbert1412 May 11, 2024
6cc8660
cleanup tests options
Jouramie May 11, 2024
2c9043b
add seasons to seed shop in Oasis
Jouramie May 11, 2024
0aebabe
- Clean csv
agilbert1412 May 11, 2024
a98be3d
split regions and logic regions
Jouramie May 11, 2024
63d6bcf
split farming region by season
Jouramie May 12, 2024
d15af90
add events for farming by season
Jouramie May 12, 2024
3d00e9b
2
Jouramie May 12, 2024
4bf45a6
maybe that will fix it
Jouramie May 12, 2024
9aa4084
fix relative imports
Jouramie May 12, 2024
836cefd
- Enabled the mods that the community has marked as functional
agilbert1412 May 13, 2024
f51936f
- Remove duplicate Calico egg item
agilbert1412 May 15, 2024
9c44491
- Allow generating any mods in tests
agilbert1412 May 15, 2024
7ddfd83
- Added the Pot of gold as a location
agilbert1412 May 16, 2024
7400c7a
- Split TestGeneration into two files
agilbert1412 May 16, 2024
955df9c
- Update location counts
agilbert1412 May 16, 2024
bb44b21
- Added leprechaun hat as a filler item
agilbert1412 May 16, 2024
bdc70b2
skip mod perf testing
Jouramie May 16, 2024
3c0b7d7
do not count event in total progression item
Jouramie May 16, 2024
e8931c1
create logic event for ore and metal bar
Jouramie May 16, 2024
92e23f6
explain dig in logic events
Jouramie May 17, 2024
1e085d9
simplify logic event creation
Jouramie May 17, 2024
07442a0
remove duplicated rules
Jouramie May 18, 2024
90fbf7b
fix stability
Jouramie May 18, 2024
aa6f862
- Fixed mastery logic rules I think
agilbert1412 May 19, 2024
390893b
- Created Tool Source (Jé please look at this one)
agilbert1412 May 19, 2024
386cf27
- Fixed the name of the Skull Cave Casserole
agilbert1412 May 19, 2024
371d1fa
- Apparently there was no craftsanity location for Deluxe Bait
agilbert1412 May 20, 2024
e765ced
- Fixes and improvements to flavored items shipsanity
agilbert1412 May 20, 2024
ed1ec60
- Add Targeted bait logic
agilbert1412 May 20, 2024
f9c223f
- Added quest "Feeding Animals" and related code
agilbert1412 May 20, 2024
2a0a6eb
- Add default archipelago ids to the export script for locations
agilbert1412 May 20, 2024
a7f2026
- Updated pan logic to require various levels of it for decent odds a…
agilbert1412 May 21, 2024
f6612fc
- Improved the calico bundle
agilbert1412 May 22, 2024
f1605ee
- Incorporate item amounts into bundle prices
agilbert1412 May 22, 2024
a45c302
improve repr in explain
Jouramie May 24, 2024
869762c
- Increased the number of Trout Derby locations
agilbert1412 May 24, 2024
1de316e
- Added Craft Bait Maker craftsanity locations
agilbert1412 May 24, 2024
85df178
rework generic tool source
Jouramie May 25, 2024
52ac828
fix event usage in has progression percent
Jouramie May 25, 2024
68bea82
add time rule for item grind
Jouramie May 25, 2024
261b3f6
improve progression percent
Jouramie May 25, 2024
d4ce6f0
- Fixed a conflict thingy
agilbert1412 May 25, 2024
9f7032b
fix tests
Jouramie May 25, 2024
0d691eb
reimplement booksanity to be a feature
Jouramie May 26, 2024
096e58f
progressive lost book as contant
Jouramie May 26, 2024
704809c
add requirement to purchase way of the wind pt 2
Jouramie May 26, 2024
cefc818
add tool and skill requirement for woodys secret
Jouramie May 26, 2024
9f9371a
add mystery box source
Jouramie May 26, 2024
7b5f5e1
add artifact trove source
Jouramie May 26, 2024
4c58c9f
add prize tickets source
Jouramie May 26, 2024
ed34a4f
add fishing treasure chests source
Jouramie May 26, 2024
2b750b4
proper fule for monster compendium
Jouramie May 26, 2024
1cfc286
proper rule for art o crabbing
Jouramie May 26, 2024
4d3eded
rename test option presets
Jouramie May 27, 2024
b52449b
remove dirty state option from test, it was not doing much...
Jouramie May 27, 2024
12d228c
improve reuse of cached world in tests
Jouramie May 27, 2024
52ec0be
- Create Walnutsanity options
agilbert1412 May 17, 2024
76c77fc
- Created Walnutsanity locations
agilbert1412 May 17, 2024
97e2056
- Added walnut items
agilbert1412 May 25, 2024
2fa609e
- Added walnut logic (incomplete)
agilbert1412 May 25, 2024
bab8083
- removed some resource pack strength
agilbert1412 May 25, 2024
8ca06fa
- Finished walnutsanity logic
agilbert1412 May 25, 2024
d682f31
- Created the custom logic rule for total received walnuts
agilbert1412 May 25, 2024
f6928ed
- Improved/Fixed the walnutsanity tests, and then the actual code fro…
agilbert1412 May 25, 2024
e9f5a00
- Fix an accidental override
agilbert1412 May 25, 2024
3b5ec6f
- Remove walnutsanity from presets until that works
agilbert1412 May 25, 2024
d384153
- Add option groups
agilbert1412 May 26, 2024
4d09beb
- Fixed some tests and stuff
agilbert1412 May 26, 2024
1207845
- Force exclude walnutsanity if the island is turned off
agilbert1412 May 26, 2024
a640fc2
- Add a comment about walnutsanity + Greatest walnut hunter
agilbert1412 May 26, 2024
0de0a03
Post merge fixes
agilbert1412 May 27, 2024
c5d9e0e
halve tests time
Jouramie May 27, 2024
0ec23bc
add walnutsanity to test option preset
Jouramie May 27, 2024
83bc880
rename stuff
Jouramie May 27, 2024
5307056
- Fixed a missing walnut and a missing rule
agilbert1412 May 28, 2024
70c6171
I need an adult
agilbert1412 May 28, 2024
bebd42f
- Fixed Cioppino
agilbert1412 May 28, 2024
8458cce
- Fixed two small logic errors
agilbert1412 May 29, 2024
77ab202
- Renamed to Free Cactis
agilbert1412 May 29, 2024
61ad5c4
- Rename the location to Free Cactis
agilbert1412 May 29, 2024
accee7e
- Fixed missing can_meet in the received hearts method
agilbert1412 May 29, 2024
9fd54de
- Fixed cactis name
agilbert1412 May 29, 2024
26ba0da
- Added 296 booksanity tests to find one bug, then fixed the bug
agilbert1412 May 29, 2024
37b868b
- I fell down a hole and then fixed a lot of rabbits
agilbert1412 May 30, 2024
b53af7c
- Prevent dried grapes (not raisins) from appearing in bundles
agilbert1412 May 30, 2024
70f123b
- Slight nerf to bundle prices
agilbert1412 May 30, 2024
1408604
- Slight improvement to fish farmer bundle
agilbert1412 May 30, 2024
68ba244
- Added raisins to the dry bundle
agilbert1412 May 30, 2024
b124489
- Added targeted bait to bundles
agilbert1412 May 31, 2024
47605cf
- Turned a specific failure case from long tests into a few short tests
agilbert1412 May 31, 2024
3246dd2
- Fixed mystery boxes recursive logic
agilbert1412 May 31, 2024
6d7bf0e
- Added a base method to the tests, plus print the default test seed
agilbert1412 May 31, 2024
fc80e12
- Reworked buffs completely
agilbert1412 Jun 1, 2024
0a34562
- Slight fixes
agilbert1412 Jun 1, 2024
e97ae12
create skill in content pack, not really using them yet
Jouramie May 28, 2024
45f8f10
reset location fill after test
Jouramie Jun 1, 2024
22be0c3
comment stuff because main is broken
Jouramie Jun 1, 2024
0a6224b
fix duplicated ids
Jouramie Jun 1, 2024
d91ce4f
hopefully this will fix it cuz I'm kinda out of ideas...
Jouramie Jun 1, 2024
93dde70
make sure ginger island is enabled when testing qi board
Jouramie Jun 1, 2024
078b507
- Changed Special Orders to be flags so that people can ask for cheap…
agilbert1412 Jun 1, 2024
a4cdaa2
- Renamed Cheap to Short because it makes more sense
agilbert1412 Jun 1, 2024
b758668
- Add documentation for the permanent buffs
agilbert1412 Jun 1, 2024
247d4c8
- Fixed an inverted logic condition
agilbert1412 Jun 1, 2024
a507ee4
- Git be dumb, Me fix
agilbert1412 Jun 1, 2024
be19609
- Enabled some mods so I can test them
agilbert1412 Jun 1, 2024
1b22038
- ER buildings without house
agilbert1412 Jun 1, 2024
8ed737c
- take into account the new setting in places
agilbert1412 Jun 1, 2024
8d9fca6
- re disabled jasper cause it's weird
agilbert1412 Jun 1, 2024
afe472b
- Add time rules for bookseller regions to make them less early
agilbert1412 Jun 3, 2024
feb7395
- Increased max time progression percent to 48
agilbert1412 Jun 3, 2024
1681953
Add new Archaeology content and strings
Witchybun Jun 5, 2024
6eb34a0
Add new recipe data
Witchybun Jun 5, 2024
82aa673
Add logic for one item sorry Jouramie
Witchybun Jun 5, 2024
1d40789
New book logic ty Jouramie
Witchybun Jun 5, 2024
cd578a2
Remove some mods from the banlist
Witchybun Jun 5, 2024
2441f6e
Fix duplicate ID
Witchybun Jun 5, 2024
6780379
- The a few presets should have progressive elevator
agilbert1412 Jun 5, 2024
11f640a
- Create Green Rain bundle and targeted baits bundle
agilbert1412 Jun 5, 2024
e5e0ffc
= Split TestRules into a bunch of files so they are easier to manage
agilbert1412 Jun 5, 2024
34823e4
- Try to fix a problem with the total prog item count in many tests. …
agilbert1412 Jun 5, 2024
835963c
Move order, fix typo
Witchybun Jun 5, 2024
dedf6b3
me dum can no refactor
Witchybun Jun 5, 2024
0b9197d
Fix the other typo
Witchybun Jun 6, 2024
e3e46ca
I never learn do I
Witchybun Jun 6, 2024
e1603da
- Don't run tests for mods that aren't currently enabled anyway
agilbert1412 Jun 6, 2024
5a35413
i think that was the missing piece
Jouramie Jun 6, 2024
2a19056
- Update number of locations
agilbert1412 Jun 6, 2024
4c5c2ec
- Update Documentation
agilbert1412 Jun 6, 2024
6e73e6b
- Enabled Jasper
agilbert1412 Jun 6, 2024
7eecfe8
replace print with logger
Jouramie Jun 6, 2024
748cfe7
this should probably fix flake8
Jouramie Jun 6, 2024
bc16970
this should probably fix flake8
Jouramie Jun 6, 2024
819263a
this should probably fix flake8
Jouramie Jun 6, 2024
5f09cc2
just remove the entrance name from logging
Jouramie Jun 6, 2024
a241adf
remove caching from that flaky test
Jouramie Jun 6, 2024
113a483
- Make sure bundle prices never go over 8 items regardless of setting…
agilbert1412 Jun 7, 2024
d876489
- Fixed the farming experience rule not requiring seeds
agilbert1412 Jun 7, 2024
387c528
add test for master angler + sve without quests
Jouramie Jun 9, 2024
2bb8db4
add long test for all mods+no_quest for all goal + other options
Jouramie Jun 9, 2024
03dc00a
- Split the rule_assert so we can breakpoint it more easily
agilbert1412 Jun 9, 2024
e2f3d32
- Fixed some SVE items that should always be in the item pool, but no…
agilbert1412 Jun 9, 2024
f0e74b0
- Changed the debug test to the SVE buggy settings
agilbert1412 Jun 9, 2024
4bb2c90
- Fixed a Bear's Knowledge mod
agilbert1412 Jun 9, 2024
6e4c0b7
- Fixed a Deep woods logic bug where it wanted to receive luck levels…
agilbert1412 Jun 9, 2024
72ece71
- Woops, was using the wrong constant (isn't the whole point of const…
agilbert1412 Jun 9, 2024
64830c5
- Set some distant lands and boarding house recipes with the correct …
agilbert1412 Jun 9, 2024
0bb5805
- Fixed a bug where a shop recipe with a heart requirement was requir…
agilbert1412 Jun 9, 2024
9a23724
remove unused code
Jouramie Jun 9, 2024
5a9fad3
remove dead code
Jouramie Jun 9, 2024
ecfd7e0
- Fixed Archaeology link in documentation
agilbert1412 Jun 9, 2024
2a4bb3f
add wiki link to masteries
Jouramie Jun 9, 2024
e105bfc
- Apparently Ayeisha changed the name of one quest, so here's a fix
agilbert1412 Jun 9, 2024
6a63a77
remove dead code
Jouramie Jun 9, 2024
5161c52
- Fixed the Ayeisha quest name in the logic too
agilbert1412 Jun 9, 2024
93461ec
remove dead code
Jouramie Jun 9, 2024
5b7f0fe
year two is unlocked after one year, not two you dummy
Jouramie Jun 9, 2024
a80d6d5
move item override from sve to content pack
Jouramie Jun 9, 2024
718a5e7
fix stability tests
Jouramie Jun 9, 2024
1b63685
uncomment test no longer failing
Jouramie Jun 9, 2024
16849c4
clean up commented seed
Jouramie Jun 9, 2024
a6ddf52
- fix villager names
agilbert1412 Jun 10, 2024
2fe5768
- Remove strange unfinished comment
agilbert1412 Jun 11, 2024
0de3fe4
- Remove redundant Mixins to TimeLogic
agilbert1412 Jun 11, 2024
9df97e9
- Improved dinosaur egg logic
agilbert1412 Jun 12, 2024
fb75559
rename artisan equipment source to crafting source
Jouramie Jun 13, 2024
96913a0
remove max level to skills
Jouramie Jun 13, 2024
05af2ee
check specificly if pet is randomized
Jouramie Jun 13, 2024
158038d
- Enabled the OptionSets in presets
agilbert1412 Jun 12, 2024
9def4c9
- Add winter to Qi Fruit growth
agilbert1412 Jun 13, 2024
d1d7b68
- Add foraging source to red mushroom in the mines
agilbert1412 Jun 13, 2024
b94128b
- Simplify bundles with 10 moss
agilbert1412 Jun 13, 2024
5bb1a12
- Simplify crafting logic conditions
agilbert1412 Jun 13, 2024
98baab6
- Delete unused method
agilbert1412 Jun 13, 2024
d112f62
- Fixed the harvest source to know how to handle winter crops
agilbert1412 Jun 13, 2024
478b66f
add some items to early item given some settings
Jouramie Jun 14, 2024
78ba38c
do not add coop as a protential item candidate if farm type is meadow…
Jouramie Jun 14, 2024
5243e61
remove prints in early items
Jouramie Jun 14, 2024
b45e43a
fishing rod only candidate when fishsanity is enabled; add furnace re…
Jouramie Jun 14, 2024
a7968a8
- Implement new Power user feature: Bundle Plando, available from the…
agilbert1412 Jun 19, 2024
8e4c832
- Fixed documentation on bundle plando
agilbert1412 Jun 19, 2024
a9b37ce
- Added new bundle setting: remixed_anywhere
agilbert1412 Jun 19, 2024
bda0f4e
- Added a test, and subsequently fixed a bug, where mod skill levels …
agilbert1412 Jun 19, 2024
a991706
- Fixed duplicate rule on the desert festival
agilbert1412 Jun 19, 2024
7ef44c8
Fix da bone
Witchybun Jun 20, 2024
38219dd
- Fixed artifacts and minerals being too early in spheres
agilbert1412 Jun 20, 2024
c78f5c3
- Add Nudge Trap
agilbert1412 Jun 20, 2024
d6f3930
- Improved the logic for the "common" minerals
agilbert1412 Jun 21, 2024
1dbac79
- Add a test that each raccoon bundle location requires reaching prev…
agilbert1412 Jun 21, 2024
ba99aba
- Fixed a bug where the raccoon bundle locations didn't require previ…
agilbert1412 Jun 21, 2024
59b6741
- Allow Bundle Plando for vault money bundles
agilbert1412 Jun 22, 2024
8a2f857
- Enable green rain bundle
agilbert1412 Jun 22, 2024
35b8be6
- Add a few resource pack items
agilbert1412 Jun 26, 2024
28525c4
- Add more resource packs
agilbert1412 Jun 26, 2024
cfffc73
- Fixed cave jelly bug
agilbert1412 Jun 28, 2024
068dc0b
- Fixed hearts logic sometimes forgetting to check the actual values
agilbert1412 Jun 28, 2024
0f750cc
- Fixed another bug in the hearts logic
agilbert1412 Jun 28, 2024
4da60a1
- Documented better
agilbert1412 Jun 28, 2024
d9668bb
add artifact spot rule and use if for jack_be_nimble_jack_be_thick
Jouramie Jun 29, 2024
695fcc3
- Fix fishing level logic for Goby and the waterfall as a whole
agilbert1412 Jun 30, 2024
17e775e
- Fixed bad constant
agilbert1412 Jun 30, 2024
9bceeba
- Fixed duplicates in CSVs, added a test for it
agilbert1412 Jul 1, 2024
9ed7755
Merge branch 'main' into StardewValley/6.x.x
Jouramie Jul 3, 2024
fad1a6a
Fix Jasper dating, add DEPRECATED location group
Witchybun Jun 26, 2024
a3f7be2
Remove dulse, add binning recipes
Witchybun Jul 4, 2024
59f7bca
Revert "Fix Jasper dating, add DEPRECATED location group"
Witchybun Jul 4, 2024
0964265
Rework binning logic
Witchybun Jul 4, 2024
68252c6
You KNOW I forget this shit
Witchybun Jul 4, 2024
fa5d40c
Fix Dulse Seaweed stuff
Witchybun Jul 4, 2024
e96fac3
Add binning recipe items
Witchybun Jul 4, 2024
e9b0700
Fix other logic and tests
Witchybun Jul 4, 2024
adc2e6f
Tons of mod name fixes
Witchybun Jul 5, 2024
9de2f3e
Fix test erroring due to dulse
Witchybun Jul 5, 2024
7294d5a
The Return of the Shifter
Witchybun Jul 5, 2024
04467be
Fix Seed Names
Witchybun Jul 5, 2024
d9d460c
Utilize different method for logic
Witchybun Jul 5, 2024
efc61e1
Fix names for item rules oops
Witchybun Jul 5, 2024
4387eed
Utilize variable for values
Witchybun Jul 5, 2024
62e2389
- Fixed using the skill instead of mod name, as the mod of the recipe
agilbert1412 Jul 5, 2024
15a3603
- Removed can craft by name, no longer used
agilbert1412 Jul 5, 2024
6509aea
Merge pull request #25 from Witchybun/FixItems
agilbert1412 Jul 5, 2024
211a545
- Add a unit test to check that all mod names in the csv are valid mo…
agilbert1412 Jul 5, 2024
ee9c26c
- A couple bushes were in the wrong region
agilbert1412 Jul 6, 2024
09bf3e6
- Fixed a couple more dig site and professor snail oversights. Thanks…
agilbert1412 Jul 6, 2024
967ae15
- Simplify some rules after I was informed you do not need a magnifyi…
agilbert1412 Jul 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 76 additions & 23 deletions worlds/stardew_valley/__init__.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import logging
from typing import Dict, Any, Iterable, Optional, Union, List, TextIO

from BaseClasses import Region, Entrance, Location, Item, Tutorial, ItemClassification, MultiWorld
from BaseClasses import Region, Entrance, Location, Item, Tutorial, ItemClassification, MultiWorld, CollectionState
from Options import PerGameCommonOptions
from worlds.AutoWorld import World, WebWorld
from . import rules
from .bundles.bundle_room import BundleRoom
from .bundles.bundles import get_all_bundles
from .content import content_packs, StardewContent, unpack_content, create_content
from .early_items import setup_early_items
from .items import item_table, create_items, ItemData, Group, items_by_group, get_all_filler_items, remove_limited_amount_packs
from .locations import location_table, create_locations, LocationData, locations_by_tag
from .logic.bundle_logic import BundleLogic
from .logic.logic import StardewLogic
from .logic.time_logic import MAX_MONTHS
from .option_groups import sv_option_groups
from .options import StardewValleyOptions, SeasonRandomization, Goal, BundleRandomization, BundlePrice, NumberOfLuckBuffs, NumberOfMovementBuffs, \
BackpackProgression, BuildingProgression, ExcludeGingerIsland, TrapItems, EntranceRandomization
from .options import StardewValleyOptions, SeasonRandomization, Goal, BundleRandomization, BundlePrice, EnabledFillerBuffs, NumberOfMovementBuffs, \
BackpackProgression, BuildingProgression, ExcludeGingerIsland, TrapItems, EntranceRandomization, FarmType, Walnutsanity
from .presets import sv_options_presets
from .regions import create_regions
from .rules import set_rules
from .stardew_rule import True_, StardewRule, HasProgressionPercent
from .stardew_rule import True_, StardewRule, HasProgressionPercent, true_
from .strings.ap_names.event_names import Event
from .strings.entrance_names import Entrance as EntranceName
from .strings.goal_names import Goal as GoalName
from .strings.region_names import Region as RegionName
from .strings.metal_names import Ore
from .strings.region_names import Region as RegionName, LogicRegion

client_version = 0

Expand Down Expand Up @@ -77,6 +79,7 @@ class StardewValleyWorld(World):

options_dataclass = StardewValleyOptions
options: StardewValleyOptions
content: StardewContent
logic: StardewLogic

web = StardewWebWorld()
Expand All @@ -94,6 +97,7 @@ def __init__(self, multiworld: MultiWorld, player: int):

def generate_early(self):
self.force_change_options_if_incompatible()
self.content = create_content(self.options)

def force_change_options_if_incompatible(self):
goal_is_walnut_hunter = self.options.goal == Goal.option_greatest_walnut_hunter
Expand All @@ -106,6 +110,11 @@ def force_change_options_if_incompatible(self):
player_name = self.multiworld.player_name[self.player]
logging.warning(
f"Goal '{goal_name}' requires Ginger Island. Exclude Ginger Island setting forced to 'False' for player {self.player} ({player_name})")
if exclude_ginger_island and self.options.walnutsanity != Walnutsanity.preset_none:
self.options.walnutsanity.value = Walnutsanity.preset_none
player_name = self.multiworld.player_name[self.player]
logging.warning(
f"Walnutsanity requires Ginger Island. Ginger Island was excluded from {self.player} ({player_name})'s world, so walnutsanity was force disabled")

def create_regions(self):
def create_region(name: str, exits: Iterable[str]) -> Region:
Expand All @@ -115,21 +124,23 @@ def create_region(name: str, exits: Iterable[str]) -> Region:

world_regions, world_entrances, self.randomized_entrances = create_regions(create_region, self.random, self.options)

self.logic = StardewLogic(self.player, self.options, world_regions.keys())
self.logic = StardewLogic(self.player, self.options, self.content, world_regions.keys())
self.modified_bundles = get_all_bundles(self.random,
self.logic,
self.content,
self.options)

def add_location(name: str, code: Optional[int], region: str):
region = world_regions[region]
location = StardewLocation(self.player, name, code, region)
region.locations.append(location)

create_locations(add_location, self.modified_bundles, self.options, self.random)
create_locations(add_location, self.modified_bundles, self.options, self.content, self.random)
self.multiworld.regions.extend(world_regions.values())

def create_items(self):
self.precollect_starting_season()
self.precollect_farm_type_items()
items_to_exclude = [excluded_items
for excluded_items in self.multiworld.precollected_items[self.player]
if not item_table[excluded_items.name].has_any_group(Group.RESOURCE_PACK,
Expand All @@ -143,7 +154,7 @@ def create_items(self):
for location in self.multiworld.get_locations(self.player)
if location.address is not None])

created_items = create_items(self.create_item, self.delete_item, locations_count, items_to_exclude, self.options,
created_items = create_items(self.create_item, self.delete_item, locations_count, items_to_exclude, self.options, self.content,
self.random)

self.multiworld.itempool += created_items
Expand Down Expand Up @@ -173,10 +184,15 @@ def precollect_starting_season(self):
starting_season = self.create_starting_item(self.random.choice(season_pool))
self.multiworld.push_precollected(starting_season)

def precollect_farm_type_items(self):
if self.options.farm_type == FarmType.option_meadowlands and self.options.building_progression & BuildingProgression.option_progressive:
self.multiworld.push_precollected(self.create_starting_item("Progressive Coop"))

def setup_player_events(self):
self.setup_construction_events()
self.setup_quest_events()
self.setup_action_events()
self.setup_logic_events()

def setup_construction_events(self):
can_construct_buildings = LocationData(None, RegionName.carpenter, Event.can_construct_buildings)
Expand All @@ -187,10 +203,26 @@ def setup_quest_events(self):
self.create_event_location(start_dark_talisman_quest, self.logic.wallet.has_rusty_key(), Event.start_dark_talisman_quest)

def setup_action_events(self):
can_ship_event = LocationData(None, RegionName.shipping, Event.can_ship_items)
self.create_event_location(can_ship_event, True_(), Event.can_ship_items)
can_ship_event = LocationData(None, LogicRegion.shipping, Event.can_ship_items)
self.create_event_location(can_ship_event, true_, Event.can_ship_items)
can_shop_pierre_event = LocationData(None, RegionName.pierre_store, Event.can_shop_at_pierre)
self.create_event_location(can_shop_pierre_event, True_(), Event.can_shop_at_pierre)
self.create_event_location(can_shop_pierre_event, true_, Event.can_shop_at_pierre)

spring_farming = LocationData(None, LogicRegion.spring_farming, Event.spring_farming)
self.create_event_location(spring_farming, true_, Event.spring_farming)
summer_farming = LocationData(None, LogicRegion.summer_farming, Event.summer_farming)
self.create_event_location(summer_farming, true_, Event.summer_farming)
fall_farming = LocationData(None, LogicRegion.fall_farming, Event.fall_farming)
self.create_event_location(fall_farming, true_, Event.fall_farming)
winter_farming = LocationData(None, LogicRegion.winter_farming, Event.winter_farming)
self.create_event_location(winter_farming, true_, Event.winter_farming)

def setup_logic_events(self):
def register_event(name: str, region: str, rule: StardewRule):
event_location = LocationData(None, region, name)
self.create_event_location(event_location, rule, name)

self.logic.setup_events(register_event)

def setup_victory(self):
if self.options.goal == Goal.option_community_center:
Expand All @@ -211,7 +243,7 @@ def setup_victory(self):
Event.victory)
elif self.options.goal == Goal.option_master_angler:
self.create_event_location(location_table[GoalName.master_angler],
self.logic.fishing.can_catch_every_fish_in_slot(self.get_all_location_names()),
self.logic.fishing.can_catch_every_fish_for_fishsanity(),
Event.victory)
elif self.options.goal == Goal.option_complete_collection:
self.create_event_location(location_table[GoalName.complete_museum],
Expand Down Expand Up @@ -270,18 +302,13 @@ def create_item(self, item: Union[str, ItemData], override_classification: ItemC
if override_classification is None:
override_classification = item.classification

if override_classification == ItemClassification.progression and item.name != Event.victory:
if override_classification == ItemClassification.progression:
self.total_progression_items += 1
# if item.name not in self.all_progression_items:
# self.all_progression_items[item.name] = 0
# self.all_progression_items[item.name] += 1
return StardewItem(item.name, override_classification, item.code, self.player)

def delete_item(self, item: Item):
if item.classification & ItemClassification.progression:
self.total_progression_items -= 1
# if item.name in self.all_progression_items:
# self.all_progression_items[item.name] -= 1

def create_starting_item(self, item: Union[str, ItemData]) -> StardewItem:
if isinstance(item, str):
Expand All @@ -299,7 +326,11 @@ def create_event_location(self, location_data: LocationData, rule: StardewRule =
location = StardewLocation(self.player, location_data.name, None, region)
location.access_rule = rule
region.locations.append(location)
location.place_locked_item(self.create_item(item))
location.place_locked_item(StardewItem(item, ItemClassification.progression, None, self.player))

# This is not ideal, but the rule count them so...
if item != Event.victory:
self.total_progression_items += 1

def set_rules(self):
set_rules(self)
Expand Down Expand Up @@ -358,7 +389,7 @@ def add_bundles_to_spoiler_log(self, spoiler_handle: TextIO):
quality = ""
else:
quality = f" ({item.quality.split(' ')[0]})"
spoiler_handle.write(f"\t\t{item.amount}x {item.item_name}{quality}\n")
spoiler_handle.write(f"\t\t{item.amount}x {item.get_item()}{quality}\n")

def add_entrances_to_spoiler_log(self):
if self.options.entrance_randomization == EntranceRandomization.option_disabled:
Expand All @@ -373,9 +404,9 @@ def fill_slot_data(self) -> Dict[str, Any]:
for bundle in room.bundles:
bundles[room.name][bundle.name] = {"number_required": bundle.number_required}
for i, item in enumerate(bundle.items):
bundles[room.name][bundle.name][i] = f"{item.item_name}|{item.amount}|{item.quality}"
bundles[room.name][bundle.name][i] = f"{item.get_item()}|{item.amount}|{item.quality}"

excluded_options = [BundleRandomization, NumberOfMovementBuffs, NumberOfLuckBuffs]
excluded_options = [BundleRandomization, NumberOfMovementBuffs, EnabledFillerBuffs]
excluded_option_names = [option.internal_name for option in excluded_options]
generic_option_names = [option_name for option_name in PerGameCommonOptions.type_hints]
excluded_option_names.extend(generic_option_names)
Expand All @@ -385,7 +416,29 @@ def fill_slot_data(self) -> Dict[str, Any]:
"seed": self.random.randrange(1000000000), # Seed should be max 9 digits
"randomized_entrances": self.randomized_entrances,
"modified_bundles": bundles,
"client_version": "5.0.0",
"client_version": "6.0.0",
})

return slot_data

def collect(self, state: CollectionState, item: StardewItem) -> bool:
change = super().collect(state, item)
if change:
state.prog_items[self.player][Event.received_walnuts] += self.get_walnut_amount(item.name)
return change

def remove(self, state: CollectionState, item: StardewItem) -> bool:
change = super().remove(state, item)
if change:
state.prog_items[self.player][Event.received_walnuts] -= self.get_walnut_amount(item.name)
return change

@staticmethod
def get_walnut_amount(item_name: str) -> int:
if item_name == "Golden Walnut":
return 1
if item_name == "3 Golden Walnuts":
return 3
if item_name == "5 Golden Walnuts":
return 5
return 0
Loading
Loading