From 36b8689bf45f082997b8512b3cc9d8df25d10e98 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Fri, 27 Dec 2024 03:02:50 +0100 Subject: [PATCH] Slight vl_fireworks reorganisation --- mods/ITEMS/vl_fireworks/README.txt | 2 +- mods/ITEMS/vl_fireworks/init.lua | 7 ++++--- mods/ITEMS/vl_fireworks/{register.lua => rockets.lua} | 0 mods/ITEMS/vl_fireworks/star.lua | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) rename mods/ITEMS/vl_fireworks/{register.lua => rockets.lua} (100%) create mode 100644 mods/ITEMS/vl_fireworks/star.lua diff --git a/mods/ITEMS/vl_fireworks/README.txt b/mods/ITEMS/vl_fireworks/README.txt index 3202bc137..0d23404f5 100644 --- a/mods/ITEMS/vl_fireworks/README.txt +++ b/mods/ITEMS/vl_fireworks/README.txt @@ -1,6 +1,6 @@ Firework mod for VoxeLibre -by NO11 and and some parts by j45 +by Herowl and teknomunk, based on the old version by NO11 and j45 Sound credits: diff --git a/mods/ITEMS/vl_fireworks/init.lua b/mods/ITEMS/vl_fireworks/init.lua index 612a63419..8c61358f7 100644 --- a/mods/ITEMS/vl_fireworks/init.lua +++ b/mods/ITEMS/vl_fireworks/init.lua @@ -2,12 +2,12 @@ local path = minetest.get_modpath("vl_fireworks") vl_fireworks = {} -function vl_fireworks.generic_particle_explosion(pos) +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 = 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)]} @@ -189,5 +189,6 @@ function vl_fireworks.generic_particle_explosion(pos) return size end -dofile(path .. "/register.lua") +dofile(path .. "/star.lua") +dofile(path .. "/rockets.lua") dofile(path .. "/crafting.lua") diff --git a/mods/ITEMS/vl_fireworks/register.lua b/mods/ITEMS/vl_fireworks/rockets.lua similarity index 100% rename from mods/ITEMS/vl_fireworks/register.lua rename to mods/ITEMS/vl_fireworks/rockets.lua diff --git a/mods/ITEMS/vl_fireworks/star.lua b/mods/ITEMS/vl_fireworks/star.lua new file mode 100644 index 000000000..e3e7585af --- /dev/null +++ b/mods/ITEMS/vl_fireworks/star.lua @@ -0,0 +1 @@ +local S = minetest.get_translator(minetest.get_current_modname())