A Short Hike: Add new options and option groups (#3410)

* A Short Hike: New options and stuff

* Add to slot data for poptracker

* Address concerns

* Address concerns

* Fix indentations

* Update option description

* Address all issues

* Group "or"s
This commit is contained in:
chandler05
2024-06-05 17:50:30 -05:00
committed by GitHub
parent be03dca774
commit c554c3fdae
5 changed files with 302 additions and 168 deletions

View File

@@ -1,12 +1,11 @@
from collections import Counter
from typing import ClassVar, Dict, Any, Type
from BaseClasses import Region, Location, Item, Tutorial
from BaseClasses import ItemClassification, Region, Location, Item, Tutorial
from Options import PerGameCommonOptions
from worlds.AutoWorld import World, WebWorld
from .Items import item_table, group_table, base_id
from .Locations import location_table
from .Rules import create_rules, get_min_feathers
from .Options import ShortHikeOptions
from .Options import ShortHikeOptions, shorthike_option_groups
class ShortHikeWeb(WebWorld):
theme = "ocean"
@@ -18,6 +17,7 @@ class ShortHikeWeb(WebWorld):
"setup/en",
["Chandler"]
)]
option_groups = shorthike_option_groups
class ShortHikeWorld(World):
"""
@@ -47,9 +47,14 @@ class ShortHikeWorld(World):
item_id: int = self.item_name_to_id[name]
id = item_id - base_id - 1
return ShortHikeItem(name, item_table[id]["classification"], item_id, player=self.player)
classification = item_table[id]["classification"]
if self.options.easier_races and name == "Running Shoes":
classification = ItemClassification.progression
return ShortHikeItem(name, classification, item_id, player=self.player)
def create_items(self) -> None:
itempool = []
for item in item_table:
count = item["count"]
@@ -57,18 +62,28 @@ class ShortHikeWorld(World):
continue
else:
for i in range(count):
self.multiworld.itempool.append(self.create_item(item["name"]))
itempool.append(self.create_item(item["name"]))
feather_count = self.options.golden_feathers
if self.options.goal == 1 or self.options.goal == 3:
if feather_count < 12:
feather_count = 12
junk = 45 - self.options.silver_feathers - feather_count - self.options.buckets
self.multiworld.itempool += [self.create_item(self.get_filler_item_name()) for _ in range(junk)]
self.multiworld.itempool += [self.create_item("Golden Feather") for _ in range(feather_count)]
self.multiworld.itempool += [self.create_item("Silver Feather") for _ in range(self.options.silver_feathers)]
self.multiworld.itempool += [self.create_item("Bucket") for _ in range(self.options.buckets)]
itempool += [self.create_item("Golden Feather") for _ in range(feather_count)]
itempool += [self.create_item("Silver Feather") for _ in range(self.options.silver_feathers)]
itempool += [self.create_item("Bucket") for _ in range(self.options.buckets)]
itempool += [self.create_item("Stick") for _ in range(self.options.sticks)]
itempool += [self.create_item("Toy Shovel") for _ in range(self.options.toy_shovels)]
if self.options.random_walkie_talkie:
itempool.append(self.create_item("Walkie Talkie"))
else:
self.multiworld.get_location("Lose Race Gift", self.player).place_locked_item(self.create_item("Walkie Talkie"))
junk = len(self.multiworld.get_unfilled_locations(self.player)) - len(itempool)
itempool += [self.create_item(self.get_filler_item_name()) for _ in range(junk)]
self.multiworld.itempool += itempool
def create_regions(self) -> None:
menu_region = Region("Menu", self.player, self.multiworld)
@@ -92,20 +107,23 @@ class ShortHikeWorld(World):
self.multiworld.completion_condition[self.player] = lambda state: state.has("Golden Feather", self.player, 12)
elif self.options.goal == "races":
# Races
self.multiworld.completion_condition[self.player] = lambda state: (state.has("Golden Feather", self.player, get_min_feathers(self, 7, 9))
or (state.has("Bucket", self.player) and state.has("Golden Feather", self.player, 7)))
self.multiworld.completion_condition[self.player] = lambda state: state.can_reach_location("Hawk Peak Race Reward", self.player)
elif self.options.goal == "help_everyone":
# Help Everyone
self.multiworld.completion_condition[self.player] = lambda state: (state.has("Golden Feather", self.player, 12)
and state.has("Toy Shovel", self.player) and state.has("Camping Permit", self.player)
and state.has("Motorboat Key", self.player) and state.has("Headband", self.player)
and state.has("Wristwatch", self.player) and state.has("Seashell", self.player, 15)
and state.has("Shell Necklace", self.player))
self.multiworld.completion_condition[self.player] = lambda state: (state.can_reach_location("Collect 15 Seashells", self.player)
and state.has("Golden Feather", self.player, 12)
and state.can_reach_location("Tough Bird Salesman (400 Coins)", self.player)
and state.can_reach_location("Ranger May Shell Necklace Golden Feather", self.player)
and state.can_reach_location("Sue the Rabbit Shoes Reward", self.player)
and state.can_reach_location("Wristwatch Trade", self.player)
and state.can_reach_location("Return Camping Permit", self.player)
and state.can_reach_location("Boat Challenge Reward", self.player)
and state.can_reach_location("Shovel Kid Trade", self.player)
and state.can_reach_location("Purchase Sunhat", self.player)
and state.can_reach_location("Artist Golden Feather", self.player))
elif self.options.goal == "fishmonger":
# Fishmonger
self.multiworld.completion_condition[self.player] = lambda state: (state.has("Golden Feather", self.player, get_min_feathers(self, 7, 9))
or (state.has("Bucket", self.player) and state.has("Golden Feather", self.player, 7))
and state.has("Fishing Rod", self.player))
self.multiworld.completion_condition[self.player] = lambda state: state.can_reach_location("Catch All Fish Reward", self.player)
def set_rules(self):
create_rules(self, location_table)
@@ -117,6 +135,9 @@ class ShortHikeWorld(World):
"goal": int(options.goal),
"logicLevel": int(options.golden_feather_progression),
"costMultiplier": int(options.cost_multiplier),
"shopCheckLogic": int(options.shop_check_logic),
"minShopCheckLogic": int(options.min_shop_check_logic),
"easierRaces": bool(options.easier_races),
}
slot_data = {