Compare commits
5 Commits
8673e2a550
...
df7faaf823
Author | SHA1 | Date |
---|---|---|
NathanSalapat | df7faaf823 | |
NathanSalapat | 37933b4bbd | |
NathanSalapat | a6dacd964c | |
NathanSalapat | 8556b6e681 | |
NathanSalapat | 49e2c3eee0 |
|
@ -0,0 +1,43 @@
|
|||
illuminati_gift_table1 = { --Common items
|
||||
'default:cobble',
|
||||
'default:obsidian',
|
||||
'default:mese_crystal_fragment',
|
||||
}
|
||||
|
||||
illuminati_gift_table2 = { --Rare items
|
||||
'default:mese',
|
||||
'default:diamondblock',
|
||||
'default:goldblock',
|
||||
}
|
||||
|
||||
illuminati_gift_table3 = { --Super rare items
|
||||
'illuminati:core_off',
|
||||
'illuminati:cone_off',
|
||||
}
|
||||
|
||||
function give_gift(pos, table)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local max = #(table)
|
||||
local gift_num = math.random(1,max)
|
||||
local gift = table[gift_num]
|
||||
inv:set_stack('dst', 1, gift)
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {'illuminati:core_on'},
|
||||
interval = 60,
|
||||
chance = 5,
|
||||
action = function(pos)
|
||||
local gift_type = math.random(1,10)
|
||||
if gift_type <= 1 then --Super rare item
|
||||
give_gift(pos, illuminati_gift_table3)
|
||||
end
|
||||
if gift_type >= 2 and gift_type <= 8 then --Comon item
|
||||
give_gift(pos, illuminati_gift_table1)
|
||||
end
|
||||
if gift_type > 8 then --Rare item
|
||||
give_gift(pos, illuminati_gift_table2)
|
||||
end
|
||||
end
|
||||
})
|
64
chats.lua
|
@ -1,31 +1,51 @@
|
|||
local illuminati_death_message_table = {
|
||||
illuminati.death_message_table = {
|
||||
'<Distant voice> We control your life too.',
|
||||
'<Hissing voice> Assemble the brotherhood, we have fresh flesh.',
|
||||
'<Whisper> The Illuminati claimed another life',
|
||||
'<Faint voices in the breeze> That was an easy one.',
|
||||
"<GrimpReaper> Fret not, I see you. I'm waching.",
|
||||
}
|
||||
|
||||
illuminati.core_message_table = {
|
||||
'<Reptillian> Ah, a new convert.',
|
||||
'<Father> Every day we grow in numbers.',
|
||||
'<Saint> Has a mortal discovered our secret? Death to him!',
|
||||
'<Block_breaker> Blocks are but temporal, we are forever.',
|
||||
}
|
||||
|
||||
minetest.register_on_chat_message(function(name,message)
|
||||
if string.match(message, 'foobar') then
|
||||
minetest.chat_send_all('<Illuminati> Hush, this is not public information.')
|
||||
end
|
||||
end)
|
||||
illuminati.triangle_message_table = {
|
||||
"<Joe> this isn't good.",
|
||||
'<square_man_max> oh, are squares not good enough?',
|
||||
'<Joe> Three sides, three branches.',
|
||||
'<Joe> Three sides, three nails.', --Really not sure on this one...
|
||||
'<Joe> Heart, Brain, Body.',
|
||||
'<Joe> 3 corners 180 degrees.',
|
||||
}
|
||||
|
||||
minetest.register_on_chat_message(function(name,message)
|
||||
if string.match(message, '%p%p%p%p%p%p%p%p') then
|
||||
minetest.chat_send_player(name, '<Illuminati> Do you have a broken keyboard?')
|
||||
end
|
||||
end)
|
||||
|
||||
--[[minetest.register_on_dieplayer(function(player)
|
||||
local key = #(minetest.get_connected_players())
|
||||
print ('number of people playing '..key)
|
||||
local person = math.random(1, key)
|
||||
for person,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
minetest.chat_send_player(name, "Hello you fool, " .. name)
|
||||
function send_message(table)
|
||||
local max = #(table)
|
||||
local key = math.random(1,max)
|
||||
local message = table[key]
|
||||
return message
|
||||
end
|
||||
-- print (person_to_spook..' has been selected to get a cheery message.')
|
||||
-- minetest.chat_send_player(person_to_spook, '<Illuminati> Somebody died.')
|
||||
|
||||
function select_player(player, table)
|
||||
local key = #(minetest.get_connected_players())
|
||||
local people = minetest.get_connected_players()
|
||||
local person = math.random(1, key)
|
||||
local name1 = people[person]
|
||||
local name = player:get_player_name()
|
||||
if name1 ~= player then
|
||||
minetest.chat_send_player(name, send_message(table))
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
select_player(player, illuminati.death_message_table)
|
||||
end)
|
||||
|
||||
minetest.register_on_chat_message(function(name,message)
|
||||
if string.match(message, 'triangle') then
|
||||
minetest.chat_send_player(name, send_message(illuminati.triangle_message_table))
|
||||
end
|
||||
end)
|
||||
--]]
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
default
|
||||
dye
|
4
init.lua
|
@ -1,2 +1,6 @@
|
|||
illuminati = {}
|
||||
|
||||
dofile(minetest.get_modpath('illuminati')..'/chats.lua')
|
||||
dofile(minetest.get_modpath('illuminati')..'/nodes.lua')
|
||||
dofile(minetest.get_modpath('illuminati')..'/relics.lua')
|
||||
dofile(minetest.get_modpath('illuminati')..'/abms.lua')
|
||||
|
|
137
nodes.lua
|
@ -1,3 +1,23 @@
|
|||
-- Craft Recipes
|
||||
minetest.register_craft({
|
||||
output = 'illuminati:core_off',
|
||||
recipe = {
|
||||
{'dye:red', 'default:mese_crystal', 'dye:red'},
|
||||
{'dye:red', 'default:diamond', 'dye:red'},
|
||||
{'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'illuminati:cone_off',
|
||||
recipe = {
|
||||
{'', 'default:mese_crystal_fragment', ''},
|
||||
{'default:mese_crystal_fragment', 'default:gold_ingot', 'default:mese_crystal_fragment'},
|
||||
{'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
-- Node Registration
|
||||
minetest.register_node('illuminati:core_off',{
|
||||
description = 'The source of power',
|
||||
drawtype = 'mesh',
|
||||
|
@ -16,35 +36,41 @@ 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'})
|
||||
minetest.set_node(pn1,{name = 'illuminati:cone_on'})
|
||||
minetest.set_node(pe1,{name = 'illuminati:cone_on'})
|
||||
minetest.set_node(p1,{name = 'illuminati:diamondblock'})
|
||||
minetest.set_node(p2,{name = 'illuminati:diamondblock'})
|
||||
minetest.set_node(ps2,{name = 'illuminati:goldblock'})
|
||||
minetest.set_node(pw2,{name = 'illuminati:goldblock'})
|
||||
minetest.set_node(pn2,{name = 'illuminati:goldblock'})
|
||||
minetest.set_node(pe2,{name = 'illuminati:goldblock'})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -78,19 +104,45 @@ minetest.register_node('illuminati:core_on',{
|
|||
fixed = {-.4, -.5, -.4, .4, .5, .4},
|
||||
},
|
||||
on_construct = function(pos)
|
||||
print 'seeing if this calls when the node is placed.'
|
||||
-- I'll eventually make something happen more than changing the nodes.
|
||||
-- Maybe the crystals with generate some items or do something.
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size('main', 8*4)
|
||||
inv:set_size('dst', 1)
|
||||
meta:set_string('formspec',
|
||||
'size[8,6]'..
|
||||
'label[2.65,0;#_#~~ ^ |-| ^ ~~#_#]'..
|
||||
'list[current_name;dst;3.5,1;1,1;]'..
|
||||
'list[current_player;main;0,2.25;8,4;]'..
|
||||
'listring[]')
|
||||
end,
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local damage_chance = math.random(1,2)
|
||||
if damage_chance == 1 then
|
||||
local hp = player:get_hp()
|
||||
player:set_hp(hp - 1)
|
||||
end
|
||||
end,
|
||||
after_dig_node = function(pos)
|
||||
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}
|
||||
minetest.set_node(ps1,{name = 'illuminati:cone_off'})
|
||||
minetest.set_node(pw1,{name = 'illuminati:cone_off'})
|
||||
minetest.set_node(pn1,{name = 'illuminati:cone_off'})
|
||||
minetest.set_node(pe1,{name = 'illuminati:cone_off'})
|
||||
local d1 = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
local d2 = {x=pos.x, y=pos.y-2, z=pos.z}
|
||||
local cs1 = {x=pos.x-3, y=pos.y-1, z=pos.z}
|
||||
local cw1 = {x=pos.x+3, y=pos.y-1, z=pos.z}
|
||||
local cn1 = {x=pos.x, y=pos.y-1, z=pos.z-3}
|
||||
local ce1 = {x=pos.x, y=pos.y-1, z=pos.z+3}
|
||||
local gs2 = {x=pos.x-3, y=pos.y-2, z=pos.z}
|
||||
local gw2 = {x=pos.x+3, y=pos.y-2, z=pos.z}
|
||||
local gn2 = {x=pos.x, y=pos.y-2, z=pos.z-3}
|
||||
local ge2 = {x=pos.x, y=pos.y-2, z=pos.z+3}
|
||||
minetest.set_node(d1,{name = 'default:diamondblock'})
|
||||
minetest.set_node(d2,{name = 'default:diamondblock'})
|
||||
minetest.set_node(cs1,{name = 'illuminati:cone_off'})
|
||||
minetest.set_node(cw1,{name = 'illuminati:cone_off'})
|
||||
minetest.set_node(cn1,{name = 'illuminati:cone_off'})
|
||||
minetest.set_node(ce1,{name = 'illuminati:cone_off'})
|
||||
minetest.set_node(gs2,{name = 'default:goldblock'})
|
||||
minetest.set_node(gw2,{name = 'default:goldblock'})
|
||||
minetest.set_node(gn2,{name = 'default:goldblock'})
|
||||
minetest.set_node(ge2,{name = 'default:goldblock'})
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -110,6 +162,9 @@ minetest.register_node('illuminati:cone_off',{
|
|||
type = 'fixed',
|
||||
fixed = {-.5, -.5, -.5, .5, .35, .5},
|
||||
},
|
||||
after_place_node = function(pos, placer)
|
||||
select_player(placer, illuminati.core_message_table)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node('illuminati:cone_on',{
|
||||
|
@ -130,3 +185,15 @@ minetest.register_node('illuminati:cone_on',{
|
|||
fixed = {-.5, -.5, -.5, .5, .35, .5},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("illuminati:goldblock", {
|
||||
description = "hu?",
|
||||
tiles = {"default_gold_block.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
minetest.register_node("illuminati:diamondblock", {
|
||||
description = "Not sure how you got this.",
|
||||
tiles = {"default_diamond_block.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
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
|
||||
|
||||
-- Register nodes
|
||||
minetest.register_node("illuminati:stone", {
|
||||
description = "Stone",
|
||||
tiles = {"default_stone.png"},
|
||||
groups = {cracky=3, stone=1},
|
||||
drop = {
|
||||
max_items = 2,
|
||||
items = {
|
||||
{
|
||||
items = {'illuminati:relic_1'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_2'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_3'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_4'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_5'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_6'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_7'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_8'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'illuminati:relic_9'},
|
||||
rarity = 15,
|
||||
},
|
||||
{
|
||||
items = {'default:cobble'},
|
||||
},
|
||||
},
|
||||
},
|
||||
legacy_mineral = true,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
-- Register ore
|
||||
minetest.register_ore({
|
||||
ore_type = 'scatter',
|
||||
ore = 'illuminati:stone',
|
||||
wherein = 'default:stone',
|
||||
clust_scarcity = 8*8*8,
|
||||
clust_size = 1,
|
||||
height_min = -31000,
|
||||
hieght_max = 128,
|
||||
})
|
After Width: | Height: | Size: 692 B |
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 816 B |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 710 B |
After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 767 B |
After Width: | Height: | Size: 772 B |