local assets =
{
	Asset("ANIM", "anim/sword_rock.zip"),
	Asset("ANIM", "anim/swap_sword_rock.zip"),
}

local function onequip(inst, owner)
    owner.AnimState:OverrideSymbol("swap_object", "swap_sword_rock", "swap_sword_rock")
    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()

    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.entity:AddNetwork()

    MakeInventoryPhysics(inst)

    inst.AnimState:SetBank("sword_rock")
    inst.AnimState:SetBuild("sword_rock")
    inst.AnimState:PlayAnimation("idle")

    inst:AddTag("sharp")

	inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        return inst
    end

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

    -------

    inst:AddComponent("finiteuses")
    inst.components.finiteuses:SetMaxUses(TUNING.SPEAR_USES*1.5)
    inst.components.finiteuses:SetUses(TUNING.SPEAR_USES*1.5)

	inst.components.finiteuses:SetOnFinished(inst.Remove)

    inst:AddComponent("inspectable")

    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.atlasname = "images/inventoryimages/sword_rock.xml"

    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip(onequip)
    inst.components.equippable:SetOnUnequip(onunequip)

    MakeHauntableLaunch(inst)

    return inst
end

STRINGS.NAMES.SWORD_ROCK								= "Stone Sword"
STRINGS.RECIPE_DESC.SWORD_ROCK 							= "Slice and dice."

STRINGS.CHARACTERS.GENERIC.DESCRIBE.SWORD_ROCK 			= "It would take a king to lift that up."
STRINGS.CHARACTERS.WILLOW.DESCRIBE.SWORD_ROCK 			= "The sword is the stone."
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.SWORD_ROCK 		= "Weapon suited for mighty Wolfgang!"
STRINGS.CHARACTERS.WENDY.DESCRIBE.SWORD_ROCK 			= "The earth itself is my weapon."
STRINGS.CHARACTERS.WX78.DESCRIBE.SWORD_ROCK 			= "INCREASES COMBAT EFFECTIVENESS"
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.SWORD_ROCK 	= "A primitive sword made from a slate of rock."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.SWORD_ROCK 			= "Can it cut trees?"
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.SWORD_ROCK 			= "It is nothing compared to a real sword."
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.SWORD_ROCK 		= "A weapon made for battle."
STRINGS.CHARACTERS.WEBBER.DESCRIBE.SWORD_ROCK 			= "It weighs a ton!"

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