Version 1.2: Resource Difficulty

Now it's greatly difficult to get these tools/armor in MCL and MTG, as
it now costs 9x9x9 leaves to make 1 piece of the tool or armor.

  Also reworked the MCL armor and tools so they should properly work
regardless of MCL version. (I hope, :P)
master
david 2021-07-13 14:40:54 -04:00
parent 2352602d69
commit da319108fb
15 changed files with 132 additions and 19 deletions

View File

@ -19,3 +19,9 @@ This mod supports MTG (via using 3d_armor) and also supports MineClone2. (Exclud
Currently there are no easily adjustable settings... and the current settings I do have I manually fiddled with to make some what sane defaults.
I do have some very rudimentary debug abilities, it simply dumps what slot it is, and the new durability (in raw) to the logs. (Unfortunately you will need to change it in both renew_tools and renew_armor in their init.lua files)
## News
* Changed the recipe for crafting all equipment due to the fact it is equal to diamond tools/armor thus the need for them to
be expensive.

View File

@ -1,2 +1,3 @@
name = minetest-renew
description = Self Repairing tools and armor
description = Self Repairing tools and armor
optional_depends = default, mcl_core, 3d_armor, mcl_armor, mcl_farming, farming

View File

@ -9,13 +9,13 @@ renew_armor.da_armor = minetest.get_modpath("3d_armor") or nil
-- The direct durability for the armors
renew_armor.uses = 365
renew_armor.heal = 1
renew_armor.heal = 2
-- The amount repaired per global step
renew_armor.factor = 35
renew_armor.factor = 36
-- Do we log that we did something? (Specifically used for debug
renew_armor.log = false
renew_armor.log = true
-- Only support repairing armor when the player is wearing it
local function check_player(player, timer)

View File

@ -1,17 +1,19 @@
local mcl_armor = rawget(_G, "mcl_armor") or nil
local mcl_armor = armor
local mat = "renew_plant:plant"
local mat = "renew_plant:plant_tri"
local points = {
head = 3,
torso = 8,
legs = 6,
feet = 3,
}
local renewal = {}
renewal.usage = renew_armor.S("")
minetest.register_tool("renew_armor:helmet", {
description = renew_armor.S("Renewable Helmet"),
_doc_items_longdesc = renew_armor.S("A self-repairing peice of armor"),
_doc_items_usagehelp = mcl_armor.usage,
_doc_items_usagehelp = armor.usage,
inventory_image = "renew_armor_inv_helmet.png",
groups = {armor_head = 1, combat_armor_head = 1, armor = 1, combat_armor = 1, mcl_armor_points = points.head, mcl_armor_toughness = 2, mcl_armor_uses=renew_armor.uses, enchantablility = 20},
sounds = {

View File

@ -31,7 +31,7 @@ armor:register_armor(":renew_armor:boots", {
damage_groups = {cracky=2, snappy=1, choppy=1, level=3}
})
local mat = "renew_plant:plant"
local mat = "renew_plant:plant_tri"
minetest.register_craft({
output = "renew_armor:helmet",

View File

@ -8,7 +8,17 @@ renew_plant.mcl = minetest.get_modpath("mcl_core") or nil
minetest.register_craftitem("renew_plant:plant", {
description = renew_plant.S("Renewable Plant Fiber"),
inventory_image = "renew_plant_plant.png"
inventory_image = "renew_plant_plant1.png"
})
minetest.register_craftitem("renew_plant:plant_duo", {
description = renew_plant.S("Renewable Plant Mend"),
inventory_image = "renew_plant_plant2.png"
})
minetest.register_craftitem("renew_plant:plant_tri", {
description = renew_plant.S("Renewable Plant Bond"),
inventory_image = "renew_plant_plant3.png"
})
minetest.register_craft({
@ -18,10 +28,68 @@ minetest.register_craft({
})
minetest.register_craft({
output = "renew_plant:plant 1",
type = "fuel",
recipe = "renew_plant:plant_duo",
burntime = 75
})
minetest.register_craft({
type = "fuel",
recipe = "renew_plant:plant_tri",
burntime = 145
})
local p1 = "renew_plant:plant"
local p2 = "renew_plant:plant_duo"
local p3 = "renew_plant:plant_tri"
minetest.register_craft({
output = p1.." 1",
recipe = {
{"group:leaves", "group:leaves", "group:leaves"},
{"group:leaves", "group:leaves", "group:leaves"},
{"group:leaves", "group:leaves", "group:leaves"}
}
})
minetest.register_craft({
output = p2.." 1",
recipe = {
{p1, p1, p1},
{p1, p1, p1},
{p1, p1, p1}
}
})
minetest.register_craft({
output = p3.." 1",
recipe = {
{p2, p2, p2},
{p2, p2, p2},
{p2, p2, p2}
}
})
minetest.register_craft({
type = "shapeless",
output = "default:leaves 9",
recipe = {
p1
}
})
minetest.register_craft({
type = "shapeless",
output = p1.." 9",
recipe = {
p2
}
})
minetest.register_craft({
type = "shapeless",
output = p2.." 9",
recipe = {
p3
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -10,7 +10,7 @@ renew_tools.mcl = minetest.get_modpath("mcl_core") or nil
renew_tools.uses = 365
-- The amount repaired per global step
renew_tools.factor = 35
renew_tools.factor = 36
-- Do we log when we repair? Used for debugging
renew_tools.log = false

View File

@ -97,6 +97,32 @@ local make_stripped_trunk = function(itemstack, placer, pointed_thing)
return itemstack
end
-- Assistant functions that really should have been placed into an API (Thus I have to lug it around)
local function create_soil(pos, inv)
if pos == nil then
return false
end
local node = minetest.get_node(pos)
local name = node.name
local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
if minetest.get_item_group(name, "cultivatable") == 2 then
if above.name == "air" then
node.name = "mcl_farming:soil"
minetest.set_node(pos, node)
minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.5 }, true)
return true
end
elseif minetest.get_item_group(name, "cultivatable") == 1 then
if above.name == "air" then
node.name = "mcl_core:dirt"
minetest.set_node(pos, node)
minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.6 }, true)
return true
end
end
return false
end
-- Assistant functions that really should have been placed into an API (Thus I have to lug it around)
local hoe_on_place_function = function(wear_divisor)
return function(itemstack, user, pointed_thing)
@ -133,9 +159,12 @@ minetest.register_tool("renew_tools:pick", {
max_drop_level=5,
damage_groups = {fleshy=5},
punch_attack_uses=renew_tools.uses,
groupcaps={
pickaxey_dig_diamond = {times=mcl_autogroup.digtimes.pickaxey_dig_diamond, uses=renew_tools.uses, maxlevel=0},
},
},
sound = { breaks = "default_tool_breaks" },
--_repair_material = "mcl_core:diamond",
-- _repair_material = "mcl_core:diamond",
_mcl_toollike_wield = true,
_mcl_diggroups = {
pickaxey = { speed = 8, level = 5, uses=renew_tools.uses }
@ -150,12 +179,14 @@ minetest.register_tool("renew_tools:shovel", {
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=5,
groupcaps={
shovely_dig_diamond = {times=mcl_autogroup.digtimes.shovely_dig_diamond, uses=renew_tools.uses, maxlevel=0},
},
damage_groups = {fleshy=5},
punch_attack_uses=renew_tools.uses,
},
on_place = make_grass_path,
sound = { breaks = "default_tool_breaks" },
--_repair_material = "mcl_core:diamond",
_mcl_toollike_wield = true,
_mcl_diggroups = {
shovely = { speed = 8, level = 5, uses=renew_tools.uses }
@ -170,12 +201,14 @@ minetest.register_tool("renew_tools:axe", {
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=5,
groupcaps={
axey_dig_diamond = {times=mcl_autogroup.digtimes.axey_dig_diamond, uses=renew_tools.uses, maxlevel=0},
},
damage_groups = {fleshy=9},
punch_attack_uses=renew_tools.uses,
},
on_place = make_stripped_trunk,
sound = { breaks = "default_tool_breaks" },
--_repair_material = "mcl_core:diamond",
_mcl_toollike_wield = true,
_mcl_diggroups = {
axey = { speed = 8, level = 5, uses=renew_tools.uses }
@ -190,11 +223,14 @@ minetest.register_tool("renew_tools:sword", {
tool_capabilities = {
full_punch_interval = 0.625,
max_drop_level=5,
groupcaps={
swordy_dig = {times=mcl_autogroup.digtimes.swordy_dig , uses=renew_tools.uses, maxlevel=0},
swordy_cobweb_dig = {times=mcl_autogroup.digtimes.swordy_cobweb_dig , uses=renew_tools.uses, maxlevel=0},
},
damage_groups = {fleshy=7},
punch_attack_uses=renew_tools.uses,
},
sound = { breaks = "default_tool_breaks" },
--_repair_material = "mcl_core:diamond",
_mcl_toollike_wield = true,
_mcl_diggroups = {
swordy = { speed = 8, level = 5, uses=renew_tools.uses },
@ -207,7 +243,7 @@ minetest.register_tool("renew_tools:hoe", {
description = renew_tools.S("Renewable Hoe"),
_tt_help = renew_tools.S("Uses: "..renew_tools.uses),
inventory_image = "renew_tools_hoe.png",
on_place = hoe_on_place_function(0),
on_place = hoe_on_place_function(renew_tools.uses),
groups = { tool=1, hoe=1, enchantability=10 },
tool_capabilities = {
full_punch_interval = 0.25,
@ -220,7 +256,7 @@ minetest.register_tool("renew_tools:hoe", {
},
})
local mat = "renew_plant:plant"
local mat = "renew_plant:plant_tri"
local stk = "group:stick"
minetest.register_craft({

View File

@ -1,4 +1,4 @@
name = renew_tools
description = Self-Repairing tools
depends = renew_plant
optional_depends = default, mcl_core, mcl_farming, farming
optional_depends = default, mcl_core, mcl_farming, farming, _mcl_autogroup

View File

@ -63,7 +63,7 @@ minetest.register_tool("renew_tools:sword", {
groups = {sword = 1}
})
local mat = "renew_plant:plant"
local mat = "renew_plant:plant_tri"
local stk = "group:stick"
minetest.register_craft({