游戏达人
![Rank: 7](static/image/common/star_level3.gif) ![Rank: 7](static/image/common/star_level2.gif) ![Rank: 7](static/image/common/star_level1.gif)
- 贡献度
- 80
- 金元
- 18917
- 积分
- 2222
- 精华
- 1
- 注册时间
- 2010-11-27
|
打死、烤肉酱 发表于 2013-9-2 20:28 ![](static/image/common/back.gif)
我是说可以把人骨和墓碑可以像打矿石一样用锄头把它打掉
这已经属于重新设计游戏了,今后请避免提问类似重新设计游戏和做mod的问题,因为比对代码和测试需要大量时间
一.墓碑可做矿石开采:用记事本打开游戏目录\data\scripts\prefabs\gravestone.lua文件,在MakeObstaclePhysics(inst, .25)的下一行插入以下内容:
inst:AddComponent("lootdropper")
inst:AddComponent("workable")
inst.components.workable:SetWorkAction(ACTIONS.MINE)
inst.components.workable:SetWorkLeft(TUNING.ROCKS_MINE)
inst.components.workable:SetOnWorkCallback(
function(inst, worker, workleft)
local pt = Point(inst.Transform:GetWorldPosition())
if workleft <= 0 then
inst.components.lootdropper:DropLoot(pt)
inst:Remove()
end
end)
inst.components.lootdropper:SetLoot({"rocks", "rocks", "rocks", "nitre", "flint"})
inst.components.lootdropper:AddChanceLoot("nitre", 0.25)
inst.components.lootdropper:AddChanceLoot("bluegem", 0.5)
inst.components.lootdropper:AddChanceLoot("redgem", 0.5)
inst.components.lootdropper:AddChanceLoot("orangegem", 0.5)
inst.components.lootdropper:AddChanceLoot("yellowgem", 0.5)
inst.components.lootdropper:AddChanceLoot("greengem", 0.5)
inst.components.lootdropper:AddChanceLoot("thulecite", 0.5)
inst.components.lootdropper:AddChanceLoot("flint", 0.6)
即可让墓碑可做矿石开采,其中rocks、nitre、flint、bluegem等为物品名,可自行修改为其他物品
二.人骨可做矿石开采:用记事本打开游戏目录\data\scripts\prefabs\skeleton.lua文件,在MakeObstaclePhysics(inst, 0.25)的下一行插入以下内容:
inst:AddComponent("lootdropper")
inst:AddComponent("workable")
inst.components.workable:SetWorkAction(ACTIONS.MINE)
inst.components.workable:SetWorkLeft(TUNING.ROCKS_MINE)
inst.components.workable:SetOnWorkCallback(
function(inst, worker, workleft)
local pt = Point(inst.Transform:GetWorldPosition())
if workleft <= 0 then
inst.components.lootdropper:DropLoot(pt)
inst:Remove()
end
end)
inst.components.lootdropper:SetLoot({"rocks", "rocks", "rocks", "nitre", "flint"})
inst.components.lootdropper:AddChanceLoot("nitre", 0.25)
inst.components.lootdropper:AddChanceLoot("bluegem", 0.5)
inst.components.lootdropper:AddChanceLoot("redgem", 0.5)
inst.components.lootdropper:AddChanceLoot("orangegem", 0.5)
inst.components.lootdropper:AddChanceLoot("yellowgem", 0.5)
inst.components.lootdropper:AddChanceLoot("greengem", 0.5)
inst.components.lootdropper:AddChanceLoot("thulecite", 0.5)
inst.components.lootdropper:AddChanceLoot("flint", 0.6)
即可让人骨可做矿石开采,其中rocks、nitre、flint、bluegem等为物品名,可自行修改为其他物品
|
|