added numbers

master
Nathan Salapat 2020-09-07 09:15:19 -05:00
parent 61ec69cbf9
commit 887457c150
16 changed files with 84 additions and 6 deletions

View File

@ -2,8 +2,8 @@ minetest.register_abm({
label = 'Firevine Growth/Spread',
nodenames = {'caverealms:fire_vine'},
neighbors = {'group:stone'},
interval = 53,
chance = 25,
interval = 104,
chance = 40,
action = function(pos)
local node_below = ({x=pos.x, y=pos.y-1, z=pos.z})
local below_name = minetest.get_node(node_below).name

View File

@ -27,6 +27,19 @@ letters = {
{'Z', 'z'}
}
numbers = {
{'0', '0'},
{'1', '1'},
{'2', '2'},
{'3', '3'},
{'4', '4'},
{'5', '5'},
{'6', '6'},
{'7', '7'},
{'8', '8'},
{'9', '9'}
}
for i in ipairs(letters) do
local desc = letters[i][1]
local name = letters[i][2]
@ -67,6 +80,46 @@ for i in ipairs(letters) do
})
end
for i in ipairs(numbers) do
local desc = numbers[i][1]
local name = numbers[i][2]
minetest.register_node('letters:'..name, {
description = 'Number '..desc,
drawtype = 'signlike',
tiles = {'letters_'..name..'.png'},
inventory_image = 'letters_'..name..'.png',
wield_image = 'letters_'..name..'.png',
paramtype = 'light',
paramtype2 = 'colorwallmounted',
palette = 'letters_color_palette.png',
sunlight_propagates = true,
selection_box = {
type = 'fixed',
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
collision_box = {
type = 'fixed',
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
groups = {dig_immediate = 2, attached_node = 1},
on_rightclick = function(pos, node, clicker)
local player_name = clicker:get_player_name()
if minetest.is_protected(pos, player_name) and not minetest.check_player_privs(clicker, 'protection_bypass') then
return
end
minetest.swap_node(pos, {name = node.name, param2 = node.param2+8})
end,
on_punch = function(pos, node, puncher, pointed_thing)
local player_name = puncher:get_player_name()
if minetest.is_protected(pos, player_name) and not minetest.check_player_privs(puncher, 'protection_bypass') then
return
end
minetest.swap_node(pos, {name = node.name, param2 = node.param2-8})
end
})
end
letters_shop =
'size[9,9.5]'..
'image_button[0,0;1,1;letters_a.png;a;]'..
@ -95,6 +148,16 @@ letters_shop =
'image_button[5,2;1,1;letters_x.png;x;]'..
'image_button[6,2;1,1;letters_y.png;y;]'..
'image_button[7,2;1,1;letters_z.png;z;]'..
'image_button[8,2;1,1;letters_0.png;0;]'..
'image_button[0,3;1,1;letters_1.png;1;]'..
'image_button[1,3;1,1;letters_2.png;2;]'..
'image_button[2,3;1,1;letters_3.png;3;]'..
'image_button[3,3;1,1;letters_4.png;4;]'..
'image_button[4,3;1,1;letters_5.png;5;]'..
'image_button[5,3;1,1;letters_6.png;6;]'..
'image_button[6,3;1,1;letters_7.png;7;]'..
'image_button[7,3;1,1;letters_8.png;8;]'..
'image_button[8,3;1,1;letters_9.png;9;]'..
'list[current_name;input;0,4;1,1;]'..
'label[1,4.25;One coin per letter. Click the letters you want, they\'ll be added to inventory.]'..
'list[current_player;main;.5,5.5;8,4;]'
@ -103,7 +166,7 @@ minetest.register_node('letters:station', {
description = 'Sign Shop',
--drawtype = 'mesh',
--mesh = 'letters_station.obj',
tiles = {'letters_station.png'},
tiles = {'letters_station_top.png', 'letters_station.png'},
paramtype = 'light',
paramtype2 = 'facedir',
selection_box = {
@ -145,7 +208,7 @@ minetest.register_node('letters:station', {
local coins = inv:get_stack('input', 1)
local coin_count = coins:get_count()
if coin_count >= 1 then
for i=0, 25 do
for i=0, 26 do
local letter = string.char(i + 96)
if fields [letter] then
local player_inv = sender:get_inventory()
@ -156,6 +219,17 @@ minetest.register_node('letters:station', {
end
end
end
for i=0, 9 do
local letter = tostring(i)
if fields [letter] then
local player_inv = sender:get_inventory()
if player_inv:room_for_item('main', 'letters:'..letter) then
player_inv:add_item('main', 'letters:'..letter)
coins:take_item()
inv:set_stack('input',1,coins)
end
end
end
end
end,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -14,7 +14,7 @@ minetest.register_chatcommand('interact', {
params = 'keyword',
privs = {home=true},
func = function(name, params)
if params == 'yellowsnow' then
if params == 'strawhat' then
local privs = minetest.get_player_privs(name)
privs.interact = true
minetest.set_player_privs(name, privs)
@ -51,6 +51,7 @@ minetest.register_on_joinplayer(function(player)
local player_name = player:get_player_name()
minetest.chat_send_player(player_name, 'Read the rules for information on how to get interact. Para español visite https://www.nathansalapat.com/server/epic-server_es')
minetest.show_formspec(player_name, 'rules', spawn_rules_formspec)
sounds.random_player()
--[[
else
local player_name = player:get_player_name()

View File

@ -1,2 +1,2 @@
name = spawn
depends = default
depends = default, sounds

View File

@ -1,4 +1,7 @@
local news = {
'9/6/20',
'Added numbers to the letter machine.',
'',
'9/5/20',
'Added some abmbient sounds for different biomes.',
'',