From 06e7795d301dcb2fdd915133bdc12fcd3cf7c648 Mon Sep 17 00:00:00 2001 From: kaadmy Date: Thu, 17 Dec 2015 10:05:34 -0800 Subject: [PATCH] added lumien ore; may be buggy --- mods/ambiance/init.lua | 1 - mods/lumien/README.txt | 9 ++ mods/lumien/depends.txt | 3 + mods/lumien/init.lua | 142 ++++++++++++++++++++++++ mods/lumien/textures/lumien_block.png | Bin 0 -> 271 bytes mods/lumien/textures/lumien_block.xcf | Bin 0 -> 822 bytes mods/lumien/textures/lumien_crystal.png | Bin 0 -> 538 bytes mods/lumien/textures/lumien_crystal.xcf | Bin 0 -> 1306 bytes mods/lumien/textures/lumien_mineral.png | Bin 0 -> 419 bytes mods/lumien/textures/lumien_mineral.xcf | Bin 0 -> 1308 bytes mods/tnt/init.lua | 53 +++++---- 11 files changed, 184 insertions(+), 24 deletions(-) create mode 100644 mods/lumien/README.txt create mode 100644 mods/lumien/depends.txt create mode 100644 mods/lumien/init.lua create mode 100644 mods/lumien/textures/lumien_block.png create mode 100644 mods/lumien/textures/lumien_block.xcf create mode 100644 mods/lumien/textures/lumien_crystal.png create mode 100644 mods/lumien/textures/lumien_crystal.xcf create mode 100644 mods/lumien/textures/lumien_mineral.png create mode 100644 mods/lumien/textures/lumien_mineral.xcf diff --git a/mods/ambiance/init.lua b/mods/ambiance/init.lua index e250925..6d35ff8 100644 --- a/mods/ambiance/init.lua +++ b/mods/ambiance/init.lua @@ -70,7 +70,6 @@ local function step(dtime) local pos = player:getpos() local name = player:get_player_name() - for soundname, sound in pairs(ambiance.sounds) do if lastsound[name][soundname] then lastsound[name][soundname] = lastsound[name][soundname] + dtime diff --git a/mods/lumien/README.txt b/mods/lumien/README.txt new file mode 100644 index 0000000..4d4d72a --- /dev/null +++ b/mods/lumien/README.txt @@ -0,0 +1,9 @@ +Lumien mod +========== +By Kaadmy, for Pixture + +Adds a new type of ore: Lumien. +Lumien crystals glow when a player's nearby. + +Asset license: WTFPL +Source license: WTFPL diff --git a/mods/lumien/depends.txt b/mods/lumien/depends.txt new file mode 100644 index 0000000..3b3b016 --- /dev/null +++ b/mods/lumien/depends.txt @@ -0,0 +1,3 @@ +default +tnt +util diff --git a/mods/lumien/init.lua b/mods/lumien/init.lua new file mode 100644 index 0000000..9850c5d --- /dev/null +++ b/mods/lumien/init.lua @@ -0,0 +1,142 @@ +-- +-- Lumien mod +-- By Kaadmy, for Pixture +-- + +minetest.register_node( + "lumien:crystal_on", + { + description = "Lumien Crystal", + inventory_image = "lumien_crystal.png", + tiles = {"lumien_block.png"}, + paramtype = "light", + paramtype2 = "wallmounted", + drawtype = "nodebox", + node_box = { + type = "wallmounted", + wall_top = {-4/16, 0.5-(4/16), -4/16, 4/16, 0.5, 4/16}, + wall_side = {-0.5, -4/16, -4/16, -0.5+(4/16), 4/16, 4/16}, + wall_bottom = {-4/16, -0.5, -4/16, 4/16, -0.5+(4/16), 4/16} + }, + + groups = {crumbly = 3}, + light_source = 13, + drop = "lumien:crystal_off", + sounds = default.node_sound_glass_defaults(), + }) + +minetest.register_node( + "lumien:crystal_off", + { + description = "Lumien Crystal", + inventory_image = "lumien_crystal.png", + tiles = {"lumien_block.png"}, + paramtype = "light", + paramtype2 = "wallmounted", + drawtype = "nodebox", + node_box = { + type = "wallmounted", + wall_top = {-4/16, 0.5-(4/16), -4/16, 4/16, 0.5, 4/16}, + wall_side = {-0.5, -4/16, -4/16, -0.5+(4/16), 4/16, 4/16}, + wall_bottom = {-4/16, -0.5, -4/16, 4/16, -0.5+(4/16), 4/16} + }, + + groups = {crumbly = 3}, + light_source = 2, + sounds = default.node_sound_glass_defaults(), + }) + +minetest.register_node( + "lumien:block", + { + description = "Lumien Block", + tiles = {"lumien_block.png"}, + groups = {cracky = 1, stone = 1}, + light_source = 14, + sounds = default.node_sound_stone_defaults(), + }) + +minetest.register_node( + "lumien:ore", + { + description = "Lumien Ore", + tiles = {"default_stone.png^lumien_mineral.png"}, + groups = {cracky = 1, stone = 1}, + drop = "lumien:block", + sounds = default.node_sound_stone_defaults(), + }) + +minetest.register_ore( + { + ore_type = "scatter", + ore = "lumien:ore", + wherein = "default:stone", + clust_scarcity = 12*12*12, + clust_num_ores = 10, + clust_size = 10, + y_min = -256, + y_max = -64, + }) + +minetest.register_abm( + { + nodenames = {"lumien:crystal_on"}, + interval = 1, + chance = 1, + action = function(pos, node) + util.nodefunc( + {x = pos.x-1, y = pos.y-1, z = pos.z-1}, + {x = pos.x+1, y = pos.y+1, z = pos.z+1}, + "tnt:tnt", + function(pos) + tnt.burn(pos) + end, + true + ) + + local ok = true + for _,object in ipairs(minetest.get_objects_inside_radius(pos, 4)) do + if object:is_player() then + ok = false + end + end + + if ok then + minetest.set_node( + pos, + { + name = "lumien:crystal_off", + param = node.param, + param2 = node.param2 + }) + end + end, + }) + +local function step(dtime) + for _, player in ipairs(minetest.get_connected_players()) do + local pos = player:getpos() + + util.nodefunc( + {x = pos.x-1, y = pos.y-1, z = pos.z-1}, + {x = pos.x+1, y = pos.y+1, z = pos.z+1}, + "lumien:crystal_off", + function(pos) + local node = minetest.get_node(pos) + + minetest.set_node( + pos, + { + name = "lumien:crystal_on", + param = node.param, + param2 = node.param2 + }) + end, + true + ) + end +end + +minetest.register_globalstep(step) + +default.log("mod:lumien", "loaded") \ No newline at end of file diff --git a/mods/lumien/textures/lumien_block.png b/mods/lumien/textures/lumien_block.png new file mode 100644 index 0000000000000000000000000000000000000000..58cd455b32a25324df911705ab13db07b9648c0a GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP~kARpcQ?=_eJD`wciEBiObAE1aYF-J0b5UwyNotBh zd1gt5g1e`0KzJjcI8af!r;B5V#p$(^4EYWya4ScwE3%>*!o!lDDrpxASy^eqm6a$D(uP6IvX% zr2g%A>CnGQJW94HTw;<&dXMDth6lP`b6UQ(Zqa(b-L;CrNM3)JrDXa6pc5E8UHx3v IIVCg!07tW0{Qv*} literal 0 HcmV?d00001 diff --git a/mods/lumien/textures/lumien_block.xcf b/mods/lumien/textures/lumien_block.xcf new file mode 100644 index 0000000000000000000000000000000000000000..4892c3413ab166968973a83d7f0c461678f338bf GIT binary patch literal 822 zcmbVK%TB^T6z#)Dr4&KYm5WK(z@i2czJM+m7ft+yQrcl+AEYf27RE0y@he!mm>=NJ ziucx5OT>*gIX!32y?5?pri_P6vUYvq^T3lJ+9gnT0J039Yk)R+mm~y47jObN1>BYz z>u#Wa3T!ag)^y`A^r8&b5+<*##B(xlPM&$TAkzo?5i{+gl!p%UOqTFDdQdG({WRMI z9!cYX&j*dZ&)hhO6VflpOxVmJ!~0=k>3(Uw0-PLrXruCX`*0fR6m!NUqD$YURJdEnksLleG!i&t$(V)rGP%gu3fswkNtYx2R54s|iqPZqqS3DwVAk ZI6AO~u1*!(psL-$Y>)nP+N&(>KLNE&swe;e literal 0 HcmV?d00001 diff --git a/mods/lumien/textures/lumien_crystal.png b/mods/lumien/textures/lumien_crystal.png new file mode 100644 index 0000000000000000000000000000000000000000..33c5883cb551304f55bdca40cebb55f1e26f238c GIT binary patch literal 538 zcmV+#0_FXQP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00DwYL_t(I%cYaON&`U@M$aUg zVq-c3j!g;+LF^`-O~Beh5Ct0xVNzM;0mR162gslgAP9mfB8Zq)a2ml%6m1+~(@5BW zf{cakCUG}dc$@iQzQet9zbm}={3mk!GbXYwjWO}+0kqcQ_ZzKs8nCrI&(cOC2Kd&( z884BeZt6Y@0wAsq*KuJ4!1={JcWoACQlwXBk}>pKQn+H4;joV=ox5_{oZB8*`&kfSY*41j2?&7_Sq49WDzk67lr z~igVtKa1_J0DZ6M-Vs8*{er3Up{>vzk$xV}ro0Ij2a09w~i-$sf7#+byy z!<`wnvV3o|vU8d}3tDUBdz(^Fz=aXATm%pwhp+oTS(P02tYq cfz*5zZO3rDj;&y9Cqeib zf-(HOK;*066@>!hB|=B6Azmk#bg!U4#QMa=vE_EZ+qHWmaD_IXzaQAGk$q}>_C{yM z;fIek+S!h!Ubp4iWq076QVwdS>|{v)XEZatHm3Ui@roBBQQQcO)X8V3Kbn7>n{Ig9{nF znZa8b{3L^)0@JzaSO=i{Xr%v)^jnZpy?E#0)1g(rJkF`#h`*IgFs=(-E{_H0iy0TH zVDe@f1jnFqHsg%n90gMuI5Agex7^`@lmRGP=(8m#v4ys{o(X}1n1tw{2(g$Tty?$@R=S{77U9VJ703$v( z&1TcAXqD86shKLs5|w1cR80nYcMx+jVw#l-jL=ny5i{lo86#sdGM@Monna?>I5&r=(zxj-Sw64!_l=ltB<)VvY~=c3falGGH1 z^30M91$R&1fbd2>aRvrPZci7-5R21GC!Nha;=t3oKhmiyK=yLm>>J$&O(kr&qYrI* z(Cz8C%Gqv7bIhFP@?)QqJv>+rNo3BOcW<(>@ju~whE=yjp8Re8@FOWUd|9Se*1hU8 zJjRD-O0MeaNLb96!%!q%Zg$b_HiJX~!}L}Ap7yS^+$40fk$ukhdBzOiy|ToVCS`Pc ztUTzs085CO{WiM7deQ&nQlgf^81{>}2O^U0k3@n20R`YYe2rVxB z{?FA*{MWvGUF&NFqTOHSGd!#G6aKR5Mh5!isrflC$fZM){Yqh`p3Y{Y zceA-ATy+@sd@t1hep&K%Ml?s`y4QTt$;Uqb$z73E#$Ml(AA5H0_05x-{D5J{;OXk; Jvd$@?2>|OnqqP74 literal 0 HcmV?d00001 diff --git a/mods/lumien/textures/lumien_mineral.xcf b/mods/lumien/textures/lumien_mineral.xcf new file mode 100644 index 0000000000000000000000000000000000000000..b0cd964cd25db5512f695eae90709282ca6f875f GIT binary patch literal 1308 zcmdT?O>Wab6rQmiC`ls%w5(W+V3Q&RwaN|3qJvZ<#0^}>c1I+3<+!3`=EvbE z&eVi*=;mxV&o8H;n5R=U+3OCYI7p{yCWh9HviQUo`!DwGX#odSX%Ezs7HVA={{}?8 zn4kH9N@8(P--YC5Te8ZH&J&djl?12ZocL)J&BOfng2etiwaRQ#={Zz~f36XH{eI|) z_745vU7V%oiG6HN)piG--cAYIsxYk-8Ed_*jfi0 zeFF#Mu!g2<^fh*-&AP=;4C`wvq{vzdu67`Xc%U0FAx8eNk@T?EN)77xL5*xx^R}txKYcCF7%w|8k9p-b{Bzh2 WaF03VE_2H+tj}&se9gRk%6