Пример #1
0
def test_collect_eggplant_crown(world, level, player_item_set, expected_status,
                                expected_step_name):
    game_state = State(
        world=world,
        level=level,
    )

    eggy_chain = EggplantChain()
    result = eggy_chain.collect_eggplant_crown(game_state, player_item_set)

    assert result.status == expected_status
    if expected_status.in_progress:
        assert result.next_step.__name__ == expected_step_name
Пример #2
0
def test_visit_eggplant_world(world, level, theme, expected_status,
                              expected_step_name):
    game_state = State(
        world=world,
        level=level,
        theme=theme,
    )
    player_item_set = set()

    eggy_chain = EggplantChain()
    result = eggy_chain.visit_eggplant_world(game_state, player_item_set)

    assert result.status == expected_status
    if expected_status.in_progress:
        assert result.next_step.__name__ == expected_step_name
Пример #3
0
def test_collect_eggplant_skip():
    entity_map = EntityMapBuilder()
    player = make_player_with_hh_type(entity_map,
                                      EntityType.CHAR_EGGPLANT_CHILD)
    game_state = State(
        world=5,
        items=Items(players=(player, )),
        instance_id_to_pointer=entity_map.build(),
    )
    player_item_set = set()

    eggy_chain = EggplantChain()
    result = eggy_chain.collect_eggplant(game_state, player_item_set)

    assert result.status == ChainStatus.IN_PROGRESS
    assert result.next_step.__name__ == "guide_eggplant_child_to_71"
Пример #4
0
def test_collect_eggplant_item(world, screen, player_item_set, hh_item_set,
                               expected_status, expected_step_name):
    entity_map = EntityMapBuilder()
    player = make_player_with_hh_items(entity_map, hh_item_set)
    game_state = State(
        world=world,
        screen=screen,
        items=Items(players=(player, )),
        instance_id_to_pointer=entity_map.build(),
    )
    eggy_chain = EggplantChain()
    result = eggy_chain.collect_eggplant(game_state, player_item_set)

    assert result.status == expected_status
    if expected_status.in_progress:
        assert result.next_step.__name__ == expected_step_name
Пример #5
0
def test_guide_eggplant_child_to_71(world, level, screen, hh_type,
                                    expected_status, expected_step_name):
    entity_map = EntityMapBuilder()
    player = make_player_with_hh_type(entity_map, hh_type)
    game_state = State(
        world=world,
        level=level,
        screen=screen,
        items=Items(players=(player, )),
        instance_id_to_pointer=entity_map.build(),
    )
    player_item_set = set()

    eggy_chain = EggplantChain()
    result = eggy_chain.guide_eggplant_child_to_71(game_state, player_item_set)

    assert result.status == expected_status
    if expected_status.in_progress:
        assert result.next_step.__name__ == expected_step_name
Пример #6
0
    def __init__(self, always_show_modifiers=False):
        self.always_show_modifiers = always_show_modifiers
        self.run_label = RunLabel()

        self.world = 0
        self.level = 0
        self.level_started = False

        self.player_item_types: Set[EntityType] = set()
        self.player_last_item_types: Set[EntityType] = set()

        self.final_death = False

        self.health = 4
        self.bombs = 4
        self.ropes = 4
        self.level_start_ropes = 4

        self.poisoned = False
        self.cursed = False

        # Score
        self.is_score_run = False

        # Low%
        self.is_low_percent = True

        # Low% if Chain
        self.failed_low_if_not_chain = False

        # Moon Challenge Mattock is okay if you're going CO
        self.mc_has_swung_mattock = False

        # Chain
        self.had_ankh = False
        # Combined status of Abzu and Duat
        self.sunken_chain_status = ChainStatus.UNSTARTED

        # Millionaire
        self.clone_gun_wo_cosmic = False

        self.world2_theme = None
        self.world4_theme = None

        # Quest chains
        self.abzu_stepper = AbzuChain.make_stepper()
        self.duat_stepper = DuatChain.make_stepper()
        self.cosmic_stepper = CosmicOceanChain.make_stepper()
        self.eggplant_stepper = EggplantChain.make_stepper()

        self.prev_next_uid: Optional[int] = None
        self.new_entities: List[PolyPointer[Entity]] = []