diff --git a/chats.lua b/chats.lua index 37ad485..5265d54 100644 --- a/chats.lua +++ b/chats.lua @@ -1,10 +1,24 @@ -local illuminati_death_message_table = { +illuminati.death_message_table = { ' We control your life too.', ' Assemble the brotherhood, we have fresh flesh.', ' The Illuminati claimed another life', - ' That was an easy one.' + ' That was an easy one.', } +illuminati.core_message_table = { + 'Ah, a new convert.', + 'Every day we grow in numbers.', + 'Has a mortal discovered our secret? Death to him!', + 'Blocks are but temporal, we are forever.', +} + +function send_message(table) + local max = #(table) + local key = math.random(1,max) + local message = table[key] + return message +end + minetest.register_on_chat_message(function(name,message) if string.match(message, 'foobar') then minetest.chat_send_all(' Hush, this is not public information.') @@ -21,7 +35,9 @@ minetest.register_on_dieplayer(function(player) local key = #(minetest.get_connected_players()) local people = minetest.get_connected_players() local person = math.random(1, key) - local name1 = people[person] + local name1 = people[person] local name = name1:get_player_name() - minetest.chat_send_player(name, "Hello " ..name..' somebody just died.') + if name1 ~= player then + minetest.chat_send_player(name, send_message(illuminati.death_message_table)) + end end) diff --git a/init.lua b/init.lua index 3219da4..5076cd3 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,5 @@ +illuminati = {} + dofile(minetest.get_modpath('illuminati')..'/chats.lua') dofile(minetest.get_modpath('illuminati')..'/nodes.lua') +dofile(minetest.get_modpath('illuminati')..'/relics.lua') diff --git a/nodes.lua b/nodes.lua index febe0ff..2268457 100644 --- a/nodes.lua +++ b/nodes.lua @@ -36,30 +36,30 @@ minetest.register_node('illuminati:core_off',{ fixed = {-.4, -.5, -.4, .4, .5, .4}, }, after_place_node = function(pos, itemstack) - local n = minetest.get_node(pos) - local p1 = {x=pos.x, y=pos.y-1, z=pos.z} - local p2 = {x=pos.x, y=pos.y-2, z=pos.z} - local n1 = minetest.get_node_or_nil(p1) - local n2 = minetest.get_node_or_nil(p2) - if n1.name == 'default:diamondblock' and n2.name == 'default:diamondblock' then - local ps1 = {x=pos.x-3, y=pos.y-1, z=pos.z} - local pw1 = {x=pos.x+3, y=pos.y-1, z=pos.z} - local pn1 = {x=pos.x, y=pos.y-1, z=pos.z-3} - local pe1 = {x=pos.x, y=pos.y-1, z=pos.z+3} - local ns1 = minetest.get_node_or_nil(ps1) - local nw1 = minetest.get_node_or_nil(pw1) - local nn1 = minetest.get_node_or_nil(pn1) - local ne1 = minetest.get_node_or_nil(pe1) - if ns1.name == 'illuminati:cone_off' and nw1.name == 'illuminati:cone_off' and nn1.name == 'illuminati:cone_off' and ne1.name == 'illuminati:cone_off' then - local ps2 = {x=pos.x-3, y=pos.y-2, z=pos.z} - local pw2 = {x=pos.x+3, y=pos.y-2, z=pos.z} - local pn2 = {x=pos.x, y=pos.y-2, z=pos.z-3} - local pe2 = {x=pos.x, y=pos.y-2, z=pos.z+3} - local ns2 = minetest.get_node_or_nil(ps2) - local nw2 = minetest.get_node_or_nil(pw2) - local nn2 = minetest.get_node_or_nil(pn2) - local ne2 = minetest.get_node_or_nil(pe2) - if ns2.name == 'default:goldblock' and nw2.name == 'default:goldblock' and nn2.name == 'default:goldblock' and ne2.name == 'default:goldblock' then + local n = minetest.get_node(pos) + local p1 = {x=pos.x, y=pos.y-1, z=pos.z} + local p2 = {x=pos.x, y=pos.y-2, z=pos.z} + local n1 = minetest.get_node_or_nil(p1) + local n2 = minetest.get_node_or_nil(p2) + if n1.name == 'default:diamondblock' and n2.name == 'default:diamondblock' then + local ps1 = {x=pos.x-3, y=pos.y-1, z=pos.z} + local pw1 = {x=pos.x+3, y=pos.y-1, z=pos.z} + local pn1 = {x=pos.x, y=pos.y-1, z=pos.z-3} + local pe1 = {x=pos.x, y=pos.y-1, z=pos.z+3} + local ns1 = minetest.get_node_or_nil(ps1) + local nw1 = minetest.get_node_or_nil(pw1) + local nn1 = minetest.get_node_or_nil(pn1) + local ne1 = minetest.get_node_or_nil(pe1) + if ns1.name == 'illuminati:cone_off' and nw1.name == 'illuminati:cone_off' and nn1.name == 'illuminati:cone_off' and ne1.name == 'illuminati:cone_off' then + local ps2 = {x=pos.x-3, y=pos.y-2, z=pos.z} + local pw2 = {x=pos.x+3, y=pos.y-2, z=pos.z} + local pn2 = {x=pos.x, y=pos.y-2, z=pos.z-3} + local pe2 = {x=pos.x, y=pos.y-2, z=pos.z+3} + local ns2 = minetest.get_node_or_nil(ps2) + local nw2 = minetest.get_node_or_nil(pw2) + local nn2 = minetest.get_node_or_nil(pn2) + local ne2 = minetest.get_node_or_nil(pe2) + if ns2.name == 'default:goldblock' and nw2.name == 'default:goldblock' and nn2.name == 'default:goldblock' and ne2.name == 'default:goldblock' then minetest.set_node(pos,{name = 'illuminati:core_on', param2=n.param2}) minetest.set_node(ps1,{name = 'illuminati:cone_on'}) minetest.set_node(pw1,{name = 'illuminati:cone_on'}) @@ -130,6 +130,18 @@ minetest.register_node('illuminati:cone_off',{ type = 'fixed', fixed = {-.5, -.5, -.5, .5, .35, .5}, }, + after_place_node = function(pos, placer) + local key = #(minetest.get_connected_players()) + local people = minetest.get_connected_players() + local person = math.random(1, key) + local name1 = people[person] + local name = name1:get_player_name() + local placer_name = placer:get_player_name() + if name ~= placer_name then + minetest.chat_send_player(name, send_message(illuminati.core_message_table)) + end + end, + }) minetest.register_node('illuminati:cone_on',{ diff --git a/relics.lua b/relics.lua new file mode 100644 index 0000000..315e1d4 --- /dev/null +++ b/relics.lua @@ -0,0 +1,22 @@ +relic_table = { -- Number, Description + {'1', 'Achieve ultimate power.'}, + {'2', 'Build a core..'}, + {'3', 'Blocks of diamond and gold.'}, + {'4', 'Cones atop the gold.'}, + {'5', 'Crystal above two diamond.'}, + {'6', 'Diamond in the center.'}, + {'7', 'Gold to the N, S, E, and W.'}, + {'8', 'Two spaces between blocks.'}, + {'9', 'If correct will generate power.'}, +} + +for i in ipairs (relic_table) do + local num = relic_table[i][1] + local desc = relic_table[i][2] + +minetest.register_craftitem('illuminati:relic_'..num, { + description = desc, + inventory_image = 'illuminati_relic_'..num..'.png', + groups = {not_in_creative_inventory=1}, +}) +end diff --git a/textures/illuminati_relic_1.png b/textures/illuminati_relic_1.png new file mode 100644 index 0000000..fd51cbf Binary files /dev/null and b/textures/illuminati_relic_1.png differ diff --git a/textures/illuminati_relic_2.png b/textures/illuminati_relic_2.png new file mode 100644 index 0000000..556bc73 Binary files /dev/null and b/textures/illuminati_relic_2.png differ diff --git a/textures/illuminati_relic_3.png b/textures/illuminati_relic_3.png new file mode 100644 index 0000000..929d3c1 Binary files /dev/null and b/textures/illuminati_relic_3.png differ diff --git a/textures/illuminati_relic_4.png b/textures/illuminati_relic_4.png new file mode 100644 index 0000000..994e238 Binary files /dev/null and b/textures/illuminati_relic_4.png differ diff --git a/textures/illuminati_relic_5.png b/textures/illuminati_relic_5.png new file mode 100644 index 0000000..a3e30d3 Binary files /dev/null and b/textures/illuminati_relic_5.png differ diff --git a/textures/illuminati_relic_6.png b/textures/illuminati_relic_6.png new file mode 100644 index 0000000..ca499fa Binary files /dev/null and b/textures/illuminati_relic_6.png differ diff --git a/textures/illuminati_relic_7.png b/textures/illuminati_relic_7.png new file mode 100644 index 0000000..88b3363 Binary files /dev/null and b/textures/illuminati_relic_7.png differ diff --git a/textures/illuminati_relic_8.png b/textures/illuminati_relic_8.png new file mode 100644 index 0000000..d52a264 Binary files /dev/null and b/textures/illuminati_relic_8.png differ diff --git a/textures/illuminati_relic_9.png b/textures/illuminati_relic_9.png new file mode 100644 index 0000000..dd80c22 Binary files /dev/null and b/textures/illuminati_relic_9.png differ