----------------物品栏函数---------------
--[[
    物品栏的脚本是个没有初始化的子游戏-----
    要使用主游戏的脚本指令，得先SUB(true),
    调用了SUB指令后，指令目标就是主游戏
    记得要调回SUB(false)
--]]
function ItemLocked()
    if(GOP() == 1) then
        TUR()MSG("\nThis item is being used by another player")W99()
    else
        TUR()MSG("This item is being used by another")
        CAT("\nplayer")W99()
    end
end

--珍鱼
function ItemSystem_Chinfish()
    TUR()MSG("*Chinfish*")W99()
end
function ItemSystem_Chinfish_Check()
    if(LOC()) then
        ItemLocked()
    else
        LOC(true)
        if(GOP() == 1) then
            KEY()MSG("A common small fish found in ponds near Mimiga")
            CAT("\nVillage.")NOD()CLR()
        else
            KEY()MSG("A common small fish found in")
            CAT("\nponds near Mimiga Village.")NOD()CLR()
        end
        CAT("\nEat it?")YNJ()
        if(YES()) then
            SUB(true)
            --增加所有玩家的生命最大值1点
            MLP(1)IMM()
            ITS("Chinfish",1)
            SUB(false)
        end    
        LOC(false)
    end
end
RGI("Chinfish","CS_item_chinfish","ItemSystem_Chinfish","ItemSystem_Chinfish_Check",true)

--生命胶囊
function ItemSystem_LifeCapsule()
    TUR()MSG("*Life Capsule*")W99()
end
function ItemSystem_LifeCapsule_Check()
    MSG("\nIncreases maximum health when used.")NOD()W99()
end
RGI("LifeCapsule","CS_item_lifecapsule","ItemSystem_LifeCapsule","ItemSystem_LifeCapsule_Check",false)

--钉鞋
function ItemSystem_Spikes()
    TUR()MSG("*Spiked Boots*")W99()
end
function ItemSystem_Spikes_Check()
    MSG("Spiked Boots enhance your agility")
    if(GOP() == 1) then
        CAT("\nand allow you to stomp on enemies from above.")NOD()W99()
    else
        CAT("\nand allow you to stomp on")
        CAT("\nenemies from above.")NOD()W99()
    end
end
RGI("Spikes","CS_item_spikes","ItemSystem_Spikes","ItemSystem_Spikes_Check",false)

--地图系统
function ItemSystem_MapSystem()
    TUR()MSG("*Map System*")W99()
end
function ItemSystem_MapSystem_Check()
    MAP()
end
RGI("MapSystem","CS_item_mapsystem","ItemSystem_MapSystem","ItemSystem_MapSystem_Check",false)

--青鱼
function ItemSystem_Bluefish()
    TUR()MSG("*Blue Fish*")W99()
end
function ItemSystem_Bluefish_Check()
    if(LOC()) then
        ItemLocked()
    else
        LOC(true)
        KEY()
        if(GOP() == 1) then
            MSG("Found mostly in rivers and lakes in the wild.")
            CAT("\nA small fish that likes to swim around.")NOD()CLR()
        else
            MSG("Found mostly in rivers and")
            CAT("\nlakes in the wild.")NOD()
            CAT("\nA small fish that likes to")
            CAT("\nswim around.")NOD()CLR()
        end
        CAT("\nEat it?")YNJ()
        if(YES()) then
            SUB(true)
            --增加所有玩家的生命最大值2点
            MLP(2)IMM()
            ITS("Bluefish",1)
            SUB(false)
        end    
        LOC(false)
    end
end
RGI("Bluefish","CS_item_bluefish","ItemSystem_Bluefish","ItemSystem_Bluefish_Check",true)

--赤鱼
function ItemSystem_Redfish()
    TUR()MSG("*Red Fish*")W99()
end
function ItemSystem_Redfish_Check()
    if(LOC()) then
        ItemLocked()
    else
        LOC(true)
        KEY()
        if(GOP() == 1) then
            MSG("Red Fish are quite timid and will")
            CAT("\nflee at any disturbance.")NOD()
            CAT("\nThey usually hide at the bottom")
            CAT("\nof lakes, making them hard to spot.")NOD()CLR()
        else
            MSG("Red Fish are quite timid and")
            CAT("\nwill flee at any disturbance.")NOD()
            CAT("\nThey usually hide at the bottom")
            CAT("\nof lakes, making them hard to")
            CAT("\nspot.")NOD()CLR()
        end
        CAT("\nEat it?")YNJ()
        if(YES()) then
            SUB(true)
            --增加所有玩家的生命最大值3点
            MLP(3)IMM()
            ITS("Redfish",1)
            SUB(false)
        end    
        LOC(false)
    end
end
RGI("Redfish","CS_item_redfish","ItemSystem_Redfish","ItemSystem_Redfish_Check",true)

--生锈的钥匙
function ItemSystem_RustKey()
    TUR()MSG("*Rusty Key*")W99()
end
function ItemSystem_RustKey_Check()
    MSG("\nA rusty key fished from the pond...")NOD()W99()
end
RGI("RustKey","CS_item_rustkey","ItemSystem_RustKey","ItemSystem_RustKey_Check",false)

--龙鱼
function ItemSystem_Arowana()
    TUR()MSG("*Arowana*")W99()
end
function ItemSystem_Arowana_Check()
    if(GOP() == 1) then
        MSG("\nA tough big fish caught in the cave interior")NOD()W99()
    else
        MSG("A tough big fish caught in the")
        CAT("\ncave interior")NOD()W99()
    end
end
RGI("Arowana","CS_item_arowana","ItemSystem_Arowana","ItemSystem_Arowana_Check",false)

--多隆子的项链
function ItemSystem_TorokoNecklace()
    TUR()MSG("*Toroko's Necklace*")W99()
end
function ItemSystem_TorokoNecklace_Check()
    if(GOP() == 1) then
        MSG("The little fish necklace that Toroko always")
        CAT("\nwears")NOD()W99()
    else
        MSG("The little fish necklace that")
        CAT("\nToroko always wears")NOD()W99()
    end
end
RGI("TorokoNecklace","CS_item_torokonecklace","ItemSystem_TorokoNecklace","ItemSystem_TorokoNecklace_Check",false)

--翻译机
function ItemSystem_Translator()
    TUR()MSG("*Translator*")W99()
end
function ItemSystem_Translator_Check()
    MSG("With this item,")
    CAT("\nyou can communicate with humans")NOD()W99()
end
RGI("Translator","CS_item_translator","ItemSystem_Translator","ItemSystem_Translator_Check",false)

--火球
function ItemSystem_Fireball()
    TUR()MSG("- Fireball -")W99()
end
function ItemSystem_Fireball_Check()
    TUR()
    if(GOP() == 1) then
        MSG("- Fireball -")
        CAT("\nDescription: Bounces along the ground.")
        CAT("\nShows its power on slopes.")NOD()W99()
    else
        MSG("- Fireball -")
        CAT("\nDescription: Bounces along the")
        CAT("\nground.")NOD()
        CAT("\nShows its power on slopes.")NOD()W99()
    end
end
RGI("Fireball","CS_item_fireball","ItemSystem_Fireball","ItemSystem_Fireball_Check",false)

--泡泡枪
function ItemSystem_Bubbler()
    TUR()MSG("- Bubbler -")W99()
end
function ItemSystem_Bubbler_Check()
    TUR()
    if(GOP() == 1) then
        MSG("- Bubbler -")
        CAT("\nDescription: Obtained from the stove")
        CAT("\nat the old assembly hall.")NOD()
        CAT("\nIts usefulness varies from person to person.")NOD()W99()
    else
        MSG("- Bubbler -")
        CAT("\nDescription: Obtained from")
        CAT("\nthe stove at the old assembly hall.")NOD()
        CAT("\nIts usefulness varies from person")
        CAT("\nto person.")NOD()W99()
    end
end
RGI("Bubbler","CS_item_bubbler","ItemSystem_Bubbler","ItemSystem_Bubbler_Check",false)

--幽灵火球
function ItemSystem_GhostFire()
    SUB(true)
    local bFishState = FLJ("FishState");
    SUB(false)
    if(bFishState) then
        if(GOP() == 1) then
            TUR()MSG("- Ghost Fireball (Cannot use in fish form) -")W99()
        else
            TUR()MSG("- Ghost Fireball (Cannot use")
            CAT("\nin fish form) -")W99()
        end
    else
        TUR()MSG("- Ghost Fireball -")W99()
    end
end
function ItemSystem_GhostFire_Check()
    SUB(true)
    local bFishState = FLJ("FishState");
    SUB(false)
    if(bFishState) then
        MSG("As much as you want to use it,")
        CAT("\nyou don't have hands")
        CAT("\nto pull the trigger right now.")NOD()W99()
    else
        TUR()MSG("- Ghost Fireball -")
        CAT("\nDescription: Evolved form of Fireball.")
        CAT("\nBounces in the air,")NOD()
        CAT("\ndevours enemies and splits.")NOD()W99()
    end
end
RGI("GhostFire","CS_item_ghostfire","ItemSystem_GhostFire","ItemSystem_GhostFire_Check",false)

--捕获者
function ItemSystem_Catcher()
    SUB(true)
    local bFishState = FLJ("FishState");
    SUB(false)
    if(bFishState) then
        if(GOP() == 1) then
            TUR()MSG("- Catcher (Cannot use in fish form) -")W99()
        else
            TUR()MSG("- Catcher (Cannot use")
            CAT("\nin fish form) -")W99()
        end
    else
        TUR()MSG("- Catcher -")W99()
    end
end
function ItemSystem_Catcher_Check()
    SUB(true)
    local bFishState = FLJ("FishState");
    SUB(false)
    if(bFishState) then
        MSG("As much as you want to use it,")
        CAT("\nyou don't have hands")
        CAT("\nto pull the trigger right now.")NOD()W99()
    else
        TUR()MSG("- Catcher -")
        CAT("\nDescription: Evolved form of Bubbler.")NOD()
        CAT("\nTraps enemies and pulls them to")
        CAT("\nthe ground, immobilizing them.")NOD()W99()
    end
end
RGI("Catcher","CS_item_catcher","ItemSystem_Catcher","ItemSystem_Catcher_Check",false)

--恶魔之花
function ItemSystem_DemonFlower()
    TUR()MSG("- Demon Flower -")W99()
end
function ItemSystem_DemonFlower_Check()
    MSG("There seems to be some magical")
    CAT("\npower contained within.")NOD()W99()
end
RGI("DemonFlower","CS_item_demonflower","ItemSystem_DemonFlower","ItemSystem_DemonFlower_Check",false)

--蜂巢
function ItemSystem_Honeycomb()
    TUR()MSG("- Honeycomb -")W99()
end
function ItemSystem_Honeycomb_Check()
    if(GOP() == 1) then
        MSG("A small piece taken from a giant beehive,")NOD()
        CAT("\nit seems to contain quite a bit of honey.")NOD()
    else
        MSG("A small piece taken from a") 
        CAT("\ngiant beehive,")NOD()
        CAT("\nit seems to contain quite a") 
        CAT("\nbit of honey.")NOD()
    end
    W99()
end
RGI("Honeycomb","CS_item_honeycomb","ItemSystem_Honeycomb","ItemSystem_Honeycomb_Check",false)

--蜂蜜
function ItemSystem_Honey()
    TUR()MSG("- Honey -")W99()
end
function ItemSystem_Honey_Check()
    MSG("\nA jar of wild honey.")NOD()W99()
end
RGI("Honey","CS_item_honey","ItemSystem_Honey","ItemSystem_Honey_Check",false)

--甜甜圈
function ItemSystem_Doughnut()
    TUR()MSG("- Giant Honey Doughnut -")W99()
end
function ItemSystem_Doughnut_Check()
    MSG("It's huge, feels like you")
    CAT("\ncould eat on this all day.")NOD()W99()
end
RGI("Doughnut","CS_item_doughnut","ItemSystem_Doughnut","ItemSystem_Doughnut_Check",false)

--萤火虫
function ItemSystem_Firefly()
    TUR()MSG("- Firefly -")W99()
end
function ItemSystem_Firefly_Check()
    MSG("\nA magical bug that emits light.")NOD()W99()
end
RGI("Firefly","CS_item_firefly","ItemSystem_Firefly","ItemSystem_Firefly_Check",true)

--米克
function ItemSystem_Mick()
    TUR()MSG("- Mick -")W99()
end
function ItemSystem_Mick_Check()
    if(GOP() == 1) then
        MSG("Mick is very good at searching,")NOD()
        CAT("\nif you bring him to the right path")
        CAT("\nhe will bark to give you a hint.")NOD()
    else
        MSG("Mick is very good at searching,")NOD()
        CAT("\nif you bring him to the") 
        CAT("\nright path he will bark")
        CAT("\nto give you a hint.")NOD()
    end
    W99()
end
RGI("Mick","CS_item_puppy","ItemSystem_Mick","ItemSystem_Mick_Check",false)

--恰可的口红
function ItemSystem_ChakoLipstick()
    TUR()MSG("- Chako's Lipstick -")W99()
end
function ItemSystem_ChakoLipstick_Check()
    MSG("This is Chako's most important")
    CAT("\npersonal item.")NOD()W99()
end
RGI("ChakoLipstick","CS_item_chakolipstick","ItemSystem_ChakoLipstick","ItemSystem_ChakoLipstick_Check",false)

--电容器
function ItemSystem_Capacitor()
    TUR()MSG("- Capacitor -")W99()
end
function ItemSystem_Capacitor_Check()
    if(GOP() == 1) then
        MSG("Whenever you successfully defend against an")
        CAT("\nenemy attack,")NOD()
        CAT("\nrecover 1 energy point.")W99()
    else
        MSG("Whenever you successfully")
        CAT("\ndefend against an enemy")
        CAT("\nattack,")NOD()
        CAT("\nrecover 1 energy point.")W99()
    end
end
RGI("Capacitor","CS_item_capacitor","ItemSystem_Capacitor","ItemSystem_Capacitor_Check",false)

--鱼饲料
function ItemSystem_FishFeed()
    TUR()MSG("- Fish Feed -")W99()
end
function ItemSystem_FishFeed_Check()
    if(GOP() == 1) then
        MSG("\nMimika might be able to eat this...")NOD()W99()
    else
        MSG("Mimika might be able to")
        CAT("\neat this...")NOD()W99()
    end
end
RGI("FishFeed","CS_item_fishfeed","ItemSystem_FishFeed","ItemSystem_FishFeed_Check",false)

--剑
function ItemSystem_Sword()
    TUR()MSG("- Sword -")W99()
end
function ItemSystem_Sword_Check()
    TUR()
    if(GOP() == 1) then
        MSG("- Sword -")
        CAT("\nDescription: Deals high damage in a single hit.")
        CAT("\nHas three attack modes.")NOD()W99()
    else
        MSG("- Sword -")
        CAT("\nDescription: Deals high")
        CAT("\ndamage in a single hit.")NOD()
        CAT("\nHas three attack modes.")NOD()W99()
    end
end
RGI("Sword","CS_item_sword","ItemSystem_Sword","ItemSystem_Sword_Check",false)

--生命罐
function ItemSystem_LifePot()
    TUR()MSG("*Life Pot*")W99()
end
function ItemSystem_LifePot_Check()
    if(LOC()) then
        ItemLocked()
    else
        LOC(true)
        KEY()MSG("Restores health points once.")
        CAT("\nUse it?")YNJ()
        if(YES()) then
            SUB(true)
            --恢复所有生命
            LIP(1000,PLY())IMM()
            ITS("LifePot",1)
            SUB(false)
        end    
        LOC(false)
    end
end
RGI("LifePot","CS_item_lifepot","ItemSystem_LifePot","ItemSystem_LifePot_Check",true)

--突破
function ItemSystem_Spur()
    TUR()MSG("- Spur -")W99()
end
function ItemSystem_Spur_Check()
    TUR()MSG("- Spur -")
    CAT("\nDescription: Hold the button")
    CAT("\nto fire a laser beam.")NOD()W99()
end
RGI("Spur","CS_item_spur","ItemSystem_Spur","ItemSystem_Spur_Check",false)

--超级飞弹
function ItemSystem_SuperMissile()
    TUR()MSG("- Super Missile -")W99()
end
function ItemSystem_SuperMissile_Check()
    TUR()MSG("- Super Missile -")
    CAT("\nDescription: Powerful missile.")
    CAT("\nExcellent acceleration.")NOD()W99()
end
RGI("SuperMissile","CS_item_supermissile","ItemSystem_SuperMissile","ItemSystem_SuperMissile_Check",false)

--机枪
function ItemSystem_MachineGun()
    TUR()MSG("- Machine Gun -")W99()
end
function ItemSystem_MachineGun_Check()
    TUR()
    if(GOP() == 1) then
        MSG("- Machine Gun -")
        CAT("\nDescription: Automatic rapid fire.")
        CAT("\nAmmo regenerates over time.")NOD()W99()
    else
        MSG("- Machine Gun -")
        CAT("\nDescription: Automatic")
        CAT("\nrapid fire.")NOD()
        CAT("\nAmmo regenerates over time.")NOD()W99()
    end
end
RGI("MachineGun","CS_item_machinegun","ItemSystem_MachineGun","ItemSystem_MachineGun_Check",false)

--复仇女神
function ItemSystem_Nemesis()
    TUR()MSG("- Nemesis -")W99()
end
function ItemSystem_Nemesis_Check()
    TUR()
    if(GOP() == 1) then
        MSG("- Nemesis -")
        CAT("\nDescription: Goddess of lightning.")
        CAT("\nAlways maintains strongest form at Level 1.")NOD()W99()
    else
        MSG("- Nemesis -")
        CAT("\nDescription: Goddess of")
        CAT("\nlightning.")NOD()
        CAT("\nAlways maintains strongest")
        CAT("\nform at Level 1.")NOD()W99()
    end
end
RGI("Nemesis","CS_item_nemesis","ItemSystem_Nemesis","ItemSystem_Nemesis_Check",false)

--氧气瓶
function ItemSystem_AirTank()
    TUR()MSG("- Air Tank -")W99()
end
function ItemSystem_AirTank_Check()
    TUR()MSG("\nAllows breathing underwater.")NOD()W99()
end
RGI("AirTank","CS_item_airtank","ItemSystem_AirTank","ItemSystem_AirTank_Check",false)

--电梯钥匙
function ItemSystem_LiftKey()
    TUR()MSG("- Elevator Key -")W99()
end
function ItemSystem_LiftKey_Check()
    TUR()MSG("\nDropped by Mr. G.")NOD()W99()
end
RGI("LiftKey","CS_item_liftkey","ItemSystem_LiftKey","ItemSystem_LiftKey_Check",false)

--牵引绳
function ItemSystem_TowRope()
    TUR()MSG("- Tow Rope -")W99()
end
function ItemSystem_TowRope_Check()
    if(GOP() == 1) then
        MSG("Used it to replace the fishing line")
        CAT("\nNow you can climb upward with the fishing rod.")NOD()W99()
    else
        MSG("Used it to replace the") 
        CAT("\nfishing line")NOD()
        CAT("\nNow you can climb upward with")
        CAT("\nthe fishing rod.")NOD()W99()
    end
end
RGI("TowRope","CS_item_towrope","ItemSystem_TowRope","ItemSystem_TowRope_Check",false)

--铁门钥匙
function ItemSystem_IronKey()
    TUR()MSG("- Key of Iron Door  -")W99()
end
function ItemSystem_IronKey_Check()
    if(GOP() == 1) then
        MSG("Use it to open Mahin's iron door")
        CAT("\nLet's go home together~")NOD()W99()
    else
        MSG("Use it to open")
        CAT("\nMahin's iron door")
        CAT("\nLet's go home together~")NOD()W99()
    end
end
RGI("IronKey","CS_item_ironkey","ItemSystem_IronKey","ItemSystem_IronKey_Check",false)

--突波扩展充能器
function ItemSystem_SpurCharger()
    TUR()MSG("- Spur Charger -")W99()
end
function ItemSystem_SpurCharger_Check()
    if(GOP() == 1) then
        MSG("Increases the rate at which the Spur charges,") 
        CAT("\nand enables Spur to release a") 
        CAT("\nhuge wall-piercing laser when fully charged.")NOD()W99()
    else
        MSG("Increases the rate at which")
        CAT("\nthe Spur charges,")NOD()
        CAT("\nand enables Spur to release a") 
        CAT("\nhuge wall-piercing laser") 
        CAT("\nwhen fully charged.")NOD()W99()
    end
end
RGI("SpurCharger","CS_item_spurcharger","ItemSystem_SpurCharger","ItemSystem_SpurCharger_Check",false)

--机枪转轮模块
function ItemSystem_MachinegunWheelModule()
    TUR()MSG("- Rotor Assembly -")W99()
end
function ItemSystem_MachinegunWheelModule_Check()
    if(GOP() == 1) then
        MSG("Boosts fire rate of Machine Gun to match") 
        CAT("\na Minigun's fire rate,")
        CAT("\nsuppressing all enemies.")NOD()W99()
    else
        MSG("Boosts fire rate of") 
        CAT("\nMachine Gun to match") 
        CAT("\na Minigun's fire rate,")NOD()
        CAT("\nsuppressing all enemies.")NOD()W99()
    end
end
RGI("MachinegunWheelModule","CS_item_machinegunwheelmodule","ItemSystem_MachinegunWheelModule","ItemSystem_MachinegunWheelModule_Check",false)