modimport ("scripts/tuning_musha.lua")
modimport ("scripts/musha_play.lua")

local LEVELS = GetModConfigData("mushalevel")
local SKILLS = GetModConfigData("mushaskill")
local VALKYRIE = GetModConfigData("valkyriec")
local LIGHTNING = GetModConfigData("powerattack")
local SHIELD = GetModConfigData("shielda")
local Shadow = GetModConfigData("bunsin")
local Dogs = GetModConfigData("dogs")
local YAMCHO = GetModConfigData("commandyamche")
local MEAT = GetModConfigData("monstermeat")
local Mbadge = GetModConfigData("mushabadge")
local Cgems = GetModConfigData("craftgems")
local Frostone = GetModConfigData("frostseries")
local Smart = GetModConfigData("smartmusha")
local Difficult = GetModConfigData("difficultover")
local Difficult_sleep = GetModConfigData("difficultsleep")
local Hide = GetModConfigData("hidecast")
local Collect = GetModConfigData("yamchecollect")
local Hold = GetModConfigData("visualhold")
local Sleeprincess = GetModConfigData("sleeping")

local ACTIONS = GLOBAL.ACTIONS

ACTIONS.ADDFUEL.priority = 4
ACTIONS.GIVE.priority = 3
--ACTIONS.STORE.priority = 2

local require = GLOBAL.require
local SpawnPrefab = GLOBAL.SpawnPrefab
--------------
local Widget = GLOBAL.require('widgets/widget')
local Image = GLOBAL.require('widgets/image')
local Text = GLOBAL.require('widgets/text')
local Badge = GLOBAL.require("widgets/badge")
--------------
local RECIPETABS = GLOBAL.RECIPETABS
local Recipe = GLOBAL.Recipe
local Ingredient = GLOBAL.Ingredient
local ACTIONS = GLOBAL.ACTIONS
TECH = GLOBAL.TECH


PrefabFiles = {
	"musha",
          "musha_small",
          "musha_egg",
          "musha_egg1",
          "musha_egg2",
          "musha_egg3",
          "musha_eggs1",
          "musha_eggs2",
          "musha_eggs3",
          "musha_egg8",
     	"frosthammer",
          "broken_frosthammer",
          "frostback",
          "hat_mbunny",
          "hat_mphoenix",
          "hat_mcrown",
          "hat_mprincess",
          "ghosthound",
          "ghosthound2",
          "armor_mushaa",
          "armor_mushab",
	"books",
	"shock_fx2",
	"glowdust",
	"mushasword",
	"mushasword_base",
	"mushasword_frost",
	"mushasword2",
	"mushasword3",
	"mushasword4",
	"musha_flute",
	"cristal",
	"forcefieldfxx",
	"exp",
	"exp1000",
	"shadowmusha",
	"tentacle_frost",
	
	"bedroll_straw",
	"bedroll_furry",
	"tent",
	"siestahut",
	"tent_musha",

}


local function Mushaintro(inst)
    if GLOBAL.GetPlayer().prefab == "musha" then
	local player = GLOBAL.GetPlayer()
	 local yamche = SpawnPrefab("musha_small")
 	 local brokensword = SpawnPrefab("mushasword_base")
	 local dust1 = SpawnPrefab("glowdust")
	 local dust2 = SpawnPrefab("glowdust")
	 local dust3 = SpawnPrefab("glowdust")	 
	 local princesscrown = SpawnPrefab("hat_mprincess")
	 local frostheart = SpawnPrefab("broken_frosthammer")
	 local crystalll = SpawnPrefab("cristal")	 
player.components.inventory:GiveItem(yamche) 
player.components.inventory:GiveItem(brokensword) 
player.components.inventory:GiveItem(dust1)
player.components.inventory:GiveItem(dust2) 
player.components.inventory:GiveItem(dust3)  
player.components.inventory:GiveItem(princesscrown) 
player.components.inventory:GiveItem(frostheart) 
player.components.inventory:GiveItem(crystalll) 
	 
     inst.components.maxwelltalker.speeches.SANDBOX_1 =
        {
            appearsound = "dontstarve/maxwell/appear_adventure",
	    voice = "dontstarve/maxwell/talk_LP_world2",
	appearanim = "appear2",
	idleanim= "idle2_loop",
	dialogpreanim = "dialog2_pre",
	dialoganim="dialog2_loop",
	dialogpostanim = "dialog2_pst",
	disappearanim = "disappear2",
            disableplayer = true,
            skippable = true,
            {
                string = "So good of you to visit my dear",
                wait = 3,
                anim = nil,
                sound = nil,
            },
            {
                string = "...not that you had a lot of choice in the matter.",
                wait = 3,
                anim = nil,
                sound = nil,
            },
            {
                string = "Meet the other guests and entertain yourself.",
                wait = 3,
                anim = nil,
                sound = nil,
            },
            {
                string = "Do take care, they aren't used to meeting a princess.",
                wait = 3,
                anim = nil,
                sound = nil,
            },
            {
                string = "I wouldn't want anything unfortunate to happen to you...",
                wait = 3,
                anim = dialog2_loop,
                sound = nil,
            },
	}

    end
end

AddPrefabPostInit("maxwellintro", Mushaintro)


local function Mushaintro2(inst)
    if GLOBAL.GetPlayer().prefab == "musha" then
	local player = GLOBAL.GetPlayer()
	 local yamche = SpawnPrefab("musha_small")
 	 local brokensword = SpawnPrefab("mushasword_base")
	 local dust1 = SpawnPrefab("glowdust")
	 local dust2 = SpawnPrefab("glowdust")
	 local dust3 = SpawnPrefab("glowdust")	 
	 local princesscrown = SpawnPrefab("hat_mprincess")
	 local frostheart = SpawnPrefab("broken_frosthammer")
	 local crystalll = SpawnPrefab("cristal")	 
player.components.inventory:GiveItem(yamche) 
player.components.inventory:GiveItem(brokensword) 
player.components.inventory:GiveItem(dust1)
player.components.inventory:GiveItem(dust2) 
player.components.inventory:GiveItem(dust3)  
player.components.inventory:GiveItem(princesscrown) 
player.components.inventory:GiveItem(frostheart) 
player.components.inventory:GiveItem(crystalll) 
end end
AddPrefabPostInit("wallyintro", Mushaintro2)


Assets = {
    Asset( "IMAGE", "images/saveslot_portraits/musha.tex" ),
    Asset( "IMAGE", "images/selectscreen_portraits/musha.tex" ),
    Asset( "IMAGE", "images/selectscreen_portraits/musha_silho.tex" ),
    Asset( "IMAGE", "bigportraits/musha.tex" ),
	Asset("IMAGE", "images/musha.tex"),
	Asset("IMAGE", "images/mushas.tex"),
        Asset( "ANIM", "anim/musha_battle.zip"),
        Asset( "ANIM", "anim/musha.zip"),
        Asset( "ANIM", "anim/musha_h.zip"),
        Asset( "ANIM", "anim/musha_normal.zip"),
    Asset( "ANIM", "anim/musha_hunger.zip"),
	----
Asset( "ANIM", "anim/musha_old.zip"),
Asset( "ANIM", "anim/musha_normal_old.zip"),
Asset( "ANIM", "anim/musha_battle_old.zip"),
Asset( "ANIM", "anim/musha_hunger_old.zip"),
Asset( "ANIM", "anim/musha_full_p_old.zip"),
Asset( "ANIM", "anim/musha_normal_p_old.zip"),
Asset( "ANIM", "anim/musha_battle_p_old.zip"),
Asset( "ANIM", "anim/musha_hunger_p_old.zip"),
----
Asset( "ANIM", "anim/tent_musha.zip"),
Asset( "ANIM", "anim/tent_musha_on.zip"),
Asset( "ANIM", "anim/tent_musha_broken.zip"),

    Asset("ANIM", "anim/musha_egg8.zip"),
    Asset("ANIM", "anim/musha_egg.zip"),
    Asset("ANIM", "anim/musha_egg1.zip"),
    Asset("ANIM", "anim/musha_egg2.zip"),
    Asset("ANIM", "anim/musha_egg3.zip"),
    Asset("ANIM", "anim/musha_eggs1.zip"),
    Asset("ANIM", "anim/musha_eggs2.zip"),
    Asset("ANIM", "anim/musha_eggs3.zip"),
    Asset("ANIM", "anim/musha_ice.zip"),
    Asset("ANIM", "anim/musha_small.zip"),
    Asset("ANIM", "anim/musha_teen.zip"),
    Asset("ANIM", "anim/musha_tall.zip"),
    Asset("ANIM", "anim/musha_tall2.zip"),
    Asset("ANIM", "anim/musha_tall3.zip"),
    Asset("ANIM", "anim/musha_tall4.zip"),
    Asset("ANIM", "anim/musha_tall5.zip"),
    Asset("ANIM", "anim/frosthammer.zip"),
    Asset("ANIM", "anim/swap_frosthammer.zip"),
    Asset("ANIM", "anim/broken_frosthammer.zip"),
    Asset("ANIM", "anim/swap_frostback.zip"),
    Asset("ANIM", "anim/swap_frostpocket.zip"),
    Asset("ANIM", "anim/hat_mbunny.zip"),
    Asset("ANIM", "anim/hat_mbunny2.zip"),
    Asset("ANIM", "anim/hat_mphoenix.zip"),
    Asset("ANIM", "anim/hat_mphoenix2.zip"),
    Asset("ANIM", "anim/hat_mcrown.zip"),
    Asset("ANIM", "anim/hat_mprincess.zip"),
    Asset("ANIM", "anim/ghosthound.zip"),
    Asset("ANIM", "anim/armor_mushaa.zip"),
    Asset("ANIM", "anim/armor_mushab.zip"),
    Asset("ANIM", "anim/ui_chest_yamche0.zip"),
    Asset("ANIM", "anim/ui_chest_yamche1.zip"),
    Asset("ANIM", "anim/ui_chest_yamche2.zip"),
    Asset("ANIM", "anim/hat_yamche.zip"),
    Asset("ANIM", "anim/ui_frostsmall.zip"),
    Asset("ANIM", "anim/ui_chest_frosthammer.zip"),
    Asset("ANIM", "anim/ui_chest_frosthammer2.zip"),
    Asset("ANIM", "anim/ui_mushab_2x3.zip"),
    Asset("ANIM", "anim/shock_fx2.zip"),
    Asset("ANIM", "anim/forcefieldx.zip"),
    Asset("ANIM", "anim/glowdust.zip"),
    Asset("ANIM", "anim/cristal.zip"),
    Asset("ANIM", "anim/exp.zip"),
    Asset("ANIM", "anim/musha_flute.zip"),
    Asset("ANIM", "anim/mushasword_base.zip"),
    Asset("ANIM", "anim/mushasword_frost.zip"),
    Asset("ANIM", "anim/mushasword.zip"),
    Asset("ANIM", "anim/mushasword2.zip"),
    Asset("ANIM", "anim/mushasword3.zip"),
    Asset("ANIM", "anim/mushasword4.zip"),
    Asset("ANIM", "anim/swap_mushasword_base.zip"),
    Asset("ANIM", "anim/swap_mushasword_frost1.zip"),
    Asset("ANIM", "anim/swap_mushasword_frost2.zip"),
    Asset("ANIM", "anim/swap_mushasword_frost3.zip"),
    Asset("ANIM", "anim/swap_mushasword.zip"),
    Asset("ANIM", "anim/swap_mushasword2.zip"),
    Asset("ANIM", "anim/swap_mushasword3.zip"),
    Asset("ANIM", "anim/swap_mushasword4.zip"),
    Asset("ANIM", "anim/tentacle_frost.zip"),

	Asset("IMAGE", "images/inventoryimages/musha_egg.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg1.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg2.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg3.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_eggs1.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_eggs2.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_eggs3.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_cracked.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_cracked1.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_cracked2.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_cracked3.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_crackeds1.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_crackeds2.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_crackeds3.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_cooked.tex"),

	Asset("IMAGE", "images/inventoryimages/musha_egg8.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_egg_cracked8.tex"),

	Asset("IMAGE", "images/inventoryimages/musha_small.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_teen.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_tall.tex"),
	Asset("IMAGE", "images/inventoryimages/frosthammer.tex"),
	Asset("IMAGE", "images/inventoryimages/broken_frosthammer.tex"),
	Asset("IMAGE", "images/inventoryimages/frostback.tex"),
	Asset("IMAGE", "images/inventoryimages/hat_mbunny.tex"),
	Asset("IMAGE", "images/inventoryimages/hat_mphoenix.tex"),
	Asset("IMAGE", "images/inventoryimages/hat_mcrown.tex"),
	Asset("IMAGE", "images/inventoryimages/hat_mprincess.tex"),
	Asset("IMAGE", "images/inventoryimages/armor_mushaa.tex"),
	Asset("IMAGE", "images/inventoryimages/armor_mushab.tex"),
	Asset("IMAGE", "images/inventoryimages/musha_flute.tex"),
	Asset("IMAGE", "images/inventoryimages/mushasword_base.tex"),
	Asset("IMAGE", "images/inventoryimages/mushasword_frost.tex"),
	Asset("IMAGE", "images/inventoryimages/mushasword.tex"),
	Asset("IMAGE", "images/inventoryimages/mushasword2.tex"),
	Asset("IMAGE", "images/inventoryimages/mushasword3.tex"),
	Asset("IMAGE", "images/inventoryimages/mushasword4.tex"),
	Asset("IMAGE", "images/inventoryimages/blade_b.tex"),
	Asset("IMAGE", "images/inventoryimages/blade_1.tex"),
	Asset("IMAGE", "images/inventoryimages/blade_2.tex"),
	Asset("IMAGE", "images/inventoryimages/blade_3.tex"),
	Asset("IMAGE", "images/inventoryimages/blade_4.tex"),
	Asset("IMAGE", "images/inventoryimages/blade_f.tex"),
	Asset("IMAGE", "images/inventoryimages/glowdust.tex"),
	Asset("IMAGE", "images/inventoryimages/cristal.tex"),
	Asset("IMAGE", "images/inventoryimages/exp.tex"),

	Asset("ATLAS", "images/inventoryimages/tent_musha.xml"),
	Asset("ATLAS", "images/musha.xml"),
	Asset("ATLAS", "images/mushas.xml"),
	Asset( "ATLAS", "images/saveslot_portraits/musha.xml" ),
    Asset( "ATLAS", "images/selectscreen_portraits/musha.xml" ),
    Asset( "ATLAS", "images/selectscreen_portraits/musha_silho.xml" ),
    Asset( "ATLAS", "bigportraits/musha.xml" ),
	Asset("ATLAS", "images/inventoryimages/frosthammer.xml"),
	Asset("ATLAS", "images/inventoryimages/broken_frosthammer.xml"),
	Asset("ATLAS", "images/inventoryimages/frostback.xml"),
	Asset("ATLAS", "images/inventoryimages/hat_mbunny.xml"),
	Asset("ATLAS", "images/inventoryimages/hat_mphoenix.xml"),
	Asset("ATLAS", "images/inventoryimages/hat_mcrown.xml"),
	Asset("ATLAS", "images/inventoryimages/hat_mprincess.xml"),
	Asset("ATLAS", "images/inventoryimages/armor_mushaa.xml"),
	Asset("ATLAS", "images/inventoryimages/armor_mushab.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_flute.xml"),
	Asset("ATLAS", "images/inventoryimages/mushasword_base.xml"),
	Asset("ATLAS", "images/inventoryimages/mushasword_frost.xml"),
	Asset("ATLAS", "images/inventoryimages/mushasword.xml"),
	Asset("ATLAS", "images/inventoryimages/mushasword2.xml"),
	Asset("ATLAS", "images/inventoryimages/mushasword3.xml"),
	Asset("ATLAS", "images/inventoryimages/mushasword4.xml"),
	Asset("ATLAS", "images/inventoryimages/blade_b.xml"),
	Asset("ATLAS", "images/inventoryimages/blade_1.xml"),
	Asset("ATLAS", "images/inventoryimages/blade_2.xml"),
	Asset("ATLAS", "images/inventoryimages/blade_3.xml"),
	Asset("ATLAS", "images/inventoryimages/blade_4.xml"),

	Asset("ATLAS", "images/inventoryimages/musha_egg8.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_cracked8.xml"),

	Asset("ATLAS", "images/inventoryimages/musha_egg.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg1.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg2.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg3.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_cracked.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_cracked1.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_cracked2.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_cracked3.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_eggs1.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_eggs2.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_eggs3.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_cracked.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_crackeds1.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_crackeds2.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_crackeds3.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_egg_cooked.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_small.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_teen.xml"),
	Asset("ATLAS", "images/inventoryimages/musha_tall.xml"),
	Asset("ATLAS", "images/inventoryimages/glowdust.xml"),
	Asset("ATLAS", "images/inventoryimages/cristal.xml"),
	Asset("ATLAS", "images/inventoryimages/exp.xml"),
Asset("ATLAS", "images/status_stamina.xml"),

}


function mushaPostInit(musha)
--matarial

local bushhat = Ingredient( "bushhat", 1)
local ruinshat = Ingredient( "ruinshat", 1)
local armorruins = Ingredient( "armorruins", 1)
local amulet = Ingredient( "amulet", 1)
local butterfly10 = Ingredient( "butterfly", 10)
local butterfly8 = Ingredient( "butterfly", 8)
local butterfly6 = Ingredient( "butterfly", 6)
local bee5 = Ingredient( "bee", 5)
local bee4 = Ingredient( "bee", 4)
local papyrus2 = Ingredient( "papyrus", 2)
local beefaloh = Ingredient( "beefalohat", 1)
local walrustusk = Ingredient( "walrus_tusk", 2)
local eyes = Ingredient( "deerclops_eyeball", 1)

local princess = Ingredient( "hat_mprincess", 1)
princess.atlas = "images/inventoryimages/hat_mprincess.xml"

local armoraa = Ingredient( "armor_mushaa", 1)
armoraa.atlas = "images/inventoryimages/armor_mushaa.xml"

local glowdusts = Ingredient( "glowdust", 1)
glowdusts.atlas = "images/inventoryimages/glowdust.xml"
local dust2 = Ingredient( "glowdust", 2)
dust2.atlas = "images/inventoryimages/glowdust.xml"
local dust3 = Ingredient( "glowdust", 3)
dust3.atlas = "images/inventoryimages/glowdust.xml"
local dust4 = Ingredient( "glowdust", 4)
dust4.atlas = "images/inventoryimages/glowdust.xml"
local dust6 = Ingredient( "glowdust", 6)
dust6.atlas = "images/inventoryimages/glowdust.xml"
local dust10 = Ingredient( "glowdust", 10)
dust10.atlas = "images/inventoryimages/glowdust.xml"

local broken = Ingredient( "broken_frosthammer", 1)
broken.atlas = "images/inventoryimages/broken_frosthammer.xml"

local frosta = Ingredient( "frosthammer", 1)
frosta.atlas = "images/inventoryimages/frosthammer.xml"

local meggs = Ingredient( "musha_egg", 1)
meggs.atlas = "images/inventoryimages/musha_egg.xml"
--egg
local phoenix_egg = Ingredient( "musha_egg", 1)
phoenix_egg.atlas = "images/inventoryimages/musha_egg.xml"
local phoenix_eggs1 = Ingredient( "musha_eggs1", 1)
phoenix_eggs1.atlas = "images/inventoryimages/musha_eggs1.xml"
local phoenix_eggs2 = Ingredient( "musha_eggs2", 1)
phoenix_eggs2.atlas = "images/inventoryimages/musha_eggs2.xml"
local phoenix_eggs3 = Ingredient( "musha_eggs3", 1)
phoenix_eggs3.atlas = "images/inventoryimages/musha_eggs3.xml"
local phoenix_egg1 = Ingredient( "musha_egg1", 1)
phoenix_egg1.atlas = "images/inventoryimages/musha_egg1.xml"
local phoenix_egg2 = Ingredient( "musha_egg2", 1)
phoenix_egg2.atlas = "images/inventoryimages/musha_egg2.xml"
local phoenix_egg3 = Ingredient( "musha_egg3", 1)
phoenix_egg3.atlas = "images/inventoryimages/musha_egg3.xml"
local phoenix_egg8 = Ingredient( "musha_egg8", 1)
phoenix_egg8.atlas = "images/inventoryimages/musha_egg8.xml"
--
local bladeb = Ingredient( "mushasword_base", 1)
bladeb.atlas = "images/inventoryimages/mushasword_base.xml"
local blade1 = Ingredient( "mushasword", 1)
blade1.atlas = "images/inventoryimages/mushasword.xml"
local blade2 = Ingredient( "mushasword2", 1)
blade2.atlas = "images/inventoryimages/mushasword2.xml"

local crystal = Ingredient( "cristal", 1)
crystal.atlas = "images/inventoryimages/cristal.xml"
local crystal6 = Ingredient( "cristal", 6)
crystal6.atlas = "images/inventoryimages/cristal.xml"
local crystal10 = Ingredient( "cristal", 10)
crystal10.atlas = "images/inventoryimages/cristal.xml"


--dust

 local glowdust = GLOBAL.Recipe( "glowdust", {Ingredient("wormlight", 1), Ingredient("berries", 5) }, RECIPETABS.MAGIC, {SCIENCE=0})
	glowdust.atlas = "images/inventoryimages/glowdust.xml"

--exp
--[[
 local exp = GLOBAL.Recipe( "exp", {Ingredient("goldnugget", 4),}, RECIPETABS.REFINE, {SCIENCE=0})
	exp.atlas = "images/inventoryimages/exp.xml"]]

--cristal

 local cristal = GLOBAL.Recipe( "cristal", {dust10}, RECIPETABS.MAGIC, {SCIENCE=0})
	cristal.atlas = "images/inventoryimages/cristal.xml"

--horn

 local musha_flute = GLOBAL.Recipe( "musha_flute", {dust6, Ingredient("horn", 1), Ingredient("spidergland", 60)},  RECIPETABS.MAGIC, {SCIENCE=0})
	musha_flute.atlas = "images/inventoryimages/musha_flute.xml"

--tent
local tent_musha = GLOBAL.Recipe("tent_musha", { dust6, Ingredient("lightbulb", 20), Ingredient("papyrus", 16), Ingredient("twigs", 10), }, RECIPETABS.MAGIC, {SCIENCE=0}, "tent_musha_placer" ) 
tent_musha.atlas = "images/inventoryimages/tent_musha.xml"


--phoenix weapon

 local mushasword_base = GLOBAL.Recipe( "mushasword_base", { glowdusts, Ingredient("goldnugget", 10)}, RECIPETABS.WAR, {SCIENCE=0})
mushasword_base.atlas = "images/inventoryimages/mushasword_base.xml"

 local mushasword = GLOBAL.Recipe( "mushasword", { bladeb, glowdusts, Ingredient("feather_robin", 2), Ingredient("goldnugget", 10) }, RECIPETABS.WAR, {SCIENCE=0})
mushasword.atlas = "images/inventoryimages/mushasword.xml"
 local mushasword2 = GLOBAL.Recipe( "mushasword2", { blade1,  dust6, Ingredient("redgem", 6), Ingredient("goldnugget", 20) }, RECIPETABS.WAR, {SCIENCE=0})
mushasword2.atlas = "images/inventoryimages/mushasword2.xml"
 local mushasword3 = GLOBAL.Recipe( "mushasword3", { blade2,  dust10, Ingredient("redgem", 30), Ingredient("goldnugget", 80) }, RECIPETABS.WAR, {SCIENCE=0})
mushasword3.atlas = "images/inventoryimages/mushasword3.xml"
 local mushasword4 = GLOBAL.Recipe( "mushasword4", { blade2, Ingredient("redgem", 30), Ingredient("greengem", 8), Ingredient("nightmarefuel", 40) }, RECIPETABS.WAR, {SCIENCE=0})
mushasword4.atlas = "images/inventoryimages/mushasword4.xml"

--frost 

 local mushasword_frost = GLOBAL.Recipe( "mushasword_frost", { bladeb, broken, dust3 }, RECIPETABS.WAR, {SCIENCE=0})
mushasword_frost.atlas = "images/inventoryimages/mushasword_frost.xml"

 local frosthammer = GLOBAL.Recipe( "frosthammer", { broken, Ingredient("livinglog", 15), Ingredient("bluegem", 30), Ingredient("gears", 4)}, RECIPETABS.WAR, {SCIENCE=0})
frosthammer.atlas = "images/inventoryimages/frosthammer.xml"

--armor

 local broken_frosthammer = GLOBAL.Recipe( "broken_frosthammer", { eyes, butterfly4, Ingredient("gears", 4), Ingredient("bluegem", 12) }, RECIPETABS.WAR, {SCIENCE=0})
broken_frosthammer.atlas = "images/inventoryimages/broken_frosthammer.xml"

local armor_mushaa = GLOBAL.Recipe( "armor_mushaa", {amulet, Ingredient("goldnugget", 40), Ingredient("thulecite", 20) }, RECIPETABS.WAR, {SCIENCE=0})
	armor_mushaa.atlas = "images/inventoryimages/armor_mushaa.xml"

 local frostback = GLOBAL.Recipe( "frostback", { broken, armoraa, butterfly8, Ingredient("bluegem", 5) }, RECIPETABS.WAR, {SCIENCE=0})
frostback.atlas = "images/inventoryimages/frostback.xml"

 local armor_mushab = GLOBAL.Recipe( "armor_mushab", {armoraa, Ingredient("greengem", 8), Ingredient("orangegem", 8), Ingredient("purplegem", 20)}, RECIPETABS.WAR, {SCIENCE=0})
	armor_mushab.atlas = "images/inventoryimages/armor_mushab.xml"

--egg
--phoenix_egg
 local musha_egg = GLOBAL.Recipe( "musha_egg", { dust10, Ingredient("redgem", 60), Ingredient("bluegem", 40), Ingredient("greengem", 30) },  RECIPETABS.MAGIC, {SCIENCE=0})
	musha_egg.atlas = "images/inventoryimages/musha_egg.xml"

local musha_eggs1 = GLOBAL.Recipe("musha_eggs1", { phoenix_egg, GLOBAL.Ingredient("goldnugget", 1)}, RECIPETABS.MAGIC, {SCIENCE=0})  
musha_eggs1.atlas = "images/inventoryimages/musha_eggs1.xml"
local musha_eggs2 = GLOBAL.Recipe("musha_eggs2", { phoenix_eggs1, GLOBAL.Ingredient("goldnugget", 15)}, RECIPETABS.MAGIC, {SCIENCE=0})  
musha_eggs2.atlas = "images/inventoryimages/musha_eggs2.xml"
local musha_eggs3 = GLOBAL.Recipe("musha_eggs3", { phoenix_eggs2, GLOBAL.Ingredient("goldnugget", 30)}, RECIPETABS.MAGIC, {SCIENCE=0})  
musha_eggs3.atlas = "images/inventoryimages/musha_eggs3.xml"
local musha_egg1 = GLOBAL.Recipe("musha_egg1", { phoenix_eggs3, GLOBAL.Ingredient("goldnugget", 45), GLOBAL.Ingredient("purplegem", 1)}, RECIPETABS.MAGIC, {SCIENCE=0})  
musha_egg1.atlas = "images/inventoryimages/musha_egg1.xml"
local musha_egg2 = GLOBAL.Recipe("musha_egg2", { phoenix_egg1, GLOBAL.Ingredient("goldnugget", 60), GLOBAL.Ingredient("purplegem", 3)}, RECIPETABS.MAGIC, {SCIENCE=0})  
musha_egg2.atlas = "images/inventoryimages/musha_egg2.xml"
local musha_egg3 = GLOBAL.Recipe("musha_egg3", { phoenix_egg2, GLOBAL.Ingredient("goldnugget", 90), GLOBAL.Ingredient("purplegem", 5)}, RECIPETABS.MAGIC, {SCIENCE=0})  
musha_egg3.atlas = "images/inventoryimages/musha_egg3.xml"
local musha_egg8 = GLOBAL.Recipe("musha_egg8", { phoenix_egg3, GLOBAL.Ingredient("goldnugget", 120), GLOBAL.Ingredient("purplegem", 8)}, RECIPETABS.MAGIC, {SCIENCE=0})  
musha_egg8.atlas = "images/inventoryimages/musha_egg8.xml"
--hat

 local hat_mbunny = GLOBAL.Recipe( "hat_mbunny", {walrustusk, Ingredient("dug_grass", 8), Ingredient("manrabbit_tail", 10), Ingredient("bluegem", 4)  }, RECIPETABS.WAR, {SCIENCE=0})
	hat_mbunny.atlas = "images/inventoryimages/hat_mbunny.xml"
	
 local hat_mprincess = GLOBAL.Recipe( "hat_mprincess", {amulet, Ingredient("goldnugget", 12), Ingredient("purplegem", 2) },  RECIPETABS.WAR, {SCIENCE=0})
	hat_mprincess.atlas = "images/inventoryimages/hat_mprincess.xml"
	
 local hat_mcrown = GLOBAL.Recipe( "hat_mcrown", {princess, Ingredient("thulecite", 10), Ingredient("purplegem", 6) }, RECIPETABS.WAR, {SCIENCE=0})
	hat_mcrown.atlas = "images/inventoryimages/hat_mprincess.xml"

 local hat_mphoenix = GLOBAL.Recipe( "hat_mphoenix", {princess, Ingredient("panflute", 1), Ingredient("goldnugget", 60), Ingredient("thulecite", 40) }, RECIPETABS.WAR, {SCIENCE=0})
	hat_mphoenix.atlas = "images/inventoryimages/hat_mphoenix.xml"


end

AddSimPostInit(function(inst)
        if inst.prefab == "musha" then
                mushaPostInit(inst)
        end
end)

--GetPlayer = GLOBAL.GetPlayer

table.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "musha")

local STRINGS = GLOBAL.STRINGS

-----------------------------
GLOBAL.STRINGS.CHARACTER_TITLES.musha = "musha"
GLOBAL.STRINGS.CHARACTER_NAMES.musha = "musha"
GLOBAL.STRINGS.CHARACTER_DESCRIPTIONS.musha = "musha"
GLOBAL.STRINGS.CHARACTER_QUOTES.musha = "\"A full belly is the mother of all happiness.\""

STRINGS.NAMES.MUSHA_EGG = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGG_CRACKED = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGGS1 = "Phoenix Egg(LV 2)"
STRINGS.NAMES.MUSHA_EGG_CRACKEDS1 = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGGS2 = "Phoenix Egg(LV 3)"
STRINGS.NAMES.MUSHA_EGG_CRACKEDS2 = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGGS3 = "Phoenix Egg(LV 4)"
STRINGS.NAMES.MUSHA_EGG_CRACKEDS3 = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGG1 = "Phoenix Egg(LV 5)"
STRINGS.NAMES.MUSHA_EGG_CRACKED1 = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGG2 = "Phoenix Egg(LV 6)"
STRINGS.NAMES.MUSHA_EGG_CRACKED2 = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGG3 = "Phoenix Egg(LV 7)"
STRINGS.NAMES.MUSHA_EGG_CRACKED3 = "Phoenix Egg"
STRINGS.NAMES.MUSHA_EGG8 = "Phoenix Egg(LV 8)"
STRINGS.NAMES.MUSHA_EGG_CRACKED8 = "Phoenix Egg"
--tent
STRINGS.NAMES.TENT_MUSHA = "Musha's Tent"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.TENT_MUSHA = "Home sweet home"
STRINGS.RECIPE_TENT_MUSHA = "Leaves Tent"
STRINGS.RECIPE_DESC.TENT_MUSHA = "Tent,Guard,Lantern"

STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKED = "I want to see you soon! (LV 1)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKEDS1 = "I want to see you soon! (LV 2)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKEDS2 = "I want to see you soon! (LV 3)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKEDS3 = "I want to see you soon! (LV 4)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKED1 = "I want to see you soon! (LV 5)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKED2 = "I want to see you soon! (LV 6)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKED3 = "I want to see you soon! (LV 7)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_EGG_CRACKED8 = "I want to see you soon! (LV 8)"


STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_SMALL = "Level [1] Next :EXP[1]\nBattle Command: (Z)\nAww, so cute!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TEEN = "Level [2] Next :EXP[20]\nBattle Command: (Z)\nHe's no longer a baby but still so cute!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TEENR1 = "Level [2] Next :EXP[20]\nBattle Command: (Z)\nHe's no longer a baby but still so cute!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TEENR2 = "Level [2] Next :EXP[20]\nBattle Command: (Z)\nHe's no longer a baby but still so cute!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TEENR3 = "Level [2] Next :EXP[20]\nBattle Command: (Z)\nHe's no longer a baby but still so cute!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TEENR4 = "Level [2] Next :EXP[20]\nBattle Command: (Z)\nHe's no longer a baby but still so cute!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TEENICE = "Level [2] Next :EXP[20]\nBattle Command: (Z)\nHe's no longer a baby but still so cute!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALL = "Level [3] Next :EXP[50]\nBattle Command: (Z)\nYeah! Healthy and growing"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLR1 = "Level [3] Next :EXP[50]\nBattle Command: (Z)\nYeah! Healthy and growing"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLR2 = "Level [3] Next :EXP[50]\nBattle Command: (Z)\nYeah! Healthy and growing"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLR3 = "Level [3] Next :EXP[50]\nBattle Command: (Z)\nYeah! Healthy and growing"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLR4 = "Level [3] Next :EXP[50]\nBattle Command: (Z)\nYeah! Healthy and growing"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRICE = "Level [3] Next :EXP[50]\nBattle Command: (Z)\nYeah! Healthy and growing"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALL2 = "Level [4] Next :EXP[100]\nBattle Command: (Z)\nHe looks big enough for battle.."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRR1 = "Level [4] Next :EXP[100]\nBattle Command: (Z)\nHe looks big enough for battle.."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRR2 = "Level [4] Next :EXP[100]\nBattle Command: (Z)\nHe looks big enough for battle.."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRR3 = "Level [4] Next :EXP[100]\nBattle Command: (Z)\nHe looks big enough for battle.."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRR4 = "Level [4] Next :EXP[100]\nBattle Command: (Z)\nHe looks big enough for battle.."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRR5 = "Level [4] Next :EXP[100]\nBattle Command: (Z)\nHe looks big enough for battle.."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRICE = "Level [4] Next :EXP[100]\nBattle Command: (Z)\nHe looks big enough for battle.."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALL3 = "Level [5] Next :EXP[300]\nBattle Command: (Z)\nMaybe his flame is pyrokinesis?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRR1 = "Level [5] Next :EXP[300]\nBattle Command: (Z)\nMaybe his flame is pyrokinesis?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRR2 = "Level [5] Next :EXP[300]\nBattle Command: (Z)\nMaybe his flame is pyrokinesis?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRR3 = "Level [5] Next :EXP[300]\nBattle Command: (Z)\nMaybe his flame is pyrokinesis?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRR4 = "Level [5] Next :EXP[300]\nBattle Command: (Z)\nMaybe his flame is pyrokinesis?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRR5 = "Level [5] Next :EXP[300]\nBattle Command: (Z)\nMaybe his flame is pyrokinesis?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRICE = "Level [5] Next :EXP[300]\nBattle Command: (Z)\nCoool Yamche!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALL4 = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRR1 = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRR2 = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRR3 = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRR4 = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRR5 = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRR6 = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRICE = "Level [6] Next :EXP[400]\nBattle Command: (Z)\nWow! Getting really, really big."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALL5 = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRR1 = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRR2 = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRR3 = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRR4 = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRR5 = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRR6 = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_TALLRRRRRICE = "Level [7] Next :EXP[500]\nBattle Command: (Z)\nHe's a powerful partner!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RP1 = "Level [8]\nBattle Command: (Z) \n I love you!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RP2 = "Level [8]\nBattle Command: (Z) \n I love you!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RP3 = "Level [8]\nBattle Command: (Z) \n I love you!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RP4 = "Level [8]\nBattle Command: (Z) \n I love you!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RP5 = "Level [8]\nBattle Command: (Z) \n I love you!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RP6 = "Level [8]\nBattle Command: (Z) \n I love you!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RP7 = "Level [8]\nBattle Command: (Z) \n I love you!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHA_RPICE = "Level [8]\nBattle Command: (Z) \n I love you!"

STRINGS.NAMES.GHOSTHOUND = "Ghost Hound"
STRINGS.NAMES.GHOSTHOUND2 = "Ghost Puppy"
STRINGS.NAMES.SHADOWMUSHA = "Musha's Shadow"
STRINGS.NAMES.TENTACLE_FROST = "Frozen tentacle"

STRINGS.RECIPE_DESC.MUSHA_EGG = "Summon Phoenix Egg"
STRINGS.RECIPE_DESC.MUSHA_EGGS1 = "2 level Egg. Fast hatch"
STRINGS.RECIPE_DESC.MUSHA_EGGS2 = "3 level Egg. Fast hatch"
STRINGS.RECIPE_DESC.MUSHA_EGGS3 = "4 level Egg. Fast hatch"
STRINGS.RECIPE_DESC.MUSHA_EGG1 = "5 level Egg. Fast hatch"
STRINGS.RECIPE_DESC.MUSHA_EGG2 = "6 level Egg. Fast hatch"
STRINGS.RECIPE_DESC.MUSHA_EGG3 = "7 level Egg. Fast hatch"
STRINGS.RECIPE_DESC.MUSHA_EGG8 = "8 level Egg."

STRINGS.RECIPE_DESC.REDGEM = "Craft Red gem"
STRINGS.RECIPE_DESC.BLUEGEM = "Craft Blue gem" 
STRINGS.RECIPE_DESC.ROCKS = "Look at gold as if it's a valueless stone" 
STRINGS.NAMES.ROCKS = "Rocks"

STRINGS.NAMES.REDGEM = "Red gem"
STRINGS.NAMES.REDGEM2 = "Red gem"
STRINGS.NAMES.BLUEGEM = "Blue gem" 
STRINGS.NAMES.BLUEGEM2 = "Blue gem" 

STRINGS.NAMES.MUSHASWORD_BASE = "Broken Blade"
STRINGS.NAMES.MUSHASWORD = "Phoenix Blade I"
STRINGS.NAMES.MUSHASWORD2 = "Phoenix Blade II"
STRINGS.NAMES.MUSHASWORD3 = "Phoenix Blade III"
STRINGS.NAMES.MUSHASWORD4 = "Phoenix Axe"
STRINGS.NAMES.MUSHASWORD_FROST = "Frost Phoenix Blade"

STRINGS.RECIPE_DESC.MUSHASWORD_BASE = "Broken Phoenix Blade, Speicial attack : ((R))"
STRINGS.RECIPE_DESC.MUSHASWORD = "Flame Attack(LV 1), Speicial attack : ((R))"
STRINGS.RECIPE_DESC.MUSHASWORD2 = "Flame Attack(LV 2),Speicial attack : ((R))"
STRINGS.RECIPE_DESC.MUSHASWORD3 = "Flame Attack(LV 3),Speicial attack : ((R))"
STRINGS.RECIPE_DESC.MUSHASWORD4 = "Flame Attack(LV 2),Speicial attack : ((R))"
STRINGS.RECIPE_DESC.MUSHASWORD_FROST = "Growable, Speicial attack : ((R))"

STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHASWORD_BASE = "Cool Blade!\nSpeicial attack : ((R))"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHASWORD_BASE = "Let's make again! \nSpeicial attack : ((R))"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHASWORD = "Not sharp.. but still fine blade \nSpeicial attack : ((R))"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHASWORD2 = "Sharp! Let's make lasagna ! \nSpeicial attack : ((R))"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHASWORD3 = "Strong like a Phoenix ! \nSpeicial attack : ((R))"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHASWORD4 = "Powerful Axe ! Powerful Musha! \nSpeicial attack : ((R))"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MUSHASWORD_FROST = "Grow up! my Blade! \nSpeicial attack : ((R))"

STRINGS.NAMES.MUSHA_FLUTE = "Phoenix Flute"
STRINGS.RECIPE_DESC.MUSHA_FLUTE = "Healing,Cure. Repair:Glow Dust"

STRINGS.NAMES.GLOWDUST = "Glow dust"
STRINGS.RECIPE_DESC.GLOWDUST = "Dust of light"

STRINGS.NAMES.CRISTAL = "Frozen Crystal"
STRINGS.RECIPE_DESC.CRISTAL = "Yamche => each level EGG"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.CRISTAL = "Twinkle crystal!"

STRINGS.NAMES.EXP = "Energy Essence"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.EXP = "This is [EXP] essence!"
STRINGS.NAMES.EXP1000CHEAT = "Cheat Essence"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.EXP1000CHEAT = "This is [Cheat] essence!"
STRINGS.RECIPE_DESC.EXP = "Energy essence, Repair to [Growable items]"
STRINGS.RECIPE_DESC.EXP10 = "Adds EXP 10"
STRINGS.RECIPE_DESC.EXP50 = "Adds EXP 50"
STRINGS.RECIPE_DESC.EXP100 = "Adds EXP 100"

STRINGS.NAMES.FROSTHAMMER = "Frost Hammer"
STRINGS.RECIPE_DESC.FROSTHAMMER = "Growable, icebox, Speicial attack : ((R))"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.FROSTHAMMER = "Big and beautiful royal arms. \nSpeicial attack : ((R))"

STRINGS.NAMES.FROSTBACK = "Frost Armor"
STRINGS.RECIPE_DESC.FROSTBACK = "Growable, ice box"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.FROSTBACK = "My favorite royal armor"


STRINGS.NAMES.BROKEN_FROSTHAMMER = "Frost Heart"
--STRINGS.NAMES.BROKEN = "Frost Heart"
STRINGS.RECIPE_DESC.BROKEN_FROSTHAMMER = "Growable, ice box"
--STRINGS.RECIPE_DESC.BROKEN = "Disassemble the Frost armor, Fridge"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.BROKEN_FROSTHAMMER = "Heart of frost butterfly"

STRINGS.NAMES.HAT_MPHOENIX = "Phoenix Helmet"
STRINGS.RECIPE_DESC.HAT_MPHOENIX = "Growable, Detachable mask(Right click)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.HAT_MPHOENIX = "The Return of the Queen !"
STRINGS.NAMES.HAT_MPRINCESS = "Puppy Princess Crown"
STRINGS.RECIPE_DESC.HAT_MPRINCESS = "Shield, ressurect item, Pink=>healing"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.HAT_MPRINCESS = "Long live the Princess!"
STRINGS.NAMES.HAT_MCROWN = "Puppy Queen Crown"
STRINGS.RECIPE_DESC.HAT_MCROWN = "Shield, Growable, Visual change(LV16)"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.HAT_MCROWN = "I am Puppy Queen!!"
STRINGS.NAMES.HAT_MBUNNY = "Bunny Scout Hat"
STRINGS.RECIPE_DESC.HAT_MBUNNY = "Growable, Detachable Gogle(Right click)"

STRINGS.CHARACTERS.GENERIC.DESCRIBE.HAT_MBUNNY = "Perfect for scouting"
STRINGS.NAMES.ARMOR_MUSHAA = "Musha's Armor"
STRINGS.RECIPE_DESC.ARMOR_MUSHAA = "Growable, Backpack"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.ARMOR_MUSHAA = "My old Friends."
STRINGS.NAMES.ARMOR_MUSHAB = "Princess Armor"
STRINGS.RECIPE_DESC.ARMOR_MUSHAB = "Growable, Freeze reflect, Special option"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.ARMOR_MUSHAB = "Perfect, my style" 

STRINGS.BABY=
{"Baby Yamche"}
STRINGS.PHOENIXS=
{
    --random
    "Yamche",
    "Brave Yamche",
    "Cuty Yamche",
    "Owl Yamche",
    "Sunny Yamche",
    "Moon Yamche",
    "Seoul Yamche",
    "Suri Yamche",
    "Vilja Yamche",
    "Sunny Yamche",
    "Sunnyholic",
    "Musha Yamche",
    "Mellisa Yamche",
    "Lidia Yamche ",
    "Battleborn Yamche ",
    "Grey Yamche",
    "Sky Yamche",
    "Lucia Yamche",
    "Khajit Yamche",
    "Pig Yamche",
    "Mjoll Yamche",
    "Lioness Yamche",
    "Muiri Yamche",
    "Ysolda Yamche",
    "Rayya Yamche",
    "Falkas Yamche",
    "Vilkas Yamche",
    "Aela Yamche",
    "Huter Yamche",
    "Huntress Yamche",
    "Queen Yamche",
    "Fire Yamche",
    "Cicero Yamche",
    "Top Yamche",
    "Lina Yamche",
    "Totoro Yamche",
    "Yu-na Yamche",
    "Winter Yamche",
    "White Yamche",
    "Mellisa Yamche",
    "Riften Yamche",
    "Dawnstar Yamche",
    "Windhelm Yamche",
    "Pho Yamche",
    "Sneaky Yamche",
    "Kiwis Yamche",
    "Coco Yamche",
    "Moon Yamche",
    "Pizza Yamche",
    "Sugar Yamche",
    "Orc Yamche",
    "Elf Yamche",
    "Knight Yamche",
    "Lich Yamche",
    "Azeroth Yamche",
    "Tauren Yamche",
    "Troll Yamche",
    "Thrall Yamche",
    "Narugar Yamche",
    "Yancook Yamche",
    "Tirano Yamche",
    "Honey Yamche",
    "Isis Yamche",
    "Bosom Yamche",
    "Esmeralda Yamche",
    "Pluvia Yamche",
	"Doraemon Yamche",
	"Dooly Yamche",
	"Apple Yamche",
	"IU Yamche",
    "Gandalf Yamche",
    "Frodo Yamche",
    "Sam Yamche",
    "Regolas Yamche",
    "Gimli Yamche",
    "Boromir Yamche",

	
    --Orizinal
    "Wilxon Yamche",
    "Willo Yamche",
    "Wolfkong Yamche",
    "Wenil Yamche",
    "WX79 Yamche",
    "Wickerbi Yamche",
    "Woorie Yamche",
    "Wex Yamche",
    "Maximus Yamche",
    "Wigfreedom Yamche",
    "Webbers Yamche",
}

------------------------------


ACTIONS.STAYORDER = GLOBAL.Action(2, true, true)
ACTIONS.STAYORDER.fn = function(act)
local targ = act.target
	if targ and targ.components.staycommand then
		act.doer.components.locomotor:Stop()
		act.doer.components.talker:Say(GLOBAL.GetString(act.doer.prefab, "ANNOUNCE_STAYORDER"))
		targ.components.combat:GiveUp()
		targ.components.staycommand:SetStaying(true)
		targ.components.staycommand:RememberStayPos("stayspot", GLOBAL.Point(targ.Transform:GetWorldPosition())) 
	return true
	end
end

ACTIONS.STAYORDER.str = STRINGS.ACTIONS.STAYORDER
ACTIONS.STAYORDER.id = "STAYORDER"
ACTIONS.STAYORDER_CANCEL = GLOBAL.Action(2, true, true)
ACTIONS.STAYORDER_CANCEL.fn = function(act)
	local targ = act.target
	if targ and targ.components.staycommand then
	act.doer.components.locomotor:Stop()
		act.doer.components.talker:Say(GLOBAL.GetString(act.doer.prefab, "ANNOUNCE_STAYORDER_CANCEL"))
		targ.components.staycommand:SetStaying(false)

		return true
	end
end

if Hide == "enable" then
ACTIONS.BLINK.str = STRINGS.ACTIONS.BLINK 
ACTIONS.BLINK.id = "BLINK"
ACTIONS.CASTSPELL.str = STRINGS.ACTIONS.CASTSPELL
ACTIONS.CASTSPELL.id = "CASTSPELL"

STRINGS.ACTIONS.BLINK = ""
STRINGS.ACTIONS.CASTSPELL = ""
end

ACTIONS.STAYORDER_CANCEL.str = STRINGS.ACTIONS.STAYORDER_CANCEL
ACTIONS.STAYORDER_CANCEL.id = "STAYORDER_CANCEL"

STRINGS.ACTIONS.STAYORDER = "Stay here"
STRINGS.ACTIONS.STAYORDER_CANCEL = "Follow me"
STRINGS.CHARACTERS.GENERIC.ANNOUNCE_STAYORDER = "Stay here."
STRINGS.CHARACTERS.GENERIC.ANNOUNCE_STAYORDER_CANCEL = "Follow me."


------working DIALOGUE---
STRINGS.CHARACTERS.MUSHA =require "speech_musha"
--STRINGS.CHARACTERS.MUSHA =require "speech_willow"


function arms(inst)
        inst:AddTag("arm")
end
AddPrefabPostInit("tentacle_pillar_arm", arms)


------------
AddMinimapAtlas("images/musha.xml")
AddMinimapAtlas("images/mushas.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg8.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_cracked8.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_cracked.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg1.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_cracked1.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg2.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_cracked2.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg3.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_cracked3.xml")
AddMinimapAtlas("images/inventoryimages/musha_eggs1.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_crackeds1.xml")
AddMinimapAtlas("images/inventoryimages/musha_eggs2.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_crackeds2.xml")
AddMinimapAtlas("images/inventoryimages/musha_eggs3.xml")
AddMinimapAtlas("images/inventoryimages/musha_egg_crackeds3.xml")
AddMinimapAtlas("images/inventoryimages/musha_small.xml")
AddMinimapAtlas("images/inventoryimages/musha_teen.xml")
AddMinimapAtlas("images/inventoryimages/musha_tall.xml")
AddMinimapAtlas("images/inventoryimages/frosthammer.xml")
AddMinimapAtlas("images/inventoryimages/frostback.xml")
AddMinimapAtlas("images/inventoryimages/broken_frosthammer.xml")
AddMinimapAtlas("images/inventoryimages/mushasword_base.xml")
AddMinimapAtlas("images/inventoryimages/mushasword.xml")
AddMinimapAtlas("images/inventoryimages/mushasword2.xml")
AddMinimapAtlas("images/inventoryimages/mushasword3.xml")
AddMinimapAtlas("images/inventoryimages/mushasword4.xml")
AddMinimapAtlas("images/inventoryimages/blade_f.xml")
AddMinimapAtlas("images/inventoryimages/blade_b.xml")
AddMinimapAtlas("images/inventoryimages/blade_1.xml")
AddMinimapAtlas("images/inventoryimages/blade_2.xml")
AddMinimapAtlas("images/inventoryimages/blade_3.xml")
AddMinimapAtlas("images/inventoryimages/blade_4.xml")
AddMinimapAtlas("images/inventoryimages/cristal.xml")
AddMinimapAtlas("images/inventoryimages/exp.xml")


----hold visual
----------------------------------------------
local function hold_visual(inst)
local inst = GLOBAL.GetPlayer()
if not inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and not inst.full_hold and not inst.normal_hold and not inst.berserk_hold and not inst.valkyrie_hold and not inst.hold_old1 and not inst.hold_old2 and not inst.hold_old3 and not inst.hold_old4 and not inst.hold_old5 and not inst.hold_old6 and not inst.hold_old7 and not inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[Full]")
inst.visual_hold = true

inst.full_hold = true
inst.normal_hold = false
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and not inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[Normal]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = false
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_normal")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and not inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[Valkyrie]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = false
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_battle")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and not inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[Berserk]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = false
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_hunger")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and not inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 1]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = false
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and not inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 2]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = false
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_normal_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and not inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 3]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = false
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_battle_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and not inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 4]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = false
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_hunger_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and not inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 5]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = false
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_full_p_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and not inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 6]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = false
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_normal_p_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and not inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 7]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = false
inst.AnimState:SetBuild("musha_battle_p_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and not inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - On] \nVisual:[old visual 8]")
inst.visual_hold = true
inst.full_hold = true
inst.normal_hold = true
inst.valkyrie_hold = true
inst.berserk_hold = true
inst.hold_old1 = true
inst.hold_old2 = true
inst.hold_old3 = true
inst.hold_old4 = true
inst.hold_old5 = true
inst.hold_old6 = true
inst.hold_old7 = true
inst.hold_old8 = true
inst.AnimState:SetBuild("musha_hunger_p_old")

elseif inst.visual_hold and not inst.components.health:IsDead() and not inst:HasTag("playerghost") and inst.full_hold and inst.normal_hold and inst.valkyrie_hold and inst.berserk_hold and inst.hold_old1 and inst.hold_old2 and inst.hold_old3 and inst.hold_old4 and inst.hold_old5 and inst.hold_old6 and inst.hold_old7 and inst.hold_old8 then
inst.components.talker:Say("[Visual Hold - Off] \nVisual:[Auto]")
inst.visual_hold = false
inst.full_hold = false
inst.normal_hold = false
inst.valkyrie_hold = false
inst.berserk_hold = false
inst.hold_old1 = false
inst.hold_old2 = false
inst.hold_old3 = false
inst.hold_old4 = false
inst.hold_old5 = false
inst.hold_old6 = false
inst.hold_old7 = false
inst.hold_old8 = false
end
inst.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)
inst.components.talker.fontsize = 26
 end 

if Hold == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		hold_visual()

	end
	end
end)
end
if Hold == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		hold_visual()
	end	end end) end

	if Hold == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		hold_visual()
	end	end end) end
	if Hold == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		hold_visual()
	end	end end) end
	if Hold == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		hold_visual()
	end	end end) end
	if Hold == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		hold_visual()
	end	end end) end
-----------collect stuffs

yamche2 = function() 
local inst = GLOBAL.GetPlayer()
local x,y,z = inst.Transform:GetWorldPosition()
local ents = TheSim:FindEntities(x,y,z, 25, {"yamche"})
for k,v in pairs(ents) do
if not v.sg:HasStateTag("open") then
if v:HasTag("baby") or v:HasTag("level1") and v.components.follower.leader and inst.components.leader:IsFollower(v) then 
inst.components.talker:Say("He is too small..")
end
if not v:HasTag("baby") and not v:HasTag("level1") and not v:HasTag("animals") and v.components.follower and v.components.follower.leader and inst.components.leader:IsFollower(v) and inst.components.leader:CountFollowers("yamche") > 1 then
inst.components.talker:Say("Hmm.. too many Yamche.\nmaybe He'll be confusing..")
end
if not v:HasTag("baby") and not v:HasTag("level1") and not v:HasTag("animals") and v.components.follower and v.components.follower.leader and inst.components.leader:IsFollower(v) and not inst.working and inst.components.leader:CountFollowers("yamche") == 1 then
inst.components.talker:Say("Yamche, Gathering stuffs.\n[Gathering]")
inst.working = true
v.pick1 = true
v.working_food = true
v.drop = false
v.yamche = true 
if not v:HasTag("animals") and not v:HasTag("baby") and not v:HasTag("level1") then
v.components.talker:Say("[Gethering Items]\nHungry-rate(x6)")
end
elseif not v:HasTag("baby")  and not v:HasTag("level1") and not v:HasTag("animals") and v.components.follower and v.components.follower.leader and inst.components.leader:IsFollower(v) and inst.working and inst.components.leader:CountFollowers("yamche") == 1 then
inst.components.talker:Say("Stop to gathering\n[Stop]")
inst.working = false
v.pick1 = false
v.working_food = false
v.drop = true
if not v:HasTag("animals")  and not v:HasTag("level1") and not v:HasTag("baby") then
v.components.talker:Say("[Rest]\nHungry-rate(x1)")
end end
end 
end
inst.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)

end

if Collect == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end
if Collect == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		yamche2()

	end
	end
end)
end

	if Collect == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		yamche2()
	end	end end) end
	if Collect == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		yamche2()
	end	end end) end
	if Collect == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		yamche2()
	end	end end) end
	if Collect == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		yamche2()
	end	end end) end
---------------
--level?
-- KEY_C
level_info = function() 
	local player = GLOBAL.GetPlayer()
	local inst = GLOBAL.GetPlayer()
local max_exp = 999997000
local level = math.min(inst.level, max_exp)
	local max_stamina = 100
	local min_stamina = 0
	local max_fatigue = 100
	local min_fatigue = 0	
	local max_music = 100
	local min_music = 0	
			local mx=math.floor(max_stamina-min_stamina)
			local cur=math.floor(inst.stamina-min_stamina)
			local mx2=math.floor(max_fatigue-min_fatigue)
			local cur2=math.floor(inst.fatigue-min_fatigue)
			local mxx=math.floor(max_music-min_music)
			local curr=math.floor(inst.music-min_music)
			sleep = ""..math.floor(cur*100/mx).."%"
			sleepy = ""..math.floor(cur2*100/mx2).."%"
			music = ""..math.floor(curr*100/mxx).."%"
inst.components.talker:Say("[Next: Level Up] [EXP]: ".. (inst.level) .."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
	player:AddTag("levelinfo") 
if inst.level <5 then
inst.components.talker:Say("Level 1 [EXP]: ".. (inst.level) .."/ 5".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=5 and inst.level <9  then
inst.components.talker:Say("Level 2 [EXP]: ".. (inst.level) .."/ 10".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=10 and inst.level <29  then
inst.components.talker:Say("Level 3 [EXP]: ".. (inst.level) .."/ 30".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=30 and inst.level <49  then
inst.components.talker:Say("Level 4 [EXP]: ".. (inst.level) .."/ 50".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=50 and inst.level <79  then
inst.components.talker:Say("Level 5 [EXP]: ".. (inst.level) .."/ 80".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=80 and inst.level <124  then
inst.components.talker:Say("Level 6 [EXP]: ".. (inst.level) .."/ 125".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=125 and inst.level <199  then
inst.components.talker:Say("Level 7 [EXP]: ".. (inst.level) .."/ 200".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=200 and inst.level <339  then
inst.components.talker:Say("Level 8 [EXP]: ".. (inst.level) .."/ 340".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=340 and inst.level <429  then
inst.components.talker:Say("Level 9 [EXP]: ".. (inst.level) .."/ 430".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=430 and inst.level <529  then
inst.components.talker:Say("Level 10 [EXP]: ".. (inst.level) .."/ 530".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=530 and inst.level <639  then
inst.components.talker:Say("Level 11 [EXP]: ".. (inst.level) .."/ 640".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=640 and inst.level <759  then
inst.components.talker:Say("Level 12 [EXP]: ".. (inst.level) .."/ 760".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=760 and inst.level <889  then
inst.components.talker:Say("Level 13 [EXP]: ".. (inst.level) .."/ 890".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=890 and inst.level <1029  then
inst.components.talker:Say("Level 14 [EXP]: ".. (inst.level) .."/ 1030".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=1030 and inst.level <1179  then
inst.components.talker:Say("Level 15 [EXP]: ".. (inst.level) .."/ 1180".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=1180 and inst.level <1339  then
inst.components.talker:Say("Level 16 [EXP]: ".. (inst.level) .."/ 1340".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=1340 and inst.level <1509  then
inst.components.talker:Say("Level 17 [EXP]: ".. (inst.level) .." 1510".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=1510 and inst.level <1689  then
inst.components.talker:Say("Level 18 [EXP]: ".. (inst.level) .."/ 1690".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=1690 and inst.level <1879  then
inst.components.talker:Say("Level 19 [EXP]: ".. (inst.level) .."/ 1880".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=1880 and inst.level <2079  then
inst.components.talker:Say("Level 20 [EXP]: ".. (inst.level) .."/ 2080".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=2080 and inst.level <2289  then
inst.components.talker:Say("Level 21 [EXP]: ".. (inst.level) .."/ 2289".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=2290 and inst.level <2499  then
inst.components.talker:Say("Level 22 [EXP]: ".. (inst.level) .."/ 2500".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=2500 and inst.level <2849  then
inst.components.talker:Say("Level 23 [EXP]: ".. (inst.level) .."/ 2850".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=2850 and inst.level <3199  then
inst.components.talker:Say("Level 24 [EXP]: ".. (inst.level) .."/ 3200".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=3200 and inst.level <3699  then
inst.components.talker:Say("Level 25 [EXP]: ".. (inst.level) .."/ 3700".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=3700 and inst.level <4199  then
inst.components.talker:Say("Level 26 [EXP]: ".. (inst.level) .."/ 4200".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=4200 and inst.level <4699  then
inst.components.talker:Say("Level 27 [EXP]: ".. (inst.level) .."/ 4700".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=4700 and inst.level <5499 then
inst.components.talker:Say("Level 28 [EXP]: ".. (inst.level) .."/ 5500".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=5500 and inst.level <6999 then
inst.components.talker:Say("Level 29 [EXP]: ".. (inst.level) .."/ 7000".."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
elseif inst.level >=7000  then
inst.components.talker:Say("Level 30 \n[MAX]\n Extra EXP ".. (inst.level -7000).."\n[Sleep]: "..(sleep).."   [Tired]: "..(sleepy).."\n[Performance]: "..(music))	
end
inst.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)
inst.components.talker.fontsize = 26
end

--config SKILL hotkey 
if LEVELS == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end
if LEVELS == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		level_info()

	end
	end
end)
end

	if LEVELS == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		level_info()
	end	end end) end
	if LEVELS == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		level_info()
	end	end end) end
	if LEVELS == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		level_info()
	end	end end) end
	if LEVELS == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		level_info()
	end	end end) end
	
---skill?
--default key = X
-----------
skill_info = function() 
	local player = GLOBAL.GetPlayer()
	local max_exp = 99997000
	local exp = math.min(player.level, max_exp)
	--player.components.talker:Say("[Next: Level Up] \n EXP ".. (player.level))
			if player.level >=0 and player.level <=4 then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]")
			elseif player.level >4 and player.level <10 then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nLightning Shield [1/4] \n\n")
			elseif player.level >10 and player.level <30  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nLightning Shield [1/4] \n\n")
			elseif player.level >=30 and player.level <50  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nLightning Shield [1/4] \nCritical Hit [1/4] \n\n")
			elseif player.level >=50 and player.level <80  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nLightning Shield [1/4] \nLightning Strike [1/2] \nCritical Hit [1/4] \n\n")
			elseif player.level >=80 and player.level <124  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nLightning Shield [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [1/4] \n\n")
			elseif player.level >=125 and player.level <200  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [1/4] \n\n")
			elseif player.level >=200 and player.level <340  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [1/4] \nFlame shield [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [1/4] \n\n")
			elseif player.level >=340 and player.level <430  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [1/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [1/4]\n\n")
			elseif player.level >=430 and player.level <530  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [1/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [1/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=530 and player.level <640  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [1/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [2/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=640 and player.level <760  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [1/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [3/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=760 and player.level <890  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [1/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=890 and player.level <1030  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [2/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=1030 and player.level <1180  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [3/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=1180 and player.level <1340  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[1/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=1340 and player.level <1510  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [1/4] \n\n")
			elseif player.level >=1510 and player.level <1690  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [2/4] \n\n")
			elseif player.level >=1690 and player.level <1880  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [3/4] \n\n")
			elseif player.level >=1880 and player.level <2080  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [1/4] \nRegenerate [1/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=2080 and player.level <2290  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [1/4] \nRegenerate [2/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=2290 and player.level <2500  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [1/4] \nRegenerate [3/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [1/3] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=2500 and player.level <2850  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [2/4] \nRegenerate [3/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [2/3] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=2850 and player.level <3200  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [3/4] \nRegenerate [3/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=3200 and player.level <3700  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [1/3]\nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [4/4] \nRegenerate [3/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [2/3] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=3700 and player.level <4200  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [2/3] \nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [4/4] \nRegenerate [3/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [2/3] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=4200 and player.level <4700  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [3/3] \nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [4/4] \nRegenerate [3/4] \nLesser cure[2/2] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [2/3] \nFreeze Hit [4/4] \n\n")
			elseif player.level >=4700 and player.level <5500 then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [3/3] \nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [4/4] \nRegenerate [3/4] \nLesser cure[2/2] \nShield [3/3] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [2/3] \nFreeze Hit [4/4] \nBerserk Armor [1/1] \n\n")
			elseif player.level >=5500 and player.level <7000 then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [3/3] \nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [4/4] \nRegenerate [4/4] \nLesser cure[2/2] \nShield [3/3] \nLightning Strike [1/2] \nCritical Hit [4/4] \nBackstab [2/3] \nFreeze Hit [4/4] \nBerserk Armor [1/1] \n\n")
			elseif player.level >=7000  then
	player.components.talker:Say("[Current Skill] \n\nSummon/Music [X]\nShield [3/3] \nValkyrie [V] \nBerserker [1/1] \nLightning Shield [4/4] \nFlame shield [4/4] \nRegenerate [4/4] \nLesser cure[2/2] \nShield [3/3] \nLightning Strike [2/2] \nCritical Hit [4/4] \nBackstab [3/3] \nFreeze Hit [4/4] \nBerserk Armor [1/1] \nShadow image [H] \n\n")
end
player.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)
player.components.talker.fontsize = 22
end

--config SKILL hotkey 
if SKILLS == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end
if SKILLS == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_info()

	end
	end
end)
end

	if SKILLS == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_info()
	end	end end) end
	if SKILLS == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_info()
	end	end end) end
	if SKILLS == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_info()
	end	end end) end
	if SKILLS == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_info()
	end	end end) end

----active skill -lightning

skill_lightning = function() 
local player = GLOBAL.GetPlayer()

if player.lightning_activate then
player.components.combat:SetRange(2)
player.Light:Enable(false)
 player:RemoveTag("lightningblue1")
 player:RemoveTag("lightningblue2")
 player:RemoveTag("frosta")
 player:RemoveTag("framea")
SpawnPrefab("sparks").Transform:SetPosition(player:GetPosition():Get())
player.AnimState:SetBloomEffectHandle( "" )
player.lightning_activate = false
 
	elseif player:HasTag("Valkyrieh") and player:HasTag("lightningo1") and not player:HasTag("lightningblue1") and not player:HasTag("frosthammer") and not player:HasTag("phoenixblade") and player.components.sanity.current >= 30 and not player.lightning_activate then
	player.components.talker:Say("[Lightning Strike]")
		player:AddTag("lightningblue1")
	player.components.combat:SetRange(9)
	player.Light:Enable(true)
player.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
player.Light:Enable(true)
player:RemoveTag("lightningo1") 
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")
player.lightning_activate = true

	elseif player:HasTag("Valkyrieh") and player:HasTag("lightningo2") and not player:HasTag("lightningblue2") and not player:HasTag("frosthammer") and not player:HasTag("phoenixblade") and player.components.sanity.current >= 30 and not player.lightning_activate then

	player.components.talker:Say("[Lightning Strike]")
		player:AddTag("lightningblue2")
	player.components.combat:SetRange(9)
	player.Light:Enable(true)
player.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
player.Light:Enable(true)
player:RemoveTag("lightningo2") 
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")
player.lightning_activate = true
----
	elseif player:HasTag("Valkyrieh") and player:HasTag("lightningo1") and not player:HasTag("lightningblue1") and player:HasTag("frosthammer") and not player:HasTag("frosta") and player.components.sanity.current >= 30 and not player.lightning_activate then
	player.components.talker:Say("[Lightning-Frost Strike]")
		player:AddTag("lightningblue1")
		player:AddTag("frosta")
	player.components.combat:SetRange(9)
	player.Light:Enable(true)
player.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
player.Light:Enable(true)
player:RemoveTag("lightningo2") 
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")
player.lightning_activate = true

	elseif player:HasTag("Valkyrieh") and player:HasTag("lightningo2") and not player:HasTag("lightningblue2") and player:HasTag("frosthammer") and not player:HasTag("frosta") and player.components.sanity.current >= 30 and not player.lightning_activate then
	player.components.talker:Say("[Lightning-Frost Strike]")
		player:AddTag("lightningblue2")
		player:AddTag("frosta")
	player.components.combat:SetRange(9)
	player.Light:Enable(true)
player.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
player.Light:Enable(true)
player:RemoveTag("lightningo2") 
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")

player.lightning_activate = true
----
	elseif player:HasTag("Valkyrieh") and player:HasTag("lightningo1") and not player:HasTag("lightningblue1") and player:HasTag("phoenixblade") and not player:HasTag("framea") and player.components.sanity.current >= 30 and not player.lightning_activate then
	player.components.talker:Say("[Lightning-Flame Strike]")
		player:AddTag("lightningblue1")
		player:AddTag("framea")
	player.components.combat:SetRange(9)
	player.Light:Enable(true)
player.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
player:RemoveTag("lightningo2") 
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")
player.lightning_activate = true

	elseif player:HasTag("Valkyrieh") and player:HasTag("lightningo2") and not player:HasTag("lightningblue2") and player:HasTag("phoenixblade") and not player:HasTag("framea") and player.components.sanity.current >= 30 and not player.lightning_activate then
	player.components.talker:Say("[Lightning-Flame Strike]")
		player:AddTag("lightningblue2")
		player:AddTag("framea")
	player.components.combat:SetRange(9)
	player.Light:Enable(true)
player.AnimState:SetBloomEffectHandle( "shaders/anim.ksh" )
player:RemoveTag("lightningo2") 
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")
player.lightning_activate = true
----
	elseif player:HasTag("Valkyrieh") and player.components.sanity.current < 30 and not player.lightning_activate then
	player.components.talker:Say("Not enough [Sanity] !")

	elseif player:HasTag("Valkyrieh") and not player:HasTag("lightningo1") and not player:HasTag("lightningblue1") and not player:HasTag("lightningo2") and not player:HasTag("lightningblue2") and not player.lightning_activate then
	player.components.talker:Say("Not enough Lightning power..")

	elseif not player:HasTag("Valkyrieh") and not player:HasTag("frosthammer") and not player:HasTag("phoenixblade") and not player.lightning_activate then
	player.components.talker:Say("[Lightning Strike] can be used only in Valkyrie moods..")

------
elseif player:HasTag("frosthammer") and not player:HasTag("frosta") and not player:HasTag("Valkyrieh") and player.components.sanity.current > 20 and not player.lightning_activate then
		player:AddTag("frosta")
	player.components.talker:Say("Frost Power!!")
SpawnPrefab("sparks").Transform:SetPosition(player:GetPosition():Get())
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")
player.lightning_activate = true
elseif player:HasTag("frosthammer") and not player:HasTag("frosta") and not player:HasTag("Valkyrieh") and player.components.sanity.current < 20 and not player.lightning_activate then
	player.components.talker:Say("Not enough [sanity]..")

------
elseif player:HasTag("phoenixblade") and not player:HasTag("framea") and not player:HasTag("Valkyrieh") and player.components.sanity.current > 20 and not player.lightning_activate then
		player:AddTag("framea")
	player.components.talker:Say("Flame Power!!")
SpawnPrefab("sparks").Transform:SetPosition(player:GetPosition():Get())
player.SoundEmitter:PlaySound("dontstarve/maxwell/shadowmax_appear")
player.lightning_activate = true
elseif player:HasTag("phoenixblade") and not player:HasTag("framea") and not player:HasTag("Valkyrieh") and player.components.sanity.current < 20 and not player.lightning_activate then
	player.components.talker:Say("Not enough [sanity]..")

end
player.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)
end 


--config SPECIAL ATTACK hotkey 
if LIGHTNING == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end
if LIGHTNING == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_lightning()

	end
	end
end)
end

	if LIGHTNING == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_lightning()
	end	end end) end
	if LIGHTNING == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_lightning()
	end	end end) end
	if LIGHTNING == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_lightning()
	end	end end) end
	if LIGHTNING == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_lightning()
	end	end end) end

----active skill -shield
--default key = T

skill_cure = function() 
	local player = GLOBAL.GetPlayer()

if player:HasTag("cure0") and not player:HasTag("cure1") and not player:HasTag("cure2") and player:HasTag("cureoo0") and not player:HasTag("shieldon") and not player.components.health:IsDead() then

	--player.components.talker:Say("Activate [Shield]")
		player:AddTag("cureo0")
		player:AddTag("frameon1")
		player:AddTag("frameon2")
		player:AddTag("frameon3")
		player:AddTag("frameon4")

elseif player:HasTag("cure1") and not player:HasTag("cure0") and not player:HasTag("cure2") and player:HasTag("cureoo1") and not player:HasTag("shieldon") and not player.components.health:IsDead() then

	--player.components.talker:Say("Activate [Shield]")
		player:AddTag("cureo1")
		player:AddTag("frameon1")
		player:AddTag("frameon2")
		player:AddTag("frameon3")
		player:AddTag("frameon4")

elseif player:HasTag("cure2") and not player:HasTag("cure0") and not player:HasTag("cure1") and player:HasTag("cureoo2") and not player:HasTag("shieldon") and not player.components.health:IsDead() then

	--player.components.talker:Say("Activate [Shield]")
		player:AddTag("cureo2")
		player:AddTag("frameon1")
		player:AddTag("frameon2")
		player:AddTag("frameon3")
		player:AddTag("frameon4")

elseif player:HasTag("cure0") and not player:HasTag("cure1") and not player:HasTag("cure2") and not player:HasTag("cureoo0") then
	player.components.talker:Say("Not enough Shield energy..")
elseif player:HasTag("cure1") and not player:HasTag("cure0") and not player:HasTag("cure2") and not player:HasTag("cureoo1") then
	player.components.talker:Say("Not enough Shield energy..")
elseif player:HasTag("cure2") and not player:HasTag("cure0") and not player:HasTag("cure1") and not player:HasTag("cureoo2") then
	player.components.talker:Say("Not enough Shield energy..")

elseif player:HasTag("shieldon") then
	player.components.talker:Say("Shield is ready!")

elseif not player:HasTag("cure0") and not player:HasTag("cure1") and not player:HasTag("cure2")  then
	player.components.talker:Say("Musha dosn't know that ability..")

end
if player:HasTag("cureo0") or player:HasTag("cureo1") or player:HasTag("cureo2") and not player.components.health:IsDead() then
	if player:HasTag("hpregen1") then
	player.components.health:StartRegen(1, 0.5)

	elseif player:HasTag("hpregen2") then
	player.components.health:StartRegen(1, 0.25)

	elseif player:HasTag("hpregen3") then
	player.components.health:StartRegen(2, 0.25)

	elseif player:HasTag("hpregen4") then
	player.components.health:StartRegen(3, 0.25)

end
end
end

--config SHIELD hotkey 
if SHIELD == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end
if SHIELD == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_cure()

	end
	end
end)
end

	if SHIELD == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_cure()
	end	end end) end
	if SHIELD == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_cure()
	end	end end) end
	if SHIELD == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_cure()
	end	end end) end
	if SHIELD == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_cure()
	end	end end) end
----active skill -Valkyrie
--default key = V

skill_valkyrie = function() 
	local player = GLOBAL.GetPlayer()
if player.stamina <=0 then	
	player.components.talker:Say("Musha needs more sleep!")
elseif player.stamina >0 then
if player:HasTag("valkyrie") and not player:HasTag("valkyrieh") and not player:HasTag("berserks") and not player:HasTag("fberserk") then
		player:AddTag("Valkyrieh")
		player:RemoveTag("Valkyriech2")
		--player.components.talker:Say("Valkyrie for Battle !!")

elseif player:HasTag("valkyrie") and player:HasTag("valkyrieh") and not player:HasTag("berserks") and not player:HasTag("fberserk") then
		player:AddTag("Valkyriech2")
		player:RemoveTag("Valkyrieh")
	------------------	

if player:HasTag("backstab1")  and player:HasTag("sneaka") then
		player:RemoveTag("sneaka")
  player:RemoveTag("hide")
        player:RemoveTag("notarget")
	player.components.talker:Say("Unhide !")
	player.components.colourtweener:StartTween({1,1,1,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
         player.components.sanity:DoDelta(80)

elseif player:HasTag("backstab2") and player:HasTag("sneaka") then
		player:RemoveTag("sneaka")
        player:RemoveTag("notarget")
	player.components.talker:Say("Unhide !")
	player.components.colourtweener:StartTween({1,1,1,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
         player.components.sanity:DoDelta(160)

elseif player:HasTag("backstab3")  and player:HasTag("sneaka") then
		player:RemoveTag("sneaka")
        player:RemoveTag("notarget")
	player.components.talker:Say("Unhide !")
	player.components.colourtweener:StartTween({1,1,1,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
         player.components.sanity:DoDelta(240)
end
			
-----------------------
		--player.components.talker:Say("")

elseif not player:HasTag("valkyrie") then
		player:RemoveTag("Valkyrieh")
	player.components.talker:Say("Musha dosn't know these feelings..")
elseif player:HasTag("berserks") and not player:HasTag("fberserk") then
	player.components.talker:Say("Krrrrrr..?")
		player:RemoveTag("Valkyrieh")
elseif player:HasTag("fberserk") and not player:HasTag("berserks") then
	player.components.talker:Say("Grrrrrr..?")
		player:RemoveTag("Valkyrieh")

end
end end


--config Valkyrie hotkey 
if VALKYRIE == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
if VALKYRIE == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_valkyrie()

	end
	end
end)
end
	if VALKYRIE == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_valkyrie()
	end	end end) end
	if VALKYRIE == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_valkyrie()
	end	end end) end
	if VALKYRIE == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_valkyrie()
	end	end end) end
	if VALKYRIE == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_valkyrie()
	end	end end) end
-----sleep

local AlwaysOnStatus = 0
for _, moddir in ipairs(GLOBAL.KnownModIndex:GetModsToLoad()) do
    if GLOBAL.KnownModIndex:GetModInfo(moddir).name == "Always On Status" then
		AlwaysOnStatus = 1
   end end
   
local SeasonClock = 0
for _, moddir in ipairs(GLOBAL.KnownModIndex:GetModsToLoad()) do
    if GLOBAL.KnownModIndex:GetModInfo(moddir).name == "Season Clock" then
		SeasonClock = 1
   end end
   
local REIGN_OF_GIANTS = 0
 if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then  
		REIGN_OF_GIANTS = 1
end 

local CAPY = 0
 if GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) then  
		CAPY = 1
end 

AddClassPostConstruct("widgets/badge", function(self)

local player = GLOBAL.GetPlayer()
if player:HasTag("musha") then
	self:SetScale(.9,.9,.9)
	self.st = self:AddChild(Image("images/status_stamina.xml", "status_stamina.tex"))
	self.st:SetScale(0,.44,0)
	self.st:SetPosition(-.5,-40,0)

	self.num:SetFont(GLOBAL.NUMBERFONT)
	self.num:SetSize(28)
	
	self.num:MoveToFront()
	self.num:Show()

	self.maxnum = self:AddChild(Text(GLOBAL.NUMBERFONT, 33))
    self.maxnum:SetPosition(6, 0, 0)
	self.maxnum:MoveToFront()
    self.maxnum:Hide()
	
	local OldOnGainFocus = self.OnGainFocus
	function self:OnGainFocus()
		OldOnGainFocus(self)
		self.maxnum:Show()
	end

	local OldOnLoseFocus = self.OnLoseFocus
	function self:OnLoseFocus()
		OldOnLoseFocus(self)
		self.maxnum:Hide()
		self.num:Show()
	end

if AlwaysOnStatus == 0 then	
self.num:SetPosition(5, 0, 0)
	self.num:SetScale(1,1,0)

if REIGN_OF_GIANTS == 1 or CAPY == 1 then		
	-- for health/hunger/sanity/beaverness
	local OldSetPercent = self.SetPercent
	if OldSetPercent then
		function self:SetPercent(val, max, ...)
			self.maxnum:SetString(tostring(math.ceil(max or 100)))
			OldSetPercent(self, val, max, ...)
		end
	end
	
	-- for moisture
	local OldSetValue = self.SetValue
	if OldSetValue then
		function self:SetValue(val, max, ...)
			self.maxnum:SetString(tostring(math.ceil(max)))
			OldSetValue(self, val, max, ...)
	end end end end end
end)

AddClassPostConstruct("widgets/statusdisplays",function(self,inst)
local player = GLOBAL.GetPlayer()
if player:HasTag("musha") then
		self.staminab = self:AddChild(Badge("status_stamina", self.owner))
		self.staminab.st:SetScale(0.85, 0.78, 1)
		self.staminab.num:SetScale(0.9, .7, 1)
		self.staminab.num:SetPosition(0, -18, 0)
if AlwaysOnStatus == 0 and SeasonClock == 0 then
	self.staminab:SetPosition(-78, -30, 0)
elseif AlwaysOnStatus == 1 and SeasonClock == 0 then	
	self.staminab:SetPosition(-78, -65, 0)
elseif AlwaysOnStatus == 1 and SeasonClock == 1 then
	self.staminab:SetPosition(20, -85, 0)
elseif AlwaysOnStatus == 0 and SeasonClock == 1 then
	self.staminab:SetPosition(20, -85, 0)	
	end
	--------
	local function Updatesleep(sleepbadge)
	local player = GLOBAL.GetPlayer()
	
	local max_stamina = 100
	local min_stamina = 0
	local max_fatigue = 100
	local min_fatigue = 0	
	local max_music = 100
	local min_music = 0	
			local mx=math.floor(max_stamina-min_stamina)
			local cur=math.floor(inst.stamina-min_stamina)
			local mx2=math.floor(max_fatigue-min_fatigue)
			local cur2=math.floor(inst.fatigue-min_fatigue)
			local mxx=math.floor(max_music-min_music)
			local curr=math.floor(inst.music-min_music)
			sleep = ""..math.floor(cur*100/mx).."%"
			sleepy = ""..math.floor(cur2*100/mx2).."%"
			music = ""..math.floor(curr*100/mxx).."%"
			----------
			----------
--[[local max_stamina = 100
	local max_fatigue = 100
	self.stamina = math.min(inst.stamina, max_stamina)
	self.fatigue = math.min(inst.fatigue, max_fatigue)]]
	
	if sleepbadge == nil then
		sleepbadge = self.staminab.focus
			end
	----		
	if sleepbadge then 

			--self.staminab.num:SetString("Tired\n" .. sleepy)
			self.staminab.num:SetString("Music\n".. music)
		else 
		
			self.staminab.num:SetString("Sleep/Tired\n" .. sleep .."/ " .. sleepy)
		
		end
		end
	self.Updatesleep = self.inst:DoPeriodicTask(0, function() Updatesleep() end)

	end	
	end)

--not TheWorld.state.isday
sleeping_princess = function()
local inst = GLOBAL.GetPlayer()
--[[ if not inst:HasTag("sleep_on") and not GLOBAL.GetClock():IsDay() then
inst.sg:AddStateTag("busy")
inst.components.locomotor:Stop()
inst.sg:GoToState("bedroll")
inst.components.playercontroller:Enable(false)
inst:DoTaskInTime(3, function() inst:AddTag("sleep_on") inst.components.playercontroller:Enable(true) end)
end 
if not inst:HasTag("sleep_on") and inst.stamina >=70 and not GLOBAL.GetClock():IsDay() then
inst.components.talker:Say("Musha always sleepy..")
elseif not inst:HasTag("sleep_on") and inst.stamina < 70 and inst.stamina >=25 then
inst.components.talker:Say("Musha many tired..")
elseif not inst:HasTag("sleep_on") and inst.stamina < 25 and inst.stamina >=5 then
inst.components.talker:Say("Musha fell asleep forever..")
elseif not inst:HasTag("sleep_on") and inst.stamina < 5 then
inst.components.talker:Say("Musha, almost died..")
end
]]
--[[if inst.music >= 100 and not inst:HasTag("music_check") and not inst:HasTag("switlight") then
inst:AddTag("switlight")
inst.music_armor = true
   inst:DoTaskInTime(3, function() inst.music_armor = false  inst:AddTag("switlight") inst.components.talker:Say("Musha Ready to [Music]\n(X)key")
   inst.sg:GoToState("play_flute") 
   inst.SoundEmitter:PlaySound("dontstarve/wilson/onemanband") inst.components.playercontroller:Enable(true) end)]]
   
if inst:HasTag("music_check")  then
inst.music_armor = true
 inst:RemoveTag("sleep_on")
  inst:RemoveTag("sleep_in")
  inst:RemoveTag("bedrolll")
  inst:RemoveTag("music_check")
   inst.sg:GoToState("wakeup")
   inst:DoTaskInTime(3, function() inst.music_armor = false inst:AddTag("switlight") inst.components.talker:Say("Musha Ready to [Music]\n(X)key")
   inst.sg:GoToState("play_flute") 
   inst.SoundEmitter:PlaySound("dontstarve/wilson/onemanband") inst.components.playercontroller:Enable(true) end)
   
elseif GLOBAL.GetClock():IsDay() and not inst:HasTag("sleep_in") and not inst:HasTag("sleep_on") and inst.stamina > 70 and not inst.sleep_no and not inst:HasTag("music_check") and not (inst.sg:HasStateTag("moving") or inst.sg:HasStateTag("attack") or inst.sg:HasStateTag("chopping") or inst.sg:HasStateTag("mining") or  inst.sg:HasStateTag("hammering") or inst.sg:HasStateTag("digging") or inst.sg:HasStateTag("netting") or inst.sg:HasStateTag("fishing")) then
local random1 = 0.2
  inst:RemoveTag("sleep_on")
  inst:RemoveTag("sleep_in")
  inst:RemoveTag("bedrolll")

if math.random() < random1 then
inst.components.talker:Say("Hello Sunny?")
elseif math.random() < random1 then
inst.components.talker:Say("Musha not sleeping")
elseif math.random() < random1 then
inst.components.talker:Say("Too bright..")
elseif math.random() < random1 then
inst.components.talker:Say("Wake up Musha.")
elseif math.random() < 1 then
inst.components.talker:Say("Sleep? no..")
end
elseif GLOBAL.GetClock():IsDay() and not inst:HasTag("sleep_in") and not inst:HasTag("sleep_on") and inst.stamina <= 70 and not inst.sleep_no and not inst:HasTag("music_check") and not (inst.sg:HasStateTag("moving") or inst.sg:HasStateTag("attack") or inst.sg:HasStateTag("chopping") or inst.sg:HasStateTag("mining") or  inst.sg:HasStateTag("hammering") or inst.sg:HasStateTag("digging") or inst.sg:HasStateTag("netting") or inst.sg:HasStateTag("fishing")) then
inst.components.playercontroller:Enable(false)
inst.sg:AddStateTag("busy")
inst:AddTag("bedrolll")
inst:AddTag("sleep_on")
GLOBAL.GetPlayer().AnimState:OverrideSymbol("swap_bedroll", "swap_bedroll_straw", "bedroll_straw")
inst.AnimState:PlayAnimation("bedroll")
inst:DoPeriodicTask(0, function() if inst:HasTag("bedrolll") then
inst.components.locomotor:Stop()
inst.sg:AddStateTag("busy") end end)
inst:DoTaskInTime(3, function()  inst:AddTag("sleep_in") end)
elseif GLOBAL.GetClock():IsDusk() and not inst:HasTag("sleep_in") and not inst:HasTag("sleep_on") and not inst.sleep_no and not (inst.sg:HasStateTag("moving") or inst.sg:HasStateTag("attack") or inst.sg:HasStateTag("chopping") or inst.sg:HasStateTag("mining") or  inst.sg:HasStateTag("hammering") or inst.sg:HasStateTag("digging") or inst.sg:HasStateTag("netting") or inst.sg:HasStateTag("fishing")) then
inst.components.playercontroller:Enable(false)
inst.sg:AddStateTag("busy")
inst:AddTag("bedrolll")
inst:AddTag("sleep_on")
inst.components.locomotor:Stop()
--inst.sg:GoToState("bedroll")
inst.AnimState:PlayAnimation("bedroll")
GLOBAL.GetPlayer().AnimState:OverrideSymbol("swap_bedroll", "swap_bedroll_straw", "bedroll_straw")
inst:DoPeriodicTask(0, function() if inst:HasTag("bedrolll") then
inst.components.locomotor:Stop()
inst.sg:AddStateTag("busy") end end)
inst:DoTaskInTime(3, function()  inst:AddTag("sleep_in") end)
elseif GLOBAL.GetClock():IsNight() and not inst:HasTag("sleep_in") and not inst:HasTag("sleep_on") and not inst.sleep_no and (inst.warm_on or inst.warm_tent)  and not (inst.sg:HasStateTag("moving") or inst.sg:HasStateTag("attack") or inst.sg:HasStateTag("chopping") or inst.sg:HasStateTag("mining") or  inst.sg:HasStateTag("hammering") or inst.sg:HasStateTag("digging") or inst.sg:HasStateTag("netting") or inst.sg:HasStateTag("fishing")) then
inst.components.playercontroller:Enable(false)
inst.sg:AddStateTag("busy")
inst:AddTag("bedrolll")
inst:AddTag("sleep_on")
inst.components.locomotor:Stop()
--inst.sg:GoToState("bedroll")
inst.AnimState:PlayAnimation("bedroll")
GLOBAL.GetPlayer().AnimState:OverrideSymbol("swap_bedroll", "swap_bedroll_straw", "bedroll_straw")
inst:DoPeriodicTask(0, function() if inst:HasTag("bedrolll") then
inst.components.locomotor:Stop()
inst.sg:AddStateTag("busy") end end)
inst:DoTaskInTime(3, function()  inst:AddTag("sleep_in") end)
elseif GLOBAL.GetClock():IsNight() and not inst:HasTag("sleep_in") and not inst:HasTag("sleep_on") and not inst.sleep_no and not inst.warm_on then
local random1 = 0.2
  inst:RemoveTag("sleep_on")
  inst:RemoveTag("sleep_in")
  inst:RemoveTag("bedrolll")
if math.random() < random1 then
inst.components.talker:Say("Too dark..")
elseif math.random() < random1 then
inst.components.talker:Say("More light !")
elseif math.random() < random1 then
inst.components.talker:Say("Darkness too danger..")
elseif math.random() < random1 then
inst.components.talker:Say("Musha must find fire !")
elseif math.random() < 1 then
inst.components.talker:Say("Musha need fire !")
end
elseif inst:HasTag("sleep_in") and not inst:HasTag("music_check")  then
  inst:RemoveTag("sleep_on")
  inst:RemoveTag("sleep_in")
  inst:RemoveTag("bedrolll")
   inst.sg:GoToState("wakeup")
   inst:DoTaskInTime(3, function() inst.components.playercontroller:Enable(true) end)
elseif not inst:HasTag("sleep_in") and inst.sleep_no and not inst:HasTag("music_check")  then
local random1 = 0.2
local random2 = 1
if math.random() < random1 then
inst.components.talker:Say("Smells something danger.")
elseif math.random() < random1 then
inst.components.talker:Say("Musha feels Something wrong..")
elseif math.random() < random1 then
inst.components.talker:Say("This place is not my tomb.")
elseif math.random() < random1 then
inst.components.talker:Say("Wake up Musha. you can do it!")
elseif math.random() < random1 then
inst.components.talker:Say("Fight or Run !")
elseif math.random() < 1 then
inst.components.talker:Say("No! wake up!")
end
end end

--config yamche hotkey 
if Sleeprincess == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end
if Sleeprincess == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		sleeping_princess()

	end
	end
end)
end

	if Sleeprincess == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		sleeping_princess()
	end	end end) end
	if Sleeprincess == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		sleeping_princess()
	end	end end) end
	if Sleeprincess == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		sleeping_princess()
	end	end end) end
	if Sleeprincess == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		sleeping_princess()
	end	end end) end

----active battle command yamche 
follow_yamche = function() 
	local player = GLOBAL.GetPlayer()
local x,y,z = player.Transform:GetWorldPosition()
local ents = TheSim:FindEntities(x,y,z, 30, {"yamcheb"})
for k,v in pairs(ents) do
		
if v.components.follower and v.components.follower.leader and player.components.leader:IsFollower(v) and not v.peace and not v.active_hunt and not v.defense and not player:HasTag("berserks") and not player:HasTag("fberserk") then
player.components.talker:Say("Yamche, Lets hunt begin!")
if v:HasTag("yamche") then
v.components.talker:Say("[Aggrasive]:Armor [40%]")
elseif v:HasTag("ghosthound") then
v.components.talker:Say("[Aggrasive]\nArmor:15")
end
v.yamche = true 
v.peace = false
v.active_hunt = true
v.defense = false

elseif v.components.follower and v.components.follower.leader and player.components.leader:IsFollower(v) and not v.peace and v.active_hunt and not v.defense and player.components.leader:IsFollower(v) and not player:HasTag("berserks") and not player:HasTag("fberserk") then
player.components.talker:Say("Yamche, Avoid battle!")
if v:HasTag("yamche") then
v.components.talker:Say("[Avoidance]:Armor [95%]")
elseif v:HasTag("ghosthound") then
v.components.talker:Say("[Avoidance]\nArmor:60")
end
v.yamche = true 
v.peace = true
v.active_hunt = false
v.defense = true

elseif v.components.follower and v.components.follower.leader and player.components.leader:IsFollower(v) and v.peace and not v.active_hunt and v.defense and player.components.leader:IsFollower(v) and not player:HasTag("berserks") and not player:HasTag("fberserk") then
player.components.talker:Say("Yamche, Protect me!")
if v:HasTag("yamche") then
v.components.talker:Say("[Defensive]:Armor [60%]")
elseif v:HasTag("ghosthound") then
v.components.talker:Say("[Defensive]\nArmor:30")
end
v.yamche = true 
v.peace = false
v.active_hunt = false
v.defense = false

elseif v.components.follower and v.components.follower.leader and player.components.leader:IsFollower(v) and player:HasTag("berserks") then
player.components.talker:Say("Back off!, Krrr !")
v.components.talker:Say("[Avoidance]\nArmor:95")
v.yamche = true 
v.peace = true
v.active_hunt = false
v.defense = true

elseif v.components.follower and v.components.follower.leader and player.components.leader:IsFollower(v) and player:HasTag("ferserk") then
player.components.talker:Say("Back off!, Krrr !")
v.components.talker:Say("[Avoidance]\nArmor:95")
v.yamche = true 
v.peace = true
v.active_hunt = false
v.defense = true
end
end 
player.components.talker.fontsize = 28
player.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)
end		


--config yamche hotkey 
if YAMCHO == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end
if YAMCHO == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		follow_yamche()

	end
	end
end)
end

	if YAMCHO == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		follow_yamche()
	end	end end) end
	if YAMCHO == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		follow_yamche()
	end	end end) end
	if YAMCHO == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		follow_yamche()
	end	end end) end
	if YAMCHO == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		follow_yamche()
	end	end end) end
	
----active shadows skill
--default key = H


local function InShadow(inst, data)
local player = GLOBAL.GetPlayer()
local x,y,z = player.Transform:GetWorldPosition()	
local ents = TheSim:FindEntities(x, y, z, 20)
for k,v in pairs(ents) do

if v.components.combat and v.components.combat.target == player and not v:HasTag("") then
		v.components.combat.target = nil 
end end
end 

skill_shadow= function() 
	local player = GLOBAL.GetPlayer()
    if player.level >= 7003 and not player:HasTag("valkyrieh") and player.components.sanity:GetMaxSanity() >= 50 and player.components.health.currenthealth >= 40 and player:HasTag("shadowb") and not player:HasTag("shadows") then
		player:AddTag("shadows")
		player.components.talker:Say("Shadow image! \n[EXP](-2)")

elseif player.level < 7003 and not player:HasTag("valkyrieh") and player.components.sanity:GetMaxSanity() >= 50 and player:HasTag("shadowb") then
	player.components.talker:Say("not enough [EXP]..")

elseif player.level >= 7003 and not player:HasTag("valkyrieh") and player.components.sanity:GetMaxSanity() < 50 and player.components.health.currenthealth >= 40 and player:HasTag("shadowb") then
	player.components.talker:Say("not enough [Sanity]..")

elseif player.level >= 7003 and not player:HasTag("valkyrieh") and player.components.sanity:GetMaxSanity() > 50 and player.components.health.currenthealth < 40 and player:HasTag("shadowb") then
	player.components.talker:Say("not enough [Health]..")

elseif not player:HasTag("valkyrieh") and not player:HasTag("shadowb") then
	player.components.talker:Say("(Shadow image) unlock to level 30")

--backstab
	elseif not player:HasTag("backstab1") and not player:HasTag("backstab2") and not player:HasTag("backstab3") then
	player.components.talker:Say("[Backstab](1/3) is unlock to level 10")
	elseif player:HasTag("backstab1") and not player:HasTag("sneaka") and player.components.sanity.current <= 80 then
	player.components.talker:Say("Not enough [Sanity]..")
	elseif player:HasTag("backstab2") and not player:HasTag("sneaka") and player.components.sanity.current <= 160 then
	player.components.talker:Say("Not enough [Sanity]..")
	elseif player:HasTag("backstab3") and not player:HasTag("sneaka") and player.components.sanity.current <= 240 then
	player.components.talker:Say("Not enough [Sanity]..")

elseif player:HasTag("valkyrieh") and player:HasTag("backstab1") and not player:HasTag("sneaka") and not player.sg:HasStateTag("attack") and not player.sg:HasStateTag("moving") and player.components.sanity:GetMaxSanity() > 60 then
		player:AddTag("sneaka")
  player:AddTag("notarget")
	player.components.talker:Say("Hide in shadow !") 
	player:DoTaskInTime( 5, function() if player:HasTag("sneaka") then player.components.talker:Say("Musha is shadow !") SpawnPrefab("statue_transition").Transform:SetPosition(player:GetPosition():Get()) player.components.colourtweener:StartTween({0.1,0.1,0.1,1}, 0) 	InShadow(inst) end end)
	player.components.colourtweener:StartTween({0.3,0.3,0.3,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
   --	player.components.sanityaura.penalty = 80
   -- 	player.components.sanity:RecalculatePenalty()
         player.components.sanity:DoDelta(-80)

elseif player:HasTag("backstab1")  and player:HasTag("sneaka") then
		player:RemoveTag("sneaka")
  player:RemoveTag("hide")
        player:RemoveTag("notarget")
	player.components.talker:Say("Unhide !")
	player.components.colourtweener:StartTween({1,1,1,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
--	player.components.sanityaura.penalty = 0
 --   	player.components.sanity:RecalculatePenalty()
         player.components.sanity:DoDelta(80)

elseif player:HasTag("valkyrieh") and player:HasTag("backstab2") and not player:HasTag("sneaka") and not player.sg:HasStateTag("attack") and not player.sg:HasStateTag("moving") and player.components.sanity:GetMaxSanity() > 60 then

		player:AddTag("sneaka")
        player:AddTag("notarget")
	player.components.talker:Say("Hide in shadow !")
	player:DoTaskInTime( 5, function() if player:HasTag("sneaka") then player.components.talker:Say("Musha is shadow !") SpawnPrefab("statue_transition").Transform:SetPosition(player:GetPosition():Get()) player.components.colourtweener:StartTween({0.1,0.1,0.1,1}, 0) 	InShadow(inst) end end)
	player.components.colourtweener:StartTween({0.3,0.3,0.3,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
         player.components.sanity:DoDelta(-160)

elseif player:HasTag("backstab2") and player:HasTag("sneaka") then
		player:RemoveTag("sneaka")
        player:RemoveTag("notarget")
	player.components.talker:Say("Unhide !")
	player.components.colourtweener:StartTween({1,1,1,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
         player.components.sanity:DoDelta(160)

elseif player:HasTag("valkyrieh") and player:HasTag("backstab3") and not player:HasTag("sneaka") and not player.sg:HasStateTag("attack") and not player.sg:HasStateTag("moving") and player.components.sanity:GetMaxSanity() > 60 then

		player:AddTag("sneaka")
        player:AddTag("notarget")
	player.components.talker:Say("Hide in shadow !")
	player:DoTaskInTime( 5, function() if player:HasTag("sneaka") then player.components.talker:Say("Musha is shadow !") SpawnPrefab("statue_transition").Transform:SetPosition(player:GetPosition():Get()) player.components.colourtweener:StartTween({0.1,0.1,0.1,1}, 0) 	InShadow(inst) end end)
	player.components.colourtweener:StartTween({0.3,0.3,0.3,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
         player.components.sanity:DoDelta(-240)

elseif player:HasTag("backstab3")  and player:HasTag("sneaka") then
		player:RemoveTag("sneaka")
        player:RemoveTag("notarget")
	player.components.talker:Say("Unhide !")
	player.components.colourtweener:StartTween({1,1,1,1}, 0)
	local fx = SpawnPrefab("statue_transition_2")
        fx.entity:SetParent(player.entity)
	fx.Transform:SetScale(1.2, 1.2, 1.2)
        fx.Transform:SetPosition(0, 0, 0)
         player.components.sanity:DoDelta(240)

end
player.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)
end

if Shadow== "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow== "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end
if Shadow == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_shadow()

	end
	end
end)
end

	if Shadow == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_shadow()
	end	end end) end
	if Shadow == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_shadow()
	end	end end) end
	if Shadow == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_shadow()
	end	end end) end
	if Shadow == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_shadow()
	end	end end) end
	
	
----active dog skill
--default key = J

skill_dogs= function() 
	local player = GLOBAL.GetPlayer()
	local inst = GLOBAL.GetPlayer()
if inst:HasTag("switlight")	and not inst.nsleep then
inst:AddTag("Light_on")
inst:RemoveTag("switlight")
elseif not inst:HasTag("switlight") and not inst:HasTag("Light_on") and not inst.nsleep then
player.components.talker:Say("Musha needs more sleep..")
elseif inst.nsleep then
player.components.talker:Say("shiny Musha !")

--[[
elseif player.components.health.currenthealth >= 40 and player:HasTag("ghoundb") and not player:HasTag("ghound") and not player:HasTag("ghounds") and not inst:HasTag("switlight") then
		player:AddTag("ghound")
		player.components.talker:Say("Come to me, ancient dog!")

elseif player:HasTag("ghounds") and not inst:HasTag("switlight") then
		player.components.talker:Say("Already, summoned ghost hound..")

elseif player.components.health.currenthealth < 40 and player:HasTag("ghoundb") and not inst:HasTag("switlight") then
	player.components.talker:Say("Not enough [health]..")

elseif not player:HasTag("ghoundb") and not inst:HasTag("switlight") then
	player.components.talker:Say("dog? me?..")
]]
end
player.components.talker.colour = GLOBAL.Vector3(0.7, 0.85, 1, 1)
end

if Dogs == "R" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "T" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_T, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "Y" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Y, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "U" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_U, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "G" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_G, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "H" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "J" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_J, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "Z" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_Z, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "X" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_X, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "C" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_C, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "V" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_V, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "B" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_B, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end
if Dogs == "N" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_N, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput

	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
   
		skill_dogs()

	end
	end
end)
end

	if Dogs == "K" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_K, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_dogs()
	end	end end) end
	if Dogs == "L" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_L, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_dogs()
	end	end end) end
	if Dogs == "O" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_O, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_dogs()
	end	end end) end
	if Dogs == "P" then
GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_P, function()
	local player = GLOBAL.GetPlayer()
	if player and player:HasTag("musha") then
		local TheInput = GLOBAL.TheInput
	if not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then
 		skill_dogs()
	end	end end) end

function gruefix(inst)
        inst:AddTag("gruef")
end

AddPrefabPostInit("grue", gruefix)

-------------comfortable DLC and ORIZINAL

function DLC(inst)
	--local player = GLOBAL.GetPlayer()
if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then
      --  player:AddTag("DLC")
        inst:AddTag("DLC")
elseif GLOBAL.IsDLCEnabled(GLOBAL.CAPY_DLC) then
		inst:AddTag("DLC")
		inst:AddTag("DLC2")
end
end
AddPrefabPostInit("musha_small", DLC)
AddPrefabPostInit("musha", DLC)
AddPrefabPostInit("hat_mbunny", DLC)
--AddPrefabPostInit("musha_small", DLC)
AddPrefabPostInit("bedroll_straw", DLC)
AddPrefabPostInit("bedroll_furry", DLC)
AddPrefabPostInit("ghosthound", DLC)
AddPrefabPostInit("shadowmusha", DLC)
AddPrefabPostInit("musha_flute", DLC)

function DLC_water(inst)
if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS)then

    inst:AddComponent("waterproofer")
    inst.components.waterproofer.effectiveness = 0
    inst:AddComponent("insulator")
    inst.components.insulator:SetInsulation(TUNING.INSULATION_MED)
    inst.components.insulator:SetSummer()
end
end

function DLC_water2(inst)
if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS)then

    inst:AddComponent("waterproofer")
    inst.components.waterproofer.effectiveness = 0
    inst:AddComponent("insulator")
    inst.components.insulator:SetInsulation(TUNING.INSULATION_MED)
end
end

function DLC_water3(inst)
if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS)then

    inst:AddComponent("waterproofer")
    inst.components.waterproofer.effectiveness = 0
end
end

AddPrefabPostInit("frostback", DLC_water)
AddPrefabPostInit("broken_frosthammer", DLC_water)
AddPrefabPostInit("mushasword_frost", DLC_water)
AddPrefabPostInit("frosthammer", DLC_water)

AddPrefabPostInit("mushasword", DLC_water2)
AddPrefabPostInit("mushasword2", DLC_water2)
AddPrefabPostInit("mushasword3", DLC_water2)
AddPrefabPostInit("mushasword4", DLC_water2)

AddPrefabPostInit("armor_mushab", DLC_water2)

AddPrefabPostInit("hat_mphoenix", DLC_water3)
AddPrefabPostInit("hat_mprincess", DLC_water3)
AddPrefabPostInit("hat_mcrown", DLC_water3)


--[[
-------------comfortable RPG HUD
local RPGActive = 0
for _, moddir in ipairs(GLOBAL.KnownModIndex:GetModsToLoad()) do
    if GLOBAL.KnownModIndex:GetModInfo(moddir).name == "RPG HUD" then
		RPGActive = 1
    end
end

if RPGActive == 1 then
-- frostback
local function frostbackpostinit(inst)
	inst.components.equippable.equipslot = GLOBAL.EQUIPSLOTS.PACK
	--inst.components.inventoryitem.cangoincontainer = false		-- storable = true // non storable = false
	inst:AddTag("nonpotatable")

end
local function rpgtag(inst)
	inst.rpgtag = true
end

AddPrefabPostInit("frostback", frostbackpostinit)
AddPrefabPostInit("broken_frosthammer", frostbackpostinit)
AddPrefabPostInit("armor_mushaa", rpgtag)
AddPrefabPostInit("armor_mushab", rpgtag)
end]]

-------------comfortable Sort Inventory
local SORTActive = 0
for _, moddir in ipairs(GLOBAL.KnownModIndex:GetModsToLoad()) do
    if GLOBAL.KnownModIndex:GetModInfo(moddir).name == "Sort Inventory" then
		SORTActive = 1
    end
end

if SORTActive == 1 then
-- frostback
local function armorsortpostinit(inst)
inst.components.container.type = "pack"
end

AddPrefabPostInit("armor_mushaa", armorsortpostinit)
AddPrefabPostInit("armor_mushab", armorsortpostinit)

end

-------yamche floating badge 

local function Yamchebadge ( inst )

	inst:DoTaskInTime( 0, function() 
		local controls = inst.HUD.controls
	local YamcheStatusDisplays = require "widgets/yamchestatusdisplays"
	controls.YamcheStatus = controls:AddChild(YamcheStatusDisplays(inst))
		controls.YamcheStatus:SetPosition(0, 0, 0)
	end)	
end
AddSimPostInit( Yamchebadge )

-------musha floating badge 

local function Mushabadge ( inst )

	inst:DoTaskInTime( 0, function() 
		local controls = inst.HUD.controls
	local MushaStatusDisplays = require "widgets/mushastatusdisplays"
	controls.MushaStatus = controls:AddChild(MushaStatusDisplays(inst))
		controls.MushaStatus:SetPosition(0, 0, 0)
	end)	
end
AddSimPostInit( Mushabadge )

-------items floating badge 

local function Itembadge( inst )

	inst:DoTaskInTime( 0, function() 
		local controls = inst.HUD.controls
	local ItemStatusDisplays = require "widgets/itemstatusdisplays"
	controls.ItemStatus = controls:AddChild(ItemStatusDisplays(inst))
		controls.ItemStatus:SetPosition(0, 0, 0)
	end)	
end
AddSimPostInit( Itembadge)

-------------

AddModCharacter("musha")

local function Monsterfood_veasy(inst)
	local player = GLOBAL.GetPlayer()
	local fooditem = inst.prefab
if tostring(fooditem)=="monsterlasagna" and player:HasTag("musha") then
inst.components.edible.hungervalue=inst.components.edible.hungervalue * 1.75	
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -2
inst.components.edible.healthvalue=inst.components.edible.healthvalue * -1.5
elseif tostring(fooditem)=="monstermeat_dried" and player:HasTag("musha") then
inst.components.edible.hungervalue=inst.components.edible.hungervalue * 1.5	
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -2	
inst.components.edible.healthvalue=inst.components.edible.healthvalue * -1	
elseif tostring(fooditem)=="cookedmonstermeat" and player:HasTag("musha") then
inst.components.edible.hungervalue=inst.components.edible.hungervalue * 1.5	
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -1
inst.components.edible.healthvalue=inst.components.edible.healthvalue * -1	
	else 
	end
end
local function Monsterfood_easy(inst)
	local player = GLOBAL.GetPlayer()
	local fooditem = inst.prefab
if tostring(fooditem)=="monsterlasagna" and player:HasTag("musha") then
inst.components.edible.hungervalue=inst.components.edible.hungervalue * 1.5	
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -1.5
inst.components.edible.healthvalue=inst.components.edible.healthvalue * -0.75
elseif tostring(fooditem)=="monstermeat_dried" and player:HasTag("musha") then
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -1.25	
inst.components.edible.healthvalue=inst.components.edible.healthvalue * -.5	
elseif tostring(fooditem)=="cookedmonstermeat" and player:HasTag("musha") then
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -0.5
inst.components.edible.healthvalue=inst.components.edible.healthvalue * 0
	else 
	end
end
local function Monsterfood_moderato(inst)
	local player = GLOBAL.GetPlayer()
	local fooditem = inst.prefab
if tostring(fooditem)=="monsterlasagna" and player:HasTag("musha") then
inst.components.edible.hungervalue=inst.components.edible.hungervalue * 1	
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -1.25
inst.components.edible.healthvalue=inst.components.edible.healthvalue * -0.5
elseif tostring(fooditem)=="monstermeat_dried" and player:HasTag("musha") then
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -1	
--inst.components.edible.healthvalue=inst.components.edible.healthvalue * 1
elseif tostring(fooditem)=="cookedmonstermeat" and player:HasTag("musha") then
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -0
inst.components.edible.healthvalue=inst.components.edible.healthvalue * 2	
	else 
	end
end
local function Monsterfood_hard(inst)
	local player = GLOBAL.GetPlayer()
	local fooditem = inst.prefab
if tostring(fooditem)=="monsterlasagna" and player:HasTag("musha") then
inst.components.edible.hungervalue=inst.components.edible.hungervalue * 0.75	
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -1
inst.components.edible.healthvalue=inst.components.edible.healthvalue * -0.25
elseif tostring(fooditem)=="monstermeat_dried" and player:HasTag("musha") then
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -0.5	
--inst.components.edible.healthvalue=inst.components.edible.healthvalue * 1
elseif tostring(fooditem)=="cookedmonstermeat" and player:HasTag("musha") then
--inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -0
inst.components.edible.healthvalue=inst.components.edible.healthvalue * 2.5	
	else 
	end
end
local function Monsterfood_vhard(inst)
	local player = GLOBAL.GetPlayer()
	local fooditem = inst.prefab
if tostring(fooditem)=="monsterlasagna" and player:HasTag("musha") then
inst.components.edible.hungervalue=inst.components.edible.hungervalue * 0.5	
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -0.5
--inst.components.edible.healthvalue=inst.components.edible.healthvalue * -0.25
elseif tostring(fooditem)=="monstermeat_dried" and player:HasTag("musha") then
inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * -0.25	
inst.components.edible.healthvalue=inst.components.edible.healthvalue * 1.5
elseif tostring(fooditem)=="cookedmonstermeat" and player:HasTag("musha") then
--inst.components.edible.sanityvalue=inst.components.edible.sanityvalue * 1.5
inst.components.edible.healthvalue=inst.components.edible.healthvalue * 2.5	
	else 
	end
end

function mushabadge_on(inst)
 	inst:AddTag("mushab")
end
function mushabadge_valkyrie(inst)
 	inst:AddTag("mushabv")
end
function mushabadge_off(inst)
 	inst:RemoveTag("mushab")
 	inst:RemoveTag("mushabv")
end

if Mbadge == "always" then
AddPrefabPostInit("musha", mushabadge_on)
end
if Mbadge == "valkyrie" then
AddPrefabPostInit("musha", mushabadge_valkyrie)
end
if Mbadge == "off" then
AddPrefabPostInit("musha", mushabadge_off)
end

function spoiled(inst)
 	inst:AddTag("spoiled")
end

AddPrefabPostInit("spoiled_food",spoiled)
AddPrefabPostInit("spoiledfood",spoiled)
AddPrefabPostInit("rottenegg",spoiled)
AddPrefabPostInit("wetgoop",spoiled)


--elemental
local function elemental( inst )
    inst:AddComponent("fuel")
    --inst.components.fuel.fuelvalue = TUNING.SMALL_FUEL
    inst.components.fuel.fuelvalue = TUNING.MED_LARGE_FUEL
    inst.components.fuel.fueltype = "CHEMICAL"

end

AddPrefabPostInit("rocks",elemental)
AddPrefabPostInit("goldnugget",elemental)
AddPrefabPostInit("flint",elemental)
AddPrefabPostInit("marble",elemental)
AddPrefabPostInit("stinger",elemental)
AddPrefabPostInit("spidergland",elemental)
AddPrefabPostInit("houndstooth",elemental)

--convert gem

function gem_purple(inst)
local glowdusts = Ingredient( "glowdust", 1)
glowdusts.atlas = "images/inventoryimages/glowdust.xml"
Recipe("redgem", {Ingredient( "purplegem",1),glowdusts,}, RECIPETABS.REFINE, {SCIENCE=0})
Recipe("bluegem", {Ingredient( "purplegem",1),glowdusts, }, RECIPETABS.REFINE, {SCIENCE=0})
end

function gem_color(inst)
local glowdusts = Ingredient( "glowdust", 1)
glowdusts.atlas = "images/inventoryimages/glowdust.xml"
Recipe("redgem", {Ingredient( "bluegem",1),glowdusts,}, RECIPETABS.REFINE, {SCIENCE=0})
Recipe("bluegem", {Ingredient( "redgem",1),glowdusts, }, RECIPETABS.REFINE, {SCIENCE=0})
end

function gem_craft(inst)
local dust2 = Ingredient( "glowdust", 2)
dust2.atlas = "images/inventoryimages/glowdust.xml"
Recipe("redgem", {Ingredient("goldnugget", 6), Ingredient("feather_robin", 12) ,dust2, }, RECIPETABS.REFINE, {SCIENCE=0})
Recipe("bluegem",{Ingredient("goldnugget", 6), Ingredient("feather_robin_winter", 12) ,dust2, }, RECIPETABS.REFINE, {SCIENCE=0})
end

function gem_ecraft(inst)
local glowdusts = Ingredient( "glowdust", 1)
glowdusts.atlas = "images/inventoryimages/glowdust.xml"
Recipe("redgem", {Ingredient("goldnugget", 3), Ingredient("feather_robin", 6) ,glowdusts, }, RECIPETABS.REFINE, {SCIENCE=0})
Recipe("bluegem",{Ingredient("goldnugget", 3), Ingredient("feather_robin_winter", 6) ,glowdusts, }, RECIPETABS.REFINE, {SCIENCE=0})
end


if Cgems == "purple" then
AddPrefabPostInit("musha",gem_purple)
end
if Cgems == "color" then
AddPrefabPostInit("musha",gem_color)
end
if Cgems == "craft" then
AddPrefabPostInit("musha",gem_craft)
end
if Cgems == "ecraft" then
AddPrefabPostInit("musha",gem_ecraft)
end

--rocks
function rockss(inst)
Recipe("rocks", {Ingredient( "goldnugget",1),}, RECIPETABS.REFINE, {SCIENCE=0})

end
AddPrefabPostInit("musha",rockss)

function disable(inst)
        inst:AddTag("tstone")
        inst:AddTag("tstoneback")
        inst:AddTag("tstonehammer")
end
function enable(inst)
end
function frostback(inst)
        inst:AddTag("tstone")
        inst:AddTag("tstonehammer")
end
function frosthammer(inst)
        inst:AddTag("tstone")
        inst:AddTag("tstoneback")
end
function frostheart(inst)
        inst:AddTag("tstonehammer")
        inst:AddTag("tstoneback")
end

if Frostone == "disable" then
AddPrefabPostInit("heatrock", disable)
end
if Frostone == "enable" then
AddPrefabPostInit("heatrock", enable)
end
if Frostone == "frostback" then
AddPrefabPostInit("heatrock", frostback)
end
if Frostone == "frosthammer" then
AddPrefabPostInit("heatrock", frosthammer)
end
if Frostone == "frostheart" then
AddPrefabPostInit("heatrock", frostheart)
end

function musha_verysmart(inst)
inst.components.builder.science_bonus = 2
end
function musha_smart(inst)
inst.components.builder.science_bonus = 1
end
function musha_normal(inst)
inst.components.builder.science_bonus = 0
end

if Smart == "verysmart" then
AddPrefabPostInit("musha", musha_verysmart)
end
if Smart == "smart" then
AddPrefabPostInit("musha", musha_smart)
end
if Smart == "normal" then
AddPrefabPostInit("musha", musha_normal)
end

function dsleep_off(inst)
inst:AddTag("dsleep_off")
end
function dsleep_veasy(inst)
inst:AddTag("dsleep_veasy")
end
function dsleep_easy(inst)
inst:AddTag("dsleep_easy")
end
function dsleep_normal(inst)
inst:AddTag("dsleep_normal")
end
function dsleep_hard(inst)
inst:AddTag("dsleep_hard")
end
function dsleep_hardcore(inst)
inst:AddTag("dsleep_hardcore")
end

if Difficult_sleep == "off" then
AddPrefabPostInit("musha",dsleep_off)
end
if Difficult_sleep == "easy" then
AddPrefabPostInit("musha",dsleep_veasy)
end
if Difficult_sleep == "easy" then
AddPrefabPostInit("musha",dsleep_easy)
end
if Difficult_sleep == "normal" then
AddPrefabPostInit("musha",dsleep_normal)
end
if Difficult_sleep == "hard" then
AddPrefabPostInit("musha",dsleep_hard)
end
if Difficult_sleep == "hardcore" then
AddPrefabPostInit("musha",dsleep_hardcore)
end

function giants_1x(inst)
  inst:AddTag("giant1x")
end
function deerclops_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.DEERCLOPS_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.DEERCLOPS_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.75)
  inst:AddTag("giant2x")
end
function bearger_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.BEARGER_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.DEERCLOPS_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.75)
  inst:AddTag("giant2x")
end
function dragonfly_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.DRAGONFLY_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.DEERCLOPS_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.25)
  inst:AddTag("giant2x")
end
function moose_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.MOOSE_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.DEERCLOPS_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.75)
  inst:AddTag("giant2x")
end
function mossling_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.MOSSLING_HEALTH*2.5)
    inst.components.combat:SetDefaultDamage(TUNING.DEERCLOPS_DAMAGE*1.5)
  inst:AddTag("small_giant2x")
end
function deerclops_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.DEERCLOPS_HEALTH*4.5)
    inst.components.combat:SetDefaultDamage(TUNING.DEERCLOPS_DAMAGE*2.5)
    inst.components.combat:SetAttackPeriod(2.6)
  inst:AddTag("giant3x")
end
function bearger_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.BEARGER_HEALTH*4.5)
    inst.components.combat:SetDefaultDamage(TUNING.BEARGER_DAMAGE*2.5)
    inst.components.combat:SetRange(TUNING.BEARGER_ATTACK_RANGE, TUNING.BEARGER_MELEE_RANGE)
    inst.components.combat:SetAttackPeriod(2.6)
  inst:AddTag("giant3x")
end
function dragonfly_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.DRAGONFLY_HEALTH*4.5)
    inst.components.combat:SetDefaultDamage(TUNING.DRAGONFLY_DAMAGE*2.5)
    inst.components.combat:SetAttackPeriod(2.1)
  inst:AddTag("giant3x")
end
function moose_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.MOOSE_HEALTH*4.5)
    inst.components.combat:SetDefaultDamage(TUNING.MOOSE_DAMAGE*2.5)
    inst.components.combat:SetAttackPeriod(2.6)
   inst:AddTag("giant3x")
end
function mossling_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.MOSSLING_HEALTH*3.5)
    inst.components.combat:SetDefaultDamage(TUNING.MOSSLING_DAMAGE*2.5)
   inst:AddTag("small_giant3x")
end
function deerclops_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.DEERCLOPS_HEALTH*6)
    inst.components.combat:SetDefaultDamage(TUNING.DEERCLOPS_DAMAGE*3)
 --   inst.components.combat:SetAreaDamage(TUNING.DEERCLOPS_AOE_RANGE, TUNING.DEERCLOPS_AOE_SCALE)
    inst.components.combat:SetAttackPeriod(2.3)
   inst:AddTag("giant4x")
end
function bearger_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.BEARGER_HEALTH*6)
    inst.components.combat:SetDefaultDamage(TUNING.BEARGER_DAMAGE*3)
    inst.components.combat:SetRange(TUNING.BEARGER_ATTACK_RANGE, TUNING.BEARGER_MELEE_RANGE)
 --   inst.components.combat:SetAreaDamage(6, 0.8)
    inst.components.combat:SetAttackPeriod(2.3)
   inst:AddTag("giant4x")
end
function dragonfly_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.DRAGONFLY_HEALTH*6)
    inst.components.combat:SetDefaultDamage(TUNING.DRAGONFLY_DAMAGE*3)
   -- inst.components.combat:SetAreaDamage(6, 0.8)
    inst.components.combat:SetAttackPeriod(1.8)
   inst:AddTag("giant4x")
end
function moose_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.MOOSE_HEALTH*6)
    inst.components.combat:SetDefaultDamage(TUNING.MOOSE_DAMAGE*3)
    inst.components.combat:SetAttackPeriod(2.3)
    inst:AddTag("giant4x")
end
function mossling_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.MOSSLING_HEALTH*5)
    inst.components.combat:SetDefaultDamage(TUNING.MOSSLING_DAMAGE*3)
    inst:AddTag("small_giant4x")
end

------------
function nspider_1x(inst)
    inst:AddTag("spider1x")
end
function nspider_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_HEALTH*2)
    inst:AddTag("spider2x")
end
function wspider_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_WARRIOR_HEALTH*2)
    inst:AddTag("spider2x")
end
function qspider_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDERQUEEN_HEALTH*2)
    inst:AddTag("small_giant2x")
end
function chspider_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_HIDER_HEALTH*2)
    inst:AddTag("spider2x")
end
function csspider_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_SPITTER_HEALTH*2)
    inst:AddTag("spider2x")
end
function cdspider_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_WARRIOR_HEALTH*2)
     inst:AddTag("spider2x")
end
function nspider_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(2.75)
     inst:AddTag("spider3x")
end
function wspider_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_WARRIOR_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_WARRIOR_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(3.75 + math.random()*2)
     inst:AddTag("spider3x")
end
function qspider_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDERQUEEN_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDERQUEEN_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(2.75)
     inst:AddTag("small_giant3x")
end
function chspider_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_HIDER_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_HIDER_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(2.75)
     inst:AddTag("spider3x")
end
function csspider_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_SPITTER_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_SPITTER_DAMAGE_MELEE*1.5)
    inst.components.combat:SetAttackPeriod(4.75 + math.random()*2)
     inst:AddTag("spider3x")
end
function cdspider_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_WARRIOR_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_WARRIOR_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(2.75 + math.random()*2)
     inst:AddTag("spider3x")
end
function nspider_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.5)
     inst:AddTag("spider4x")
end
function wspider_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_WARRIOR_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_WARRIOR_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(3.5 + math.random()*2)
     inst:AddTag("spider4x")
end
function qspider_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDERQUEEN_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDERQUEEN_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.5)
     inst:AddTag("small_giant4x")
end
function chspider_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_HIDER_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_HIDER_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.5)
     inst:AddTag("spider4x")
end
function csspider_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_SPITTER_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_SPITTER_DAMAGE_MELEE*2)
    inst.components.combat:SetAttackPeriod(4.5 + math.random()*2)
        inst:AddTag("spider4x")
end
function cdspider_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.SPIDER_WARRIOR_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.SPIDER_WARRIOR_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(3.5 + math.random()*2)
        inst:AddTag("spider4x")
end
------
function hound_1x(inst)
        inst:AddTag("hound1x")
end
function nhound_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.HOUND_HEALTH*2)
        inst:AddTag("hound2x")
end
function fhound_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.FIREHOUND_HEALTH*2)
        inst:AddTag("hound2x")
end
function ihound_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.ICEHOUND_HEALTH*2)
        inst:AddTag("hound2x")
end
function warg_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.WARG_HEALTH*2)
        inst:AddTag("small_giant2x")
end

function nhound_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.HOUND_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.HOUND_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(1.75)
        inst:AddTag("hound3x")
end
function fhound_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.FIREHOUND_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.FIREHOUND_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(1.75)
        inst:AddTag("hound3x")
end
function ihound_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.ICEHOUND_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.ICEHOUND_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(1.75)
        inst:AddTag("hound3x")
end
function warg_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.WARG_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.WARG_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(2.75)
        inst:AddTag("small_giant3x")
end

function nhound_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.HOUND_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.HOUND_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(1.5)
        inst:AddTag("hound4x")
end
function fhound_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.FIREHOUND_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.FIREHOUND_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(1.5)
        inst:AddTag("hound4x")
end
function ihound_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.ICEHOUND_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.ICEHOUND_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(1.5)
        inst:AddTag("hound4x")
end
function warg_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.WARG_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.WARG_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(2.5)
        inst:AddTag("small_giant4x")
end
function tentacle_1x(inst)
        inst:AddTag("spider1x")
end
function tentacle_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.TENTACLE_HEALTH*2)
    inst.components.combat:SetDefaultDamage(TUNING.TENTACLE_DAMAGE*1.5)
        inst:AddTag("spider2x")
end
function tentacle_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.TENTACLE_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.TENTACLE_DAMAGE*2)
        inst:AddTag("spider3x")
end
function tentacle_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.TENTACLE_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.TENTACLE_DAMAGE*2.5)
        inst:AddTag("spider4x")
end
function rook_1x(inst)
        inst:AddTag("spider1x")
end
function rook_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.ROOK_HEALTH*2)
    inst.components.combat:SetDefaultDamage(TUNING.ROOK_DAMAGE*1.5)
        inst:AddTag("spider2x")
end
function rook_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.ROOK_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.ROOK_DAMAGE*2)
        inst:AddTag("spider3x")
end
function rook_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.ROOK_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.ROOK_DAMAGE*3)
        inst:AddTag("spider4x")
end
function minotaur_1x(inst)
        inst:AddTag("spider1x")
end
function minotaur_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.MINOTAUR_HEALTH*2)
    inst.components.combat:SetDefaultDamage(TUNING.MINOTAUR_DAMAGE*1.5)
        inst:AddTag("spider2x")
end
function minotaur_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.MINOTAUR_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.MINOTAUR_DAMAGE*2)
        inst:AddTag("spider3x")
end
function minotaur_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.MINOTAUR_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.MINOTAUR_DAMAGE*2.5)
        inst:AddTag("spider4x")
end
function bishop_1x(inst)
        inst:AddTag("spider1x")
end
function bishop_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.BISHOP_HEALTH*2)
    inst.components.combat:SetDefaultDamage(TUNING.BISHOP_DAMAGE*1.2)
        inst:AddTag("spider2x")
end
function bishop_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.BISHOP_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.BISHOP_DAMAGE*1.6)
        inst:AddTag("spider3x")
end
function bishop_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.BISHOP_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.BISHOP_DAMAGE*2)
        inst:AddTag("spider4x")
end
function tallbird_1x(inst)
        inst:AddTag("spider1x")
end
function tallbird_2x(inst)
    inst.components.health:SetMaxHealth(TUNING.TALLBIRD_HEALTH*2)
        inst:AddTag("spider2x")
end
function tallbird_3x(inst)
    inst.components.health:SetMaxHealth(TUNING.TALLBIRD_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.TALLBIRD_DAMAGE*1.5)
    inst.components.combat:SetAttackPeriod(1.75)
        inst:AddTag("spider3x")
end
function tallbird_4x(inst)
    inst.components.health:SetMaxHealth(TUNING.TALLBIRD_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.TALLBIRD_DAMAGE*2)
    inst.components.combat:SetAttackPeriod(1.5)
        inst:AddTag("spider4x")
end
function leif_1x(inst)
        inst:AddTag("small_giant1x")
    inst.components.health:SetMaxHealth(TUNING.LEIF_HEALTH)
end
function leif_2x(inst)
        inst:AddTag("small_giant2x")
    inst.components.health:SetMaxHealth(TUNING.LEIF_HEALTH*2)
end
function leif_3x(inst)
        inst:AddTag("small_giant3x")
    inst.components.health:SetMaxHealth(TUNING.LEIF_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.LEIF_DAMAGE*1.5)
end
function leif_4x(inst)
        inst:AddTag("small_giant4x")
    inst.components.health:SetMaxHealth(TUNING.LEIF_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.LEIF_DAMAGE*2)
end
function birchnutdrake_1x(inst)
        inst:AddTag("spider1x")
    inst.components.health:SetMaxHealth(50)
end
function birchnutdrake_2x(inst)
        inst:AddTag("spider2x")
    inst.components.health:SetMaxHealth(100)
end
function birchnutdrake_3x(inst)
        inst:AddTag("spider3x")
    inst.components.health:SetMaxHealth(150)
    inst.components.combat:SetDefaultDamage(10)
end
function birchnutdrake_4x(inst)
        inst:AddTag("spider4x")
    inst.components.health:SetMaxHealth(200)
    inst.components.combat:SetDefaultDamage(15)
end
function merm_1x(inst)
        inst:AddTag("spider1x")
    inst.components.health:SetMaxHealth(TUNING.MERM_HEALTH)
end
function merm_2x(inst)
        inst:AddTag("spider2x")
    inst.components.health:SetMaxHealth(TUNING.MERM_HEALTH*2)
end
function merm_3x(inst)
        inst:AddTag("spider3x")
    inst.components.health:SetMaxHealth(TUNING.MERM_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.MERM_DAMAGE*1.5)
end
function merm_4x(inst)
        inst:AddTag("spider4x")
    inst.components.health:SetMaxHealth(TUNING.MERM_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.MERM_DAMAGE*2)
end
function bat_1x(inst)
        inst:AddTag("spider1x")
    inst.components.health:SetMaxHealth(TUNING.BAT_HEALTH)
end
function bat_2x(inst)
        inst:AddTag("spider2x")
    inst.components.health:SetMaxHealth(TUNING.BAT_HEALTH*2)
end
function bat_3x(inst)
        inst:AddTag("spider3x")
    inst.components.health:SetMaxHealth(TUNING.BAT_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.BAT_DAMAGE*1.5)
end
function bat_4x(inst)
        inst:AddTag("spider4x")
    inst.components.health:SetMaxHealth(TUNING.BAT_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.BAT_DAMAGE*2)
end
function monkey_1x(inst)
        inst:AddTag("spider1x")
    inst.components.health:SetMaxHealth(TUNING.MONKEY_HEALTH)
end
function monkey_2x(inst)
        inst:AddTag("spider2x")
    inst.components.health:SetMaxHealth(TUNING.MONKEY_HEALTH*2)
end
function monkey_3x(inst)
        inst:AddTag("spider3x")
    inst.components.health:SetMaxHealth(TUNING.MONKEY_HEALTH*3)
end
function monkey_4x(inst)
        inst:AddTag("spider4x")
    inst.components.health:SetMaxHealth(TUNING.MONKEY_HEALTH*4)
end
function walus_1x(inst)
        inst:AddTag("spider1x")
    inst.components.health:SetMaxHealth(TUNING.WALRUS_HEALTH)
end
function walus_2x(inst)
        inst:AddTag("spider2x")
    inst.components.health:SetMaxHealth(TUNING.WALRUS_HEALTH*2)
end
function walus_3x(inst)
        inst:AddTag("spider3x")
    inst.components.health:SetMaxHealth(TUNING.WALRUS_HEALTH*3)
    inst.components.locomotor.runspeed = 6
    inst.components.locomotor.walkspeed = 2
end
function walus_4x(inst)
        inst:AddTag("spider4x")
    inst.components.health:SetMaxHealth(TUNING.WALRUS_HEALTH*4)
    inst.components.locomotor.runspeed = 8
    inst.components.locomotor.walkspeed = 2
end
function eyeplant_1x(inst)
end
function eyeplant_2x(inst)
        inst:AddTag("spider1x")
    inst.components.health:SetMaxHealth(TUNING.EYEPLANT_HEALTH*2)
end
function eyeplant_3x(inst)
        inst:AddTag("spider1x")
    inst.components.health:SetMaxHealth(TUNING.EYEPLANT_HEALTH*3)
    inst.components.combat:SetDefaultDamage(TUNING.EYEPLANT_DAMAGE*1.5)
end
function eyeplant_4x(inst)
        inst:AddTag("spider2x")
    inst.components.health:SetMaxHealth(TUNING.EYEPLANT_HEALTH*4)
    inst.components.combat:SetDefaultDamage(TUNING.EYEPLANT_DAMAGE*2)
end

function stat_hellh(inst)
        inst:AddTag("hellh")
 	inst.components.combat.damagemultiplier = .5
	inst.components.health:SetMaxHealth(40)
inst:AddTag("helld")
end
function stat_hardcoreh(inst)
        inst:AddTag("hardcoreh")
 	inst.components.combat.damagemultiplier = .6
	inst.components.health:SetMaxHealth(40)
inst:AddTag("hardcored")
end
function stat_hardh(inst)
        inst:AddTag("hardh")
 	inst.components.combat.damagemultiplier = .7
	inst.components.health:SetMaxHealth(50)
inst:AddTag("hardd")
end
function stat_normalh(inst)
        inst:AddTag("normalh")
 	inst.components.combat.damagemultiplier = TUNING.WENDY_DAMAGE_MULT
	inst.components.health:SetMaxHealth(60)
inst:AddTag("normald")
end
function stat_easyh(inst)
	inst.components.health:SetMaxHealth(75)
        inst:AddTag("easyh")
 	inst.components.combat.damagemultiplier = 1
inst:AddTag("easyd")
end
function stat_veasyh(inst)
 	inst.components.combat.damagemultiplier = 1.5
inst:AddTag("easyd")
	inst.components.health:SetMaxHealth(100)
        inst:AddTag("veasyh")
end

-------difficult option

if Difficult == "easyh" then
for k, fooditem in pairs(TUNING.MUSHA_FOODS) do
    AddPrefabPostInit(fooditem, Monsterfood_easy)
AddPrefabPostInit("musha", stat_easyh)
end
end
if Difficult == "veasyh" then
for k, fooditem in pairs(TUNING.MUSHA_FOODS) do
    AddPrefabPostInit(fooditem, Monsterfood_veasy)
AddPrefabPostInit("musha", stat_veasyh)
end
end
if Difficult == "monster1x" then
AddPrefabPostInit("deerclops", giants_1x)
AddPrefabPostInit("bearger", giants_1x)
AddPrefabPostInit("dragonfly", giants_1x)
AddPrefabPostInit("moose", giants_1x)
AddPrefabPostInit("mossling", giants_1x)
AddPrefabPostInit("spider", nspider_1x)
AddPrefabPostInit("spider_warrior", spider_1x)
AddPrefabPostInit("spiderqueen", spider_1x)
AddPrefabPostInit("spider_hider", spider_1x)
AddPrefabPostInit("spider_spitter", spider_1x)
AddPrefabPostInit("spider_dropper", spider_1x)
AddPrefabPostInit("hound", hound_1x)
AddPrefabPostInit("firehound", hound_1x)
AddPrefabPostInit("icehound", hound_1x)
AddPrefabPostInit("warg", hound_1x)
AddPrefabPostInit("tentacle", tentacle_1x)
AddPrefabPostInit("rook", rook_1x)
AddPrefabPostInit("minotaur", minotaur_1x)
AddPrefabPostInit("bishop", bishop_1x)
AddPrefabPostInit("tallbird", tallbird_1x)
AddPrefabPostInit("leif", leif_1x)
AddPrefabPostInit("merm", merm_1x)
AddPrefabPostInit("birchnutdrake", birchnutdrake_1x)
AddPrefabPostInit("bat", bat_1x)
AddPrefabPostInit("walus", walus_1x)
AddPrefabPostInit("monkey", monkey_1x)
AddPrefabPostInit("eyeplant", eyeplant_1x)
for k, fooditem in pairs(TUNING.MUSHA_FOODS) do
    AddPrefabPostInit(fooditem, Monsterfood_moderato)
AddPrefabPostInit("musha", stat_normalh)
end
end
if Difficult == "monster2x" then
AddPrefabPostInit("deerclops", deerclops_2x)
AddPrefabPostInit("bearger", bearger_2x)
AddPrefabPostInit("dragonfly", dragonfly_2x)
AddPrefabPostInit("moose", moose_2x)
AddPrefabPostInit("mossling", mossling_2x)
AddPrefabPostInit("spider", nspider_2x)
AddPrefabPostInit("spider_warrior", wspider_2x)
AddPrefabPostInit("spiderqueen", qspider_2x)
AddPrefabPostInit("spider_hider", chspider_2x)
AddPrefabPostInit("spider_spitter", csspider_2x)
AddPrefabPostInit("spider_dropper", cdspider_2x)
AddPrefabPostInit("hound", nhound_2x)
AddPrefabPostInit("firehound", fhound_2x)
AddPrefabPostInit("icehound", ihound_2x)
AddPrefabPostInit("warg", warg_2x)
AddPrefabPostInit("tentacle", tentacle_2x)
AddPrefabPostInit("rook", rook_2x)
AddPrefabPostInit("minotaur", minotaur_2x)
AddPrefabPostInit("bishop", bishop_2x)
AddPrefabPostInit("tallbird", tallbird_2x)
AddPrefabPostInit("leif", leif_2x)
AddPrefabPostInit("merm", merm_2x)
AddPrefabPostInit("birchnutdrake", birchnutdrake_2x)
AddPrefabPostInit("bat", bat_2x)
AddPrefabPostInit("walus", walus_2x)
AddPrefabPostInit("monkey", monkey_2x)
AddPrefabPostInit("eyeplant", eyeplant_2x)
for k, fooditem in pairs(TUNING.MUSHA_FOODS) do
    AddPrefabPostInit(fooditem, Monsterfood_hard)
AddPrefabPostInit("musha", stat_hardh)
end
end
if Difficult == "monster3x" then
AddPrefabPostInit("deerclops", deerclops_3x)
AddPrefabPostInit("bearger", bearger_3x)
AddPrefabPostInit("dragonfly", dragonfly_3x)
AddPrefabPostInit("moose", moose_3x)
AddPrefabPostInit("mossling", mossling_3x)
AddPrefabPostInit("spider", nspider_3x)
AddPrefabPostInit("spider_warrior", wspider_3x)
AddPrefabPostInit("spiderqueen", qspider_3x)
AddPrefabPostInit("spider_hider", chspider_3x)
AddPrefabPostInit("spider_spitter", csspider_3x)
AddPrefabPostInit("spider_dropper", cdspider_3x)
AddPrefabPostInit("hound", nhound_3x)
AddPrefabPostInit("firehound", fhound_3x)
AddPrefabPostInit("icehound", ihound_3x)
AddPrefabPostInit("warg", warg_3x)
AddPrefabPostInit("tentacle", tentacle_3x)
AddPrefabPostInit("rook", rook_3x)
AddPrefabPostInit("minotaur", minotaur_3x)
AddPrefabPostInit("bishop", bishop_3x)
AddPrefabPostInit("tallbird", tallbird_3x)
AddPrefabPostInit("leif", leif_3x)
AddPrefabPostInit("merm", merm_3x)
AddPrefabPostInit("birchnutdrake", birchnutdrake_3x)
AddPrefabPostInit("bat", bat_3x)
AddPrefabPostInit("walus", walus_3x)
AddPrefabPostInit("monkey", monkey_3x)
AddPrefabPostInit("eyeplant", eyeplant_3x)
for k, fooditem in pairs(TUNING.MUSHA_FOODS) do
    AddPrefabPostInit(fooditem, Monsterfood_hard)
AddPrefabPostInit("musha", stat_hardcoreh)
end
end
if Difficult == "monster4x" then
AddPrefabPostInit("deerclops", deerclops_4x)
AddPrefabPostInit("bearger", bearger_4x)
AddPrefabPostInit("dragonfly", dragonfly_4x)
AddPrefabPostInit("moose", moose_4x)
AddPrefabPostInit("mossling", mossling_4x)
AddPrefabPostInit("spider", nspider_4x)
AddPrefabPostInit("spider_warrior", wspider_4x)
AddPrefabPostInit("spiderqueen", qspider_4x)
AddPrefabPostInit("spider_hider", chspider_4x)
AddPrefabPostInit("spider_spitter", csspider_4x)
AddPrefabPostInit("spider_dropper", cdspider_4x)
AddPrefabPostInit("hound", nhound_4x)
AddPrefabPostInit("firehound", fhound_4x)
AddPrefabPostInit("icehound", ihound_4x)
AddPrefabPostInit("warg", warg_4x)
AddPrefabPostInit("tentacle", tentacle_4x)
AddPrefabPostInit("rook", rook_4x)
AddPrefabPostInit("minotaur", minotaur_4x)
AddPrefabPostInit("bishop", bishop_4x)
AddPrefabPostInit("tallbird", tallbird_4x)
AddPrefabPostInit("leif", leif_4x)
AddPrefabPostInit("merm", merm_4x)
AddPrefabPostInit("birchnutdrake", birchnutdrake_4x)
AddPrefabPostInit("bat", bat_4x)
AddPrefabPostInit("walus", walus_4x)
AddPrefabPostInit("monkey", monkey_4x)
AddPrefabPostInit("eyeplant", eyeplant_4x)
for k, fooditem in pairs(TUNING.MUSHA_FOODS) do
    AddPrefabPostInit(fooditem, Monsterfood_vhard)
AddPrefabPostInit("musha", stat_hellh)
end
end 
-------
