From 079c6486a38951967382a781858795a536413ede Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Wed, 27 Dec 2017 11:24:17 -0500 Subject: [PATCH] spawners ores big update, spawners mobs deco stones remake --- spawners_env/init.lua | 2 +- spawners_mobs/_material/deco_stones.xcf | Bin 0 -> 11875 bytes spawners_mobs/api.lua | 14 +- spawners_mobs/init.lua | 2 +- spawners_mobs/mob_mummy.lua | 3 +- spawners_mobs/nodes_additional.lua | 16 +- spawners_mobs/spawners_mobs.lua | 2 +- .../textures/spawners_mobs_crack.png | Bin 390 -> 0 bytes spawners_mobs/textures/spawners_mobs_eye.png | Bin 248 -> 0 bytes .../spawners_mobs_flame_particle_2.png | Bin 0 -> 241 bytes spawners_mobs/textures/spawners_mobs_men.png | Bin 240 -> 0 bytes .../spawners_mobs_sandstone_carved_bird.png | Bin 0 -> 437 bytes .../spawners_mobs_sandstone_carved_eye.png | Bin 0 -> 656 bytes .../spawners_mobs_sandstone_carved_men.png | Bin 0 -> 645 bytes .../spawners_mobs_sandstone_carved_sun.png | Bin 0 -> 546 bytes .../spawners_mobs_smoke2_particle.png | Bin 233 -> 0 bytes .../textures/spawners_mobs_smoke_particle.png | Bin 234 -> 170 bytes .../spawners_mobs_smoke_particle_2.png | Bin 0 -> 234 bytes spawners_mobs/textures/spawners_mobs_sun.png | Bin 231 -> 0 bytes spawners_ores/api.lua | 150 ++++++++++-------- spawners_ores/init.lua | 2 +- spawners_ores/spawners_ores.lua | 51 +++--- 22 files changed, 140 insertions(+), 102 deletions(-) create mode 100644 spawners_mobs/_material/deco_stones.xcf delete mode 100644 spawners_mobs/textures/spawners_mobs_crack.png delete mode 100644 spawners_mobs/textures/spawners_mobs_eye.png create mode 100644 spawners_mobs/textures/spawners_mobs_flame_particle_2.png delete mode 100644 spawners_mobs/textures/spawners_mobs_men.png create mode 100644 spawners_mobs/textures/spawners_mobs_sandstone_carved_bird.png create mode 100644 spawners_mobs/textures/spawners_mobs_sandstone_carved_eye.png create mode 100644 spawners_mobs/textures/spawners_mobs_sandstone_carved_men.png create mode 100644 spawners_mobs/textures/spawners_mobs_sandstone_carved_sun.png delete mode 100644 spawners_mobs/textures/spawners_mobs_smoke2_particle.png create mode 100644 spawners_mobs/textures/spawners_mobs_smoke_particle_2.png delete mode 100644 spawners_mobs/textures/spawners_mobs_sun.png diff --git a/spawners_env/init.lua b/spawners_env/init.lua index 5e65d09..29fcf29 100644 --- a/spawners_env/init.lua +++ b/spawners_env/init.lua @@ -10,4 +10,4 @@ dofile(minetest.get_modpath(MOD_NAME).."/api.lua") dofile(minetest.get_modpath(MOD_NAME).."/spawners_env.lua") dofile(minetest.get_modpath(MOD_NAME).."/spawners_gen.lua") -print ("[Mod] Spawners Environmental 0.7 Loaded.") \ No newline at end of file +print ("[Mod] Spawners Environmental Loaded.") \ No newline at end of file diff --git a/spawners_mobs/_material/deco_stones.xcf b/spawners_mobs/_material/deco_stones.xcf new file mode 100644 index 0000000000000000000000000000000000000000..8795dd4c9c175d31bd20a682d4c5391a86f53d0a GIT binary patch literal 11875 zcmd6tZ%`Zena8!efE}80${oo$i92}emL_vfr*!US^5$N&oita-Wu}(|FBsbanLqji z7*O0MPH+Sgk}N?>Mk`rDz=E)y^NZ_@=a@_p3`nCL#6akfFvQnR=EzKEu9tMibEOHg zg{1pFKWVX+ro9)PYrJ?@&-47Ae=G6XXIHr0*m?fgj}2|d+KiS~9X5SoC;1`l9EZc- zU_bobpXzk9W2?kog8eb#l@v3h}+NX@2&F!sEwf7p&!KA}Fr+cE$`l_Y% zSYNlrc<#yaC)(N#-Ing&V^6S`r+V94nvZ?!o8MyF=Lj{0r6&>E@;RaE`msMQQ0R~Q z&Nmy3UG2we)LJmU`gz8J?WtF~jMihuE<;CaAH{dKwe_`H_Zy_>KQ!en+E98Q3LEz` zov!qnPWQlsPWR;?-s>v7t+P7ak!N(eqj-O-6rJw)h)(wnmrnP0uc=XZRX-qlzaMBZ z_MSW2+sfYHG8pJX$zeZSkeO3K#*2{8x}Eueu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?f{^*&s0imA8x!oE?5&F6p}H!hQ2g=TqPcV-Zh>xHh2Bsqn^V4lK;u;2AZ6}&ZPyhY#uYdjc1IIsm?8z#9)niq9{Za1d9f(z5I<7C%b5(*q zQ+8bcAUg{BY!!@TD8UkU0*?Bsvae%#uMF{=p0DCh@Kt+yc$DkYReB`JhnDGusx*9$ zSMhi~QB{QuX?W?ObCj0qJgGmd=T2}{SbzgFQ?K?yGko zR)3jwT796?>U*75b5FxjUtQ=F@#wUgf10mWJFV6u$$qERY4{$m=JEP;b+y_lbhK2> zI{h|v`ZQOKPT|1JpV#SkYVgW literal 0 HcmV?d00001 diff --git a/spawners_mobs/api.lua b/spawners_mobs/api.lua index 22b32c3..45dd1df 100644 --- a/spawners_mobs/api.lua +++ b/spawners_mobs/api.lua @@ -70,17 +70,17 @@ function spawners_mobs.cloud_booom(pos) minetest.add_particlespawner({ amount = 5, time = 2, - minpos = vector.subtract({x=pos.x-0.6, y=pos.y, z=pos.z-0.6}, 0.6), - maxpos = vector.add({x=pos.x+0.6, y=pos.y, z=pos.z+0.6}, 0.6), + minpos = vector.subtract({x=pos.x-0.3, y=pos.y, z=pos.z-0.3}, 0.3), + maxpos = vector.add({x=pos.x+0.3, y=pos.y, z=pos.z+0.3}, 0.3), minvel = {x=0.1, y=0.1, z=0.1}, maxvel = {x=0.2, y=0.2, z=0.2}, - minacc = vector.new({x=-0.1, y=0.1, z=-0.1}), - maxacc = vector.new({x=0.1, y=0.3, z=0.1}), + minacc = vector.new({x=-0.1, y=0.3, z=-0.1}), + maxacc = vector.new({x=0.1, y=0.6, z=0.1}), minexptime = 2, maxexptime = 3, minsize = 4, - maxsize = 8, - texture = "spawners_mobs_smoke2_particle.png^[transform"..math.random(0,3), + maxsize = 12, + texture = "spawners_mobs_smoke_particle_2.png^[transform"..math.random(0,3), }) end @@ -98,7 +98,7 @@ function spawners_mobs.add_flame_effects(pos) maxexptime = 5, minsize = .5, maxsize = 2.5, - texture = "spawners_mobs_flame_particle.png", + texture = "spawners_mobs_flame_particle_2.png", }) return id diff --git a/spawners_mobs/init.lua b/spawners_mobs/init.lua index 7d93dd4..20cabfd 100644 --- a/spawners_mobs/init.lua +++ b/spawners_mobs/init.lua @@ -18,4 +18,4 @@ if minetest.get_modpath("mobs") then dofile(minetest.get_modpath(MOD_NAME).."/nodes_additional.lua") end -print ("[Mod] Spawners Mobs 0.7 Loaded.") +print ("[Mod] Spawners Mobs Loaded.") diff --git a/spawners_mobs/mob_mummy.lua b/spawners_mobs/mob_mummy.lua index 3ad366d..0a158d5 100644 --- a/spawners_mobs/mob_mummy.lua +++ b/spawners_mobs/mob_mummy.lua @@ -38,6 +38,7 @@ local mummy_def = { {name = "spawners_mobs:deco_stone_eye", chance = 25, min = 1, max = 1}, {name = "spawners_mobs:deco_stone_men", chance = 25, min = 1, max = 1}, {name = "spawners_mobs:deco_stone_sun", chance = 25, min = 1, max = 1}, + {name = "spawners_mobs:deco_stone_bird", chance = 25, min = 1, max = 1}, {name = "default:diamond", chance = 3, min = 1, max = 2}, {name = "default:mese_crystal", chance = 3, min = 1, max = 2}, {name = "spawners_mobs:mummy", chance = 25, min = 1, max = 1}, @@ -58,7 +59,7 @@ local mummy_def = { punch_start = 74, punch_end = 105, }, - follow = {"spawners_mobs:deco_stone_eye","spawners_mobs:deco_stone_men","spawners_mobs:deco_stone_sun"}, + follow = {"spawners_mobs:deco_stone_eye","spawners_mobs:deco_stone_men","spawners_mobs:deco_stone_sun","spawners_mobs:deco_stone_bird"}, on_die = function(self, pos) minetest.sound_play("spawners_mobs_mummy_death", { object = self.object, diff --git a/spawners_mobs/nodes_additional.lua b/spawners_mobs/nodes_additional.lua index 8f35164..22f1694 100644 --- a/spawners_mobs/nodes_additional.lua +++ b/spawners_mobs/nodes_additional.lua @@ -1,11 +1,15 @@ -local img = {"eye", "men", "sun"} +-- +-- Decorative Carved Sand Stones +-- -for i=1,3 do +local img = {"eye", "men", "sun", "bird"} + +for i=1, #img do minetest.register_node("spawners_mobs:deco_stone_"..img[i], { description = "Sandstone with "..img[i], - tiles = {"default_sandstone.png^spawners_mobs_"..img[i]..".png"}, - is_ground_content = true, - groups = {crumbly=2,cracky=3}, + tiles = {"spawners_mobs_sandstone_carved_"..img[i]..".png"}, + is_ground_content = false, + groups = {cracky = 2}, sounds = default.node_sound_stone_defaults(), }) -end \ No newline at end of file +end diff --git a/spawners_mobs/spawners_mobs.lua b/spawners_mobs/spawners_mobs.lua index 29553b0..f60afcd 100644 --- a/spawners_mobs/spawners_mobs.lua +++ b/spawners_mobs/spawners_mobs.lua @@ -203,7 +203,7 @@ function spawners_mobs.create(mob_name, mod_prefix, size, offset, mesh, texture, groups = {cracky=1,level=2,igniter=1,not_in_creative_inventory=1}, drop = "spawners_mobs:"..mod_prefix.."_"..mob_name.."_spawner", on_construct = function(pos) - spawners_mobs.meta_set_str("infotext", mod_prefix.." "..mob_name.." spawner (overheated)", pos) + spawners_mobs.meta_set_str("infotext", mod_prefix.." "..mob_name.." spawner is overheated - too many items/entities in the area", pos) minetest.get_node_timer(pos):start(60) end, on_timer = function(pos, elapsed) diff --git a/spawners_mobs/textures/spawners_mobs_crack.png b/spawners_mobs/textures/spawners_mobs_crack.png deleted file mode 100644 index 9ff12fb0071093b4fef4a8083b09b6a2869bec5e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 390 zcmV;10eSw3P)pG5=lfsRCt`FQqfAoFcdBLG92OQ%%<~d0SCGf_LEgEM0I6bJJOI)oAeDer zg=yhzYgdBTP6_lQeg+Zl0BHwEms&q_8TQ+acAWo>gTAW3dxF3BA}b^rhX07*qoM6N<$f_oUB@c;k- diff --git a/spawners_mobs/textures/spawners_mobs_eye.png b/spawners_mobs/textures/spawners_mobs_eye.png deleted file mode 100644 index 4445dff31f2afbf2ea8db37b26ca973419619db1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMpkRxq zi(^Q|oTZZv@--;%I8Xmk`L7{;{V&a!y+1a8H8IjUD#_=ouwnbw1cn?pwgcO;GfSp3 z>)CZzG46SB=eiqL7-P%{anUtQI}D;8yc4{(^}yrf=MMAiu~@g$`2B32DXddl=OlNCdAOJy^zV$lEp>dcbmVPApnkt%VGC~+(; r$;dBa2+c`NOi>7~EG|jSE!I)+%uCigDQi~-RK?)w>gTe~DWM4fSMysH diff --git a/spawners_mobs/textures/spawners_mobs_flame_particle_2.png b/spawners_mobs/textures/spawners_mobs_flame_particle_2.png new file mode 100644 index 0000000000000000000000000000000000000000..262c45108c403fb7bb8cf5be03d3310577cf2b05 GIT binary patch literal 241 zcmeAS@N?(olHy`uVBq!ia0vp^93afX3?$7I7w-U4q5(c3uK7i|M|8D+#+v==@%X*b z>F-tbf8Q#;*%Z0~6)=_r`2{mLJiCzw;v{*yyD)UH%6b4foCO|{#S9F5%Rrd1{m#mK zpdfpRr>`sfLmnwUU2&)Xr{aM^vY8S|xv6<2KrRD=b5UwyNotBhd1gt5g1e`0 zK#E=}J5XH5)5S4_<9c#JfanMpkR%s zi(^Q|oa7(>|JyUG&UpC$|9>9A;F*RWE~(A`e?lU%PlLJV(6oQ^uTJ*e$7tz!?|=H& zl*7D=HyLIq0(mXG4L93P3zQf(u_;)~&TLCu6X)>F_{_@}vl5dm4l^thyz8)t_kbuj zb2>v+){+|xn}U?AX4|nTEN4zJGh=25-Nkiui^7QsKzB%$xJHyXmX>7X7cqq9q$Z{) h1XmW9q~;duD0t>2>z$OfD+8)x@O1TaS?83{1OU)gRiOX? diff --git a/spawners_mobs/textures/spawners_mobs_sandstone_carved_bird.png b/spawners_mobs/textures/spawners_mobs_sandstone_carved_bird.png new file mode 100644 index 0000000000000000000000000000000000000000..468c68014ab48438e9ac53fc980333b4aea8dd1c GIT binary patch literal 437 zcmV;m0ZRUfP)c!H&hkk;uf9%f*+>$C=K_oYBmn)6J69&Xv^9nAXyp*3+KY)S%kbqubV` z-Pfnz*{bK^ueAU9!~g&Q0b)x>L;#2d9Y_EG010qNS#tmY3ljhU3ljkVnw%H_000Mc zNliru;S3rN2o*)Z5u*SA0LDo~K~xyi4UXG#gdh+FhanmjHwKs+XmoKm`TtK0kEgm% zRm0!&{d?T4-R(Hr`}l&FlvK@(OjE5g!iy+YlAVl|RX^a!RZ|w_y-S;{a8h-SvpI)| zLIK)l;v_p;j`+0q0zb7I~q=cvXqKvOGyiS*vcJ?ygnAR)7E?l!>pBh2Fv f#`Q6UY5jzMf^ia$oNQ=X00000NkvXXu0mjf%jL!b literal 0 HcmV?d00001 diff --git a/spawners_mobs/textures/spawners_mobs_sandstone_carved_eye.png b/spawners_mobs/textures/spawners_mobs_sandstone_carved_eye.png new file mode 100644 index 0000000000000000000000000000000000000000..4433710552b8208e5fe4e2ad3d9b7227625e1f80 GIT binary patch literal 656 zcmV;B0&o3^P)P ziHBQ>hhB<^S&E2Ti-=l`h+vC}UW|!gjf!B6i(ih5UyqAlj*ME6j9!|QWSW&~nU-gp zmuH%oWt^94otR{vm}Z@sW1N|0otkQ$nrok$XrG&Co||i)oNJ(*YN4EIpq*%;ook|= zXQG~IqMmG{o@=9?Y^0uRq@Qe}plYI^aHODZrJ!!6p>L$3Y^I`ar=oADqHU(4bEczh zsH1bIq;06CYrD65zq*0JyM@BMh{C;##KDfm!jZ_tl*`4J%*UC|$(+&5pjL6X4gdfE z0b)x>L;#2d9Y_EG010qNS#tmY3ljhU3ljkVnw%H_000McNliru;S3rN0yTs|+2H^H z0O3hQK~xyi4UScE1u+Z+6=r5;W@cvGFs)@vBm3R|2-)ARsh*~!sl)~tI3RJLsFBm_ z{!S=JO3D;NxV&DetFK-Eg#bD6>0$SXS4i)`+FhoRLS;GlXlwWFD_ZMZ9|*Z^ES7b( zO|8C&IDjPnRHf(9Z?T!PQs@_wy;-M^4^PV0GCpleu+NTmSDaGyyTLPQu=|Ul$JA!jt}J@zQtmmX3SW~WOG?09~{2T&KE=-0mn;8ylPKHlao+% q*ftOfwFyhfibaC51IHwg=)*tk(@q~G+>T5D0000hgOS+UWc!H&hkk;uf9%f*+>$C=K_oYBmn5CwS}00001VoOIv0Eh)0 zNB{r;32;bRa{vGf6951U69E94oEQKA00(qQO+^Rc3>pst2TYcTVE_OC-$_J4R2b6@ zk5zI+F$@G1+%PjI8)jx^W_XrG*53aP@$Xc3RS&p$1x?iyNgWB2By=m)RyQlU3qm3a zPH@{*#mcG$V06VeySLM6WQ8Ok$^*xt#hPS6NI`p!MI>skC+46EJaxhTx!HZ!^z!;f zfq}!y*44z^L+jbs$c>sn4p{38>(}S+8)JVO5rj<8CVvkfk47&^1W1As&K!K4ey=_k zQ6UCQstb+v?QP{wosS%!jIgo9UxgH?uu zT8D#MhJ;#(g;ZK9uUqn~V}p=qU|Yo?)ZrlW4Vw|l?3fx)|l!n}yWy^F-bj>W=}$i$S(#h1*- zna;_a(afM05yIF20004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-&w8V>^>M&TiL0002ZNkl zru6J3fPg4cl&V+Bh^346WV%q*6HfJM4TBBQk(6AP;;=q+qw`9t33~9>>@$p4NM1Bim)Z8V9?)?C9E_6VA5dc~zU_az8K>at;4EN{RY4 zDe6w@jPJYogTLF~^Xv+!uv9#}j^-8zZXrftHf7eO6~?AH6EIWT@-0Z=g$A>zfcor2 km^6MX5-tpB85&am0juyiX~Q}o<^TWy07*qoM6N<$f(!%osQ>@~ literal 0 HcmV?d00001 diff --git a/spawners_mobs/textures/spawners_mobs_smoke2_particle.png b/spawners_mobs/textures/spawners_mobs_smoke2_particle.png deleted file mode 100644 index 89d81c146dfc92d2528e05abcd0fa5892d1902a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnL3?x0byx0z;*aCb)T!Hle|NocXoPQU{Vk`;r z3ubV5b|VeMN%D4gVd!9$^#F1>3p^r=85p>QL70(Y)*K0-AbW|YuPgflMtL3qew(+N z|A9g=o-U3d9M@gX9ppTqz{7e$zUswAK`XEDY;$2Nhwy?HIng8W`vuQD6r3zC@PVu0 z?t514Hxn-2Jkb)%QaB+p#8y0V;`zg7yA7ppFY9hA4w`GoJ$Y3@o9)W_qe@|aPx||P U4xd~x9cT}Or>mdKI;Vst0FT2;djJ3c diff --git a/spawners_mobs/textures/spawners_mobs_smoke_particle.png b/spawners_mobs/textures/spawners_mobs_smoke_particle.png index 91779c87993f1127f73c3f29b6d96aa64361a3ac..c70a9be4be2108e849f4b13bd4486c4dec815e78 100644 GIT binary patch delta 143 zcmaFGxQfxZGr-TCmrII^fq{Y7)59eQNDF{4BQuaxwarxmQfvV}A+A7LTU*3Q(U|QNbv{wgt(@b=$4n4&z?Q| z*s)_@zkZ$JBhN6=Sf!qC83O~~GRF2hEAxRW*-JcqUD+S>I4&JW(MnpOsBV5#~o(i25R(l^>bP0l+XkKbx%7v diff --git a/spawners_mobs/textures/spawners_mobs_smoke_particle_2.png b/spawners_mobs/textures/spawners_mobs_smoke_particle_2.png new file mode 100644 index 0000000000000000000000000000000000000000..91779c87993f1127f73c3f29b6d96aa64361a3ac GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^93afX3?$7I7w-U4`~f~8uBj!u<>lqGXU{%%?AX_@ zUuXEp17#Q(OM?7@862M7NCR<_yxm;OkH}&M2EJt=%-DWsWj;`ly~NYk zmHi=)6bqBeqa|XWfI_mFArU3c`MJ5Nc_lzD1A}u>YGO%hib8p2Nrr;Er*A-tUMf3K zT-(#dF@)oKazcVYLPA1_5yPZIeOx?;^v-ed_^9c%@%SjUIdG<_PB39+X0Tq!bb6b0 Q++mP;p00i_>zopr0IIw{c>n+a literal 0 HcmV?d00001 diff --git a/spawners_mobs/textures/spawners_mobs_sun.png b/spawners_mobs/textures/spawners_mobs_sun.png deleted file mode 100644 index 63d3b957d592c1ed713b2ff4b3a8eccc0ed4f154..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMpkT45 zi(^Q|oa7(>|JyUG&UpC$|9>9A;F%jA%~5&(-_rBm|H6}tB^rDc_0Ad;@`yj!%sX3Z zPTY*ElmE)MCEh!bW)a4G!E}+d+Z4tdIft_uHnAA89f)a9V(^(1A-+JuVWap8sSXiW zWmnG5fK94env>_w)Huk{e)~X-+v6z;Kt>Tc)I$ztaD0e0suW@QD^`F diff --git a/spawners_ores/api.lua b/spawners_ores/api.lua index 7af0086..353ece6 100644 --- a/spawners_ores/api.lua +++ b/spawners_ores/api.lua @@ -1,5 +1,6 @@ -- main tables spawners_ores = {} +local percent = 10 -- how often node timers for minerals will tick, +/- some random value function spawners_ores.tick(pos) @@ -8,7 +9,7 @@ end -- how often a growth failure tick is retried (e.g. not enough place to spawn minerals) function spawners_ores.tick_short(pos) - minetest.get_node_timer(pos):start(math.random(15, 30)) + minetest.get_node_timer(pos):start(math.random(15, 20)) end -- adds smoke particles @@ -83,29 +84,73 @@ end -- build form for spawners function spawners_ores.get_formspec(pos, table) -- Inizialize metadata and variables + local table = table or {} local meta = minetest.get_meta(pos) local mineral = table.ore or meta:get_string("mineral") + local ingot = table.ore or meta:get_string("mineral") + local status = meta:get_string("status") + local inv = meta:get_inventory() + local stack = inv:get_stack("fuel", 1) - local stack_per_obj = table.stack_per_obj or {} + -- fix different Ingot namings + if ingot == "iron" then + ingot = "steel" + end + + -- add extra ores based on percentage + local stack_per_obj = spawners_ores.stack_per({ + stack_count = stack:get_count(), + percent = percent + }) local stack_per = stack_per_obj.stack_per or 0 local extra_per = stack_per_obj.extra_per or 0 + + local colorize = { + gold = "^[colorize:#ffe4008C", + tin = "^[colorize:#d0d0d08C", + iron = "^[colorize:#b66d498C", + copper = "^[colorize:#b587528C", + } + + local colorize_arrow = "" + local button = "" + + if status == "active" then + colorize_arrow = colorize[mineral] + elseif status == "waiting" then + button = "button[1.8,2.5;2,1.5;restart;RE-START]" + end - -- dynamic form - return "size[8,8.5]".. + -- dynamic formspec + local formspec = "size[8,8.5]".. default.gui_bg.. default.gui_bg_img.. default.gui_slots.. - "label[1.8,0.3;Input "..mineral.." Ingot]".. + "label[1.8,0.3;Input "..ingot.." Ingot]".. "list[current_name;fuel;1.8,1;1,1;]".. "image[1.8,1;1,1;spawners_ores_ingot_slot.png]".. "list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,5.5;8,3;8]".. - "image[2.8,1;1,1;gui_furnace_arrow_bg.png^[transformR270]".. + "image[2.9,1;1,1;gui_furnace_arrow_bg.png^[transformR270"..colorize_arrow.."]".. "label[1.8,2;"..stack_per.." minerals ("..extra_per.." extra)]".. "image[4,1;1,1;spawners_ores_stone_with_"..mineral..".png]".. + button.. "listring[current_name;fuel]".. "listring[current_player;main]".. default.get_hotbar_bg(0, 4.25) + + meta:set_string("formspec", formspec) + + -- infotext + local infotext = mineral.." fuel: "..inv:get_stack("fuel", 1):get_count() + + if inv:is_empty("fuel") then + infotext = mineral.." ore spawner is empty." + elseif status == "waiting" then + infotext = "Waiting - no default:stone was found near by, "..mineral.." fuel: "..inv:get_stack("fuel", 1):get_count() + end + + meta:set_string("infotext", infotext) end -- check if is fuel empty in the node @@ -119,7 +164,6 @@ end function spawners_ores.stack_per(table) local table = table or {} local stack_count = table.stack_count or nil - local percent = table.percent or 10 local extra_per = (stack_count / 100) * percent extra_per = math.floor(extra_per) @@ -134,6 +178,7 @@ function spawners_ores.stack_per(table) } end +-- set status and update formspec/infotext function spawners_ores.on_timer(pos, elapsed) local available_node = spawners_ores.get_available_node(pos, "default:stone") @@ -141,16 +186,12 @@ function spawners_ores.on_timer(pos, elapsed) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local stack = inv:get_stack("fuel", 1) - local formspec = "" - local infotext = "" - - local stack_per_obj = {} - local percent = 10 local how_many = 1 local ore_name = meta:get_string("ore_name") local mineral = meta:get_string("mineral") local status = meta:get_string("status") + local tick = meta:get_int("tick") -- -- active @@ -159,41 +200,43 @@ function spawners_ores.on_timer(pos, elapsed) -- make sure the right node status is shown if status ~= "active" then meta:set_string("status", "active") + + spawners_ores.get_formspec(pos) minetest.swap_node(pos, {name="spawners_ores:"..ore_name.."_spawner_active"}) end - -- take fuel - stack:take_item() - inv:set_stack("fuel", 1, stack) + -- start spawning only on proper 'tick' + if tick ~= 0 then + if stack:get_count() % percent == 0 then + -- TODO: should get countent based on 'percent' + how_many = 2 + end - -- update infotext - infotext = mineral.." fuel: "..stack:get_count() + -- enough place to spawn more ores + spawners_ores.start_spawning_ores(available_node, "default:"..ore_name, how_many) + + -- take fuel + stack:take_item() + inv:set_stack("fuel", 1, stack) - -- add extra ores based on percentage - stack_per_obj = spawners_ores.stack_per({ - stack_count = stack:get_count(), - percent = percent - }) - - if stack:get_count() % percent == 0 then - -- TODO: should get countent based on 'percent' - how_many = 2 + spawners_ores.get_formspec(pos) end - -- enough place to spawn more ores - spawners_ores.start_spawning_ores(available_node, "default:"..ore_name, how_many) + -- dont wait for proper 'tick' and change state after 1 sec. + local next_available_node = spawners_ores.get_available_node(pos, "default:stone") - -- update infotext and formspec - formspec = spawners_ores.get_formspec(pos, { - stack_per_obj = stack_per_obj, - ore = mineral - }) - - meta:set_string("formspec", formspec) - meta:set_string("infotext", mineral.." fuel: "..inv:get_stack("fuel", 1):get_count()) + if inv:is_empty("fuel") or next_available_node == false then + minetest.get_node_timer(pos):start(1.0) + return + end + if tick == 0 then + -- start new proper timer + meta:set_int("tick", 1) + end + + -- start new proper timer spawners_ores.tick(pos) - -- -- default -- @@ -203,47 +246,22 @@ function spawners_ores.on_timer(pos, elapsed) meta:set_string("status", "") minetest.swap_node(pos, {name="spawners_ores:"..ore_name.."_spawner"}) - -- update infotext, formspec and stop the timer - stack_per_obj = spawners_ores.stack_per({ - stack_count = stack:get_count() - }) - - formspec = spawners_ores.get_formspec(pos, { - stack_per_obj = stack_per_obj, - ore = mineral - }) - - meta:set_string("infotext", mineral.." ore spawner is empty.") - meta:set_string("formspec", formspec) - + spawners_ores.get_formspec(pos) return -- -- waiting -- else + -- stop timer and show "refresh" button in order to start timer again -- make sure that waiting status/node is shown if status ~= "waiting" then meta:set_string("status", "waiting") minetest.swap_node(pos, {name="spawners_ores:"..ore_name.."_spawner_waiting"}) - - infotext = "Waiting - no default:stone was found near by, "..mineral.." fuel: "..inv:get_stack("fuel", 1):get_count() end - -- update infotext and formspec - stack_per_obj = spawners_ores.stack_per({ - stack_count = stack:get_count() - }) - - formspec = spawners_ores.get_formspec(pos, { - stack_per_obj = stack_per_obj, - ore = mineral - }) - - meta:set_string("formspec", formspec) - meta:set_string("infotext", mineral.." fuel: "..inv:get_stack("fuel", 1):get_count()) - - spawners_ores.tick_short(pos) + spawners_ores.get_formspec(pos) + return end end diff --git a/spawners_ores/init.lua b/spawners_ores/init.lua index 34a0081..1a976f2 100644 --- a/spawners_ores/init.lua +++ b/spawners_ores/init.lua @@ -6,4 +6,4 @@ dofile(minetest.get_modpath(MOD_NAME).."/api.lua") -- Spawners for ores dofile(minetest.get_modpath(MOD_NAME).."/spawners_ores.lua") -print ("[Mod] Spawners Ores 0.7 Loaded.") +print ("[Mod] Spawners Ores Loaded.") diff --git a/spawners_ores/spawners_ores.lua b/spawners_ores/spawners_ores.lua index 7b1813c..a7615b2 100644 --- a/spawners_ores/spawners_ores.lua +++ b/spawners_ores/spawners_ores.lua @@ -3,7 +3,7 @@ -- local colorize = { - stone_with_gold = "^[colorize:#ffe40030", + stone_with_gold = "^[colorize:#ffe40033", stone_with_tin = "^[colorize:#d0d0d040", stone_with_iron = "^[colorize:#b66d4940", stone_with_copper = "^[colorize:#b5875240", @@ -28,9 +28,6 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) end if stack:get_name() == "default:"..mineral.."_ingot" then - - minetest.get_node_timer(pos):start(1.0) - return stack:get_count() else return 0 @@ -43,11 +40,23 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player return 0 end - minetest.get_node_timer(pos):start(1.0) - return stack:get_count() end +local function on_metadata_inventory_put(pos) + local meta = minetest.get_meta(pos) + meta:set_int("tick", 0) + spawners_ores.get_formspec(pos) + minetest.get_node_timer(pos):start(1.0) +end + +local function on_metadata_inventory_take(pos) + local meta = minetest.get_meta(pos) + meta:set_int("tick", 0) + spawners_ores.get_formspec(pos) + minetest.get_node_timer(pos):start(1.0) +end + -- -- Spawners Ores creation function -- @@ -135,7 +144,8 @@ function spawners_ores.create(def) minetest.remove_node(pos) return drops end, - + on_metadata_inventory_put = on_metadata_inventory_put, + on_metadata_inventory_take = on_metadata_inventory_take, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, }) @@ -177,6 +187,17 @@ function spawners_ores.create(def) return drops end, + on_receive_fields = function(pos, formname, fields, sender) + if fields.restart then + local meta = minetest.get_meta(pos) + meta:set_int("tick", 0) + spawners_ores.get_formspec(pos) + minetest.get_node_timer(pos):start(1.0) + end + end, + + on_metadata_inventory_put = on_metadata_inventory_put, + on_metadata_inventory_take = on_metadata_inventory_take, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, }) @@ -201,7 +222,7 @@ function spawners_ores.create(def) on_construct = function(pos) local meta = minetest.get_meta(pos) - local formspec = spawners_ores.get_formspec(pos, {ore=ore[3]}) + spawners_ores.get_formspec(pos, {ore=ore[3]}) -- Inizialize inventory local inv = meta:get_inventory() @@ -211,14 +232,11 @@ function spawners_ores.create(def) meta:set_string("mineral", ore[3]) meta:set_string("ore_name", ore_name) meta:set_string("status", "") + meta:set_int("tick", 0) -- add spinning entity inside the spawner pos.y = pos.y + offset minetest.add_entity(pos,"spawners_ores:dummy_ore_"..ore_name) - - -- Update formspec, infotext and node - meta:set_string("formspec", formspec) - meta:set_string("infotext", ore[3].." ore spawner is empty") end, on_blast = function(pos) @@ -229,10 +247,8 @@ function spawners_ores.create(def) return drops end, - on_metadata_inventory_put = function(pos) - -- start timer function, it will sort out whether ingots can burn in to stone and create minerals or not. - minetest.get_node_timer(pos):start(1.0) - end, + on_metadata_inventory_put = on_metadata_inventory_put, + on_metadata_inventory_take = on_metadata_inventory_take, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, }) @@ -241,8 +257,7 @@ function spawners_ores.create(def) minetest.register_lbm({ name = "spawners_ores:start_nodetimer_"..ore_name, nodenames = { - "spawners_ores:"..ore_name.."_spawner_active", - "spawners_ores:"..ore_name.."_spawner_waiting" + "spawners_ores:"..ore_name.."_spawner_active" }, action = function(pos, node) spawners_ores.tick_short(pos)