Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local assets =
- {
- Asset("ANIM", "anim/myamulets.zip"),
- Asset("ANIM", "anim/torso_myamulets.zip"),
- Asset("ATLAS", "images/inventoryimages/skullamulet.xml"),
- Asset("IMAGE", "images/inventoryimages/skullamulet.tex"),
- }
- local function onequip(inst, owner)
- owner.AnimState:OverrideSymbol("swap_body", "torso_myamulets", "skullamulet")
- if inst.components.fueled then
- inst.components.fueled:StartConsuming()
- end
- owner.components.combat.damagemultiplier = 1+.5
- owner.components.health:SetAbsorptionAmount(-(TUNING.WATHGRITHR_ABSORPTION*120))
- end
- local function onunequip(inst, owner)
- owner.AnimState:ClearOverrideSymbol("swap_body")
- if inst.components.fueled then
- inst.components.fueled:StopConsuming()
- end
- owner.components.combat.damagemultiplier = 1
- owner.components.health:SetAbsorptionAmount(0)
- end
- local function fn()
- local inst = CreateEntity()
- inst.entity:AddTransform()
- inst.entity:AddAnimState()
- inst.entity:AddNetwork()
- MakeInventoryPhysics(inst)
- inst.AnimState:SetBank("amulets")
- inst.AnimState:SetBuild("myamulets")
- inst.AnimState:PlayAnimation("skullamulet")
- inst.entity:SetPristine()
- if not TheWorld.ismastersim then
- return inst
- end
- inst:AddComponent("fueled")
- inst.components.fueled.fueltype = FUELTYPE.MAGIC
- inst.components.fueled:InitializeFuelLevel(TUNING.RAINCOAT_PERISHTIME)
- inst.components.fueled:SetDepletedFn(inst.Remove)
- inst:AddComponent("inspectable")
- inst:AddComponent("inventoryitem")
- inst.components.inventoryitem.imagename = "skullamulet"
- inst.components.inventoryitem.atlasname = "images/inventoryimages/skullamulet.xml"
- inst:AddComponent("equippable")
- inst.components.equippable.equipslot = EQUIPSLOTS.NECK or EQUIPSLOTS.BODY
- inst.components.equippable.dapperness = -TUNING.DAPPERNESS_HUGE
- inst.components.equippable.walkspeedmult = 1.4
- inst.components.equippable:SetOnEquip( onequip )
- inst.components.equippable:SetOnUnequip( onunequip )
- MakeHauntableLaunch(inst)
- return inst
- end
- return Prefab( "skullamulet", fn, assets, prefabs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement