mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-01 14:17:29 +01:00
Review commemts implemented
This commit is contained in:
parent
1449466365
commit
8bc4f8fdbe
@ -21,8 +21,14 @@ local function craft_star(itemstack, player, old_grid)
|
|||||||
|
|
||||||
-- analyze the recipe used
|
-- analyze the recipe used
|
||||||
for _, item in pairs(old_grid) do
|
for _, item in pairs(old_grid) do
|
||||||
if item:get_name() == "mcl_fire:fire_charge" then size = 2 end
|
if item:get_name() == "mcl_fire:fire_charge" then
|
||||||
if item:get_name() == "mcl_end:crystal" then size = 3 end
|
size = 2
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if item:get_name() == "mcl_end:crystal" then
|
||||||
|
size = 3
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local effect = {
|
local effect = {
|
||||||
|
@ -2,13 +2,15 @@ local path = minetest.get_modpath("vl_fireworks")
|
|||||||
|
|
||||||
vl_fireworks = {}
|
vl_fireworks = {}
|
||||||
|
|
||||||
|
local colors = {"red", "yellow", "blue", "green", "white"}
|
||||||
|
|
||||||
|
|
||||||
function vl_fireworks.generic_particle_explosion(pos, size)
|
function vl_fireworks.generic_particle_explosion(pos, size)
|
||||||
if pos.object then pos = pos.object:get_pos() end
|
if pos.object then pos = pos.object:get_pos() end
|
||||||
local particle_pattern = math.random(1, 3)
|
local particle_pattern = math.random(1, 3)
|
||||||
local fpitch
|
local fpitch
|
||||||
local type = math.random(1, 2)
|
local type = math.random(1, 2)
|
||||||
local size = size or math.random(1, 3)
|
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)]}
|
local this_colors = {colors[math.random(#colors)], colors[math.random(#colors)], colors[math.random(#colors)]}
|
||||||
|
|
||||||
if size == 1 then
|
if size == 1 then
|
||||||
|
@ -81,10 +81,9 @@ local firework_entity = {
|
|||||||
allow_punching = function(self, entity_def, projectile_def, object)
|
allow_punching = function(self, entity_def, projectile_def, object)
|
||||||
local lua = object:get_luaentity()
|
local lua = object:get_luaentity()
|
||||||
if lua and lua.name == "mobs_mc:rover" then return false end
|
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
|
--if (self.object:get_velocity() + object:get_velocity()).length() < 5 then return end
|
||||||
|
|
||||||
core.log("allow punching")
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
@ -183,7 +182,7 @@ local firework_def = {
|
|||||||
end,
|
end,
|
||||||
_vl_fireworks_std_durs_forces = { {2.2, 10}, {4.5, 20}, {6, 30} },
|
_vl_fireworks_std_durs_forces = { {2.2, 10}, {4.5, 20}, {6, 30} },
|
||||||
_vl_fireworks_tt = function(duration, stars)
|
_vl_fireworks_tt = function(duration, stars)
|
||||||
local retval = S("Duration:") .. " " .. duration
|
local retval = tt_help .. " " .. duration
|
||||||
|
|
||||||
for _, effect in pairs(stars) do
|
for _, effect in pairs(stars) do
|
||||||
if type(effect) == "string" then effect = core.deserialize(effect) end
|
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."),
|
_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",
|
wield_image = "vl_fireworks_star.png",
|
||||||
inventory_image = "vl_fireworks_star.png",
|
inventory_image = "vl_fireworks_star.png",
|
||||||
groups = { craftitem = 1 },
|
groups = { craftitem = 1, _vl_fireworks_star = 1 },
|
||||||
stack_max = 64,
|
stack_max = 64,
|
||||||
|
|
||||||
_vl_fireworks_star = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function vl_fireworks.star_tt(effect)
|
function vl_fireworks.star_tt(effect)
|
||||||
@ -17,7 +15,7 @@ function vl_fireworks.star_tt(effect)
|
|||||||
s = S("Generic Firework Star")
|
s = S("Generic Firework Star")
|
||||||
end
|
end
|
||||||
if effect.size then
|
if effect.size then
|
||||||
s = s .. "\nSize: " .. effect.size
|
s = s .. "\n" .. S("Size:") .. " " .. effect.size
|
||||||
end
|
end
|
||||||
return s:trim()
|
return s:trim()
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user