aboutsummaryrefslogtreecommitdiff
path: root/advtrains/debugitems.lua
blob: e672308c5df28d3730201a3658207390c4a0f485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35</*
Part of Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2013 Ciaran Gultnieks <ciaran@ciarang.com>
Copyright (C) 2013 RealBadAngel, Maciej Kasatkin <mk@realbadangel.pl>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the abominetest.register_tool("advtrains:tunnelborer",
{
	description = "tunnelborer",
	groups = {cracky=1}, -- key=name, value=rating; rating=1..3.
	inventory_image = "drwho_screwdriver.png",
	wield_image = "drwho_screwdriver.png",
	stack_max = 1,
	range = 7.0,
		
	on_place = function(itemstack, placer, pointed_thing)
	
	end,
	--[[
	^ Shall place item and return the leftover itemstack
	^ default: minetest.item_place ]]
	on_use = function(itemstack, user, pointed_thing)
		if pointed_thing.type=="node" then
			for x=-1,1 do
				for y=-1,1 do
					for z=-1,1 do
						minetest.remove_node(vector.add(pointed_thing.under, {x=x, y=y, zbool pausesGame() { return true; }
};

#endif

opt">{ params = "angledeg conn1 conn2", description = "", func = function(name, param) local angledegs, conn1s, conn2s = string.match(param, "^(%S+)%s(%S+)%s(%S+)$") if angledegs and conn1s and conn2s then local angledeg, conn1, conn2 = angledegs+0,conn1s+0,conn2s+0 local yaw = angledeg*math.pi/180 local yaw1 = advtrains.dir_to_angle(conn1) local yaw2 = advtrains.dir_to_angle(conn2) local adiff1 = advtrains.minAngleDiffRad(yaw, yaw1) local adiff2 = advtrains.minAngleDiffRad(yaw, yaw2) atdebug("yaw1",atfloor(yaw1*180/math.pi)) atdebug("yaw2",atfloor(yaw2*180/math.pi)) atdebug("dif1",atfloor(adiff1*180/math.pi)) atdebug("dif2",atfloor(adiff2*180/math.pi)) minetest.chat_send_all(advtrains.yawToAnyDir(yaw)) return true, advtrains.yawToDirection(yaw, conn1, conn2) end end, })