From 992ca8e39257b23eeafdbec2c18f040e34cf7e54 Mon Sep 17 00:00:00 2001 From: tchncs Date: Thu, 25 Aug 2016 15:13:32 +0200 Subject: [PATCH] add teamwall, add particlespawner --- depends.txt | 1 + init.lua | 2 ++ nodes.lua | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/depends.txt b/depends.txt index 9d15771..f21be6b 100644 --- a/depends.txt +++ b/depends.txt @@ -4,6 +4,7 @@ farming ? darkage ? building_blocks ? teleport_potion ? +moreores ? mobs_animal ? mobs_better_rat ? mobs_slimes ? diff --git a/init.lua b/init.lua index ea994ca..1a69037 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,5 @@ +illuna = {} + dofile(minetest.get_modpath("illuna").."/nodes.lua") dofile(minetest.get_modpath("illuna").."/crafting.lua") dofile(minetest.get_modpath("illuna").."/commands.lua") diff --git a/nodes.lua b/nodes.lua index 8a2ea1f..fec94cd 100644 --- a/nodes.lua +++ b/nodes.lua @@ -15,7 +15,69 @@ minetest.register_node("illuna:desert_gravel", { } }) -minetest.register_node("illuna:welcome_block_1", { +function illuna.teamconstruct(pos) + minetest.add_entity({x=pos.x, y=pos.y+1.35, z=pos.z}, "illuna:teamlist") + local timer = minetest.get_node_timer(pos) + timer:start(5.0) +end + +function illuna.particleconstruct(pos) + minetest.add_particlespawner({ + amount = 2, + time = 0, + minpos = pos, + maxpos = pos, + minvel = {x = -0, y = 0, z = -0}, + maxvel = {x = 1, y = 1, z = 1}, + minacc = {x = -1, y = -1, z = -1}, + maxacc = {x = 1, y = 1, z = 1}, + minexptime = 2, + maxexptime = 3, + minsize = 0.2, + maxsize = 1, + texture = "illuna_particle.png", + }) +end + +minetest.register_entity("illuna:teamlist", { + visual = "sprite", + visual_size = {x=0.85, y=0.85}, + collisionbox = {0}, + physical = false, + textures = {"moreores_tin_block.png^team_wall.png"}, + on_activate = function(self) + local pos = self.object:getpos() + local pos_under = {x=pos.x, y=pos.y-1, z=pos.z} + + if minetest.get_node(pos_under).name ~= "illuna:team" then + self.object:remove() + end + end +}) + +minetest.register_node("illuna:team", { + description = "Illuna Teamlist", + tiles = {"caverealms_glow_obsidian.png"}, + paramtype2 = "facedir", + groups = {cracky = 3}, + light_source = 20, + drop = 'illuna:team', + on_construct = illuna.teamconstruct, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("illuna:particlespawner", { + description = "Illuna Particlespawner", + tiles = {"caverealms_glow_obsidian.png"}, + paramtype2 = "facedir", + groups = {cracky = 3}, + light_source = 20, + drop = 'illuna:particlespawner', + on_construct = illuna.particleconstruct, + sounds = default.node_sound_stone_defaults(), +}) + + minetest.register_node("illuna:welcome_block_1", { description = "Illuna Welcome Block 1", tiles = {"default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png", "default_obsidian.png^welcome_block_1.png"}, paramtype2 = "facedir",