Major Update
14
CHANGELOG.md
@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## [Jun 17th - 18th 2024] Major Update: Electricity Update Pt.1
|
||||
|
||||
- Added Copper
|
||||
- Added Copper Wires
|
||||
- Added Electrical Devices
|
||||
- Added Time Device
|
||||
- Added Block Setter Device
|
||||
- Minor Texture Adjustments
|
||||
- Acid Now Damages Players
|
||||
|
||||
## [Jun 15th - 16th 2024] Major Update: Survival Update Pt. 3
|
||||
|
||||
* This update includes lot's of breaking changes!
|
||||
@ -22,8 +32,8 @@
|
||||
- Removed Coins from Resource Lootbox
|
||||
- Updated Sponge Texture
|
||||
- Explosions Now Damage Players
|
||||
- Fire Now Damages Player
|
||||
- Lava Now Damages Player
|
||||
- Fire Now Damages Players
|
||||
- Lava Now Damages Players
|
||||
- Implement Crates
|
||||
- Added Crafting Recipe to Crates
|
||||
- Changed "Useless" Lootbox Type Color Tint to Purple to Tell the Difference Between Crates
|
||||
|
16
PLANS.md
@ -1,16 +0,0 @@
|
||||
# Plans
|
||||
|
||||
These plans are for updates past the Survival Update Pt. 2
|
||||
|
||||
Plans:
|
||||
|
||||
- Combat
|
||||
- Melees
|
||||
- Ranged
|
||||
- Magic
|
||||
|
||||
- Mobs
|
||||
- Cow
|
||||
- Pig
|
||||
- Chicken
|
||||
- Sheep
|
@ -173,6 +173,14 @@ PyuTestCore.make_building_blocks("dirt", "Dirt", {"dirt.png"}, nil, nil, {
|
||||
if minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
|
||||
minetest.set_node(pos, {name = "pyutest_core:grass_block"})
|
||||
end
|
||||
end,
|
||||
|
||||
on_destruct = function (pos)
|
||||
local cpos = {x = pos.x, y = pos.y - 1, z = pos.z}
|
||||
if minetest.get_node(cpos).name == "pyutest_core:dirt_block" then
|
||||
local timer = minetest.get_node_timer(cpos)
|
||||
timer:start(8)
|
||||
end
|
||||
end
|
||||
})
|
||||
PyuTestCore.make_building_blocks("coarse_dirt", "Coarse Dirt", {"dirt.png"}, nil)
|
||||
@ -468,4 +476,6 @@ PyuTestCore.make_liquid("pyutest_core:lava", "lava", "Lava", {}, {"lava.png"}, {
|
||||
damage_per_second = 2
|
||||
})
|
||||
PyuTestCore.make_liquid("pyutest_core:oil", "oil", "Oil", {}, {"oil.png"})
|
||||
PyuTestCore.make_liquid("pyutest_core:liquid_acid", "liquid_acid", "Acid", {}, {"acid.png"})
|
||||
PyuTestCore.make_liquid("pyutest_core:liquid_acid", "liquid_acid", "Acid", {}, {"acid.png"}, {
|
||||
damage_per_second = 2
|
||||
})
|
||||
|
131
mods/pyutest_core/electricity.lua
Normal file
@ -0,0 +1,131 @@
|
||||
PyuTestCore.ELECTRICITY_UPDATE_TIME = 0.1
|
||||
|
||||
|
||||
|
||||
local function set_powered(pos, value)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if value then
|
||||
meta:set_int("powered", 1)
|
||||
else
|
||||
meta:set_int("powered", 0)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_powered(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
return meta:get_int("powered") == 1 and true or false
|
||||
end
|
||||
|
||||
local function is_electrified(pos)
|
||||
local positions = {
|
||||
vector.new(pos.x + 1, pos.y, pos.z),
|
||||
vector.new(pos.x - 1, pos.y, pos.z),
|
||||
vector.new(pos.x, pos.y + 1, pos.z),
|
||||
vector.new(pos.x, pos.y - 1, pos.z),
|
||||
vector.new(pos.x, pos.y, pos.z + 1),
|
||||
vector.new(pos.x, pos.y, pos.z - 1)
|
||||
}
|
||||
|
||||
local result = false
|
||||
for _, v in pairs(positions) do
|
||||
if get_powered(v) then
|
||||
result = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
PyuTestCore.make_ore("copper", "Copper", "ingot", "Ingot", "ore-copper.png", "ingot.png", "goldenrod", 21, 9, 3, PyuTestCore.BLOCK_BREAKABLE_LONG, nil, {
|
||||
on_construct = function (pos)
|
||||
set_powered(pos, true)
|
||||
end
|
||||
})
|
||||
|
||||
PyuTestCore.make_node("pyutest_core:copper_wire", "copper_wire", "Copper Wire", {
|
||||
block = PyuTestCore.BLOCK_BREAKABLE_INSTANT
|
||||
}, {"wire.png"}, {
|
||||
drawtype = "signlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
color = "goldenrod",
|
||||
walkable = false,
|
||||
inventory_image = "wire.png",
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = {
|
||||
type = "wallmounted"
|
||||
},
|
||||
|
||||
on_construct = function (pos)
|
||||
set_powered(pos, false)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME)
|
||||
end,
|
||||
|
||||
on_timer = function (pos)
|
||||
if is_electrified(pos) then
|
||||
set_powered(pos, true)
|
||||
else
|
||||
set_powered(pos, false)
|
||||
end
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "pyutest_core:copper_wire 16",
|
||||
recipe = {
|
||||
"pyutest_core:copper_ingot"
|
||||
},
|
||||
type = "shapeless"
|
||||
})
|
||||
|
||||
PyuTestCore.make_device = function (ns, sname, desc, color, action, setup, extra_conf)
|
||||
PyuTestCore.make_node(ns..":"..sname.."_device", sname.."_device", desc, {
|
||||
block = PyuTestCore.BLOCK_BREAKABLE_NORMAL
|
||||
}, {"device.png"}, PyuTestCore.util.tableconcat({
|
||||
color = color,
|
||||
on_construct = function (pos)
|
||||
local s = setup or function (_) end
|
||||
s(pos)
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME)
|
||||
end,
|
||||
on_timer = function (pos)
|
||||
if is_electrified(pos) then
|
||||
action(true, pos)
|
||||
else
|
||||
action(false, pos)
|
||||
end
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(PyuTestCore.ELECTRICITY_UPDATE_TIME)
|
||||
end
|
||||
}, extra_conf or {}))
|
||||
end
|
||||
|
||||
PyuTestCore.make_device("pyutest_core", "time", "Time Device", "orange", function (e)
|
||||
if not e then return end
|
||||
minetest.chat_send_all(string.format("Time: " .. os.date("%I:%M:%S", os.time())))
|
||||
end)
|
||||
|
||||
PyuTestCore.make_device("pyutest_core", "block_setter", "Block Setter Device", "blue", function (e, pos)
|
||||
if not e then return end
|
||||
local blocks = {}
|
||||
for k, _ in pairs(minetest.registered_nodes) do
|
||||
local no_disallowed_blocks_match = (k ~= "ignore" and k ~= "pyutest_core:contagious_acid")
|
||||
|
||||
if no_disallowed_blocks_match then
|
||||
table.insert(blocks, k)
|
||||
end
|
||||
end
|
||||
local pos = vector.new(pos.x, pos.y + 1, pos.z)
|
||||
minetest.remove_node(pos)
|
||||
minetest.place_node(pos, {name = blocks[math.random(#blocks)]})
|
||||
end)
|
||||
|
||||
--PyuTestCore.make_device("pyutest_core", "")
|
@ -37,7 +37,8 @@ dofile(PyuTestCore_Path.."/player.lua")
|
||||
dofile(PyuTestCore_Path.."/lootboxes.lua")
|
||||
dofile(PyuTestCore_Path.."/sfinv.lua")
|
||||
dofile(PyuTestCore_Path.."/ores.lua")
|
||||
dofile(PyuTestCore_Path.."/crafts.lua")
|
||||
dofile(PyuTestCore_Path.."/abms.lua")
|
||||
dofile(PyuTestCore_Path.."/mobs.lua")
|
||||
dofile(PyuTestCore_Path.."/combat.lua")
|
||||
dofile(PyuTestCore_Path.."/electricity.lua")
|
||||
dofile(PyuTestCore_Path.."/crafts.lua")
|
||||
|
@ -1,16 +1,16 @@
|
||||
PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max, scarcity, count, btype)
|
||||
PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max, scarcity, count, btype, oconf, bconf)
|
||||
local oid = "pyutest_core:"..id.."_ore"
|
||||
local iid = "pyutest_core:"..id.."_"..ifix
|
||||
local block_type = btype ~= nil and btype or PyuTestCore.BLOCK_BREAKABLE_MIDDLE
|
||||
|
||||
minetest.register_node(oid, {
|
||||
minetest.register_node(oid, PyuTestCore.util.tableconcat({
|
||||
description = Translate(desc .. " Ore"),
|
||||
groups = {block = block_type},
|
||||
tiles = {btxt},
|
||||
drop = iid .. " " .. tostring(count or 1),
|
||||
sounds = PyuTestCore.make_node_sounds(),
|
||||
light_source = 3.9, -- Make ores emit little light
|
||||
})
|
||||
}, oconf or {}))
|
||||
|
||||
minetest.register_craftitem(iid, {
|
||||
description = Translate(desc .. " " .. idfix),
|
||||
@ -23,7 +23,7 @@ PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max
|
||||
ore_type = "scatter",
|
||||
ore = oid,
|
||||
wherein = "pyutest_core:stone_block",
|
||||
clust_scarcity = scarcity * scarcity * scarcity, -- I spent 1 hour debugging this just because I mispelled scarcity as scarity :sob:
|
||||
clust_scarcity = scarcity * scarcity * scarcity,
|
||||
clust_num_ores = 5,
|
||||
clust_size = 3,
|
||||
y_max = y_max,
|
||||
@ -31,9 +31,7 @@ PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max
|
||||
biomes = PyuTestCore.BIOMES,
|
||||
})
|
||||
|
||||
PyuTestCore.make_building_blocks(id, desc, {"metal.png"}, color, {
|
||||
block = block_type
|
||||
})
|
||||
PyuTestCore.make_building_blocks(id, desc, {"metal.png"}, color, {block = block_type}, bconf or {})
|
||||
|
||||
local bid = "pyutest_core:"..id.."_block"
|
||||
minetest.register_craft({
|
||||
@ -53,9 +51,8 @@ PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
PyuTestCore.make_ore("coal", "Coal", "lump", "Lump", "ore-coal.png", "lump.png", {r = 32, g = 32, b = 32}, 48, 8, 5)
|
||||
PyuTestCore.make_ore("iron", "Iron", "ingot", "Ingot", "ore-iron.png", "ingot.png", nil, 21, 12, 4)
|
||||
PyuTestCore.make_ore("gold", "Gold", "ingot", "Ingot", "ore-gold.png", "ingot.png", "gold", -50, 14.5, 3, PyuTestCore.BLOCK_BREAKABLE_LONG)
|
||||
PyuTestCore.make_ore("diamond", "Diamond", "shard", "Shard", "ore-diamond.png", "shard.png", "cyan", -60, 15.7, 3, PyuTestCore.BLOCK_BREAKABLE_LONG)
|
||||
PyuTestCore.make_ore("coal", "Coal", "lump", "Lump", "ore-coal.png", "lump.png", {r = 32, g = 32, b = 32}, 48, 8, 4)
|
||||
PyuTestCore.make_ore("iron", "Iron", "ingot", "Ingot", "ore-iron.png", "ingot.png", nil, 21, 12, 3)
|
||||
PyuTestCore.make_ore("gold", "Gold", "ingot", "Ingot", "ore-gold.png", "ingot.png", "gold", -50, 14.5, 2, PyuTestCore.BLOCK_BREAKABLE_LONG)
|
||||
PyuTestCore.make_ore("diamond", "Diamond", "shard", "Shard", "ore-diamond.png", "shard.png", "cyan", -60, 15.7, 1, PyuTestCore.BLOCK_BREAKABLE_LONG)
|
||||
PyuTestCore.make_ore("emerald", "Emerald", "shard", "Shard", "ore-emerald.png", "shard.png", "seagreen", -110, 17.3, 1, PyuTestCore.BLOCK_BREAKABLE_LONG)
|
||||
|
BIN
mods/pyutest_core/textures/device.png
Normal file
After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 218 B |
BIN
mods/pyutest_core/textures/ore-copper.png
Normal file
After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 174 B |
BIN
mods/pyutest_core/textures/shiny-metal-overlay.png
Normal file
After Width: | Height: | Size: 105 B |
BIN
mods/pyutest_core/textures/wire.png
Normal file
After Width: | Height: | Size: 455 B |