From 03b5634862903cfdae6a777a1b1ec37957d2159d Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Mon, 1 Feb 2016 23:46:05 +0100 Subject: [PATCH] added sound, refined formspec and fucntions --- API.lua | 16 ++++++++-------- sounds/strike.ogg | Bin 0 -> 18902 bytes spawners_ores.lua | 36 +++++++++++++++++++++++------------- 3 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 sounds/strike.ogg diff --git a/API.lua b/API.lua index b2047a4..a2b55f6 100644 --- a/API.lua +++ b/API.lua @@ -34,7 +34,7 @@ for k, mob_mod in ipairs(ENABLED_MODS) do ::continue:: end else - print("[MOD] Spawners: MOD "..mob_mod.." not found.") + print("[MOD] Spawners: MOD "..mob_mod.." not found and will not be loaded.") end end @@ -72,9 +72,9 @@ function spawners.add_effects(pos, radius) minetest.add_particlespawner({ amount = 32, time = 2, - minpos = vector.subtract(pos, radius / 2), - maxpos = vector.add(pos, radius / 2), - minvel = {x=-0.5, y=-10, z=-0.5}, + minpos = vector.subtract({x=pos.x, y=pos.y+1, z=pos.z}, radius / 2), + maxpos = vector.add({x=pos.x, y=pos.y+1, z=pos.z}, radius / 2), + minvel = {x=-0.5, y=3, z=-0.5}, maxvel = {x=0.5, y=10, z=0.5}, minacc = vector.new(), maxacc = vector.new(), @@ -99,7 +99,7 @@ function spawners.start_spawning_ores(pos, ore_name, sound_custom, spawners_pos) sound_name = false end - local how_many = math.random(0,2) + local how_many = math.random(1,2) -- how_many = how_many+1 print("how_many: "..how_many) @@ -112,7 +112,7 @@ function spawners.start_spawning_ores(pos, ore_name, sound_custom, spawners_pos) minetest.sound_play(sound_name, { pos = pos, max_hear_distance = 32, - gain = 10, + gain = 15, }) print("#2 spawing "..ore_name.." at "..minetest.pos_to_string(pos)) @@ -122,7 +122,7 @@ function spawners.start_spawning_ores(pos, ore_name, sound_custom, spawners_pos) minetest.sound_play(sound_name, { pos = pos, max_hear_distance = 32, - gain = 10, + gain = 15, }) print("#1 spawing "..ore_name.." at "..minetest.pos_to_string(pos)) @@ -155,7 +155,7 @@ function spawners.check_around_radius_ores(pos, check_node) print("check_node: "..check_node) if check_node then - node_ore_pos = minetest.find_node_near(pos, 3, {check_node}) + node_ore_pos = minetest.find_node_near(pos, 2, {check_node}) if node_ore_pos then found_node = node_ore_pos diff --git a/sounds/strike.ogg b/sounds/strike.ogg new file mode 100644 index 0000000000000000000000000000000000000000..3c1a7482f21e8569e6e854d041f526c24a84d8f9 GIT binary patch literal 18902 zcmagG1z23ovMxNhy95se9o#h#+;wmd?rtFj3+^_!1b26b;O_43lHh?5{vqE!XYc>q z`<%O;o}OM^-Bn%HZ}qC~HK1f+p$dQo{OkJZ84dedM8rk~LyCJcU&9}C)vIoLIx}ZWnA|N#xRW(6XBRMm9Y{p_&hBQ;Z~%zmg{3Kia6zw`aVSMF0VE3{aUP;5%5X-eFV6mo%sxaO zAkTiBpP=SxL03ggp((gnv46z1?Y1Wxb(?xL6MPU(QidT#L@0b5yyg(G8$TUx~_Cw@|HTr87 zKL}fb97HkHeMy zh8DGd`27nOB?cK2-}$y7J;GMfZCa4@A*ElY85iS7uXXj5lXzyHOMQ8<^&Fu7N7zE_^}PK^$|Ev$P8zTPp~0nf`|BM3le5zfJ{jQ96;(qY?IxLycwC{d@zAr zcxFDfNmvD>69577LCKkl#e)*Y1ptguLCC-$FlYjJ5DOY%+b03Z@)c#MPVga;29B`7 zX9i#b3rJKafP*A~VhspCkf&wotEsQ!tIs!@ zt>XJ=Cb?~LC}=}&7a&x(#UyXT1v~wef3Z@){mY75eX)^C#Z_HJ-Ar3eUEAGE`(9mh z!CMYORaIEVQ&(?PU%s_dPx9V&RoB-vTfSG<#`n=(4BEc)-X?hEyg2U$p&Bii88x|W z(pjZhS?3m)rqPv_mXtQyl~z{h<{p*imX6d~lvb9H)K-;M+MYtFmBppCjHRWFWwqr` zrHrSI#igwkBem7(m1U=mmnglAr>%~qm6c_+XRp-Oiqiq7(^l3mg}~9mvXj=5)>iw| zR;RH>JCeN8lTP~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FDy4p(KeFeMI3A%>RWP%FRV>U zasiAD%K|X^ZiG9%@&MA+o3|pTvyH`iJH3^x^;1ki=EyH;y$1PfZ+Z5R!1nr!Un#maQDwt#Arr#9?IG%fJG^}2qy}wwbg%Iefv8W{^zX$0GLco$wi*r0={+&t`GmL0fQfaCA;|7 v6J1=4o6~S$B0oPb4QhX??zEntH7pIdZulCw)!gpa^D~r(ThP6cU1b3PUvl0^ literal 0 HcmV?d00001 diff --git a/spawners_ores.lua b/spawners_ores.lua index 64fa0f6..1bf9beb 100644 --- a/spawners_ores.lua +++ b/spawners_ores.lua @@ -4,6 +4,7 @@ local ore_formspec = default.gui_bg.. default.gui_bg_img.. default.gui_slots.. + "label[2,1.7;Input Ingot]".. "list[current_name;fuel;3.5,1.5;1,1;]".. "list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,5.5;8,3;8]".. @@ -116,11 +117,11 @@ local function on_receive_fields(pos, formname, fields, sender) local waiting, found_node = spawners.check_node_status_ores(pos, "stone_with_"..ingot[3], "default:stone") if found_node then - print("found_node"); minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner_active"}) elseif waiting then - print("waiting"); minetest.swap_node(pos, {name="spawners:stone_with_"..ingot[3].."_spawner_waiting"}) + + meta:set_string("infotext", "There is no stone around - waiting. "..ingot[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) else return end @@ -143,6 +144,8 @@ function spawners.create_ore(ore_name, mod_prefix, size, offset, texture, sound_ m_name = "dummy_ore" } + local ore = string.split(ore_name, "_") + dummy_ore_definition.on_activate = function(self) self.object:setvelocity({x=0, y=0, z=0}) self.object:setacceleration({x=0, y=0, z=0}) @@ -236,6 +239,7 @@ function spawners.create_ore(ore_name, mod_prefix, size, offset, texture, sound_ spawners.get_formspec(pos) pos.y = pos.y + offset minetest.add_entity(pos,"spawners:dummy_ore_"..ore_name) + meta:set_string("infotext", ore[3].." ore spawner is empty") end, can_dig = can_dig, @@ -265,19 +269,23 @@ function spawners.create_ore(ore_name, mod_prefix, size, offset, texture, sound_ minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner_active"}) end - -- take fuel - local stack = inv:get_stack("fuel", 1) - stack:take_item() - print("stack: "..stack:get_count()) - - inv:set_stack("fuel", 1, stack) if inv:is_empty("fuel") then minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner"}) - meta:set_string("infotext", ore_name.." ore spawner is empty") + meta:set_string("infotext", ore[3].." ore spawner is empty.") + + return else - meta:set_string("infotext", ore_name.." ore spawner has "..inv:get_stack("fuel", 1):get_count().." ingots") + -- take fuel + local stack = inv:get_stack("fuel", 1) + stack:take_item() + + print("stack: "..stack:get_count()) + + inv:set_stack("fuel", 1, stack) + + meta:set_string("infotext", ore[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) end -- enough place to spawn more ores @@ -287,6 +295,8 @@ function spawners.create_ore(ore_name, mod_prefix, size, offset, texture, sound_ -- waiting status if node.name ~= "spawners:"..ore_name.."_spawner_waiting" then minetest.swap_node(pos, {name="spawners:"..ore_name.."_spawner_waiting"}) + + meta:set_string("infotext", "There is no stone around - waiting. "..ore[3].." ore spawner fuel: "..inv:get_stack("fuel", 1):get_count()) end end @@ -296,13 +306,13 @@ function spawners.create_ore(ore_name, mod_prefix, size, offset, texture, sound_ end -- default:stone_with_gold -spawners.create_ore("stone_with_gold", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "tnt_ignite") +spawners.create_ore("stone_with_gold", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") -- default:stone_with_iron -spawners.create_ore("stone_with_iron", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "tnt_ignite") +spawners.create_ore("stone_with_iron", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") -- default:stone_with_copper -spawners.create_ore("stone_with_copper", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "tnt_ignite") +spawners.create_ore("stone_with_copper", "", {x=.33,y=.33}, 0, {"default_stone.png^default_mineral_gold.png"}, "strike") -- recipes