Skip to content

Commit 051518e

Browse files
authored
Stardew Valley: Fix unresolved reference warning and unused imports (#4360)
* fix unresolved reference warning and unused imports * revert stuff * just a commit to rerun the tests cuz messenger fail
1 parent b7b78de commit 051518e

File tree

19 files changed

+396
-374
lines changed

19 files changed

+396
-374
lines changed

worlds/stardew_valley/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22
from random import Random
3-
from typing import Dict, Any, Iterable, Optional, List, TextIO
3+
from typing import Dict, Any, Iterable, Optional, List, TextIO, cast
44

55
from BaseClasses import Region, Entrance, Location, Item, Tutorial, ItemClassification, MultiWorld, CollectionState
66
from Options import PerGameCommonOptions
@@ -124,7 +124,7 @@ def create_region(name: str, exits: Iterable[str]) -> Region:
124124
self.options)
125125

126126
def add_location(name: str, code: Optional[int], region: str):
127-
region = world_regions[region]
127+
region: Region = world_regions[region]
128128
location = StardewLocation(self.player, name, code, region)
129129
region.locations.append(location)
130130

@@ -314,9 +314,9 @@ def get_filler_item_rules(self):
314314
include_traps = True
315315
exclude_island = False
316316
for player in link_group["players"]:
317-
player_options = self.multiworld.worlds[player].options
318317
if self.multiworld.game[player] != self.game:
319318
continue
319+
player_options = cast(StardewValleyOptions, self.multiworld.worlds[player].options)
320320
if player_options.trap_items == TrapItems.option_no_traps:
321321
include_traps = False
322322
if player_options.exclude_ginger_island == ExcludeGingerIsland.option_true:

worlds/stardew_valley/bundles/bundle_room.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from .bundle import Bundle, BundleTemplate
66
from ..content import StardewContent
7-
from ..options import BundlePrice, StardewValleyOptions
7+
from ..options import StardewValleyOptions
88

99

1010
@dataclass

worlds/stardew_valley/content/mods/sve.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
from ...mods.mod_data import ModNames
1111
from ...strings.craftable_names import ModEdible
1212
from ...strings.crop_names import Fruit, SVEVegetable, SVEFruit
13-
from ...strings.fish_names import WaterItem, SVEFish, SVEWaterItem
13+
from ...strings.fish_names import WaterItem, SVEWaterItem
1414
from ...strings.flower_names import Flower
1515
from ...strings.food_names import SVEMeal, SVEBeverage
1616
from ...strings.forageable_names import Mushroom, Forageable, SVEForage
1717
from ...strings.gift_names import SVEGift
18-
from ...strings.metal_names import Ore
19-
from ...strings.monster_drop_names import ModLoot, Loot
18+
from ...strings.monster_drop_names import ModLoot
2019
from ...strings.performance_names import Performance
21-
from ...strings.region_names import Region, SVERegion, LogicRegion
20+
from ...strings.region_names import Region, SVERegion
2221
from ...strings.season_names import Season
2322
from ...strings.seed_names import SVESeed
2423
from ...strings.skill_names import Skill
@@ -81,7 +80,8 @@ def harvest_source_hook(self, content: StardewContent):
8180
ModEdible.lightning_elixir: (ShopSource(money_price=12000, shop_region=SVERegion.galmoran_outpost),),
8281
ModEdible.barbarian_elixir: (ShopSource(money_price=22000, shop_region=SVERegion.galmoran_outpost),),
8382
ModEdible.gravity_elixir: (ShopSource(money_price=4000, shop_region=SVERegion.galmoran_outpost),),
84-
SVEMeal.grampleton_orange_chicken: (ShopSource(money_price=650, shop_region=Region.saloon, other_requirements=(RelationshipRequirement(ModNPC.sophia, 6),)),),
83+
SVEMeal.grampleton_orange_chicken: (
84+
ShopSource(money_price=650, shop_region=Region.saloon, other_requirements=(RelationshipRequirement(ModNPC.sophia, 6),)),),
8585
ModEdible.hero_elixir: (ShopSource(money_price=8000, shop_region=SVERegion.isaac_shop),),
8686
ModEdible.aegis_elixir: (ShopSource(money_price=28000, shop_region=SVERegion.galmoran_outpost),),
8787
SVEBeverage.sports_drink: (ShopSource(money_price=750, shop_region=Region.hospital),),
@@ -92,7 +92,8 @@ def harvest_source_hook(self, content: StardewContent):
9292
ForagingSource(regions=(SVERegion.forest_west,), seasons=(Season.summer, Season.fall)), ForagingSource(regions=(SVERegion.sprite_spring_cave,), )
9393
),
9494
Mushroom.purple: (
95-
ForagingSource(regions=(SVERegion.forest_west,), seasons=(Season.fall,)), ForagingSource(regions=(SVERegion.sprite_spring_cave, SVERegion.junimo_woods), )
95+
ForagingSource(regions=(SVERegion.forest_west,), seasons=(Season.fall,)),
96+
ForagingSource(regions=(SVERegion.sprite_spring_cave, SVERegion.junimo_woods), )
9697
),
9798
Mushroom.morel: (
9899
ForagingSource(regions=(SVERegion.forest_west,), seasons=(Season.fall,)), ForagingSource(regions=(SVERegion.sprite_spring_cave,), )
@@ -117,7 +118,8 @@ def harvest_source_hook(self, content: StardewContent):
117118

118119
ModLoot.green_mushroom: (ForagingSource(regions=(SVERegion.highlands_pond,), seasons=Season.not_winter),),
119120
ModLoot.ornate_treasure_chest: (ForagingSource(regions=(SVERegion.highlands_outside,),
120-
other_requirements=(CombatRequirement(Performance.galaxy), ToolRequirement(Tool.axe, ToolMaterial.iron))),),
121+
other_requirements=(
122+
CombatRequirement(Performance.galaxy), ToolRequirement(Tool.axe, ToolMaterial.iron))),),
121123
ModLoot.swirl_stone: (ForagingSource(regions=(SVERegion.crimson_badlands,), other_requirements=(CombatRequirement(Performance.galaxy),)),),
122124
ModLoot.void_soul: (ForagingSource(regions=(SVERegion.crimson_badlands,), other_requirements=(CombatRequirement(Performance.good),)),),
123125
SVEForage.winter_star_rose: (ForagingSource(regions=(SVERegion.summit,), seasons=(Season.winter,)),),
@@ -137,7 +139,8 @@ def harvest_source_hook(self, content: StardewContent):
137139
SVEForage.thistle: (ForagingSource(regions=(SVERegion.summit,)),),
138140
ModLoot.void_pebble: (ForagingSource(regions=(SVERegion.crimson_badlands,), other_requirements=(CombatRequirement(Performance.great),)),),
139141
ModLoot.void_shard: (ForagingSource(regions=(SVERegion.crimson_badlands,),
140-
other_requirements=(CombatRequirement(Performance.galaxy), SkillRequirement(Skill.combat, 10), YearRequirement(3),)),),
142+
other_requirements=(
143+
CombatRequirement(Performance.galaxy), SkillRequirement(Skill.combat, 10), YearRequirement(3),)),),
141144
SVEWaterItem.dulse_seaweed: (ForagingSource(regions=(Region.beach,), other_requirements=(FishingRequirement(Region.beach),)),),
142145

143146
# Fable Reef

worlds/stardew_valley/content/vanilla/qi_board.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from ...data.harvest import HarvestCropSource
77
from ...strings.crop_names import Fruit
88
from ...strings.region_names import Region
9-
from ...strings.season_names import Season
109
from ...strings.seed_names import Seed
1110

1211

worlds/stardew_valley/data/bundle_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ..strings.crop_names import Fruit, Vegetable
1111
from ..strings.currency_names import Currency
1212
from ..strings.fertilizer_names import Fertilizer, RetainingSoil, SpeedGro
13-
from ..strings.fish_names import Fish, WaterItem, Trash, all_fish
13+
from ..strings.fish_names import Fish, WaterItem, Trash
1414
from ..strings.flower_names import Flower
1515
from ..strings.food_names import Beverage, Meal
1616
from ..strings.forageable_names import Forageable, Mushroom
@@ -832,7 +832,7 @@
832832
magic_rock_candy, mega_bomb.as_amount(10), mystery_box.as_amount(10), mixed_seeds.as_amount(50),
833833
strawberry_seeds.as_amount(20),
834834
spicy_eel.as_amount(5), crab_cakes.as_amount(5), eggplant_parmesan.as_amount(5),
835-
pumpkin_soup.as_amount(5), lucky_lunch.as_amount(5),]
835+
pumpkin_soup.as_amount(5), lucky_lunch.as_amount(5)]
836836
calico_bundle = BundleTemplate(CCRoom.bulletin_board, BundleName.calico, calico_items, 2, 2)
837837

838838
raccoon_bundle = BundleTemplate(CCRoom.bulletin_board, BundleName.raccoon, raccoon_foraging_items, 4, 4)

worlds/stardew_valley/data/craftable_data.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ..strings.fish_names import Fish, WaterItem, ModTrash, Trash
1515
from ..strings.flower_names import Flower
1616
from ..strings.food_names import Meal
17-
from ..strings.forageable_names import Forageable, SVEForage, DistantLandsForageable, Mushroom
17+
from ..strings.forageable_names import Forageable, DistantLandsForageable, Mushroom
1818
from ..strings.gift_names import Gift
1919
from ..strings.ingredient_names import Ingredient
2020
from ..strings.machine_names import Machine
@@ -318,7 +318,8 @@ def create_recipe(name: str, ingredients: Dict[str, int], source: RecipeSource,
318318
preservation_chamber = skill_recipe(ModMachine.preservation_chamber, ModSkill.archaeology, 1,
319319
{MetalBar.copper: 1, Material.wood: 15, ArtisanGood.oak_resin: 30},
320320
ModNames.archaeology)
321-
restoration_table = skill_recipe(ModMachine.restoration_table, ModSkill.archaeology, 1, {Material.wood: 15, MetalBar.copper: 1, MetalBar.iron: 1}, ModNames.archaeology)
321+
restoration_table = skill_recipe(ModMachine.restoration_table, ModSkill.archaeology, 1, {Material.wood: 15, MetalBar.copper: 1, MetalBar.iron: 1},
322+
ModNames.archaeology)
322323
preservation_chamber_h = skill_recipe(ModMachine.hardwood_preservation_chamber, ModSkill.archaeology, 6, {MetalBar.copper: 1, Material.hardwood: 15,
323324
ArtisanGood.oak_resin: 30}, ModNames.archaeology)
324325
grinder = skill_recipe(ModMachine.grinder, ModSkill.archaeology, 2, {Artifact.rusty_cog: 10, MetalBar.iron: 5, ArtisanGood.battery_pack: 1},
@@ -330,12 +331,14 @@ def create_recipe(name: str, ingredients: Dict[str, int], source: RecipeSource,
330331
glass_fence = skill_recipe(ModCraftable.glass_fence, ModSkill.archaeology, 7, {Artifact.glass_shards: 5}, ModNames.archaeology)
331332
bone_path = skill_recipe(ModFloor.bone_path, ModSkill.archaeology, 4, {Fossil.bone_fragment: 1}, ModNames.archaeology)
332333
rust_path = skill_recipe(ModFloor.rusty_path, ModSkill.archaeology, 2, {ModTrash.rusty_scrap: 2}, ModNames.archaeology)
333-
rusty_brazier = skill_recipe(ModCraftable.rusty_brazier, ModSkill.archaeology, 3, {ModTrash.rusty_scrap: 10, Material.coal: 1, Material.fiber: 1}, ModNames.archaeology)
334+
rusty_brazier = skill_recipe(ModCraftable.rusty_brazier, ModSkill.archaeology, 3, {ModTrash.rusty_scrap: 10, Material.coal: 1, Material.fiber: 1},
335+
ModNames.archaeology)
334336
bone_fence = skill_recipe(ModCraftable.bone_fence, ModSkill.archaeology, 8, {Fossil.bone_fragment: 2}, ModNames.archaeology)
335337
water_shifter = skill_recipe(ModCraftable.water_shifter, ModSkill.archaeology, 4, {Material.wood: 40, MetalBar.copper: 4}, ModNames.archaeology)
336338
wooden_display = skill_recipe(ModCraftable.wooden_display, ModSkill.archaeology, 1, {Material.wood: 25}, ModNames.archaeology)
337339
hardwood_display = skill_recipe(ModCraftable.hardwood_display, ModSkill.archaeology, 7, {Material.hardwood: 10}, ModNames.archaeology)
338-
lucky_ring = skill_recipe(Ring.lucky_ring, ModSkill.archaeology, 8, {Artifact.elvish_jewelry: 1, AnimalProduct.rabbit_foot: 5, Mineral.tigerseye: 1}, ModNames.archaeology)
340+
lucky_ring = skill_recipe(Ring.lucky_ring, ModSkill.archaeology, 8, {Artifact.elvish_jewelry: 1, AnimalProduct.rabbit_foot: 5, Mineral.tigerseye: 1},
341+
ModNames.archaeology)
339342
volcano_totem = skill_recipe(ModConsumable.volcano_totem, ModSkill.archaeology, 9, {Material.cinder_shard: 5, Artifact.rare_disc: 1, Artifact.dwarf_gadget: 1},
340343
ModNames.archaeology)
341344
haste_elixir = shop_recipe(ModEdible.haste_elixir, SVERegion.alesia_shop, 35000, {Loot.void_essence: 35, ModLoot.void_soul: 5, Ingredient.sugar: 1,

0 commit comments

Comments
 (0)