KH: what? yeah, it's HK (#420)
* KH: what? yeah, it's HK someone this hadn't been spotted yet. * KH: also fix the start AST Node, just in case we add those in at some point (currently they resolve to True/False anyway)
This commit is contained in:
parent
f2055daf1a
commit
2def8f35ad
|
@ -107,7 +107,7 @@ class Absorber(ast.NodeTransformer):
|
||||||
return ast.Constant(False, ctx=node.ctx)
|
return ast.Constant(False, ctx=node.ctx)
|
||||||
if node.id in logic_options:
|
if node.id in logic_options:
|
||||||
return ast.Call(
|
return ast.Call(
|
||||||
func=ast.Attribute(value=ast.Name(id='state', ctx=ast.Load()), attr='_kh_option', ctx=ast.Load()),
|
func=ast.Attribute(value=ast.Name(id='state', ctx=ast.Load()), attr='_hk_option', ctx=ast.Load()),
|
||||||
args=[ast.Name(id="player", ctx=ast.Load()), ast.Constant(value=logic_options[node.id])], keywords=[])
|
args=[ast.Name(id="player", ctx=ast.Load()), ast.Constant(value=logic_options[node.id])], keywords=[])
|
||||||
if node.id in macros:
|
if node.id in macros:
|
||||||
return macros[node.id].body
|
return macros[node.id].body
|
||||||
|
@ -143,7 +143,7 @@ class Absorber(ast.NodeTransformer):
|
||||||
if node.slice.value in removed_starts:
|
if node.slice.value in removed_starts:
|
||||||
return ast.Constant(False, ctx=node.ctx)
|
return ast.Constant(False, ctx=node.ctx)
|
||||||
return ast.Call(
|
return ast.Call(
|
||||||
func=ast.Attribute(value=ast.Name(id='state', ctx=ast.Load()), attr='_kh_start', ctx=ast.Load()),
|
func=ast.Attribute(value=ast.Name(id='state', ctx=ast.Load()), attr='_hk_start', ctx=ast.Load()),
|
||||||
args=[ast.Name(id="player", ctx=ast.Load()), node.slice], keywords=[])
|
args=[ast.Name(id="player", ctx=ast.Load()), node.slice], keywords=[])
|
||||||
elif node.value.id == "COMBAT":
|
elif node.value.id == "COMBAT":
|
||||||
return macros[unparse(node)].body
|
return macros[unparse(node)].body
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -328,10 +328,8 @@ class HKLogicMixin(LogicMixin):
|
||||||
def _hk_notches(self, player: int, *notches: int) -> int:
|
def _hk_notches(self, player: int, *notches: int) -> int:
|
||||||
return sum(self.world.worlds[player].charm_costs[notch] for notch in notches)
|
return sum(self.world.worlds[player].charm_costs[notch] for notch in notches)
|
||||||
|
|
||||||
def _kh_option(self, player: int, option_name: str) -> int:
|
def _hk_option(self, player: int, option_name: str) -> int:
|
||||||
if option_name == "RandomizeCharmNotches":
|
|
||||||
return self.world.RandomCharmCosts[player] != -1
|
|
||||||
return getattr(self.world, option_name)[player].value
|
return getattr(self.world, option_name)[player].value
|
||||||
|
|
||||||
def _kh_start(self, player, start_location: str) -> bool:
|
def _hk_start(self, player, start_location: str) -> bool:
|
||||||
return self.world.StartLocation[player] == start_location
|
return self.world.StartLocation[player] == start_location
|
||||||
|
|
Loading…
Reference in New Issue