From 71c9d20fff3b19a8738765bdf7d6642fb8ee4cd1 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 8 Apr 2020 04:07:16 +0200 Subject: [PATCH] Use larger wield scale for tools --- mods/ENTITIES/mcl_item_entity/init.lua | 20 ++++++++++---------- mods/ITEMS/mcl_bows/bow.lua | 2 ++ mods/ITEMS/mcl_farming/hoes.lua | 5 +++++ mods/ITEMS/mcl_fishing/init.lua | 2 ++ mods/ITEMS/mcl_tools/init.lua | 22 ++++++++++++++++++++++ 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 689dfd386..7e2d0858e 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -350,8 +350,6 @@ minetest.register_entity(":__builtin:item", { count = max_count self.itemstring = stack:get_name().." "..max_count end - local s = 0.2 + 0.1 * (count / max_count) - local c = s local itemtable = stack:to_table() local itemname = nil local description = "" @@ -360,16 +358,18 @@ minetest.register_entity(":__builtin:item", { end local item_texture = nil local item_type = "" - if minetest.registered_items[itemname] then - item_texture = minetest.registered_items[itemname].inventory_image - item_type = minetest.registered_items[itemname].type - description = minetest.registered_items[itemname].description - end - local ndef = minetest.registered_items[itemname] local glow - if ndef then - glow = ndef.light_source + local def = minetest.registered_items[itemname] + if def then + item_texture = def.inventory_image + item_type = def.type + description = def.description + glow = def.light_source end + local s = 0.2 + 0.1 * (count / max_count) + local wield_scale = (def and def.wield_scale and def.wield_scale.x) or 1 + local c = s + s = s / wield_scale local prop = { is_visible = true, visual = "wielditem", diff --git a/mods/ITEMS/mcl_bows/bow.lua b/mods/ITEMS/mcl_bows/bow.lua index 9b64bd514..3bae7687c 100644 --- a/mods/ITEMS/mcl_bows/bow.lua +++ b/mods/ITEMS/mcl_bows/bow.lua @@ -104,6 +104,7 @@ S("The speed and damage of the arrow increases the longer you charge. The regula _doc_items_usagehelp = S("To use the bow, you first need to have at least one arrow anywhere in your inventory (unless in Creative Mode). Hold down the right mouse button to charge, release to shoot."), _doc_items_durability = BOW_DURABILITY, inventory_image = "mcl_bows_bow.png", + wield_scale = { x = 1.8, y = 1.8, z = 1 }, stack_max = 1, -- Trick to disable melee damage to entities. -- Range not set to 0 (unlike the others) so it can be placed into item frames @@ -144,6 +145,7 @@ for level=0, 2 do description = S("Bow"), _doc_items_create_entry = false, inventory_image = "mcl_bows_bow_"..level..".png", + wield_scale = { x = 1.8, y = 1.8, z = 1 }, stack_max = 1, range = 0, -- Pointing range to 0 to prevent punching with bow :D groups = {not_in_creative_inventory=1, not_in_craft_guide=1}, diff --git a/mods/ITEMS/mcl_farming/hoes.lua b/mods/ITEMS/mcl_farming/hoes.lua index 8a6f9527a..f296bd838 100644 --- a/mods/ITEMS/mcl_farming/hoes.lua +++ b/mods/ITEMS/mcl_farming/hoes.lua @@ -68,6 +68,7 @@ minetest.register_tool("mcl_farming:hoe_wood", { _doc_items_usagehelp = hoe_usagehelp, _doc_items_hidden = false, inventory_image = "farming_tool_woodhoe.png", + wield_scale = { x = 1.8, y = 1.8, z = 1 }, on_place = hoe_on_place_function(uses.wood), groups = { tool=1, hoe=1 }, tool_capabilities = { @@ -106,6 +107,7 @@ minetest.register_tool("mcl_farming:hoe_stone", { _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_stonehoe.png", + wield_scale = { x = 1.8, y = 1.8, z = 1 }, on_place = hoe_on_place_function(uses.stone), groups = { tool=1, hoe=1 }, tool_capabilities = { @@ -139,6 +141,7 @@ minetest.register_tool("mcl_farming:hoe_iron", { _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_steelhoe.png", + wield_scale = { x = 1.8, y = 1.8, z = 1 }, on_place = hoe_on_place_function(uses.iron), groups = { tool=1, hoe=1 }, tool_capabilities = { @@ -180,6 +183,7 @@ minetest.register_tool("mcl_farming:hoe_gold", { _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_goldhoe.png", + wield_scale = { x = 1.8, y = 1.8, z = 1 }, on_place = hoe_on_place_function(uses.gold), groups = { tool=1, hoe=1 }, tool_capabilities = { @@ -222,6 +226,7 @@ minetest.register_tool("mcl_farming:hoe_diamond", { _doc_items_longdesc = hoe_longdesc, _doc_items_usagehelp = hoe_usagehelp, inventory_image = "farming_tool_diamondhoe.png", + wield_scale = { x = 1.8, y = 1.8, z = 1 }, on_place = hoe_on_place_function(uses.diamond), groups = { tool=1, hoe=1 }, tool_capabilities = { diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index e5c4698ca..53eefdad3 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -313,6 +313,8 @@ minetest.register_tool("mcl_fishing:fishing_rod", { _doc_items_usagehelp = S("Rightclick to launch the bobber. When it sinks right-click again to reel in an item. Who knows what you're going to catch?"), groups = { tool=1 }, inventory_image = "mcl_fishing_fishing_rod.png", + wield_image = "mcl_fishing_fishing_rod.png^[transformR270", + wield_scale = { x = 1.5, y = 1.5, z = 1 }, stack_max = 1, on_place = fish, on_secondary_use = fish, diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index 8f476d726..7cd6f9b9c 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -72,12 +72,15 @@ local shovel_use = S("To turn a grass block into a grass path, hold the shovel i local shears_longdesc = S("Shears are tools to shear sheep and to mine a few block types. Shears are a special mining tool and can be used to obtain the original item from grass, leaves and similar blocks that require cutting.") local shears_use = S("To shear sheep or carve faceless pumpkins, use the “place” key on them. Faces can only be carved at the side of faceless pumpkins. Mining works as usual, but the drops are different for a few blocks.") +local wield_scale = { x = 1.8, y = 1.8, z = 1 } + -- Picks minetest.register_tool("mcl_tools:pick_wood", { description = S("Wooden Pickaxe"), _doc_items_longdesc = pickaxe_longdesc, _doc_items_hidden = false, inventory_image = "default_tool_woodpick.png", + wield_scale = wield_scale, groups = { tool=1, pickaxe=1, dig_speed_class=2, }, tool_capabilities = { -- 1/1.2 @@ -96,6 +99,7 @@ minetest.register_tool("mcl_tools:pick_stone", { description = S("Stone Pickaxe"), _doc_items_longdesc = pickaxe_longdesc, inventory_image = "default_tool_stonepick.png", + wield_scale = wield_scale, groups = { tool=1, pickaxe=1, dig_speed_class=3, }, tool_capabilities = { -- 1/1.2 @@ -114,6 +118,7 @@ minetest.register_tool("mcl_tools:pick_iron", { description = S("Iron Pickaxe"), _doc_items_longdesc = pickaxe_longdesc, inventory_image = "default_tool_steelpick.png", + wield_scale = wield_scale, groups = { tool=1, pickaxe=1, dig_speed_class=4, }, tool_capabilities = { -- 1/1.2 @@ -132,6 +137,7 @@ minetest.register_tool("mcl_tools:pick_gold", { description = S("Golden Pickaxe"), _doc_items_longdesc = pickaxe_longdesc, inventory_image = "default_tool_goldpick.png", + wield_scale = wield_scale, groups = { tool=1, pickaxe=1, dig_speed_class=6, }, tool_capabilities = { -- 1/1.2 @@ -150,6 +156,7 @@ minetest.register_tool("mcl_tools:pick_diamond", { description = S("Diamond Pickaxe"), _doc_items_longdesc = pickaxe_longdesc, inventory_image = "default_tool_diamondpick.png", + wield_scale = wield_scale, groups = { tool=1, pickaxe=1, dig_speed_class=5, }, tool_capabilities = { -- 1/1.2 @@ -269,6 +276,7 @@ minetest.register_tool("mcl_tools:shovel_wood", { _doc_items_hidden = false, inventory_image = "default_tool_woodshovel.png", wield_image = "default_tool_woodshovel.png^[transformR90", + wield_scale = wield_scale, groups = { tool=1, shovel=1, dig_speed_class=2, }, tool_capabilities = { full_punch_interval = 1, @@ -289,6 +297,7 @@ minetest.register_tool("mcl_tools:shovel_stone", { _doc_items_usagehelp = shovel_use, inventory_image = "default_tool_stoneshovel.png", wield_image = "default_tool_stoneshovel.png^[transformR90", + wield_scale = wield_scale, groups = { tool=1, shovel=1, dig_speed_class=3, }, tool_capabilities = { full_punch_interval = 1, @@ -309,6 +318,7 @@ minetest.register_tool("mcl_tools:shovel_iron", { _doc_items_usagehelp = shovel_use, inventory_image = "default_tool_steelshovel.png", wield_image = "default_tool_steelshovel.png^[transformR90", + wield_scale = wield_scale, groups = { tool=1, shovel=1, dig_speed_class=4, }, tool_capabilities = { full_punch_interval = 1, @@ -329,6 +339,7 @@ minetest.register_tool("mcl_tools:shovel_gold", { _doc_items_usagehelp = shovel_use, inventory_image = "default_tool_goldshovel.png", wield_image = "default_tool_goldshovel.png^[transformR90", + wield_scale = wield_scale, groups = { tool=1, shovel=1, dig_speed_class=6, }, tool_capabilities = { full_punch_interval = 1, @@ -349,6 +360,7 @@ minetest.register_tool("mcl_tools:shovel_diamond", { _doc_items_usagehelp = shovel_use, inventory_image = "default_tool_diamondshovel.png", wield_image = "default_tool_diamondshovel.png^[transformR90", + wield_scale = wield_scale, groups = { tool=1, shovel=1, dig_speed_class=5, }, tool_capabilities = { full_punch_interval = 1, @@ -370,6 +382,7 @@ minetest.register_tool("mcl_tools:axe_wood", { _doc_items_longdesc = axe_longdesc, _doc_items_hidden = false, inventory_image = "default_tool_woodaxe.png", + wield_scale = wield_scale, groups = { tool=1, axe=1, dig_speed_class=2, }, tool_capabilities = { full_punch_interval = 1.25, @@ -387,6 +400,7 @@ minetest.register_tool("mcl_tools:axe_stone", { description = S("Stone Axe"), _doc_items_longdesc = axe_longdesc, inventory_image = "default_tool_stoneaxe.png", + wield_scale = wield_scale, groups = { tool=1, axe=1, dig_speed_class=3, }, tool_capabilities = { full_punch_interval = 1.25, @@ -404,6 +418,7 @@ minetest.register_tool("mcl_tools:axe_iron", { description = S("Iron Axe"), _doc_items_longdesc = axe_longdesc, inventory_image = "default_tool_steelaxe.png", + wield_scale = wield_scale, groups = { tool=1, axe=1, dig_speed_class=4, }, tool_capabilities = { -- 1/0.9 @@ -422,6 +437,7 @@ minetest.register_tool("mcl_tools:axe_gold", { description = S("Golden Axe"), _doc_items_longdesc = axe_longdesc, inventory_image = "default_tool_goldaxe.png", + wield_scale = wield_scale, groups = { tool=1, axe=1, dig_speed_class=6, }, tool_capabilities = { full_punch_interval = 1.0, @@ -439,6 +455,7 @@ minetest.register_tool("mcl_tools:axe_diamond", { description = S("Diamond Axe"), _doc_items_longdesc = axe_longdesc, inventory_image = "default_tool_diamondaxe.png", + wield_scale = wield_scale, groups = { tool=1, axe=1, dig_speed_class=5, }, tool_capabilities = { full_punch_interval = 1.0, @@ -459,6 +476,7 @@ minetest.register_tool("mcl_tools:sword_wood", { _doc_items_longdesc = sword_longdesc, _doc_items_hidden = false, inventory_image = "default_tool_woodsword.png", + wield_scale = wield_scale, groups = { weapon=1, sword=1, dig_speed_class=2, }, tool_capabilities = { full_punch_interval = 0.625, @@ -477,6 +495,7 @@ minetest.register_tool("mcl_tools:sword_stone", { description = S("Stone Sword"), _doc_items_longdesc = sword_longdesc, inventory_image = "default_tool_stonesword.png", + wield_scale = wield_scale, groups = { weapon=1, sword=1, dig_speed_class=3, }, tool_capabilities = { full_punch_interval = 0.625, @@ -495,6 +514,7 @@ minetest.register_tool("mcl_tools:sword_iron", { description = S("Iron Sword"), _doc_items_longdesc = sword_longdesc, inventory_image = "default_tool_steelsword.png", + wield_scale = wield_scale, groups = { weapon=1, sword=1, dig_speed_class=4, }, tool_capabilities = { full_punch_interval = 0.625, @@ -513,6 +533,7 @@ minetest.register_tool("mcl_tools:sword_gold", { description = S("Golden Sword"), _doc_items_longdesc = sword_longdesc, inventory_image = "default_tool_goldsword.png", + wield_scale = wield_scale, groups = { weapon=1, sword=1, dig_speed_class=6, }, tool_capabilities = { full_punch_interval = 0.625, @@ -531,6 +552,7 @@ minetest.register_tool("mcl_tools:sword_diamond", { description = S("Diamond Sword"), _doc_items_longdesc = sword_longdesc, inventory_image = "default_tool_diamondsword.png", + wield_scale = wield_scale, groups = { weapon=1, sword=1, dig_speed_class=5, }, tool_capabilities = { full_punch_interval = 0.625,