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

function Door_GoPeaceTown()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoPeaceTown",0,1)FAO(2)TRA("CS_peace_town","E0090",31,15)
end

function Door_GoMasroRoom()
    KEY()MM0()
    SOU("CS_011_door")
    ANP("Door_GoMasroRoom",0,1)WAI(10)HMC()
    ANP("Door_GoMasroRoom",0,0)
    MOV(32,7)WAI(16)
    SOU("CS_011_door")
    ANP("Door_OutMasroRoom",0,1)SLR(1)SMC()WAI(10)
    ANP("Door_OutMasroRoom",0,0)
end

function Door_OutMasroRoom()
    KEY()MM0()
    SOU("CS_011_door")
    ANP("Door_OutMasroRoom",0,1)WAI(10)HMC()
    ANP("Door_OutMasroRoom",0,0)
    MOV(30,7)WAI(16)
    SOU("CS_011_door")
    ANP("Door_GoMasroRoom",0,1)SLR(0)SMC()WAI(10)
    ANP("Door_GoMasroRoom",0,0)
end

function BarlogCountFirefly()
    KEY()FAC("balrog_normal")CLR()
    MS3("\n我看看有多少只")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")CLR()
    local num = ITC("Firefly")
    if(num >= 20) then
        CAT("有"..num.."只应该够了。")NOD()
        CAT("\n你们这就拿去给米莎莉吧~")NOD()
        FLP("GiveToMisery")
        MSR("CatchFirefly","GiveToMisery")
    else
        if(num <= 5) then
            CAT(""..num.."只数量还是太少了，")NOD()
            CAT("\n需要抓到20只。")NOD()CLR()
            CAT("\n你们再去洞窟里抓点吧。")NOD()
        else
            CAT(""..num.."只还不够，")NOD()
            CAT("\n需要抓到20只。")NOD()CLR()
            CAT("\n你们再去洞窟里抓点吧。")NOD()
        end
        FLP("FireflyCatch20")
    end
end
--柜台（小巴）
function Barlog1()
    if(FLJ("GoFindJenka")) then
        KEY()FAC("balrog_normal")
        MS3("珍卡婆婆在的地方似乎比较危险，")NOD()
        CAT("\n你们要小心呐。")NOD()
    elseif(FLJ("GiveToMisery")) then
        KEY()FAC("balrog_normal")
        MS3("\n你们这就拿去给米莎莉吧~")NOD()
    elseif(ITJ("Firefly")) then
        if(FLJ("FireflyCatch20")) then
            BarlogCountFirefly()
        else
            KEY()
            FAC("balrog_normal")MS3("你们就已经抓到萤火虫了嘛。")NOD()
            ANP("Barlog1","happy")
            FAC("balrog_happy")CAT("\n这不是蛮顺利的嘛~")NOD()CLR()
            BarlogCountFirefly()
        end
    elseif(FLJ("FireflyCatch20")) then
        KEY()
        FAC("balrog_normal")MS3("萤火虫洞窟就在外面左边，")NOD()
        CAT("\n快去洞窟里抓吧。")NOD()
        CAT("\n要20只呦。")NOD()
    elseif(FLJ("CatchFirefly")) then
        KEY()
        FAC("balrog_normal")MS3("看样子你们已经弄到捕获工具了。")NOD()
        ANP("Barlog1","happy")
        FAC("balrog_happy")CAT("\n这不是蛮顺利的嘛~")NOD()CLR()
        FAC("jack_normal")CAT("\n那我们大概要抓多少只呢？")NOD()CLR()
        FAC("balrog_normal")CAT("我想想")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")
        CAT("\n大概要100只吧...")NOD()CLR()
        FAC("jack_><")CAT("我们哪抓的了这么多，")NOD()
        CAT("\n洞窟里也许都没这么多吧。")NOD()CLR()
        FAC("balrog_normal")CAT("\n那20只最起码要了。")NOD()CLR()
        FAC("jack_normal")CAT("\n我知道了，那就抓20只吧。")NOD()CLR()
        FLP("FireflyCatch20")
    elseif(FLJ("ChatWithBalrog_GoodLuck")) then
        KEY()
        FAC("balrog_normal")MS3("你们去小镇上转转吧，")NOD()
        CAT("\n一定可以找到解决方法的。")NOD()
    elseif(FLJ("GetOutDivination")) then
        KEY()
        FAC("balrog_normal")MS3("你们怎么这么快就回来了，")NOD()
        ANP("Barlog1","happy")
        FAC("balrog_happy")CAT("\n是想念我来陪我聊天了嘛~")NOD()CLR()
        FAC("jack_><")CAT("\n其实我们被她赶了出来...")NOD()CLR()
        FAC("balrog_normal")CAT("\n这可不是个好消息。")NOD()CLR()
        CAT("说起来，")NOD()
        CAT("\n从那件事后她就一直心情不太好...")NOD()CLR()
        FAC("jack_normal")CAT("\n是发生了什么事吗？")NOD()CLR()
        FAC("balrog_normal")CAT("最近有客人")
        CAT("\n带着宠物进去被蝙蝠吓到了，")NOD()
        CAT("\n然后把她的店弄的一团糟...")NOD()CLR()
        CAT("\n后来她的店就禁止宠物入内了。")NOD()CLR()
        CAT("不过连咪咪卡都被赶了出来，")NOD()
        CAT("\n看样子她今天心情是真的不好..")NOD()CLR()
        FAC("jack_normal")CAT("\n那有什么办法嘛？")NOD()CLR()
        FAC("balrog_normal")CAT("我记得她小时候喜欢萤火虫")NOD()
        CAT("\n如果你们抓一些萤火虫送给她的话，")NOD()
        CAT("\n也许她心情会变好。")NOD()CLR()
        FAC("jack_><")CAT("\n可我们没有任何抓萤火虫的工具啊..")NOD()CLR()
        FAC("balrog_normal")CAT("关于这个我也没有办法了。")NOD()
        CAT("\n不过在这个小镇上总有办法解决的。")NOD()CLR()
        ANP("Barlog1","happy")
        FAC("balrog_happy")CAT("\n祝你们好运~")NOD()
        FLP("ChatWithBalrog_GoodLuck")
        MSR("AskBalrogForHelp","SearchingForMethodsToCaptureFireflies")
    elseif (FLJ("ChatWithBalrog")) then
        KEY()
        FAC("balrog_normal")MS3("我这里因为营业走不开，")NOD()
        CAT("\n暂时没法帮助你们了...")NOD()
    else
        KEY()
        FAO(0)
        MOV(15,19,PLY())
        MOV(14,19,1-PLY())
        SLR(1)
        AMC("normal")
        AMC("hide_gun")
        FAI(2)
        ANP("Barlog1","happy")
        FAC("balrog_happy")MS3("\n欢迎光临")NOD()
        FAC("balrog_normal")CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)
        CLR()CAT("你们好像是我以前")
        CAT("\n抓走过的那几只咪咪卡。")NOD()CLR()
        ANP("Barlog1","happy")
        FAC("balrog_happy")CAT("\n话说你们今天是出来旅游玩的嘛~")NOD()CLR()
        FAC("jack_><")CAT("虽然很想，")NOD()
        FAC("jack_normal")CAT("\n但是今天早上有怪物出现，")NOD()
        CAT("\n用泡泡抓走了多隆子和数。")NOD()CLR()
        CAT("\n所以我们...")NOD()CLR()CMU("XXXX")
        FAC("balrog_normal")CAT("等等...我先说明一下..")NOD()
        CAT("\n那可不是我干的！")NOD()
        CAT("\n我不可能会再去做那种事！")NOD()CLR()
        CAT("我一天到晚都在这里营业，")NOD()
        CAT("\n而且忙的不可开交！")NOD()CLR()
        ANP("Barlog1","shock")
        FAC("balrog_shock")CAT("要是米莎莉发现我人不在，")NOD()
        CAT("\n她会把我变成青蛙")
        CAT("\n放生到大海的！")NOD()CLR()
        ANP("Barlog1","normal")
        FAC("balrog_normal")CAT("\n就像这样...")NOD()CLO()
        ANP("Barlog1","normal",1)
        WAI(20)
        ANP("Barlog1","leave_counter")
        SOU("CS_023_thud")
        WAI(32)
        ANP("Barlog1","back")
        WAI(100)
        AMC("hurt")
        ANP("Barlog1","shock")
        ANP("Barlog1","drawBefore")
        ANP("Counter1","throw")
        WAI(240)
        FAO(0)TRA("CS_peace_town_hotel","Barlog1_chat_end",15,19)
    end
end

function Barlog1_chat_end()
    KEY()
    MOV(15,19,PLY())
    MOV(14,19,1-PLY())
    MV0()
    SLR(1)
    CMU("CS_Anzen")
    FAI(2)
    FAC("balrog_normal")MS3("抱歉情绪有点激动...")NOD()
    CAT("\n没吓到你们吧。")NOD()CLR()
    FAC("jack_><")CAT("我们只是想救回她们，")NOD()
    CAT("\n你有什么好主意嘛？")NOD()CLR()
    FAC("balrog_normal")CAT("要不去问问米莎莉？")NOD()
    CAT("\n今天占卜屋应该是开业的，")NOD()
    CAT("\n这个点也到营业时间了。")NOD()
    CAT("\n她今天心情好的话也许会帮你们。")NOD()CLR()
    FAC("jack_normal")CAT("\n知道啦，谢谢你")NOD()CLR()
    FAC("balrog_normal")CAT("\n不客气~")NOD()CLR()
    ANP("Barlog1","happy")
    FAC("balrog_happy")CAT("\n话说两位要不要办入住~")NOD()CLR()
    FAC("jack_><")CAT("谢谢！不用了！")NOD()
    CAT("\n我们忙着呢！")NOD()CLR()
    FAC("jack_normal")CAT("\n桑塔，我们快走吧！")NOD()CLO()
    AMC("walk",1,PLY())
    WAI(48)
    AMC("walk",1,1-PLY())
    WAI(110)
    AMC("back",1,PLY())
    WAI(16)
    SOU("CS_011_door")ANP("Door_GoPeaceTown",0,1)
    WAI(16)
    HMC(PLY())
    WAI(32)
    AMC("back",1,1-PLY())
    WAI(16)
    HMC(1-PLY())
    WAI(16)
    SOU("CS_011_door")ANP("Door_GoPeaceTown",0,0)
    WAI(64)
    FAC("balrog_normal")MS3("\n没人说话好无聊唉....")NOD()CLO()
    FAO(0)
    FLP("DivinationOpen")
    FLP("ChatWithBalrog")
    MSA("AskMiseryForHelp")
    TRA("CS_peace_town","ChatWithBalrog",30,15)
end


function Masro1()
    KEY()
    MS4("这只红狐狸看上去很忙的样子...")NOD()
    CAT("\n叨叨着什么....")NOD()CLR()
    TUR()CAT("\n“Pixel ———— 我们的神！”")NOD()
end

--得到幽灵火球后准备去寻找珍卡
function GoFindJenka()
    KEY()
    MOV(15,19,MCI("CS_mychar_jack"))
    MOV(14,19,MCI("CS_mychar_santa"))
    SLR(1)
    WAI(64)
    FAI()
    WAI(32)
    CMU("CS_Anzen")
    FAC("balrog_normal")MS3("所以，")NOD()
    CAT("\n你们要离开小镇")
    CAT("\n去寻找珍卡婆婆了嘛。")NOD()CLR()
    FAC("jack_normal")CAT("嗯，多隆子她们还等")
    CAT("\n着我们去救呢，")NOD()
    CAT("\n也谢谢你在小镇上给我们提供帮助。")NOD()CLR()
    ANP("Barlog1","happy")
    FAC("balrog_happy")MS3("\n那有空下次来小镇上玩呐~")NOD()CLR()
    FAC("jack_normal")MS3("\n我一定会的。")NOD()CLO()
    FLP("GoFindJenka")
    MSR("GiveToMisery","GoFindJenka")
end

function KazumaAndSue()
    KEY()
    HMC()
    MNP("Masro1",36,7,0)
    ANP("Masro1","sleep")
    ANP("ComputerMasro1",0,0)
    DNP("Barlog1")
    SNP("CS_kazuma_animate",1,13,0,"mainLayer","Kazuma1")
    SNP("CS_sakamoto_sue_animate",3,13,1,"mainLayer","SakamotoSue1")
    SNP("CS_skydragon_animate",5,13,0,"mainLayer","SkyDragon1")
    ANP("Kazuma1","computer")
    CMU("CS_Anzen")
    FAI(0)
    WAI(60)
    KEY()FAC("kazuma_normal")MS3("Ok！我已经收到小狗的坐标了，")NOD()
    CAT("\n布斯特教授和")
    CAT("\n营救机器人已经在路上了。")NOD()CLR()
    CAT("\n你们就放心继续去救大家吧。")NOD()CLO()
    FAO(0)
    TRA("CS_sky","ProfessorBoosterWithRobot",19,13)
end

function KazumaAndSue2()
    KEY()
    MNP("Masro1",36,7,0)
    ANP("Masro1","sleep")
    ANP("ComputerMasro1",0,0)
    DNP("Barlog1")
    SNP("CS_kazuma_animate",1,13,0,"mainLayer","Kazuma1")
    SNP("CS_sakamoto_sue_animate",3,13,1,"mainLayer","SakamotoSue1")
    SNP("CS_skydragon_animate",5,13,0,"mainLayer","SkyDragon1")
    ANP("Kazuma1","computer")
    RMU()
    FAI(0)
    WAI(30)
    ANP("SakamotoSue1","angry",0)
    FAC("sakamotosue_angry")MS3("哥哥！为什么我们又要来这种")
    CAT("\n有危险生物的地方啊...")NOD()CLR()
    FAC("kazuma_normal")CAT("毕竟我和库特是好友~")NOD()
    CAT("\n他也请求我在背后给他做后援。")NOD()CLR()
    CAT("毕竟你也是自己要求")
    CAT("\n要跟来的不是嘛...")NOD()CLR()
    ANP("SakamotoSue1","normal",1)
    FAC("sakamotosue_normal")CAT("\n但你当时是说来休假的...")NOD()CLR()
    FAC("kazuma_normal")CAT("是呀~")NOD()
    CAT("\n我们其实是在一个非常安全")
    CAT("\n还有结界的小镇上的酒店里度假。")NOD()CLR()
    CAT("其实更主要的原因是，")NOD()
    FAC("kazuma_good")CAT("\n这次我们度假的开支全是库特包的。")NOD()CLR()
    ANP("SakamotoSue1","normal",0)
    FAC("sakamotosue_normal")CAT("\n原来是这样...")NOD()CLO()
    PMU(5)
    WAI(60)
    FAO(2)
    SMC(0)SMC(1)
    TRA("CS_soapcastle_kingbedroom","ContinueRescue",9,15)
end

function LockedDoor()
    PRI()
    MS4("\n门是锁上的。")NOD()
end