Skip to content

Commit

Permalink
- Allow Bundle Plando for vault money bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
agilbert1412 committed Jun 22, 2024
1 parent ab76fd7 commit 6d02ab8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
4 changes: 2 additions & 2 deletions worlds/stardew_valley/bundles/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def can_appear(self, options: StardewValleyOptions) -> bool:

class MoneyBundleTemplate(CurrencyBundleTemplate):

def __init__(self, room: str, item: BundleItem):
super().__init__(room, "", item)
def __init__(self, room: str, default_name: str, item: BundleItem):
super().__init__(room, default_name, item)

def create_bundle(self, random: Random, content: StardewContent, options: StardewValleyOptions) -> Bundle:
currency_amount = self.get_currency_amount(options.bundle_price)
Expand Down
10 changes: 5 additions & 5 deletions worlds/stardew_valley/data/bundle_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@
night_fish_bundle_thematic, crab_pot_bundle_thematic, specialty_fish_bundle_thematic]
fish_tank_bundles_remixed = [*fish_tank_bundles_thematic, spring_fish_bundle, summer_fish_bundle, fall_fish_bundle, winter_fish_bundle, trash_bundle,
rain_fish_bundle, quality_fish_bundle, master_fisher_bundle, legendary_fish_bundle, tackle_bundle, bait_bundle,
specific_bait_bundle, fish_smoker_bundle]
specific_bait_bundle, deep_fishing_bundle, fish_smoker_bundle]

# In Remixed, the trash items are in the recycling bundle, so we don't use the thematic version of the crab pot bundle that added trash items to it
fish_tank_bundles_remixed.remove(crab_pot_bundle_thematic)
Expand Down Expand Up @@ -868,10 +868,10 @@
vault_10000_gold = BundleItem.money_bundle(10000)
vault_25000_gold = BundleItem.money_bundle(25000)

vault_2500_bundle = MoneyBundleTemplate(CCRoom.vault, vault_2500_gold)
vault_5000_bundle = MoneyBundleTemplate(CCRoom.vault, vault_5000_gold)
vault_10000_bundle = MoneyBundleTemplate(CCRoom.vault, vault_10000_gold)
vault_25000_bundle = MoneyBundleTemplate(CCRoom.vault, vault_25000_gold)
vault_2500_bundle = MoneyBundleTemplate(CCRoom.vault, BundleName.money_2500, vault_2500_gold)
vault_5000_bundle = MoneyBundleTemplate(CCRoom.vault, BundleName.money_5000, vault_5000_gold)
vault_10000_bundle = MoneyBundleTemplate(CCRoom.vault, BundleName.money_10000, vault_10000_gold)
vault_25000_bundle = MoneyBundleTemplate(CCRoom.vault, BundleName.money_25000, vault_25000_gold)

vault_gambler_items = BundleItem(Currency.qi_coin, 10000)
vault_gambler_bundle = CurrencyBundleTemplate(CCRoom.vault, BundleName.gambler, vault_gambler_items)
Expand Down
4 changes: 4 additions & 0 deletions worlds/stardew_valley/strings/bundle_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class BundleName:
bartender = cc_bundle("Bartender's Bundle")
calico = cc_bundle("Calico Bundle")
raccoon = cc_bundle("Raccoon Bundle")
money_2500 = cc_bundle("2,500g Bundle")
money_5000 = cc_bundle("5,000g Bundle")
money_10000 = cc_bundle("10,000g Bundle")
money_25000 = cc_bundle("25,000g Bundle")
gambler = cc_bundle("Gambler's Bundle")
carnival = cc_bundle("Carnival Bundle")
walnut_hunter = cc_bundle("Walnut Hunter Bundle")
Expand Down
22 changes: 21 additions & 1 deletion worlds/stardew_valley/test/TestBundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,27 @@ def test_quality_fish_have_correct_quality(self):
self.assertEqual(bundle_item.quality, FishQuality.gold)


class TestRemixedAnywhereBundlesLogic(SVTestBase):
class TestRemixedPlandoBundles(SVTestBase):
plando_bundles = {BundleName.money_2500, BundleName.money_5000, BundleName.money_10000, BundleName.gambler, BundleName.ocean_fish,
BundleName.lake_fish, BundleName.deep_fishing, BundleName.spring_fish, BundleName.legendary_fish, BundleName.bait}
options = {
BundleRandomization: BundleRandomization.option_remixed,
BundlePlando: frozenset(plando_bundles)
}

def test_all_plando_bundles_are_there(self):
location_names = {location.name for location in self.multiworld.get_locations()}
for bundle_name in self.plando_bundles:
with self.subTest(f"{bundle_name}"):
self.assertIn(bundle_name, location_names)
self.assertNotIn(BundleName.money_25000, location_names)
self.assertNotIn(BundleName.carnival, location_names)
self.assertNotIn(BundleName.night_fish, location_names)
self.assertNotIn(BundleName.specialty_fish, location_names)
self.assertNotIn(BundleName.specific_bait, location_names)


class TestRemixedAnywhereBundles(SVTestBase):
fish_bundle_names = {BundleName.spring_fish, BundleName.summer_fish, BundleName.fall_fish, BundleName.winter_fish, BundleName.ocean_fish,
BundleName.lake_fish, BundleName.river_fish, BundleName.night_fish, BundleName.legendary_fish, BundleName.specialty_fish,
BundleName.bait, BundleName.specific_bait, BundleName.crab_pot, BundleName.tackle, BundleName.quality_fish,
Expand Down

0 comments on commit 6d02ab8

Please sign in to comment.