Project Zomboid

Project Zomboid

92 次評價
Infinite weapons durability
   
獎勵
加入最愛
已加入最愛
移除最愛
檔案大小
發佈於
更新時間
291.153 KB
2024 年 12 月 18 日 上午 5:23
1 月 29 日 上午 11:54
2 項更新註記 (檢視)

訂閱以下載
Infinite weapons durability

描述
Infinite weapons durability, by GhostLexly. fixed to B42

Original mod: https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2747095819&searchtext=infinite+weapons

Workshop ID: 3386659539
Mod ID: InfWeapons
17 則留言
Tidurian 3 月 5 日 下午 1:45 
if PrimaryItem:getCondition() ~= PrimaryItem:getConditionMax() or PrimaryItem:getHeadCondition() ~= PrimaryItem:getHeadConditionMax() or PrimaryItem:getSharpness() ~= PrimaryItem:getMaxSharpness() then

and

if SecondaryItem:getCondition() ~= SecondaryItem:getConditionMax() or SecondaryItem:getHeadCondition() ~= SecondaryItem:getHeadConditionMax() or SecondaryItem:getSharpness() ~= SecondaryItem:getMaxSharpness() then

those are one continous line. Steam breaks them into three lines.
Tidurian 3 月 5 日 下午 1:38 
@Thrice should not matter but "every line below a IF "one tab in" every "end" one tab back. but yeah should not matter.
Thrice 3 月 5 日 下午 1:37 
@Tildurian - Steam removed any formatting in that text you posted. Does that matter? Total lua noob.
Tidurian 2 月 10 日 上午 12:00 
Core.Main = function()
local player = getPlayer();
if player ~= null then
local PrimaryItem = player:getPrimaryHandItem();
local SecondaryItem = player:getSecondaryHandItem();
if PrimaryItem ~= nil then
if PrimaryItem:getCondition() ~= PrimaryItem:getConditionMax() or PrimaryItem:getHeadCondition() ~= PrimaryItem:getHeadConditionMax() or PrimaryItem:getSharpness() ~= PrimaryItem:getMaxSharpness() then
Core.DoRepair(PrimaryItem)
end
end
if SecondaryItem ~= nil then
if SecondaryItem:getCondition() ~= SecondaryItem:getConditionMax() or SecondaryItem:getHeadCondition() ~= SecondaryItem:getHeadConditionMax() or SecondaryItem:getSharpness() ~= SecondaryItem:getMaxSharpness() then
Core.DoRepair(SecondaryItem)
end
end
end
end
Tidurian 2 月 9 日 下午 11:54 
Core.DoRepair = function(ItemToRepair)
-- sets the maximum conditions
ItemToRepair:setCondition(ItemToRepair:getConditionMax() )
ItemToRepair:setHeadCondition(ItemToRepair:getHeadConditionMax())
if ItemToRepair:hasSharpness() then ItemToRepair:applyMaxSharpness() end
end
Tidurian 2 月 9 日 下午 11:54 
i went ahead and rewrote the entire "infiniteWeaponsDurability.lua" includes sharpness and also checks the secondary hand. also replaced reoccuring checks with local Variables. (should be better for performance)

will be a multipost since Steam dosnt allows me more then 1000 letters for comments....
Tidurian 2 月 9 日 下午 11:37 
Feature suggestion b42 : Keep bladed items sharpened as well as repaired. i already know the function to use within your mod : just add in your "Core.DoRepair function" : "if ItemToRepair:hasSharpness() then ItemToRepair:applyMaxSharpness() end"
TimmyNeutron 1 月 22 日 下午 3:14 
@Bryoda thank you so much kind sir your code works <3
TarLink 1 月 14 日 上午 3:16 
@Bryoda , thanks, I used your code and it works ! :steamthumbsup:
TarLink 1 月 11 日 下午 5:02 
I confirm, the axe broke, but the handle is still there !