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




local function onAttackqimei(inst, owner, target)



end




    local function onequip(inst, owner)
        owner.AnimState:OverrideSymbol("swap_object", "swap_xk", "swap_galientsword")
        owner.AnimState:Show("ARM_carry") 
        owner.AnimState:Hide("ARM_normal") 
    end

    local function onunequip(inst, owner) 
        owner.AnimState:Hide("ARM_carry") 
        owner.AnimState:Show("ARM_normal") 
    end








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

    MakeInventoryPhysics(inst)
    local minimap = inst.entity:AddMiniMapEntity()
    minimap:SetIcon("sword_7.tex")
	
    inst.AnimState:SetBank("galientsword")
    inst.AnimState:SetBuild("xk")
    inst.AnimState:PlayAnimation("idle")
    
	--inst:AddTag("shadow")
	--inst:AddTag("feng")
    inst:AddTag("sharp")
    inst:AddTag("weapon_sword")
    --inst:AddTag("extinguisher")
	


    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(40)

    -------
    inst.components.weapon:SetRange(1.5)
    inst.components.weapon:SetOnAttack(onAttackqimei)


	
    inst:AddComponent("inspectable")
	


    inst:AddComponent("inventoryitem")
	inst.components.inventoryitem.imagename = "xk"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/xk.xml"
	--inst.components.inventoryitem.nobounce = true
	inst.components.inventoryitem.keepondeath = true


	inst:AddComponent("talker")
    inst.components.talker.fontsize = 36
    inst.components.talker.font = TALKINGFONT
    inst.components.talker.colour = Vector3(.9, .4, .4)
    inst.components.talker.offset = Vector3(0, 0, 0)
    inst.components.talker.symbol = "swap_object"
	inst.Transform:SetScale(1.5,1.5,1.5)
	
    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip(onequip)
    inst.components.equippable:SetOnUnequip(onunequip)
    --inst.components.equippable.dapperness = 20/60
	
	if not IsDLCEnabled(REIGN_OF_GIANTS) then
    MakeInventoryFloatable(inst, "idle_water", "anim")
    inst.components.equippable.poisonblocker = true
	inst:AddComponent("windproofer")
	inst.components.windproofer:SetEffectiveness(0) 
end
	
--inst:AddComponent("tool")
--inst.components.tool:SetAction(ACTIONS.HACK,2)
--inst.components.tool:SetAction(ACTIONS.CHOP, 5)
--inst.components.tool:SetAction(ACTIONS.MINE, 2)

 
	
    return inst
end

return Prefab( "common/inventory/sword_7", fn, assets)