mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
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:
@@ -1,4 +1,5 @@
|
||||
from worlds.generic.Rules import forbid_items_for_player, add_rule
|
||||
from worlds.shorthike.Options import Goal, GoldenFeatherProgression, MinShopCheckLogic, ShopCheckLogic
|
||||
|
||||
def create_rules(self, location_table):
|
||||
multiworld = self.multiworld
|
||||
@@ -11,11 +12,23 @@ def create_rules(self, location_table):
|
||||
forbid_items_for_player(multiworld.get_location(loc["name"], player), self.item_name_groups['Maps'], player)
|
||||
add_rule(multiworld.get_location(loc["name"], player),
|
||||
lambda state: state.has("Shovel", player))
|
||||
|
||||
# Shop Rules
|
||||
if loc["purchase"] and not options.coins_in_shops:
|
||||
forbid_items_for_player(multiworld.get_location(loc["name"], player), self.item_name_groups['Coins'], player)
|
||||
if loc["purchase"] >= get_min_shop_logic_cost(self) and options.shop_check_logic != ShopCheckLogic.option_nothing:
|
||||
if options.shop_check_logic in {ShopCheckLogic.option_fishing_rod, ShopCheckLogic.option_fishing_rod_and_shovel}:
|
||||
add_rule(multiworld.get_location(loc["name"], player),
|
||||
lambda state: state.has("Progressive Fishing Rod", player))
|
||||
if options.shop_check_logic in {ShopCheckLogic.option_golden_fishing_rod, ShopCheckLogic.option_golden_fishing_rod_and_shovel}:
|
||||
add_rule(multiworld.get_location(loc["name"], player),
|
||||
lambda state: state.has("Progressive Fishing Rod", player, 2))
|
||||
if options.shop_check_logic in {ShopCheckLogic.option_shovel, ShopCheckLogic.option_fishing_rod_and_shovel, ShopCheckLogic.option_golden_fishing_rod_and_shovel}:
|
||||
add_rule(multiworld.get_location(loc["name"], player),
|
||||
lambda state: state.has("Shovel", player))
|
||||
|
||||
# Minimum Feather Rules
|
||||
if options.golden_feather_progression != 2:
|
||||
if options.golden_feather_progression != GoldenFeatherProgression.option_hard:
|
||||
min_feathers = get_min_feathers(self, loc["minGoldenFeathers"], loc["minGoldenFeathersEasy"])
|
||||
|
||||
if options.buckets > 0 and loc["minGoldenFeathersBucket"] < min_feathers:
|
||||
@@ -32,11 +45,11 @@ def create_rules(self, location_table):
|
||||
|
||||
# Fishing Rules
|
||||
add_rule(multiworld.get_location("Catch 3 Fish Reward", player),
|
||||
lambda state: state.has("Fishing Rod", player))
|
||||
lambda state: state.has("Progressive Fishing Rod", player))
|
||||
add_rule(multiworld.get_location("Catch Fish with Permit", player),
|
||||
lambda state: state.has("Fishing Rod", player))
|
||||
lambda state: state.has("Progressive Fishing Rod", player))
|
||||
add_rule(multiworld.get_location("Catch All Fish Reward", player),
|
||||
lambda state: state.has("Fishing Rod", player))
|
||||
lambda state: state.has("Progressive Fishing Rod", player, 2))
|
||||
|
||||
# Misc Rules
|
||||
add_rule(multiworld.get_location("Return Camping Permit", player),
|
||||
@@ -59,15 +72,34 @@ def create_rules(self, location_table):
|
||||
lambda state: state.has("Stick", player))
|
||||
add_rule(multiworld.get_location("Beachstickball (30 Hits)", player),
|
||||
lambda state: state.has("Stick", player))
|
||||
|
||||
# Race Rules
|
||||
if options.easier_races:
|
||||
add_rule(multiworld.get_location("Lighthouse Race Reward", player),
|
||||
lambda state: state.has("Running Shoes", player))
|
||||
add_rule(multiworld.get_location("Old Building Race Reward", player),
|
||||
lambda state: state.has("Running Shoes", player))
|
||||
add_rule(multiworld.get_location("Hawk Peak Race Reward", player),
|
||||
lambda state: state.has("Running Shoes", player))
|
||||
|
||||
def get_min_feathers(self, min_golden_feathers, min_golden_feathers_easy):
|
||||
options = self.options
|
||||
|
||||
min_feathers = min_golden_feathers
|
||||
if options.golden_feather_progression == 0:
|
||||
if options.golden_feather_progression == GoldenFeatherProgression.option_easy:
|
||||
min_feathers = min_golden_feathers_easy
|
||||
if min_feathers > options.golden_feathers:
|
||||
if options.goal != 1 and options.goal != 3:
|
||||
if options.goal not in {Goal.option_help_everyone, Goal.option_photo}:
|
||||
min_feathers = options.golden_feathers
|
||||
|
||||
return min_feathers
|
||||
|
||||
def get_min_shop_logic_cost(self):
|
||||
options = self.options
|
||||
|
||||
if options.min_shop_check_logic == MinShopCheckLogic.option_40_coins:
|
||||
return 40
|
||||
elif options.min_shop_check_logic == MinShopCheckLogic.option_100_coins:
|
||||
return 100
|
||||
elif options.min_shop_check_logic == MinShopCheckLogic.option_400_coins:
|
||||
return 400
|
||||
|
Reference in New Issue
Block a user