Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local assets =
- {
- Asset("ANIM", "anim/meatbat.zip"),
- Asset("ANIM", "anim/swap_meatbat.zip"),
- }
- local function onequip(inst, owner)
- owner.AnimState:OverrideSymbol("swap_object", "swap_meatbat", "swap_ham_bat")
- 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(Sim)
- local inst = CreateEntity()
- local trans = inst.entity:AddTransform()
- local anim = inst.entity:AddAnimState()
- MakeInventoryPhysics(inst)
- anim:SetBank("ham_bat")
- anim:SetBuild("meatbat")
- anim:PlayAnimation("idle")
- inst:AddComponent("weapon")
- inst.components.weapon:SetDamage(59.5)
- inst:AddTag("show_spoilage")
- inst:AddComponent("perishable")
- inst.components.perishable:SetPerishTime(TUNING.PERISH_MED)
- inst.components.perishable:StartPerishing()
- inst.components.perishable.onperishreplacement = "spoiled_food"
- inst:AddComponent("dapperness")
- inst.components.dapperness.dapperness = -0.05
- -------
- inst:AddComponent("inspectable")
- inst:AddComponent("inventoryitem")
- inst:AddComponent("equippable")
- inst.components.equippable:SetOnEquip( onequip )
- inst.components.equippable:SetOnUnequip( onunequip )
- inst.components.inventoryitem.atlasname = "images/inventoryimages/meatbat.xml"
- return inst
- end
- return Prefab( "common/inventory/meatbat", fn, assets)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement