HK: plando charm cost (#431)
* HK: Charm costs in spoiler log now with charm name. * HK: Allow Plando Charm costs * HK: skip unnecessary checks https://github.com/ArchipelagoMW/Archipelago/pull/431#discussion_r847804916
This commit is contained in:
parent
618bdfc917
commit
a4daa78c0b
|
@ -96,12 +96,14 @@ class ShopItemSlots(Range):
|
||||||
range_start = 0
|
range_start = 0
|
||||||
range_end = 30
|
range_end = 30
|
||||||
|
|
||||||
|
|
||||||
class ShopPriceModifier(Range):
|
class ShopPriceModifier(Range):
|
||||||
"""Percentage modifier for shuffled item prices in shops"""
|
"""Percentage modifier for shuffled item prices in shops"""
|
||||||
range_start = 0
|
range_start = 0
|
||||||
default = 100
|
default = 100
|
||||||
range_end = 400
|
range_end = 400
|
||||||
|
|
||||||
|
|
||||||
class WorldState(Choice):
|
class WorldState(Choice):
|
||||||
option_standard = 1
|
option_standard = 1
|
||||||
option_open = 0
|
option_open = 0
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import typing
|
import typing
|
||||||
from .ExtractedData import logic_options, starts, pool_options
|
from .ExtractedData import logic_options, starts, pool_options
|
||||||
from Options import Option, DefaultOnToggle, Toggle, Choice, Range
|
|
||||||
from .Charms import vanilla_costs
|
from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict
|
||||||
|
from .Charms import vanilla_costs, names as charm_names
|
||||||
|
|
||||||
|
|
||||||
class Disabled(Toggle):
|
class Disabled(Toggle):
|
||||||
|
@ -225,6 +226,18 @@ class RandomCharmCosts(Range):
|
||||||
return charms
|
return charms
|
||||||
|
|
||||||
|
|
||||||
|
class PlandoCharmCosts(OptionDict):
|
||||||
|
"""Allows setting a Charm's Notch costs directly, mapping {name: cost}.
|
||||||
|
This is set after any random Charm Notch costs, if applicable."""
|
||||||
|
display_name = "Charm Notch Cost Plando"
|
||||||
|
valid_keys = frozenset(charm_names)
|
||||||
|
|
||||||
|
def get_costs(self, charm_costs: typing.List[int]) -> typing.List[int]:
|
||||||
|
for name, cost in self.value.items():
|
||||||
|
charm_costs[charm_names.index(name)] = cost
|
||||||
|
return charm_costs
|
||||||
|
|
||||||
|
|
||||||
class EggShopSlots(Range):
|
class EggShopSlots(Range):
|
||||||
"""For each slot, add a location to the Egg Shop and a Geo drop to the item pool."""
|
"""For each slot, add a location to the Egg Shop and a Geo drop to the item pool."""
|
||||||
|
|
||||||
|
@ -240,10 +253,11 @@ hollow_knight_options: typing.Dict[str, type(Option)] = {
|
||||||
MaximumGrubPrice.__name__: MaximumGrubPrice,
|
MaximumGrubPrice.__name__: MaximumGrubPrice,
|
||||||
MinimumEssencePrice.__name__: MinimumEssencePrice,
|
MinimumEssencePrice.__name__: MinimumEssencePrice,
|
||||||
MaximumEssencePrice.__name__: MaximumEssencePrice,
|
MaximumEssencePrice.__name__: MaximumEssencePrice,
|
||||||
MinimumEggPrice.__name__: MinimumEggPrice,
|
|
||||||
MaximumEggPrice.__name__: MaximumEggPrice,
|
|
||||||
MinimumCharmPrice.__name__: MinimumCharmPrice,
|
MinimumCharmPrice.__name__: MinimumCharmPrice,
|
||||||
MaximumCharmPrice.__name__: MaximumCharmPrice,
|
MaximumCharmPrice.__name__: MaximumCharmPrice,
|
||||||
RandomCharmCosts.__name__: RandomCharmCosts,
|
RandomCharmCosts.__name__: RandomCharmCosts,
|
||||||
|
PlandoCharmCosts.__name__: PlandoCharmCosts,
|
||||||
|
MinimumEggPrice.__name__: MinimumEggPrice,
|
||||||
|
MaximumEggPrice.__name__: MaximumEggPrice,
|
||||||
EggShopSlots.__name__: EggShopSlots,
|
EggShopSlots.__name__: EggShopSlots,
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,8 @@ class HKWorld(World):
|
||||||
|
|
||||||
def generate_early(self):
|
def generate_early(self):
|
||||||
world = self.world
|
world = self.world
|
||||||
self.charm_costs = world.RandomCharmCosts[self.player].get_costs(world.random)
|
charm_costs = world.RandomCharmCosts[self.player].get_costs(world.random)
|
||||||
|
self.charm_costs = world.PlandoCharmCosts[self.player].get_costs(charm_costs)
|
||||||
world.exclude_locations[self.player].value.update(white_palace_locations)
|
world.exclude_locations[self.player].value.update(white_palace_locations)
|
||||||
world.local_items[self.player].value.add("Mimic_Grub")
|
world.local_items[self.player].value.add("Mimic_Grub")
|
||||||
for vendor, unit in self.shops.items():
|
for vendor, unit in self.shops.items():
|
||||||
|
@ -217,7 +218,12 @@ class HKWorld(World):
|
||||||
options = slot_data["options"] = {}
|
options = slot_data["options"] = {}
|
||||||
for option_name in self.options:
|
for option_name in self.options:
|
||||||
option = getattr(self.world, option_name)[self.player]
|
option = getattr(self.world, option_name)[self.player]
|
||||||
options[option_name] = int(option.value)
|
try:
|
||||||
|
optionvalue = int(option.value)
|
||||||
|
except TypeError:
|
||||||
|
pass # C# side is currently typed as dict[str, int], drop what doesn't fit
|
||||||
|
else:
|
||||||
|
options[option_name] = optionvalue
|
||||||
|
|
||||||
# 32 bit int
|
# 32 bit int
|
||||||
slot_data["seed"] = self.world.slot_seeds[self.player].randint(-2147483647, 2147483646)
|
slot_data["seed"] = self.world.slot_seeds[self.player].randint(-2147483647, 2147483646)
|
||||||
|
|
Loading…
Reference in New Issue