Project Zomboid

Project Zomboid

92 lượt đánh giá
Infinite weapons durability
   
Giải thưởng
Yêu thích
Đã yêu thích
Bỏ thích
Kích cỡ file
Đã đăng
Đã cập nhật
291.153 KB
18 Thg12, 2024 @ 5:23am
29 Thg01 @ 11:54am
2 ghi chú thay đổi ( xem )

Đăng ký để tải xuống
Infinite weapons durability

Mô tả
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 bình luận
Tidurian 5 Thg03 @ 1:45pm 
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 5 Thg03 @ 1:38pm 
@Thrice should not matter but "every line below a IF "one tab in" every "end" one tab back. but yeah should not matter.
Thrice 5 Thg03 @ 1:37pm 
@Tildurian - Steam removed any formatting in that text you posted. Does that matter? Total lua noob.
Tidurian 10 Thg02 @ 12:00am 
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 9 Thg02 @ 11:54pm 
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 9 Thg02 @ 11:54pm 
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 9 Thg02 @ 11:37pm 
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 22 Thg01 @ 3:14pm 
@Bryoda thank you so much kind sir your code works <3
TarLink 14 Thg01 @ 3:16am 
@Bryoda , thanks, I used your code and it works ! :steamthumbsup:
TarLink 11 Thg01 @ 5:02pm 
I confirm, the axe broke, but the handle is still there !