Review commemts implemented

This commit is contained in:
the-real-herowl 2024-12-27 15:27:08 +01:00
parent 1449466365
commit 8bc4f8fdbe
4 changed files with 15 additions and 10 deletions

@ -21,8 +21,14 @@ local function craft_star(itemstack, player, old_grid)
-- analyze the recipe used
for _, item in pairs(old_grid) do
if item:get_name() == "mcl_fire:fire_charge" then size = 2 end
if item:get_name() == "mcl_end:crystal" then size = 3 end
if item:get_name() == "mcl_fire:fire_charge" then
size = 2
break
end
if item:get_name() == "mcl_end:crystal" then
size = 3
break
end
end
local effect = {

@ -2,13 +2,15 @@ local path = minetest.get_modpath("vl_fireworks")
vl_fireworks = {}
local colors = {"red", "yellow", "blue", "green", "white"}
function vl_fireworks.generic_particle_explosion(pos, size)
if pos.object then pos = pos.object:get_pos() end
local particle_pattern = math.random(1, 3)
local fpitch
local type = math.random(1, 2)
local size = size or math.random(1, 3)
local colors = {"red", "yellow", "blue", "green", "white"}
local this_colors = {colors[math.random(#colors)], colors[math.random(#colors)], colors[math.random(#colors)]}
if size == 1 then

@ -81,10 +81,9 @@ local firework_entity = {
allow_punching = function(self, entity_def, projectile_def, object)
local lua = object:get_luaentity()
if lua and lua.name == "mobs_mc:rover" then return false end
-- TODO at some point make it so impact depends on collision speed? (see next line)
--if (self.object:get_velocity() + object:get_velocity()).length() < 5 then return end
core.log("allow punching")
return true
end,
},
@ -183,7 +182,7 @@ local firework_def = {
end,
_vl_fireworks_std_durs_forces = { {2.2, 10}, {4.5, 20}, {6, 30} },
_vl_fireworks_tt = function(duration, stars)
local retval = S("Duration:") .. " " .. duration
local retval = tt_help .. " " .. duration
for _, effect in pairs(stars) do
if type(effect) == "string" then effect = core.deserialize(effect) end

@ -5,10 +5,8 @@ minetest.register_craftitem("vl_fireworks:firework_star", {
_doc_items_longdesc = S("A firework star is the key component of a firework rocket which is responsible for the visible explosion."),
wield_image = "vl_fireworks_star.png",
inventory_image = "vl_fireworks_star.png",
groups = { craftitem = 1 },
groups = { craftitem = 1, _vl_fireworks_star = 1 },
stack_max = 64,
_vl_fireworks_star = true
})
function vl_fireworks.star_tt(effect)
@ -17,7 +15,7 @@ function vl_fireworks.star_tt(effect)
s = S("Generic Firework Star")
end
if effect.size then
s = s .. "\nSize: " .. effect.size
s = s .. "\n" .. S("Size:") .. " " .. effect.size
end
return s:trim()
end