local assets=
{
	Asset("ANIM", "anim/hat_mbunny.zip"),
	Asset("ANIM", "anim/hat_mbunny2.zip"),
  Asset("ATLAS", "images/inventoryimages/hat_mbunny.xml"),
  Asset("IMAGE", "images/inventoryimages/hat_mbunny.tex")
}
---------------------------

---------------------------
local function levelexp(inst,data)

	local max_exp = 4100
	local exp = math.min(inst.level, max_exp)

if inst.level <= 4000 then
inst.components.talker:Say("-[Bunny Scout Hat]\n[Grow Points]".. (inst.level))
inst:RemoveTag("levelup")
end
if inst.level >=0 and inst.level <10 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[10]\n[Grow Points]".. (inst.level))
inst:AddTag("level1")
elseif inst.level >=10 and inst.level <30 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[30]\n[Grow Points]".. (inst.level))
inst:AddTag("level2")
inst:RemoveTag("level1")
elseif inst.level >=30 and inst.level <60 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[60]\n[Grow Points]".. (inst.level))
inst:AddTag("level3")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
elseif inst.level >=60 and inst.level <100 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[100]\n[Grow Points]".. (inst.level))
inst:AddTag("level4")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
elseif inst.level >=100 and inst.level <150 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[150]\n[Grow Points]".. (inst.level))
inst:AddTag("level5")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
elseif inst.level >=150 and inst.level <200 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[200]\n[Grow Points]".. (inst.level))
inst:AddTag("level6")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
elseif inst.level >=200 and inst.level <250 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[250]\n[Grow Points]".. (inst.level))
inst:AddTag("level7")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
elseif inst.level >=250 and inst.level <300 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[300]\n[Grow Points]".. (inst.level))
inst:AddTag("level8")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
elseif inst.level >=300 and inst.level <350 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[350]\n[Grow Points]".. (inst.level))
inst:AddTag("level9")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
elseif inst.level >=350 and inst.level <450 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[450]\n[Grow Points]".. (inst.level))
inst:AddTag("level10")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
elseif inst.level >=450 and inst.level <600 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[600]\n[Grow Points]".. (inst.level))
inst:AddTag("level11")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
elseif inst.level >=600 and inst.level <700 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[700]\n[Grow Points]".. (inst.level))
inst:AddTag("level12")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
elseif inst.level >=700 and inst.level <800 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[800]\n[Grow Points]".. (inst.level))
inst:AddTag("level13")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
elseif inst.level >=800 and inst.level <900 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[900]\n[Grow Points]".. (inst.level))
inst:AddTag("level14")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
elseif inst.level >=900 and inst.level <1000 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1000]\n[Grow Points]".. (inst.level))
inst:AddTag("level15")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
elseif inst.level >=1000 and inst.level <1100 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1100]\n[Grow Points]".. (inst.level))
inst:AddTag("level16")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
elseif inst.level >=1100 and inst.level <1200 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1200]\n[Grow Points]".. (inst.level))
inst:AddTag("level17")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
elseif inst.level >=1200 and inst.level <1300 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1300]\n[Grow Points]".. (inst.level))
inst:AddTag("level18")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
elseif inst.level >=1300 and inst.level <1400 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1400]\n[Grow Points]".. (inst.level))
inst:AddTag("level19")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
elseif inst.level >=1400 and inst.level <1500 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1500]\n[Grow Points]".. (inst.level))
inst:AddTag("level20")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
elseif inst.level >=1500 and inst.level <1600 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1600]\n[Grow Points]".. (inst.level))
inst:AddTag("level21")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
elseif inst.level >=1600 and inst.level <1800 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[1800]\n[Grow Points]".. (inst.level))
inst:AddTag("level22")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
elseif inst.level >=1800 and inst.level <2000 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[2000]\n[Grow Points]".. (inst.level))
inst:AddTag("level23")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
elseif inst.level >=2000 and inst.level <2200 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[2200]\n[Grow Points]".. (inst.level))
inst:AddTag("level24")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
inst:RemoveTag("level23")
elseif inst.level >=2200 and inst.level <2400 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[2400]\n[Grow Points]".. (inst.level))
inst:AddTag("level25")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
inst:RemoveTag("level23")
inst:RemoveTag("level24")
elseif inst.level >=2400 and inst.level <2600 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[2600]\n[Grow Points]".. (inst.level))
inst:AddTag("level26")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
inst:RemoveTag("level23")
inst:RemoveTag("level24")
inst:RemoveTag("level25")
elseif inst.level >=2600 and inst.level <2800 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[2800]\n[Grow Points]".. (inst.level))
inst:AddTag("level27")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
inst:RemoveTag("level23")
inst:RemoveTag("level24")
inst:RemoveTag("level25")
inst:RemoveTag("level26")
elseif inst.level >=2800 and inst.level <3000 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[3000]\n[Grow Points]".. (inst.level))
inst:AddTag("level28")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
inst:RemoveTag("level23")
inst:RemoveTag("level24")
inst:RemoveTag("level25")
inst:RemoveTag("level26")
inst:RemoveTag("level27")
elseif inst.level >=3000 and inst.level <4000 then
inst.components.talker:Say("-[Bunny Scout Hat] \nNext:[4000]\n[Grow Points]".. (inst.level))
inst:AddTag("level29")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
inst:RemoveTag("level23")
inst:RemoveTag("level24")
inst:RemoveTag("level25")
inst:RemoveTag("level26")
inst:RemoveTag("level27")
inst:RemoveTag("level28")
elseif inst.level >=4000 then
inst.components.talker:Say("-[Bunny Scout Hat] \n[MAX]")
inst:AddTag("level30")
inst:RemoveTag("level1")
inst:RemoveTag("level2")
inst:RemoveTag("level3")
inst:RemoveTag("level4")
inst:RemoveTag("level5")
inst:RemoveTag("level6")
inst:RemoveTag("level7")
inst:RemoveTag("level8")
inst:RemoveTag("level9")
inst:RemoveTag("level10")
inst:RemoveTag("level11")
inst:RemoveTag("level12")
inst:RemoveTag("level13")
inst:RemoveTag("level14")
inst:RemoveTag("level15")
inst:RemoveTag("level16")
inst:RemoveTag("level17")
inst:RemoveTag("level18")
inst:RemoveTag("level19")
inst:RemoveTag("level20")
inst:RemoveTag("level21")
inst:RemoveTag("level22")
inst:RemoveTag("level23")
inst:RemoveTag("level24")
inst:RemoveTag("level25")
inst:RemoveTag("level26")
inst:RemoveTag("level27")
inst:RemoveTag("level28")
inst:RemoveTag("level29")
end
end


local function onpreload(inst, data)
	if data then
		if data.level then
		inst.level = data.level
			levelexp(inst)
end
	end
		end
local function onsave(inst, data)
	data.level = inst.level
	data.charge_time = inst.charge_time
end

local function OnDurability(inst, data)
inst:AddTag("broken")
inst.components.fueled:StopConsuming()        
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.01)
inst.components.talker:Say("-[Broken BunnyHat]\nArmor (1)\nDurability (1)\nSpeed up(0)")
    if inst.task then inst.task:Cancel() inst.task = nil end
end

local function UpgradeArmor(inst)
if inst:HasTag("broken") then
    inst.components.equippable.walkspeedmult = 1
	inst.components.talker:Say("-[Bunny Scout Hat]\nDurability (0)\nSpeed up (0)")
            inst.components.fueled:StopConsuming()        
   end

if not inst:HasTag("broken") then
        if inst:HasTag("level1") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV1)]\nArmor(10)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.1)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level2") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV2)]\nArmor(11)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.11)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level3") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV3)]\nArmor(12)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.12)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level4") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV4)]\nArmor(13)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.13)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level5") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV5)]\nArmor(14)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.14)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level6") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV6)]\nArmor(15)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.15)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level7") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV7)]\nArmor(16)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.16)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level8") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV8)]\nArmor(17)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.17)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level9") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV9)]\nArmor(18)\nSpeed up\nWarm up(Small)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.18)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level10") then
	inst.components.talker:Say("-[Bunny Scout Hat(LV10)]\nArmor(19)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.19)
    inst.components.insulator.insulation = TUNING.INSULATION_MED

        elseif inst:HasTag("level11") then
   inst.components.equippable.walkspeedmult = 1.19
	inst.components.talker:Say("-[Bunny Scout Hat(LV11)]\nArmor(20)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.2)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level12") then
   inst.components.equippable.walkspeedmult = 1.20
	inst.components.talker:Say("-[Bunny Scout Hat(LV12)]\nArmor(21)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.21)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level13") then
   inst.components.equippable.walkspeedmult = 1.21
	inst.components.talker:Say("-[Bunny Scout Hat(LV13)]\nArmor(22)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.22)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level14") then
   inst.components.equippable.walkspeedmult = 1.22
	inst.components.talker:Say("-[Bunny Scout Hat(LV14)]\nArmor(23)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.23)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level15") then
   inst.components.equippable.walkspeedmult = 1.23
	inst.components.talker:Say("-[Bunny Scout Hat(LV15)]\nArmor(24)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.24)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level16") then
   inst.components.equippable.walkspeedmult = 1.24
	inst.components.talker:Say("-[Bunny Scout Hat(LV16)]\nArmor(25)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.25)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level17") then
   inst.components.equippable.walkspeedmult = 1.25
	inst.components.talker:Say("-[Bunny Scout Hat(LV17)]\nArmor(26)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.26)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level18") then
   inst.components.equippable.walkspeedmult = 1.26
	inst.components.talker:Say("-[Bunny Scout Hat(LV18)]\nArmor(27)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.27)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level19") then
   inst.components.equippable.walkspeedmult = 1.27
	inst.components.talker:Say("-[Bunny Scout Hat(LV19)]\nArmor(28)\nSpeed up\nWarm up(MED)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.28)
    inst.components.insulator.insulation = TUNING.INSULATION_SMALL

        elseif inst:HasTag("level20") then
   inst.components.equippable.walkspeedmult = 1.28
	inst.components.talker:Say("-[Bunny Scout Hat(LV20)]\nArmor(29)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.29)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level21") then
   inst.components.equippable.walkspeedmult = 1.29
	inst.components.talker:Say("-[Bunny Scout Hat(LV21)]\nArmor(30)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.3)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level22") then
   inst.components.equippable.walkspeedmult = 1.3
	inst.components.talker:Say("-[Bunny Scout Hat(LV22)]\nArmor(31)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.31)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level23") then
   inst.components.equippable.walkspeedmult = 1.31
	inst.components.talker:Say("-[Bunny Scout Hat(LV23)]\nArmor(32)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.32)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level24") then
   inst.components.equippable.walkspeedmult = 1.32
	inst.components.talker:Say("-[Bunny Scout Hat(LV24)]\nArmor(33)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.33)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level25") then
   inst.components.equippable.walkspeedmult = 1.33
	inst.components.talker:Say("-[Bunny Scout Hat(LV25)]\nArmor(34)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.34)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level26") then
   inst.components.equippable.walkspeedmult = 1.34
	inst.components.talker:Say("-[Bunny Scout Hat(LV26)]\nArmor(35)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.35)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level27") then
   inst.components.equippable.walkspeedmult = 1.35
	inst.components.talker:Say("-[Bunny Scout Hat(LV27)]\nArmor(36)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.36)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level28") then
   inst.components.equippable.walkspeedmult = 1.36
	inst.components.talker:Say("-[Bunny Scout Hat(LV28)]\nArmor(37)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.37)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level29") then
   inst.components.equippable.walkspeedmult = 1.37
	inst.components.talker:Say("-[Bunny Scout Hat(LV29)]\nArmor(38)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.38)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

        elseif inst:HasTag("level30") then
   inst.components.equippable.walkspeedmult = 1.4
	inst.components.talker:Say("-[Bunny Scout Hat(LV30)]\nArmor(40)\nSpeed up\nWarm up(Large)")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.4)
    inst.components.insulator.insulation = TUNING.INSULATION_LARGE

------
end
end
end

-------- --------
local function TakeItem(inst, item, data)
local expchance0 = 1
local expchance1 = 0.3
local expchance2 = 0.2
local expchance3 = 0.12
	inst.components.fueled:DoDelta(5000000)
	SpawnPrefab("splash").Transform:SetPosition(inst:GetPosition():Get())
inst:RemoveTag ("broken")     
UpgradeArmor(inst)
   if math.random() < expchance1 and inst.level <= 4005 then
	inst.level = inst.level + 2
	levelexp(inst)
	inst.components.talker:Say("Lucky Points ! +(2)\n[Grow Points]".. (inst.level))
    elseif  math.random() < expchance2 and inst.level <= 4005 then
	inst.level = inst.level + 5
	levelexp(inst)
	inst.components.talker:Say("Lucky Points ! +(5)\n[Grow Points]".. (inst.level))
	elseif  math.random() < expchance3 and inst.level <= 4005 then
	inst.level = inst.level + 8
	levelexp(inst)
	inst.components.talker:Say("Lucky Points ! +(8)\n[Grow Points]".. (inst.level))
	elseif  math.random() < expchance0 and inst.level <= 4005 then
	inst.level = inst.level + 1
	levelexp(inst)
    end
end

local function OnLoad(inst, data)
    UpgradeArmor(inst)
end

    local function onequip(inst, owner, fname_override)
   inst:AddTag("talkf")
    UpgradeArmor(inst)
inst.components.fueled:StartConsuming()        

if inst:HasTag("gogleoff") then
        owner.AnimState:OverrideSymbol("swap_hat", "hat_mbunny", "swap_hat")
        owner.AnimState:Show("HAT")
        owner.AnimState:Hide("HAT_HAIR")
        owner.AnimState:Hide("HAIR_NOHAT")
        owner.AnimState:Hide("HAIR")
            owner.AnimState:Hide("HEAD")
            owner.AnimState:Show("HEAD_HAIR")
elseif not inst:HasTag("gogleoff") then
        owner.AnimState:OverrideSymbol("swap_hat", "hat_mbunny2", "swap_hat")
        owner.AnimState:Show("HAT")
        owner.AnimState:Hide("HAT_HAIR")
        owner.AnimState:Hide("HAIR_NOHAT")
        owner.AnimState:Hide("HAIR")
            owner.AnimState:Hide("HEAD")
            owner.AnimState:Show("HEAD_HAIR")
        end

    inst.expfn = function(attacked, data)
local expchance = 0.5
local damagedur1 = 0.2
local damagedur2 = 0.5
local damagedur3 = 0.7
local damagedur4 = 1


if data and data.attacker and math.random() < damagedur1 then
inst.components.fueled:DoDelta(-150000)
elseif data and data.attacker and math.random() < damagedur2 then
inst.components.fueled:DoDelta(-100000)
elseif data and data.attacker and math.random() < damagedur3 then
inst.components.fueled:DoDelta(-50000)
elseif data and data.attacker and math.random() < damagedur4 then
inst.components.fueled:DoDelta(-50000)

end
if data and data.attacker and math.random() < expchance and inst.level < 4010 then

inst.components.fueled:DoDelta(-50000)
	inst.level = inst.level + 1
			levelexp(inst)

		end 
	    end

    inst:ListenForEvent("attacked", inst.expfn, owner)

end

    local function onunequip(inst, owner)
   inst:RemoveTag("talkf")
    UpgradeArmor(inst)
	inst:AddTag("gogleoff") 
inst.components.fueled:StopConsuming()        
    inst:RemoveEventCallback("attacked", inst.expfn, owner)
    if inst.task then inst.task:Cancel() inst.task = nil end

        owner.AnimState:Hide("HAT")
        owner.AnimState:Hide("HAT_HAIR")
        owner.AnimState:Show("HAIR_NOHAT")
        owner.AnimState:Show("HAIR")

        if owner:HasTag("player") then
            owner.AnimState:Show("HEAD")
            owner.AnimState:Hide("HEAD_HAIR")
        end
    end

local function consume(inst, owner)
if not inst:HasTag("broken") then
inst.components.fueled:DoDelta(-50000)
end
end

  local function gogleon(inst, data, owner, fname_override)
local player = GetPlayer()
        local owner = inst.components.inventoryitem.owner
if owner and inst:HasTag("broken") then
	inst:AddTag("gogleoff") 
	player.components.talker:Say("Bunny Hat is Broken !")
	inst.components.talker:Say("-[Bunny Scout Hat]\nDurability (0)\nSpeed up (0)")
    inst.components.equippable.walkspeedmult = 1
        owner.AnimState:OverrideSymbol("swap_hat", "hat_mbunny", "swap_hat")
        owner.AnimState:Show("HAT")
        owner.AnimState:Hide("HAT_HAIR")
        owner.AnimState:Hide("HAIR_NOHAT")
        owner.AnimState:Hide("HAIR")
            owner.AnimState:Hide("HEAD")
            owner.AnimState:Show("HEAD_HAIR")
        inst.components.useableitem:StopUsingItem()
end
if owner and inst:HasTag("gogleoff") and not inst:HasTag("broken") then
	player.components.talker:Say("Goggle on !")
    inst.task = inst:DoPeriodicTask(1, function() consume(inst, owner) end)

        owner.AnimState:OverrideSymbol("swap_hat", "hat_mbunny2", "swap_hat")
        owner.AnimState:Show("HAT")
        owner.AnimState:Hide("HAT_HAIR")
        owner.AnimState:Hide("HAIR_NOHAT")
        owner.AnimState:Hide("HAIR")
            owner.AnimState:Hide("HEAD")
            owner.AnimState:Show("HEAD_HAIR")

        if inst:HasTag("level1")then
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(15)\n(LV 1)")
    inst.components.equippable.walkspeedmult = 1.15
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level2") then
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(16)\n(LV 2)")
    inst.components.equippable.walkspeedmult = 1.16
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level3") then
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(17)\n(LV 3)")
    inst.components.equippable.walkspeedmult = 1.17
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level4") then
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(18)\n(LV 4)")
    inst.components.equippable.walkspeedmult = 1.18
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level5") then
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(19)\n(LV 5)")
    inst.components.equippable.walkspeedmult = 1.19
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level6") then
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(20)\n(LV 6)")
   inst.components.equippable.walkspeedmult = 1.20
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level7") then
   inst.components.equippable.walkspeedmult = 1.21
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(21)\n(LV 7)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level8") then
   inst.components.equippable.walkspeedmult = 1.22
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(22)\n(LV 8)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level9") then
   inst.components.equippable.walkspeedmult = 1.23
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(23)\n(LV 9)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level10") then
   inst.components.equippable.walkspeedmult = 1.24
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(24)\n(LV 10)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level11") then
   inst.components.equippable.walkspeedmult = 1.25
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(25)\n(LV 11)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level12") then
   inst.components.equippable.walkspeedmult = 1.26
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(26)\n(LV 12)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level13") then
   inst.components.equippable.walkspeedmult = 1.27
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(27)\n(LV 13)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level14") then
   inst.components.equippable.walkspeedmult = 1.28
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(28)\n(LV 14)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level15") then
   inst.components.equippable.walkspeedmult = 1.29
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(29)\n(LV 15)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level16") then
   inst.components.equippable.walkspeedmult = 1.30
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(30)\n(LV 16)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level17") then
   inst.components.equippable.walkspeedmult = 1.31
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(31)\n(LV 17)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level18") then
   inst.components.equippable.walkspeedmult = 1.32
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(32)\n(LV 18)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level19") then
   inst.components.equippable.walkspeedmult = 1.33
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(33)\n(LV 19)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level20") then
   inst.components.equippable.walkspeedmult = 1.34
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(34)\n(LV 20)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level21") then
   inst.components.equippable.walkspeedmult = 1.35
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(35)\n(LV 21)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level22") then
   inst.components.equippable.walkspeedmult = 1.36
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(36)\n(LV 22)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level23") then
   inst.components.equippable.walkspeedmult = 1.37
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(37)\n(LV 23)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level24") then
   inst.components.equippable.walkspeedmult = 1.38
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(38)\n(LV 24)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level25") then
   inst.components.equippable.walkspeedmult = 1.39
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(39)\n(LV 25)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level26") then
   inst.components.equippable.walkspeedmult = 1.40
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(40)\n(LV 26)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level27") then
   inst.components.equippable.walkspeedmult = 1.41
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(41)\n(LV 27)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level28") then
   inst.components.equippable.walkspeedmult = 1.42
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(42)\n(LV 28)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level29") then
   inst.components.equippable.walkspeedmult = 1.43
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(43)\n(LV 29)")
	inst:RemoveTag("gogleoff") 

        elseif inst:HasTag("level30") then
   inst.components.equippable.walkspeedmult = 1.45
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(45)\n(LV 30)")
	inst:RemoveTag("gogleoff") 

end
        inst.components.useableitem:StopUsingItem()

-----------
elseif owner and not inst:HasTag("gogleoff") and not inst:HasTag("broken") then
	inst:AddTag("gogleoff") 
	player.components.talker:Say("Goggle off !")
	inst.components.talker:Say("-[Bunny Scout]\nSpeed up(10)\n(Base)")
    if inst.task then inst.task:Cancel() inst.task = nil end
    inst.components.equippable.walkspeedmult = 1.1

        owner.AnimState:OverrideSymbol("swap_hat", "hat_mbunny", "swap_hat")
        owner.AnimState:Show("HAT")
        owner.AnimState:Hide("HAT_HAIR")
        owner.AnimState:Hide("HAIR_NOHAT")
        owner.AnimState:Hide("HAIR")
            owner.AnimState:Hide("HEAD")
            owner.AnimState:Show("HEAD_HAIR")
        inst.components.useableitem:StopUsingItem()
end
end

---------------hat fn sim
	
local function fn(Sim)
	local inst = CreateEntity()
	local trans = inst.entity:AddTransform()
	local anim = inst.entity:AddAnimState()

    MakeInventoryPhysics(inst)
    
    inst:AddTag("hat")

    anim:SetBank("beehat")
    anim:SetBuild("hat_mbunny")

    anim:PlayAnimation("anim")    
        
    inst:AddComponent("inspectable")
    	
    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.atlasname = "images/inventoryimages/hat_mbunny.xml"

   inst:AddComponent("armor")
    inst.components.armor:InitCondition(9999999999999999999999999999999999999999999999999999999999999, 0.15)

inst:AddTag("gogleoff") 
inst:AddTag("level1")

            inst:AddComponent("useableitem")
     inst.components.useableitem:SetOnUseFn(gogleon)
        inst:AddComponent("equippable")
        inst.components.equippable.equipslot = EQUIPSLOTS.HEAD
        inst.components.equippable:SetOnEquip( onequip )
        inst.components.equippable:SetOnUnequip( onunequip )
    inst.components.equippable.walkspeedmult = 1.1

        inst:AddComponent("insulator")
        inst.components.insulator.insulation = TUNING.INSULATION_MED

    inst:AddComponent("talker")
    inst.components.talker.fontsize = 19
    inst.components.talker.font = TALKINGFONT
    inst.components.talker.colour = Vector3(0.8, 1, 0.65, 1)
    inst.components.talker.offset = Vector3(-200,-220,0)
    inst.components.talker.symbol = "swap_object"

	inst.level = 0
inst:ListenForEvent("levelup", levelexp)
	inst.OnSave = onsave
	inst.OnPreLoad = onpreload

        inst:AddComponent("fueled")
       inst.components.fueled.fueltype = "CHEMICAL"
        inst.components.fueled:InitializeFuelLevel(20000000)
       inst.components.fueled:SetDepletedFn(OnDurability)
        inst.components.fueled.ontakefuelfn = TakeItem
        inst.components.fueled.accepting = true
inst.components.fueled:StartConsuming()        

    return inst
end
---------------------------------
return Prefab( "common/inventory/hat_mbunny", fn, assets ) 
