from typing import Any, Dict

from Options import Accessibility, ProgressionBalancing, DeathLink
from .options import Goal, StartingMoney, ProfitMargin, BundleRandomization, BundlePrice, EntranceRandomization, SeasonRandomization, Cropsanity, \
    BackpackProgression, ToolProgression, ElevatorProgression, SkillProgression, BuildingProgression, FestivalLocations, ArcadeMachineLocations, \
    SpecialOrderLocations, HelpWantedLocations, Fishsanity, Museumsanity, Friendsanity, FriendsanityHeartSize, NumberOfMovementBuffs, NumberOfLuckBuffs, \
    ExcludeGingerIsland, TrapItems, MultipleDaySleepEnabled, MultipleDaySleepCost, ExperienceMultiplier, FriendshipMultiplier, DebrisMultiplier, QuickStart, \
    Gifting

all_random_settings = {
    "progression_balancing":                "random",
    "accessibility":                        "random",
    Goal.internal_name:                     "random",
    StartingMoney.internal_name:            "random",
    ProfitMargin.internal_name:             "random",
    BundleRandomization.internal_name:      "random",
    BundlePrice.internal_name:              "random",
    EntranceRandomization.internal_name:    "random",
    SeasonRandomization.internal_name:      "random",
    Cropsanity.internal_name:               "random",
    BackpackProgression.internal_name:      "random",
    ToolProgression.internal_name:          "random",
    ElevatorProgression.internal_name:      "random",
    SkillProgression.internal_name:         "random",
    BuildingProgression.internal_name:      "random",
    FestivalLocations.internal_name:        "random",
    ArcadeMachineLocations.internal_name:   "random",
    SpecialOrderLocations.internal_name:    "random",
    HelpWantedLocations.internal_name:      "random",
    Fishsanity.internal_name:               "random",
    Museumsanity.internal_name:             "random",
    Friendsanity.internal_name:             "random",
    FriendsanityHeartSize.internal_name:    "random",
    NumberOfMovementBuffs.internal_name:    "random",
    NumberOfLuckBuffs.internal_name:        "random",
    ExcludeGingerIsland.internal_name:      "random",
    TrapItems.internal_name:                "random",
    MultipleDaySleepEnabled.internal_name:  "random",
    MultipleDaySleepCost.internal_name:     "random",
    ExperienceMultiplier.internal_name:     "random",
    FriendshipMultiplier.internal_name:     "random",
    DebrisMultiplier.internal_name:         "random",
    QuickStart.internal_name:               "random",
    Gifting.internal_name:                  "random",
    "death_link":                           "random",
}

easy_settings = {
    "progression_balancing":                ProgressionBalancing.default,
    "accessibility":                        Accessibility.option_items,
    Goal.internal_name:                     Goal.option_community_center,
    StartingMoney.internal_name:            "very rich",
    ProfitMargin.internal_name:             "double",
    BundleRandomization.internal_name:      BundleRandomization.option_thematic,
    BundlePrice.internal_name:              BundlePrice.option_cheap,
    EntranceRandomization.internal_name:    EntranceRandomization.option_disabled,
    SeasonRandomization.internal_name:      SeasonRandomization.option_randomized_not_winter,
    Cropsanity.internal_name:               Cropsanity.option_enabled,
    BackpackProgression.internal_name:      BackpackProgression.option_early_progressive,
    ToolProgression.internal_name:          ToolProgression.option_progressive,
    ElevatorProgression.internal_name:      ElevatorProgression.option_progressive,
    SkillProgression.internal_name:         SkillProgression.option_progressive,
    BuildingProgression.internal_name:      BuildingProgression.option_progressive_early_shipping_bin,
    FestivalLocations.internal_name:        FestivalLocations.option_easy,
    ArcadeMachineLocations.internal_name:   ArcadeMachineLocations.option_disabled,
    SpecialOrderLocations.internal_name:    SpecialOrderLocations.option_disabled,
    HelpWantedLocations.internal_name:      "minimum",
    Fishsanity.internal_name:               Fishsanity.option_only_easy_fish,
    Museumsanity.internal_name:             Museumsanity.option_milestones,
    Friendsanity.internal_name:             Friendsanity.option_none,
    FriendsanityHeartSize.internal_name:    4,
    NumberOfMovementBuffs.internal_name:    8,
    NumberOfLuckBuffs.internal_name:        8,
    ExcludeGingerIsland.internal_name:      ExcludeGingerIsland.option_true,
    TrapItems.internal_name:                TrapItems.option_easy,
    MultipleDaySleepEnabled.internal_name:  MultipleDaySleepEnabled.option_true,
    MultipleDaySleepCost.internal_name:     "free",
    ExperienceMultiplier.internal_name:     "triple",
    FriendshipMultiplier.internal_name:     "quadruple",
    DebrisMultiplier.internal_name:         DebrisMultiplier.option_quarter,
    QuickStart.internal_name:               QuickStart.option_true,
    Gifting.internal_name:                  Gifting.option_true,
    "death_link":                           "false",
}

medium_settings = {
    "progression_balancing":                25,
    "accessibility":                        Accessibility.option_locations,
    Goal.internal_name:                     Goal.option_community_center,
    StartingMoney.internal_name:            "rich",
    ProfitMargin.internal_name:             150,
    BundleRandomization.internal_name:      BundleRandomization.option_thematic,
    BundlePrice.internal_name:              BundlePrice.option_normal,
    EntranceRandomization.internal_name:    EntranceRandomization.option_non_progression,
    SeasonRandomization.internal_name:      SeasonRandomization.option_randomized,
    Cropsanity.internal_name:               Cropsanity.option_enabled,
    BackpackProgression.internal_name:      BackpackProgression.option_early_progressive,
    ToolProgression.internal_name:          ToolProgression.option_progressive,
    ElevatorProgression.internal_name:      ElevatorProgression.option_progressive_from_previous_floor,
    SkillProgression.internal_name:         SkillProgression.option_progressive,
    BuildingProgression.internal_name:      BuildingProgression.option_progressive_early_shipping_bin,
    FestivalLocations.internal_name:        FestivalLocations.option_hard,
    ArcadeMachineLocations.internal_name:   ArcadeMachineLocations.option_victories_easy,
    SpecialOrderLocations.internal_name:    SpecialOrderLocations.option_board_only,
    HelpWantedLocations.internal_name:      "normal",
    Fishsanity.internal_name:               Fishsanity.option_exclude_legendaries,
    Museumsanity.internal_name:             Museumsanity.option_milestones,
    Friendsanity.internal_name:             Friendsanity.option_starting_npcs,
    FriendsanityHeartSize.internal_name:    4,
    NumberOfMovementBuffs.internal_name:    6,
    NumberOfLuckBuffs.internal_name:        6,
    ExcludeGingerIsland.internal_name:      ExcludeGingerIsland.option_true,
    TrapItems.internal_name:                TrapItems.option_medium,
    MultipleDaySleepEnabled.internal_name:  MultipleDaySleepEnabled.option_true,
    MultipleDaySleepCost.internal_name:     "free",
    ExperienceMultiplier.internal_name:     "double",
    FriendshipMultiplier.internal_name:     "triple",
    DebrisMultiplier.internal_name:         DebrisMultiplier.option_half,
    QuickStart.internal_name:               QuickStart.option_true,
    Gifting.internal_name:                  Gifting.option_true,
    "death_link":                           "false",
}

hard_settings = {
    "progression_balancing":                0,
    "accessibility":                        Accessibility.option_locations,
    Goal.internal_name:                     Goal.option_grandpa_evaluation,
    StartingMoney.internal_name:            "extra",
    ProfitMargin.internal_name:             "normal",
    BundleRandomization.internal_name:      BundleRandomization.option_thematic,
    BundlePrice.internal_name:              BundlePrice.option_expensive,
    EntranceRandomization.internal_name:    EntranceRandomization.option_buildings,
    SeasonRandomization.internal_name:      SeasonRandomization.option_randomized,
    Cropsanity.internal_name:               Cropsanity.option_enabled,
    BackpackProgression.internal_name:      BackpackProgression.option_progressive,
    ToolProgression.internal_name:          ToolProgression.option_progressive,
    ElevatorProgression.internal_name:      ElevatorProgression.option_progressive_from_previous_floor,
    SkillProgression.internal_name:         SkillProgression.option_progressive,
    BuildingProgression.internal_name:      BuildingProgression.option_progressive,
    FestivalLocations.internal_name:        FestivalLocations.option_hard,
    ArcadeMachineLocations.internal_name:   ArcadeMachineLocations.option_full_shuffling,
    SpecialOrderLocations.internal_name:    SpecialOrderLocations.option_board_qi,
    HelpWantedLocations.internal_name:      "lots",
    Fishsanity.internal_name:               Fishsanity.option_all,
    Museumsanity.internal_name:             Museumsanity.option_all,
    Friendsanity.internal_name:             Friendsanity.option_all,
    FriendsanityHeartSize.internal_name:    4,
    NumberOfMovementBuffs.internal_name:    4,
    NumberOfLuckBuffs.internal_name:        4,
    ExcludeGingerIsland.internal_name:      ExcludeGingerIsland.option_false,
    TrapItems.internal_name:                TrapItems.option_hard,
    MultipleDaySleepEnabled.internal_name:  MultipleDaySleepEnabled.option_true,
    MultipleDaySleepCost.internal_name:     "cheap",
    ExperienceMultiplier.internal_name:     "vanilla",
    FriendshipMultiplier.internal_name:     "double",
    DebrisMultiplier.internal_name:         DebrisMultiplier.option_vanilla,
    QuickStart.internal_name:               QuickStart.option_true,
    Gifting.internal_name:                  Gifting.option_true,
    "death_link":                           "true",
}

nightmare_settings = {
    "progression_balancing":                0,
    "accessibility":                        Accessibility.option_locations,
    Goal.internal_name:                     Goal.option_community_center,
    StartingMoney.internal_name:            "vanilla",
    ProfitMargin.internal_name:             "half",
    BundleRandomization.internal_name:      BundleRandomization.option_shuffled,
    BundlePrice.internal_name:              BundlePrice.option_expensive,
    EntranceRandomization.internal_name:    EntranceRandomization.option_buildings,
    SeasonRandomization.internal_name:      SeasonRandomization.option_randomized,
    Cropsanity.internal_name:               Cropsanity.option_enabled,
    BackpackProgression.internal_name:      BackpackProgression.option_progressive,
    ToolProgression.internal_name:          ToolProgression.option_progressive,
    ElevatorProgression.internal_name:      ElevatorProgression.option_progressive_from_previous_floor,
    SkillProgression.internal_name:         SkillProgression.option_progressive,
    BuildingProgression.internal_name:      BuildingProgression.option_progressive,
    FestivalLocations.internal_name:        FestivalLocations.option_hard,
    ArcadeMachineLocations.internal_name:   ArcadeMachineLocations.option_full_shuffling,
    SpecialOrderLocations.internal_name:    SpecialOrderLocations.option_board_qi,
    HelpWantedLocations.internal_name:      "maximum",
    Fishsanity.internal_name:               Fishsanity.option_special,
    Museumsanity.internal_name:             Museumsanity.option_all,
    Friendsanity.internal_name:             Friendsanity.option_all_with_marriage,
    FriendsanityHeartSize.internal_name:    4,
    NumberOfMovementBuffs.internal_name:    2,
    NumberOfLuckBuffs.internal_name:        2,
    ExcludeGingerIsland.internal_name:      ExcludeGingerIsland.option_false,
    TrapItems.internal_name:                TrapItems.option_hell,
    MultipleDaySleepEnabled.internal_name:  MultipleDaySleepEnabled.option_true,
    MultipleDaySleepCost.internal_name:     "expensive",
    ExperienceMultiplier.internal_name:     "half",
    FriendshipMultiplier.internal_name:     "vanilla",
    DebrisMultiplier.internal_name:         DebrisMultiplier.option_vanilla,
    QuickStart.internal_name:               QuickStart.option_false,
    Gifting.internal_name:                  Gifting.option_true,
    "death_link":                           "true",
}

short_settings = {
    "progression_balancing":                ProgressionBalancing.default,
    "accessibility":                        Accessibility.option_items,
    Goal.internal_name:                     Goal.option_bottom_of_the_mines,
    StartingMoney.internal_name:            "filthy rich",
    ProfitMargin.internal_name:             "quadruple",
    BundleRandomization.internal_name:      BundleRandomization.option_thematic,
    BundlePrice.internal_name:              BundlePrice.option_very_cheap,
    EntranceRandomization.internal_name:    EntranceRandomization.option_disabled,
    SeasonRandomization.internal_name:      SeasonRandomization.option_randomized_not_winter,
    Cropsanity.internal_name:               Cropsanity.option_disabled,
    BackpackProgression.internal_name:      BackpackProgression.option_early_progressive,
    ToolProgression.internal_name:          ToolProgression.option_progressive,
    ElevatorProgression.internal_name:      ElevatorProgression.option_progressive_from_previous_floor,
    SkillProgression.internal_name:         SkillProgression.option_progressive,
    BuildingProgression.internal_name:      BuildingProgression.option_progressive_early_shipping_bin,
    FestivalLocations.internal_name:        FestivalLocations.option_disabled,
    ArcadeMachineLocations.internal_name:   ArcadeMachineLocations.option_disabled,
    SpecialOrderLocations.internal_name:    SpecialOrderLocations.option_disabled,
    HelpWantedLocations.internal_name:      "none",
    Fishsanity.internal_name:               Fishsanity.option_none,
    Museumsanity.internal_name:             Museumsanity.option_none,
    Friendsanity.internal_name:             Friendsanity.option_none,
    FriendsanityHeartSize.internal_name:    4,
    NumberOfMovementBuffs.internal_name:    10,
    NumberOfLuckBuffs.internal_name:        10,
    ExcludeGingerIsland.internal_name:      ExcludeGingerIsland.option_true,
    TrapItems.internal_name:                TrapItems.option_easy,
    MultipleDaySleepEnabled.internal_name:  MultipleDaySleepEnabled.option_true,
    MultipleDaySleepCost.internal_name:     "free",
    ExperienceMultiplier.internal_name:     "quadruple",
    FriendshipMultiplier.internal_name:     800,
    DebrisMultiplier.internal_name:         DebrisMultiplier.option_none,
    QuickStart.internal_name:               QuickStart.option_true,
    Gifting.internal_name:                  Gifting.option_true,
    "death_link":                           "false",
}

lowsanity_settings = {
    "progression_balancing":                ProgressionBalancing.default,
    "accessibility":                        Accessibility.option_minimal,
    Goal.internal_name:                     Goal.default,
    StartingMoney.internal_name:            StartingMoney.default,
    ProfitMargin.internal_name:             ProfitMargin.default,
    BundleRandomization.internal_name:      BundleRandomization.default,
    BundlePrice.internal_name:              BundlePrice.default,
    EntranceRandomization.internal_name:    EntranceRandomization.default,
    SeasonRandomization.internal_name:      SeasonRandomization.option_disabled,
    Cropsanity.internal_name:               Cropsanity.option_disabled,
    BackpackProgression.internal_name:      BackpackProgression.option_vanilla,
    ToolProgression.internal_name:          ToolProgression.option_vanilla,
    ElevatorProgression.internal_name:      ElevatorProgression.option_vanilla,
    SkillProgression.internal_name:         SkillProgression.option_vanilla,
    BuildingProgression.internal_name:      BuildingProgression.option_vanilla,
    FestivalLocations.internal_name:        FestivalLocations.option_disabled,
    ArcadeMachineLocations.internal_name:   ArcadeMachineLocations.option_disabled,
    SpecialOrderLocations.internal_name:    SpecialOrderLocations.option_disabled,
    HelpWantedLocations.internal_name:      "none",
    Fishsanity.internal_name:               Fishsanity.option_none,
    Museumsanity.internal_name:             Museumsanity.option_none,
    Friendsanity.internal_name:             Friendsanity.option_none,
    FriendsanityHeartSize.internal_name:    FriendsanityHeartSize.default,
    NumberOfMovementBuffs.internal_name:    NumberOfMovementBuffs.default,
    NumberOfLuckBuffs.internal_name:        NumberOfLuckBuffs.default,
    ExcludeGingerIsland.internal_name:      ExcludeGingerIsland.option_true,
    TrapItems.internal_name:                TrapItems.default,
    MultipleDaySleepEnabled.internal_name:  MultipleDaySleepEnabled.default,
    MultipleDaySleepCost.internal_name:     MultipleDaySleepCost.default,
    ExperienceMultiplier.internal_name:     ExperienceMultiplier.default,
    FriendshipMultiplier.internal_name:     FriendshipMultiplier.default,
    DebrisMultiplier.internal_name:         DebrisMultiplier.default,
    QuickStart.internal_name:               QuickStart.default,
    Gifting.internal_name:                  Gifting.default,
    "death_link":                           DeathLink.default,
}

allsanity_settings = {
    "progression_balancing":                ProgressionBalancing.default,
    "accessibility":                        Accessibility.option_locations,
    Goal.internal_name:                     Goal.default,
    StartingMoney.internal_name:            StartingMoney.default,
    ProfitMargin.internal_name:             ProfitMargin.default,
    BundleRandomization.internal_name:      BundleRandomization.default,
    BundlePrice.internal_name:              BundlePrice.default,
    EntranceRandomization.internal_name:    EntranceRandomization.option_buildings,
    SeasonRandomization.internal_name:      SeasonRandomization.option_randomized,
    Cropsanity.internal_name:               Cropsanity.option_enabled,
    BackpackProgression.internal_name:      BackpackProgression.option_early_progressive,
    ToolProgression.internal_name:          ToolProgression.option_progressive,
    ElevatorProgression.internal_name:      ElevatorProgression.option_progressive,
    SkillProgression.internal_name:         SkillProgression.option_progressive,
    BuildingProgression.internal_name:      BuildingProgression.option_progressive_early_shipping_bin,
    FestivalLocations.internal_name:        FestivalLocations.option_hard,
    ArcadeMachineLocations.internal_name:   ArcadeMachineLocations.option_full_shuffling,
    SpecialOrderLocations.internal_name:    SpecialOrderLocations.option_board_qi,
    HelpWantedLocations.internal_name:      "maximum",
    Fishsanity.internal_name:               Fishsanity.option_all,
    Museumsanity.internal_name:             Museumsanity.option_all,
    Friendsanity.internal_name:             Friendsanity.option_all,
    FriendsanityHeartSize.internal_name:    1,
    NumberOfMovementBuffs.internal_name:    12,
    NumberOfLuckBuffs.internal_name:        12,
    ExcludeGingerIsland.internal_name:      ExcludeGingerIsland.option_false,
    TrapItems.internal_name:                TrapItems.default,
    MultipleDaySleepEnabled.internal_name:  MultipleDaySleepEnabled.default,
    MultipleDaySleepCost.internal_name:     MultipleDaySleepCost.default,
    ExperienceMultiplier.internal_name:     ExperienceMultiplier.default,
    FriendshipMultiplier.internal_name:     FriendshipMultiplier.default,
    DebrisMultiplier.internal_name:         DebrisMultiplier.default,
    QuickStart.internal_name:               QuickStart.default,
    Gifting.internal_name:                  Gifting.default,
    "death_link":                           DeathLink.default,
}

sv_options_presets: Dict[str, Dict[str, Any]] = {
    "All random": all_random_settings,
    "Easy": easy_settings,
    "Medium": medium_settings,
    "Hard": hard_settings,
    "Nightmare": nightmare_settings,
    "Short": short_settings,
    "Lowsanity": lowsanity_settings,
    "Allsanity": allsanity_settings,
}
