diff --git a/minetest.conf b/minetest.conf index c918bc9..0a179dd 100644 --- a/minetest.conf +++ b/minetest.conf @@ -1,2 +1 @@ -bomb_range = 2 unified_inventory_lite = true diff --git a/mods/pyutest_core/abms.lua b/mods/pyutest_core/abms.lua index 536ccc8..00db4d6 100644 --- a/mods/pyutest_core/abms.lua +++ b/mods/pyutest_core/abms.lua @@ -13,8 +13,9 @@ minetest.register_abm({ label = "Contagious Acid Spread", nodenames = PyuTestCore.building_blocks, neighbors = {"pyutest_core:contagious_acid"}, - interval = 1.2, - chance = 4.5, + interval = 3.2, + chance = 2.7, + catchup = true, action = function (pos) minetest.set_node(pos, {name = "pyutest_core:contagious_acid"}) end diff --git a/mods/pyutest_core/blocks.lua b/mods/pyutest_core/blocks.lua index ff9615b..235292d 100644 --- a/mods/pyutest_core/blocks.lua +++ b/mods/pyutest_core/blocks.lua @@ -134,8 +134,8 @@ end PyuTestCore.make_colored_blocks("grass", "Grass", "grass.png", nil) PyuTestCore.make_colored_blocks("dirt", "Dirt", "dirt.png", nil) -PyuTestCore.make_colored_blocks("stone", "Stone", "stone.png", nil) -PyuTestCore.make_colored_blocks("iron", "Iron", "iron.png", nil) +PyuTestCore.make_colored_blocks("stone", "Stone", "stone.png", nil, {block = PyuTestCore.BLOCK_BREAKABLE_LONG}) +PyuTestCore.make_colored_blocks("iron", "Iron", "iron.png", nil, {block = PyuTestCore.BLOCK_BREAKABLE_LONG}) PyuTestCore.make_colored_blocks("wooden", "Wooden", "wood.png", nil) PyuTestCore.make_colored_blocks("snow", "Snow", "snow.png", nil) PyuTestCore.make_colored_blocks("sand", "Sand", "sand.png", nil) @@ -145,9 +145,10 @@ PyuTestCore.make_colored_blocks("leaves", "Leaves", "leaves.png", nil) PyuTestCore.make_colored_blocks("mushroom", "Mushroom", "mushroom.png", nil) PyuTestCore.make_colored_blocks("mushroom_stem", "Mushroom Stem", "mushroom-stem.png", nil) PyuTestCore.make_colored_blocks("mycelium", "Mycelium", "mycelium.png", nil) -PyuTestCore.make_colored_blocks("hellstone", "Hellstone", "hellstone.png", nil) -PyuTestCore.make_colored_blocks("basalt", "Basalt", "basalt.png", nil) -PyuTestCore.make_colored_blocks("obsidian", "Obsidian", "obsidian.png", nil) +PyuTestCore.make_colored_blocks("hellstone", "Hellstone", "hellstone.png", nil, {block = PyuTestCore.BLOCK_BREAKABLE_LONG}) +PyuTestCore.make_colored_blocks("basalt", "Basalt", "basalt.png", nil, {block = PyuTestCore.BLOCK_BREAKABLE_LONG}) +PyuTestCore.make_colored_blocks("obsidian", "Obsidian", "obsidian.png", nil, {block = PyuTestCore.BLOCK_BREAKABLE_FOREVER}) +PyuTestCore.make_colored_blocks("haybale", "Haybale", "haybale.png", nil) PyuTestCore.make_colored_blocks("white", "White", "wool.png", "white") PyuTestCore.make_colored_blocks("red", "Red", "wool.png", "red") @@ -157,6 +158,8 @@ PyuTestCore.make_colored_blocks("green", "Green", "wool.png", "green") PyuTestCore.make_colored_blocks("blue", "Blue", "wool.png", "blue") PyuTestCore.make_colored_blocks("purple", "Purple", "wool.png", "purple") PyuTestCore.make_colored_blocks("black", "Black", "wool.png", "black") +PyuTestCore.make_colored_blocks("pink", "Pink", "wool.png", "hotpink") +PyuTestCore.make_colored_blocks("cherry", "Cherry", "wool.png", "lightpink") PyuTestCore.make_node("pyutest_core:light", "light", "Light", { snappy = 1, @@ -235,6 +238,43 @@ PyuTestCore.make_node("pyutest_core:flower3", "blue_daisy", "Blue Daisy", { inventory_image = "flower3.png" }) +PyuTestCore.make_node("pyutest_core:deadbush", "deadbush", "Deadbush", { + snappy = 1, + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT +}, {"deadbush.png"}, { + drawtype = "plantlike", + walkable = false, + waving = 1, + buildable_to = true, + paramtype = "light", + sunlight_propagates = true, + inventory_image = "deadbush.png" +}) + +PyuTestCore.make_node("pyutest_core:tree_sapling", "tree_sapling", "Tree Sapling", { + snappy = 1, + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT +}, {"sapling.png"}, { + drawtype = "plantlike", + walkable = false, + waving = 1, + buildable_to = true, + paramtype = "light", + sunlight_propagates = true, + inventory_image = "sapling.png", + + on_timer = function (pos) + minetest.remove_node(pos) + pos.y = pos.y - 1 + minetest.place_schematic(pos, PyuTestCore.get_schem_path("tree"), "random", nil, false, "place_center_x, place_center_z") + end, + + on_rightclick = function (pos) + local timer = minetest.get_node_timer(pos) + timer:start(6) + end +}) + PyuTestCore.make_node("pyutest_core:trapdoor", "trapdoor", "Trapdoor", { choppy = 1, block = PyuTestCore.BLOCK_BREAKABLE_NORMAL @@ -253,5 +293,49 @@ PyuTestCore.make_node("pyutest_core:contagious_acid", "acid", "Contagious Acid", block = PyuTestCore.BLOCK_BREAKABLE_LONG, }, {"acid.png"}, {}) +PyuTestCore.make_node("pyutest_core:barrier", "barrier", "Barrier", { + block = PyuTestCore.BLOCK_BREAKABLE_FOREVER +}, {}, { + drawtype = "airlike", + walkable = true, + paramtype = "light", + sunlight_propagates = true, + inventory_image = "barrier.png", + wield_image = "barrier.png" +}) + +PyuTestCore.make_node("pyutest_core:fire", "fire", "Fire", { + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT +}, {"fire.png"}, { + drawtype = "firelike", + walkable = false, + buildable_to = true, + paramtype = "light", + sunlight_propagates = true, + -- inventory_image = "fire.png" +}) + +PyuTestCore.make_node("pyutest_core:tnt", "tnt", "TNT", { + block = PyuTestCore.BLOCK_BREAKABLE_INSTANT +}, { + "tnt-top-bottom.png", + "tnt-top-bottom.png", + "tnt-side.png", + "tnt-side.png", + "tnt-side.png", + "tnt-side.png" +}, { + on_rightclick = function (pos) + local timer = minetest.get_node_timer(pos) + timer:start(4) + end, + + on_timer = function (pos) + PyuTestCore.create_explosion(pos, 3, true) + end +}) + PyuTestCore.make_liquid("pyutest_core:water", "water", "Water", {}, {"water.png"}) -PyuTestCore.make_liquid("pyutest_core:lava", "Lava", "Lava", {}, {"lava.png"}) +PyuTestCore.make_liquid("pyutest_core:lava", "lava", "Lava", {}, {"lava.png"}) +PyuTestCore.make_liquid("pyutest_core:oil", "oil", "Oil", {}, {"oil.png"}) +PyuTestCore.make_liquid("pyutest_core:liquid_acid", "liquid_acid", "Acid", {}, {"acid.png"}) diff --git a/mods/pyutest_core/init.lua b/mods/pyutest_core/init.lua index 578b107..58b5fc4 100644 --- a/mods/pyutest_core/init.lua +++ b/mods/pyutest_core/init.lua @@ -12,7 +12,14 @@ PyuTestCore = { } } +PyuTestCore.get_schem_path = function (name) + return minetest.get_modpath("pyutest_core") .. "/schematics/"..name..".mts" +end PyuTestCore_Path = minetest.get_modpath("pyutest_core") + +dofile(PyuTestCore_Path.."/utils.lua") -- Depedency-less utilities + +-- Core Game Code dofile(PyuTestCore_Path.."/blocks.lua") dofile(PyuTestCore_Path.."/mapgen.lua") dofile(PyuTestCore_Path.."/abms.lua") diff --git a/mods/pyutest_core/mapgen.lua b/mods/pyutest_core/mapgen.lua index e8821a8..a3a3314 100644 --- a/mods/pyutest_core/mapgen.lua +++ b/mods/pyutest_core/mapgen.lua @@ -5,13 +5,15 @@ minetest.register_alias("mapgen_lava_source", "pyutest_core:water_source") -- Biomes -PyuTestCore_BiomeEndings = { +PyuTestCore_SurfaceBiomeBottom = -3 +PyuTestCore_BiomeTops = { grassland = 40, desert = 70, frozen_plains = 50, mountains = 300, mushroom_fields = 40, - hellbounds = 70 + hellbounds = 70, + oillands = 45 } minetest.register_biome({ @@ -23,8 +25,8 @@ minetest.register_biome({ node_filler = "pyutest_core:dirt_block", depth_filler = 3, - y_max = PyuTestCore_BiomeEndings.grassland, - y_min = -3, + y_max = PyuTestCore_BiomeTops.grassland, + y_min = PyuTestCore_SurfaceBiomeBottom, heat_point = 50, humidity_point = 50, @@ -39,8 +41,8 @@ minetest.register_biome({ node_filler = "pyutest_core:dirt_block", depth_filler = 3, - y_max = PyuTestCore_BiomeEndings.grassland, - y_min = -3, + y_max = PyuTestCore_BiomeTops.grassland, + y_min = PyuTestCore_SurfaceBiomeBottom, heat_point = 50, humidity_point = 63 @@ -55,8 +57,8 @@ minetest.register_biome({ node_filler = "pyutest_core:stone_block", depth_filler = 3, - y_max = PyuTestCore_BiomeEndings.mountains, - y_min = PyuTestCore_BiomeEndings.grassland, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_BiomeTops.grassland, heat_point = 45, humidity_point = 34 @@ -71,8 +73,8 @@ minetest.register_biome({ node_filler = "pyutest_core:sandstone_block", depth_filler = 3, - y_max = PyuTestCore_BiomeEndings.desert, - y_min = -3, + y_max = PyuTestCore_BiomeTops.desert, + y_min = PyuTestCore_SurfaceBiomeBottom, heat_point = 78, humidity_point = 4 @@ -87,8 +89,8 @@ minetest.register_biome({ node_filler = "pyutest_core:sandstone_block", depth_filler = 3, - y_max = PyuTestCore_BiomeEndings.mountains, - y_min = PyuTestCore_BiomeEndings.desert, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_BiomeTops.desert, heat_point = 65, humidity_point = 8 @@ -103,8 +105,8 @@ minetest.register_biome({ node_filler = "pyutest_core:snow_block", depth_filler = 3, - y_max = PyuTestCore_BiomeEndings.mountains, - y_min = PyuTestCore_BiomeEndings.frozen_plains, + y_max = PyuTestCore_BiomeTops.mountains, + y_min = PyuTestCore_BiomeTops.frozen_plains, heat_point = 16, humidity_point = 23 @@ -123,8 +125,8 @@ minetest.register_biome({ node_water_top = "pyutest_core:ice_block", depth_water_top = 10, - y_max = PyuTestCore_BiomeEndings.frozen_plains, - y_min = -3, + y_max = PyuTestCore_BiomeTops.frozen_plains, + y_min = PyuTestCore_SurfaceBiomeBottom, heat_point = 19, humidity_point = 23 @@ -142,8 +144,8 @@ minetest.register_biome({ node_water_top = "pyutest_core:ice_block", depth_water_top = 10, - y_max = PyuTestCore_BiomeEndings.frozen_plains, - y_min = -3, + y_max = PyuTestCore_BiomeTops.frozen_plains, + y_min = PyuTestCore_SurfaceBiomeBottom, heat_point = 21, humidity_point = 9 }) @@ -156,8 +158,8 @@ minetest.register_biome({ node_filler = "pyutest_core:dirt_block", depth_filler = 3, - y_max = PyuTestCore_BiomeEndings.frozen_plains, - y_min = -3, + y_max = PyuTestCore_BiomeTops.frozen_plains, + y_min = PyuTestCore_SurfaceBiomeBottom, heat_point = 34, humidity_point = 76 @@ -178,18 +180,38 @@ minetest.register_biome({ node_riverbed = "pyutest_core:lava_source", depth_riverbed = 2, - y_max = PyuTestCore_BiomeEndings.hellbounds, - y_min = -1, + y_max = PyuTestCore_BiomeTops.hellbounds, + y_min = PyuTestCore_SurfaceBiomeBottom, heat_point = 98, humidity_point = 3 }) -PyuTestCore.get_schem_path = function (name) - return minetest.get_modpath("pyutest_core") .. "/schematics/"..name..".mts" -end +minetest.register_biome({ + name = "oillands", + + node_top = "pyutest_core:basalt_block", + depth_top = 1, + + node_filler = "pyutest_core:basalt_block", + depth_filler = 3, + + node_water = "pyutest_core:oil_source", + node_river_water = "pyutest_core:oil_source", + + node_riverbed = "pyutest_core:oil_source", + depth_riverbed = 2, + + y_max = PyuTestCore_BiomeTops.oillands, + y_min = PyuTestCore_SurfaceBiomeBottom, + + heat_point = 48, + humidity_point = 18 +}) + -- Structures dofile(PyuTestCore_Path.."/structures.lua") + -- Trees, Plants and More dofile(PyuTestCore_Path.."/trees.lua") diff --git a/mods/pyutest_core/structures.lua b/mods/pyutest_core/structures.lua index d664d93..741e0f7 100644 --- a/mods/pyutest_core/structures.lua +++ b/mods/pyutest_core/structures.lua @@ -4,7 +4,7 @@ minetest.register_decoration({ sidelen = 16, fill_ratio = 0.00004, biomes = {"grassland"}, - y_max = PyuTestCore_BiomeEndings.grassland, + y_max = PyuTestCore_BiomeTops.grassland, y_min = 1, schematic = PyuTestCore.get_schem_path("hut"), rotation = "random", @@ -17,7 +17,7 @@ minetest.register_decoration({ sidelen = 16, fill_ratio = 0.00004, biomes = {"frozen_plains"}, - y_max = PyuTestCore_BiomeEndings.frozen_plains, + y_max = PyuTestCore_BiomeTops.frozen_plains, y_min = 1, schematic = PyuTestCore.get_schem_path("igloo"), rotation = "random", @@ -30,7 +30,7 @@ minetest.register_decoration({ sidelen = 16, fill_ratio = 0.00007, biomes = {"frozen_plains"}, - y_max = PyuTestCore_BiomeEndings.frozen_plains, + y_max = PyuTestCore_BiomeTops.frozen_plains, y_min = 1, schematic = PyuTestCore.get_schem_path("snowycamp"), rotation = "random", @@ -43,7 +43,7 @@ minetest.register_decoration({ sidelen = 16, fill_ratio = 0.00006, biomes = {"desert"}, - y_max = PyuTestCore_BiomeEndings.desert, + y_max = PyuTestCore_BiomeTops.desert, y_min = 1, schematic = PyuTestCore.get_schem_path("desertwell"), rotation = "random", diff --git a/mods/pyutest_core/textures/barrier.png b/mods/pyutest_core/textures/barrier.png new file mode 100644 index 0000000..cdbc8ec Binary files /dev/null and b/mods/pyutest_core/textures/barrier.png differ diff --git a/mods/pyutest_core/textures/basalt.png b/mods/pyutest_core/textures/basalt.png index 92e54c1..4c6c5a6 100644 Binary files a/mods/pyutest_core/textures/basalt.png and b/mods/pyutest_core/textures/basalt.png differ diff --git a/mods/pyutest_core/textures/blast.png b/mods/pyutest_core/textures/blast.png new file mode 100644 index 0000000..fdd8e7b Binary files /dev/null and b/mods/pyutest_core/textures/blast.png differ diff --git a/mods/pyutest_core/textures/deadbush.png b/mods/pyutest_core/textures/deadbush.png new file mode 100644 index 0000000..ddeb72c Binary files /dev/null and b/mods/pyutest_core/textures/deadbush.png differ diff --git a/mods/pyutest_core/textures/fire.png b/mods/pyutest_core/textures/fire.png new file mode 100644 index 0000000..b410aa4 Binary files /dev/null and b/mods/pyutest_core/textures/fire.png differ diff --git a/mods/pyutest_core/textures/hellstone.png b/mods/pyutest_core/textures/hellstone.png index f7fbf94..c4ee1ab 100644 Binary files a/mods/pyutest_core/textures/hellstone.png and b/mods/pyutest_core/textures/hellstone.png differ diff --git a/mods/pyutest_core/textures/mycelium.png b/mods/pyutest_core/textures/mycelium.png index 760a00e..7d4935b 100644 Binary files a/mods/pyutest_core/textures/mycelium.png and b/mods/pyutest_core/textures/mycelium.png differ diff --git a/mods/pyutest_core/textures/obsidian.png b/mods/pyutest_core/textures/obsidian.png index ac3e8f4..353ad9d 100644 Binary files a/mods/pyutest_core/textures/obsidian.png and b/mods/pyutest_core/textures/obsidian.png differ diff --git a/mods/pyutest_core/textures/oil.png b/mods/pyutest_core/textures/oil.png new file mode 100644 index 0000000..a09ccb7 Binary files /dev/null and b/mods/pyutest_core/textures/oil.png differ diff --git a/mods/pyutest_core/textures/sapling.png b/mods/pyutest_core/textures/sapling.png new file mode 100644 index 0000000..66663bf Binary files /dev/null and b/mods/pyutest_core/textures/sapling.png differ diff --git a/mods/pyutest_core/textures/tnt-side.png b/mods/pyutest_core/textures/tnt-side.png new file mode 100644 index 0000000..a72cc08 Binary files /dev/null and b/mods/pyutest_core/textures/tnt-side.png differ diff --git a/mods/pyutest_core/textures/tnt-top-bottom.png b/mods/pyutest_core/textures/tnt-top-bottom.png new file mode 100644 index 0000000..76019b5 Binary files /dev/null and b/mods/pyutest_core/textures/tnt-top-bottom.png differ diff --git a/mods/pyutest_core/tools.lua b/mods/pyutest_core/tools.lua index deeff25..7770d2b 100644 --- a/mods/pyutest_core/tools.lua +++ b/mods/pyutest_core/tools.lua @@ -57,24 +57,11 @@ PyuTestCore.make_item("pyutest_core:stick", "stick", "Stick", {}, "stick.png", { }) PyuTestCore.make_tool("pyutest_core:bomb", "bomb", "Bomb", {}, "bomb.png", { - on_use = function (itemstack, user) + on_use = function (_, user) if user == nil then return end local pos = user:get_pos() - local range = tonumber(minetest.settings:get("bomb_range")) or 2 - - for dx = -range, range do - for dz = -range, range do - for dy = -range, range do - minetest.remove_node({x = pos.x + dx, y = pos.y + dy, z = pos.z + dz}) - end - end - end - - minetest.sound_play("block_break", { - pos = pos, - gain = 1 - }) + PyuTestCore.create_explosion(pos, 2) end }) diff --git a/mods/pyutest_core/trees.lua b/mods/pyutest_core/trees.lua index e2fa371..370cfe3 100644 --- a/mods/pyutest_core/trees.lua +++ b/mods/pyutest_core/trees.lua @@ -1,10 +1,32 @@ +minetest.register_decoration({ + deco_type = "simple", + place_on = {"pyutest_core:grass_block"}, + sidelen = 16, + fill_ratio = 0.009, + biomes = {"forest", "grassland"}, + y_max = PyuTestCore_BiomeTops.grassland, + y_min = 1, + decoration = {"pyutest_core:flower", "pyutest_core:flower2", "pyutest_core:flower3"} +}) + +minetest.register_decoration({ + deco_type = "simple", + place_on = {"pyutest_core:dirt_block"}, + sidelen = 16, + fill_ratio = 0.019, + biomes = {"wasteland", "desert"}, + y_max = PyuTestCore_BiomeTops.grassland, + y_min = 1, + decoration = "pyutest_core:deadbush" +}) + minetest.register_decoration({ deco_type = "schematic", place_on = {"pyutest_core:grass_block"}, sidelen = 16, fill_ratio = 0.004, biomes = {"forest"}, - y_max = PyuTestCore_BiomeEndings.grassland, + y_max = PyuTestCore_BiomeTops.grassland, y_min = 1, schematic = PyuTestCore.get_schem_path("tree"), rotation = "random", @@ -17,7 +39,7 @@ minetest.register_decoration({ sidelen = 16, fill_ratio = 0.004, biomes = {"forest"}, - y_max = PyuTestCore_BiomeEndings.grassland, + y_max = PyuTestCore_BiomeTops.grassland, y_min = 1, schematic = PyuTestCore.get_schem_path("tree2"), rotation = "random", @@ -26,11 +48,11 @@ minetest.register_decoration({ minetest.register_decoration({ deco_type = "schematic", - place_on = {"pyutest_core:mycelium_block"}, + place_on = {"pyutest_core:mycelium_block", "pyutest_core:grass_block"}, sidelen = 16, fill_ratio = 0.003, - biomes = {"mushroom_fields"}, - y_max = PyuTestCore_BiomeEndings.mushroom_fields, + biomes = {"mushroom_fields", "forest"}, + y_max = PyuTestCore_BiomeTops.mushroom_fields, y_min = 1, schematic = PyuTestCore.get_schem_path("mushroom"), rotation = "random", diff --git a/mods/pyutest_core/utils.lua b/mods/pyutest_core/utils.lua new file mode 100644 index 0000000..2b83439 --- /dev/null +++ b/mods/pyutest_core/utils.lua @@ -0,0 +1,42 @@ +PyuTestCore.create_explosion = function (pos, range, rm_pos) + if rm_pos then + minetest.remove_node(pos) + end + + for dx = -range, range do + for dz = -range, range do + for dy = -range, range do + local npos = {x = pos.x + dx, y = pos.y + dy, z = pos.z + dz} + if minetest.get_node(npos).name == "pyutest_core:tnt" then + minetest.get_node_timer(npos):start(0.2) + else + minetest.dig_node(npos) + end + end + end + end + + local r = range + local minpos = {x = pos.x - r, y = pos.y - r, z = pos.z - r} + local maxpos = {x = pos.x + r, y = pos.y + r, z = pos.z + r} + + minetest.add_particlespawner({ + amount = range * 3, + time = 1, + minexptime = 1, + maxexptime = 1, + minsize = 32, + maxsize = 64, + + collisiondetection = false, + texture = "blast.png", + + minpos = minpos, + maxpos = maxpos, + }) + + minetest.sound_play("block_break", { + pos = pos, + gain = 1.5 + }) +end diff --git a/settingtypes.txt b/settingtypes.txt index d0c812d..e69de29 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -1 +0,0 @@ -bomb_range (Bomb Explosion Range) int 2 1