Advertisement
Guest User

Untitled

a guest
Jan 15th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. local assets =
  2. {
  3. Asset("ANIM", "anim/meatbat.zip"),
  4. Asset("ANIM", "anim/swap_meatbat.zip"),
  5. }
  6.  
  7. local function onequip(inst, owner)
  8. owner.AnimState:OverrideSymbol("swap_object", "swap_meatbat", "swap_ham_bat")
  9. owner.AnimState:Show("ARM_carry")
  10. owner.AnimState:Hide("ARM_normal")
  11. end
  12.  
  13. local function onunequip(inst, owner)
  14. owner.AnimState:Hide("ARM_carry")
  15. owner.AnimState:Show("ARM_normal")
  16. end
  17.  
  18. local function fn(Sim)
  19. local inst = CreateEntity()
  20. local trans = inst.entity:AddTransform()
  21. local anim = inst.entity:AddAnimState()
  22. MakeInventoryPhysics(inst)
  23.  
  24. anim:SetBank("ham_bat")
  25. anim:SetBuild("meatbat")
  26. anim:PlayAnimation("idle")
  27.  
  28. inst:AddComponent("weapon")
  29. inst.components.weapon:SetDamage(59.5)
  30.  
  31. inst:AddTag("show_spoilage")
  32.  
  33. inst:AddComponent("perishable")
  34. inst.components.perishable:SetPerishTime(TUNING.PERISH_MED)
  35. inst.components.perishable:StartPerishing()
  36. inst.components.perishable.onperishreplacement = "spoiled_food"
  37.  
  38. inst:AddComponent("dapperness")
  39. inst.components.dapperness.dapperness = -0.05
  40. -------
  41.  
  42.  
  43. inst:AddComponent("inspectable")
  44.  
  45. inst:AddComponent("inventoryitem")
  46.  
  47. inst:AddComponent("equippable")
  48. inst.components.equippable:SetOnEquip( onequip )
  49. inst.components.equippable:SetOnUnequip( onunequip )
  50.  
  51. inst.components.inventoryitem.atlasname = "images/inventoryimages/meatbat.xml"
  52.  
  53. return inst
  54. end
  55.  
  56. return Prefab( "common/inventory/meatbat", fn, assets)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement