Unnamed Minor Update

This commit is contained in:
IamPyu 2024-12-22 17:40:52 -06:00
parent 77cee61fd8
commit 3d1c5b947a
5 changed files with 32 additions and 30 deletions

View File

@ -1,5 +1,15 @@
# Changelog
## [Dec 22nd] Unnamed Minor Update
Game Changes:
- Bugfixes
Code Changes:
- Document some functions
## [Dec 2nd - Dec 22nd] Major Update: The Greatest Update
**THIS UPDATE CONTAINS BREAKING CHANGES!!**

View File

@ -44,7 +44,7 @@ PyuTest.make_electricity_device("pyutest_electricity:delayer", "Delayer", {
end)
core.register_craft({
output = "pyutest_electricity:button",
output = "pyutest_electricity:delayer",
recipe = {
{ "group:cobble", "group:cobble", "group:cobble" },
{ "group:cobble", "pyutest_ores:zinc_ingot", "group:cobble" },

View File

@ -33,6 +33,7 @@ local function after_place_node(pos)
local meta = core.get_meta(pos)
meta:set_int(NOTE_POSITION_KEY, #NOTES)
meta:set_string("infotext", string.format("Note: %d", meta:get_int(NOTE_POSITION_KEY)))
end
local function play_sound(pos)
@ -72,24 +73,14 @@ PyuTest.make_electricity_device("pyutest_electricity:note_block", "Note Block",
meta:set_int(NOTE_POSITION_KEY, ppos + 1)
end
meta:set_string("infotext", string.format("Note: %d", meta:get_int(NOTE_POSITION_KEY)))
play_sound(pos)
end
}, function (pos, node, sender_pos)
play_sound(pos)
end)
core.register_abm({
label = "Note Block infotext",
nodenames = {"pyutest_electricity:note_block"},
interval = 1,
chance = 1,
action = function (pos)
local meta = core.get_meta(pos)
meta:set_string("infotext", string.format("Note: %d", meta:get_int(NOTE_POSITION_KEY)))
end
})
core.register_craft({
output = "pyutest_electricity:note_block",
recipe = {

View File

@ -13,20 +13,6 @@ PyuTest.make_potion = function (name, desc, options)
PyuTest.potion_recipes[options.craft] = name
end
PyuTest.make_projectile(e_id, {
visual = "sprite",
textures = {texture},
}, {
_slowdown = false,
}, {
on_hit_node = function (self, pos, node)
splash(pos + vector.new(0, 1, 0))
end,
on_hit_object = function (self, object)
splash(self.object:get_pos(), self.object)
end
})
local function drink(itemstack, user, pointed_thing)
if user == nil or not user:is_player() then
return
@ -43,10 +29,10 @@ PyuTest.make_potion = function (name, desc, options)
return itemstack
end
local function splash(pos, obj)
local function splash(pos)
local rad = options.radius or 2
for o in core.objects_inside_radius(pos, rad) do
if o ~= obj then
if o:is_valid() then
if o:is_player() then
if options.action_splash then
options.action_splash(o)
@ -85,6 +71,20 @@ PyuTest.make_potion = function (name, desc, options)
return itemstack
end
PyuTest.make_projectile(e_id, {
visual = "sprite",
textures = {texture},
}, {
_slowdown = false,
}, {
on_hit_node = function (self, pos, node)
splash(pos + vector.new(0, 1, 0))
end,
on_hit_object = function (self, object)
splash(self.object:get_pos())
end,
})
PyuTest.make_item(name, desc, {
potion = 1
}, texture, {

View File

@ -37,7 +37,8 @@ PyuTest.make_potion("pyutest_potions:instant_damage", "Instant Damage Potion", {
end,
action_splash = function (object)
PyuTest.deal_damage(object, 6, PyuTest.DAMAGE_TYPES.magic())
end
end,
craft = "pyutest_tools:stone_sword"
})
PyuTest.make_potion("pyutest_potions:instant_health", "Instant Health Potion", {