Esempio n. 1
0
def add_layout_configuration_arguments(parser: ArgumentParser):
    parser.add_argument("--trick-level",
                        type=str,
                        choices=[layout.value for layout in LayoutTrickLevel],
                        default=LayoutTrickLevel.NO_TRICKS.value,
                        help="The level of tricks to use.")
    parser.add_argument(
        "--sky-temple-keys",
        type=str,
        choices=[str(mode.value) for mode in LayoutSkyTempleKeyMode],
        default=LayoutSkyTempleKeyMode.default().value,
        help="The Sky Temple Keys randomization mode.")
    parser.add_argument(
        "--skip-item-loss",
        action="store_true",
        help="Disables the item loss cutscene, disabling losing your items.")
Esempio n. 2
0
from randovania.interface_common.preset_editor import PresetEditor
from randovania.layout.layout_configuration import LayoutConfiguration, LayoutElevators, \
    LayoutSkyTempleKeyMode
from randovania.layout.starting_location import StartingLocation
from randovania.layout.trick_level import LayoutTrickLevel, TrickLevelConfiguration


@pytest.fixture(name="editor")
def _editor() -> PresetEditor:
    return PresetEditor(MagicMock())


_sample_layout_configurations = [
    {
        "trick_level_configuration": TrickLevelConfiguration(trick_level),
        "sky_temple_keys": LayoutSkyTempleKeyMode.default(),
        "elevators": LayoutElevators.TWO_WAY_RANDOMIZED,
    }
    for trick_level in [LayoutTrickLevel.NO_TRICKS, LayoutTrickLevel.HARD, LayoutTrickLevel.MINIMAL_RESTRICTIONS]
]


@pytest.fixture(params=_sample_layout_configurations, name="initial_layout_configuration_params")
def _initial_layout_configuration_params(request) -> dict:
    return request.param


@pytest.mark.parametrize("new_trick_level",
                         [LayoutTrickLevel.NO_TRICKS, LayoutTrickLevel.TRIVIAL, LayoutTrickLevel.HYPERMODE])
def test_edit_layout_trick_level(editor: PresetEditor,
                                 initial_layout_configuration_params: dict,
Esempio n. 3
0
    # Assert
    assert result == {
        "version": randovania.interface_common.persisted_options.
        _CURRENT_OPTIONS_FILE_VERSION,
        "options": {
            "last_changelog_displayed":
            str(update_checker.strict_current_version()),
        }
    }


_sample_layout_configurations = [{
    "trick_level_configuration":
    TrickLevelConfiguration(trick_level),
    "sky_temple_keys":
    LayoutSkyTempleKeyMode.default(),
    "elevators":
    LayoutElevators.RANDOMIZED,
    "starting_location":
    StartingLocation.default(),
} for trick_level in [
    LayoutTrickLevel.NO_TRICKS, LayoutTrickLevel.HARD,
    LayoutTrickLevel.MINIMAL_RESTRICTIONS
]]


@pytest.fixture(params=_sample_layout_configurations,
                name="initial_layout_configuration_params")
def _initial_layout_configuration_params(request) -> dict:
    return request.param