YN031-全部物品无限使用(工具、武器、盔甲、魔杖、护身符、衣服、帽子、照明物品等全部无限使用)
代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 三十一.全部物品无限使用(工具、武器、盔甲、魔杖、护身符、衣服、帽子、照明物品等全部无限使用) 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/widgets/itemtile.lua文件,将下列内容: if invitem.components.fueled then self:SetPercent(invitem.components.fueled:GetPercent()) end if invitem.components.finiteuses then self:SetPercent(invitem.components.finiteuses:GetPercent()) end if invitem.components.perishable then if self:HasSpoilage() then self:SetPerishPercent(invitem.components.perishable:GetPercent()) else self:SetPercent(invitem.components.perishable:GetPercent()) end end if invitem.components.armor then self:SetPercent(invitem.components.armor:GetPercent()) end 替换为: --if invitem.components.fueled then --self:SetPercent(invitem.components.fueled:GetPercent()) --end --if invitem.components.finiteuses then --self:SetPercent(invitem.components.finiteuses:GetPercent()) --end if invitem.components.perishable then if self:HasSpoilage() then self:SetPerishPercent(invitem.components.perishable:GetPercent()) else self:SetPercent(invitem.components.perishable:GetPercent()) end end --if invitem.components.armor then --self:SetPercent(invitem.components.armor:GetPercent()) --end 2.用MT管理器打开游戏目录/assets/scripts/components/finiteuses.lua文件,将self:SetUses(self.current - (num or 1))替换为self:SetUses(self.current - 0) 3.用MT管理器打开游戏目录/assets/DLC0002/scripts/components/fueled.lua文件,将self.consuming = true替换为self.consuming = false 4.用MT管理器打开游戏目录/assets/scripts/components/armor.lua文件,将下列内容: function Armor:SetCondition(amount) self.condition = amount 替换为: function Armor:SetCondition(amount) self.condition = self.maxcondition 即可让全部物品无限使用。其中火堆和石头营火会无限燃烧,直到睡过帐篷或下地洞后熄灭