Skip to content

Commit 2f871e3

Browse files
authoredOct 13, 2020
Devtest hand tool: Update capabilities, add creative mode capabilities (#10484)
1 parent fc2e120 commit 2f871e3

File tree

1 file changed

+44
-16
lines changed

1 file changed

+44
-16
lines changed
 

‎games/devtest/mods/basetools/init.lua

+44-16
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
Tool types:
88
9-
* Hand: basic tool/weapon (just for convenience, not optimized for testing)
9+
* Hand: basic tool/weapon (special capabilities in creative mode)
1010
* Pickaxe: dig cracky
1111
* Axe: dig choppy
1212
* Shovel: dig crumbly
@@ -24,21 +24,49 @@ Tool materials:
2424
]]
2525

2626
-- The hand
27-
minetest.register_item(":", {
28-
type = "none",
29-
wield_image = "wieldhand.png",
30-
wield_scale = {x=1,y=1,z=2.5},
31-
tool_capabilities = {
32-
full_punch_interval = 1.0,
33-
max_drop_level = 0,
34-
groupcaps = {
35-
crumbly = {times={[3]=1.50}, uses=0, maxlevel=0},
36-
snappy = {times={[3]=1.50}, uses=0, maxlevel=0},
37-
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=2.00}, uses=0, maxlevel=0},
38-
},
39-
damage_groups = {fleshy=1},
40-
}
41-
})
27+
if minetest.settings:get_bool("creative_mode") then
28+
local digtime = 42
29+
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
30+
31+
minetest.register_item(":", {
32+
type = "none",
33+
wield_image = "wieldhand.png",
34+
wield_scale = {x = 1, y = 1, z = 2.5},
35+
range = 10,
36+
tool_capabilities = {
37+
full_punch_interval = 0.5,
38+
max_drop_level = 3,
39+
groupcaps = {
40+
crumbly = caps,
41+
cracky = caps,
42+
snappy = caps,
43+
choppy = caps,
44+
oddly_breakable_by_hand = caps,
45+
-- dig_immediate group doesn't use value 1. Value 3 is instant dig
46+
dig_immediate =
47+
{times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256},
48+
},
49+
damage_groups = {fleshy = 10},
50+
}
51+
})
52+
else
53+
minetest.register_item(":", {
54+
type = "none",
55+
wield_image = "wieldhand.png",
56+
wield_scale = {x = 1, y = 1, z = 2.5},
57+
tool_capabilities = {
58+
full_punch_interval = 0.9,
59+
max_drop_level = 0,
60+
groupcaps = {
61+
crumbly = {times = {[2] = 3.00, [3] = 0.70}, uses = 0, maxlevel = 1},
62+
snappy = {times = {[3] = 0.40}, uses = 0, maxlevel = 1},
63+
oddly_breakable_by_hand =
64+
{times = {[1] = 3.50, [2] = 2.00, [3] = 0.70}, uses = 0}
65+
},
66+
damage_groups = {fleshy = 1},
67+
}
68+
})
69+
end
4270

4371
-- Mese Pickaxe: special tool that digs "everything" instantly
4472
minetest.register_tool("basetools:pick_mese", {

0 commit comments

Comments
 (0)
Please sign in to comment.