SoE: update to v042 and balancing changes (#1125)

* SoE: rebalancing and cleanup

* ModuleUpdate: make url detection more generic

* SoE: change item rules to depend on target player difficulty

* SoE: Update to pyevermizer 0.41.0

* adds footknight
* adds location difficulty

* SoE: minor optimization in item rule

if .. in is faster with sets

* SoE: drop support of patch format v3

* SoE: fix some typing and warnings

* SoE: cleanup imports
This commit is contained in:
black-sliver
2022-10-21 23:26:40 +02:00
committed by GitHub
parent 40c3ef35c7
commit 04b6c31076
6 changed files with 157 additions and 86 deletions

View File

@@ -1,18 +1,33 @@
import typing
from Options import Option, Range, Choice, Toggle, DefaultOnToggle, AssembleOptions, DeathLink, ProgressionBalancing
from Options import Range, Choice, Toggle, DefaultOnToggle, AssembleOptions, DeathLink, ProgressionBalancing
# typing boilerplate
class FlagsProtocol(typing.Protocol):
value: int
default: int
flags: typing.List[str]
class FlagProtocol(typing.Protocol):
value: int
default: int
flag: str
# meta options
class EvermizerFlags:
flags: typing.List[str]
def to_flag(self) -> str:
def to_flag(self: FlagsProtocol) -> str:
return self.flags[self.value]
class EvermizerFlag:
flag: str
def to_flag(self) -> str:
def to_flag(self: FlagProtocol) -> str:
return self.flag if self.value != self.default else ''
@@ -23,6 +38,7 @@ class OffOnFullChoice(Choice):
alias_chaos = 2
# actual options
class Difficulty(EvermizerFlags, Choice):
"""Changes relative spell cost and stuff"""
display_name = "Difficulty"
@@ -168,6 +184,7 @@ class TrapCount(Range):
default = 0
# more meta options
class ItemChanceMeta(AssembleOptions):
def __new__(mcs, name, bases, attrs):
if 'item_name' in attrs:
@@ -183,6 +200,7 @@ class TrapChance(Range, metaclass=ItemChanceMeta):
default = 20
# more actual options
class TrapChanceQuake(TrapChance):
"""Sets the chance/ratio of quake traps"""
item_name = "Quake Trap"
@@ -210,11 +228,12 @@ class TrapChanceOHKO(TrapChance):
class SoEProgressionBalancing(ProgressionBalancing):
default = 30
__doc__ = ProgressionBalancing.__doc__.replace(f"default {ProgressionBalancing.default}", f"default {default}")
__doc__ = ProgressionBalancing.__doc__.replace(f"default {ProgressionBalancing.default}", f"default {default}") \
if ProgressionBalancing.__doc__ else None
special_range_names = {**ProgressionBalancing.special_range_names, "normal": default}
soe_options: typing.Dict[str, type(Option)] = {
soe_options: typing.Dict[str, AssembleOptions] = {
"difficulty": Difficulty,
"energy_core": EnergyCore,
"required_fragments": RequiredFragments,