fix namespace conflict
@ -1,18 +0,0 @@
|
|||||||
gems = {}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_privilege("gems_admin", "Set up Gems arenas")
|
|
||||||
|
|
||||||
|
|
||||||
dofile(minetest.get_modpath("gems") .. "/api.lua")
|
|
||||||
|
|
||||||
dofile(minetest.get_modpath("gems") .. "/nodes.lua")
|
|
||||||
dofile(minetest.get_modpath("gems") .. "/shop.lua")
|
|
||||||
dofile(minetest.get_modpath("gems") .. "/armor.lua")
|
|
||||||
dofile(minetest.get_modpath("gems") .. "/items.lua")
|
|
||||||
dofile(minetest.get_modpath("gems") .. "/map.lua")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -14,9 +14,9 @@
|
|||||||
|
|
||||||
arena_lib.on_load('gems_2', function(arena)
|
arena_lib.on_load('gems_2', function(arena)
|
||||||
|
|
||||||
gems.place_arena(arena)
|
gems_api.place_arena(arena)
|
||||||
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
gems.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
gems_api.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -30,11 +30,11 @@ end)
|
|||||||
arena_lib.on_start('gems_2', function(arena)
|
arena_lib.on_start('gems_2', function(arena)
|
||||||
|
|
||||||
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
gems.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
gems_api.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
for pl_name,stats in pairs(arena.players) do
|
for pl_name,stats in pairs(arena.players) do
|
||||||
local player = minetest.get_player_by_name(pl_name)
|
local player = minetest.get_player_by_name(pl_name)
|
||||||
if player then
|
if player then
|
||||||
gems.clear_inv(player)
|
gems_api.clear_inv(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ end)
|
|||||||
|
|
||||||
arena_lib.on_death('gems_2', function(arena, p_name, reason)
|
arena_lib.on_death('gems_2', function(arena, p_name, reason)
|
||||||
|
|
||||||
gems.on_death( arena , p_name , reason )
|
gems_api.on_death( arena , p_name , reason )
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -63,10 +63,10 @@ end)
|
|||||||
|
|
||||||
|
|
||||||
arena_lib.on_time_tick('gems_2', function(arena)
|
arena_lib.on_time_tick('gems_2', function(arena)
|
||||||
-- gems.on_time_tick(arena)
|
-- gems_api.on_time_tick(arena)
|
||||||
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
local teams = {"ruby", "emerald"}
|
local teams = {"ruby", "emerald"}
|
||||||
gems.on_time_tick(arena,teams)
|
gems_api.on_time_tick(arena,teams)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -78,5 +78,5 @@ end)
|
|||||||
|
|
||||||
|
|
||||||
arena_lib.on_end('gems_2',function(arena, players, winner_name, spectators, is_forced)
|
arena_lib.on_end('gems_2',function(arena, players, winner_name, spectators, is_forced)
|
||||||
gems.on_end(arena, players, winner_name, spectators, is_forced)
|
gems_api.on_end(arena, players, winner_name, spectators, is_forced)
|
||||||
end)
|
end)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
if not minetest.get_modpath("lib_chatcmdbuilder") then
|
if not minetest.get_modpath("lib_chatcmdbuilder") then
|
||||||
dofile(minetest.get_modpath("gems") .. "/chatcmdbuilder.lua")
|
dofile(minetest.get_modpath("gems_api") .. "/chatcmdbuilder.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
arena_lib.register_minigame("gems_2", {
|
arena_lib.register_minigame("gems_2", {
|
||||||
|
@ -7,7 +7,7 @@ thx to elceejo for bugfixes and code snippets
|
|||||||
Code MIT (C) MisterE <MisterE@ircnow.org>, debiankaios
|
Code MIT (C) MisterE <MisterE@ircnow.org>, debiankaios
|
||||||
|
|
||||||
|
|
||||||
shops formspecs modified by MisterE from mesewars (gems.shop in api.lua), Copyright (c) 2019-date, Lejo <Lejo_1@web.de>, MIT
|
shops formspecs modified by MisterE from mesewars (gems_api.shop in api.lua), Copyright (c) 2019-date, Lejo <Lejo_1@web.de>, MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name = gems_2
|
name = gems_2
|
||||||
description = a minigame similar to eggwars
|
description = a minigame similar to eggwars
|
||||||
depends = gems, arena_lib, worldedit, 3d_armor
|
depends = gems_api, arena_lib, worldedit, 3d_armor
|
||||||
depends_optional = server_manager
|
depends_optional = server_manager
|
@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
arena_lib.on_load('gems_4', function(arena)
|
arena_lib.on_load('gems_4', function(arena)
|
||||||
|
|
||||||
gems.place_arena(arena)
|
gems_api.place_arena(arena)
|
||||||
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
gems.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
gems_api.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -32,11 +32,11 @@ end)
|
|||||||
arena_lib.on_start('gems_4', function(arena)
|
arena_lib.on_start('gems_4', function(arena)
|
||||||
|
|
||||||
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
gems.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
gems_api.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
for pl_name,stats in pairs(arena.players) do
|
for pl_name,stats in pairs(arena.players) do
|
||||||
local player = minetest.get_player_by_name(pl_name)
|
local player = minetest.get_player_by_name(pl_name)
|
||||||
if player then
|
if player then
|
||||||
gems.clear_inv(player)
|
gems_api.clear_inv(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ end)
|
|||||||
|
|
||||||
arena_lib.on_death('gems_4', function(arena, p_name, reason)
|
arena_lib.on_death('gems_4', function(arena, p_name, reason)
|
||||||
|
|
||||||
gems.on_death( arena , p_name , reason )
|
gems_api.on_death( arena , p_name , reason )
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ arena_lib.on_time_tick('gems_4', function(arena)
|
|||||||
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
worldedit.keep_loaded(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
local teams = {"ruby","sapphire","emerald", "opal"}
|
local teams = {"ruby","sapphire","emerald", "opal"}
|
||||||
|
|
||||||
gems.on_time_tick(arena,teams)
|
gems_api.on_time_tick(arena,teams)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
@ -82,6 +82,6 @@ end)
|
|||||||
|
|
||||||
|
|
||||||
arena_lib.on_end('gems_4',function(arena, players, winner_name, spectators, is_forced)
|
arena_lib.on_end('gems_4',function(arena, players, winner_name, spectators, is_forced)
|
||||||
gems.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
gems_api.clearobjects(arena.area_to_clear_pos_1, arena.area_to_clear_pos_2)
|
||||||
gems.on_end(arena, players, winner_name, spectators, is_forced)
|
gems_api.on_end(arena, players, winner_name, spectators, is_forced)
|
||||||
end)
|
end)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
if not minetest.get_modpath("lib_chatcmdbuilder") then
|
if not minetest.get_modpath("lib_chatcmdbuilder") then
|
||||||
dofile(minetest.get_modpath("gems") .. "/chatcmdbuilder.lua")
|
dofile(minetest.get_modpath("gems_api") .. "/chatcmdbuilder.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ thx to elceejo for bugfixes and code snippets
|
|||||||
Code MIT (C) MisterE <MisterE@ircnow.org>, debiankaios
|
Code MIT (C) MisterE <MisterE@ircnow.org>, debiankaios
|
||||||
|
|
||||||
|
|
||||||
shops formspecs modified by MisterE from mesewars (gems.shop in api.lua), Copyright (c) 2019-date, Lejo <Lejo_1@web.de>, MIT
|
shops formspecs modified by MisterE from mesewars (gems_api.shop in api.lua), Copyright (c) 2019-date, Lejo <Lejo_1@web.de>, MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name = gems_4
|
name = gems_4
|
||||||
description = a minigame similar to eggwars
|
description = a minigame similar to eggwars
|
||||||
depends = gems, arena_lib, worldedit, 3d_armor
|
depends = gems_api, arena_lib, worldedit, 3d_armor
|
||||||
depends_optional = server_manager
|
depends_optional = server_manager
|
@ -2,7 +2,7 @@
|
|||||||
--=========== GET OPPOSITE TEAM ===============
|
--=========== GET OPPOSITE TEAM ===============
|
||||||
-- returns the name of the team directly opposite the input team name or nil
|
-- returns the name of the team directly opposite the input team name or nil
|
||||||
|
|
||||||
gems.get_opposite_team = function(team_name)
|
gems_api.get_opposite_team = function(team_name)
|
||||||
if team_name then
|
if team_name then
|
||||||
if team_name == "ruby" then
|
if team_name == "ruby" then
|
||||||
return "emerald"
|
return "emerald"
|
||||||
@ -24,7 +24,7 @@ end
|
|||||||
--sells the player an item for an item (from mesewars)
|
--sells the player an item for an item (from mesewars)
|
||||||
|
|
||||||
|
|
||||||
function gems.shop(player, input, output)
|
function gems_api.shop(player, input, output)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
if not inv:contains_item("main", input) then
|
if not inv:contains_item("main", input) then
|
||||||
@ -40,47 +40,47 @@ end
|
|||||||
--=========== Clear Objects ===============
|
--=========== Clear Objects ===============
|
||||||
--clears objects (items) in the area pos1 to pos2
|
--clears objects (items) in the area pos1 to pos2
|
||||||
|
|
||||||
gems.clearobjects = function(pos1,pos2)
|
gems_api.clearobjects = function(pos1,pos2)
|
||||||
npos1, npos2 = worldedit.sort_pos(pos1, pos2)
|
npos1, npos2 = worldedit.sort_pos(pos1, pos2)
|
||||||
minetest.after(1,function(npos1,npos2)
|
minetest.after(1,function(npos1,npos2)
|
||||||
worldedit.clear_objects(npos1, npos2)
|
worldedit.clear_objects(npos1, npos2)
|
||||||
end,npos1,npos2)
|
end,npos1,npos2)
|
||||||
end
|
end
|
||||||
|
|
||||||
function gems.place_node_async(arena_name)
|
function gems_api.place_node_async(arena_name)
|
||||||
if gems.arena_nodes[arena_name] and #gems.arena_nodes[arena_name] > 0 then
|
if gems_api.arena_nodes[arena_name] and #gems_api.arena_nodes[arena_name] > 0 then
|
||||||
-- minetest.debug("length of nodeslist:"..#gems.arena_nodes[arena_name])
|
-- minetest.debug("length of nodeslist:"..#gems_api.arena_nodes[arena_name])
|
||||||
local steps = #gems.arena_nodes[arena_name]
|
local steps = #gems_api.arena_nodes[arena_name]
|
||||||
if steps > 10 then
|
if steps > 10 then
|
||||||
steps = 10
|
steps = 10
|
||||||
end
|
end
|
||||||
for i=1,steps do
|
for i=1,steps do
|
||||||
local data = table.remove(gems.arena_nodes[arena_name])
|
local data = table.remove(gems_api.arena_nodes[arena_name])
|
||||||
minetest.set_node(data.pos,data.node)
|
minetest.set_node(data.pos,data.node)
|
||||||
end
|
end
|
||||||
minetest.after(0,function(arena_name)
|
minetest.after(0,function(arena_name)
|
||||||
gems.place_node_async(arena_name)
|
gems_api.place_node_async(arena_name)
|
||||||
end,arena_name)
|
end,arena_name)
|
||||||
else
|
else
|
||||||
gems.arena_nodes[arena_name] = {}
|
gems_api.arena_nodes[arena_name] = {}
|
||||||
gems.save_nodes(arena_name)
|
gems_api.save_nodes(arena_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--=========== Place_arena ===============
|
--=========== Place_arena ===============
|
||||||
--repairs the arena to its original state
|
--repairs the arena to its original state
|
||||||
|
|
||||||
gems.place_arena = function(arena)
|
gems_api.place_arena = function(arena)
|
||||||
local arena_name = arena.name
|
local arena_name = arena.name
|
||||||
minetest.load_area(arena.area_to_clear_pos_1,arena.area_to_clear_pos_2)
|
minetest.load_area(arena.area_to_clear_pos_1,arena.area_to_clear_pos_2)
|
||||||
minetest.after(1,function(arena_name)
|
minetest.after(1,function(arena_name)
|
||||||
gems.place_node_async(arena_name)
|
gems_api.place_node_async(arena_name)
|
||||||
end,arena_name)
|
end,arena_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
--=========== get_protector groups ===============
|
--=========== get_protector groups ===============
|
||||||
--returns the groups for protector nodes
|
--returns the groups for protector nodes
|
||||||
gems.get_protector_groups = function(gem_name)
|
gems_api.get_protector_groups = function(gem_name)
|
||||||
local gem_names = {
|
local gem_names = {
|
||||||
"ruby", -- red
|
"ruby", -- red
|
||||||
"sapphire", --blue
|
"sapphire", --blue
|
||||||
@ -116,7 +116,7 @@ end
|
|||||||
|
|
||||||
--=========== clear_inv ===============
|
--=========== clear_inv ===============
|
||||||
--clears a player's inventory, including armor. Pass a player objref
|
--clears a player's inventory, including armor. Pass a player objref
|
||||||
gems.clear_inv = function(player)
|
gems_api.clear_inv = function(player)
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
local list = inv:get_list("main")
|
local list = inv:get_list("main")
|
||||||
for k, v in pairs(list) do
|
for k, v in pairs(list) do
|
||||||
@ -132,7 +132,7 @@ end
|
|||||||
--what happens when a player dies in the arena
|
--what happens when a player dies in the arena
|
||||||
--if their team's gem exists, then they respawn. If not, then they are eliminated
|
--if their team's gem exists, then they respawn. If not, then they are eliminated
|
||||||
|
|
||||||
gems.on_death = function( arena , p_name , reason )
|
gems_api.on_death = function( arena , p_name , reason )
|
||||||
|
|
||||||
local p_team_id = arena.players[p_name].teamID
|
local p_team_id = arena.players[p_name].teamID
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ end
|
|||||||
|
|
||||||
--++++++++++++++++++get_id_by_name()
|
--++++++++++++++++++get_id_by_name()
|
||||||
|
|
||||||
gems.get_team_id_by_name = function(arena , name)
|
gems_api.get_team_id_by_name = function(arena , name)
|
||||||
|
|
||||||
for id, stats in pairs( arena.teams ) do
|
for id, stats in pairs( arena.teams ) do
|
||||||
if stats.name == name then
|
if stats.name == name then
|
||||||
@ -252,10 +252,10 @@ function minetest.is_protected(pos, name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--gems.show_hud_team_location( arena, show_to_team_id , show_loc_of_team_id )
|
--gems_api.show_hud_team_location( arena, show_to_team_id , show_loc_of_team_id )
|
||||||
|
|
||||||
|
|
||||||
gems.show_hud_team_location = function( arena, show_to_team_id , show_loc_of_team_id , show_of_color)
|
gems_api.show_hud_team_location = function( arena, show_to_team_id , show_loc_of_team_id , show_of_color)
|
||||||
|
|
||||||
|
|
||||||
local show_to_team_players = arena_lib.get_players_in_team(arena, show_to_team_id)
|
local show_to_team_players = arena_lib.get_players_in_team(arena, show_to_team_id)
|
||||||
@ -294,7 +294,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function gems.on_time_tick(arena,teams)
|
function gems_api.on_time_tick(arena,teams)
|
||||||
|
|
||||||
if arena and arena.current_time and arena.current_time > 3 then
|
if arena and arena.current_time and arena.current_time > 3 then
|
||||||
|
|
||||||
@ -314,31 +314,31 @@ function gems.on_time_tick(arena,teams)
|
|||||||
-- local weared_armor_elems = armor:get_weared_armor_elements(player)
|
-- local weared_armor_elems = armor:get_weared_armor_elements(player)
|
||||||
-- local item_shield = weared_armor_elems["shield"]
|
-- local item_shield = weared_armor_elems["shield"]
|
||||||
|
|
||||||
-- local ruby_protectors = minetest.find_node_near(pos, 4, {"gems:protector_ruby"}, true)
|
-- local ruby_protectors = minetest.find_node_near(pos, 4, {"gems_api:protector_ruby"}, true)
|
||||||
-- local emerald_protectors = minetest.find_node_near(pos, 4, {"gems:protector_emerald"}, true)
|
-- local emerald_protectors = minetest.find_node_near(pos, 4, {"gems_api:protector_emerald"}, true)
|
||||||
-- local opal_protectors = minetest.find_node_near(pos, 4, {"gems:protector_opal"}, true)
|
-- local opal_protectors = minetest.find_node_near(pos, 4, {"gems_api:protector_opal"}, true)
|
||||||
-- local sapphire_protectors = minetest.find_node_near(pos, 4, {"gems:protector_sapphire"}, true)
|
-- local sapphire_protectors = minetest.find_node_near(pos, 4, {"gems_api:protector_sapphire"}, true)
|
||||||
|
|
||||||
|
|
||||||
-- if ruby_protectors and not team_name == "ruby" and item_shield ~= "gems:shield_ruby" then
|
-- if ruby_protectors and not team_name == "ruby" and item_shield ~= "gems_api:shield_ruby" then
|
||||||
-- minetest.chat_send_all("4")
|
-- minetest.chat_send_all("4")
|
||||||
|
|
||||||
-- damage = damage + 1
|
-- damage = damage + 1
|
||||||
|
|
||||||
-- end
|
-- end
|
||||||
-- if emerald_protectors and not team_name == "emerald" and item_shield ~= "gems:shield_emerald" then
|
-- if emerald_protectors and not team_name == "emerald" and item_shield ~= "gems_api:shield_emerald" then
|
||||||
-- minetest.chat_send_all("4")
|
-- minetest.chat_send_all("4")
|
||||||
|
|
||||||
-- damage = damage + 1
|
-- damage = damage + 1
|
||||||
|
|
||||||
-- end
|
-- end
|
||||||
-- if opal_protectors and not team_name == "opal" and item_shield ~= "gems:shield_opal" then
|
-- if opal_protectors and not team_name == "opal" and item_shield ~= "gems_api:shield_opal" then
|
||||||
-- minetest.chat_send_all("4")
|
-- minetest.chat_send_all("4")
|
||||||
|
|
||||||
-- damage = damage + 1
|
-- damage = damage + 1
|
||||||
|
|
||||||
-- end
|
-- end
|
||||||
-- if sapphire_protectors and not team_name == "sapphire" and item_shield ~= "gems:shield_sapphire" then
|
-- if sapphire_protectors and not team_name == "sapphire" and item_shield ~= "gems_api:shield_sapphire" then
|
||||||
-- minetest.chat_send_all("4")
|
-- minetest.chat_send_all("4")
|
||||||
|
|
||||||
-- damage = damage + 1
|
-- damage = damage + 1
|
||||||
@ -359,7 +359,7 @@ function gems.on_time_tick(arena,teams)
|
|||||||
|
|
||||||
for _, team_name in ipairs (teams) do
|
for _, team_name in ipairs (teams) do
|
||||||
|
|
||||||
local team_id = gems.get_team_id_by_name( arena , team_name )
|
local team_id = gems_api.get_team_id_by_name( arena , team_name )
|
||||||
|
|
||||||
local node_at_gem = minetest.get_node( arena[ team_name.."_gem"] ).name
|
local node_at_gem = minetest.get_node( arena[ team_name.."_gem"] ).name
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ function gems.on_time_tick(arena,teams)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if node_at_gem ~= "gems:great_gem_" .. team_name and arena.teams[team_id].gem_exists then
|
if node_at_gem ~= "gems_api:great_gem_" .. team_name and arena.teams[team_id].gem_exists then
|
||||||
--The great gem is missing! Now the players shall die.
|
--The great gem is missing! Now the players shall die.
|
||||||
|
|
||||||
-- send msg and switch off gem_exists
|
-- send msg and switch off gem_exists
|
||||||
@ -386,7 +386,7 @@ end
|
|||||||
|
|
||||||
-- clear players' armor at the end of the game TODO: implement armor saving and re-adding
|
-- clear players' armor at the end of the game TODO: implement armor saving and re-adding
|
||||||
|
|
||||||
gems.on_end = function(arena, players, winner_name, spectators, is_forced)
|
gems_api.on_end = function(arena, players, winner_name, spectators, is_forced)
|
||||||
for pl_name ,stats in pairs(players) do
|
for pl_name ,stats in pairs(players) do
|
||||||
local player = minetest.get_player_by_name(pl_name)
|
local player = minetest.get_player_by_name(pl_name)
|
||||||
if player then
|
if player then
|
@ -17,7 +17,7 @@ if minetest.get_modpath("3d_armor") then
|
|||||||
for _ , gem_name in pairs(gem_names) do
|
for _ , gem_name in pairs(gem_names) do
|
||||||
|
|
||||||
local gem_name_cap = gem_names_caps[_]
|
local gem_name_cap = gem_names_caps[_]
|
||||||
armor:register_armor("gems:shield_"..gem_name, {
|
armor:register_armor("gems_api:shield_"..gem_name, {
|
||||||
description = gem_name_cap .. " Shield",
|
description = gem_name_cap .. " Shield",
|
||||||
inventory_image = "gems_inv_shield_"..gem_name..".png",
|
inventory_image = "gems_inv_shield_"..gem_name..".png",
|
||||||
groups = {armor_shield=1, armor_heal=7, armor_use=200,not_in_creative_inventory = 1},
|
groups = {armor_shield=1, armor_heal=7, armor_use=200,not_in_creative_inventory = 1},
|
18
gems_api/init.lua
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
gems_api = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_privilege("gems_admin", "Set up Gems arenas")
|
||||||
|
|
||||||
|
|
||||||
|
dofile(minetest.get_modpath("gems_api") .. "/api.lua")
|
||||||
|
|
||||||
|
dofile(minetest.get_modpath("gems_api") .. "/nodes.lua")
|
||||||
|
dofile(minetest.get_modpath("gems_api") .. "/shop.lua")
|
||||||
|
dofile(minetest.get_modpath("gems_api") .. "/armor.lua")
|
||||||
|
dofile(minetest.get_modpath("gems_api") .. "/items.lua")
|
||||||
|
dofile(minetest.get_modpath("gems_api") .. "/map.lua")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ for _, gem_name in pairs(gem_names) do
|
|||||||
if gem_name == "opal" then color = "#f4b41b" end
|
if gem_name == "opal" then color = "#f4b41b" end
|
||||||
if gem_name == "sapphire" then color = "#28ccdf" end
|
if gem_name == "sapphire" then color = "#28ccdf" end
|
||||||
|
|
||||||
minetest.register_craftitem("gems:".. gem_name , {
|
minetest.register_craftitem("gems_api:".. gem_name , {
|
||||||
description = minetest.colorize( color, gem_names_caps[_]),
|
description = minetest.colorize( color, gem_names_caps[_]),
|
||||||
inventory_image = "item_"..gem_name..".png",
|
inventory_image = "item_"..gem_name..".png",
|
||||||
})
|
})
|
||||||
@ -32,7 +32,7 @@ for _, gem_name in pairs(gem_names) do
|
|||||||
--==================== Revealer =========================
|
--==================== Revealer =========================
|
||||||
-- use to reveal the current locations of all team members of that gem team
|
-- use to reveal the current locations of all team members of that gem team
|
||||||
|
|
||||||
minetest.register_craftitem("gems:".. gem_name .. "_reveal", {
|
minetest.register_craftitem("gems_api:".. gem_name .. "_reveal", {
|
||||||
description = minetest.colorize( color, gem_names_caps[_] .. " Revealer") .."\nUse to reveal the current location\nof all " .. minetest.colorize( color, gem_names_caps[_]) .. " team members to your team.\nDisappears after 5 sec and does not update.",
|
description = minetest.colorize( color, gem_names_caps[_] .. " Revealer") .."\nUse to reveal the current location\nof all " .. minetest.colorize( color, gem_names_caps[_]) .. " team members to your team.\nDisappears after 5 sec and does not update.",
|
||||||
inventory_image = "gems_reveal.png^[colorize:"..color.."88",
|
inventory_image = "gems_reveal.png^[colorize:"..color.."88",
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
@ -46,7 +46,7 @@ for _, gem_name in pairs(gem_names) do
|
|||||||
if not arena then return end
|
if not arena then return end
|
||||||
--returns the id of the team whose color the item is
|
--returns the id of the team whose color the item is
|
||||||
|
|
||||||
local t_team_id = gems.get_team_id_by_name(arena , gem_name)
|
local t_team_id = gems_api.get_team_id_by_name(arena , gem_name)
|
||||||
|
|
||||||
if not t_team_id then
|
if not t_team_id then
|
||||||
minetest.chat_send_player(p_name,gem_names_caps[_].. " Team isnt in this game!")
|
minetest.chat_send_player(p_name,gem_names_caps[_].. " Team isnt in this game!")
|
||||||
@ -61,7 +61,7 @@ for _, gem_name in pairs(gem_names) do
|
|||||||
if not arena.players[p_name].teamID then return end
|
if not arena.players[p_name].teamID then return end
|
||||||
local p_team_id = arena.players[p_name].teamID
|
local p_team_id = arena.players[p_name].teamID
|
||||||
|
|
||||||
gems.show_hud_team_location( arena, p_team_id , t_team_id , color )
|
gems_api.show_hud_team_location( arena, p_team_id , t_team_id , color )
|
||||||
|
|
||||||
|
|
||||||
return itemstack
|
return itemstack
|
||||||
@ -78,8 +78,8 @@ for _, gem_name in pairs(gem_names) do
|
|||||||
local gc = {cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3},}
|
local gc = {cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3},}
|
||||||
gc[ gem_name ] = {times={[1]=25, [2]=13, [3]=4}, uses=20, maxlevel=3}
|
gc[ gem_name ] = {times={[1]=25, [2]=13, [3]=4}, uses=20, maxlevel=3}
|
||||||
|
|
||||||
minetest.register_tool("gems:pick_" .. gem_name, {
|
minetest.register_tool("gems_api:pick_" .. gem_name, {
|
||||||
description = minetest.colorize(color , gem_names_caps[_] .. " Pickaxe") .. " \nUse to break Gem blocks, and Great Gems of\nAny team except " .. gems.get_opposite_team(gem_name),
|
description = minetest.colorize(color , gem_names_caps[_] .. " Pickaxe") .. " \nUse to break Gem blocks, and Great Gems of\nAny team except " .. gems_api.get_opposite_team(gem_name),
|
||||||
inventory_image = "pick_"..gem_name..".png",
|
inventory_image = "pick_"..gem_name..".png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.9,
|
full_punch_interval = 0.9,
|
||||||
@ -98,7 +98,7 @@ for _, gem_name in pairs(gem_names) do
|
|||||||
-- gem swords are the best swords available, and they are most effecive against players of the same gem team.
|
-- gem swords are the best swords available, and they are most effecive against players of the same gem team.
|
||||||
--
|
--
|
||||||
|
|
||||||
minetest.register_tool("gems:sword_" .. gem_name, {
|
minetest.register_tool("gems_api:sword_" .. gem_name, {
|
||||||
description = minetest.colorize(color , gem_names_caps[_] .. " Sword" ) .. " - \nMost useful against the".. gem_name .. " team",
|
description = minetest.colorize(color , gem_names_caps[_] .. " Sword" ) .. " - \nMost useful against the".. gem_name .. " team",
|
||||||
inventory_image = "sword_"..gem_name..".png",
|
inventory_image = "sword_"..gem_name..".png",
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
@ -160,7 +160,7 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
|||||||
if itemstack then
|
if itemstack then
|
||||||
|
|
||||||
|
|
||||||
if itemstack:get_name() == "gems:sword_ruby" then
|
if itemstack:get_name() == "gems_api:sword_ruby" then
|
||||||
--give 1 more damage
|
--give 1 more damage
|
||||||
|
|
||||||
if p_team_name == "ruby" then
|
if p_team_name == "ruby" then
|
||||||
@ -178,7 +178,7 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
|||||||
|
|
||||||
-- heal one damage if the player has an opposite shield
|
-- heal one damage if the player has an opposite shield
|
||||||
|
|
||||||
if victim_worn_armor and victim_worn_armor["shield"] == "gems:shield_emerald" then
|
if victim_worn_armor and victim_worn_armor["shield"] == "gems_api:shield_emerald" then
|
||||||
|
|
||||||
modifier = modifier + 1
|
modifier = modifier + 1
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if itemstack:get_name() == "gems:sword_emerald" then
|
if itemstack:get_name() == "gems_api:sword_emerald" then
|
||||||
|
|
||||||
if p_team_name == "emerald" then
|
if p_team_name == "emerald" then
|
||||||
|
|
||||||
@ -199,14 +199,14 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
|||||||
modifier = modifier + 1
|
modifier = modifier + 1
|
||||||
|
|
||||||
end
|
end
|
||||||
if victim_worn_armor and victim_worn_armor["shield"] == "gems:shield_ruby" then
|
if victim_worn_armor and victim_worn_armor["shield"] == "gems_api:shield_ruby" then
|
||||||
|
|
||||||
modifier = modifier + 1
|
modifier = modifier + 1
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if itemstack:get_name() == "gems:sword_opal" then
|
if itemstack:get_name() == "gems_api:sword_opal" then
|
||||||
|
|
||||||
if p_team_name == "opal" then
|
if p_team_name == "opal" then
|
||||||
|
|
||||||
@ -218,14 +218,14 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
|||||||
modifier = modifier + 1
|
modifier = modifier + 1
|
||||||
|
|
||||||
end
|
end
|
||||||
if victim_worn_armor and victim_worn_armor["shield"] == "gems:shield_sapphire" then
|
if victim_worn_armor and victim_worn_armor["shield"] == "gems_api:shield_sapphire" then
|
||||||
|
|
||||||
modifier = modifier + 1
|
modifier = modifier + 1
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if itemstack:get_name() == "gems:sword_sapphire" then
|
if itemstack:get_name() == "gems_api:sword_sapphire" then
|
||||||
|
|
||||||
if p_team_name == "sapphire" then
|
if p_team_name == "sapphire" then
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
|||||||
modifier = modifier + 1
|
modifier = modifier + 1
|
||||||
|
|
||||||
end
|
end
|
||||||
if victim_worn_armor and victim_worn_armor["shield"] == "gems:shield_opal" then
|
if victim_worn_armor and victim_worn_armor["shield"] == "gems_api:shield_opal" then
|
||||||
|
|
||||||
modifier = modifier + 1
|
modifier = modifier + 1
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
local storage = minetest.get_mod_storage()
|
local storage = minetest.get_mod_storage()
|
||||||
gems.arena_nodes = {}
|
gems_api.arena_nodes = {}
|
||||||
function gems.save_nodes(arena_name)
|
function gems_api.save_nodes(arena_name)
|
||||||
storage:set_string(arena_name,minetest.serialize(gems.arena_nodes[arena_name]))
|
storage:set_string(arena_name,minetest.serialize(gems_api.arena_nodes[arena_name]))
|
||||||
end
|
end
|
||||||
function gems.get_stored_nodes(arena_name)
|
function gems_api.get_stored_nodes(arena_name)
|
||||||
return minetest.deserialize(storage:get_string(arena_name))
|
return minetest.deserialize(storage:get_string(arena_name))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -11,28 +11,28 @@ end
|
|||||||
minetest.register_on_mods_loaded(function()
|
minetest.register_on_mods_loaded(function()
|
||||||
for arena_id,arena in ipairs(arena_lib.mods["gems_2"].arenas) do
|
for arena_id,arena in ipairs(arena_lib.mods["gems_2"].arenas) do
|
||||||
local arena_name = arena.name
|
local arena_name = arena.name
|
||||||
gems.arena_nodes[arena_name] = gems.get_stored_nodes(arena_name) or {}
|
gems_api.arena_nodes[arena_name] = gems_api.get_stored_nodes(arena_name) or {}
|
||||||
end
|
end
|
||||||
for arena_id,arena in ipairs(arena_lib.mods["gems_4"].arenas) do
|
for arena_id,arena in ipairs(arena_lib.mods["gems_4"].arenas) do
|
||||||
local arena_name = arena.name
|
local arena_name = arena.name
|
||||||
gems.arena_nodes[arena_name] = gems.get_stored_nodes(arena_name) or {}
|
gems_api.arena_nodes[arena_name] = gems_api.get_stored_nodes(arena_name) or {}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
local function attempt_save_node(arena,pos,oldnode)
|
local function attempt_save_node(arena,pos,oldnode)
|
||||||
if gems.arena_nodes[arena.name] then
|
if gems_api.arena_nodes[arena.name] then
|
||||||
-- dont change the stored value if we already know what node should be there
|
-- dont change the stored value if we already know what node should be there
|
||||||
local save_node = true
|
local save_node = true
|
||||||
for _,data in ipairs(gems.arena_nodes[arena.name]) do
|
for _,data in ipairs(gems_api.arena_nodes[arena.name]) do
|
||||||
if data.pos == pos then
|
if data.pos == pos then
|
||||||
save_node = false
|
save_node = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if save_node == true then
|
if save_node == true then
|
||||||
local data = {pos=pos,node=oldnode}
|
local data = {pos=pos,node=oldnode}
|
||||||
table.insert(gems.arena_nodes[arena.name],data)
|
table.insert(gems_api.arena_nodes[arena.name],data)
|
||||||
gems.save_nodes(arena.name)
|
gems_api.save_nodes(arena.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
@ -1,2 +1,2 @@
|
|||||||
name = gems
|
name = gems_api
|
||||||
description = a minigame similar to eggwars (api mod)
|
description = a minigame similar to eggwars (api mod)
|
@ -13,11 +13,11 @@ local gem_names_caps = {
|
|||||||
|
|
||||||
|
|
||||||
--================== BLOCKS ======================
|
--================== BLOCKS ======================
|
||||||
--blocks made from gems cannot be broken except with picks made from gems. Its easiest to break them with the pick of the same gem.
|
--blocks made from gems cannot be broken except with picks made from gems_api. Its easiest to break them with the pick of the same gem.
|
||||||
--its hardest to break them with the pick of the directly opposing gem
|
--its hardest to break them with the pick of the directly opposing gem
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:block_ruby", {
|
minetest.register_node( "gems_api:block_ruby", {
|
||||||
description = "Ruby Block",
|
description = "Ruby Block",
|
||||||
tiles = {"block_ruby.png"},
|
tiles = {"block_ruby.png"},
|
||||||
groups = { ruby = 3 , sapphire = 2, opal = 2, emerald = 1},
|
groups = { ruby = 3 , sapphire = 2, opal = 2, emerald = 1},
|
||||||
@ -25,7 +25,7 @@ minetest.register_node( "gems:block_ruby", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:block_sapphire", {
|
minetest.register_node( "gems_api:block_sapphire", {
|
||||||
description = "Sapphire Block",
|
description = "Sapphire Block",
|
||||||
tiles = {"block_sapphire.png"},
|
tiles = {"block_sapphire.png"},
|
||||||
groups = { sapphire = 3, emerald = 2 ,ruby = 2, opal = 1},
|
groups = { sapphire = 3, emerald = 2 ,ruby = 2, opal = 1},
|
||||||
@ -33,7 +33,7 @@ minetest.register_node( "gems:block_sapphire", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:block_emerald", {
|
minetest.register_node( "gems_api:block_emerald", {
|
||||||
description = "Emerald Block",
|
description = "Emerald Block",
|
||||||
tiles = {"block_emerald.png"},
|
tiles = {"block_emerald.png"},
|
||||||
groups = { emerald = 3, opal = 2, sapphire = 2 , ruby = 1},
|
groups = { emerald = 3, opal = 2, sapphire = 2 , ruby = 1},
|
||||||
@ -41,7 +41,7 @@ minetest.register_node( "gems:block_emerald", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:block_opal", {
|
minetest.register_node( "gems_api:block_opal", {
|
||||||
description = "Opal Block",
|
description = "Opal Block",
|
||||||
tiles = {"block_opal.png"},
|
tiles = {"block_opal.png"},
|
||||||
groups = { opal = 3, ruby = 2, emerald = 2, sapphire = 1},
|
groups = { opal = 3, ruby = 2, emerald = 2, sapphire = 1},
|
||||||
@ -52,7 +52,7 @@ minetest.register_node( "gems:block_opal", {
|
|||||||
--================== GLASS ======================
|
--================== GLASS ======================
|
||||||
--Glass made from gems cant be broken with regular tools, but it only slows gem tools down a bit
|
--Glass made from gems cant be broken with regular tools, but it only slows gem tools down a bit
|
||||||
|
|
||||||
minetest.register_node( "gems:glass_ruby", {
|
minetest.register_node( "gems_api:glass_ruby", {
|
||||||
description = "Ruby Glass",
|
description = "Ruby Glass",
|
||||||
tiles = {"glass_ruby.png"},
|
tiles = {"glass_ruby.png"},
|
||||||
groups = { ruby = 3 , sapphire = 3, opal = 2, emerald = 2,},
|
groups = { ruby = 3 , sapphire = 3, opal = 2, emerald = 2,},
|
||||||
@ -64,7 +64,7 @@ minetest.register_node( "gems:glass_ruby", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:glass_sapphire", {
|
minetest.register_node( "gems_api:glass_sapphire", {
|
||||||
description = "Sapphire Glass",
|
description = "Sapphire Glass",
|
||||||
tiles = {"glass_sapphire.png"},
|
tiles = {"glass_sapphire.png"},
|
||||||
groups = { sapphire = 3, emerald = 3 ,ruby = 2, opal = 2, },
|
groups = { sapphire = 3, emerald = 3 ,ruby = 2, opal = 2, },
|
||||||
@ -76,7 +76,7 @@ minetest.register_node( "gems:glass_sapphire", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:glass_emerald", {
|
minetest.register_node( "gems_api:glass_emerald", {
|
||||||
description = "Emerald Glass",
|
description = "Emerald Glass",
|
||||||
tiles = {"glass_emerald.png"},
|
tiles = {"glass_emerald.png"},
|
||||||
groups = { emerald = 3, opal = 3, sapphire = 2 , ruby = 2, },
|
groups = { emerald = 3, opal = 3, sapphire = 2 , ruby = 2, },
|
||||||
@ -88,7 +88,7 @@ minetest.register_node( "gems:glass_emerald", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:glass_opal", {
|
minetest.register_node( "gems_api:glass_opal", {
|
||||||
description = "Opal Glass",
|
description = "Opal Glass",
|
||||||
tiles = {"glass_opal.png"},
|
tiles = {"glass_opal.png"},
|
||||||
groups = { opal = 3, ruby = 3, emerald = 2, sapphire = 2, },
|
groups = { opal = 3, ruby = 3, emerald = 2, sapphire = 2, },
|
||||||
@ -106,7 +106,7 @@ minetest.register_node( "gems:glass_opal", {
|
|||||||
-- Great gems cannot be dug with the picks of the directly opposing color. They must be dug by an adjacent color.
|
-- Great gems cannot be dug with the picks of the directly opposing color. They must be dug by an adjacent color.
|
||||||
-- its easiest to dig them with the same color. Great gems allow players of that team to respawn.
|
-- its easiest to dig them with the same color. Great gems allow players of that team to respawn.
|
||||||
|
|
||||||
minetest.register_node( "gems:great_gem_ruby", {
|
minetest.register_node( "gems_api:great_gem_ruby", {
|
||||||
description = "Ruby Great Gem",
|
description = "Ruby Great Gem",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "hex_crystal_big.obj",
|
mesh = "hex_crystal_big.obj",
|
||||||
@ -127,7 +127,7 @@ minetest.register_node( "gems:great_gem_ruby", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:great_gem_sapphire", {
|
minetest.register_node( "gems_api:great_gem_sapphire", {
|
||||||
description = "Sapphire Great Gem",
|
description = "Sapphire Great Gem",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "hex_crystal_big.obj",
|
mesh = "hex_crystal_big.obj",
|
||||||
@ -148,7 +148,7 @@ minetest.register_node( "gems:great_gem_sapphire", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:great_gem_emerald", {
|
minetest.register_node( "gems_api:great_gem_emerald", {
|
||||||
description = "Emerald Great Gem",
|
description = "Emerald Great Gem",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "hex_crystal_big.obj",
|
mesh = "hex_crystal_big.obj",
|
||||||
@ -169,7 +169,7 @@ minetest.register_node( "gems:great_gem_emerald", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( "gems:great_gem_opal", {
|
minetest.register_node( "gems_api:great_gem_opal", {
|
||||||
description = "Opal Great Gem",
|
description = "Opal Great Gem",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "hex_crystal_big.obj",
|
mesh = "hex_crystal_big.obj",
|
||||||
@ -195,7 +195,7 @@ minetest.register_node( "gems:great_gem_opal", {
|
|||||||
|
|
||||||
-- Protectors hurt players of all other teams in a radius of 4 nodes
|
-- Protectors hurt players of all other teams in a radius of 4 nodes
|
||||||
|
|
||||||
-- minetest.register_node( "gems:protector_ruby", {
|
-- minetest.register_node( "gems_api:protector_ruby", {
|
||||||
-- description = "Ruby Protector",
|
-- description = "Ruby Protector",
|
||||||
-- tiles = {"glow_ruby.png"},
|
-- tiles = {"glow_ruby.png"},
|
||||||
-- groups = { ruby = 3 , sapphire = 3, opal = 2, emerald = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
-- groups = { ruby = 3 , sapphire = 3, opal = 2, emerald = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
||||||
@ -206,7 +206,7 @@ minetest.register_node( "gems:great_gem_opal", {
|
|||||||
-- })
|
-- })
|
||||||
|
|
||||||
|
|
||||||
-- minetest.register_node( "gems:protector_sapphire", {
|
-- minetest.register_node( "gems_api:protector_sapphire", {
|
||||||
-- description = "Sapphire Protector",
|
-- description = "Sapphire Protector",
|
||||||
-- tiles = {"glow_sapphire.png"},
|
-- tiles = {"glow_sapphire.png"},
|
||||||
-- groups = { sapphire = 3, emerald = 3 ,ruby = 2, opal = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
-- groups = { sapphire = 3, emerald = 3 ,ruby = 2, opal = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
||||||
@ -217,7 +217,7 @@ minetest.register_node( "gems:great_gem_opal", {
|
|||||||
-- })
|
-- })
|
||||||
|
|
||||||
|
|
||||||
-- minetest.register_node( "gems:protector_emerald", {
|
-- minetest.register_node( "gems_api:protector_emerald", {
|
||||||
-- description = "Emerald Protector",
|
-- description = "Emerald Protector",
|
||||||
-- tiles = {"glow_emerald.png"},
|
-- tiles = {"glow_emerald.png"},
|
||||||
-- groups = { emerald = 3, opal = 3, sapphire = 2 , ruby = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
-- groups = { emerald = 3, opal = 3, sapphire = 2 , ruby = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
||||||
@ -228,7 +228,7 @@ minetest.register_node( "gems:great_gem_opal", {
|
|||||||
-- })
|
-- })
|
||||||
|
|
||||||
|
|
||||||
-- minetest.register_node( "gems:protector_opal", {
|
-- minetest.register_node( "gems_api:protector_opal", {
|
||||||
-- description = "Opal Protector",
|
-- description = "Opal Protector",
|
||||||
-- tiles = {"glow_opal.png"},
|
-- tiles = {"glow_opal.png"},
|
||||||
-- groups = { opal = 3, ruby = 3, emerald = 2, sapphire = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
-- groups = { opal = 3, ruby = 3, emerald = 2, sapphire = 2, cracky = 1 , oddly_breakable_by_hand = 1},
|
||||||
@ -245,7 +245,7 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
local gem_name_cap = gem_names_caps[_]
|
local gem_name_cap = gem_names_caps[_]
|
||||||
|
|
||||||
minetest.register_node( "gems:mine_".. gem_name, {
|
minetest.register_node( "gems_api:mine_".. gem_name, {
|
||||||
description = gem_name_cap .. " Mine",
|
description = gem_name_cap .. " Mine",
|
||||||
tiles = { "default_stone.png^item_" .. gem_name .. ".png" },
|
tiles = { "default_stone.png^item_" .. gem_name .. ".png" },
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
@ -253,12 +253,12 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
|
|
||||||
minetest.register_abm{
|
minetest.register_abm{
|
||||||
label = "gems:mine_".. gem_name .." dropper",
|
label = "gems_api:mine_".. gem_name .." dropper",
|
||||||
nodenames = {"gems:mine_".. gem_name},
|
nodenames = {"gems_api:mine_".. gem_name},
|
||||||
interval = 3,
|
interval = 3,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
minetest.spawn_item({x=pos.x, y=pos.y+1, z=pos.z}, "gems:".. gem_name)
|
minetest.spawn_item({x=pos.x, y=pos.y+1, z=pos.z}, "gems_api:".. gem_name)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,10 +268,10 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
-- Protectors hurt players of all other teams in a radius of 4 nodes
|
-- Protectors hurt players of all other teams in a radius of 4 nodes
|
||||||
|
|
||||||
minetest.register_node( "gems:protector_" .. gem_name, {
|
minetest.register_node( "gems_api:protector_" .. gem_name, {
|
||||||
description = gem_name_cap .. " Protector",
|
description = gem_name_cap .. " Protector",
|
||||||
tiles = {"glow_"..gem_name..".png"},
|
tiles = {"glow_"..gem_name..".png"},
|
||||||
groups = gems.get_protector_groups(gem_name),
|
groups = gems_api.get_protector_groups(gem_name),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
use_texture_alpha = "blend",
|
use_texture_alpha = "blend",
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
@ -317,7 +317,7 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
if team_name ~= gem_name then
|
if team_name ~= gem_name then
|
||||||
|
|
||||||
if not(item_shield) or (item_shield ~= "gems:shield_" .. gem_name) then
|
if not(item_shield) or (item_shield ~= "gems_api:shield_" .. gem_name) then
|
||||||
|
|
||||||
local hp = player:get_hp()
|
local hp = player:get_hp()
|
||||||
local newhp = hp - 1
|
local newhp = hp - 1
|
@ -11,39 +11,39 @@ local gem_names_caps = {
|
|||||||
"Opal", --yellow
|
"Opal", --yellow
|
||||||
}
|
}
|
||||||
|
|
||||||
gems.prices = {}
|
gems_api.prices = {}
|
||||||
gems.prices.gem_block = {5 , 1}
|
gems_api.prices.gem_block = {5 , 1}
|
||||||
gems.prices.gem_glass = {3 , 1}
|
gems_api.prices.gem_glass = {3 , 1}
|
||||||
gems.prices.gem_pick = {15 , 1}
|
gems_api.prices.gem_pick = {15 , 1}
|
||||||
gems.prices.gem_sword = {18 , 1}
|
gems_api.prices.gem_sword = {18 , 1}
|
||||||
|
|
||||||
gems.prices.gem_protector = {13, 1}
|
gems_api.prices.gem_protector = {13, 1}
|
||||||
|
|
||||||
gems.prices.steel_pick = {3 , 1}
|
gems_api.prices.steel_pick = {3 , 1}
|
||||||
gems.prices.steel_sword = {3 , 1}
|
gems_api.prices.steel_sword = {3 , 1}
|
||||||
gems.prices.bronze_pick = {2 , 1}
|
gems_api.prices.bronze_pick = {2 , 1}
|
||||||
gems.prices.bronze_sword = {2 , 1}
|
gems_api.prices.bronze_sword = {2 , 1}
|
||||||
gems.prices.steel_axe = {3 , 1}
|
gems_api.prices.steel_axe = {3 , 1}
|
||||||
gems.prices.bronze_axe = {2 , 1}
|
gems_api.prices.bronze_axe = {2 , 1}
|
||||||
|
|
||||||
gems.prices.stone = {1 , 5}
|
gems_api.prices.stone = {1 , 5}
|
||||||
gems.prices.obsidian = {1 , 2}
|
gems_api.prices.obsidian = {1 , 2}
|
||||||
gems.prices.wood = {1 , 5}
|
gems_api.prices.wood = {1 , 5}
|
||||||
gems.prices.tree = {1 , 2}
|
gems_api.prices.tree = {1 , 2}
|
||||||
gems.prices.glass = {1 , 5}
|
gems_api.prices.glass = {1 , 5}
|
||||||
gems.prices.obsidian_glass = {1 , 3}
|
gems_api.prices.obsidian_glass = {1 , 3}
|
||||||
|
|
||||||
gems.prices.apple = {4 , 1}
|
gems_api.prices.apple = {4 , 1}
|
||||||
|
|
||||||
gems.prices.revealer = {25, 1}
|
gems_api.prices.revealer = {25, 1}
|
||||||
gems.prices.enderpearl = {22, 1}
|
gems_api.prices.enderpearl = {22, 1}
|
||||||
gems.prices.torch = {3, 1}
|
gems_api.prices.torch = {3, 1}
|
||||||
|
|
||||||
gems.prices.gem_shield = {18, 1}
|
gems_api.prices.gem_shield = {18, 1}
|
||||||
gems.prices.steel_helmet = {5 , 1}
|
gems_api.prices.steel_helmet = {5 , 1}
|
||||||
gems.prices.steel_chestplate = {6 , 1}
|
gems_api.prices.steel_chestplate = {6 , 1}
|
||||||
gems.prices.steel_leggings = {6 , 1}
|
gems_api.prices.steel_leggings = {6 , 1}
|
||||||
gems.prices.steel_boots = {5 , 1}
|
gems_api.prices.steel_boots = {5 , 1}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -61,10 +61,10 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
gems[ gem_name .. "_shop_main_menu"] = (
|
gems_api[ gem_name .. "_shop_main_menu"] = (
|
||||||
"size[10,7]" ..
|
"size[10,7]" ..
|
||||||
-- gems menu, name = <gem_name>_gems_menu
|
-- gems menu, name = <gem_name>_gems_menu
|
||||||
"item_image_button[1,1;2,2;gems:".. gem_name .. ";".. gem_name .. "_gems_menu;]" ..
|
"item_image_button[1,1;2,2;gems_api:".. gem_name .. ";".. gem_name .. "_gems_menu;]" ..
|
||||||
"tooltip[".. gem_name .. "_gems_menu;Gems]" ..
|
"tooltip[".. gem_name .. "_gems_menu;Gems]" ..
|
||||||
|
|
||||||
-- tools menu, name = <gem_name>_tools_menu
|
-- tools menu, name = <gem_name>_tools_menu
|
||||||
@ -93,34 +93,34 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
gems[ gem_name .. "_shop_gems_menu"] = (
|
gems_api[ gem_name .. "_shop_gems_menu"] = (
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"size[10,7]" ..
|
"size[10,7]" ..
|
||||||
|
|
||||||
-- gem block, name = <gem_name>_block_button
|
-- gem block, name = <gem_name>_block_button
|
||||||
"item_image_button[1,1;2,2;gems:block_".. gem_name .. ";".. gem_name .. "_block_button;"..tostring(gems.prices.gem_block[1])..":"..tostring(gems.prices.gem_block[2]).."]" ..
|
"item_image_button[1,1;2,2;gems_api:block_".. gem_name .. ";".. gem_name .. "_block_button;"..tostring(gems_api.prices.gem_block[1])..":"..tostring(gems_api.prices.gem_block[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_block_button;"..gem_name_cap.." Block]" ..
|
"tooltip[".. gem_name .. "_block_button;"..gem_name_cap.." Block]" ..
|
||||||
|
|
||||||
-- gem glass block, name = <gem_name>_glass_button
|
-- gem glass block, name = <gem_name>_glass_button
|
||||||
"item_image_button[4,1;2,2;gems:glass_".. gem_name .. ";".. gem_name .. "_glass_button;"..tostring(gems.prices.gem_glass[1])..":"..tostring(gems.prices.gem_glass[2]).."]" ..
|
"item_image_button[4,1;2,2;gems_api:glass_".. gem_name .. ";".. gem_name .. "_glass_button;"..tostring(gems_api.prices.gem_glass[1])..":"..tostring(gems_api.prices.gem_glass[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_glass_button;"..gem_name_cap.." Glass]" ..
|
"tooltip[".. gem_name .. "_glass_button;"..gem_name_cap.." Glass]" ..
|
||||||
|
|
||||||
-- Gem pick, name = <gem_name>_pick_button
|
-- Gem pick, name = <gem_name>_pick_button
|
||||||
"item_image_button[7,1;2,2;gems:pick_".. gem_name .. ";".. gem_name .. "_pick_button;"..tostring(gems.prices.gem_pick[1])..":"..tostring(gems.prices.gem_pick[2]).."]" ..
|
"item_image_button[7,1;2,2;gems_api:pick_".. gem_name .. ";".. gem_name .. "_pick_button;"..tostring(gems_api.prices.gem_pick[1])..":"..tostring(gems_api.prices.gem_pick[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_pick_button;"..gem_name_cap.." Pick]" ..
|
"tooltip[".. gem_name .. "_pick_button;"..gem_name_cap.." Pick]" ..
|
||||||
|
|
||||||
-- Gem Sword, name = <gem_name>_sword_button
|
-- Gem Sword, name = <gem_name>_sword_button
|
||||||
"item_image_button[1,4;2,2;gems:sword_".. gem_name .. ";".. gem_name .. "_sword_button;"..tostring(gems.prices.gem_sword[1])..":"..tostring(gems.prices.gem_sword[2]).."]" ..
|
"item_image_button[1,4;2,2;gems_api:sword_".. gem_name .. ";".. gem_name .. "_sword_button;"..tostring(gems_api.prices.gem_sword[1])..":"..tostring(gems_api.prices.gem_sword[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_sword_button;"..gem_name_cap.." Sword]" ..
|
"tooltip[".. gem_name .. "_sword_button;"..gem_name_cap.." Sword]" ..
|
||||||
|
|
||||||
-- Gem Protector, name = <gem_name>_protector_button
|
-- Gem Protector, name = <gem_name>_protector_button
|
||||||
"item_image_button[4,4;2,2;gems:protector_".. gem_name .. ";".. gem_name .. "_protector_button;"..tostring(gems.prices.gem_protector[1])..":"..tostring(gems.prices.gem_protector[2]).."]" ..
|
"item_image_button[4,4;2,2;gems_api:protector_".. gem_name .. ";".. gem_name .. "_protector_button;"..tostring(gems_api.prices.gem_protector[1])..":"..tostring(gems_api.prices.gem_protector[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_protector_button;"..gem_name_cap.." Protector \n(damages plays of other colors)]" ..
|
"tooltip[".. gem_name .. "_protector_button;"..gem_name_cap.." Protector \n(damages plays of other colors)]" ..
|
||||||
|
|
||||||
-- gem shield protects against protector damage and special gem sword attacks
|
-- gem shield protects against protector damage and special gem sword attacks
|
||||||
"item_image_button[7,4;2,2;gems:shield_" .. gem_name .. ";".. gem_name .. "_gem_shield_button;"..tostring(gems.prices.gem_shield[1])..":"..tostring(gems.prices.gem_shield[2]).."]" ..
|
"item_image_button[7,4;2,2;gems_api:shield_" .. gem_name .. ";".. gem_name .. "_gem_shield_button;"..tostring(gems_api.prices.gem_shield[1])..":"..tostring(gems_api.prices.gem_shield[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_gem_shield_button;Gem Shield \n(Protects against protector damage and extra gem attacks)]"
|
"tooltip[".. gem_name .. "_gem_shield_button;Gem Shield \n(Protects against protector damage and extra gem attacks)]"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -131,32 +131,32 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
gems[ gem_name .. "_shop_tools_menu"] = (
|
gems_api[ gem_name .. "_shop_tools_menu"] = (
|
||||||
|
|
||||||
"size[10,7]" ..
|
"size[10,7]" ..
|
||||||
|
|
||||||
-- Steel Pick, name = <gem_name>_steel_pick_button
|
-- Steel Pick, name = <gem_name>_steel_pick_button
|
||||||
"item_image_button[1,1;2,2;default:pick_steel;".. gem_name .. "_steel_pick_button;"..tostring(gems.prices.steel_pick[1])..":"..tostring(gems.prices.steel_pick[2]).."]" ..
|
"item_image_button[1,1;2,2;default:pick_steel;".. gem_name .. "_steel_pick_button;"..tostring(gems_api.prices.steel_pick[1])..":"..tostring(gems_api.prices.steel_pick[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_steel_pick_button;Steel Pick]" ..
|
"tooltip[".. gem_name .. "_steel_pick_button;Steel Pick]" ..
|
||||||
|
|
||||||
-- Steel Sword, name = <gem_name>_steel_sword_button
|
-- Steel Sword, name = <gem_name>_steel_sword_button
|
||||||
"item_image_button[4,1;2,2;default:sword_steel;".. gem_name .. "_steel_sword_button;"..tostring(gems.prices.steel_sword[1])..":"..tostring(gems.prices.steel_sword[2]).."]" ..
|
"item_image_button[4,1;2,2;default:sword_steel;".. gem_name .. "_steel_sword_button;"..tostring(gems_api.prices.steel_sword[1])..":"..tostring(gems_api.prices.steel_sword[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_steel_sword_button;Steel Sword]" ..
|
"tooltip[".. gem_name .. "_steel_sword_button;Steel Sword]" ..
|
||||||
|
|
||||||
-- bronze pick, name = <gem_name>_bronze_pick_button
|
-- bronze pick, name = <gem_name>_bronze_pick_button
|
||||||
"item_image_button[7,1;2,2;default:pick_bronze;".. gem_name .. "_bronze_pick_button;"..tostring(gems.prices.bronze_pick[1])..":"..tostring(gems.prices.bronze_pick[2]).."]" ..
|
"item_image_button[7,1;2,2;default:pick_bronze;".. gem_name .. "_bronze_pick_button;"..tostring(gems_api.prices.bronze_pick[1])..":"..tostring(gems_api.prices.bronze_pick[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_bronze_pick_button;Bronze Pick]" ..
|
"tooltip[".. gem_name .. "_bronze_pick_button;Bronze Pick]" ..
|
||||||
|
|
||||||
-- bronze Sword, name = <gem_name>_bronze_sword_button
|
-- bronze Sword, name = <gem_name>_bronze_sword_button
|
||||||
"item_image_button[1,4;2,2;default:sword_bronze;".. gem_name .. "_bronze_sword_button;"..tostring(gems.prices.bronze_sword[1])..":"..tostring(gems.prices.bronze_sword[2]).."]" ..
|
"item_image_button[1,4;2,2;default:sword_bronze;".. gem_name .. "_bronze_sword_button;"..tostring(gems_api.prices.bronze_sword[1])..":"..tostring(gems_api.prices.bronze_sword[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_bronze_sword_button;Bronze Sword]" ..
|
"tooltip[".. gem_name .. "_bronze_sword_button;Bronze Sword]" ..
|
||||||
|
|
||||||
-- Steel Axe, name = <gem_name>_steel_axe_button
|
-- Steel Axe, name = <gem_name>_steel_axe_button
|
||||||
"item_image_button[4,4;2,2;default:axe_steel;".. gem_name .. "_steel_axe_button;"..tostring(gems.prices.steel_axe[1])..":"..tostring(gems.prices.steel_axe[2]).."]" ..
|
"item_image_button[4,4;2,2;default:axe_steel;".. gem_name .. "_steel_axe_button;"..tostring(gems_api.prices.steel_axe[1])..":"..tostring(gems_api.prices.steel_axe[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_steel_axe_button;Steel Axe]" ..
|
"tooltip[".. gem_name .. "_steel_axe_button;Steel Axe]" ..
|
||||||
|
|
||||||
--Bronze axe, name = <gem_name>_bronze_axe_button
|
--Bronze axe, name = <gem_name>_bronze_axe_button
|
||||||
"item_image_button[7,4;2,2;default:axe_bronze;".. gem_name .. "_bronze_axe_button;"..tostring(gems.prices.bronze_axe[1])..":"..tostring(gems.prices.bronze_axe[2]).."]" ..
|
"item_image_button[7,4;2,2;default:axe_bronze;".. gem_name .. "_bronze_axe_button;"..tostring(gems_api.prices.bronze_axe[1])..":"..tostring(gems_api.prices.bronze_axe[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_bronze_axe_button;Bronze Axe]"
|
"tooltip[".. gem_name .. "_bronze_axe_button;Bronze Axe]"
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -166,32 +166,32 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
gems[ gem_name .. "_shop_blocks_menu"] = (
|
gems_api[ gem_name .. "_shop_blocks_menu"] = (
|
||||||
|
|
||||||
"size[10,7]" ..
|
"size[10,7]" ..
|
||||||
|
|
||||||
-- Stone, name = <gem_name>_stone_button
|
-- Stone, name = <gem_name>_stone_button
|
||||||
"item_image_button[1,1;2,2;default:stone;".. gem_name .. "_stone_button;"..tostring(gems.prices.stone[1])..":"..tostring(gems.prices.stone[2]).."]" ..
|
"item_image_button[1,1;2,2;default:stone;".. gem_name .. "_stone_button;"..tostring(gems_api.prices.stone[1])..":"..tostring(gems_api.prices.stone[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_stone_button;Stone]" ..
|
"tooltip[".. gem_name .. "_stone_button;Stone]" ..
|
||||||
|
|
||||||
-- obsidian, name = <gem_name>_obsidian_button
|
-- obsidian, name = <gem_name>_obsidian_button
|
||||||
"item_image_button[4,1;2,2;default:obsidian;".. gem_name .. "_obsidian_button;"..tostring(gems.prices.obsidian[1])..":"..tostring(gems.prices.obsidian[2]).."]" ..
|
"item_image_button[4,1;2,2;default:obsidian;".. gem_name .. "_obsidian_button;"..tostring(gems_api.prices.obsidian[1])..":"..tostring(gems_api.prices.obsidian[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_obsidian_button;Obsidian]" ..
|
"tooltip[".. gem_name .. "_obsidian_button;Obsidian]" ..
|
||||||
|
|
||||||
-- wood, name = <gem_name>_wood_button
|
-- wood, name = <gem_name>_wood_button
|
||||||
"item_image_button[7,1;2,2;default:wood;".. gem_name .. "_wood_button;"..tostring(gems.prices.wood[1])..":"..tostring(gems.prices.wood[2]).."]" ..
|
"item_image_button[7,1;2,2;default:wood;".. gem_name .. "_wood_button;"..tostring(gems_api.prices.wood[1])..":"..tostring(gems_api.prices.wood[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_wood_button;Wood]" ..
|
"tooltip[".. gem_name .. "_wood_button;Wood]" ..
|
||||||
|
|
||||||
-- tree, name = <gem_name>_tree_button
|
-- tree, name = <gem_name>_tree_button
|
||||||
"item_image_button[1,4;2,2;default:tree;".. gem_name .. "_tree_button;"..tostring(gems.prices.tree[1])..":"..tostring(gems.prices.tree[2]).."]" ..
|
"item_image_button[1,4;2,2;default:tree;".. gem_name .. "_tree_button;"..tostring(gems_api.prices.tree[1])..":"..tostring(gems_api.prices.tree[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_tree_button;Tree]" ..
|
"tooltip[".. gem_name .. "_tree_button;Tree]" ..
|
||||||
|
|
||||||
-- glass, name = <gem_name>_glass_button
|
-- glass, name = <gem_name>_glass_button
|
||||||
"item_image_button[4,4;2,2;default:glass;".. gem_name .. "_glass_button;"..tostring(gems.prices.glass[1])..":"..tostring(gems.prices.glass[2]).."]" ..
|
"item_image_button[4,4;2,2;default:glass;".. gem_name .. "_glass_button;"..tostring(gems_api.prices.glass[1])..":"..tostring(gems_api.prices.glass[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_glass_button;Glass]" ..
|
"tooltip[".. gem_name .. "_glass_button;Glass]" ..
|
||||||
|
|
||||||
-- obsidian glass, name = <gem_name>_obsidian_glass_button
|
-- obsidian glass, name = <gem_name>_obsidian_glass_button
|
||||||
"item_image_button[7,4;2,2;default:obsidian_glass;".. gem_name .. "_obsidian_glass_button;"..tostring(gems.prices.obsidian_glass[1])..":"..tostring(gems.prices.obsidian_glass[2]).."]" ..
|
"item_image_button[7,4;2,2;default:obsidian_glass;".. gem_name .. "_obsidian_glass_button;"..tostring(gems_api.prices.obsidian_glass[1])..":"..tostring(gems_api.prices.obsidian_glass[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_obsidian_glass_button;Obsidian Glass]"
|
"tooltip[".. gem_name .. "_obsidian_glass_button;Obsidian Glass]"
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -200,11 +200,11 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
gems[ gem_name .. "_shop_food_menu"] = (
|
gems_api[ gem_name .. "_shop_food_menu"] = (
|
||||||
"size[10,7]" ..
|
"size[10,7]" ..
|
||||||
|
|
||||||
-- apple, name = <gem_name>_apple_button
|
-- apple, name = <gem_name>_apple_button
|
||||||
"item_image_button[1,1;2,2;default:apple;".. gem_name .. "_apple_button;"..tostring(gems.prices.apple[1])..":"..tostring(gems.prices.apple[2]).."]" ..
|
"item_image_button[1,1;2,2;default:apple;".. gem_name .. "_apple_button;"..tostring(gems_api.prices.apple[1])..":"..tostring(gems_api.prices.apple[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_apple_button;Apple]"
|
"tooltip[".. gem_name .. "_apple_button;Apple]"
|
||||||
|
|
||||||
-- -- obsidian, name = <gem_name>_obsidian_button
|
-- -- obsidian, name = <gem_name>_obsidian_button
|
||||||
@ -233,19 +233,19 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
-- Special menu
|
-- Special menu
|
||||||
|
|
||||||
gems[ gem_name .. "_shop_special_menu"] = (
|
gems_api[ gem_name .. "_shop_special_menu"] = (
|
||||||
"size[10,7]" ..
|
"size[10,7]" ..
|
||||||
|
|
||||||
-- revealer, name = <gem_name>_reveal_button
|
-- revealer, name = <gem_name>_reveal_button
|
||||||
"item_image_button[1,1;2,2;gems:" .. gem_name .. "_reveal;".. gem_name .. "_reveal_button;"..tostring(gems.prices.revealer[1])..":"..tostring(gems.prices.revealer[2]).."]" ..
|
"item_image_button[1,1;2,2;gems_api:" .. gem_name .. "_reveal;".. gem_name .. "_reveal_button;"..tostring(gems_api.prices.revealer[1])..":"..tostring(gems_api.prices.revealer[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_reveal_button;Revealer \nUse to reveal the ".. gem_name .. " team's location to your team]" ..
|
"tooltip[".. gem_name .. "_reveal_button;Revealer \nUse to reveal the ".. gem_name .. " team's location to your team]" ..
|
||||||
|
|
||||||
-- enderpearl:ender_pearl, name = <gem_name>_enderpearl_button
|
-- enderpearl:ender_pearl, name = <gem_name>_enderpearl_button
|
||||||
"item_image_button[4,1;2,2;enderpearl:ender_pearl;".. gem_name .. "_enderpearl_button;"..tostring(gems.prices.enderpearl[1])..":"..tostring(gems.prices.enderpearl[2]).."]" ..
|
"item_image_button[4,1;2,2;enderpearl:ender_pearl;".. gem_name .. "_enderpearl_button;"..tostring(gems_api.prices.enderpearl[1])..":"..tostring(gems_api.prices.enderpearl[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_enderpearl_button;Enderpearl \nUse to teleport short distances]" ..
|
"tooltip[".. gem_name .. "_enderpearl_button;Enderpearl \nUse to teleport short distances]" ..
|
||||||
|
|
||||||
-- torch, name = <gem_name>_torch_button
|
-- torch, name = <gem_name>_torch_button
|
||||||
"item_image_button[7,1;2,2;default:torch;".. gem_name .. "_torch_button;"..tostring(gems.prices.torch[1])..":"..tostring(gems.prices.torch[2]).."]" ..
|
"item_image_button[7,1;2,2;default:torch;".. gem_name .. "_torch_button;"..tostring(gems_api.prices.torch[1])..":"..tostring(gems_api.prices.torch[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_torch_button;Torch]"
|
"tooltip[".. gem_name .. "_torch_button;Torch]"
|
||||||
|
|
||||||
-- -- tree, name = <gem_name>_tree_button
|
-- -- tree, name = <gem_name>_tree_button
|
||||||
@ -270,32 +270,32 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
gems[ gem_name .. "_shop_armor_menu"] = (
|
gems_api[ gem_name .. "_shop_armor_menu"] = (
|
||||||
|
|
||||||
"size[10,7]" ..
|
"size[10,7]" ..
|
||||||
|
|
||||||
-- steel helmet, name = <gem_name>_steel_helmet_button
|
-- steel helmet, name = <gem_name>_steel_helmet_button
|
||||||
"item_image_button[1,1;2,2;3d_armor:helmet_steel;".. gem_name .. "_steel_helmet_button;"..tostring(gems.prices.steel_helmet[1])..":"..tostring(gems.prices.steel_helmet[2]).."]" ..
|
"item_image_button[1,1;2,2;3d_armor:helmet_steel;".. gem_name .. "_steel_helmet_button;"..tostring(gems_api.prices.steel_helmet[1])..":"..tostring(gems_api.prices.steel_helmet[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_steel_helmet_button;Steel Helmet]" ..
|
"tooltip[".. gem_name .. "_steel_helmet_button;Steel Helmet]" ..
|
||||||
|
|
||||||
-- steel leggings, name = <gem_name>_steel_leggings_button
|
-- steel leggings, name = <gem_name>_steel_leggings_button
|
||||||
"item_image_button[4,1;2,2;3d_armor:leggings_steel;".. gem_name .. "_steel_leggings_button;"..tostring(gems.prices.steel_leggings[1])..":"..tostring(gems.prices.steel_leggings[2]).."]" ..
|
"item_image_button[4,1;2,2;3d_armor:leggings_steel;".. gem_name .. "_steel_leggings_button;"..tostring(gems_api.prices.steel_leggings[1])..":"..tostring(gems_api.prices.steel_leggings[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_steel_leggings_button;Steel Leggings]" ..
|
"tooltip[".. gem_name .. "_steel_leggings_button;Steel Leggings]" ..
|
||||||
|
|
||||||
-- steel_chestplate, name = <gem_name>_steel_chestplate_button
|
-- steel_chestplate, name = <gem_name>_steel_chestplate_button
|
||||||
"item_image_button[7,1;2,2;3d_armor:chestplate_steel;".. gem_name .. "_steel_chestplate_button;"..tostring(gems.prices.steel_chestplate[1])..":"..tostring(gems.prices.steel_chestplate[2]).."]" ..
|
"item_image_button[7,1;2,2;3d_armor:chestplate_steel;".. gem_name .. "_steel_chestplate_button;"..tostring(gems_api.prices.steel_chestplate[1])..":"..tostring(gems_api.prices.steel_chestplate[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_steel_chestplate_button;Steel Chestplate]" ..
|
"tooltip[".. gem_name .. "_steel_chestplate_button;Steel Chestplate]" ..
|
||||||
|
|
||||||
-- steel_boots, name = <gem_name>_steel_boots_button
|
-- steel_boots, name = <gem_name>_steel_boots_button
|
||||||
"item_image_button[1,4;2,2;3d_armor:boots_steel;".. gem_name .. "_steel_boots_button;"..tostring(gems.prices.steel_boots[1])..":"..tostring(gems.prices.steel_boots[2]).."]" ..
|
"item_image_button[1,4;2,2;3d_armor:boots_steel;".. gem_name .. "_steel_boots_button;"..tostring(gems_api.prices.steel_boots[1])..":"..tostring(gems_api.prices.steel_boots[2]).."]" ..
|
||||||
"tooltip[".. gem_name .. "_steel_boots_button;Steel Boots]"
|
"tooltip[".. gem_name .. "_steel_boots_button;Steel Boots]"
|
||||||
|
|
||||||
-- -- steel_boots, name = <gem_name>_steel_boots_button
|
-- -- steel_boots, name = <gem_name>_steel_boots_button
|
||||||
-- "item_image_button[4,4;2,2;3d_armor:boots_steel;".. gem_name .. "_steel_boots_button;"..tostring(gems.prices.steel_boots[1])..":"..tostring(gems.prices.steel_boots[2]).."]" ..
|
-- "item_image_button[4,4;2,2;3d_armor:boots_steel;".. gem_name .. "_steel_boots_button;"..tostring(gems_api.prices.steel_boots[1])..":"..tostring(gems_api.prices.steel_boots[2]).."]" ..
|
||||||
-- "tooltip[".. gem_name .. "_steel_boots_button;Steel Boots]"
|
-- "tooltip[".. gem_name .. "_steel_boots_button;Steel Boots]"
|
||||||
|
|
||||||
-- -- obsidian glass, name = <gem_name>_obsidian_glass_button
|
-- -- obsidian glass, name = <gem_name>_obsidian_glass_button
|
||||||
-- "item_image_button[7,4;2,2;default:obsidian_glass;".. gem_name .. "_obsidian_glass_button;"..tostring(gems.prices.obsidian_glass[1])..":"..tostring(gems.prices.obsidian_glass[2]).."]" ..
|
-- "item_image_button[7,4;2,2;default:obsidian_glass;".. gem_name .. "_obsidian_glass_button;"..tostring(gems_api.prices.obsidian_glass[1])..":"..tostring(gems_api.prices.obsidian_glass[2]).."]" ..
|
||||||
-- "tooltip[".. gem_name .. "_obsidian_glass_button;Obsidian Glass]"
|
-- "tooltip[".. gem_name .. "_obsidian_glass_button;Obsidian Glass]"
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -305,7 +305,7 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
--register the shop node
|
--register the shop node
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("gems:shop_"..gem_name, {
|
minetest.register_node("gems_api:shop_"..gem_name, {
|
||||||
description = gem_name_cap .. " Shop",
|
description = gem_name_cap .. " Shop",
|
||||||
groups = {unbreakable = 1},
|
groups = {unbreakable = 1},
|
||||||
drop = "",
|
drop = "",
|
||||||
@ -313,7 +313,7 @@ for _ , gem_name in pairs(gem_names) do
|
|||||||
tiles = {"default_steel_block.png^item_" ..gem_name .. ".png",},
|
tiles = {"default_steel_block.png^item_" ..gem_name .. ".png",},
|
||||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
minetest.show_formspec(name, "gems:shop_main", gems[ gem_name .. "_shop_main_menu"])
|
minetest.show_formspec(name, "gems_api:shop_main", gems_api[ gem_name .. "_shop_main_menu"])
|
||||||
end,
|
end,
|
||||||
groups = {},
|
groups = {},
|
||||||
sounds = default.node_sound_metal_defaults(),
|
sounds = default.node_sound_metal_defaults(),
|
||||||
@ -336,40 +336,40 @@ minetest.register_on_player_receive_fields(function(player, formname, pressed)
|
|||||||
|
|
||||||
local gem_name_cap = gem_names_caps[_]
|
local gem_name_cap = gem_names_caps[_]
|
||||||
|
|
||||||
if formname == "gems:shop_main" then
|
if formname == "gems_api:shop_main" then
|
||||||
|
|
||||||
if pressed[gem_name .. "_gems_menu"] then
|
if pressed[gem_name .. "_gems_menu"] then
|
||||||
|
|
||||||
minetest.show_formspec(name, "gems:" .. gem_name .. "_shop_gems_menu", gems[gem_name .. "_shop_gems_menu"])
|
minetest.show_formspec(name, "gems_api:" .. gem_name .. "_shop_gems_menu", gems_api[gem_name .. "_shop_gems_menu"])
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name .. "_tools_menu"] then
|
if pressed[gem_name .. "_tools_menu"] then
|
||||||
|
|
||||||
minetest.show_formspec(name, "gems:" .. gem_name .. "_shop_tools_menu", gems[gem_name .. "_shop_tools_menu"])
|
minetest.show_formspec(name, "gems_api:" .. gem_name .. "_shop_tools_menu", gems_api[gem_name .. "_shop_tools_menu"])
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name .. "_blocks_menu"] then
|
if pressed[gem_name .. "_blocks_menu"] then
|
||||||
|
|
||||||
minetest.show_formspec(name, "gems:" .. gem_name .. "_shop_blocks_menu", gems[gem_name .. "_shop_blocks_menu"])
|
minetest.show_formspec(name, "gems_api:" .. gem_name .. "_shop_blocks_menu", gems_api[gem_name .. "_shop_blocks_menu"])
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[ gem_name .. "_food_menu"] then
|
if pressed[ gem_name .. "_food_menu"] then
|
||||||
|
|
||||||
minetest.show_formspec(name, "gems:" .. gem_name .. "_shop_food_menu", gems[gem_name .. "_shop_food_menu"])
|
minetest.show_formspec(name, "gems_api:" .. gem_name .. "_shop_food_menu", gems_api[gem_name .. "_shop_food_menu"])
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[ gem_name .. "_special_menu"] then
|
if pressed[ gem_name .. "_special_menu"] then
|
||||||
|
|
||||||
minetest.show_formspec(name, "gems:" .. gem_name .. "_shop_special_menu", gems[gem_name .. "_shop_special_menu"])
|
minetest.show_formspec(name, "gems_api:" .. gem_name .. "_shop_special_menu", gems_api[gem_name .. "_shop_special_menu"])
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[ gem_name .. "_armor_menu"] then
|
if pressed[ gem_name .. "_armor_menu"] then
|
||||||
|
|
||||||
minetest.show_formspec(name, "gems:" .. gem_name .. "_shop_armor_menu", gems[gem_name .. "_shop_armor_menu"])
|
minetest.show_formspec(name, "gems_api:" .. gem_name .. "_shop_armor_menu", gems_api[gem_name .. "_shop_armor_menu"])
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -377,132 +377,132 @@ minetest.register_on_player_receive_fields(function(player, formname, pressed)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if formname == "gems:" .. gem_name .. "_shop_gems_menu" then
|
if formname == "gems_api:" .. gem_name .. "_shop_gems_menu" then
|
||||||
|
|
||||||
if pressed[gem_name.. "_block_button" ] then
|
if pressed[gem_name.. "_block_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.gem_block[1]), "gems:block_" .. gem_name .. " " .. tostring(gems.prices.gem_block[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.gem_block[1]), "gems_api:block_" .. gem_name .. " " .. tostring(gems_api.prices.gem_block[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[ gem_name .. "_glass_button" ] then
|
if pressed[ gem_name .. "_glass_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.gem_glass[1]), "gems:glass_" .. gem_name .. " " .. tostring(gems.prices.gem_glass[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.gem_glass[1]), "gems_api:glass_" .. gem_name .. " " .. tostring(gems_api.prices.gem_glass[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[ gem_name .. "_pick_button" ] then
|
if pressed[ gem_name .. "_pick_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.gem_pick[1]), "gems:pick_" .. gem_name .. " " .. tostring(gems.prices.gem_pick[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.gem_pick[1]), "gems_api:pick_" .. gem_name .. " " .. tostring(gems_api.prices.gem_pick[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[ gem_name .. "_sword_button" ] then
|
if pressed[ gem_name .. "_sword_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.gem_sword[1]), "gems:sword_" .. gem_name .. " " .. tostring(gems.prices.gem_sword[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.gem_sword[1]), "gems_api:sword_" .. gem_name .. " " .. tostring(gems_api.prices.gem_sword[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[ gem_name .. "_protector_button" ] then
|
if pressed[ gem_name .. "_protector_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.gem_protector[1]), "gems:protector_" .. gem_name .. " " .. tostring(gems.prices.gem_protector[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.gem_protector[1]), "gems_api:protector_" .. gem_name .. " " .. tostring(gems_api.prices.gem_protector[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
if pressed[gem_name.. "_gem_shield_button" ] then
|
if pressed[gem_name.. "_gem_shield_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.gem_shield[1]), "gems:shield_"..gem_name .." ".. tostring(gems.prices.gem_shield[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.gem_shield[1]), "gems_api:shield_"..gem_name .." ".. tostring(gems_api.prices.gem_shield[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if formname == "gems:" .. gem_name .. "_shop_tools_menu" then
|
if formname == "gems_api:" .. gem_name .. "_shop_tools_menu" then
|
||||||
|
|
||||||
|
|
||||||
if pressed[gem_name.. "_steel_pick_button" ] then
|
if pressed[gem_name.. "_steel_pick_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.steel_pick[1]), "default:pick_steel " .. tostring(gems.prices.steel_pick[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.steel_pick[1]), "default:pick_steel " .. tostring(gems_api.prices.steel_pick[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_steel_sword_button" ] then
|
if pressed[gem_name.. "_steel_sword_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.steel_sword[1]), "default:sword_steel " .. tostring(gems.prices.steel_sword[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.steel_sword[1]), "default:sword_steel " .. tostring(gems_api.prices.steel_sword[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_bronze_pick_button" ] then
|
if pressed[gem_name.. "_bronze_pick_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.bronze_pick[1]), "default:pick_bronze " .. tostring(gems.prices.bronze_pick[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.bronze_pick[1]), "default:pick_bronze " .. tostring(gems_api.prices.bronze_pick[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_bronze_sword_button" ] then
|
if pressed[gem_name.. "_bronze_sword_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.bronze_sword[1]), "default:sword_bronze " .. tostring(gems.prices.bronze_sword[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.bronze_sword[1]), "default:sword_bronze " .. tostring(gems_api.prices.bronze_sword[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_steel_axe_button" ] then
|
if pressed[gem_name.. "_steel_axe_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.steel_axe[1]), "default:axe_steel " .. tostring(gems.prices.steel_axe[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.steel_axe[1]), "default:axe_steel " .. tostring(gems_api.prices.steel_axe[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_bronze_axe_button" ] then
|
if pressed[gem_name.. "_bronze_axe_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.bronze_axe[1]), "default:axe_bronze " .. tostring(gems.prices.bronze_axe[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.bronze_axe[1]), "default:axe_bronze " .. tostring(gems_api.prices.bronze_axe[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if formname == "gems:" .. gem_name .. "_shop_blocks_menu" then
|
if formname == "gems_api:" .. gem_name .. "_shop_blocks_menu" then
|
||||||
|
|
||||||
if pressed[gem_name.. "_stone_button" ] then
|
if pressed[gem_name.. "_stone_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.stone[1]), "default:stone " .. tostring(gems.prices.stone[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.stone[1]), "default:stone " .. tostring(gems_api.prices.stone[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_obsidian_button" ] then
|
if pressed[gem_name.. "_obsidian_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.obsidian[1]), "default:obsidian " .. tostring(gems.prices.obsidian[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.obsidian[1]), "default:obsidian " .. tostring(gems_api.prices.obsidian[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_wood_button" ] then
|
if pressed[gem_name.. "_wood_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.wood[1]), "default:wood " .. tostring(gems.prices.wood[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.wood[1]), "default:wood " .. tostring(gems_api.prices.wood[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_tree_button" ] then
|
if pressed[gem_name.. "_tree_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.tree[1]), "default:tree " .. tostring(gems.prices.tree[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.tree[1]), "default:tree " .. tostring(gems_api.prices.tree[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_glass_button" ] then
|
if pressed[gem_name.. "_glass_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.glass[1]), "default:glass " .. tostring(gems.prices.glass[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.glass[1]), "default:glass " .. tostring(gems_api.prices.glass[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_obsidian_glass_button" ] then
|
if pressed[gem_name.. "_obsidian_glass_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.obsidian_glass[1]), "default:obsidian_glass " .. tostring(gems.prices.obsidian_glass[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.obsidian_glass[1]), "default:obsidian_glass " .. tostring(gems_api.prices.obsidian_glass[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if formname == "gems:" .. gem_name .. "_shop_food_menu" then
|
if formname == "gems_api:" .. gem_name .. "_shop_food_menu" then
|
||||||
|
|
||||||
if pressed[gem_name.. "_apple_button" ] then
|
if pressed[gem_name.. "_apple_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.apple[1]), "default:apple " .. tostring(gems.prices.apple[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.apple[1]), "default:apple " .. tostring(gems_api.prices.apple[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -510,23 +510,23 @@ minetest.register_on_player_receive_fields(function(player, formname, pressed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--TODO: add special and bows, and armor
|
--TODO: add special and bows, and armor
|
||||||
if formname == "gems:" .. gem_name .. "_shop_special_menu" then
|
if formname == "gems_api:" .. gem_name .. "_shop_special_menu" then
|
||||||
|
|
||||||
if pressed[gem_name.. "_reveal_button" ] then
|
if pressed[gem_name.. "_reveal_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.revealer[1]), "gems:"..gem_name.."_reveal " .. tostring(gems.prices.revealer[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.revealer[1]), "gems_api:"..gem_name.."_reveal " .. tostring(gems_api.prices.revealer[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_enderpearl_button" ] then
|
if pressed[gem_name.. "_enderpearl_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.enderpearl[1]), "enderpearl:ender_pearl " .. tostring(gems.prices.enderpearl[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.enderpearl[1]), "enderpearl:ender_pearl " .. tostring(gems_api.prices.enderpearl[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if pressed[gem_name.. "_torch_button" ] then
|
if pressed[gem_name.. "_torch_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.torch[1]), "default:torch " .. tostring(gems.prices.torch[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.torch[1]), "default:torch " .. tostring(gems_api.prices.torch[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
-- torch, name = <gem_name>_torch_button
|
-- torch, name = <gem_name>_torch_button
|
||||||
@ -535,28 +535,28 @@ minetest.register_on_player_receive_fields(function(player, formname, pressed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if formname == "gems:" .. gem_name .. "_shop_armor_menu" then
|
if formname == "gems_api:" .. gem_name .. "_shop_armor_menu" then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if pressed[gem_name.. "_steel_helmet_button" ] then
|
if pressed[gem_name.. "_steel_helmet_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.steel_helmet[1]), "3d_armor:helmet_steel " .. tostring(gems.prices.steel_helmet[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.steel_helmet[1]), "3d_armor:helmet_steel " .. tostring(gems_api.prices.steel_helmet[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
if pressed[gem_name.. "_steel_leggings_button" ] then
|
if pressed[gem_name.. "_steel_leggings_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.steel_leggings[1]), "3d_armor:leggings_steel " .. tostring(gems.prices.steel_leggings[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.steel_leggings[1]), "3d_armor:leggings_steel " .. tostring(gems_api.prices.steel_leggings[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
if pressed[gem_name.. "_steel_chestplate_button" ] then
|
if pressed[gem_name.. "_steel_chestplate_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.steel_chestplate[1]), "3d_armor:chestplate_steel " .. tostring(gems.prices.steel_chestplate[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.steel_chestplate[1]), "3d_armor:chestplate_steel " .. tostring(gems_api.prices.steel_chestplate[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
if pressed[gem_name.. "_steel_boots_button" ] then
|
if pressed[gem_name.. "_steel_boots_button" ] then
|
||||||
|
|
||||||
gems.shop( player , "gems:".. gem_name .. " " .. tostring(gems.prices.steel_boots[1]), "3d_armor:boots_steel " .. tostring(gems.prices.steel_boots[2]))
|
gems_api.shop( player , "gems_api:".. gem_name .. " " .. tostring(gems_api.prices.steel_boots[1]), "3d_armor:boots_steel " .. tostring(gems_api.prices.steel_boots[2]))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 731 B After Width: | Height: | Size: 731 B |
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 749 B |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 677 B |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 752 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
Before Width: | Height: | Size: 771 B After Width: | Height: | Size: 771 B |
Before Width: | Height: | Size: 775 B After Width: | Height: | Size: 775 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 756 B After Width: | Height: | Size: 756 B |
Before Width: | Height: | Size: 750 B After Width: | Height: | Size: 750 B |
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 758 B |
Before Width: | Height: | Size: 183 B After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 317 B |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 702 B |
Before Width: | Height: | Size: 664 B After Width: | Height: | Size: 664 B |
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 715 B |
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 168 B |
@ -4,12 +4,11 @@ shield textures modified by MisterE, Copyright (C) 2017-2019 davidthecreator - C
|
|||||||
|
|
||||||
thx to elceejo for bugfixes and code snippets
|
thx to elceejo for bugfixes and code snippets
|
||||||
|
|
||||||
Code MIT (C) MisterE <MisterE@ircnow.org>, debiankaios
|
chatcmdbuilder Copyright (c) 2016-21 rubenwardy
|
||||||
|
Other Code MIT (C) MisterE <mistere123.coding@gmail.com>, debiankaios
|
||||||
|
|
||||||
shops formspecs modified by MisterE from mesewars (gems.shop in api.lua), Copyright (c) 2019-date, Lejo <Lejo_1@web.de>, MIT
|
|
||||||
|
|
||||||
|
|
||||||
|
shops formspecs modified by MisterE from mesewars (gems_api.shop in api.lua), Copyright (c) 2019-date, Lejo <Lejo_1@web.de>, MIT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|