Lots of minor changes and add buckets!

This commit is contained in:
IamPyu 2024-10-25 23:04:36 -06:00
parent 88dd7aa48c
commit 90df776796
9 changed files with 82 additions and 7 deletions

View File

@ -15,7 +15,7 @@
- Added stats which can improve your defense and attack capabilities
- Defense stat is only applied when your health is greater than one fourth of it!
- Added upgrade runes which can be used to improve your defense and attack stats
- Added buckets
## [Oct 19th 2024] Bugfix Update

View File

@ -263,3 +263,11 @@ PyuTest.deal_damage = function(target, damage)
target:set_hp(hp - damage)
end
end
PyuTest.give_item_or_drop = function(stack, inventory, listname, pos)
local leftover = inventory:add_item(listname, stack)
if leftover then
minetest.add_item(pos, leftover)
end
end

View File

@ -0,0 +1,55 @@
PyuTest.make_item("pyutest_buckets:bucket", "Empty Bucket", {}, "pyutest-bucket.png", {
pointabilities = {
nodes = {
["group:liquid"] = true
}
},
on_place = function (itemstack, user, pointed_thing)
if user == nil then
return
end
if pointed_thing.type == "node" then
local pos = pointed_thing.under
local node = minetest.get_node(pos)
local def = minetest.registered_nodes[node.name]
if def.__source then
PyuTest.give_item_or_drop(ItemStack(def.__source), user:get_inventory(), "main", user:get_pos())
minetest.remove_node(pos)
itemstack:take_item()
return itemstack
end
end
end
})
minetest.register_craft({
output = "pyutest_buckets:bucket",
recipe = {
{"pyutest_ores:iron_ingot", "", "pyutest_ores:iron_ingot"},
{"", "pyutest_ores:iron_ingot", ""}
}
})
PyuTest.make_liquid_bucket = function (source, flowing, source_desc, color)
local texture = string.format("pyutest-bucket.png^(pyutest-bucket-overlay.png^[colorize:%s)", color)
minetest.override_item(source, {
description = source_desc,
wield_image = texture,
inventory_image = texture,
after_place_node = function (pos, placer)
if placer == nil then return end
PyuTest.give_item_or_drop(ItemStack("pyutest_buckets:bucket"), placer:get_inventory(), "main", placer:get_pos())
end,
__source = source,
})
end
PyuTest.make_liquid_bucket("pyutest_blocks:water_source", "pyutest_blocks:water_flowing", "Water Bucket", "blue")
PyuTest.make_liquid_bucket("pyutest_blocks:lava_source", "pyutest_blocks:lava_flowing", "Lava Bucket", "orange")

View File

@ -0,0 +1 @@
depends = pyutest_blocks,pyutest_tools,pyutest_ores

View File

@ -1,4 +1,4 @@
PyuTest.make_upgrade_rune = function (name, desc, stat, increase, max)
PyuTest.make_upgrade_rune = function (name, desc, stat, increase, max, color)
PyuTest.make_item(name, desc, {
upgrade_rune = 1,
}, "pyutest-rune.png", {
@ -27,5 +27,5 @@ PyuTest.make_upgrade_rune = function (name, desc, stat, increase, max)
})
end
PyuTest.make_upgrade_rune("pyutest_upgrades:defense", "Defense Upgrade Rune", "defense", 0.5, 5)
PyuTest.make_upgrade_rune("pyutest_upgrades:attack", "Attack Upgrade Rune", "attack", 0.5, 3)
PyuTest.make_upgrade_rune("pyutest_upgrades:defense", "Defense Upgrade Rune", "defense", 0.5, 5, "green")
PyuTest.make_upgrade_rune("pyutest_upgrades:attack", "Attack Upgrade Rune", "attack", 0.5, 3, "red")

View File

@ -105,7 +105,9 @@ end
for k, v in pairs(PyuTest.COLORS) do
if v[2] ~= nil then
PyuTest.make_node("pyutest_wool:"..k.."_stained_glass", v[1] .. " Stained Glass", {
local id = "pyutest_wool:"..k.."_stained_glass"
PyuTest.make_node(id, v[1] .. " Stained Glass", {
cracky = PyuTest.BLOCK_FAST,
glass = 1,
colored = 1
@ -115,6 +117,15 @@ for k, v in pairs(PyuTest.COLORS) do
paramtype = "light",
sunlight_propagates = true
})
minetest.register_craft({
output = id,
recipe = {
"pyutest_blocks:glass",
"pyutest_wool:"..k.."_dye"
},
type = "shapeless"
})
end
end

View File

@ -5,10 +5,10 @@ minetest.register_abm({
chance = 2.5,
catch_up = true,
action = function (pos)
local heat = minetest.get_heat(pos)
local heat = minetest.get_heat(pos) or 50
local found = minetest.find_node_near(pos, 2, {"group:emits_heat"}) ~= nil
if heat and heat < 12 and not found then
if heat < 12 and not found then
minetest.set_node(pos, {name = "pyutest_blocks:ice_block"})
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 181 B