9 * Hand: basic tool/weapon (special capabilities in creative mode)
15 * Dagger: deal damage, but faster
19 * Wood: dig nodes of rating 3
20 * Stone: dig nodes of rating 3 or 2
21 * Steel: dig nodes of rating 3, 2 or 1
22 * Mese: dig "everything" instantly
23 * n-Uses: can be used n times before breaking
27 if minetest.settings:get_bool("creative_mode") then
29 local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}
31 minetest.register_item(":", {
33 wield_image = "wieldhand.png",
34 wield_scale = {x = 1, y = 1, z = 2.5},
37 full_punch_interval = 0.5,
44 oddly_breakable_by_hand = caps,
45 -- dig_immediate group doesn't use value 1. Value 3 is instant dig
47 {times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256},
49 damage_groups = {fleshy = 10},
53 minetest.register_item(":", {
55 wield_image = "wieldhand.png",
56 wield_scale = {x = 1, y = 1, z = 2.5},
58 full_punch_interval = 0.9,
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}
66 damage_groups = {fleshy = 1},
71 -- Mese Pickaxe: special tool that digs "everything" instantly
72 minetest.register_tool("basetools:pick_mese", {
73 description = "Mese Pickaxe".."\n"..
74 "Digs diggable nodes instantly",
75 inventory_image = "basetools_mesepick.png",
77 full_punch_interval = 1.0,
80 cracky={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
81 crumbly={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
82 snappy={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
83 choppy={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
84 dig_immediate={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
86 damage_groups = {fleshy=100},
92 -- Pickaxes: Dig cracky
95 minetest.register_tool("basetools:pick_wood", {
96 description = "Wooden Pickaxe".."\n"..
98 inventory_image = "basetools_woodpick.png",
102 cracky={times={[3]=2.00}, uses=30, maxlevel=0}
106 minetest.register_tool("basetools:pick_stone", {
107 description = "Stone Pickaxe".."\n"..
109 inventory_image = "basetools_stonepick.png",
110 tool_capabilities = {
113 cracky={times={[2]=1.20, [3]=0.80}, uses=60, maxlevel=0}
117 minetest.register_tool("basetools:pick_steel", {
118 description = "Steel Pickaxe".."\n"..
120 inventory_image = "basetools_steelpick.png",
121 tool_capabilities = {
124 cracky={times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=90, maxlevel=0}
128 minetest.register_tool("basetools:pick_steel_l1", {
129 description = "Steel Pickaxe Level 1".."\n"..
130 "Digs cracky=1..3".."\n"..
132 inventory_image = "basetools_steelpick_l1.png",
133 tool_capabilities = {
136 cracky={times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=90, maxlevel=1}
140 minetest.register_tool("basetools:pick_steel_l2", {
141 description = "Steel Pickaxe Level 2".."\n"..
142 "Digs cracky=1..3".."\n"..
144 inventory_image = "basetools_steelpick_l2.png",
145 tool_capabilities = {
148 cracky={times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=90, maxlevel=2}
154 -- Shovels (dig crumbly)
157 minetest.register_tool("basetools:shovel_wood", {
158 description = "Wooden Shovel".."\n"..
160 inventory_image = "basetools_woodshovel.png",
161 tool_capabilities = {
164 crumbly={times={[3]=0.50}, uses=30, maxlevel=0}
168 minetest.register_tool("basetools:shovel_stone", {
169 description = "Stone Shovel".."\n"..
171 inventory_image = "basetools_stoneshovel.png",
172 tool_capabilities = {
175 crumbly={times={[2]=0.50, [3]=0.30}, uses=60, maxlevel=0}
179 minetest.register_tool("basetools:shovel_steel", {
180 description = "Steel Shovel".."\n"..
182 inventory_image = "basetools_steelshovel.png",
183 tool_capabilities = {
186 crumbly={times={[1]=1.00, [2]=0.70, [3]=0.60}, uses=90, maxlevel=0}
195 minetest.register_tool("basetools:axe_wood", {
196 description = "Wooden Axe".."\n"..
198 inventory_image = "basetools_woodaxe.png",
199 tool_capabilities = {
202 choppy={times={[3]=0.80}, uses=30, maxlevel=0},
206 minetest.register_tool("basetools:axe_stone", {
207 description = "Stone Axe".."\n"..
209 inventory_image = "basetools_stoneaxe.png",
210 tool_capabilities = {
213 choppy={times={[2]=1.00, [3]=0.60}, uses=60, maxlevel=0},
217 minetest.register_tool("basetools:axe_steel", {
218 description = "Steel Axe".."\n"..
220 inventory_image = "basetools_steelaxe.png",
221 tool_capabilities = {
224 choppy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=90, maxlevel=0},
230 -- Shears (dig snappy)
233 minetest.register_tool("basetools:shears_wood", {
234 description = "Wooden Shears".."\n"..
236 inventory_image = "basetools_woodshears.png",
237 tool_capabilities = {
240 snappy={times={[3]=1.00}, uses=30, maxlevel=0},
244 minetest.register_tool("basetools:shears_stone", {
245 description = "Stone Shears".."\n"..
247 inventory_image = "basetools_stoneshears.png",
248 tool_capabilities = {
251 snappy={times={[2]=1.00, [3]=0.50}, uses=60, maxlevel=0},
255 minetest.register_tool("basetools:shears_steel", {
256 description = "Steel Shears".."\n"..
258 inventory_image = "basetools_steelshears.png",
259 tool_capabilities = {
262 snappy={times={[1]=1.00, [2]=0.50, [3]=0.25}, uses=90, maxlevel=0},
268 -- Swords (deal damage)
271 minetest.register_tool("basetools:sword_wood", {
272 description = "Wooden Sword".."\n"..
274 inventory_image = "basetools_woodsword.png",
275 tool_capabilities = {
276 full_punch_interval = 1.0,
277 damage_groups = {fleshy=2},
280 minetest.register_tool("basetools:sword_stone", {
281 description = "Stone Sword".."\n"..
283 inventory_image = "basetools_stonesword.png",
284 tool_capabilities = {
285 full_punch_interval = 1.0,
287 damage_groups = {fleshy=5},
290 minetest.register_tool("basetools:sword_steel", {
291 description = "Steel Sword".."\n"..
293 inventory_image = "basetools_steelsword.png",
294 tool_capabilities = {
295 full_punch_interval = 1.0,
297 damage_groups = {fleshy=10},
300 minetest.register_tool("basetools:sword_titanium", {
301 description = "Titanium Sword".."\n"..
302 "Damage: fleshy=100",
303 inventory_image = "basetools_titaniumsword.png",
304 tool_capabilities = {
305 full_punch_interval = 1.0,
307 damage_groups = {fleshy=100},
310 minetest.register_tool("basetools:sword_blood", {
311 description = "Blood Sword".."\n"..
312 "Damage: fleshy=1000",
313 inventory_image = "basetools_bloodsword.png",
314 tool_capabilities = {
315 full_punch_interval = 1.0,
317 damage_groups = {fleshy=1000},
322 minetest.register_tool("basetools:sword_mese", {
323 description = "Mese Sword".."\n"..
324 "Damage: fleshy=32767, fiery=32767, icy=32767".."\n"..
325 "Full Punch Interval: 0.0s",
326 inventory_image = "basetools_mesesword.png",
327 tool_capabilities = {
328 full_punch_interval = 0.0,
330 damage_groups = {fleshy=32767, fiery=32767, icy=32767},
334 -- Fire/Ice sword: Deal damage to non-fleshy damage groups
335 minetest.register_tool("basetools:sword_fire", {
336 description = "Fire Sword".."\n"..
338 inventory_image = "basetools_firesword.png",
339 tool_capabilities = {
340 full_punch_interval = 1.0,
342 damage_groups = {icy=10},
345 minetest.register_tool("basetools:sword_ice", {
346 description = "Ice Sword".."\n"..
348 inventory_image = "basetools_icesword.png",
349 tool_capabilities = {
350 full_punch_interval = 1.0,
352 damage_groups = {fiery=10},
355 minetest.register_tool("basetools:sword_elemental", {
356 description = "Elemental Sword".."\n"..
357 "Damage: fiery=10, icy=10",
358 inventory_image = "basetools_elementalsword.png",
359 tool_capabilities = {
360 full_punch_interval = 1.0,
362 damage_groups = {fiery=10, icy=10},
366 -- Healing weapons: heal HP
367 minetest.register_tool("basetools:dagger_heal", {
368 description = "Healing Dagger".."\n"..
369 "Heal: fleshy=1".."\n"..
370 "Full Punch Interval: 0.5s",
371 inventory_image = "basetools_healdagger.png",
372 tool_capabilities = {
373 full_punch_interval = 0.5,
374 damage_groups = {fleshy=-1},
377 minetest.register_tool("basetools:sword_heal", {
378 description = "Healing Sword".."\n"..
380 inventory_image = "basetools_healsword.png",
381 tool_capabilities = {
382 full_punch_interval = 1.0,
383 damage_groups = {fleshy=-10},
386 minetest.register_tool("basetools:sword_heal_super", {
387 description = "Super Healing Sword".."\n"..
388 "Heal: fleshy=32768, fiery=32768, icy=32768",
389 inventory_image = "basetools_superhealsword.png",
390 tool_capabilities = {
391 full_punch_interval = 1.0,
392 damage_groups = {fleshy=-32768, fiery=-32768, icy=-32768},
398 -- Dagger: Low damage, fast punch interval
400 minetest.register_tool("basetools:dagger_wood", {
401 description = "Wooden Dagger".."\n"..
402 "Damage: fleshy=1".."\n"..
403 "Full Punch Interval: 0.5s",
404 inventory_image = "basetools_wooddagger.png",
405 tool_capabilities = {
406 full_punch_interval = 0.5,
408 damage_groups = {fleshy=1},
411 minetest.register_tool("basetools:dagger_steel", {
412 description = "Steel Dagger".."\n"..
413 "Damage: fleshy=2".."\n"..
414 "Full Punch Interval: 0.5s",
415 inventory_image = "basetools_steeldagger.png",
416 tool_capabilities = {
417 full_punch_interval = 0.5,
419 damage_groups = {fleshy=2},
423 -- Test tool uses and punch_attack_uses
424 local uses = { 1, 2, 3, 5, 10, 50, 100, 1000, 10000, 65535 }
433 local color = string.format("#FF00%02X", math.floor(((i-1)/#uses) * 255))
434 minetest.register_tool("basetools:pick_uses_"..string.format("%05d", u), {
435 description = ustring.." Pickaxe".."\n"..
437 inventory_image = "basetools_usespick.png^[colorize:"..color..":127",
438 tool_capabilities = {
441 cracky={times={[3]=0.1, [2]=0.2, [1]=0.3}, uses=u, maxlevel=0}
446 minetest.register_tool("basetools:sword_uses_"..string.format("%05d", u), {
447 description = ustring.." Sword".."\n"..
449 inventory_image = "basetools_usessword.png^[colorize:"..color..":127",
450 tool_capabilities = {
451 damage_groups = {fleshy=1},
452 punch_attack_uses = u,