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

function GoSoapCastleGolemStatue()
    PRI()FAO(1)TRA("CS_soapcastle_golemstatue","E0093",2,17,0,75)
end

function Back()
    if(FLJ("HeroBack")) then
        KEY()
        FAC("curly_normal")MS4("\n我们得快往前去寻找数她们。")NOD()
    else
        KEY()
        FAC("king_normal")MS4("\n我是不会后退的。")NOD()
    end
end

function BreakCage()
    KEY()
    MYB(1,PLY())WAS()
    FAC("king_normal")MS3("这个大厅里埋藏着敌人，")NOD()
    CAT("\n我还不能就这么离开。")NOD()
end

function TrapCage1()
    KEY()
    FLP("TrapCage")
    DNP("BreakCage")
    FON("Camera1")
    FAC("king_normal")MS3("别耍小手段了，")NOD()
    CAT("\n笼子是困不住我的。")NOD()CLO()
    WAI(60)
    SLR(0)
    AMC("back")
    WAI(32)
    SLR(1)
    AMC("back")
    WAI(32)
    FAC("king_normal")MS3("\n出来吧，")NOD()CAT("别藏了！")NOD()CLO()
    WAI(32)
    --石头在前方先出现
    MNP("GolemRock1",57,-1,0)
    CNP("GolemRock1","CS_enemy_golemrock",0)
    ANP("GolemRock1",1060)
    WAI(60)
    AMC("normal")
    WAI(60)
    --布在后方出现
    MNP("GolemPaper1",21,-1,0)
    CNP("GolemPaper1","CS_enemy_golempaper",0)
    ANP("GolemPaper1",1060)
    WAI(60)
    --剪刀出现
    MNP("GolemScissors1",25,-1,0)
    CNP("GolemScissors1","CS_enemy_golemscissors",0)
    ANP("GolemScissors1",1060)
    SLR(0)
    AMC("normal")
    WAI(120)
    FAC("tap_normal")MS3("够了，")NOD()
    CAT("\n你不能再前进了。")NOD()CLR()
    CMU("XXXX")
    FAC("king_normal")CAT("\n那就看你能不能阻止的了我。")NOD()CLR()
    FAC("tap_normal")CAT("\n所有人一起上！")NOD()CLO()
    CMU("CS_FireEye")
    ANP("GolemPaper1","action")
    ANP("GolemScissors1","action")
    ANP("GolemRock1","action")
    --左力场
    for i=13,18,1 do
        SNP("CS_forcefield",19,i,0,"mainLayer","ForcefieldL")
    end
    --右力场
    for i=13,18,1 do
        SNP("CS_forcefield",59,i,0,"mainLayer","ForcefieldR")
    end
end

function GolemPaper1()
    FLP("GolemPaper1")
    DefeatePaperScissorsRock()
end

function GolemScissors1()
    FLP("GolemScissors1")
    DefeatePaperScissorsRock()
end

function GolemRock1()
    FLP("GolemRock1")
    DefeatePaperScissorsRock()
end

function DefeatePaperScissorsRock()
    if(FLJ("GolemPaper1") and FLJ("GolemScissors1") and FLJ("GolemRock1")) then
        KEY()
        FAC("king_normal")MS3("有点不太好对付，")NOD()
        CAT("\n不过总算全部都击倒了。")NOD()CLR()
        CAT("\n我这辈子再也不想玩猜拳了...")CLO()
        --临时保存
        SKP("DefeatePaperScissorsRock")
        FAO(2)
        TRA("CS_soapcastle_golemhall","FightTap",39,18)
    end
end

function FightTap()
    SKP("FightTap")
    KEY()
    --金继续往前走
    CMU("CS_Balcony")
    AMC("normal",1)
    FAI(0)
    WAI(32)
    AMC("walk",1)
    WAI(60)
    MNP("GolemTap1",56,-1,0)
    CNP("GolemTap1","CS_boss_tap",0)
    ANP("GolemTap1","down_look")
    ANP("GolemTap1",1060)
    WAI(32)
    --金停下
    AMC("normal",1)
    WAI(32)
    CMU("XXXX")
    ANP("GolemTap1","left_look")
    FAC("tap_normal")MS3("到此为止！")NOD()
    CAT("\n我来亲自把你的剑掰断。")NOD()CLR()
    FAC("king_normal")MS3("\n那你就试试！")NOD()CLO()
    FON("Camera1")
    --开始战斗
    --左力场
    for i=13,18,1 do
        SNP("CS_forcefield",19,i,0,"mainLayer","ForcefieldL")
    end
    --右力场
    for i=13,18,1 do
        SNP("CS_forcefield",59,i,0,"mainLayer","ForcefieldR")
    end
    ANP("GolemTap1","fight")
    CMU("CS_LastBtl3")
    BSL("GolemTap1")
end

function GolemTap1()
    KEY()
    FOM()
    DNP("ForcefieldL")
    DNP("ForcefieldR")
    FLP("DefeatedTap")
    CMU("XXXX")
    FAC("tap_defeated")MS3("\n我居然输了...")NOD()CLR()
    FAC("king_normal")CAT("终于打倒他了，")NOD()
    CAT("\n我都快喘不过气了。")NOD()CLR()
    SLR(1)
    CAT("\n后面应该不会有更强的家伙了吧...")NOD()CLO()
    FAO(2)TRA("CS_soapcastle_golemhall","SoapKingCome",41,18)
end

function SoapKingCome()
    SKP("SoapKingCome")
    KEY()
    for i=0,5,1 do
        SOU("CS_023_thud")
        WAI(16)
    end
    FAC("king_normal")MS3("\n有什么人要过来了...")NOD()CLO()
    FAI(0)
    WAI(32)
    FON("Camera2")
    MS3("你们在搞毛啊，")NOD()
    CAT("\n整个楼板都在震，")NOD()
    CAT("\n我连书都没办法好好看了...")NOD()CLO()
    MNP("Soapking1",75,18,0)
    CNP("Soapking1","CS_boss_soapking",0,0)
    FON("Soapking1")
    WAI(32)
    ANP("Soapking1","walk",0)
    WAI(20*16)
    ANP("Soapking1","normal",0)
    MS3("你是谁啊？")NOD()
    CAT("\n为什么在我的城堡搞破坏？")NOD()CLO()
    WAI(32)
    FOM()
    WAI(32)
    MS3("\n小手，你怎么发白了...")NOD()CLR()
    ---[[
    FAC("king_normal")CAT("\n你就是这里的首领嘛？")NOD()CLR()
    FAC()CAT("没错。")NOD()CLR()
    FAC("king_normal")CAT("\n你为什么要绑架我的村民？")NOD()CLR()
    FAC()CAT("绑架？我可没做过那种事。")NOD()
    CAT("\n谁稀罕你们这些小兔子。")NOD()CLR()
    FAC("king_normal")CAT("骗人！")NOD()
    CAT("\n我们这边有人被抓时")
    CAT("\n留下了怪物的画像，")NOD()
    CAT("\n就是一只长手长脚")
    CAT("\n脑袋方方正正的怪物。")NOD()CLR()
    FAC()CAT("啊！那个是塔拉，")NOD()
    CAT("\n是我的手下之一。")NOD()CLR()
    CAT("难怪最近我总觉得")
    CAT("\n他和扑悠这段时间频繁外出,")NOD()
    CAT("\n肯定是在背着我搞些什么事。")NOD()CLR()
    FAC("king_normal")CAT("所以你能把你的手下们召回来，")NOD()
    CAT("\n把我的村民们还给我吗？")NOD()CLR()
    FAC()CAT("这可不行，")NOD()
    CAT("\n我的骑士已经被你打败了，")NOD()
    CAT("\n我现在非常生气。")NOD()CLR()
    --]]
    CAT("\n现在就把你变成鱼好了。")NOD()CLR()
    FAC("king_normal")CAT("\n变成鱼？")NOD()CLO()
    ANP("Soapking1","magicbubble_player1")
    WAI(96)
    FAC("king_normal")MS3("\n糟了！我对魔法没有抵抗。")NOD()CLR()
    FAC()CAT("只要对手是鱼的话，")NOD()
    CAT("\n我就可以随便蹂躏了。")NOD()CLR()
    CAT("\n再见了，小鱼。")NOD()CLO()
    ANP("Soapking1","lightningstrike_player1")
    WAI(60)
    AMC("knocked_away")
    WAI(240)
    MS3("刚刚听到雷声了！")
    CAT("\n巴鲁罗格！快点！")NOD()CLO()
    WAI(32)
    SGP("CS_mychar_curly",2,18,1,"CS_mychar_curly_p2")
    WAI(32)
    FAC("curly_normal")MS3("\n这里发生什么事了...")NOD()CLR()
    FAC("curly_sad")CAT("金！你还好吗？")
    CAT("\n你看起来伤的很重。")NOD()CLO()
    --库特出现
    SGP("CS_mychar_quote",2,18,1,"CS_mychar_quote_p1")
    WAI(32)
    AMC("walk",0,"CS_mychar_quote_p1")
    WAI(16)
    SNP("CS_balrog_animate",2,18,1,"mainLayer","Balrog1")
    AMC("normal",1,"CS_mychar_quote_p1")
    WAI(16)
    ANP("Balrog1","walk",1)
    WAI(32)
    ANP("Balrog1","normal",0)
    WAI(32)
    CMU("CS_HeroBack")
    ANP("Balrog1","happy")
    FAC("balrog_happy")MS3("不用担心，")
    CAT("\n我们已经来啦！")NOD()CLR()
    FAC("king_normal")CAT("没事，")NOD()
    CAT("\n我还能继续战斗...")NOD()CLR()
    FAC("curly_sad")CAT("金，你不用勉强自己，")NOD()
    CAT("\n还是快去医院治疗比较好。")NOD()CLR()
    FAC("curly_normal")CAT("巴鲁罗格")
    CAT("\n你现在就把金送去医院吧！")NOD()CLR()
    FAC("balrog_normal")CAT("\n明白了~")NOD()CLR()
    FAC("king_normal")CAT("\n你们一定要救回大家啊！")NOD()CLR()
    FAC("curly_happy")CAT("那是肯定的！")NOD()
    CAT("\n剩下的交给我们来处理吧。")NOD()CLO()
    FAO(1)
    DNP("Balrog1")
    HMC(0)
    SPL(0,"CS_mychar_quote_p1")
    SPL(1,"CS_mychar_curly_p2")
    ---[[
    if(GOP() == 1) then
        AGP("CS_mychar_curly_p2",true)
    end
    P2A(true)--允许玩家2使用AI切换
    --]]
    MOV(34,18,0)
    MOV(33,18,1)
    FON("Camera1",0)
    WAI(32)
    FAI(3)
    WAI(32)
    FAC()MS3("这次是机器人嘛...")NOD()
    CAT("\n我会把你们都轰成废铁。")NOD()CLR()
    FAC("curly_normal")CAT("不用多说了，")NOD()
    CAT("\n你这家伙觉悟吧！")NOD()CLO()
     --开始战斗
    --左力场
    for i=13,18,1 do
        SNP("CS_forcefield",19,i,0,"mainLayer","ForcefieldL")
    end
    --右力场
    for i=13,18,1 do
        SNP("CS_forcefield",59,i,0,"mainLayer","ForcefieldR")
    end
    --[[
    WAI(64)
    FAO(4)
    MSS(2)
    MS3("masrofox：You've completed the current build. ")
    CAT("\nThe ending is scheduled for v1.0 release this April.")
    MSS(5)
    WAI(9999)
    NOD()CLO()
    --]]
    ANP("Soapking1","fight")
    CMU("CS_VsSoapKing")
    BSL("Soapking1")
    --清空所有物品
    ITS()
    --添加库特和卡莉的物品
    ITP("Spur")
    ITP("SuperMissile")
    ITP("MachineGun")
    ITP("Nemesis")
    ITP("LifePot",2)
    ITP("AirTank")
    --添加任务
    MSD()
    MSA("SaveEveryoneCurly")
end
---[[
function FightSoapKing()
    KEY()
    SGP("CS_mychar_quote",2,18,1,"CS_mychar_quote_p1")
    SGP("CS_mychar_curly",2,18,1,"CS_mychar_curly_p2")
    --
    if(GOP() == 1) then
        AGP("CS_mychar_curly_p2",true)
    end
    --
    HMC(0)
    SPL(0,"CS_mychar_quote_p1")
    SPL(1,"CS_mychar_curly_p2")
    MOV(34,18,0)
    MOV(33,18,1)
    FON("Camera1",0)
    MNP("Soapking1",75,18,0)
    CNP("Soapking1","CS_boss_soapking",0,0)
    MNP("Soapking1",55,18,0)
    CMU("CS_HeroBack")
    FAI(3)
    WAI(32)
    FAC()MS3("这次是机器人嘛...")NOD()
    CAT("\n我会把你们都轰成废铁。")NOD()CLR()
    FAC("curly_normal")CAT("不用多说了，")NOD()
    CAT("\n你这家伙觉悟吧！")NOD()CLO()
    --开始战斗
    --左力场
    for i=13,18,1 do
        SNP("CS_forcefield",19,i,0,"mainLayer","ForcefieldL")
    end
    --右力场
    for i=13,18,1 do
        SNP("CS_forcefield",59,i,0,"mainLayer","ForcefieldR")
    end
    ANP("Soapking1","fight")
    CMU("CS_VsSoapKing")
    BSL("Soapking1")
    --清空所有物品
    ITS()
    --添加库特和卡莉的物品
    ITP("Spur")
    ITP("SuperMissile")
    ITP("MachineGun")
    ITP("Nemesis")
    ITP("LifePot",2)
    ITP("AirTank")
    --添加任务
    MSD()
    MSA("SaveEveryoneCurly")
end
--]]

--击败了Soapking1
function Soapking1()
    KEY()
    CMU("XXXX")
    DNP("ForcefieldL")
    DNP("ForcefieldR")
    WAI(60)
    FLP("DefeatedSoapKing")
    MS3("不要....")NOD()
    CAT("\n我不要变成雕像啊!!!!")NOD()CLO()
    WAI(30)
    ANP("Soapking1","defeated")
    WAI(60)
    FAC("curly_happy")MS3("\n我们打败他了~")NOD()CLR()
    FAC("curly_normal")CAT("接下来赶紧去找数她们吧，")NOD()
    CAT("\n我很担心他们。")NOD()
    FLP("HeroBack")
    FLP("PuppyAppear")
    FOM()
    CMU("CS_Balcony")
end

function ProfessorBoosterCheckStatue()
    KEY()
    HMC()
    CMU("CS_Vivi")
    ---[[
    FAI(3)
    WAI(32)
    SNP("CS_bluerobot_animate",3,18,1,"mainLayer","BlueRobot1")
    WAI(16)
    ANP("BlueRobot1","walk",1)
    WAI(32)
    ANP("BlueRobot1","normal",1)
    WAI(16)
    SNP("CS_professor_booster_animate",3,18,1,"mainLayer","ProfessorBooster1")
    ANP("ProfessorBooster1","walk",1)
    WAI(16)
    ANP("ProfessorBooster1","normal",1)
    WAI(16)
    SNP("CS_bluerobot_animate",3,18,1,"mainLayer","BlueRobot2")
    WAI(32)
    FAC("professorbooster_normal")MS3("终于是抵达这个地方了，")NOD()
    CAT("\n有一股当年刚到飞岛上的奇妙感。")NOD()CLR()
    CAT("\n希望这里不会有什么危险吧...")NOD()CLO()
    FAO(2)
    MOV(41,18)
    FON("ProfessorBooster1",1)
    MNP("BlueRobot1",35,18,0)
    MNP("ProfessorBooster1",34,18,0)
    MNP("BlueRobot2",32,18,0)
    ANP("BlueRobot1","walk",1)
    ANP("BlueRobot2","walk",1)
    ANP("ProfessorBooster1","walk",1)
    FAI(2)
    WAI(96)
    ANP("ProfessorBooster1","normal",1)
    WAI(16)
    ANP("BlueRobot2","normal",1)
    WAI(32)
    ANP("BlueRobot1","normal",1)
    WAI(16)
    ANP("ProfessorBooster1","back",1)
    WAI(32)
    ANP("BlueRobot2","normal",0)
    WAI(16)
    FAC("professorbooster_normal")MS3("这些是雕像吗？")NOD()
    CAT("\n感觉非常的完整。")NOD()CLR()
    ANP("ProfessorBooster1","back",0)
    CAT("一点风化痕迹都没有，")NOD()
    CAT("\n简直就像是刚刚才完工的感觉。")NOD()CLO()
    ANP("ProfessorBooster1","back",1)
    WAI(120)
    ANP("ProfessorBooster1","normal",1)
    FAC("professorbooster_normal")MS3("现在不是在这里花时间的时候，")NOD()
    CAT("\n我得赶快找到小狗才是...")NOD()CLO()
    FAO(2)
    FOM()
    --]]
    TRA("CS_soapcastle_kingbedroom","ProfessorBoosterSavePuppy",32,16)
end

function ProfessorBoosterGetWand()
    KEY()
    SNP("CS_professor_booster_animate",49,18,0,"mainLayer","ProfessorBooster1")
    SNP("CS_bluerobot_animate",54,18,1,"mainLayer","BlueRobot2")
    ANP("ProfessorBooster1","walk",0)
    ANP("BlueRobot2","walk",0)
    FON("ProfessorBooster1",1)
    FAI(1)
    WAI(96)
    ANP("ProfessorBooster1","normal",0)
    WAI(32)
    ANP("BlueRobot2","normal",0)
    WAI(32)
    ANP("ProfessorBooster1","back",0)
    WAI(32)
    FAC("professorbooster_normal")MS3("嗯，")NOD()
    CAT("\n我对这些雕像果然还是很在意。")NOD()CLR()
    ANP("ProfessorBooster1","back",1)
    CAT("特别是这个雕像，")NOD()
    CAT("\n它手里的魔杖是真家伙吗？")NOD()
    CAT("\n我突然好想拿下来试一试。")NOD()CLR()
    CAT("毕竟魔杖不是王冠，")NOD()
    CAT("\n不像当年某人的那玩意这么危险，")NOD()
    CAT("\n我都来这里一趟了，")NOD()
    CAT("\n玩一下应该没关系。")NOD()CLO()
    WAI(32)
    ANP("DefeatedSoapKing1","hide_wand")
    ANP("ProfessorBooster1","show_wand")
    WAI(32)
    ANP("ProfessorBooster1","normal")
    WAI(32)
    ANP("ProfessorBooster1","normal",0)
    WAI(32)
    FAC("professorbooster_normal")MS3("这根魔杖好大啊，")NOD()
    CAT("\n感觉威力应该也很大。")NOD()
    CAT("\n那么来试试看。")NOD()CLR()
    ANP("ProfessorBooster1","magic",0)
    CAT("\n向我展现你的力量吧！")NOD()CLO()
    ANP("ProfessorBooster1","flash")
    WAI(16)
    ANP("ProfessorBooster1","set_target")
    ANP("ProfessorBooster1","BlueRobot2")
    WAI(60)
    ANP("ProfessorBooster1","normal",0)
    WAI(32)
    ANP("ProfessorBooster1","normal",1)
    WAI(32)
    FAC("professorbooster_normal")MS3("嗯，")NOD()CAT("看样子这东西是真家伙了。")NOD()
    CAT("\n不过这魔杖只能把目标变成鱼嘛...")NOD()
    CAT("\n真是无趣，")NOD()
    CAT("\n不过还是拿回去研究好了。")NOD()CLO()
    WAI(60)
    SOU("CS_043_computer_beep")
    WAI(16)
    SOU("CS_043_computer_beep")
    WAI(16)
    SOU("CS_043_computer_beep")
    WAI(16)
    ANP("ProfessorBooster1","normal",0)
    WAI(16)
    FAC("professorbooster_normal")MS3("嗯？是数码打来的电话...")NOD()
    CAT("\n不过正好我也要汇报一下这边消息。")NOD()CLR()
    ANP("ProfessorBooster1","back",0)
    CAT("\n什么事啊？数码。")NOD()CLO()
    FAO(2)
    FOM()
    TRA("CS_peace_town_divination","KazumaMSG",20,12)
end

function ProfessorBoosterGoGaudiCity()
    KEY()
    SNP("CS_professor_booster_animate",41,18,0,"mainLayer","ProfessorBooster1")
    SNP("CS_bluerobot_animate",44,18,0,"mainLayer","BlueRobot2")
    ANP("BlueRobot2","transform_fish")
    ANP("DefeatedSoapKing1","hide_wand")
    ANP("ProfessorBooster1","show_wand")
    FON("ProfessorBooster1",1)
    CMU("CS_Vivi")
    FAI(2)
    WAI(32)
    FAC("professorbooster_normal")MS3("看样子这根魔杖，")NOD()
    CAT("\n就算作为战力我现在也不得不带去了。")NOD()
    ANP("ProfessorBooster1","magic",0)
    CAT("\n或许这是上天让我使用魔法的指示。")NOD()CLO()
    WAI(32)
    FAO(0)
    FOM()
    SMC(0)SMC(1)
    TRA("CS_fortress_entrance","E0093",4,27)
end