Merge pull request #37 from BadToad2000/shift_click

Shift click
BadToad2000/master
Brandon 2016-09-21 16:30:16 -05:00 committed by GitHub
commit 1325d7c5a3
16 changed files with 79 additions and 45 deletions

View File

@ -63,16 +63,18 @@ local function adventuretest_dignode(pos, node, digger)
if digger ~= nil and digger ~= "" then
local name= digger:get_player_name()
-- EXPERIENCE
if minetest.registered_nodes[node.name] ~= nil then
if minetest.registered_nodes[node.name]["skill"] ~= nil then
default.drop_item(pos,"experience:1_exp")
skills.add_exp(name,5)
end
end
-- ENERGY
pd.increment(name,"energy",-0.05)
-- EXPERIENCE
if minetest.registered_nodes[node.name] ~= nil then
if minetest.registered_nodes[node.name]["skill"] ~= nil then
default.drop_item(pos,"experience:1_exp")
skills.add_exp(name,5)
end
end
pd.increment(name,STAT_DUG,1)
local dug = pd.get(name,STAT_DUG)
if dug % 100 == 0 then

View File

@ -79,7 +79,7 @@ function boat.on_rightclick(self, clicker)
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
self.object:setyaw(clicker:get_look_horizontal() - math.pi / 2)
end
end

View File

@ -255,7 +255,8 @@ function bones_on_dieplayer (player)
meta:set_string("formspec", "size[8,9;]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
"list[current_player;main;0,5;8,4;]"
.."listring[current_name;main]".."listring[current_player;main]")
meta:set_string("infotext", player:get_player_name().."'s fresh bones")
meta:set_string("owner", player:get_player_name())
meta:set_int("time", 0)

View File

@ -45,7 +45,9 @@ local cottages_anvil_formspec =
"label[0,-0.5;"..S("Anvil").."]"..
"label[0,3.0;"..S("Punch anvil with hammer to").."]"..
"label[0,3.3;"..S("repair tool in workpiece-slot.").."]"..
"list[current_player;main;0,4;8,4;]";
"list[current_player;main;0,4;8,4;]"
.."listring[current_player;main]".."listring[current_name;hammer]"
.."listring[current_player;main]".."listring[current_name;input]"
minetest.register_node("cottages:anvil", {

View File

@ -39,7 +39,10 @@ barrel.on_construct = function( pos )
"list[current_name;input;3,0.5;1,1;]"..
"label[5,3.3;"..S("Fill:").."]"..
"list[current_name;output;5,3.8;1,1;]"..
"list[current_player;main;0,5;8,4;]");
"list[current_player;main;0,5;8,4;]"
.."listring[current_name;output]".."listring[current_player;main]"
.."listring[current_name;input]".."listring[current_player;main]"
)
meta:set_string( 'liquid_type', '' ); -- which liquid is in the barrel?

View File

@ -5,11 +5,11 @@
-- * a bed seperated into foot and head reagion so that it can be placed manually; it has
-- no other functionality than decoration!
-- * a sleeping mat - mostly for NPC that cannot afford a bet yet
-- * bench - if you don't have 3dforniture:chair, then this is the next best thing
-- * bench - if you don't have 3dfurniture:chair, then this is the next best thing
-- * table - very simple one
-- * shelf - for stroring things; this one is 3d
-- * shelf - for storing things; this one is 3d
-- * stovepipe - so that the smoke from the furnace can get away
-- * washing place - put it over a water source and you can 'wash' yourshelf
-- * washing place - put it over a water source and you can 'wash' yourself
---------------------------------------------------------------------------------------
-- TODO: change the textures of the bed (make the clothing white, foot path not entirely covered with cloth)
@ -224,7 +224,8 @@ minetest.register_node("cottages:shelf", {
meta:set_string("formspec",
"size[8,8]"..
"list[current_name;main;0,0;8,3;]"..
"list[current_player;main;0,4;8,4;]")
"list[current_player;main;0,4;8,4;]"..
"listring[current_name;main]".."listring[current_player;main]")
meta:set_string("infotext", S("open storage shelf"))
local inv = meta:get_inventory();
inv:set_size("main", 24);

View File

@ -97,7 +97,10 @@ local cottages_formspec_treshing_floor =
"label[0,-0.5;"..S("Threshing floor").."]"..
"label[0,2.5;"..S("Punch threshing floor with a stick").."]"..
"label[0,3.0;"..S("to get straw and seeds from wheat.").."]"..
"list[current_player;main;0,4;8,4;]";
"list[current_player;main;0,4;8,4;]"
.."listring[current_name;straw]".."listring[current_player;main]"
.."listring[current_name;seeds]".."listring[current_player;main]"
.."listring[current_name;harvest]".."listring[current_player;main]"
minetest.register_node("cottages:threshing_floor", {
drawtype = "nodebox",
@ -352,7 +355,9 @@ local cottages_handmill_formspec = "size[8,8]"..
"label[0,-0.3;"..S("Mill").."]"..
"label[0,2.5;"..S("Punch this hand-driven mill").."]"..
"label[0,3.0;"..S("to convert wheat seeds into flour.").."]"..
"list[current_player;main;0,4;8,4;]";
"list[current_player;main;0,4;8,4;]"
.."listring[current_name;flour]".."listring[current_player;main]"
.."listring[current_name;seeds]".."listring[current_player;main]"
minetest.register_node("cottages:handmill", {
description = S("mill, powered by punching"),

View File

@ -815,14 +815,16 @@ minetest.register_node("default:sign_wall", {
default.chest_formspec =
"size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]"
"list[current_player;main;0,5;8,4;]"..
"listring[]"
function default.get_locked_chest_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec =
"size[8,9]"..
"list[nodemeta:".. spos .. ";main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]"
"list[current_player;main;0,5;8,4;]"..
"listring[]"
return formspec
end
@ -1028,6 +1030,9 @@ function default.get_furnace_active_formspec(pos, percent)
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]"
.."listring[current_name;dst]".."listring[current_player;main]"
.."listring[current_name;src]".."listring[current_player;main]"
.."listring[current_name;fuel]".."listring[current_player;main]"
return formspec
end
@ -1048,6 +1053,9 @@ default.furnace_inactive_formspec =
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]"
.."listring[current_name;dst]".."listring[current_player;main]"
.."listring[current_name;src]".."listring[current_player;main]"
.."listring[current_name;fuel]".."listring[current_player;main]"
minetest.register_node("default:furnace", {
description = "Furnace",

View File

@ -42,15 +42,15 @@ dofile(handle_schematics.modpath.."/replacements_get_table.lua")
-- uses build_chest.* namespace
-- a chest for spawning buildings manually
--dofile(handle_schematics.modpath.."/build_chest.lua")
dofile(handle_schematics.modpath.."/build_chest.lua")
-- makes the replacements from replacements_group.* available to the build chest
--dofile(handle_schematics.modpath.."/build_chest_handle_replacements.lua");
dofile(handle_schematics.modpath.."/build_chest_handle_replacements.lua");
-- creates 2d previews of the schematic from left/right/back/front/top
--dofile(handle_schematics.modpath.."/build_chest_preview_image.lua");
dofile(handle_schematics.modpath.."/build_chest_preview_image.lua");
-- reads a file and adds the files listed there as menu entries
--dofile(handle_schematics.modpath.."/build_chest_add_schems_from_file.lua");
dofile(handle_schematics.modpath.."/build_chest_add_schems_from_file.lua");
-- locate schematics through directories
--dofile(handle_schematics.modpath.."/build_chest_add_schems_by_directory.lua");
dofile(handle_schematics.modpath.."/build_chest_add_schems_by_directory.lua");
-- the main functionality of the mod;
-- provides the function handle_schematics.place_building_from_file

View File

@ -139,7 +139,7 @@ local magicmissle_spell = {
local dir = user:get_look_dir()
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
obj:setacceleration({x=dir.x*-3, y=-1, z=dir.z*-3})
obj:setyaw(user:get_look_yaw()+math.pi)
obj:setyaw(user:get_look_horizontal()+math.pi)
obj:get_luaentity().player = user
magic.update_magic(user,name)
else

View File

@ -128,7 +128,7 @@ mg_villages.map_of_world = function( pname )
end
-- code and arrows taken from mapp mod
local yaw = player:get_look_yaw()
local yaw = player:get_look_horizontal()
local rotate = 0;
if yaw ~= nil then
-- Find rotation and texture based on yaw.

View File

@ -44,8 +44,8 @@ minetest.is_protected = function(pos, name)
local is_houseowner = false;
for nr, p in pairs( mg_villages.all_villages[ village_id ].to_add_data.bpos ) do
trustedusers = p.can_edit
trustedUser = false
local trustedusers = p.can_edit
local trustedUser = false
if trustedusers ~= nil then
for _,trusted in pairs(trustedusers) do
if trusted == name then
@ -136,8 +136,10 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
return;
end
local owner = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner;
local btype = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].btype;
local village = mg_villages.all_villages[ village_id ];
local plot = village.to_add_data.bpos[ plot_nr ];
-- local owner = mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ].owner;
local btype = plot.btype;
local owner_name = plot.owner;
if( not( owner_name ) or owner_name == "" ) then
@ -160,8 +162,7 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
-- create the header
local formspec = "size[13,10]"..
"label[3.3,0.0;Plot No.: "..tostring( plot_nr )..", with "..tostring( mg_villages.BUILDINGS[ plot.btype ].scm ).."]"..
"label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..", which is "..tostring( distance ).." m away]"
.."label[7.3,0.4;from the village center]"..
"label[0.3,0.4;Located at:]" .."label[3.3,0.4;"..(minetest.pos_to_string( pos ) or '?')..", which is "..tostring( distance ).."m from the village center]"..
"label[0.3,0.8;Part of village:]" .."label[3.3,0.8;"..(village.name or "- name unknown -").."]"
.."label[7.3,0.8;located at "..(village_pos).."]"..
"label[0.3,1.2;Owned by:]" .."label[3.3,1.2;"..(owner_name).."]"..
@ -338,10 +339,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
local original_formspec = "size[8,3]"..
"button[7.0,0.0;1.0,0.5;info;Info]"..
"label[1.0,0.5;Plot No.: "..tostring( plot_nr ).."]"..
"label[2.5,0.5;Building:]"..
"label[3.5,0.5;"..tostring( mg_villages.BUILDINGS[btype].scm ).."]"..
"label[2.5,0.5;Building: "..tostring( mg_villages.BUILDINGS[btype].scm ).." ]"..
"field[20,20;0.1,0.1;pos2str;Pos;"..minetest.pos_to_string( pos ).."]";
local formspec = "";
local formspec = "";
local ifinhabit = "";
-- Get Price
@ -368,8 +368,9 @@ mg_villages.plotmarker_formspec = function( pos, formname, fields, player )
if (not(owner) or owner=='') then
formspec = original_formspec ..
"label[1,1;You can buy this plot for]"..
"label[3.8,1;"..tostring( price_stack:get_count() ).." x ]"..
--"label[1,1;You can buy this plot for]"..
--"label[3.8,1;"..tostring( price_stack:get_count() ).." x ]"..
"label[1,1;You can buy this plot for "..tostring( price_stack:get_count() ).." x ]"..
"item_image[4.3,0.8;1,1;"..( price_stack:get_name() ).."]"..
ifinhabit..
"button[2,2.5;1.5,0.5;buy;Buy plot]"..

View File

@ -320,7 +320,16 @@ function circular_saw.on_construct(pos)
"field[0.3,3.5;1,1;max_offered;" ..S("Max").. ":;${max_offered}]" ..
"button[1,3.2;1,1;Set;" ..S("Set").. "]" ..
"list[current_name;output;2.8,0;8,6;]" ..
"list[current_player;main;1.5,6.25;8,4;]")
"list[current_player;main;1.5,6.25;8,4;]"..
"listring[current_name;output]"..
"listring[current_player;main]"..
"listring[current_name;input]"..
"listring[current_player;main]"..
"listring[current_name;micro]"..
"listring[current_player;main]"..
"listring[current_name;recyle]"..
"listring[current_player;main]"
)
meta:set_int("anz", 0) -- No microblocks inside yet.
meta:set_string("max_offered", 99) -- How many items of this kind are offered by default?

View File

@ -21,7 +21,7 @@ local throwing_shoot_arrow = function(itemstack, player)
local dir = player:get_look_dir()
obj:setvelocity({x=dir.x*19, y=dir.y*19, z=dir.z*19})
obj:setacceleration({x=dir.x*-3, y=weapon_def.drop_rate, z=dir.z*-3})
obj:setyaw(player:get_look_yaw()+math.pi)
obj:setyaw(player:get_look_horizontal()+math.pi)
obj:get_luaentity().player = player
obj:get_luaentity().max_damage = obj:get_luaentity().max_damage + weapon_def.damage_modifier
minetest.sound_play("throwing_sound", {object=player})

View File

@ -14,7 +14,7 @@ function ts_doors.register_door(recipe, description, texture)
tiles = {{ name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base.png^[noalpha^[makealpha:0,255,0", backface_culling = true }},
description = description .. " Door",
inventory_image = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_inv.png^[noalpha^[makealpha:0,255,0",
groups = groups,
groups = door_groups,
recipe = {
{recipe, recipe},
{recipe, recipe},
@ -23,14 +23,14 @@ function ts_doors.register_door(recipe, description, texture)
})
groups.level = 2
door_groups.level = 2
doors.register("ts_door_locked_" .. recipe:gsub(":", "_"), {
tiles = {{ name = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":0,32=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. ":16,32=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_locked.png^[noalpha^[makealpha:0,255,0", backface_culling = true }},
description = description .. " Locked Door",
inventory_image = "[combine:32x38:0,0=" .. texture .. ":0,16=" .. texture .. ":16,0=" .. texture .. ":16,16=" .. texture .. "^[transformR270^[colorize:#fff:30^ts_doors_base_locked_inv.png^[noalpha^[makealpha:0,255,0",
protected = true,
groups = groups,
groups = door_groups,
sound_open = "doors_steel_door_open",
sound_close = "doors_steel_door_close",
recipe = {

View File

@ -49,6 +49,8 @@ local function inventory_set_formspec(player, size)
.."list[current_player;main;"..(fsize_x-msize_x)..","..(fsize_y-msize_y+1.25)..";"..msize_x..","..(msize_y - 1)..";"..msize_x.."]"
.."list[current_player;craft;"..(fsize_x-size-2)..",0;"..size..","..size..";]"
.."list[current_player;craftpreview;"..(fsize_x-1)..","..(size/2-0.5)..";1,1;]"
.."listring[current_player;main]"
.."listring[current_player;craft]"
for i = 0, msize_x - 1, 1 do
formspec = formspec.."image["..(fsize_x-msize_x + i)..","..(fsize_y-msize_y)..";1,1;gui_hb_bg.png]"
end
@ -56,8 +58,8 @@ local function inventory_set_formspec(player, size)
-- add the shortcut buttons
if size ~= 3 then
formspec = formspec .. "image_button[0.25,0.25;1,1;inventory_plus_zcg.png;zcg;]"
formspec = formspec .. "image_button[1.25,0.25;1,1;inventory_plus_skins.png;skins;]"
formspec = formspec .. "image_button[0.25,1.25;1,1;inventory_plus_armor.png;armor;]"
.. "image_button[1.25,0.25;1,1;inventory_plus_skins.png;skins;]"
.. "image_button[0.25,1.25;1,1;inventory_plus_armor.png;armor;]"
end
player:set_inventory_formspec(formspec)