饥荒mod吧 关注:57,891贴子:235,600
  • 4回复贴,共1

如何添加镰刀收割代码,跪求大神指点

只看楼主收藏回复

local assets =
{
Asset("ANIM", "anim/scythe.zip"),
Asset("ANIM", "anim/swap_scythe.zip"),
}
local function onequip(inst, owner)
owner.AnimState:OverrideSymbol("swap_object", "swap_scythe", "swap_scythe")
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("scythe")
inst.AnimState:SetBuild("scythe")
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(15)
-------
inst:AddComponent("finiteuses")
inst.components.finiteuses:SetMaxUses(TUNING.SPEAR_USES*3)
inst.components.finiteuses:SetUses(TUNING.SPEAR_USES*3)
inst.components.finiteuses:SetOnFinished(inst.Remove)
inst:AddComponent("inspectable")
inst:AddComponent("inventoryitem")
inst.components.inventoryitem.atlasname = "images/inventoryimages/scythe.xml"
inst:AddComponent("equippable")
inst.components.equippable:SetOnEquip(onequip)
inst.components.equippable:SetOnUnequip(onunequip)
MakeHauntableLaunch(inst)
return inst
end
STRINGS.NAMES.SCYTHE= "Stone scythe"
STRINGS.RECIPE_DESC.SCYTHE = "Slice and dice."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.SCYTHE = "It would take a king to lift that up."
STRINGS.CHARACTERS.WILLOW.DESCRIBE.SCYTHE = "The scythe is the stone."
STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.SCYTHE = "Weapon suited for mighty Wolfgang!"
STRINGS.CHARACTERS.WENDY.DESCRIBE.SCYTHE = "The earth itself is my weapon."
STRINGS.CHARACTERS.WX78.DESCRIBE.SCYTHE = "INCREASES COMBAT EFFECTIVENESS"
STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.SCYTHE = "A primitive scythe made from a slate of flint."
STRINGS.CHARACTERS.WOODIE.DESCRIBE.SCYTHE = "Can it cut trees?"
STRINGS.CHARACTERS.WAXWELL.DESCRIBE.SCYTHE = "It is nothing compared to a real scythe."
STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE.SCYTHE = "A weapon made for battle."
STRINGS.CHARACTERS.WEBBER.DESCRIBE.SCYTHE = "It weighs a ton!"
return Prefab( "common/inventory/scythe", fn, assets)


1楼2017-07-25 21:46回复
    自己顶一个


    2楼2017-07-26 09:21
    回复
      收集代码是啥?就是拿着镰刀去收集(割)东西是吗,那么需要新写一个action来完成,并没有直接使用的代码


      来自Android客户端3楼2017-07-26 16:15
      收起回复