mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-05-27 12:39:56 -07:00
LttP: logic fixes and missing bombs (#5645)
3 logic issues: * #3046 made it so that prizes were included in LttP's pre_fill items. It accounted for it in regular pre_fill, but missed stage_pre_fill. * LttP defines a maximum number of heart pieces and heart containers logically within each difficulty. Item condensing did not account for this, and could reduce the number of heart pieces below the required amount logically. Notably, this makes some combination of settings much harder to generate, so another solution may end up ideal. * Current logic rules do not properly account for the case of standard start and enemizer, requiring a large amount of items logically within a short number of locations. However, the behavior of Enemizer in this situation is well-defined, as the guards during the standard starting sequence are not changed. Thus the required items can be safely minimized.
This commit is contained in:
@@ -59,10 +59,11 @@ def has_hearts(state: CollectionState, player: int, count: int) -> int:
|
||||
|
||||
def heart_count(state: CollectionState, player: int) -> int:
|
||||
# Warning: This only considers items that are marked as advancement items
|
||||
diff = state.multiworld.worlds[player].difficulty_requirements
|
||||
return min(state.count('Boss Heart Container', player), diff.boss_heart_container_limit) \
|
||||
max_heart_pieces = state.multiworld.worlds[player].logical_heart_pieces
|
||||
max_heart_containers = state.multiworld.worlds[player].logical_heart_containers
|
||||
return min(state.count('Boss Heart Container', player), max_heart_containers) \
|
||||
+ state.count('Sanctuary Heart Container', player) \
|
||||
+ min(state.count('Piece of Heart', player), diff.heart_piece_limit) // 4 \
|
||||
+ min(state.count('Piece of Heart', player), max_heart_pieces) // 4 \
|
||||
+ 3 # starting hearts
|
||||
|
||||
|
||||
@@ -139,6 +140,16 @@ def can_kill_most_things(state: CollectionState, player: int, enemies: int = 5)
|
||||
and can_use_bombs(state, player, enemies * 4)))
|
||||
|
||||
|
||||
def can_kill_standard_start(state: CollectionState, player: int, enemies: int = 5) -> bool:
|
||||
# Enemizer does not randomize standard start enemies
|
||||
return (has_melee_weapon(state, player)
|
||||
or state.has('Cane of Somaria', player)
|
||||
or (state.has('Cane of Byrna', player) and (enemies < 6 or can_extend_magic(state, player)))
|
||||
or state.has_any(["Bow", "Progressive Bow"], player)
|
||||
or state.has('Fire Rod', player)
|
||||
or can_use_bombs(state, player, enemies)) # Escape assist is set
|
||||
|
||||
|
||||
def can_get_good_bee(state: CollectionState, player: int) -> bool:
|
||||
cave = state.multiworld.get_region('Good Bee Cave', player)
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user