Zillion: use Option.current_key

and other minor fixes
This commit is contained in:
beauxq
2023-03-06 19:14:25 -08:00
committed by black-sliver
parent 8ca25fed63
commit e6109394ad
4 changed files with 18 additions and 14 deletions

View File

@@ -276,14 +276,14 @@ def validate(world: "MultiWorld", p: int) -> "Tuple[ZzOptions, Counter[str]]":
skill = wo.skill[p].value
jump_levels = cast(ZillionJumpLevels, wo.jump_levels[p])
jump_option = jump_levels.get_current_option_name().lower()
jump_option = jump_levels.current_key
required_level = char_to_jump["Apple"][cast(ZzVBLR, jump_option)].index(3) + 1
if skill == 0:
# because of hp logic on final boss
required_level = 8
gun_levels = cast(ZillionGunLevels, wo.gun_levels[p])
gun_option = gun_levels.get_current_option_name().lower()
gun_option = gun_levels.current_key
guns_required = char_to_gun["Champ"][cast(ZzVBLR, gun_option)].index(3)
floppy_req = cast(ZillionFloppyReq, wo.floppy_req[p])
@@ -347,10 +347,14 @@ def validate(world: "MultiWorld", p: int) -> "Tuple[ZzOptions, Counter[str]]":
# that should be all of the level requirements met
name_capitalization = {
"jj": "JJ",
"apple": "Apple",
"champ": "Champ",
}
start_char = cast(ZillionStartChar, wo.start_char[p])
start_char_name = start_char.get_current_option_name()
if start_char_name == "Jj":
start_char_name = "JJ"
start_char_name = name_capitalization[start_char.current_key]
assert start_char_name in chars
start_char_name = cast(Chars, start_char_name)