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

function Door_GoPeaceTownHotel()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownHotel",0,1)FAO(0)TRA("CS_peace_town_hotel","E0092",25,19)
end

function Door_GoPeaceTownNoodle()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownNoodle",0,1)FAO(0)TRA("CS_peace_town_noodle","E0092",11,14)
end

function Door_GoPeaceTownDisco()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownDisco",0,1)FAO(0)TRA("CS_peace_town_disco","E0092",5,16)
end

function Door_GoPeaceTownRepair()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownRepair",0,1)FAO(0)TRA("CS_peace_town_repair","E0092",9,12)
end

function Door_GoPeaceTownRecycle()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownRecycle",0,1)FAO(0)TRA("CS_peace_town_recycle","E0092",11,14)
end

function Door_GoPeaceTownBakery()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownBakery",0,1)FAO(0)TRA("CS_peace_town_bakery","E0092",11,14)
end

function GoPeaceTownAround()
    if(FLJ("BringHoneycomb")) then
        PRI()FAO(3)TRA("CS_peace_town_around","E0091",38,14,1,15)
    else
        KEY()
        MYB(0,PLY())WAS()
        FAC("jack_normal")MS4("没有足够的信息前")
        CAT("\n还是先不出小镇吧。")NOD()
    end
end

function Door_GoPeaceTownDivination()
    if(FLJ("GoFindJenka")) then
        KEY()FAC("jack_normal")MS4("我们还是得尽快出发")
        CAT("\n不打扰米莎莉了吧。")NOD()
    elseif(FLJ("GiveToMisery")) then
        PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownDivination",0,1)FAO(0)TRA("CS_peace_town_divination","E0092",28,12)
    elseif(FLJ("FireflyCatch20")) then
        if(ITJ("Firefly")) then
            local num = ITC("Firefly")
            if(num >= 20) then
                KEY()FAC("jack_normal")MS4("在拜访米莎前")
                CAT("\n还是先和巴鲁罗格商量一下吧。")NOD()
            else
                KEY()FAC("jack_normal")MS4("萤火虫数量还不够...")NOD()
                CAT("\n再回洞窟抓到20只吧。")NOD()
            end
        else
            KEY()FAC("jack_normal")MS4("\n我们还是快去抓萤火虫吧...")NOD()
        end
    elseif(FLJ("CatchFirefly")) then
        if(ITJ("Firefly")) then
            local num = ITC("Firefly")
            if(num >= 20) then
                KEY()FAC("jack_normal")MS4("在拜访米莎前")
                CAT("\n还是先和巴鲁罗格商量一下吧。")NOD()
            else
                KEY()FAC("jack_normal")MS4("也不知道数量够不够...")NOD()
                CAT("\n还是去问问巴鲁罗格吧。")NOD()
            end
        else
            KEY()FAC("jack_normal")MS4("\n我们还是快去抓萤火虫吧...")NOD()
        end
    elseif(FLJ("GetOutDivination")) then
        KEY()
        MS4("你无形感觉到一股杀气，")NOD()
        CAT("\n（再进去的话肯定会被干掉的...）")NOD()
    else
        if(FLJ("DivinationOpen")) then
            PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTownDivination",0,1)FAO(0)TRA("CS_peace_town_divination","E0092",28,12)
        else
            KEY()FAC("jack_normal")MS4("看样子还没到营业时间，")NOD()
            CAT("\n先去其他地方逛逛吧。")NOD()
        end
    end
end

--被米莎莉赶了出来
function GetOutDivination()
    KEY()
    ANP("Door_GoPeaceTownDivination",0,1)
    FON("Door_GoPeaceTownDivination",1)
    --设置泡泡跟踪目标
    SNP("null",25,30,0,"mainLayer","Bubble1_target")--泡泡
    SNP("null",23,30,0,"mainLayer","Bubble2_target")--泡泡
    MOV(25,30,PLY())
    MOV(23,30,1-PLY())
    SLR(1)
    FAI(0)
    WAI(32)
    SNP("CS_bubble_catcher",20,31,1,"mainLayer","Bubble1")--泡泡
    ANP("Bubble1","set_target")
    ANP("Bubble1","Bubble1_target")
    if(MCN(PLY()) == "CS_mychar_jack") then
        ANP("Bubble1","caught_jack")
    else
        ANP("Bubble1","caught_santa")
    end
    WAI(32)
    DNP("Bubble1")
    SMC(PLY())
    AMC("hurt",1,PLY())
    --玩家2
    SNP("CS_bubble_catcher",20,31,1,"mainLayer","Bubble2")--泡泡
    ANP("Bubble2","set_target")
    ANP("Bubble2","Bubble2_target")
    if(MCN(1-PLY()) == "CS_mychar_jack") then
        ANP("Bubble2","caught_jack")
    else
        ANP("Bubble2","caught_santa")
    end
    WAI(16)
    AMC("lie",1,PLY())
    SOU("CS_071_little_crash")
    AMC("smoke",0,PLY())
    WAI(8)
    DNP("Bubble2")
    SMC(1-PLY())
    AMC("hurt",1,1-PLY())
    WAI(16)
    AMC("lie",1,1-PLY())
    SOU("CS_071_little_crash")
    AMC("smoke",0,1-PLY())
    WAI(64)
    SOU("CS_011_door")ANP("Door_GoPeaceTownDivination",0,0)
    AMC("show_gun")
    WAI(32)
    AMC("normal",1,PLY())
    WAI(16)
    AMC("normal",1,1-PLY())
    WAI(16)
    AMC("normal",0,PLY())
    WAI(16)
    AMC("normal",0,1-PLY())
    WAI(64)
    FAC("jack_><")MS3("这下麻烦了，")NOD()
    FAC("jack_normal")CAT("\n我们回去再问问巴鲁罗格吧。")NOD()
    CMU("CS_Azarashi")
    FOM()
    FLP("GetOutDivination")
    MSR("AskMiseryForHelp","AskBalrogForHelp")
end

--在酒店和小巴对完话
function ChatWithBalrog()
    KEY()
    SMC()
    AMC("show_gun")
    MOV(30,15,PLY())
    SLR(1,PLY())
    MOV(32,15,1-PLY())
    SLR(0,1-PLY())
    CMU("CS_Azarashi")
    FAI(0)
    WAI(32)
    FAC("jack_normal")MS3("占卜屋现在应该营业了，")NOD()
    CAT("\n我们过去看看吧。")NOD()
end

function SantaAndJackArrive()
    KEY()
    CMU("XXXX")
    --玩家1切换为杰克
    if(MCN(0) ~= "CS_mychar_jack") then
        SWP()
    end
    MV0()
    SNP("sys_trigger_v_allplayer",50,0,0,"mainLayer","Camera1")
    WAI(1)
    FON("Camera1",1)
    MOV(49,0,0)
    SLR(1,0)
    MOV(51,0,1)
    SLR(0,1)
    AMC("hurt")
    FAI(0)
    WAS()
    SOU("CS_071_little_crash")
    AMC("smoke")
    AMC("lie")
    WAI(128)
    AMC("normal","CS_mychar_santa")
    WAI(32)
    AMC("normal",1,1)--桑塔往右看
    WAI(32)
    AMC("back",1,1)--桑塔往右看
    WAI(32)
    AMC("back",0,1)--桑塔往右看
    WAI(32)
    MS3("哇啊！")NOD()
    CAT("\n这是什么地方！")NOD()CLO()
    WAI(32)
    FAC("jack_><")MS3("唔.....")
    AMC("normal",0,1)--桑塔往左看
    NOD()
    CAT("\n我都快被转吐了...")NOD()CLO()
    WAI(16)
    AMC("normal","CS_mychar_jack")
    WAI(32)
    AMC("normal",0,0)--杰克往左看
    WAI(48)
    AMC("back",0,0)
    WAI(48)
    AMC("back",1,0)
    WAI(32)
    AMC("normal",1,0)--杰克往右看
    WAI(32)
    FAC("jack_normal")MS3("没想到村子外面")
    CAT("\n还有这种地方...")NOD()CLO()
    WAI(32)
    SOU("CS_052_enemy_hurt_big")
    WAI(64)
    MS3("\n想起来我早上还没吃呐...")NOD()CLR()
    FAC("jack_><")MS3("\n别说了...我也是...")NOD()CLR()
    FAC("jack_normal")MS3("还是先一起去附近逛逛吧...")NOD()
    CAT("\n然后顺便找一下")
    CAT("\n多隆子她们的下落...")NOD()CLR()
    FAC()CAT("\n那快点出发吧！")NOD()
    DNP("Camera1")
    FOM()
    CMU("CS_Azarashi")
end

function Credit_Cut()
    KEY()
    SNP("null",15,10,0,"mainLayer","Camera1")
    FON("Camera1",1)
    local helicopter_x =21;
    local helicopter_y =10;
    SNP("CS_helicopter",helicopter_x,helicopter_y,1,"mainLayer","Helicopter1")
    ANP("Helicopter1","mute")
    ANP("Helicopter1","fly")
    ANP("Helicopter1","set_manned")
    ANP("Helicopter1","landing")
    SNP("CS_quote_animate",helicopter_x,helicopter_y-1,1,"mainLayer","Quote1")
    SNP("CS_curly_animate",helicopter_x-1,helicopter_y-1,1,"mainLayer","Curly1")
    LAY("credit_black",true)
    FAI(0)
    WAI(180)
    ANP("Helicopter1","unset_manned")
    WAI(16)
    ANP("Quote1","walk",1)
    WAI(16)
    ANP("Curly1","walk",1)
    WAI(16)
    SNP("CS_sue_animate",21,14,1,"mainLayer","Sue1")
    WAI(16)
    ANP("Sue1","walk",1)
    SNP("CS_toroko_animate",21,14,1,"mainLayer","Toroko1")
    WAI(16)
    SNP("CS_santa_animate",21,14,1,"mainLayer","Santa1")
    ANP("Toroko1","walk",1)
    WAI(16)
    ANP("Santa1","walk",1)
    SNP("CS_chako_animate",21,14,1,"mainLayer","Chako1")
    WAI(16)
    ANP("Chako1","walk",1)
    WAI(16)
    SNP("CS_jack_animate",21,14,1,"mainLayer","Jack1")
    WAI(16)
    ANP("Jack1","walk",1)
    WAI(24)
    ANP("Quote1","back",1)
    ANP("Door_GoPeaceTownHotel",0,1)
    WAI(16)
    DNP("Quote1")
    WAI(16)
    DNP("Curly1")
    WAI(16)
    ANP("Jack1","normal",1)
    DNP("Sue1")
    WAI(16)
    DNP("Toroko1")
    WAI(16)
    DNP("Santa1")
    WAI(16)
    ANP("Chako1","normal",0)
    WAI(64)
    ANP("Chako1","jump")
    SNP("CS_exclamation",31,13,0,"mainLayer","null")--感叹号
    WAI(60)
    SNP("CS_speechbubble",26,14,1,"mainLayer","Speechbubble1")
    ANP("Speechbubble1","ls_speechbubble_king")
    WAI(120)
    DNP("Speechbubble1")
    WAI(32)
    ANP("Chako1","walk",0)
    WAI(96)
    ANP("Chako1","normal",1)
    WAI(32)
    ANP("Chako1","push",1)
    ANP("Jack1","be_push",1)
    WAI(120)
    FAO(2)
    FOM()
    TRA("CS_credit","Credit_Cut1",0,0)
end

function Credit_Cut2()
    KEY()
    SNP("null",50,17,0,"mainLayer","Camera1")
    FON("Camera1",1)
    SNP("CS_skydragon_animate",50,20,0,"mainLayer","Skydragon1")ANP("Skydragon1","hover_toroko")
    SNP("CS_chako_animate",52,23,0,"mainLayer","Chako1")ANP("Chako1","look_up")
    ANP("")
    FAI(2)
    WAI(400)
    FAO(2)
    FOM()
    TRA("CS_credit","Credit_Cut4",0,0)
end