diff --git a/CHANGELOG.md b/CHANGELOG.md index 4942f00..1af70de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ - 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 +- Added Recipe for White, Red, Blue, Yellow, and Purple Dye - Bring Back Old Dirt Functionality - Remove Coarse Dirt - Major Codebase Refactors @@ -30,8 +30,11 @@ - Removed Liquid Lootbox - Added Block Digging Sound - Added Monsters and Humans +- Added Mimics - Remove aliases - "Decentralize" PyuTest APIs + - This means that PyuTest APIs no longer assume blocks, entities, bla bla bla are being defined for the pyutest_core mod +- Remove Colors from Lootboxes ## [Some Day I Don't Remember] Unnamed Minor Update diff --git a/mods/pyutest_core/blocks.lua b/mods/pyutest_core/blocks.lua index aa7e54c..cf0b2cf 100644 --- a/mods/pyutest_core/blocks.lua +++ b/mods/pyutest_core/blocks.lua @@ -141,7 +141,7 @@ PyuTestCore.make_building_blocks("pyutest_core:basalt", "Basalt", {"basalt.png"} 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}) +PyuTestCore.make_building_blocks("pyutest_core:crying_obsidian", "Enchanted Obsidian", {"enchanted-obsidian.png"}, nil, {block = PyuTestCore.BLOCK_BREAKABLE_VERYLONG}) PyuTestCore.make_node("pyutest_core:light", "Light", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT, @@ -236,7 +236,6 @@ PyuTestCore.make_node("pyutest_core:flower4", "Lavender", { inventory_image = "flower4.png" }) - PyuTestCore.make_node("pyutest_core:deadbush", "Deadbush", { block = PyuTestCore.BLOCK_BREAKABLE_INSTANT }, {"deadbush.png"}, { diff --git a/mods/pyutest_core/lootboxes.lua b/mods/pyutest_core/lootboxes.lua index 6bc21a5..1606df9 100644 --- a/mods/pyutest_core/lootboxes.lua +++ b/mods/pyutest_core/lootboxes.lua @@ -1,17 +1,9 @@ -PyuTestCore.LOOTBOX_USEFULLNESS = { - USELESS = "purple", - AVERAGE = "lightblue", - USEFUL = "coral", - AMAZING = "cyan" -} - -PyuTestCore.make_lootbox = function (type, dtype, items, usefullness) - local id = "pyutest_core:"..type.."_lootbox" +PyuTestCore.make_lootbox = function (name, dname, items) + local id = name.."_lootbox" minetest.register_node(id, { - description = Translate(dtype .. " Lootbox"), + description = Translate(dname .. " Lootbox"), groups = {block = PyuTestCore.BLOCK_BREAKABLE_CHOPPY}, tiles = {"crate.png"}, - color = usefullness, sounds = PyuTestCore.make_node_sounds(), on_rightclick = function (pos, _, clicker) if clicker == nil then return end @@ -29,26 +21,26 @@ PyuTestCore.make_lootbox = function (type, dtype, items, usefullness) }) end -PyuTestCore.make_lootbox("trash", "Trash", { +PyuTestCore.make_lootbox("pyutest_core:trash", "Trash", { ItemStack("pyutest_core:deadbush 19"), ItemStack("pyutest_core:") -}, PyuTestCore.LOOTBOX_USEFULLNESS.USELESS) +}) -PyuTestCore.make_lootbox("resource", "Resource", { +PyuTestCore.make_lootbox("pyutest_core:resource", "Resource", { 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", { +PyuTestCore.make_lootbox("pyutest_core:griefer", "Griefer's Dream", { ItemStack("pyutest_core:tnt 3"), ItemStack("pyutest_core:bomb 2") -}, PyuTestCore.LOOTBOX_USEFULLNESS.USEFUL) +}) -PyuTestCore.make_lootbox("lighting", "Lighting", { +PyuTestCore.make_lootbox("pyutest_core:lighting", "Lighting", { ItemStack("pyutest_core:light 2"), ItemStack("pyutest_core:torch 13") -}, PyuTestCore.LOOTBOX_USEFULLNESS.AMAZING) +}) diff --git a/mods/pyutest_core/magic.lua b/mods/pyutest_core/magic.lua index d7753ee..c3d9978 100644 --- a/mods/pyutest_core/magic.lua +++ b/mods/pyutest_core/magic.lua @@ -21,6 +21,7 @@ PyuTestCore.make_spellbook = function (nsname, desc, color, craftitem, action) end PyuTestCore.make_item(nsname, desc, {}, "spellbook.png", { + stack_max = 1, color = color, on_use = function (itemstack, user, pointed_thing) local pos = user:get_pos() diff --git a/mods/pyutest_core/mobs.lua b/mods/pyutest_core/mobs.lua index e477fea..3db2a1d 100644 --- a/mods/pyutest_core/mobs.lua +++ b/mods/pyutest_core/mobs.lua @@ -2,6 +2,7 @@ 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") +mobs.fallback_node = "pyutest_core:dirt_block" mobs:register_mob("pyutest_core:monster", { type = "monster", @@ -16,8 +17,6 @@ mobs:register_mob("pyutest_core:monster", { 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}, @@ -34,16 +33,15 @@ mobs:register_mob("pyutest_core:monster", { } }) 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 --- }) +mobs:spawn({ + name = "pyutest_core:monster", + nodes = {"group:ground"}, + interval = 2, + chance = 2, + active_object_count = 8, + min_light = 0, + max_light = 9, +}) mobs:register_mob("pyutest_core:human", { type = "npc", @@ -52,7 +50,7 @@ mobs:register_mob("pyutest_core:human", { walk_velocity = 1, run_velocity = 3, armor = 100, - passive = false, + passive = true, walk_chance = 50, stand_chance = 50, damage = 3, @@ -63,21 +61,55 @@ mobs:register_mob("pyutest_core:human", { collisionbox = PyuTestCore.HUMAN_LIKE_CBOX, textures = {"player.png", "player_back.png"}, follow = {"pyutest_core:coin"}, - attack_monsters = true, - group_attack = true, + runaway = true, view_range = 15, reach = 2, + fear_height = 7, 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 --- }) +mobs:spawn({ + name = "pyutest_core:human", + nodes = {"group:ground"}, + interval = 3, + chance = 4, + active_object_count = 5, + min_light = 9, + max_light = 15, + day_toggle = true, +}) + +mobs:register_mob("pyutest_core:mimic", { + type = "monster", + hp_max = 15, + hp_min = 15, + walk_velocity = 1, + run_velocity = 3, + armor = 100, + passive = false, + stand_chance = 1, + walk_chance = 0, + damage = 4, + attack_type = "dogfight", + pathfinding = 1, + visual = "cube", + visual_size = {x = 1, y = 1, z = 1}, + collisionbox = { + -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 + }, + textures = {"crate.png", "crate.png", "crate.png", "crate.png", "crate.png", "crate.png"}, + view_range = 12, + blood_amount = PyuTestCore.ENTITY_BLOOD_AMOUNT, + reach = 2 +}) +mobs:register_egg("pyutest_core:mimic", "Mimic Spawn Egg", "egg.png", 0) +mobs:spawn({ + name = "pyutest_core:mimic", + nodes = {"group:ground"}, + interval = 3, + chance = 18, + active_object_count = 2, + min_light = 0, + max_light = 15, + day_toggle = true, +}) diff --git a/mods/pyutest_core/player.lua b/mods/pyutest_core/player.lua index e525f96..a18c037 100644 --- a/mods/pyutest_core/player.lua +++ b/mods/pyutest_core/player.lua @@ -1,6 +1,10 @@ -- player setup minetest.register_on_joinplayer(function (player) if player == nil then return end + player:set_properties({ + hp_max = 30 + }) + player:get_inventory():set_width("main", 8) player:get_inventory():set_size("main", 8 * 4) player:hud_set_hotbar_itemcount(9) diff --git a/mods/pyutest_core/textures/lootbox_unlock.ogg b/mods/pyutest_core/sounds/lootbox_unlock.ogg similarity index 100% rename from mods/pyutest_core/textures/lootbox_unlock.ogg rename to mods/pyutest_core/sounds/lootbox_unlock.ogg diff --git a/mods/pyutest_core/textures/crying-obsidian.png b/mods/pyutest_core/textures/enchanted-obsidian.png similarity index 100% rename from mods/pyutest_core/textures/crying-obsidian.png rename to mods/pyutest_core/textures/enchanted-obsidian.png diff --git a/mods/pyutest_core/trees.lua b/mods/pyutest_core/trees.lua index da1c0bc..c541415 100644 --- a/mods/pyutest_core/trees.lua +++ b/mods/pyutest_core/trees.lua @@ -68,6 +68,31 @@ minetest.register_decoration({ flags = "place_center_x, place_center_z" }) +-- turns out lsystems are not in minetest yet, maybe they will in 5.9.0? +-- minetest.register_decoration({ +-- deco_type = "lsystem", +-- place_on = {"pyutest_core:grass_block"}, +-- sidelen = 16, +-- fill_ratio = 0.004, +-- biomes = {"forest"}, +-- y_max = PyuTestCore_BiomeTops.grassland, +-- y_min = 1, +-- treedef = { +-- axiom="FFFFFAFFBF", +-- rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]", +-- rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]", +-- trunk="pyutest_core:wooden_block", +-- leaves="pyutest_core:leaves_block", +-- angle=30, +-- iterations=2, +-- random_level=0, +-- trunk_type="single", +-- thin_branches=true, +-- fruit = "pyutest_core:leaves_block", +-- fruit_chance = 10 +-- } +-- }) + minetest.register_decoration({ deco_type = "schematic", place_on = {"pyutest_core:mycelium_block"}, diff --git a/mods/pyutest_core/utils.lua b/mods/pyutest_core/utils.lua index e22af2d..735d3cc 100644 --- a/mods/pyutest_core/utils.lua +++ b/mods/pyutest_core/utils.lua @@ -3,7 +3,6 @@ PyuTestCore.create_explosion = function (pos, range, rm_pos, dmg, creator) minetest.remove_node(pos) end - for dx = -range, range do for dz = -range, range do for dy = -range, range do @@ -17,10 +16,11 @@ PyuTestCore.create_explosion = function (pos, range, rm_pos, dmg, creator) end end - for _, v in pairs(minetest.get_objects_inside_radius(pos, range)) do if v ~= nil and v ~= creator then - v:set_hp(v:get_hp() - dmg) + v:punch(creator, nil, { + damage_groups = {fleshy = dmg} + }, nil) end end