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

function InitRoom()
    if(FLJ("ExploreEscapeRoutes")) then
        if(not FLJ("DefeatedPuu&Tala")) then
            SNP("CS_soapwalker_animate",29,17,1,"mainLayer","Tala1")
            ANP("Tala1","look_down")
            SNP("CS_puu_animate",32,17,0,"mainLayer","Puu1")
        end
    end
end

function GoSoapCastle()
    if(FLJ("InBossFight")) then
        PRI()MS4("Cannot escape!")NOD()
    else
        PRI()FAO(1)TRA("CS_soapcastle","E0093",4,15,0,75)
    end
end

function GoSoapCastleStair()
    if(FLJ("InBossFight")) then
        PRI()MS4("Cannot escape!")NOD()
    else
        PRI()FAO(3)TRA("CS_soapcastle_stair","E0091",90,20,0,3)
    end
end

function SoapKingGoResturant()
    KEY()
    CMU("XXXX")
    SNP("CS_puu_animate",14,17,0,"mainLayer","Puu1")
    FAI(2)
    WAI(32)
    SNP("CS_soapking_animate",4,17,1,"mainLayer","Soapking1")
    WAI(16)
    ANP("Puu1","walk",0)
    WAI(16)
    ANP("Soapking1","walk",1)
    WAI(16)
    ANP("Puu1","normal",0)
    WAI(48)
    ANP("Soapking1","normal",1)
    CMU("CS_Access")
    FAC("puu_normal")MS3("Welcome back, Your Majesty,")NOD()
    CAT("\nHow was the fish race today?")NOD()CLR()
    FAC()CAT("Not good,")NOD()
    CAT("\nit was a complete disaster.")NOD()
    CAT("\nTheir fish are no match") 
    CAT("\nfor my arowana fish Kuron,")NOD()
    CAT("\nIf Kuron competed,")
    CAT("\nit would easily take first place.")NOD()CLR()
    FAC("puu_normal")CAT("Of course!")NOD()
    CAT("\nOur Kuron is the strongest.")NOD()CLR()
    FAC()CAT("Now that you mention it,")NOD()
    CAT("\nI want to go see my fish right now...")NOD()CLO()
    ANP("Soapking1","walk",1)
    WAI(32)
    ANP("Puu1","normal",1)
    FAC("puu_normal")MS3("\nYour Majesty, wait......")WAI(32)CLO()
    WAI(32)
    ANP("Puu1","walk",1)
    WAI(32)
    FAO(0)
    TRA("CS_soapcastle","SoapKingGoResturant",46,11)
end

function MeetMonster()
    KEY()
    MM0()
    WAI(16)
    FAO(0)
    MOV(48,17,"CS_mychar_jack_p1")
    MOV(49,17,"CS_mychar_santa_p2")
    MOV(50,17,"CS_mychar_puppy_p3")
    SLR(0)
    FAI(2)
    FLP("MeetMonster")
    DNP("MeetMonster")
    WAI(32)
    if(SKJ("QuickPuuBoss")) then
        ANP("Puu1","normal",1)
        ANP("Tala1","look_normal")
        FAC("puu_normal")MS3("\nCatch them!")NOD()
    else
        ANP("Puu1","normal",1)
        WAI(32)
        ANP("Tala1","look_normal")
        WAI(32)
        FAC("puu_normal")MS3("Hey! What do I see?!")NOD()
        CAT("\nTwo brand new Mimigas!")NOD()CLO()
        AMC("walk",0,"CS_mychar_puppy_p3")
        WAI(48)
        AMC("stand_bark",0,"CS_mychar_puppy_p3")
        WAI(24)
        AMC("stand_bark",0,"CS_mychar_puppy_p3")
        WAI(16)
        FAC("soapwalker_normal")MS3("And even a puppy too~")NOD()
        CAT("\nI don't know if the Gaudi") 
        CAT("\nwill take dogs,")NOD()
        CAT("\nbut either way")
        CAT("\nwe'll have 6 Mimigas now~")NOD()CLR()
        FAC("puu_normal")CAT("Yeah,")NOD()
        CAT("\nI'm extremely lucky tonight.")NOD()CLR()
        FAC("soapwalker_normal")CAT("Well brother")
        CAT("\nlet's catch them together~")NOD()CLR()
        FAC("puu_normal")CAT("\nLet's do it!")NOD()CLR()
        FAC("jack_normal")CAT("\nEveryone! Prepare for battle!")NOD()
    end
    CMU("CS_FireEye")
    CNP("Puu1","CS_boss_puu",0,1)
    CNP("Tala1","CS_boss_tala",0,1)
    AMC("normal",0,"CS_mychar_puppy_p3")
    ANP("GroupHpBar1",500,1)--设置boss血条计数
    FLP("InBossFight")
    SKP("QuickPuuBoss")
    BSL("GroupHpBar1")
end

--战胜了Puu和Tala
function GroupHpBar1()
    KEY()
    KIL("CS_puububble_empty")
    KIL("CS_puububble_soapa")
    KIL("CS_puububble_soapb")
    KIL("CS_puububble_soapc")
    KIL("CS_enemy_soapa")
    KIL("CS_enemy_soapb")
    KIL("CS_enemy_soapc")
    FLS("InBossFight")
    SKS("QuickPuuBoss")
    FLP("DefeatedPuu&Tala")
    FLP("GolemTrap")
    CMU("CS_Fanfale3")
    MS4("\nPuu & Tala have been defeated!")WAI(140)NOD()CLO()
    WAI(32)
    FAC("jack_normal")MS3("The monsters seem to have") 
    CAT("\nturned into statues,")NOD()
    CAT("\nlet's continue moving forward.")NOD()
end
