diff --git a/CHANGELOG.md b/CHANGELOG.md index b2ed210..80e5f51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Jul 18th - **STILL UNDERDEVELOPMENT** 2024] Update: Aquatic Caves +This update contains breaking changes! The main theme of this update was to revamp oceans and caves, but this update adds a bit of everything! - Revamped caves *again* @@ -16,6 +17,9 @@ The main theme of this update was to revamp oceans and caves, but this update ad - Added stone and wooden swords - Revamp source tree - Add structure API +- New snow texture +- Add snowman boss battle :0 +- Make magic shards more common ## [Jul 17th 2024] Unnamed Minor Update diff --git a/mods/pyutest/pyutest_core/items.lua b/mods/pyutest/pyutest_core/items.lua index fbd2285..6aa49c4 100644 --- a/mods/pyutest/pyutest_core/items.lua +++ b/mods/pyutest/pyutest_core/items.lua @@ -55,3 +55,4 @@ PyuTestCore.make_item("pyutest_core:glass_bottle", "Glass Bottle", {}, "glass-bo stack_max = 16 }) PyuTestCore.make_item("pyutest_core:brick", "Brick", {}, "brick.png") +PyuTestCore.make_item("pyutest_core:snowball", "Snowball", {}, "snowball.png") diff --git a/mods/pyutest/pyutest_core/magic.lua b/mods/pyutest/pyutest_core/magic.lua index c3d9978..ff23b22 100644 --- a/mods/pyutest/pyutest_core/magic.lua +++ b/mods/pyutest/pyutest_core/magic.lua @@ -4,7 +4,7 @@ minetest.override_item("pyutest_core:crying_obsidian_block", { max_items = 1, items = { { - rarity = 5, + rarity = 3.2, items = {"pyutest_core:magic_shards 3"} }, diff --git a/mods/pyutest/pyutest_core/mobs.lua b/mods/pyutest/pyutest_core/mobs.lua index adb90ba..0bfc151 100644 --- a/mods/pyutest/pyutest_core/mobs.lua +++ b/mods/pyutest/pyutest_core/mobs.lua @@ -3,6 +3,27 @@ PyuTestCore.HUMAN_LIKE_CBOX = {-0.25, -1, -0.25, 0.25, 1, 0.25} mobs.fallback_node = "pyutest_core:dirt_block" +local snowball_hit_player = function (self, player) + player:punch(self.object, nil, { + damage_groups = {fleshy = 9} + }, nil) +end + +mobs:register_arrow("pyutest_core:arrow_snowball", { + visual = "sprite", + visual_size = {x = 1, y = 1}, + textures = {"snowball.png"}, + hit_node = function (self, pos) + PyuTestCore.create_explosion(pos, 1, false, 9, self.object, false) + end, + hit_player = snowball_hit_player, + hit_mob = snowball_hit_player, + velocity = 9, + collisionbox = { + -1.5, -1.5, -1.5, 1.5, 1.5, 1.5 + } +}) + mobs:register_mob("pyutest_core:monster", { type = "monster", hp_max = 20, @@ -39,7 +60,7 @@ mobs:register_mob("pyutest_core:human", { hp_max = 20, hp_min = 20, walk_velocity = 1, - run_velocity = 1.8, + run_velocity = 6, armor = 100, passive = true, walk_chance = 50, @@ -109,6 +130,59 @@ mobs:register_mob("pyutest_core:firefly", { }) mobs:register_egg("pyutest_core:firefly", "Firefly Spawn Egg", "egg.png^[multiply:yellow", 0) +mobs:register_mob("pyutest_core:snowman", { + type = "monster", + hp_max = 450, + hp_min = 450, + walk_velocity = 1, + run_velocity = 4, + armor = 100, + passive = false, + walk_chance = 1, + stand_chance = 2, + damage = 9, + attack_chance = 1, + attack_type = "dogshoot", + arrow = "pyutest_core:arrow_snowball", + shoot_interval = 1.2, + shoot_offset = 2, + 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 = 35, + reach = 2, + jump = 1, + group_attack = false, + makes_footstep_sound = true, + dogshoot_switch = 2, + dogshoot_count_max = 3, + dogshoot_count2_max = 6, + + textures = { + "snowman.png", "snowman_back.png" + }, + + drops = { + { + name = "pyutest_core:magic_shards", + min = 2, + max = 5, + chance = 1 + }, + + { + name = "pyutest_core:snowball", + min = 4, + max = 9, + chance = 1 + } + } +}) +mobs:register_egg("pyutest_core:snowman", "Snowman Spawn Egg", "egg.png^[multiply:skyblue", 0) + local mapgen = minetest.get_mapgen_params().mgname or "???" if mapgen ~= "flat" and mapgen ~= "singlenode" then mobs:spawn({ diff --git a/mods/pyutest/pyutest_core/textures/snow.png b/mods/pyutest/pyutest_core/textures/snow.png index ef52447..0b7cbc7 100644 Binary files a/mods/pyutest/pyutest_core/textures/snow.png and b/mods/pyutest/pyutest_core/textures/snow.png differ diff --git a/mods/pyutest/pyutest_core/textures/snowball.png b/mods/pyutest/pyutest_core/textures/snowball.png new file mode 100644 index 0000000..cbd7718 Binary files /dev/null and b/mods/pyutest/pyutest_core/textures/snowball.png differ diff --git a/mods/pyutest/pyutest_core/textures/snowman.png b/mods/pyutest/pyutest_core/textures/snowman.png new file mode 100644 index 0000000..281df7b Binary files /dev/null and b/mods/pyutest/pyutest_core/textures/snowman.png differ diff --git a/mods/pyutest/pyutest_core/textures/snowman_back.png b/mods/pyutest/pyutest_core/textures/snowman_back.png new file mode 100644 index 0000000..4ab1379 Binary files /dev/null and b/mods/pyutest/pyutest_core/textures/snowman_back.png differ diff --git a/mods/pyutest/pyutest_core/utils.lua b/mods/pyutest/pyutest_core/utils.lua index 62b4aa5..8d4f26f 100644 --- a/mods/pyutest/pyutest_core/utils.lua +++ b/mods/pyutest/pyutest_core/utils.lua @@ -56,7 +56,7 @@ PyuTestCore.create_explosion = function (pos, range, rm_pos, dmg, creator, dmg_c if creator ~= nil then if v ~= creator then v:punch(creator, nil, { - damage_groups = {fleshy = dmg} + damage_groups = {fleshy = dmg} }, nil) end diff --git a/mods/pyutest/pyutest_mapgen/api.lua b/mods/pyutest/pyutest_mapgen/api.lua index e69de29..5cd24e3 100644 --- a/mods/pyutest/pyutest_mapgen/api.lua +++ b/mods/pyutest/pyutest_mapgen/api.lua @@ -0,0 +1,48 @@ +PyuTestMapgen = {} + +PyuTestMapgen.register_structure = function (name, schematic, def) + local id = "pyutest_mapgen:structure_block_"..name + minetest.register_node(id, { + description = string.format("Structure Block (%s)", name), + groups = { + not_in_creative_inventory = 1 + }, + tiles = { + "stick.png" + }, + walkable = false, + pointable = false, + }) + + minetest.register_decoration({ + sidelen = 80, + decoration = id, + deco_type = "simple", + place_on = def.place_on, + spawn_by = def.spawn_by, + num_spawn_by = def.num_spawn_by, + fill_ratio = def.fill_ratio, + noise_params = def.noise_params, + flags = def.flags or "place_center_x, place_center_y, force_placement", + biomes = def.biomes, + y_max = def.y_max, + y_min = def.y_min + }) + + minetest.register_lbm({ + name = "pyutest_mapgen:spawn_"..name, + run_at_every_load = true, + nodenames = {id}, + action = function (pos, node) + minetest.remove_node(pos) + minetest.place_schematic( + pos, + PyuTestCore.get_schem_path(schematic), + def.rotation or "random", + def.replacements or {}, + def.force_placement or true, + def.flags or "place_center_x, place_center_z" + ) + end + }) +end diff --git a/mods/pyutest/pyutest_mapgen/structures.lua b/mods/pyutest/pyutest_mapgen/structures.lua index 75c5b65..ec4ce77 100644 --- a/mods/pyutest/pyutest_mapgen/structures.lua +++ b/mods/pyutest/pyutest_mapgen/structures.lua @@ -1,7 +1,5 @@ -minetest.register_decoration({ - deco_type = "schematic", +PyuTestMapgen.register_structure("igloo", "igloo", { place_on = {"pyutest_core:snow_block"}, - sidelen = 16, fill_ratio = 0.00004, biomes = {"frozen_plains"}, y_max = PyuTestCore_BiomeTops.frozen_plains, @@ -12,33 +10,20 @@ minetest.register_decoration({ place_offset_y = 1 }) -minetest.register_decoration({ - deco_type = "schematic", +PyuTestMapgen.register_structure("desertwell", "desertwell", { place_on = {"pyutest_core:sand_block"}, - sidelen = 16, fill_ratio = 0.00006, biomes = {"desert"}, y_max = PyuTestCore_BiomeTops.desert, y_min = 1, - schematic = PyuTestCore.get_schem_path("desertwell"), - rotation = "random", - flags = "place_center_x, place_center_z" + rotation = "random" }) -local rblocks = minetest.registered_nodes -local blocks = {} -for k, _ in pairs(rblocks) do - local m = k:find("_block") - if m ~= nil then - table.insert(blocks, k) - end -end - minetest.register_decoration({ deco_type = "simple", sidelen = 16, fill_ratio = 0.0003, - place_on = blocks, + place_on = {"group:ground"}, biomes = minetest.registered_biomes, y_max = PyuTestCore_BiomeTops.mountains, y_min = PyuTestCore_SurfaceBottom, @@ -51,11 +36,8 @@ minetest.register_decoration({ } }) -minetest.register_decoration({ - deco_type = "schematic", - sidelen = 16, +PyuTestMapgen.register_structure("ice_spike", "icespike", { fill_ratio = 0.0004, - schematic = PyuTestCore.get_schem_path("icespike"), place_on = { "pyutest_core:ice_block", "pyutest_core:stone_block" @@ -66,36 +48,26 @@ minetest.register_decoration({ }, y_max = PyuTestCore_BiomeTops.ice_spikes, y_min = PyuTestCore_WorldBottom, - flags = "place_center_x, place_center_z", }) -minetest.register_decoration({ - deco_type = "schematic", - sidelen = 16, +PyuTestMapgen.register_structure("obsidian_mound", "obsidian-mound", { 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_SurfaceBottom, - flags = "place_center_x, place_center_z", place_offset_y = 1 }) -minetest.register_decoration({ - deco_type = "schematic", - sidelen = 16, +PyuTestMapgen.register_structure("ocean_ruins", "ocean_ruins", { fill_ratio = 0.0002, - schematic = PyuTestCore.get_schem_path("ocean_ruins"), place_on = {"pyutest_core:gravel_block"}, biomes = PyuTestCore.get_biomes_from_type(PyuTestCore.BIOME_TYPES.OCEAN), y_max = PyuTestCore_DeepOceanMax + 4, y_min = PyuTestCore_DeepOceanMin, - flags = "place_center_x, place_center_z, force_placement", place_offset_y = 1, spawn_by = {"pyutest_core:water_source"}, - num_spawn_by = 2, - rotation = "random" + num_spawn_by = 2 })