diff --git a/CHANGELOG.md b/CHANGELOG.md index 20d4150..97cb8f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Notable Game Changes: - Improved Stairs - Added Reinforced Glass - Add back the Rubies that were removed a while ago! +- Replaced Spawnpoints with a item Other Game Changes: @@ -31,6 +32,8 @@ Other Game Changes: - Fire is now marked as floodable - You can now walk through leaves - Make crop hitbox smaller +- Fireworks now damage entities when they're too close to the explosion +- Added new damage type `fireworks` Code Changes: diff --git a/mods/CORE/pyutest/damage.lua b/mods/CORE/pyutest/damage.lua index 55f1cd5..f7e962b 100644 --- a/mods/CORE/pyutest/damage.lua +++ b/mods/CORE/pyutest/damage.lua @@ -16,6 +16,14 @@ PyuTest.DAMAGE_TYPES = { } } end, + fireworks = function () + return { + type = "set_hp", + _pyutest = { + type = "fireworks", + } + } + end, burning = function () return { type = "set_hp", @@ -55,6 +63,8 @@ core.register_on_dieplayer(function(player, reason) if newreason.type == "explosion" then message = string.format("%s blew up", playername) + elseif newreason.type == "fireworks" then + message = string.format("%s went off with a bang", playername) elseif newreason.type == "burning" then message = string.format("%s burned to death", playername) end diff --git a/mods/ENTITIES/pyutest_fireworks/init.lua b/mods/ENTITIES/pyutest_fireworks/init.lua index 5c2034d..39600cc 100644 --- a/mods/ENTITIES/pyutest_fireworks/init.lua +++ b/mods/ENTITIES/pyutest_fireworks/init.lua @@ -25,7 +25,6 @@ core.register_entity("pyutest_fireworks:firework", { trail = function(self) local pos = self.object:get_pos() - vector.new(0, 1, 0) - local velocity = vector.new(math.random(-1, 1), 0, math.random(-1, 1)) if math.random(1, 2) == 1 then @@ -65,6 +64,12 @@ core.register_entity("pyutest_fireworks:firework", { local pos = self.object:get_pos() + for _, v in pairs(core.get_objects_inside_radius(pos, 3)) do + if v ~= self.object then + PyuTest.deal_damage(v, 9, PyuTest.DAMAGE_TYPES.fireworks()) + end + end + core.add_particlespawner({ amount = math.random(20, 40), time = 0.8, diff --git a/mods/PLAYER/pyutest_hud/init.lua b/mods/PLAYER/pyutest_hud/init.lua new file mode 100644 index 0000000..25af244 --- /dev/null +++ b/mods/PLAYER/pyutest_hud/init.lua @@ -0,0 +1,17 @@ +-- core.hud_replace_builtin("health", {}) + +-- PyuTest.HUDBARS = { + +-- } + +-- core.hud_replace_builtin("health", { +-- hud_elem_type = "statbar", +-- text = "pyutest-bar-health.png", +-- text2 = "pyutest-bar-empty.png", +-- number = core.PLAYER_MAX_HP_DEFAULT, +-- item = core.PLAYER_MAX_HP_DEFAULT, +-- position = {x = 0.5, y = 1}, +-- direction = 0, +-- size = {x = 24, y = 24}, +-- offset = {x = (-10 * 24) - 25, y = -(48 + 24 + 16)}, +-- }) diff --git a/mods/PLAYER/pyutest_spawnpoints/init.lua b/mods/PLAYER/pyutest_spawnpoints/init.lua index 5e9a050..dacc040 100644 --- a/mods/PLAYER/pyutest_spawnpoints/init.lua +++ b/mods/PLAYER/pyutest_spawnpoints/init.lua @@ -23,16 +23,17 @@ end core.register_on_shutdown(save_data) PyuTest.register_interval(save_data, 10) -PyuTest.make_node("pyutest_spawnpoints:spawnpoint", "Spawnpoint", { - choppy = PyuTest.BLOCK_FAST, - block = 1 -}, { "pyutest-spawnpoint.png" }, { - on_rightclick = function(pos, node, clicker) +PyuTest.make_item("pyutest_spawnpoints:spawnpoint", "Spawnpoint Setter", {}, "pyutest-star.png", { + color = PyuTest.COLORS.khaki[2], + on_use = function(itemstack, clicker) if clicker == nil then return end if not clicker:is_player() then return end local name = clicker:get_player_name() - spawnpoints[name] = pos + spawnpoints[name] = clicker:get_pos() + + itemstack:take_item() + return itemstack end }) diff --git a/textures/pyutest-bar-breath.png b/textures/pyutest-bar-breath.png new file mode 100644 index 0000000..699ad69 Binary files /dev/null and b/textures/pyutest-bar-breath.png differ diff --git a/textures/pyutest-bar-empty.png b/textures/pyutest-bar-empty.png new file mode 100644 index 0000000..7a3fefe Binary files /dev/null and b/textures/pyutest-bar-empty.png differ diff --git a/textures/pyutest-bar-health.png b/textures/pyutest-bar-health.png new file mode 100644 index 0000000..2ea48ae Binary files /dev/null and b/textures/pyutest-bar-health.png differ diff --git a/textures/pyutest-star.png b/textures/pyutest-star.png new file mode 100644 index 0000000..4bbe13f Binary files /dev/null and b/textures/pyutest-star.png differ