forked from Desour/helicopter
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinit.lua
More file actions
executable file
·79 lines (58 loc) · 2 KB
/
init.lua
File metadata and controls
executable file
·79 lines (58 loc) · 2 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--
-- constants
--
helicopter = {}
helicopter.S = nil
if(minetest.get_translator ~= nil) then
helicopter.S = minetest.get_translator(minetest.get_current_modname())
else
helicopter.S = function ( s ) return s end
end
local S = helicopter.S
helicopter.friction_air_quadratic = 0.01
helicopter.friction_air_constant = 0.2
helicopter.friction_land_quadratic = 1
helicopter.friction_land_constant = 2
helicopter.friction_water_quadratic = 0.1
helicopter.friction_water_constant = 1
helicopter.colors ={
black='#2b2b2b',
blue='#0063b0',
brown='#8c5922',
cyan='#07B6BC',
dark_green='#567a42',
dark_grey='#6d6d6d',
green='#4ee34c',
grey='#9f9f9f',
magenta='#ff0098',
orange='#ff8b0e',
pink='#ff62c6',
red='#dc1818',
violet='#a437ff',
white='#FFFFFF',
yellow='#ffe400',
}
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "settings.lua")
--dofile(minetest.get_modpath(minetest.get_current_modname()) .. DIR_DELIM .. "heli_hud.lua")
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "heli_hud.lua")
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "heli_utilities.lua")
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "heli_entities.lua")
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "heli_crafts.lua")
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "heli_control.lua")
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "heli_fuel_management.lua")
helicopter.helicopter_last_time_command = 0
--
-- helpers and co.
--
if not minetest.global_exists("matrix3") then
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "matrix.lua")
end
helicopter.creative = minetest.global_exists("creative")
function helicopter.check_is_under_water(obj)
local pos_up = obj:get_pos()
pos_up.y = pos_up.y + 0.1
local node_up = minetest.get_node(pos_up).name
local nodedef = minetest.registered_nodes[node_up]
local liquid_up = nodedef.liquidtype ~= "none"
return liquid_up
end