tweak kb code

This commit is contained in:
tenplus1 2024-11-06 14:24:49 +00:00
parent 6a03423cce
commit c3c5dd6c2d

View File

@ -269,8 +269,10 @@ local function punchy(
if tmp < 0 then tmp = 0.0 elseif tmp > 1 then tmp = 1.0 end if tmp < 0 then tmp = 0.0 elseif tmp > 1 then tmp = 1.0 end
if group ~= "knockback" then
damage = damage + (tool_capabilities.damage_groups[group] or 0) * tmp damage = damage + (tool_capabilities.damage_groups[group] or 0) * tmp
end end
end
-- if custom value found then use instead -- if custom value found then use instead
if tool_capabilities.damage_groups["knockback"] then if tool_capabilities.damage_groups["knockback"] then
@ -298,9 +300,10 @@ minetest.register_tool("playerplus:stick", {
description = "Sword of Boing", description = "Sword of Boing",
inventory_image = "playerplus_sword_boing.png", inventory_image = "playerplus_sword_boing.png",
wield_image = "playerplus_sword_boing.png", wield_image = "playerplus_sword_boing.png",
groups = {not_in_creative_inventory = 1},
tool_capabilities = { tool_capabilities = {
full_punch_interval = 1.4, full_punch_interval = 1.4,
damage_groups = {fleshy = 0, knockback = 11, not_in_creative_inventory = 1} damage_groups = {knockback = 11}
} }
}) })