From 08db716db017be90275865fd25e52d2accd172c3 Mon Sep 17 00:00:00 2001 From: NPXcoot Date: Sun, 8 May 2016 15:07:33 +0200 Subject: [PATCH] Portal and tunnels idea --- init.lua | 71 ++++++++++++++++++++++++++++++++++++++++++++-- schems/3xair.mts | Bin 0 -> 38 bytes schems/air.mts | Bin 0 -> 48 bytes schems/portal.mts | Bin 0 -> 189 bytes tunnels.lua | 6 ++++ 5 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 schems/3xair.mts create mode 100644 schems/air.mts create mode 100644 schems/portal.mts create mode 100644 tunnels.lua diff --git a/init.lua b/init.lua index 602fac6..a8ee26f 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,6 @@ --Nssb +local path = minetest.get_modpath("nssb") +dofile(path.."/tunnels.lua") --Materials minetest.register_node("nssb:mossy_stone_brick", { description = "Mossy Stone Brick", @@ -416,6 +418,7 @@ nssb_register_buildings ('doppiopiccoghiaccio', 11, "default:dirt_with_snow", 1, nssb_register_buildings ('doppiopiccosabbia', 11, "default:desert_sand", 1, "default:desert_stone", 1, "air", 3, "default:desert_sand", 7, false, nil, false, false) nssb_register_buildings ('piccoscrausics', 8, "default:desert_sand", 1, "default:desert_stone", 1, "air", 3, "default:desert_sand", 3, false, nil, false, false) nssb_register_buildings ('fossasand', 1, "default:desert_sand", 1, "default:desert_stone", 1, "air", 3, "default:desert_sand", 16, false, nil, false, false) +nssb_register_buildings ('portal', 6, "default:dirt_with_grass", 2, "default:dirt", 2, "air", 24, "default:tree", 4, false, nil, false, false) --Eggs @@ -615,7 +618,7 @@ minetest.register_node("nssb:mornar", { liquid_alternative_source = "nssb:mornen", liquid_viscosity = 6, post_effect_color = {a=500, r=1, g=1, b=1}, - groups = {liquid=3, puts_out_fire=1}, + groups = {liquid=3, water=1, puts_out_fire=1}, }) minetest.register_node("nssb:mornen_flowing", { @@ -645,9 +648,40 @@ minetest.register_node("nssb:mornen_flowing", { liquid_renewable = true, damage_per_second = 2, post_effect_color = {a=500, r=1, g=1, b=1}, - groups = {liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, + groups = {liquid=3, puts_out_fire=1, water=1, not_in_creative_inventory=1}, }) + minetest.register_node("nssb:portal", { + description = "Morvala Portal", + inventory_image = minetest.inventorycube("mornen.png"), + drawtype = "liquid", + tiles = { + { + name = "mornen_animated.png", + animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0}, + }, + }, + alpha = 800, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + light_source = 15, + liquid_range= 0, + drowning = 1, + liquid_renewable = false, + liquidtype = "source", + liquid_alternative_flowing = "nssb:portal", + liquid_alternative_source = "nssb:portal", + liquid_viscosity = 0, + post_effect_color = {a=10, r=1, g=1, b=1}, + groups = {liquid=3, puts_out_fire=1}, +}) + + --abm @@ -689,6 +723,39 @@ minetest.register_abm({ }) +minetest.register_abm({ + nodenames = {"nssb:portal"}, + neighbors = {"air"}, + interval = 1.0, + chance = 1, + action = + function (pos, node) + minetest.add_particlespawner({ + amount = 100, + time = 1, + minpos = {x=pos.x-0.5, y=pos.y+0.5, z=pos.z-0.5}, + maxpos = {x=pos.x+0.5, y=pos.y+0.5, z=pos.z+0.5}, + minvel = {x=0, y=0.1, z=0}, + maxvel = {x=0, y=0.8, z=0}, + minacc = {x=0,y=0,z=0}, + maxacc = {x=0,y=0.4,z=0}, + minexptime = 1, + maxexptime = 3, + minsize = 0.5, + maxsize = 1.4, + collisiondetection = false, + vertical = true, + texture = "morparticle.png", + }) +--inserire funzione di teletrasporto che non sono in grado di fare + end +}) + +--destination of teleporting +local function placeair (pos) + local posair ={ x=0,y=-30600,z=0} + minetest.place_schematic(posair, minetest.get_modpath("nssb").."/schems/air.mts") +end --nodes gen for i=1,8 do diff --git a/schems/3xair.mts b/schems/3xair.mts new file mode 100644 index 0000000000000000000000000000000000000000..1c8c3dd56626529be4bca5b5a5e8ad4ca5d97c69 GIT binary patch literal 38 rcmeYb3HD`RVPIrnW?-(buLm&_Gm9$bBqunqe>GqbXJoKj#!>+Qm~sfk literal 0 HcmV?d00001 diff --git a/schems/air.mts b/schems/air.mts new file mode 100644 index 0000000000000000000000000000000000000000..4e19611b77e2092dfeca69a1cca40c4e63cc780c GIT binary patch literal 48 zcmeYb3HD`RVPIomW#Fs_0R~0}=ETgRiaE&%60D0EtXIghdL%4JPA*_%ur6=?3;-3J B4O{>K literal 0 HcmV?d00001 diff --git a/schems/portal.mts b/schems/portal.mts new file mode 100644 index 0000000000000000000000000000000000000000..281fca3b33ca6285bd0e1aeccc0209d9af4b1bc1 GIT binary patch literal 189 zcmeYb3HD`RVPIq6U|_3<0tQwFo|M$I#L}D+tCY;55(aT(UVM3GNk)8nQDSj119M_# z5ra%#adDDWW?o8WaY<2Wa!F=VPHKE^eo<;(2~d_BEL)IYRFareF()~Jfyqt5WtpRn znwBFQTN)eNj+JKuIE>~?>iBoGIH+0hU#?->U~#5KOd&<>*58)5i`sv3IQ;$KxV2G` XZ>7louZtP<6C_wG7#WV(OymauV#h+? literal 0 HcmV?d00001 diff --git a/tunnels.lua b/tunnels.lua new file mode 100644 index 0000000..a74e23c --- /dev/null +++ b/tunnels.lua @@ -0,0 +1,6 @@ +local function tunnel3x (pos) + for pox=0,100 do + local pos3x ={ x=pox,y=0,z=0} + minetest.place_schematic(pos3x, minetest.get_modpath("nssb").."/schems/3xair.mts") + end +end \ No newline at end of file