--保存点
function SavePoint()
    PRI()
    MS4("\n是否保存游戏？")YNJ()
    if(YES()) then
        AMC("set_levelreset_pos")--保存重置关卡的坐标
        SAV()CLR()
        CAT("\n游戏已保存")NOD()
    end
end
--保存点（水下）
function SavePointWater()
    PRI()
    MS4("\n是否保存游戏？")YNJ()
    if(YES()) then
        KEY()
        ANP("saved")--设置保存动画
        AMC("set_levelreset_pos")--保存重置关卡的坐标
        SAV()
    end
end
--保存点Beta
function SavePointBeta()
    PRI()
    MS4("\n是否保存游戏？")YNJ()
    if(YES()) then
        SOU("CS_Beta_savec")
        AMC("set_levelreset_pos")--保存重置关卡的坐标
        SAV()CLR()
        CAT("\n游戏已保存")NOD()
    end
end
--生命恢复点
function HealthRefill()
    PRI()
    LIP(1000)
    SOU("CS_020_health_refill")
    MS4("\n体力得到了回复。")NOD()
end
--经验吸收机
function ExpToHealth()
    PRI()
    MS4("\n要清空经验来恢复体力吗？")YNJ()
    if(YES()) then
        ZAM(PLY())
        LIP(1000,PLY())
        SOU("CS_020_health_refill")
        CLR()
        MS4("\n体力得到了回复。")NOD()
    end
end
--关卡重置机
function LevelReset()
    PRI()
    MS4("要重置关卡吗？")YNJ()
    if(YES()) then
        FAO(2)
        KEY()
        MOV(PLY())--将其他玩家带到身边
        RST("enemy","spike","trap","resetlevel_delete")--重新生成含有这些名称的实体
        AMC("set_levelreset_pos")--保存重置关卡的坐标
        WAI(16)
        PRI()
        FAI(0)
    end
end
--关卡重置机（技能）
function LevelReset_Skill()
    PRI()
    MS4("要重置关卡吗？")YNJ()
    if(YES()) then
        FAO(2)
        KEY()
        AMC("move_levelreset_pos")--回到最后一次的坐标位置
        RST("enemy","spike","trap","resetlevel_delete")--重新生成含有这些名称的实体
        WAI(16)
        PRI()
        FAI(0)
    end
end
--床
function Bed()
    KEY()
    MS4("\n要休息吗？")YNJ()
    if(YES()) then
        FAO(4)CMU("XXXX")WAI(20)CLR()
        MS4("\n...")NOD()CLO()
        WAI(50)
        LIP(1000)
        SOU("CS_020_health_refill")
        AMC(0,1,PLY())
        MS4("\n体力得到了回复。")NOD()CLO()
        RMU()FAI(4)
    end
end

function Died()
    CMU("XXXX")WAI(30)PRI()WAI(60)CMU("CS_Gameover",0.5)WAI(15)
    MS4("你死了。\n")
    CAT("要再试一次吗？")YNJ()
    if(YES()) then
        INI()
    else
        ESC()
    end
end

function Drown()
    PRI()WAI(60)CMU("CS_Gameover",0.5)WAI(15)
    MS4("你溺死了。\n")
    CAT("要再试一次吗？")YNJ()
    if(YES()) then
        INI()
    else
        ESC()
    end
end

function FallOutOfMap()
    KEY()CMU("XXXX")WAI(40)
    PRI()WAI(40)CMU("CS_Gameover",0.5)
    HMC(PLY())MS4("\n你就这样从此永远消失了...")NOD()CLR()
    CAT("请重试一次。")YNJ()
    if(YES()) then
        INI()
    else
        ESC()
    end
end

function DeathByMovingPlatform()
    KEY()WAI(30)PRI()WAI(60)CMU("CS_Gameover",0.5)WAI(15)
    MS4("你被压扁了。\n")
    CAT("要再试一次吗？")YNJ()
    if(YES()) then
        INI()
    else
        ESC()
    end
end

function KanpaEatFishDesc()
    if(not FLJ("KanpaEatFishDesc")) then
        FLP("KanpaEatFishDesc")
        CLR()MS3("食用小鱼可以获得生命上限，")NOD()
        CAT("\n多去钓一些吧~")NOD()
    end
end

STA("CS_pe_smoke",4,"CS_012_block_destroy")--设置星星砖破坏效果
dofile(global_path.."CS_item.lua")
dofile(global_path.."CS_mission.lua")
dofile(global_path.."CS_skill.lua")

MSS(5)