KDL3: Post-PR adjustments (#2917)

* logic adjustments, add patch_suffix

* forgot the other two consumables
This commit is contained in:
Silvris 2024-03-08 00:46:14 -06:00 committed by GitHub
parent b4bb88fcf7
commit 3e0ff3f72d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 18 deletions

View File

@ -97,6 +97,7 @@ def cmd_gift(self: "SNIClientCommandProcessor"):
class KDL3SNIClient(SNIClient): class KDL3SNIClient(SNIClient):
game = "Kirby's Dream Land 3" game = "Kirby's Dream Land 3"
patch_suffix = ".apkdl3"
levels = None levels = None
consumables = None consumables = None
stars = None stars = None
@ -406,7 +407,8 @@ class KDL3SNIClient(SNIClient):
ctx.locations_checked.add(new_check_id) ctx.locations_checked.add(new_check_id)
location = ctx.location_names[new_check_id] location = ctx.location_names[new_check_id]
snes_logger.info( snes_logger.info(
f'New Check: {location} ({len(ctx.locations_checked)}/{len(ctx.missing_locations) + len(ctx.checked_locations)})') f'New Check: {location} ({len(ctx.locations_checked)}/'
f'{len(ctx.missing_locations) + len(ctx.checked_locations)})')
await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": [new_check_id]}]) await ctx.send_msgs([{"cmd": 'LocationChecks', "locations": [new_check_id]}])
except Exception as ex: except Exception as ex:
# we crashed, so print log and clean up # we crashed, so print log and clean up

View File

@ -206,13 +206,19 @@ def set_rules(world: "KDL3World") -> None:
lambda state: can_reach_needle(state, world.player)) lambda state: can_reach_needle(state, world.player))
set_rule(world.multiworld.get_location(LocationName.sand_canyon_5_u2, world.player), set_rule(world.multiworld.get_location(LocationName.sand_canyon_5_u2, world.player),
lambda state: can_reach_ice(state, world.player) and lambda state: can_reach_ice(state, world.player) and
(can_reach_rick(state, world.player) or can_reach_coo(state, world.player))) (can_reach_rick(state, world.player) or can_reach_coo(state, world.player)
or can_reach_chuchu(state, world.player) or can_reach_pitch(state, world.player)
or can_reach_nago(state, world.player)))
set_rule(world.multiworld.get_location(LocationName.sand_canyon_5_u3, world.player), set_rule(world.multiworld.get_location(LocationName.sand_canyon_5_u3, world.player),
lambda state: can_reach_ice(state, world.player) and lambda state: can_reach_ice(state, world.player) and
(can_reach_rick(state, world.player) or can_reach_coo(state, world.player))) (can_reach_rick(state, world.player) or can_reach_coo(state, world.player)
or can_reach_chuchu(state, world.player) or can_reach_pitch(state, world.player)
or can_reach_nago(state, world.player)))
set_rule(world.multiworld.get_location(LocationName.sand_canyon_5_u4, world.player), set_rule(world.multiworld.get_location(LocationName.sand_canyon_5_u4, world.player),
lambda state: can_reach_ice(state, world.player) and lambda state: can_reach_ice(state, world.player) and
(can_reach_rick(state, world.player) or can_reach_coo(state, world.player))) (can_reach_rick(state, world.player) or can_reach_coo(state, world.player)
or can_reach_chuchu(state, world.player) or can_reach_pitch(state, world.player)
or can_reach_nago(state, world.player)))
set_rule(world.multiworld.get_location(LocationName.cloudy_park_6_u1, world.player), set_rule(world.multiworld.get_location(LocationName.cloudy_park_6_u1, world.player),
lambda state: can_reach_cutter(state, world.player)) lambda state: can_reach_cutter(state, world.player))
@ -242,7 +248,9 @@ def set_rules(world: "KDL3World") -> None:
for i in range(12, 18): for i in range(12, 18):
set_rule(world.multiworld.get_location(f"Sand Canyon 5 - Star {i}", world.player), set_rule(world.multiworld.get_location(f"Sand Canyon 5 - Star {i}", world.player),
lambda state: can_reach_ice(state, world.player) and lambda state: can_reach_ice(state, world.player) and
(can_reach_rick(state, world.player) or can_reach_coo(state, world.player))) (can_reach_rick(state, world.player) or can_reach_coo(state, world.player)
or can_reach_chuchu(state, world.player) or can_reach_pitch(state, world.player)
or can_reach_nago(state, world.player)))
for i in range(21, 23): for i in range(21, 23):
set_rule(world.multiworld.get_location(f"Sand Canyon 5 - Star {i}", world.player), set_rule(world.multiworld.get_location(f"Sand Canyon 5 - Star {i}", world.player),
lambda state: can_reach_chuchu(state, world.player)) lambda state: can_reach_chuchu(state, world.player))
@ -267,32 +275,32 @@ def set_rules(world: "KDL3World") -> None:
# Kirby cannot eat enemies fully submerged in water. Vast majority of cases, the enemy can be brought to the surface # Kirby cannot eat enemies fully submerged in water. Vast majority of cases, the enemy can be brought to the surface
# and eaten by inhaling while falling on top of them # and eaten by inhaling while falling on top of them
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_2_E3, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_2_E3, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_3_E6, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_3_E6, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
# Ripple Field 4 E5, E7, and E8 are doable, but too strict to leave in logic # Ripple Field 4 E5, E7, and E8 are doable, but too strict to leave in logic
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_4_E5, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_4_E5, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_4_E7, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_4_E7, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_4_E8, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_4_E8, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E1, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E1, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E2, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E2, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E3, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E3, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E4, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Ripple_Field_5_E4, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E7, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E7, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E8, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E8, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E9, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E9, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E10, world.player), set_rule(world.multiworld.get_location(EnemyAbilities.Sand_Canyon_4_E10, world.player),
lambda state: can_reach_kine(state, world.player)) lambda state: can_reach_kine(state, world.player) or can_reach_chuchu(state, world.player))
for boss_flag, purification, i in zip(["Level 1 Boss - Purified", "Level 2 Boss - Purified", for boss_flag, purification, i in zip(["Level 1 Boss - Purified", "Level 2 Boss - Purified",
"Level 3 Boss - Purified", "Level 4 Boss - Purified", "Level 3 Boss - Purified", "Level 4 Boss - Purified",