diff --git a/.gitmodules b/.gitmodules index d808915..ce34585 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ [submodule "mods/unified_inventory"] path = mods/unified_inventory url = https://github.com/minetest-mods/unified_inventory +[submodule "mods/mobs_redo"] + path = mods/mobs_redo + url = https://codeberg.org/tenplus1/mobs_redo diff --git a/CHANGELOG.md b/CHANGELOG.md index ee16689..4942f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## [Jun 26th - **STILL UNDER DEVELOPMENT** 2024] Major Update: Adventure and Magic Update + +**This update contains breaking changes!!** + +- Adjusted Sprinting Speed +- Diamonds, Emeralds, and Gold are now much rarer +- Update Copper Color +- Added Weathering to Copper Ore +- Added Stone Pickaxe +- Added Magic Shards +- Replaced Crying Obsidian with Enchanted Obsidian (hehe microsoft cant sue me now) +- Added Structure Obsidian Mound where Enchanted Obsidian May Spawn. +- Magic Shards can Drop from Enchanted Obsidian Blocks +- Added Enchanted Tools + - Added Enchanted Sword + - Added Enchanted Pickaxe +- Removed a Bunch of Colored Blocks (Because I don't want to add that much dyes, flowers, and crafting recipes) +- Added String and Dyes +- Replaced Every Colored Block with \ Wool Block +- Added Recipe for White, Red, Blue, Yellow, and Purple Wool Blocks +- Bring Back Old Dirt Functionality +- Remove Coarse Dirt +- Major Codebase Refactors +- Added Sugarcanes +- Added Eggs and Spawn Eggs +- Fire and Lava Now Creates Light +- Added Strings to Resource Lootboxes +- Removed Liquid Lootbox +- Added Block Digging Sound +- Added Monsters and Humans +- Remove aliases +- "Decentralize" PyuTest APIs + ## [Some Day I Don't Remember] Unnamed Minor Update - Added Ice Spikes Biome @@ -20,7 +53,7 @@ ## [Jun 15th - 16th 2024] Major Update: Survival Update Pt. 3 -* This update includes lot's of breaking changes! +**This update contains breaking changes!!** - Added Diamonds and Emeralds - Added Block Variants of Ores diff --git a/mods/mobs_redo b/mods/mobs_redo new file mode 160000 index 0000000..e11f383 --- /dev/null +++ b/mods/mobs_redo @@ -0,0 +1 @@ +Subproject commit e11f3835892ad9bd5e502fe5118be68d78371ec0 diff --git a/mods/pyutest_cmds/mod.conf b/mods/pyutest_cmds/mod.conf index 2152ed5..b1e9bb5 100644 --- a/mods/pyutest_cmds/mod.conf +++ b/mods/pyutest_cmds/mod.conf @@ -1 +1,2 @@ name = pyutest_cmds +depends = pyutest_core diff --git a/mods/pyutest_core/blocks.lua b/mods/pyutest_core/blocks.lua index 72f0627..aa7e54c 100644 --- a/mods/pyutest_core/blocks.lua +++ b/mods/pyutest_core/blocks.lua @@ -1,12 +1,13 @@ PyuTestCore.make_node_sounds = function(tbl) local t = tbl or {} t.footstep = t.footstep or {name = "block_walk", gain = 1} + t.dig = t.dig or {name = "block_dig", gain = 0.50} t.dug = t.dug or {name = "block_break", gain = 0.50} t.place = t.place or {name = "block_place", gain = 0.50} return t end -PyuTestCore.make_node = function(nsname, sname, desc, groups, tiles, extra_conf) +PyuTestCore.make_node = function(name, desc, groups, tiles, extra_conf) local conf = { description = Translate(desc), tiles = tiles, @@ -20,8 +21,7 @@ PyuTestCore.make_node = function(nsname, sname, desc, groups, tiles, extra_conf) end end - minetest.register_node(nsname, conf) - minetest.register_alias(sname, nsname) + minetest.register_node(name, conf) end PyuTestCore.node_boxes = { @@ -40,30 +40,29 @@ PyuTestCore.node_boxes = { } PyuTestCore.building_blocks = {} -PyuTestCore.make_building_blocks = function (color, dcolor, tex, colortint, cgroups, extra_conf) +PyuTestCore.make_building_blocks = function (name, desc, tex, colortint, cgroups, extra_conf) local groups = cgroups or { block = PyuTestCore.BLOCK_BREAKABLE_NORMAL } groups["block"] = groups["block"] or PyuTestCore.BLOCK_BREAKABLE_NORMAL local econf = extra_conf or {} - local id_block = "pyutest_core:"..color.."_block" - local id_carpet = "pyutest_core:"..color.."_carpet" - local id_slab = "pyutest_core:"..color.."_slab" - local id_pillar = "pyutest_core:"..color.."_pillar" + local id_block = name.."_block" + local id_carpet = name.."_carpet" + local id_slab = name.."_slab" + local id_pillar = name.."_pillar" minetest.register_node(id_block, PyuTestCore.util.tableconcat({ - description = Translate(dcolor.." Block"), + description = Translate(desc.." Block"), tiles = tex, color = colortint, groups = groups, sounds = PyuTestCore.make_node_sounds(), }, econf)) table.insert(PyuTestCore.building_blocks, id_block) - minetest.register_alias(color.."_block", id_block) minetest.register_node(id_carpet, PyuTestCore.util.tableconcat({ - description = Translate(dcolor .. " Carpet"), + description = Translate(desc .. " Carpet"), tiles = tex, groups = groups, color = colortint, @@ -74,10 +73,9 @@ PyuTestCore.make_building_blocks = function (color, dcolor, tex, colortint, cgro sounds = PyuTestCore.make_node_sounds(), }, econf)) table.insert(PyuTestCore.building_blocks, id_carpet) - minetest.register_alias(color.."_carpet", id_carpet) minetest.register_node(id_slab, PyuTestCore.util.tableconcat({ - description = Translate(dcolor.." Slab"), + description = Translate(desc.." Slab"), tiles = tex, groups = groups, color = colortint, @@ -88,10 +86,9 @@ PyuTestCore.make_building_blocks = function (color, dcolor, tex, colortint, cgro sounds = PyuTestCore.make_node_sounds(), }, econf)) table.insert(PyuTestCore.building_blocks, id_slab) - minetest.register_alias(color.."_slab", id_slab) minetest.register_node(id_pillar, PyuTestCore.util.tableconcat({ - description = Translate(dcolor.." Pillar"), + description = Translate(desc.." Pillar"), tiles = tex, groups = groups, color = colortint, @@ -102,7 +99,6 @@ PyuTestCore.make_building_blocks = function (color, dcolor, tex, colortint, cgro sounds = PyuTestCore.make_node_sounds(), }, econf)) table.insert(PyuTestCore.building_blocks, id_pillar) - minetest.register_alias(color.."_pillar", id_pillar) minetest.register_craft({ output = id_carpet .. " 2", @@ -128,101 +124,26 @@ PyuTestCore.make_building_blocks = function (color, dcolor, tex, colortint, cgro }) end -PyuTestCore.make_liquid = function (nsname, sname, desc, groups, tiles, extra_conf) - local function make_liquid_flags(liquidtype) - local drawtype = "" +PyuTestCore.make_building_blocks("pyutest_core:grass", "Grass", {"grass.png"}, nil, {ground = 1}, {drop = "pyutest_core:dirt_block"}) +PyuTestCore.make_building_blocks("pyutest_core:dirt", "Dirt", {"dirt.png"}, nil, {ground = 1}) +PyuTestCore.make_building_blocks("pyutest_core:stone", "Stone", {"stone.png"}, nil, {ground = 1, block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE}) +PyuTestCore.make_building_blocks("pyutest_core:wooden", "Wooden", {"wood.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY}) +PyuTestCore.make_building_blocks("pyutest_core:snow", "Snow", {"snow.png"}, nil, {ground = 1}) +PyuTestCore.make_building_blocks("pyutest_core:sand", "Sand", {"sand.png"}, nil, {ground = 1}) +PyuTestCore.make_building_blocks("pyutest_core:sandstone", "Sandstone", {"sandstone.png"}, nil, {ground = 1}) +PyuTestCore.make_building_blocks("pyutest_core:ice", "Ice", {"ice.png"}, nil, {ground = 1}) +PyuTestCore.make_building_blocks("pyutest_core:leaves", "Leaves", {"leaves.png"}, nil) +PyuTestCore.make_building_blocks("pyutest_core:mushroom", "Mushroom", {"mushroom.png"}, nil) +PyuTestCore.make_building_blocks("pyutest_core:mushroom_stem", "Mushroom Stem", {"mushroom-stem.png"}, nil) +PyuTestCore.make_building_blocks("pyutest_core:mycelium", "Mycelium", {"mycelium.png"}, nil, {ground = 1}) +PyuTestCore.make_building_blocks("pyutest_core:hellstone", "Hellstone", {"hellstone.png"}, nil, {ground = 1, block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE}) +PyuTestCore.make_building_blocks("pyutest_core:basalt", "Basalt", {"basalt.png"}, nil, {ground = 1, block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE}) +PyuTestCore.make_building_blocks("pyutest_core:obsidian", "Obsidian", {"obsidian.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_VERYLONG}) +PyuTestCore.make_building_blocks("pyutest_core:haybale", "Haybale", {"haybale-top-bottom.png", "haybale-top-bottom.png", "haybale.png"}, nil) + -- keeping old ID for backwards compatibility +PyuTestCore.make_building_blocks("pyutest_core:crying_obsidian", "Enchanted Obsidian", {"crying-obsidian.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_VERYLONG}) - if liquidtype == "source" then - drawtype = "liquid" - elseif liquidtype == "flowing" then - drawtype = "liquid" - end - - local t = PyuTestCore.util.tableconcat({ - drawtype = drawtype, - waving = 3, - walkable = false, - pointable = false, - buildable_to = true, - is_ground_content = false, - use_texture_alpha = "blend", - paramtype = "light", - drop = "", - drowning = 1, - liquidtype = liquidtype, - liquid_viscosity = 1, - liquid_alternative_flowing = nsname.."_flowing", - liquid_alternative_source = nsname.."_source" - }, extra_conf or {}) - return t - end - groups["liquid"] = 1 - - PyuTestCore.make_node(nsname.."_source", sname.."_source", desc .. " Source", groups, tiles, make_liquid_flags("source")) - PyuTestCore.make_node(nsname.."_flowing", sname.."_flowing", "Flowing " .. desc, groups, tiles, make_liquid_flags("flowing")) -end - -PyuTestCore.make_building_blocks("grass", "Grass", {"grass.png"}, nil, nil, {drop = "pyutest_core:dirt_block"}) -PyuTestCore.make_building_blocks("dirt", "Dirt", {"dirt.png"}, nil, nil, { - on_construct = function (pos) - local timer = minetest.get_node_timer(pos) - timer:start(8) - end, - - on_timer = function (pos) - 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) -PyuTestCore.make_building_blocks("stone", "Stone", {"stone.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE}) -PyuTestCore.make_building_blocks("wooden", "Wooden", {"wood.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY}) -PyuTestCore.make_building_blocks("snow", "Snow", {"snow.png"}, nil) -PyuTestCore.make_building_blocks("sand", "Sand", {"sand.png"}, nil) -PyuTestCore.make_building_blocks("sandstone", "Sandstone", {"sandstone.png"}, nil) -PyuTestCore.make_building_blocks("ice", "Ice", {"ice.png"}, nil) -PyuTestCore.make_building_blocks("leaves", "Leaves", {"leaves.png"}, nil) -PyuTestCore.make_building_blocks("mushroom", "Mushroom", {"mushroom.png"}, nil) -PyuTestCore.make_building_blocks("mushroom_stem", "Mushroom Stem", {"mushroom-stem.png"}, nil) -PyuTestCore.make_building_blocks("mycelium", "Mycelium", {"mycelium.png"}, nil) -PyuTestCore.make_building_blocks("hellstone", "Hellstone", {"hellstone.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE}) -PyuTestCore.make_building_blocks("basalt", "Basalt", {"basalt.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE}) -PyuTestCore.make_building_blocks("obsidian", "Obsidian", {"obsidian.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_LONG}) -PyuTestCore.make_building_blocks("haybale", "Haybale", {"haybale-top-bottom.png", "haybale-top-bottom.png", "haybale.png"}, nil) -PyuTestCore.make_building_blocks("crying_obsidian", "Crying Obsidian", {"crying-obsidian.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_LONG}) - -PyuTestCore.make_building_blocks("color_white", "White", {"wool.png"}, "white") -PyuTestCore.make_building_blocks("color_red", "Red", {"wool.png"}, "red") -PyuTestCore.make_building_blocks("color_orange", "Orange", {"wool.png"}, "orange") -PyuTestCore.make_building_blocks("color_yellow", "Yellow", {"wool.png"}, "yellow") -PyuTestCore.make_building_blocks("color_green", "Green", {"wool.png"}, "green") -PyuTestCore.make_building_blocks("color_blue", "Blue", {"wool.png"}, "blue") -PyuTestCore.make_building_blocks("color_purple", "Purple", {"wool.png"}, "purple") -PyuTestCore.make_building_blocks("color_black", "Black", {"wool.png"}, "black") -PyuTestCore.make_building_blocks("color_pink", "Pink", {"wool.png"}, "hotpink") -PyuTestCore.make_building_blocks("color_cherry", "Cherry", {"wool.png"}, "lightpink") -PyuTestCore.make_building_blocks("color_brown", "Brown", {"wool.png"}, "brown") -PyuTestCore.make_building_blocks("color_gray", "Gray", {"wool.png"}, "gray") -PyuTestCore.make_building_blocks("color_teal", "Teal", {"wool.png"}, "teal") -PyuTestCore.make_building_blocks("color_cyan", "Cyan", {"wool.png"}, "cyan") -PyuTestCore.make_building_blocks("color_yellowgreen", "Yellow Green", {"wool.png"}, "yellowgreen") -PyuTestCore.make_building_blocks("color_plum", "Plum", {"wool.png"}, "plum") -PyuTestCore.make_building_blocks("color_gold", "Gold", {"wool.png"}, "gold") -PyuTestCore.make_building_blocks("color_skyblue", "Sky Blue", {"wool.png"}, "skyblue") -PyuTestCore.make_building_blocks("color_darkviolet", "Dark Violet", {"wool.png"}, "darkviolet") -PyuTestCore.make_building_blocks("color_violet", "Violet", {"wool.png"}, "violet") - -PyuTestCore.make_node("pyutest_core:light", "light", "Light", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:light", "Light", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, light = 1 }, { @@ -242,8 +163,7 @@ PyuTestCore.make_node("pyutest_core:light", "light", "Light", { end }) -PyuTestCore.make_node("pyutest_core:torch", "torch", "Torch", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:torch", "Torch", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, light = 1 }, { @@ -256,13 +176,11 @@ PyuTestCore.make_node("pyutest_core:torch", "torch", "Torch", { inventory_image = "torch.png", }) -PyuTestCore.make_node("pyutest_core:sponge", "sponge", "Sponge", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:sponge", "Sponge", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"sponge.png"}) -PyuTestCore.make_node("pyutest_core:glass", "glass", "Glass", { - cracky = 1, +PyuTestCore.make_node("pyutest_core:glass", "Glass", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"glass.png"}, { drawtype = "glasslike_framed", @@ -270,8 +188,7 @@ PyuTestCore.make_node("pyutest_core:glass", "glass", "Glass", { sunlight_propagates = true }) -PyuTestCore.make_node("pyutest_core:flower", "rose", "Rose", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:flower", "Rose", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, }, {"flower.png"}, { drawtype = "plantlike", @@ -283,8 +200,7 @@ PyuTestCore.make_node("pyutest_core:flower", "rose", "Rose", { inventory_image = "flower.png" }) -PyuTestCore.make_node("pyutest_core:flower2", "dandelion", "Dandelion", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:flower2", "Dandelion", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, }, {"flower2.png"}, { drawtype = "plantlike", @@ -296,8 +212,7 @@ PyuTestCore.make_node("pyutest_core:flower2", "dandelion", "Dandelion", { inventory_image = "flower2.png" }) -PyuTestCore.make_node("pyutest_core:flower3", "blue_daisy", "Blue Daisy", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:flower3", "Blue Daisy", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, }, {"flower3.png"}, { drawtype = "plantlike", @@ -309,8 +224,7 @@ PyuTestCore.make_node("pyutest_core:flower3", "blue_daisy", "Blue Daisy", { inventory_image = "flower3.png" }) -PyuTestCore.make_node("pyutest_core:flower4", "lavender", "Lavender", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:flower4", "Lavender", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, }, {"flower4.png"}, { drawtype = "plantlike", @@ -323,8 +237,7 @@ PyuTestCore.make_node("pyutest_core:flower4", "lavender", "Lavender", { }) -PyuTestCore.make_node("pyutest_core:deadbush", "deadbush", "Deadbush", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:deadbush", "Deadbush", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"deadbush.png"}, { drawtype = "plantlike", @@ -336,8 +249,7 @@ PyuTestCore.make_node("pyutest_core:deadbush", "deadbush", "Deadbush", { inventory_image = "deadbush.png" }) -PyuTestCore.make_node("pyutest_core:grass_plant", "grass_plant", "Grass", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:grass_plant", "Grass", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"grass-plant.png"}, { drawtype = "plantlike", @@ -349,8 +261,7 @@ PyuTestCore.make_node("pyutest_core:grass_plant", "grass_plant", "Grass", { inventory_image = "grass-plant.png" }) -PyuTestCore.make_node("pyutest_core:tree_sapling", "tree_sapling", "Tree Sapling", { - snappy = 1, +PyuTestCore.make_node("pyutest_core:tree_sapling", "Tree Sapling", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"sapling.png"}, { drawtype = "plantlike", @@ -381,8 +292,18 @@ PyuTestCore.make_node("pyutest_core:tree_sapling", "tree_sapling", "Tree Sapling end }) -PyuTestCore.make_node("pyutest_core:trapdoor", "trapdoor", "Trapdoor", { - choppy = 1, +PyuTestCore.make_node("pyutest_core:sugarcane", "Sugarcane", { + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT +}, {"sugarcane.png"}, { + drawtype = "plantlike", + walkable = false, + waving = 1, + paramtype = "light", + sunlight_propagates = true, + inventory_image = "sugarcane.png" +}) + +PyuTestCore.make_node("pyutest_core:trapdoor", "Trapdoor", { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY }, {"trapdoor.png"}, { drawtype = "nodebox", @@ -394,12 +315,11 @@ PyuTestCore.make_node("pyutest_core:trapdoor", "trapdoor", "Trapdoor", { } }) -PyuTestCore.make_node("pyutest_core:contagious_acid", "acid", "Contagious Acid", { - fleshy = 1, +PyuTestCore.make_node("pyutest_core:contagious_acid", "Contagious Acid", { block = PyuTestCore.BLOCK_BREAKABLE_MIDDLE, }, {"acid.png"}, {}) -PyuTestCore.make_node("pyutest_core:barrier", "barrier", "Barrier", { +PyuTestCore.make_node("pyutest_core:barrier", "Barrier", { block = PyuTestCore.BLOCK_BREAKABLE_FOREVER }, {}, { drawtype = "airlike", @@ -410,7 +330,7 @@ PyuTestCore.make_node("pyutest_core:barrier", "barrier", "Barrier", { wield_image = "barrier.png" }) -PyuTestCore.make_node("pyutest_core:fire", "fire", "Fire", { +PyuTestCore.make_node("pyutest_core:fire", "Fire", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"fire.png"}, { drawtype = "firelike", @@ -418,10 +338,12 @@ PyuTestCore.make_node("pyutest_core:fire", "fire", "Fire", { buildable_to = true, paramtype = "light", sunlight_propagates = true, - damage_per_second = 1 + damage_per_second = 2, + light_source = 8, + drop = "pyutest_core:ash 4" }) -PyuTestCore.make_node("pyutest_core:tnt", "tnt", "TNT", { +PyuTestCore.make_node("pyutest_core:tnt", "TNT", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, { "tnt-top-bottom.png", @@ -438,7 +360,7 @@ PyuTestCore.make_node("pyutest_core:tnt", "tnt", "TNT", { end }) -PyuTestCore.make_node("pyutest_core:crate", "crate", "Crate", { +PyuTestCore.make_node("pyutest_core:crate", "Crate", { block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY }, {"crate.png"}, { on_construct = function (pos) @@ -471,11 +393,46 @@ PyuTestCore.make_node("pyutest_core:crate", "crate", "Crate", { end }) -PyuTestCore.make_liquid("pyutest_core:water", "water", "Water", {}, {"water.png"}) -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 = function (name, desc, groups, tiles, extra_conf) + local function make_liquid_flags(liquidtype) + local drawtype = "" + + if liquidtype == "source" then + drawtype = "liquid" + elseif liquidtype == "flowing" then + drawtype = "liquid" + end + + local t = PyuTestCore.util.tableconcat({ + drawtype = drawtype, + waving = 3, + walkable = false, + pointable = false, + buildable_to = true, + is_ground_content = false, + use_texture_alpha = "blend", + paramtype = "light", + drop = "", + drowning = 1, + liquidtype = liquidtype, + liquid_viscosity = 1, + liquid_alternative_flowing = name.."_flowing", + liquid_alternative_source = name.."_source" + }, extra_conf or {}) + return t + end + groups["liquid"] = 1 + + PyuTestCore.make_node(name.."_source", desc .. " Source", groups, tiles, make_liquid_flags("source")) + PyuTestCore.make_node(name.."_flowing", "Flowing " .. desc, groups, tiles, make_liquid_flags("flowing")) +end + +PyuTestCore.make_liquid("pyutest_core:water", "Water", {}, {"water.png"}) +PyuTestCore.make_liquid("pyutest_core:lava", "Lava", {}, {"lava.png"}, { + damage_per_second = 2, + light_source = 8 +}) +PyuTestCore.make_liquid("pyutest_core:oil", "Oil", {}, {"oil.png"}) +PyuTestCore.make_liquid("pyutest_core:liquid_acid", "Acid", {}, {"acid.png"}, { damage_per_second = 2 }) diff --git a/mods/pyutest_core/combat.lua b/mods/pyutest_core/combat.lua index 1e4f824..103d3b9 100644 --- a/mods/pyutest_core/combat.lua +++ b/mods/pyutest_core/combat.lua @@ -1,20 +1,5 @@ -PyuTestCore.make_spellbook = function (nsname, sname, desc, color, action) - if action == nil then - action = function(_, _, _)end - end - - PyuTestCore.make_item(nsname, sname, desc, {}, "spellbook.png", { - color = color, - on_use = function (itemstack, user, pointed_thing) - local pos = user:get_pos() - minetest.sound_play({name = "spellbook_action", gain = 0.75}, {pos = pos}) - action(itemstack, user, pointed_thing) - end, - }) -end - -PyuTestCore.make_sword = function (nsname, sname, desc, texture, damage, durability) - PyuTestCore.make_tool(nsname, sname, desc, {}, texture, { +PyuTestCore.make_sword = function (nsname, desc, texture, damage, durability) + PyuTestCore.make_tool(nsname, desc, {}, texture, { stack_max = 1, tool_capabilities = { groupcaps = { @@ -28,27 +13,6 @@ PyuTestCore.make_sword = function (nsname, sname, desc, texture, damage, durabil }) end -PyuTestCore.make_sword("pyutest_core:iron_sword", "iron_sword", "Iron Sword", "iron-sword.png", 7, 400) -PyuTestCore.make_sword("pyutest_core:diamond_sword", "diamond_sword", "Diamond Sword", "diamond-sword.png", 12, 600) +PyuTestCore.make_sword("pyutest_core:iron_sword", "Iron Sword", "iron-sword.png", 7, 750) +PyuTestCore.make_sword("pyutest_core:diamond_sword", "Diamond Sword", "diamond-sword.png", 12, 1200) -PyuTestCore.make_spellbook("pyutest_core:explosions_spellbook", "explosions_spellbook", "Spellbook of Explosions", "gray", function (itemstack, user) - PyuTestCore.create_explosion(user:get_pos(), 3, false, 4, user) -end) - -PyuTestCore.make_spellbook("pyutest_core:fire_spellbook", "fire_spellbook", "Spellbook of Fire", "orange", function (itemstack, user) - local range = 2 - - local function replace(pos) - local node = minetest.get_node_or_nil(pos) - if node == nil then return end - if node.name ~= "air" then return end - minetest.set_node(pos, {name = "pyutest_core:fire"}) - end - - for dx = -range, range do - for dz = -range, range do - local pos = user:get_pos() - replace({x = pos.x + dx, y = pos.y, z = pos.z + dz}) - end - end -end) diff --git a/mods/pyutest_core/crafts.lua b/mods/pyutest_core/crafts.lua index f1c1548..aabbc2a 100644 --- a/mods/pyutest_core/crafts.lua +++ b/mods/pyutest_core/crafts.lua @@ -99,7 +99,7 @@ minetest.register_craft({ }) minetest.register_craft({ - output = "pyutest_core:sword", + output = "pyutest_core:iron_sword", recipe = { {"pyutest_core:iron_ingot"}, {"pyutest_core:iron_ingot"}, @@ -133,3 +133,13 @@ minetest.register_craft({ {"pyutest_core:wooden_block", "pyutest_core:wooden_block", "pyutest_core:wooden_block"} } }) + + +minetest.register_craft({ + output = "pyutest_core:stone_pickaxe", + recipe = { + {"pyutest_core:stone_block", "pyutest_core:stone_block", "pyutest_core:stone_block"}, + {"", "pyutest_core:stick", ""}, + {"", "pyutest_core:stick", ""} + } +}) diff --git a/mods/pyutest_core/electricity.lua b/mods/pyutest_core/electricity.lua index 4f29e93..6061ac9 100644 --- a/mods/pyutest_core/electricity.lua +++ b/mods/pyutest_core/electricity.lua @@ -1,9 +1,7 @@ PyuTestCore.ELECTRICITY_UPDATE_TIME = 0.1 - - local function set_powered(pos, value) - local meta = minetest.get_meta(pos) + local meta = minetest.get_meta(pos) if value then meta:set_int("powered", 1) else @@ -37,19 +35,19 @@ local function is_electrified(pos) return result end -PyuTestCore.make_ore("copper", "Copper", "ingot", "Ingot", "ore-copper.png", "ingot.png", "goldenrod", 21, 9, 3, PyuTestCore.BLOCK_BREAKABLE_LONG, nil, { +PyuTestCore.make_ore("pyutest_core:copper", "Copper", "ingot", "Ingot", "ore-copper.png", "ingot.png", "darkgoldenrod", 21, 9, 2, nil, nil, { on_construct = function (pos) set_powered(pos, true) end }) -PyuTestCore.make_node("pyutest_core:copper_wire", "copper_wire", "Copper Wire", { +PyuTestCore.make_node("pyutest_core:copper_wire", "Copper Wire", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"wire.png"}, { drawtype = "signlike", paramtype = "light", sunlight_propagates = true, - color = "goldenrod", + color = "darkgoldenrod", walkable = false, inventory_image = "wire.png", paramtype2 = "wallmounted", @@ -83,8 +81,8 @@ minetest.register_craft({ type = "shapeless" }) -PyuTestCore.make_device = function (ns, sname, desc, color, craftitem, action, setup, extra_conf) - PyuTestCore.make_node(ns..":"..sname.."_device", sname.."_device", desc, { +PyuTestCore.make_device = function (name, desc, color, craftitem, action, setup, extra_conf) + PyuTestCore.make_node(name.."_device", desc, { block = PyuTestCore.BLOCK_BREAKABLE_NORMAL }, {"device.png"}, PyuTestCore.util.tableconcat({ color = color, @@ -108,7 +106,7 @@ PyuTestCore.make_device = function (ns, sname, desc, color, craftitem, action, s }, extra_conf or {})) minetest.register_craft({ - output = ns..":"..sname.."_device 4", + output = name.."_device 4", recipe = { {"pyutest_core:copper_ingot", "pyutest_core:copper_ingot", "pyutest_core:copper_ingot"}, {"pyutest_core:copper_ingot", craftitem, "pyutest_core:copper_ingot"}, @@ -117,12 +115,12 @@ PyuTestCore.make_device = function (ns, sname, desc, color, craftitem, action, s }) end -PyuTestCore.make_device("pyutest_core", "time", "Time Device", "orange", "pyutest_core:light", function (e) +PyuTestCore.make_device("pyutest_core:time", "Time Device", "orange", "pyutest_core:light", 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", "pyutest_core:stone_block", function (e, pos) +PyuTestCore.make_device("pyutest_core:block_setter", "Block Setter Device", "blue", "pyutest_core:stone_block", function (e, pos) if not e then return end local blocks = {} for k, _ in pairs(minetest.registered_nodes) do @@ -136,5 +134,3 @@ PyuTestCore.make_device("pyutest_core", "block_setter", "Block Setter Device", " minetest.remove_node(pos) minetest.place_node(pos, {name = blocks[math.random(#blocks)]}) end) - ---PyuTestCore.make_device("pyutest_core", "") diff --git a/mods/pyutest_core/init.lua b/mods/pyutest_core/init.lua index cbefba5..4d27050 100644 --- a/mods/pyutest_core/init.lua +++ b/mods/pyutest_core/init.lua @@ -1,10 +1,11 @@ Translate = minetest.get_translator("pyutest_core") PyuTestCore = { - BLOCK_BREAKABLE_INSTANT = 6, - BLOCK_BREAKABLE_NORMAL = 5, - BLOCK_BREAKABLE_CHOPPY = 4, - BLOCK_BREAKABLE_MIDDLE = 3, - BLOCK_BREAKABLE_LONG = 2, + BLOCK_BREAKABLE_INSTANT = 7, + BLOCK_BREAKABLE_NORMAL = 6, + BLOCK_BREAKABLE_CHOPPY = 5, + BLOCK_BREAKABLE_MIDDLE = 4, + BLOCK_BREAKABLE_LONG = 3, + BLOCK_BREAKABLE_VERYLONG = 2, BLOCK_BREAKABLE_FOREVER = 1, util = { @@ -32,7 +33,9 @@ dofile(PyuTestCore_Path.."/utils.lua") -- Utilities -- Core Game Code dofile(PyuTestCore_Path.."/blocks.lua") dofile(PyuTestCore_Path.."/mapgen.lua") +dofile(PyuTestCore_Path.."/items.lua") dofile(PyuTestCore_Path.."/tools.lua") +dofile(PyuTestCore_Path.."/wool.lua") dofile(PyuTestCore_Path.."/player.lua") dofile(PyuTestCore_Path.."/lootboxes.lua") dofile(PyuTestCore_Path.."/sfinv.lua") @@ -40,5 +43,6 @@ dofile(PyuTestCore_Path.."/ores.lua") dofile(PyuTestCore_Path.."/abms.lua") dofile(PyuTestCore_Path.."/mobs.lua") dofile(PyuTestCore_Path.."/combat.lua") +dofile(PyuTestCore_Path.."/magic.lua") dofile(PyuTestCore_Path.."/electricity.lua") dofile(PyuTestCore_Path.."/crafts.lua") diff --git a/mods/pyutest_core/items.lua b/mods/pyutest_core/items.lua new file mode 100644 index 0000000..7973526 --- /dev/null +++ b/mods/pyutest_core/items.lua @@ -0,0 +1,51 @@ +PyuTestCore.make_item = function (nsname, desc, groups, wield_image, extra_conf) + local conf = { + description = Translate(desc), + wield_image = wield_image, + inventory_image = wield_image, + groups = groups + } + + if extra_conf ~= nil then + for k, v in pairs(extra_conf) do + conf[k] = v + end + end + + minetest.register_craftitem(nsname, conf) +end + +PyuTestCore.make_item("pyutest_core:stick", "Stick", {}, "stick.png", { + stack_max = 99 +}) + +PyuTestCore.make_item("pyutest_core:gunpowder", "Gunpowder", {}, "powder.png", { + color = "dimgray", + stack_max = 99 +}) + +PyuTestCore.make_item("pyutest_core:ash", "Ash", {}, "powder.png", { + color = "gray", + stack_max = 99 +}) + +PyuTestCore.make_item("pyutest_core:sugar", "Sugar", {}, "powder.png", { + stack_max = 99 +}) + +PyuTestCore.make_item("pyutest_core:coin", "Coin", {}, "coin.png", { + stack_max = 99, + on_secondary_use = function (_, user) + local pos = user:get_pos() + minetest.sound_play({name = "coin", gain = 1}, { + pos = pos + }) + return nil + end +}) + +PyuTestCore.make_item("pyutest_core:wheat", "Wheat", {}, "wheat.png") +PyuTestCore.make_item("pyutest_core:string", "String", {}, "string.png") +PyuTestCore.make_item("pyutest_core:egg", "Egg", {}, "egg.png", { + color = "peachpuff" +}) diff --git a/mods/pyutest_core/lootboxes.lua b/mods/pyutest_core/lootboxes.lua index 58a4f06..6bc21a5 100644 --- a/mods/pyutest_core/lootboxes.lua +++ b/mods/pyutest_core/lootboxes.lua @@ -35,11 +35,12 @@ PyuTestCore.make_lootbox("trash", "Trash", { }, PyuTestCore.LOOTBOX_USEFULLNESS.USELESS) PyuTestCore.make_lootbox("resource", "Resource", { - ItemStack("pyutest_core:gunpowder 4"), - ItemStack("pyutest_core:stick 6"), - ItemStack("pyutest_core:sugar 3"), - ItemStack("pyutest_core:tree_sapling 2"), - ItemStack("pyutest_core:apple 5") + ItemStack("pyutest_core:gunpowder 3"), + ItemStack("pyutest_core:stick 4"), + ItemStack("pyutest_core:sugar 2"), + ItemStack("pyutest_core:tree_sapling 3"), + ItemStack("pyutest_core:apple 3"), + ItemStack("pyutest_core:string 5") }, PyuTestCore.LOOTBOX_USEFULLNESS.AVERAGE) PyuTestCore.make_lootbox("griefer", "Griefer's Dream", { @@ -47,13 +48,6 @@ PyuTestCore.make_lootbox("griefer", "Griefer's Dream", { ItemStack("pyutest_core:bomb 2") }, PyuTestCore.LOOTBOX_USEFULLNESS.USEFUL) -PyuTestCore.make_lootbox("liquid_sources", "Liquid Sources", { - ItemStack("pyutest_core:water_source 5"), - ItemStack("pyutest_core:lava_source 5"), - ItemStack("pyutest_core:oil_source 5"), - ItemStack("pyutest_core:liquid_acid_source 5") -}, PyuTestCore.LOOTBOX_USEFULLNESS.USEFUL) - PyuTestCore.make_lootbox("lighting", "Lighting", { ItemStack("pyutest_core:light 2"), ItemStack("pyutest_core:torch 13") diff --git a/mods/pyutest_core/magic.lua b/mods/pyutest_core/magic.lua new file mode 100644 index 0000000..d7753ee --- /dev/null +++ b/mods/pyutest_core/magic.lua @@ -0,0 +1,125 @@ +PyuTestCore.make_item("pyutest_core:magic_shards", "Magic Shards", {}, "magic-shards.png") +minetest.override_item("pyutest_core:crying_obsidian_block", { + drop = { + max_items = 1, + items = { + { + rarity = 5, + items = {"pyutest_core:magic_shards 3"} + }, + + { + items = {"pyutest_core:crying_obsidian_block"} + } + } + } +}) + +PyuTestCore.make_spellbook = function (nsname, desc, color, craftitem, action) + if action == nil then + action = function(_, _, _)end + end + + PyuTestCore.make_item(nsname, desc, {}, "spellbook.png", { + color = color, + on_use = function (itemstack, user, pointed_thing) + local pos = user:get_pos() + minetest.sound_play({name = "spellbook_action", gain = 0.75}, {pos = pos}) + action(itemstack, user, pointed_thing) + end + }) + + minetest.register_craft({ + output = nsname, + recipe = { + {"", "pyutest_core:magic_shards", ""}, + {"pyutest_core:magic_shards", craftitem, "pyutest_core:magic_shards"}, + {"", "pyutest_core:magic_shards", ""} + } + }) +end + +PyuTestCore.make_spellbook("pyutest_core:explosions_spellbook", "Spellbook of Explosions", "gray", "pyutest_core:bomb", function (itemstack, user) + PyuTestCore.create_explosion(user:get_pos(), 3, false, 7, user) +end) + +PyuTestCore.make_spellbook("pyutest_core:fire_spellbook", "Spellbook of Fire", "crimson", "pyutest_core:hellstone_block", function (itemstack, user) + local range = 2 + + local function replace(pos) + local node = minetest.get_node_or_nil(pos) + if node == nil then return end + if node.name ~= "air" then return end + local pos2 = vector.new(pos.x, pos.y - 1, pos.z) + node = minetest.get_node_or_nil(pos) + if node == nil then return end + if node.name ~= "air" then return end + + minetest.set_node(pos, {name = "pyutest_core:fire"}) + end + + for dx = -range, range do + for dz = -range, range do + local pos = user:get_pos() + replace({x = pos.x + dx, y = pos.y, z = pos.z + dz}) + end + end +end) + + +PyuTestCore.make_item("pyutest_core:enchanted_shard", "Enchanted Shard", {}, "shard.png", { + color = "indigo", +}) + +minetest.register_craft({ + output = "pyutest_core:enchanted_shard 2", + recipe = { + {"pyutest_core:magic_shards", "pyutest_core:diamond_shard", "pyutest_core:magic_shards"}, + {"pyutest_core:emerald_shard", "pyutest_core:magic_shards", "pyutest_core:emerald_shard"}, + {"pyutest_core:magic_shards", "pyutest_core:diamond_shard", "pyutest_core:magic_shards"} + } +}) + +-- these tools are worth the hassle +PyuTestCore.make_tool("pyutest_core:enchanted_pickaxe", "Enchanted Pickaxe", {}, "enchanted-pickaxe.png", { + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.015, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.035, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.075, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.15, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 0.8, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 1.2, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 3 + }, + uses = 3600, + } + }, + punch_attack_uses = 1200, + damage_groups = {fleshy = 4} + } +}) + +minetest.register_craft({ + output = "pyutest_core:enchanted_pickaxe", + recipe = { + {"pyutest_core:enchanted_shard", "pyutest_core:enchanted_shard", "pyutest_core:enchanted_shard"}, + {"", "pyutest_core:stick", ""}, + {"", "pyutest_core:stick", ""} + } +}) + +PyuTestCore.make_sword("pyutest_core:enchanted_sword", "Enchanted Sword", "enchanted-sword.png", 15, 3600) + + +minetest.register_craft({ + output = "pyutest_core:enchanted_sword", + recipe = { + {"pyutest_core:enchanted_shard"}, + {"pyutest_core:enchanted_shard"}, + {"pyutest_core:stick"} + } +}) diff --git a/mods/pyutest_core/mapgen.lua b/mods/pyutest_core/mapgen.lua index e8be119..d6133d5 100644 --- a/mods/pyutest_core/mapgen.lua +++ b/mods/pyutest_core/mapgen.lua @@ -137,10 +137,10 @@ minetest.register_biome({ minetest.register_biome({ name = "wasteland", - node_top = "pyutest_core:coarse_dirt_block", + node_top = "pyutest_core:dirt_block", depth_top = 1, - node_filler = "pyutest_core:coarse_dirt_block", + node_filler = "pyutest_core:dirt_block", depth_filler = 3, node_water_top = "pyutest_core:ice_block", diff --git a/mods/pyutest_core/mobs.lua b/mods/pyutest_core/mobs.lua index 161e25f..e477fea 100644 --- a/mods/pyutest_core/mobs.lua +++ b/mods/pyutest_core/mobs.lua @@ -1,27 +1,83 @@ -PyuTestCore.make_entity = function(name, def, setup) - local ndef = def - setup(ndef) - minetest.register_entity(name, ndef) -end +PyuTestCore.ENTITY_BLOOD_AMOUNT = 6 +PyuTestCore.HUMAN_LIKE_CBOX = {-0.25, -1, -0.25, 0.25, 1, 0.25} +minetest.register_alias("mapgen_dirt", "pyutest_core:dirt_block") -PyuTestCore.make_entity("pyutest_core:dummy", { - initial_properties = { - hp_max = 20, - physical = true, - visual = "upright_sprite", - collide_with_objects = false, - textures = {"player.png", "player_back.png"}, - visual_size = {x = 1, y = 2}, - nametag = "Dummy", - automatic_rotate = 15, +mobs:register_mob("pyutest_core:monster", { + type = "monster", + hp_max = 20, + hp_min = 20, + walk_velocity = 1, + run_velocity = 3, + armor = 100, + passive = false, + walk_chance = 0, + stand_chance = 25, + damage = 5.5, + attack_chance = 1, + attack_type = "dogfight", + attack_players = true, + attack_npcs = true, + pathfinding = 1, + visual = "upright_sprite", + visual_size = {x = 1, y = 2}, + collisionbox = PyuTestCore.HUMAN_LIKE_CBOX, + physical = true, + blood_amount = PyuTestCore.ENTITY_BLOOD_AMOUNT, + view_range = 30, + reach = 2, + jump = 1, + group_attack = true, + + textures = { + "player.png^[invert:rgb", "player_back.png^[invert:rgb" } -}, function (def) - function def:on_rightclick(clicker) - self.object:set_velocity({x = 0, y = 10, z = 0}) - end +}) +mobs:register_egg("pyutest_core:monster", "Monster Spawn Egg", "egg.png", 0) +-- mobs:spawn({ +-- name = "pyutest_core:monster", +-- nodes = {"group:ground"}, +-- interval = 2, +-- chance = 2, +-- active_object_count = 15, +-- min_light = 0, +-- max_light = 7, +-- on_map_load = true +-- }) - function def:on_step(dtime) - self.object:add_velocity({x = 0, y = -1 * dtime, z = 0}) - end -end) +mobs:register_mob("pyutest_core:human", { + type = "npc", + hp_max = 20, + hp_min = 20, + walk_velocity = 1, + run_velocity = 3, + armor = 100, + passive = false, + walk_chance = 50, + stand_chance = 50, + damage = 3, + attack_type = "dogfight", + pathfinding = 1, + visual = "upright_sprite", + visual_size = {x = 1, y = 2}, + collisionbox = PyuTestCore.HUMAN_LIKE_CBOX, + textures = {"player.png", "player_back.png"}, + follow = {"pyutest_core:coin"}, + attack_monsters = true, + group_attack = true, + view_range = 15, + reach = 2, + blood_amount = PyuTestCore.ENTITY_BLOOD_AMOUNT, +}) +mobs:register_egg("pyutest_core:human", "Human Spawn Egg", "egg.png", 0) +-- mobs:spawn({ +-- name = "pyutest_core:human", +-- nodes = {"group:ground"}, +-- interval = 3, +-- chance = 4, +-- active_object_count = 7, +-- min_light = 9, +-- max_light = 15, +-- day_toggle = true, +-- on_map_load = true +-- }) diff --git a/mods/pyutest_core/mod.conf b/mods/pyutest_core/mod.conf index 195fdc0..657edae 100644 --- a/mods/pyutest_core/mod.conf +++ b/mods/pyutest_core/mod.conf @@ -1 +1,2 @@ name = pyutest_core +depends = mobs diff --git a/mods/pyutest_core/ores.lua b/mods/pyutest_core/ores.lua index ef1ffb7..eb4958e 100644 --- a/mods/pyutest_core/ores.lua +++ b/mods/pyutest_core/ores.lua @@ -1,7 +1,7 @@ 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 + local oid = id.."_ore" + local iid = id.."_"..ifix + local block_type = btype ~= nil and btype or PyuTestCore.BLOCK_BREAKABLE_LONG minetest.register_node(oid, PyuTestCore.util.tableconcat({ description = Translate(desc .. " Ore"), @@ -33,7 +33,7 @@ PyuTestCore.make_ore = function (id, desc, ifix, idfix, btxt, itxt, color, y_max PyuTestCore.make_building_blocks(id, desc, {"metal.png"}, color, {block = block_type}, bconf or {}) - local bid = "pyutest_core:"..id.."_block" + local bid = id.."_block" minetest.register_craft({ output = bid, recipe = { @@ -51,8 +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, 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) +PyuTestCore.make_ore("pyutest_core:coal", "Coal", "lump", "Lump", "ore-coal.png", "lump.png", {r = 32, g = 32, b = 32}, 48, 8, 2, PyuTestCore.BLOCK_BREAKABLE_MIDDLE) +PyuTestCore.make_ore("pyutest_core:iron", "Iron", "ingot", "Ingot", "ore-iron.png", "ingot.png", nil, 21, 13, 1) +PyuTestCore.make_ore("pyutest_core:gold", "Gold", "ingot", "Ingot", "ore-gold.png", "ingot.png", "gold", -75, 15.5, 1) +PyuTestCore.make_ore("pyutest_core:diamond", "Diamond", "shard", "Shard", "ore-diamond.png", "shard.png", "cyan", -90, 16.7, 1) +PyuTestCore.make_ore("pyutest_core:emerald", "Emerald", "shard", "Shard", "ore-emerald.png", "shard.png", "seagreen", -120, 18.3, 1) diff --git a/mods/pyutest_core/player.lua b/mods/pyutest_core/player.lua index 9e96dee..e525f96 100644 --- a/mods/pyutest_core/player.lua +++ b/mods/pyutest_core/player.lua @@ -18,7 +18,7 @@ minetest.register_globalstep(function(dtime) for p=1, #players do local ctrl = players[p]:get_player_control() if ctrl.aux1 then - set_player_speed(players[p], 1.85) + set_player_speed(players[p], 1.70) else set_player_speed(players[p], 1) end @@ -41,8 +41,9 @@ minetest.override_item("", { [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.85, [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 3, [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 5.5, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 8, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 12 + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 9, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 12, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 18 }, uses = 0 } diff --git a/mods/pyutest_core/schematics/obsidian-mound.mts b/mods/pyutest_core/schematics/obsidian-mound.mts new file mode 100644 index 0000000..68362e7 Binary files /dev/null and b/mods/pyutest_core/schematics/obsidian-mound.mts differ diff --git a/mods/pyutest_core/sounds/block_dig.ogg b/mods/pyutest_core/sounds/block_dig.ogg new file mode 100644 index 0000000..7c5fde0 Binary files /dev/null and b/mods/pyutest_core/sounds/block_dig.ogg differ diff --git a/mods/pyutest_core/structures.lua b/mods/pyutest_core/structures.lua index 6fd1aaa..ca14ac2 100644 --- a/mods/pyutest_core/structures.lua +++ b/mods/pyutest_core/structures.lua @@ -62,9 +62,9 @@ end minetest.register_decoration({ deco_type = "simple", sidelen = 16, - fill_ratio = 0.0008, + fill_ratio = 0.0003, place_on = blocks, - biomes = PyuTestCore.BIOMES, + biomes = minetest.registered_biomes, y_max = PyuTestCore_BiomeTops.mountains, y_min = PyuTestCore_WorldBottom, decoration = { @@ -89,3 +89,18 @@ minetest.register_decoration({ y_min = PyuTestCore_WorldBottom, flags = "place_center_x, place_center_z", }) + +minetest.register_decoration({ + deco_type = "schematic", + sidelen = 16, + fill_ratio = 0.0001, + schematic = PyuTestCore.get_schem_path("obsidian-mound"), + place_on = {"pyutest_core:mycelium_block"}, + biomes = { + "mushroom_fields" + }, + y_max = PyuTestCore_BiomeTops.mushroom_fields, + y_min = PyuTestCore_WorldBottom, + flags = "", + place_offset_y = 1 +}) diff --git a/mods/pyutest_core/textures/dye.png b/mods/pyutest_core/textures/dye.png new file mode 100644 index 0000000..e40dcd5 Binary files /dev/null and b/mods/pyutest_core/textures/dye.png differ diff --git a/mods/pyutest_core/textures/egg.png b/mods/pyutest_core/textures/egg.png new file mode 100644 index 0000000..9fddbb0 Binary files /dev/null and b/mods/pyutest_core/textures/egg.png differ diff --git a/mods/pyutest_core/textures/enchanted-pickaxe.png b/mods/pyutest_core/textures/enchanted-pickaxe.png new file mode 100644 index 0000000..b3e2c42 Binary files /dev/null and b/mods/pyutest_core/textures/enchanted-pickaxe.png differ diff --git a/mods/pyutest_core/textures/enchanted-sword.png b/mods/pyutest_core/textures/enchanted-sword.png new file mode 100644 index 0000000..028b6fb Binary files /dev/null and b/mods/pyutest_core/textures/enchanted-sword.png differ diff --git a/mods/pyutest_core/textures/magic-shards.png b/mods/pyutest_core/textures/magic-shards.png new file mode 100644 index 0000000..da50fa9 Binary files /dev/null and b/mods/pyutest_core/textures/magic-shards.png differ diff --git a/mods/pyutest_core/textures/ore-copper.png b/mods/pyutest_core/textures/ore-copper.png index ebc052c..b73f836 100644 Binary files a/mods/pyutest_core/textures/ore-copper.png and b/mods/pyutest_core/textures/ore-copper.png differ diff --git a/mods/pyutest_core/textures/ore-diamond.png b/mods/pyutest_core/textures/ore-diamond.png index 740ec22..bd73159 100644 Binary files a/mods/pyutest_core/textures/ore-diamond.png and b/mods/pyutest_core/textures/ore-diamond.png differ diff --git a/mods/pyutest_core/textures/ore-emerald.png b/mods/pyutest_core/textures/ore-emerald.png index a9e2cea..18aa3e6 100644 Binary files a/mods/pyutest_core/textures/ore-emerald.png and b/mods/pyutest_core/textures/ore-emerald.png differ diff --git a/mods/pyutest_core/textures/ore-gold.png b/mods/pyutest_core/textures/ore-gold.png index cda182d..6e2a6de 100644 Binary files a/mods/pyutest_core/textures/ore-gold.png and b/mods/pyutest_core/textures/ore-gold.png differ diff --git a/mods/pyutest_core/textures/stone-pickaxe.png b/mods/pyutest_core/textures/stone-pickaxe.png new file mode 100644 index 0000000..efb88ba Binary files /dev/null and b/mods/pyutest_core/textures/stone-pickaxe.png differ diff --git a/mods/pyutest_core/textures/string.png b/mods/pyutest_core/textures/string.png new file mode 100644 index 0000000..67764a3 Binary files /dev/null and b/mods/pyutest_core/textures/string.png differ diff --git a/mods/pyutest_core/textures/sugarcane.png b/mods/pyutest_core/textures/sugarcane.png new file mode 100644 index 0000000..c8c8006 Binary files /dev/null and b/mods/pyutest_core/textures/sugarcane.png differ diff --git a/mods/pyutest_core/tools.lua b/mods/pyutest_core/tools.lua index 6b8c9ee..335321e 100644 --- a/mods/pyutest_core/tools.lua +++ b/mods/pyutest_core/tools.lua @@ -1,4 +1,4 @@ -PyuTestCore.make_tool = function (nsname, sname, desc, groups, wield_image, extra_conf) +PyuTestCore.make_tool = function (nsname, desc, groups, wield_image, extra_conf) local conf = { description = Translate(desc), wield_image = wield_image, @@ -13,31 +13,12 @@ PyuTestCore.make_tool = function (nsname, sname, desc, groups, wield_image, extr end minetest.register_tool(nsname, conf) - minetest.register_alias(sname, nsname) end -PyuTestCore.make_item = function (nsname, sname, desc, groups, wield_image, extra_conf) - local conf = { - description = Translate(desc), - wield_image = wield_image, - inventory_image = wield_image, - groups = groups - } - - if extra_conf ~= nil then - for k, v in pairs(extra_conf) do - conf[k] = v - end - end - - minetest.register_craftitem(nsname, conf) - minetest.register_alias(sname, nsname) -end - -PyuTestCore.make_food = function (nsname, sname, desc, wield_image, health_fill, extra_code) +PyuTestCore.make_food = function (nsname, desc, wield_image, health_fill, extra_code) local code = extra_code or function()end - PyuTestCore.make_item(nsname, sname, desc, {}, wield_image, { + PyuTestCore.make_item(nsname, desc, {}, wield_image, { on_use = function (itemstack, user, pt) if user == nil then return end minetest.sound_play({name = "eat", gain = 1}, {pos = user:get_pos(), start_time = 1.2}) @@ -47,16 +28,16 @@ PyuTestCore.make_food = function (nsname, sname, desc, wield_image, health_fill, }) end -PyuTestCore.make_tool("pyutest_core:wooden_pickaxe", "wooden_pickaxe", "Wooden Pickaxe", {}, "wooden-pickaxe.png", { +PyuTestCore.make_tool("pyutest_core:wooden_pickaxe", "Wooden Pickaxe", {}, "wooden-pickaxe.png", { stack_max = 1, tool_capabilities = { groupcaps = { block = { times = { [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.085, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.65, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 1.2, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 2, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.75, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 1.9, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 3, }, uses = 200, } @@ -66,7 +47,29 @@ PyuTestCore.make_tool("pyutest_core:wooden_pickaxe", "wooden_pickaxe", "Wooden P } }) -PyuTestCore.make_tool("pyutest_core:iron_pickaxe", "iron_pickaxe", "Iron Pickaxe", {}, "iron-pickaxe.png", { +PyuTestCore.make_tool("pyutest_core:stone_pickaxe", "Stone Pickaxe", {}, "stone-pickaxe.png", { + stack_max = 1, + tool_capabilities = { + groupcaps = { + block = { + times = { + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.065, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.55, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 1.4, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 2, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 6, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 9, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 15 + }, + uses = 450, + } + }, + punch_attack_uses = 225, + damage_groups = {fleshy = 3} + } +}) + +PyuTestCore.make_tool("pyutest_core:iron_pickaxe", "Iron Pickaxe", {}, "iron-pickaxe.png", { stack_max = 1, tool_capabilities = { groupcaps = { @@ -74,10 +77,11 @@ PyuTestCore.make_tool("pyutest_core:iron_pickaxe", "iron_pickaxe", "Iron Pickaxe times = { [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.7, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 1, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 2, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 4 + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.9, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 1.5, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 3.4, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 7, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 13 }, uses = 750, } @@ -87,18 +91,19 @@ PyuTestCore.make_tool("pyutest_core:iron_pickaxe", "iron_pickaxe", "Iron Pickaxe } }) -PyuTestCore.make_tool("pyutest_core:diamond_pickaxe", "diamond_pickaxe", "Diamond Pickaxe", {}, "diamond-pickaxe.png", { +PyuTestCore.make_tool("pyutest_core:diamond_pickaxe", "Diamond Pickaxe", {}, "diamond-pickaxe.png", { stack_max = 1, tool_capabilities = { groupcaps = { block = { times = { - [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.015, - [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.15, - [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.15, - [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.35, - [PyuTestCore.BLOCK_BREAKABLE_LONG] = 0.85, - [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 1.7 + [PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.035, + [PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.35, + [PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 0.5, + [PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 0.7, + [PyuTestCore.BLOCK_BREAKABLE_LONG] = 2.5, + [PyuTestCore.BLOCK_BREAKABLE_VERYLONG] = 5, + [PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 8 }, uses = 1200, } @@ -108,7 +113,7 @@ PyuTestCore.make_tool("pyutest_core:diamond_pickaxe", "diamond_pickaxe", "Diamon } }) -PyuTestCore.make_item("pyutest_core:bomb", "bomb", "Bomb", {}, "bomb.png", { +PyuTestCore.make_item("pyutest_core:bomb", "Bomb", {}, "bomb.png", { stack_max = 16, on_use = function (_, user) if user == nil then @@ -123,44 +128,5 @@ PyuTestCore.make_item("pyutest_core:bomb", "bomb", "Bomb", {}, "bomb.png", { end }) -PyuTestCore.make_item("pyutest_core:stick", "stick", "Stick", {}, "stick.png", { - stack_max = 99 -}) - -PyuTestCore.make_item("pyutest_core:gunpowder", "gunpowder", "Gunpowder", {}, "powder.png", { - color = "dimgray", - stack_max = 99 -}) - -PyuTestCore.make_item("pyutest_core:ash", "ash", "Ash", {}, "powder.png", { - color = "gray", - stack_max = 99 -}) - -PyuTestCore.make_item("pyutest_core:sugar", "sugar", "Sugar", {}, "powder.png", { - stack_max = 99 -}) - -PyuTestCore.make_item("pyutest_core:coin", "coin", "Coin", {}, "coin.png", { - stack_max = 99, - on_secondary_use = function (_, user) - local pos = user:get_pos() - minetest.sound_play({name = "coin", gain = 1}, { - pos = pos - }) - return nil - end -}) - -PyuTestCore.make_item("pyutest_core:wheat", "wheat", "Wheat", {}, "wheat.png") - -PyuTestCore.make_item("pyutest_core:apple", "apple", "Apple", {}, "apple.png", { - on_use = function (itemstack, user, pt) - if user == nil then return end - minetest.sound_play({name = "eat", gain = 1}, {pos = user:get_pos(), start_time = 1.2}) - minetest.do_item_eat(3, "", itemstack, user, pt) - end -}) - -PyuTestCore.make_food("pyutest_core:apple", "apple", "Apple", "apple.png", 5) -PyuTestCore.make_food("pyutest_core:bread", "bread", "Bread", "bread.png", 3) +PyuTestCore.make_food("pyutest_core:apple", "Apple", "apple.png", 5) +PyuTestCore.make_food("pyutest_core:bread", "Bread", "bread.png", 3) diff --git a/mods/pyutest_core/wool.lua b/mods/pyutest_core/wool.lua new file mode 100644 index 0000000..275943b --- /dev/null +++ b/mods/pyutest_core/wool.lua @@ -0,0 +1,38 @@ +PyuTestCore.make_wool_and_dyes = function(name, desc, color) + PyuTestCore.make_building_blocks(name.."_wool", desc.." Wool", {"wool.png"}, color or "white") + + PyuTestCore.make_item(name.."_dye", desc.." Dye", {}, "dye.png", { + color = color or "white" + }) + + -- if nomakecraft then return end + + minetest.register_craft({ + output = name.."_wool_block", + type = "shapeless", + recipe = { + "pyutest_core:white_wool_block", + name.."_dye" + } + }) +end + +PyuTestCore.make_wool_and_dyes("pyutest_core:white", "White", "white") +minetest.register_craft({ + output = "pyutest_core:white_wool_block 4", + recipe = { + {"pyutest_core:string", "pyutest_core:string"}, + {"pyutest_core:string", "pyutest_core:string"} + } +}) + +PyuTestCore.make_wool_and_dyes("pyutest_core:black", "Black", "black") +PyuTestCore.make_wool_and_dyes("pyutest_core:brown", "Brown", "brown") + +PyuTestCore.make_wool_and_dyes("pyutest_core:red", "Red", "red") +PyuTestCore.make_wool_and_dyes("pyutest_core:orange", "Orange", "orange") +PyuTestCore.make_wool_and_dyes("pyutest_core:yellow", "Yellow", "yellow") +PyuTestCore.make_wool_and_dyes("pyutest_core:green", "Green", "green") +PyuTestCore.make_wool_and_dyes("pyutest_core:blue", "Blue", "blue") +PyuTestCore.make_wool_and_dyes("pyutest_core:purple", "Purple", "purple") +PyuTestCore.make_wool_and_dyes("pyutest_core:pink", "Pink", "pink")