#-*-fundamental-*-

# Dungeon Environment Customization Menu

### NOTE : The "GetMenu" directive currently only works with
### DungeonItem, DungeonZombies, and DungeonBats (and also Constrain
### directives). We should document somewhere where GetMenu can be
### used and where it can't.

include "dungeon_layouts.txt"
include "knights_rooms.txt"
include "item_generation.txt"

include "quests.txt"  # quest descriptions

starting_daggers = DungeonGear(i_dagger, [5,4,3,2])
starting_poison_traps = DungeonGear(i_poison_trap, [2,2,2,2])
starting_blade_traps = DungeonGear(i_blade_trap, [3,3,3,3])

# Item respawn parameters 
respawn_interval = ts
respawn_time_base = 3000

MAIN_MENU = [
    # First some Dungeon directives that apply to all quests :-

    DungeonStuff("chest", 80, ig_pot, 3)
    DungeonStuff("small_table", 75, Random(ig_pot:2, ig_table:1), 1)
    DungeonStuff("table",  67, ig_table, 1)
    DungeonRespawn(ig_respawn, i_lockpicks)

    # And now the menu itself :-

    {

        # The pre-defined quests are the first menu option
        id="quest"
        title="Quest"
        values=[
            "Custom",
            ["Quest for Gems", 
                    Constrain("mission",1)
                    Constrain("book",0)  Constrain("wand",0)  Constrain("num_wands",0)
                    Constrain("num_gems",4)  Constrain("gems_needed",3)
                    Constrain("dungeon_type",2)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",1)
                    Constrain("starting_gear",0)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",3)
                    Constrain("zombies",0)  Constrain("bats",0) ],
            ["The Big Quest for Gems", 
                    Constrain("mission",1)
                    Constrain("book",0)  Constrain("wand",0)  Constrain("num_wands",0)
                    Constrain("num_gems",6)  Constrain("gems_needed",4)
                    Constrain("dungeon_type",3)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",1)
                    Constrain("starting_gear",0)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",3)
                    Constrain("zombies",0)  Constrain("bats",0) ],
            ["Shock Assault", 
                    Constrain("mission",1)
                    Constrain("book",0)  Constrain("wand",0)  Constrain("num_wands",0)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",5)  Constrain("premapped",0)
                    Constrain("entry",2)  Constrain("exit",2)
                    Constrain("starting_gear",2)  Constrain("keys",1)
                    Constrain("pretrapped",0)  Constrain("stuff",4)
                    Constrain("zombies",0)  Constrain("bats",0) ]
            ["War of Survival",
                    Constrain("mission",0)
                    Constrain("book",0)  Constrain("wand",3)  Constrain("num_wands",2)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",3)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",0)
                    Constrain("starting_gear",0)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",3)
                    Constrain("zombies",0)  Constrain("bats",1) ]
            ["The Dungeon of Death",
                    Constrain("mission",1)
                    Constrain("book",0)  Constrain("wand",0)  Constrain("num_wands",0)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",7)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",4)
                    Constrain("starting_gear",0)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",3)
                    Constrain("zombies",0)  Constrain("bats",4) ]
            ["The Lost Book of the Gnome King",
                    Constrain("mission",2)
                    Constrain("book",4)  Constrain("wand",0)  Constrain("num_wands",0)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",3)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",1)
                    Constrain("starting_gear",0)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",4)
                    Constrain("zombies",0)  Constrain("bats",1) ]
            ["The Tomb of the Liche Lord",
                    Constrain("mission",2)
                    Constrain("book",3)  Constrain("wand",4)  Constrain("num_wands",1)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",3)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",1)
                    Constrain("starting_gear",0)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",5)
                    Constrain("zombies",2)  Constrain("bats",1) ]
            ["The Ancient Wand of Death",
                    Constrain("mission",3)
                    Constrain("book",0)  Constrain("wand",1)  Constrain("num_wands",1)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",2)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",2)
                    Constrain("starting_gear",0)  Constrain("keys",2)
                    Constrain("pretrapped",1)  Constrain("stuff",4)
                    Constrain("zombies",1)  Constrain("bats",0) ]
            ["The Way to the Paradise",
                    Constrain("mission",4)
                    Constrain("book",1)  Constrain("wand",2)  Constrain("num_wands",1)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",4)  Constrain("premapped",0)
                    Constrain("entry",0)  Constrain("exit",0)
                    Constrain("starting_gear",0)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",3)
                    Constrain("zombies",1)  Constrain("bats",0) ]
            ["The Quest of Giants",
                    Constrain("mission",2)
                    Constrain("book",2)  Constrain("wand",1)  Constrain("num_wands",1)
                    Constrain("num_gems",6)  Constrain("gems_needed",4)
                    Constrain("dungeon_type",4)  Constrain("premapped",0)
                    Constrain("entry",1)  Constrain("exit",4)
                    Constrain("starting_gear",1)  Constrain("keys",3)
                    Constrain("pretrapped",1)  Constrain("stuff",4)
                    Constrain("zombies",3)  Constrain("bats",3) ]
            ["Run for the Freedom",
                    Constrain("mission",1)
                    Constrain("book",0)  Constrain("wand",0)  Constrain("num_wands",0)
                    Constrain("num_gems",0)  Constrain("gems_needed",0)
                    Constrain("dungeon_type",6)  Constrain("premapped",1)
                    Constrain("entry",1)  Constrain("exit",4)
                    Constrain("starting_gear",0)  Constrain("keys",1)
                    Constrain("pretrapped",0)  Constrain("stuff",1)
                    Constrain("zombies",0)  Constrain("bats",5) ]
        ]
    }

    {
        id="mission"
        title="Mission Type"
        values=[
            ["Duel to the Death",        Constrain("exit",0)
                                         Constrain("num_gems",0)  Constrain("gems_needed", 0)
                                         ConstrainMin("num_wands",1)  Constrain("wand", 3)
                                         Constrain("book",0) ]
            ["Escape From the Dungeon",  ConstrainMin("exit",1) Constrain("book",0)]
            ["Retrieve Book and Escape", ConstrainMin("exit",1)
                                         ConstrainMin("book",1)
                                         QuestRetrieve(1, all_books, "Book", "Books")]
            ["Retrieve Wand and Escape", ConstrainMin("exit",1) 
                                         ConstrainMin("num_wands",1) 
                                         Constrain("book",0)
                                         QuestRetrieve(1, all_wands, "Wand", "Wands")]
            ["Destroy Book with Wand",   Constrain("exit",0)
                                         ConstrainMin("num_wands",1)
                                         ConstrainMin("book",1)
                                         QuestDestroy(all_books, all_wands)
                                         DungeonSegment("special_pentagram")]
        ]
    }

    {
        id="book"
        title="Type of Book"
        values=[
            "No Book in the Dungeon"
            ["Ancient Book of Knowledge"  DungeonItem(1, i_book_of_knowledge) ]
            ["Lost Book of Ashur"         DungeonItem(1, i_basic_book) ]
            ["Necronomicon"               DungeonSegment("liche_tomb") ]
            ["Tome of Gnomes"             DungeonSegment("gnome_room") ]
        ]
    }

    {
        id="wand"
        title="Type of Wand"
        values=[
            # NOTE: If you change this list then you may also need to change the constraint
            # on the DUEL TO THE DEATH mission (above).
            "No Wands in the Dungeon"
            ["Wand of Destruction"  DungeonItem(GetMenu("num_wands"), i_wand_of_destruction) ]
            ["Wand of Open Ways"    DungeonItem(GetMenu("num_wands"), i_wand_of_open_ways)   ]
            ["Wand of Securing"     DungeonItem(GetMenu("num_wands"), i_wand_of_securing)    ]
            ["Wand of Undeath"      DungeonItem(GetMenu("num_wands"), i_wand_of_undeath)     ]
        ]
    }

    { 
        id="num_wands"
        title="Number of Wands"
        values = [
            ["None"        Constrain("wand",0)]
            [MenuNumber()  ConstrainMin("wand",1) ]:2
        ]
    }

    {
        id="num_gems"
        title="Number of Gems"
        values = [ 
            ["None"                Constrain("gems_needed", 0)]
            [MenuIcon(g_gem_main_menu) ConstrainMax("gems_needed", GetMenu("num_gems")) 
                                   DungeonItem(GetMenu("num_gems"), i_gem) ]:6 
        ]
    }

    {
        id="gems_needed"
        title="Gems Needed"
        values=[
            "None"
            [MenuIcon(g_gem_main_menu) QuestRetrieve(1, [i_gem], "Gem", "Gems")]
            [MenuIcon(g_gem_main_menu) QuestRetrieve(2, [i_gem], "Gem", "Gems")]
            [MenuIcon(g_gem_main_menu) QuestRetrieve(3, [i_gem], "Gem", "Gems")]
            [MenuIcon(g_gem_main_menu) QuestRetrieve(4, [i_gem], "Gem", "Gems")]
            [MenuIcon(g_gem_main_menu) QuestRetrieve(5, [i_gem], "Gem", "Gems")]
            [MenuIcon(g_gem_main_menu) QuestRetrieve(6, [i_gem], "Gem", "Gems")]
        ]
    }

    {
        id="dungeon_type"
        title="Dungeon Type"
        values=[
            ["Tiny" DungeonLayout(d_tiny, d_small, d_basic, d_big, d_huge)]
            ["Small" DungeonLayout(d_small, d_basic, d_big, d_huge)]
            ["Basic" DungeonLayout(d_basic, d_big, d_huge)]
            ["Big" DungeonLayout(d_big, d_huge)]
            ["Huge" DungeonLayout(d_huge)]
            ["Snake" DungeonLayout(d_snake, d_long_snake, d_huge)]
            ["Long Snake" DungeonLayout(d_long_snake, d_huge)]
            ["Ring" DungeonLayout(d_ring, d_huge)]
        ]
    }

    {
        id="premapped"
        title="Premapped"
        values=[
            "No"
            ["Yes" DungeonPremapped()]
        ]
    }

    {
        id="entry"
        title="Entry Point"
        values=[
            ["Total Random" DungeonHome("total_random")]
            ["Close to Other" DungeonHome("close_to_other")]
            ["Away from Other" DungeonHome("away_from_other")]
        ]
    }

    {
        id="exit"
        title="Exit Point"
        values=[
            "No Escape"
            ["Same as Entry" DungeonExit("same_as_entry")]
            ["Other's Entry" DungeonExit("others_entry")]
            ["Total Random" DungeonExit("total_random")]
            ["Guarded" DungeonSegment("guarded_exit") DungeonExit("guarded_exit")]
        ]
    }

    {
        id="starting_gear"
        title="Starting Gear"
        values=[
            "Sword Only"
            ["Daggers"           starting_daggers]
            ["Traps"             starting_poison_traps starting_blade_traps]
            ["Daggers and Traps" starting_daggers starting_poison_traps starting_blade_traps]
        ]
    }

    {
        id="keys"
        title="Number of Keys"
        min_value = 1
        values = [
            [MenuIcon(g_key_main_menu) DungeonKeys(i_lockpicks, i_key1)]
            [MenuIcon(g_key_main_menu) DungeonKeys(i_lockpicks, i_key1, i_key2)]
            [MenuIcon(g_key_main_menu) DungeonKeys(i_lockpicks, i_key1, i_key2, i_key3)]
        ]
    }

    {
        id="pretrapped"
        title="Pretrapped Chests"
        values=[
            "No"
            ["Yes" DungeonPretrapped()]
        ]
    }

    {
        id="stuff"
        title="Amount of Stuff"
        min_value = 1
        values=[
            # There is no easy way of saying e.g. 100/(8-AmountOfStuff) so we will just write
            # the possibilities out manually...
            ["1"    DungeonStuff("barrel", 100/(8-1),    ig_trap, -1)
                    DungeonStuff("floor",  100/(18-3*1), ig_big)
                    DungeonRespawnTimings(respawn_interval, respawn_time_base, 700)]
            ["2"   DungeonStuff("barrel", 100/(8-2),    ig_trap, -1)
                    DungeonStuff("floor",  100/(18-3*2), ig_big)
                    DungeonRespawnTimings(respawn_interval, respawn_time_base, 600)]
            ["3"  DungeonStuff("barrel", 100/(8-3),    ig_trap,  -1)
                    DungeonStuff("floor",  100/(18-3*3), ig_big)
                    DungeonRespawnTimings(respawn_interval, respawn_time_base, 500)]
            ["4" DungeonStuff("barrel", 100/(8-4),    ig_trap,   -1)
                    DungeonStuff("floor",  100/(18-3*4), ig_big)
                    DungeonRespawnTimings(respawn_interval, respawn_time_base, 400)]
            ["5"    DungeonStuff("barrel", 100/(8-5),    ig_trap,  -1)
                        DungeonStuff("floor",  100/(18-3*5), ig_big)
                        DungeonRespawnTimings(respawn_interval, respawn_time_base, 300)]
        ]
    }

    {
        id="zombies"
        title="Zombie Activity"  
        values=[
            [MenuIcon("I") DungeonZombies(GetMenu("zombies"))]:6  # values from 0--5
        ]
    }

    {
        id="bats"
        title="Vampire Bats"
        values=[
            [MenuIcon("I") DungeonBats(GetMenu("bats"))]:6
        ]
    }

]

MAIN_MENU_SPACE = [ "quest", "gems_needed", "stuff" ]
