代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
二十六.伍迪吃疯肉立即变海狸且随身物品不掉落
用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/woodie.lua文件,
1.将inst.components.inventory:DropEverything()替换为--inst.components.inventory:DropEverything()
2.在inst.Light:SetColour(245/255,40/255,0/255)的下一行插入以下内容:
local function OnEat(inst, food)
if food.prefab == "monstermeat" and not inst.components.beaverness:IsBeaver() then
if not inst.components.beaverness.doing_transform then
inst.components.beaverness:SetPercent(1)
end
end
end
inst.components.eater:SetOnEatFn(OnEat)
即可让伍迪吃疯肉立即变海狸,随身物品还保留在身上(只是看不见),等变回伍迪即可使用。不要在伍迪佩戴橙色护身符时变海狸,否则砍的木头都自动被吸走,海狸无法吃到。不要与“小病小灾”一同修改