function E0090()
    MNA()CMU("CS_Grand")FAI(0)Unlock()
end
function E0091()
    MNA()CMU("CS_Grand")FAI(1)Unlock()
end
function E0092()
    MNA()CMU("CS_Grand")FAI(2)Unlock()
end
function E0093()
    MNA()CMU("CS_Grand")FAI(3)Unlock()
end
function E0094()
    MNA()CMU("CS_Grand")FAI(4)Unlock()
end

function Test1()
    --镜头转到CupCamera
    KEY()
    ANP("LocalCamera1","disable_focus")
    FON("CupCamera")WAI(90)
    ANP("Lock1",0,1)--解锁
    SOU("CS_012_block_destroy")
    WAI(30)
    FOM()
    ANP("LocalCamera1","enable_focus")
end

function CheckNormalGame(bossStr)
    local bNormalMode = true;
    if(bossStr == "Malco" or 
        bossStr == "Arowana") then
        if(FLJ("UsingKanpa") == false) then
            bNormalMode = false;
        end
    elseif(bossStr == "Flower&Hive" or 
        bossStr == "Ironhead" or 
        bossStr == "Puu&Tala") then
        if(FLJ("UsingJack&Santa") == false) then
            bNormalMode = false;
        end
    elseif(bossStr == "RedDemon" or 
        bossStr == "GolemTower" or 
        bossStr == "GolemHall" or 
        bossStr == "Tap" ) then
        if(FLJ("UsingKing") == false) then
            bNormalMode = false;
        end
    elseif(bossStr == "Lei" or 
        bossStr == "Trap" or 
        bossStr == "MonsterX") then
        if(FLJ("UsingQuote&Curly") == false) then
            bNormalMode = false;
        end
    end
    return bNormalMode;
end

function CheckSwitchFreeMode(bossStr)
    if(FLJ("FreeMode")) then
        return false;
    elseif(not CheckNormalGame(bossStr)) then
        GIT("NikumaruCounter")
        MS4("要关闭计时器")
        CAT("\n在自由模式下游玩吗？")YNJ()CLR()
        GIT()
        if(YES()) then
            TIM(false,false)
            FLP("FreeMode")
            CAT("\n计时器已关闭。")NOD()CLO()
            return false;
        else
            return true;
        end
    end
    return false;
end

function Unlock()
    --如果完成了所有挑战 则奖杯门会解锁
    if(FLJ("DefeatedMalco") and
        FLJ("DefeatedArowana") and 
        FLJ("DefeatedFlower&Hive") and 
        FLJ("DefeatedIronhead") and 
        FLJ("DefeatedPuu&Tala") and 
        FLJ("DefeatedRedDemon") and 
        FLJ("DefeatedGolemTower") and
        FLJ("DefeatedGolemHall") and
        FLJ("DefeatedTap") and
        FLJ("DefeatedLei") and
        FLJ("DefeatedTrap") and
        FLJ("DefeatedMonsterX")
    ) then
        --镜头转到CupCamera
        KEY()
        ANP("LocalCamera1","disable_focus")
        FON("CupCamera")WAI(90)
        ANP("Lock1",0,1)--解锁
        SOU("CS_012_block_destroy")
        PMU(5)
        WAI(30)
        FOM()
        ANP("LocalCamera1","enable_focus")
    end
end

function GameStart()
    PRI()
    MOV(3,14)
    GIT("Spikes")
    ITP("Spikes")
    SOU("CS_038_get_item")
    AMC(204,"CS_mychar_kanpa")
    MSG("\n获得了 =钉鞋= 。")NOD()CLR()
    GIT("NikumaruCounter")
    ITP("NikumaruCounter")
    TIM(true,true)
    SOU("CS_043_computer_beep")
    CAT("\n定时器开始进行计时。")NOD()CLO()GIT()
    CMU("CS_Grand")
    AMC("show_fishing_rod","CS_mychar_kanpa");--显示鱼竿
    SetUsingMycharFlag("UsingKanpa")
    DNP("Kanpa1")
    --一起创建其他角色
    SGP("CS_mychar_jack",0,0,0,"CS_mychar_jack_p1")AMC("show_gun",0,"CS_mychar_jack_p1")HMC("CS_mychar_jack_p1")
    SGP("CS_mychar_santa",0,0,0,"CS_mychar_santa_p2")AMC("show_gun",0,"CS_mychar_santa_p2")HMC("CS_mychar_santa_p2")
    SGP("CS_mychar_king",0,0,0,"CS_mychar_king_p1")HMC("CS_mychar_king_p1")
    SGP("CS_mychar_quote",0,0,0,"CS_mychar_quote_p1")HMC("CS_mychar_quote_p1")
    SGP("CS_mychar_curly",0,0,0,"CS_mychar_curly_p2")HMC("CS_mychar_curly_p2")
    FAI(3)
end

function SetUsingMycharFlag(flagStr)
    FLS("UsingKanpa")
    FLS("UsingJack&Santa")
    FLS("UsingKing")
    FLS("UsingQuote&Curly")
    FLP(flagStr)
end

function HideCurrentPlayer()
    if(FLJ("UsingKanpa")) then
        HMC("CS_mychar_kanpa_p1")
    elseif(FLJ("UsingJack&Santa")) then
        HMC("CS_mychar_jack_p1")
        HMC("CS_mychar_santa_p2")
    elseif(FLJ("UsingKing")) then
        HMC("CS_mychar_king_p1")
    elseif(FLJ("UsingQuote&Curly")) then
        HMC("CS_mychar_quote_p1")
        HMC("CS_mychar_curly_p2")
    end
end

function ShowCurrentPlayer()
    if(FLJ("UsingKanpa")) then
        SMC("CS_mychar_kanpa_p1")
    elseif(FLJ("UsingJack&Santa")) then
        SMC("CS_mychar_jack_p1")
        SMC("CS_mychar_santa_p2")
    elseif(FLJ("UsingKing")) then
        SMC("CS_mychar_king_p1")
    elseif(FLJ("UsingQuote&Curly")) then
        SMC("CS_mychar_quote_p1")
        SMC("CS_mychar_curly_p2")
    end
end
-----------------------------间八篇--------------------------
function MalcoBoss()
    PRI()
    if(FLJ("DefeatedMalco")) then
        TUR()MS4("\n已完成马鲁可Boss挑战")NOD()
    else
        if(CheckSwitchFreeMode("Malco")) then
            return;
        end
        MS4("\n要挑战Boss马鲁可嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_malco","QuickMalcoBoss",23,14)
        end
    end
end

function KuronBoss()
    PRI()
    if(FLJ("DefeatedArowana")) then
        TUR()MS4("\n已完成库龙Boss挑战")NOD()
    else
        if(CheckSwitchFreeMode("Arowana")) then
            return;
        end
        MS4("\n要挑战Boss库龙嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_kuron","QuickFishBoss",23,14)
        end
    end
end

--生命胶囊
function PathLifeCapsule1()
    PRI()SOU("CS_022_chest_open")DNP("PathLifeCapsule1")FLP("PathLifeCapsule1")
    MS4("获得了 =生命胶囊= ！")NOD()
    MLP(5)
    CAT("\n生命值的上限增加了 5 点！")NOD()
end

function PathLifeCapsule2()
    PRI()SOU("CS_022_chest_open")DNP("PathLifeCapsule2")FLP("PathLifeCapsule2")
    MS4("获得了 =生命胶囊= ！")NOD()
    MLP(5)
    CAT("\n生命值的上限增加了 5 点！")NOD()
end

function Fishing1()
    PRI()
    if(WET()) then
        MS4("鱼还在水中活蹦乱跳的，")NOD()
        CAT("没法捕获。")NOD()
    else
        MS4("\n这是村里鱼塘常见的珍鱼...")NOD()CLR()
        ITP("Chinfish")
        GIT("Chinfish")
        SOU("CS_038_get_item")
        DNP("Fishing1")
        FLP("Fishing1")
        CAT("\n获得了 =珍鱼= 。")NOD()
    end
end

function Fishing2()
    PRI()
    if(WET()) then
        MS4("鱼还在水中活蹦乱跳的，")NOD()
        CAT("没法捕获。")NOD()
    else
        MS4("\n这是野外湖泊里常见的青鱼...")NOD()CLR()
        ITP("Bluefish")
        GIT("Bluefish")
        SOU("CS_038_get_item")
        DNP("Fishing2")
        FLP("Fishing2")
        CAT("\n获得了 =青鱼= 。")NOD()
    end
end

function Fishing3()
    PRI()
    if(WET()) then
        MS4("鱼还在水中活蹦乱跳的，")NOD()
        CAT("没法捕获。")NOD()
    else
        MS4("\n这是野外湖泊里常见的青鱼...")NOD()CLR()
        ITP("Bluefish")
        GIT("Bluefish")
        SOU("CS_038_get_item")
        DNP("Fishing3")
        FLP("Fishing3")
        CAT("\n获得了 =青鱼= 。")NOD()
    end
end

function Fishing4()
    PRI()
    if(WET()) then
        MS4("鱼还在水中活蹦乱跳的，")NOD()
        CAT("没法捕获。")NOD()
    else
        MS4("\n这是胆小的赤鱼...")NOD()CLR()
        ITP("Redfish")
        GIT("Redfish")
        SOU("CS_038_get_item")
        DNP("Fishing4")
        FLP("Fishing4")
        CAT("\n获得了 =赤鱼= 。")NOD()
    end
end

function Door_GoJackSantaChapter()
    KEY()
    SOU("CS_011_door")
    ANP("Door_GoJackSantaChapter",0,1)WAI(10)HideCurrentPlayer()
    ANP("Door_GoJackSantaChapter",0,0)
    MOV(35,37)WAI(50)
    SOU("CS_011_door")
    ANP("Door_GoKanpaChapter",0,1)SLR(0)ShowCurrentPlayer()WAI(10)
    ANP("Door_GoKanpaChapter",0,0)
end

function Door_GoKanpaChapter()
    KEY()
    SOU("CS_011_door")
    ANP("Door_GoKanpaChapter",0,1)WAI(10)HideCurrentPlayer()
    ANP("Door_GoKanpaChapter",0,0)
    MOV(35,14)WAI(50)
    SOU("CS_011_door")
    ANP("Door_GoJackSantaChapter",0,1)SLR(0)ShowCurrentPlayer()WAI(10)
    ANP("Door_GoJackSantaChapter",0,0)
end

function Kanpa1()
    PRI()
    MS4("\n要切换为间八吗？")YNJ()
    if(YES()) then
        CLR()
        CAT("\n这里交给我吧~")NOD()CLO()
        FAO(2)
        HideCurrentPlayer();
        --切换为间八
        SetUsingMycharFlag("UsingKanpa")
        TRA("CS_bossrush_mainstage","KanpaGo",0,0)
    end
end

function KanpaGo()
    PRI()
    HMC(0)
    HMC(1)
    SMC("CS_mychar_kanpa_p1")
    SPL(0,"CS_mychar_kanpa_p1")
    SPL(1,"null")
    MOV(32,14,0)
    MOV(0,0,1)
    FAI(0)
end

-----------------------------杰克桑塔篇--------------------------
function FlowerAndHiveBoss()
    PRI()
    if(FLJ("DefeatedFlower&Hive")) then
        TUR()MS4("\n已完成魔花&蜂巢Boss挑战")NOD()
    elseif(FLJ("UsingKanpa")) then
        TUR()MS4("间八不适合这个项目，")NOD()
        CAT("\n也不适合后面的所有项目。")NOD()
    else
        if(CheckSwitchFreeMode("Flower&Hive")) then
            return;
        end
        MS4("\n要挑战魔花&蜂巢Boss嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_flower","QuickFlowerBoss",0,0)
        end
    end
end

function IronheadBoss()
    PRI()
    if(FLJ("DefeatedIronhead")) then
        TUR()MS4("\n已完成铁头Boss挑战")NOD()
    elseif(FLJ("UsingJack&Santa")) then
        if(CheckSwitchFreeMode("Ironhead")) then
            return;
        end
        MS4("\n要挑战铁头Boss嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_ironhead","QuickIronheadBoss",43,12)
        end
    else
        TUR()MS4("\n只有杰克&桑塔才能玩这个挑战。")NOD()
    end
end

function PuuAndTalaBoss()
    PRI()
    if(FLJ("DefeatedPuu&Tala")) then
        TUR()MS4("\n已完成扑悠&塔拉Boss挑战")NOD()
    elseif(FLJ("UsingKanpa")) then
        TUR()MS4("间八不适合这个项目，")NOD()
        CAT("\n也不适合后面的所有项目。")NOD()
    else
        if(CheckSwitchFreeMode("Puu&Tala")) then
            return;
        end
        MS4("\n要挑战扑悠&塔拉Boss嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_puutala","QuickPuuAndTalaBoss",35,15)
        end
    end
end

--生命胶囊
function PathLifeCapsule3()
    PRI()SOU("CS_022_chest_open")DNP("PathLifeCapsule3")FLP("PathLifeCapsule3")
    MS4("获得了 =生命胶囊= ！")NOD()
    MLP(5)
    CAT("\n生命值的上限增加了 5 点！")NOD()
end

function PathLifeCapsule4()
    PRI()SOU("CS_022_chest_open")DNP("PathLifeCapsule4")FLP("PathLifeCapsule4")
    MS4("获得了 =生命胶囊= ！")NOD()
    MLP(5)
    CAT("\n生命值的上限增加了 5 点！")NOD()
end

function PathLifeCapsule5()
    PRI()SOU("CS_022_chest_open")DNP("PathLifeCapsule5")FLP("PathLifeCapsule5")
    MS4("获得了 =生命胶囊= ！")NOD()
    MLP(5)
    CAT("\n生命值的上限增加了 5 点！")NOD()
end

function SwitchJackAndSanta()
    PRI()
    MS4("\n要切换为杰克&桑塔吗？")YNJ()
    if(YES()) then
        CLR()
        FAC("jack_normal")CAT("\n这里交给我们吧~")NOD()CLO()
        FAO(2)
        HideCurrentPlayer();
        --切换为杰克桑塔
        SetUsingMycharFlag("UsingJack&Santa")
        TRA("CS_bossrush_mainstage","JackAndSantaGo",32,37)
    end
end

function JackAndSantaGo()
    PRI()
    HMC(0)
    HMC(1)
    SMC("CS_mychar_jack_p1")
    SMC("CS_mychar_santa_p2")
    if(GOP() == 1) then
        AGP("CS_mychar_santa_p2",true)
    end
    SPL(0,"CS_mychar_jack_p1")
    SPL(1,"CS_mychar_santa_p2")
    MOV(32,37,0)
    MOV(31,37,1)
    FAI(0)
end

function Jack1()
    SwitchJackAndSanta()
end
function Santa1()
    SwitchJackAndSanta()
end

--捕获者
function Chest_Catcher()
    if(FLJ("Chest_Catcher")) then
        Chest_Catcher_Opened()
    elseif(FLJ("UsingJack&Santa")) then
        PRI()
        SOU("CS_022_chest_open")
        ANP("Chest_Catcher",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("Catcher")
        SOU("CS_038_get_item")
        MS4("=泡泡枪=")
        CAT("\n升级成了 =捕获者=")NOD()CLO()
        AMC("catcher_get")
        FLP("Chest_Catcher")
    else
        PRI()
        MS4("\n无法打开...")NOD()
    end
end
function Chest_Catcher_Opened()
    PRI()
    MS4("\n是空的...")NOD()
end

--幽灵火球
function Chest_GhostFire()
    if(FLJ("Chest_GhostFire")) then
        Chest_GhostFire_Opened()
    elseif(FLJ("UsingJack&Santa")) then
        PRI()
        SOU("CS_022_chest_open")
        ANP("Chest_GhostFire",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("GhostFire")
        SOU("CS_038_get_item")
        MS3("=火球=")
        CAT("\n升级成了 =幽灵火球=")NOD()CLO()
        AMC("ghostfire_get")
        FLP("Chest_GhostFire")
    else
        PRI()
        MS4("\n无法打开...")NOD()
    end
end
function Chest_GhostFire_Opened()
    PRI()
    MS4("\n是空的...")NOD()
end

-----------------------------金篇--------------------------
function RedDemonBoss()
    PRI()
    if(FLJ("DefeatedRedDemon")) then
        TUR()MS4("\n已完成赤鬼Boss挑战")NOD()
    elseif(FLJ("UsingKanpa")) then
        TUR()MS4("间八不适合这个项目，")NOD()
        CAT("\n也不适合后面的所有项目。")NOD()
    else
        if(CheckSwitchFreeMode("RedDemon")) then
            return;
        end
        MS4("\n要挑战赤鬼Boss嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_reddemon","QuickRedDemonBoss",13,17)
        end
    end
end

function GolemTower()
    PRI()
    if(FLJ("DefeatedGolemTower")) then
        TUR()MS4("\n已完成魔像之塔挑战")NOD()
    elseif(FLJ("UsingKanpa")) then
        TUR()MS4("间八不适合这个项目，")NOD()
        CAT("\n也不适合后面的所有项目。")NOD()
    else
        if(CheckSwitchFreeMode("GolemTower")) then
            return;
        end
        MS4("\n要挑战魔像之塔嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_golemtower","QuickGolemTower",6,60)
        end
    end
end

function GolemHall()
    PRI()
    if(FLJ("DefeatedGolemHall")) then
        TUR()MS4("\n已完成魔像大厅挑战")NOD()
    elseif(FLJ("UsingKanpa")) then
        TUR()MS4("间八不适合这个项目，")NOD()
        CAT("\n也不适合后面的所有项目。")NOD()
    else
        if(CheckSwitchFreeMode("GolemHall")) then
            return;
        end
        MS4("\n要挑战魔像大厅嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_golemhall","QuickGolemHall",39,18)
        end
    end
end

function TapBoss()
    PRI()
    if(FLJ("DefeatedTap")) then
        TUR()MS4("\n已完成塔普Boss挑战")NOD()
    elseif(FLJ("UsingKanpa")) then
        TUR()MS4("间八不适合这个项目，")NOD()
        CAT("\n也不适合后面的所有项目。")NOD()
    else
        if(CheckSwitchFreeMode("Tap")) then
            return;
        end
        MS4("\n要挑战塔普Boss嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_tap","QuickTapBoss",39,18)
        end
    end
end

function Door_GoKingChapter()
    KEY()
    SOU("CS_011_door")
    ANP("Door_GoKingChapter",0,1)WAI(10)HideCurrentPlayer()
    ANP("Door_GoKingChapter",0,0)
    MOV(4,60)WAI(50)
    SOU("CS_011_door")
    ANP("Door_GoJackSantaChapter2",0,1)SLR(1)ShowCurrentPlayer()WAI(10)
    ANP("Door_GoJackSantaChapter2",0,0)
end

function Door_GoJackSantaChapter2()
    KEY()
    SOU("CS_011_door")
    ANP("Door_GoJackSantaChapter2",0,1)WAI(10)HideCurrentPlayer()
    ANP("Door_GoJackSantaChapter2",0,0)
    MOV(4,37)WAI(50)
    SOU("CS_011_door")
    ANP("Door_GoKingChapter",0,1)SLR(1)ShowCurrentPlayer()WAI(10)
    ANP("Door_GoKingChapter",0,0)
end

function PathLifeCapsule6()
    PRI()SOU("CS_022_chest_open")DNP("PathLifeCapsule6")FLP("PathLifeCapsule6")
    MS4("获得了 =生命胶囊= ！")NOD()
    MLP(5)
    CAT("\n生命值的上限增加了 5 点！")NOD()
end
--电容器
function Chest_Capacitor()
    if(FLJ("Chest_Capacitor")) then
        Chest_Capacitor_Opened()
    elseif(FLJ("UsingKing")) then
        PRI()
        SOU("CS_022_chest_open")
        ANP("Chest_Capacitor",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("Capacitor")
        ITP("Capacitor")
        SOU("CS_038_get_item")
        MS3("\n获得了 =电容器= 。")NOD()CLO()
        FLP("Chest_Capacitor")
    else
        PRI()
        MS4("\n无法打开...")NOD()
    end
end
function Chest_Capacitor_Opened()
    PRI()
    MS4("\n是空的...")NOD()
end

function King1()
    PRI()
    MS4("\n要切换为金吗？")YNJ()
    if(YES()) then
        CLR()
        FAC("king_normal")CAT("\n这里交给我吧~")NOD()CLO()
        FAO(2)
        HideCurrentPlayer();
        --切换为金
        SetUsingMycharFlag("UsingKing")
        TRA("CS_bossrush_mainstage","KingGo",6,60)
    end
end

function KingGo()
    PRI()
    HMC(0)
    HMC(1)
    SMC("CS_mychar_king_p1")
    SPL(0,"CS_mychar_king_p1")
    SPL(1,"null")
    MOV(6,60,0)
    FAI(0)
end
-----------------------------库特卡莉篇--------------------------
function LeiBoss()
    PRI()
    if(FLJ("DefeatedLei")) then
        TUR()MS4("\n已完成雷Boss挑战")NOD()
    elseif(FLJ("UsingQuote&Curly")) then
        if(CheckSwitchFreeMode("Lei")) then
            return;
        end
        MS4("\n要挑战雷Boss嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_lei","QuickLeiBoss",34,18)
        end
    else
        TUR()MS4("\n只有库特&卡莉才能玩这个挑战。")NOD()
    end
end

function FortressTrap()
    PRI()
    if(FLJ("DefeatedTrap")) then
        TUR()MS4("\n已完成陷阱房挑战")NOD()
    elseif(FLJ("UsingQuote&Curly")) then
        if(CheckSwitchFreeMode("Trap")) then
            return;
        end
        MS4("\n要挑战陷阱房嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_trap","QuickTrap",40,23)
        end
    else
        TUR()MS4("\n只有库特&卡莉才能玩这个挑战。")NOD()
    end
end

function MonsterXBoss()
    PRI()
    if(FLJ("DefeatedMonsterX")) then
        TUR()MS4("\n已完成MonsterXBoss挑战")NOD()
    elseif(FLJ("UsingQuote&Curly")) then
        if(CheckSwitchFreeMode("MonsterX")) then
            return;
        end
        MS4("\n要挑战MonsterX Boss嘛？")YNJ()
        if(YES()) then
            CLO()
            FAO(3)TRA("CS_bossrush_eyex","QuickMonsterXBoss",40,23)
        end
    else
        TUR()MS4("\n只有库特&卡莉才能玩这个挑战。")NOD()
    end
end

function SwitchQuoteAndCurly()
    PRI()
    MS4("\n要切换为库特&卡莉吗？")YNJ()
    if(YES()) then
        CLR()
        FAC("curly_happy")CAT("\n这里交给我们吧！")NOD()CLO()
        FAO(2)
        HideCurrentPlayer();
        --切换为库特卡莉
        SetUsingMycharFlag("UsingQuote&Curly")
        TRA("CS_bossrush_mainstage","QuoteAndCurlyGo",32,83)
    end
end

function QuoteAndCurlyGo()
    PRI()
    HMC(0)
    HMC(1)
    SMC("CS_mychar_quote_p1")
    SMC("CS_mychar_curly_p2")
    if(GOP() == 1) then
        AGP("CS_mychar_curly_p2",true)
    end
    SPL(0,"CS_mychar_quote_p1")
    SPL(1,"CS_mychar_curly_p2")
    MOV(32,83,0)
    MOV(31,83,1)
    FAI(0)
end

function Quote1()
    SwitchQuoteAndCurly()
end
function Curly1()
    SwitchQuoteAndCurly()
end

function Door_GoQuoteCurlyChapter()
    KEY()
    SOU("CS_011_door")
    ANP("Door_GoQuoteCurlyChapter",0,1)WAI(10)HideCurrentPlayer()
    ANP("Door_GoQuoteCurlyChapter",0,0)
    MOV(35,83)WAI(50)
    SOU("CS_011_door")
    ANP("Door_GoKingChapter2",0,1)SLR(0)ShowCurrentPlayer()WAI(10)
    ANP("Door_GoKingChapter2",0,0)
end

function Door_GoKingChapter2()
    KEY()
    SOU("CS_011_door")
    ANP("Door_GoKingChapter2",0,1)WAI(10)HideCurrentPlayer()
    ANP("Door_GoKingChapter2",0,0)
    MOV(35,60)WAI(50)
    SOU("CS_011_door")
    ANP("Door_GoQuoteCurlyChapter",0,1)SLR(0)ShowCurrentPlayer()WAI(10)
    ANP("Door_GoQuoteCurlyChapter",0,0)
end

function PathLifeCapsule7()
    PRI()SOU("CS_022_chest_open")DNP("PathLifeCapsule7")FLP("PathLifeCapsule7")
    MS4("获得了 =生命胶囊= ！")NOD()
    MLP(5)
    CAT("\n生命值的上限增加了 5 点！")NOD()
end

function Chest_SpurCharger()
    if(FLJ("Chest_SpurCharger")) then
        Chest_SpurCharger_Opened()
    else
        PRI()
        FLP("Chest_SpurCharger")
        ITP("SpurCharger")
        SOU("CS_022_chest_open")
        ANP("Chest_SpurCharger",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("SpurCharger")
        SOU("CS_038_get_item")
        CAT("\n获得了 =突波扩展充能器= 。")NOD()
    end
end

function Chest_SpurCharger_Opened()
    PRI()
    MS4("\n里面是空的...")NOD()CLR()
end

function Chest_MachinegunWheelModule()
    if(FLJ("Chest_MachinegunWheelModule")) then
        Chest_MachinegunWheelModule_Opened()
    else
        PRI()
        FLP("Chest_MachinegunWheelModule")
        ITP("MachinegunWheelModule")
        SOU("CS_022_chest_open")
        ANP("Chest_MachinegunWheelModule",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("MachinegunWheelModule")
        SOU("CS_038_get_item")
        CAT("\n获得了 =机枪转轮模块= 。")NOD()
    end
end

function Chest_MachinegunWheelModule_Opened()
    PRI()
    MS4("\n里面是空的...")NOD()CLR()
end

function Chest_LiftPot1_Opened()
    PRI()
    MS4("\n里面是空的...")NOD()CLR()
end

function Chest_LiftPot1()
    if(FLJ("Chest_LiftPot1")) then
        Chest_LiftPot1_Opened()
    else
        PRI()
        FLP("Chest_LiftPot1")
        ITP("LifePot")
        SOU("CS_022_chest_open")
        ANP("Chest_LiftPot1",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("LifePot")
        SOU("CS_038_get_item")
        CAT("\n获得了 =生命罐= 。")NOD()
    end
end

function Chest_LiftPot2_Opened()
    PRI()
    MS4("\n里面是空的...")NOD()CLR()
end

function Chest_LiftPot2()
    if(FLJ("Chest_LiftPot2")) then
        Chest_LiftPot2_Opened()
    else
        PRI()
        FLP("Chest_LiftPot2")
        ITP("LifePot")
        SOU("CS_022_chest_open")
        ANP("Chest_LiftPot2",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("LifePot")
        SOU("CS_038_get_item")
        CAT("\n获得了 =生命罐= 。")NOD()
    end
end
-----------------------------奖杯--------------------------
function Door_GoCup()
    KEY()
    SOU("CS_011_door")
    ANP("Door_GoCup",0,1)WAI(10)HideCurrentPlayer()
    ANP("Door_GoCup",0,0)
    MOV(4,112)WAI(50)
    SOU("CS_011_door")
    ANP("Door_Back",0,1)SLR(1)ShowCurrentPlayer()WAI(10)
    ANP("Door_Back",0,0)
end

function Door_Back()
    KEY()
    TUR()MS4("\n不能返回！")NOD()
end

function TouchCup1()
    KEY()
    DNP()
    CMU("XXXX")
    CNP("Firework1","CS_pe_fireworks",0)
    --停止计时器
    if(not FLJ("FreeMode")) then
        TIM(true,false)
        --如果是新纪录
        if(STC()) then
            CMU("CS_White")
        else
            CMU("CS_Toroko")
        end
    else
        CMU("CS_Balcony")
    end
    ANP("Cup1","get")
    SOU("CS_022_chest_open")
    WAI(60)
    MS2("\n")
    CAT("恭喜完成Boss Rush挑战！~",2)
    WAI(9999)
end

function Died()
    SMC(0)SMC(1)LIP(1000)MIP(1000)
end