function E0090()
    InitRoom()FAI(0)
end
function E0091()
    InitRoom()FAI(1)
end
function E0092()
    InitRoom()FAI(2)
end
function E0093()
    InitRoom()FAI(3)
end
function E0094()
    InitRoom()FAI(4)
end

function InitRoom()
    MNA()
    if(FLJ("KingBack")) then
        CMU("CS_Quiet")
    else
        CMU("CS_Mura")
    end
end

--去集会场
function Door_GoKingHouse()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoKingHouse",0,1)FAO(0)TRA("CS_king_house","E0092",14,15)
end
--路牌【集会场】
function Sign_KingHouse()
    PRI()
    TUR()MS4("\n")CAT("-集会场-",2)NOD()
end

--去多隆子家
function Door_GoTorokoHouse()
    if(FLJ("JackSantaGo")) then
        PRI()MM0()SOU("CS_011_door")ANP("Door_GoTorokoHouse",0,1)FAO(0)TRA("CS_toroko_house","E0092",15,16)
    else
        if(FLJ("ThreeDaysLater")) then
            PRI()
            MS4("杰克说了离村的时候")
            CAT("\n最好不要让其他人看到，")NOD()
            CAT("\n还是赶紧出发吧...")NOD()
        elseif(FLJ("GoTorokoHome")) then
            PRI()MM0()SOU("CS_011_door")ANP("Door_GoTorokoHouse",0,1)FAO(0)TRA("CS_toroko_house","AskEveryoneWhereMahinWent",15,16)
        elseif(FLJ("AskedToroko")) then
            PRI()
            MS4("她们说马宾过几天自己就会回来，")NOD()
            CAT("\n我想还是不要再打扰女孩子们了吧...")NOD()
        else
            PRI()MM0()SOU("CS_011_door")ANP("Door_GoTorokoHouse",0,1)FAO(0)TRA("CS_toroko_house","E0092",15,16)
        end
    end
end
--路牌【多隆子和数的家】
function Sign_TorokoHouse()
    PRI()
    TUR()MS4("\n")CAT("-多隆子和数的家-",2)NOD()
end

--去渔屋
function Door_GoKanpaHouse()
    PRI()MM0()SOU("CS_011_door")ANP("Door_GoKanpaHouse",0,1)FAO(0)TRA("CS_kanpa_house","E0092",14,14)
end
--路牌【渔屋】
function Sign_KanpaHouse()
    PRI()
    TUR()MS4("\n")CAT("-渔屋-",2)NOD()
end

--去桑塔家
function Door_GoSantaHouse()
    if(FLJ("JackSantaGo")) then
        PRI()MM0()SOU("CS_011_door")ANP("Door_GoSantaHouse",0,1)FAO(0)TRA("CS_santa_house","E0092",18,14)
    else
        PRI()
        MS4("\n门锁住了。")NOD()
    end
end
--路牌【桑塔和怡可的家】
function Sign_SantaHouse()
    PRI()
    TUR()MS4("\n")CAT("-桑塔和怡可的家-",2)NOD()
end

--去酒吧
function Door_GoBar()
    if(FLJ("KingBack")) then
        PRI()MM0()SOU("CS_011_door")ANP("Door_GoBar",0,1)FAO(0)TRA("CS_bar2","E0092",28,14)
    elseif(FLJ("JackSantaGo")) then
        PRI()MM0()SOU("CS_011_door")ANP("Door_GoBar",0,1)FAO(0)TRA("CS_bar","E0092",28,14)
    else
        PRI()
        MS4("\n还没到今天的营业时间。")NOD()
    end
end

--去村子外围
function GoVillageAround()
    if(FLJ("ThreeDaysLater")) then
        PRI()FAO(1)TRA("CS_village_around","E0093",1,12,1,12)
    elseif(FLJ("GoTorokoHome") or FLJ("AskedToroko")) then
        --不让玩家出村子
        KEY()
        MYB(1,PLY())WAS()
        MS4("\n天快黑了还是不出去吧。")NOD()
    end
end

--宝箱（地图系统）
function Chest_MapSystem()
    if(FLJ("Chest_MapSystem")) then
        Chest_MapSystem_Opened()
    else
        PRI()
        FLP("Chest_MapSystem")
        ITP("MapSystem")
        SOU("CS_022_chest_open")
        ANP("Chest_MapSystem",0,1)
        MS4("打开了宝箱。")NOD()CLR()
        GIT("MapSystem")
        SOU("CS_038_get_item")
        CMU("CS_Fanfale1")
        CAT("\n获得了 =地图系统= 。")WAI(160)NOD()RMU()CLR()
        Chest_MapSystem_Opened()
    end
end

--晾衣架
function DryingRack1()
    PRI()
    MS4("一个空晾衣架。")NOD()
end

function Chest_MapSystem_Opened()
    if(FLJ("KingBack")) then
        PRI()
        MS4("\n里面是空的...")NOD()CLR()
        FAC("king_normal")MS4("地图系统果然")
        CAT("\n已经被拿走了嘛...")NOD()
    else
        PRI()
        MS4("\n上面写了些什么...")NOD()CLR()
        TUR()CAT("如果有事无论如何都要出门的话")
        CAT("\n就带上它吧。")
        CAT("\n")CAT("——金",1)NOD()
        if(FLJ("JackSantaGo")) then
            if(ITJ("MapSystem") == false) then
                TUR(false)
                CLR()FAC("jack_normal")MS4("地图系统已经不在里面了，")NOD()
                CAT("\n也许被放到了其他地方...")NOD()
                if(FLJ("FindMapSystem") == false) then
                    FLP("FindMapSystem")
                end
            end
        end
    end
end

function SueAndTorokoToGo()
    KEY()
    CMU("CS_Mura")
    SNP("CS_sue_animate",43,8,0,"mainLayer","Sue1")--数
    SNP("CS_toroko_animate",42,8,1,"mainLayer","Toroko1")--多隆子
    ANP("Toroko1","normal",1)
    FAI(0)
    WAI(32)
    FAC("sue_normal")MSG("\n多隆子你准备好了嘛？")NOD()CLR()
    FAC("toroko_><")CAT("\n嗯...")NOD()CLR()
    ANP("Sue1","angry")
    FAC("sue_normal")CAT("\n那趁杰克还在睡觉我们赶快出发吧！")NOD()CLR()CLO()
    WAI(32)
    FAO(0)
    TRA("CS_village_around","SueAndTorokoLookForCat",58,13)
end

function TorokoHasBeenCaptured()
    KEY()
    CMU("CS_Escape")
    SNP("CS_toroko_animate",59,12,0,"mainLayer","Toroko1")--多隆子
    ANP("Toroko1","run_max_speed",0)
    SNP("CS_bubble_catcher",60,12,0,"mainLayer","Bubble1")--泡泡
    ANP("Bubble1","set_target")
    ANP("Bubble1","Toroko1")
    SNP("CS_chako_animate",29,14,0,"mainLayer","Chako1")--怡可
    ANP("Chako1","back")
    ANP("DryingRack1",0,1)
    FAI(1)
    WAI(64)
    SOU("CS_021_bubble")
    DNP("Toroko1")
    ANP("Bubble1","caught_toroko")
    ANP("Bubble1","turn",1)
    WAI(32)
    FAC("toroko_><")TUR()MSG("\n恰可姐姐！！")WAI(32)
    ANP("Chako1","normal",1)
    WAI(48)CLO()
    SNP("CS_sparkitem",0,0,0,"mainLayer","SparkItem1")--项链
    MNP("SparkItem1","Bubble1")
    WAI(32)
    ANP("Chako1","walk",1)
    WAI(32)
    WAI(32)
    WAI(32)
    ANP("Chako1","normal",1)
    WAI(32)
    ANP("Chako1","look_up")
    PMU(2)
    WAI(60)
    FAO(0)
    TRA("CS_king_house","ChakoWakeJackUp",14,15)
end

function TorokoNecklace()
    PRI()
    MS4("\n这是多隆子的项链...")NOD()CLR()
    ITP("TorokoNecklace")
    GIT("TorokoNecklace")
    SOU("CS_038_get_item")
    DNP("TorokoNecklace")
    FLS("TorokoNecklace")
    CMU("CS_Fanfale1")
    CAT("\n获得了 =多隆子的项链= 。")WAI(160)NOD()
    RMU()
end

function SoapComing()
    KEY()
    HMC()
    CMU("CS_Dr")
    FAI(0)
    SNP("CS_soapwalker_animate",58,-1,0,"mainLayer","SoapWalker1")
    ANP("SoapWalker1",1010,0)
    WAI(128)
    SNP("CS_puu_animate",50,-1,0,"mainLayer","Puu1")
    ANP("Puu1",1010,0)
    WAI(128)
    FAC("soapwalker_normal")MS3("不是兄弟，你的落地动静")
    CAT("\n能不能像我一样小点。")NOD()
    CAT("\n猎物都被你吓跑了我们怎么抓？")NOD()CLR()
    FAC("puu_normal")CAT("抱歉。")NOD()CLR()
    FAC("soapwalker_normal")CAT("我已经等不及要见到")
    CAT("\n它们可爱的表情了。")NOD()CLR()
    FAC("puu_normal")CAT("\n那我搜这边，你去搜那边。")NOD()CLR()
    FAC("soapwalker_normal")CAT("\n就这么办~")NOD()CLO()
    FAO(2)
    TRA("CS_santa_house","HideInBasement",18,14)
end

function SoapSearch()
    KEY()
    SNP("CS_soapwalker_animate",12,15,0,"mainLayer","SoapWalker1")
    ANP("SoapWalker1","walk",1)
    FAI(0)
    WAI(32)
    SOU("CS_011_door")ANP("Door_GoKingHouse",0,1)
    WAI(32)
    ANP("SoapWalker1","look_down",1)
    SNP("CS_puu_animate",23,14,0,"mainLayer","Puu1")
    WAI(16)
    ANP("SoapWalker1","normal",1)
    WAI(16)
    SOU("CS_011_door")ANP("Door_GoKingHouse",0,0)
    WAI(16)
    FAC("soapwalker_normal")MS3("\n你有发现什么嘛？")NOD()CLR()
    FAC("puu_normal")CAT("不，")NOD()CAT("我一只也没找到。")
    CAT("\n果然是我昨天来抓的时候，")NOD()
    CAT("\n把它们吓的都跑了嘛...")NOD()CLR()
    FAC("soapwalker_normal")CAT("\n你要是昨天抓的时候叫上我就好了...")NOD()CLO()
    ANP("Puu1","normal",1)
    WAI(32)
    FAC("puu_normal")MS3("不管怎么说现在有三只的话")
    CAT("\n多少应该能和高第们交差了。")NOD()CLR()
    ANP("SoapWalker1","look_normal",1)
    FAC("soapwalker_normal")CAT("不行，三只可不够哦...")NOD()
    CAT("\n你弄丢的那鱼可比这三只贵多了...")NOD()
    CAT("\n最起码要7只才能")
    CAT("\n弥补你的犯下的失误")NOD()CLR()
    CAT("在我们大王发现鱼还没失踪前")
    CAT("\n赶快想想办法吧...")NOD()CLO()
    WAI(64)
    ANP("Puu1","normal",0)
    WAI(32)
    FAC("puu_normal")MS3("\n要是能拷问它们鱼在哪就好了，")NOD()CLR()
    ANP("SoapWalker1","look_down",1)
    FAC("soapwalker_normal")CAT("\n你觉得你听的懂咪咪卡语嘛？")NOD()CLR()
    FAC("puu_normal")MS3("\n不知道，但我有一股不详的预感。")NOD()CLR()
    FAC("soapwalker_normal")CAT("你怕大王今天发现鱼不见了")
    CAT("\n然后把你变成鱼嘛？")NOD()CLR()
    ANP("Puu1","normal",1)
    ANP("SoapWalker1","look_normal",1)
    FAC("puu_normal")CAT("\n别说了，总之先回去吧。")NOD()CLR()
    FAC("soapwalker_normal")CAT("\n也是...")NOD()CLO()
    PMU(1)
    ANP("Puu1","walk",1)
    WAI(16)
    ANP("SoapWalker1","walk",1)
    WAI(64)
    ANP("Puu1","normal",1)
    WAI(16)
    ANP("Puu1","leave",1)
    ANP("SoapWalker1","normal",1)
    WAI(128)
    ANP("SoapWalker1","normal",0)
    WAI(64)
    FAO(2)
    TRA("CS_santa_house","ChakoObserve",18,14)
end

function ChakoGoKingHouseGetFood()
    KEY()
    FAI(0)
    WAI(32)
    SOU("CS_011_door")ANP("Door_GoSantaHouse",0,1)
    WAI(16)
    SNP("CS_chako_animate",14,15,1,"mainLayer","Chako1")
    WAI(16)
    SOU("CS_011_door")ANP("Door_GoSantaHouse",0,0)
    WAI(32)
    ANP("Chako1","normal",0)
    WAI(32)
    ANP("Chako1","normal",1)
    WAI(32)
    FAC("chako_normal")MS3("似乎是真的走了，")NOD()
    CAT("\n那么我赶快去拿吧。")NOD()CLO()
    FON("Chako1")
    WAI(32)
    ANP("Chako1","walk",1)
    WAI(64)
    SNP("CS_soapwalker_animate",28,-1,0,"mainLayer","SoapWalker1")
    ANP("SoapWalker1",1060,0)
    ANP("SoapWalker1","look_down",0)
    WAI(80)
    ANP("Chako1","normal",1)
    WAI(32)
    FAC("soapwalker_normal")MS3("果然还有小可爱呢，")NOD()
    CAT("\n仔细一看好像还是个小美人，")NOD()
    CAT("\n还好我没有立马走掉。")NOD()CLO()
    WAI(16)
    ANP("Chako1","back",1)
    SOU("CS_011_door")ANP("Door_GoKingHouse",0,1)
    WAI(16)
    DNP("Chako1")
    WAI(16)
    SOU("CS_011_door")ANP("Door_GoKingHouse",0,0)
    WAI(32)
    FAC("soapwalker_angry")MS3("\n喂！别当我不存在啊！")NOD()CLO()
    FAO(2)
    FOM()
    TRA("CS_king_house","ChakoHidden",14,15)
end

function ChakoGetCaught()
    KEY()
    SNP("CS_soapwalker_animate",21,14,1,"mainLayer","SoapWalker1")
    ANP("SoapWalker1","look_down",1)
    FON("Door_GoKingHouse",0)
    FAI(0)
    WAI(32)
    SOU("CS_011_door")ANP("Door_GoKingHouse",0,1)
    WAI(16)
    SNP("CS_chako_animate",23,14,1,"mainLayer","Chako1")
    WAI(16)
    SOU("CS_011_door")ANP("Door_GoKingHouse",0,0)
    WAI(16)
    ANP("Chako1","walk",1)
    WAI(32)
    ANP("Chako1","normal",0)
    WAI(32)
    MS3("\n.")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")NOD()CLO()
    WAI(32)
    FAC("soapwalker_normal")MS3("居然没有逃跑，")NOD()
    CAT("\n你不怕我吗？")NOD()CLR()
    FAC("chako_normal")CAT("\n这并没有什么可怕的。")NOD()CLR()
    FAC("soapwalker_normal")CAT("\n.")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)CAT(".")WAI(8)NOD()CLO()
    ANP("SoapWalker1","walk",1)
    WAI(32)
    WAI(8)
    ANP("Chako1","look_up",0)
    ANP("SoapWalker1","look_bottom",1)
    WAI(8)
    ANP("SoapWalker1","normal",1)
    WAI(16)
    ANP("SoapWalker1","catch_chako",0)
    DNP("Chako1")
    WAI(8)
    ANP("SoapWalker1","catch_chako",1)
    WAI(8)
    ANP("SoapWalker1","catch_chako",2)
    WAI(16)
    FAC("soapwalker_normal")MS3("\n现在呢？")NOD()CLR()
    ANP("SoapWalker1","catch_chako",3)
    FAC("chako_normal")CAT("\n我不怕。")NOD()CLR()
    ANP("SoapWalker1","catch_chako",4)
    FAC("soapwalker_normal")CAT("\n也好，该准备起飞了。")NOD()CLO()
    ANP("SoapWalker1","catch_chako",5)
    WAI(8)
    ANP("SoapWalker1","catch_chako",6)
    WAI(32)
    ANP("SoapWalker1","catch_chako",7)
    WAI(96)
    FAO(0)TRA("CS_sea_entrance","FallIntoSea",20,0)
end

function KingBack()
    KEY()
    SNP("sys_trigger_h_player1",32,14,1,"mainLayer","Camera1")
    FON("Camera1",1)
    SLR(0,0)
    AMC("walk")
    CMU("CS_Quiet")
    FAI(2)
    WAI(8*16-4)
    AMC("normal")
    WAI(32)
    AMC("normal",1)
    WAI(64)
    AMC("normal",0)
    WAI(32)
    FAC("king_normal")MS3("\n总感觉好安静啊。")NOD()CLO()
    AMC("back")
    WAI(32)
    SOU("CS_011_door")ANP("Door_GoKingHouse",0,1)FAO(0)TRA("CS_king_house","KingBack",14,15)
end

function KingLeaveBar()
    KEY()
    HMC(0)
    FAI(2)
    WAI(32)
    SOU("CS_011_door")ANP("Door_GoBar",0,1)
    WAI(32)
    SMC(0)
    WAI(32)
    SOU("CS_011_door")ANP("Door_GoBar",0,0)
    WAI(16)
    FAC("king_normal")MS3("见鬼，")NOD()
    CAT("\n果然还是一个人都没有嘛...")NOD()CLO()
    WAI(32)
    AMC("walk",1)
    WAI(8*16)
    AMC("normal",1)
    CMU("XXXX")
    SOU("CS_011_door")ANP("Door_GoSantaHouse",0,1)
    WAI(16)
    SNP("CS_colon_animate",14,15,0,"mainLayer","Colon1")
    WAI(32)
    MS3("\n果然是金村长回来了！")NOD()CLR()
    FAC("king_normal")CAT("你们从哪里冒出来的...")NOD()
    CAT("\n不会是大家在和我玩捉迷藏吧。")NOD()CLR()
    FAC()CAT("\n不是这样的！")NOD()CLR()
    FAC("king_normal")CAT("\n所以到底是发生了什么事...")NOD()CLO()
    WAI(32)
    FAO(0)
    TRA("CS_santa_house","KingAndColon",25,14)
end