helicopter/init.lua

68 lines
1.8 KiB
Lua
Raw Normal View History

2019-09-17 14:47:34 -07:00
--
-- constants
--
2020-05-10 12:29:06 -07:00
helicopter = {}
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 ={
2020-04-29 10:40:04 -07:00
black='#2b2b2b',
blue='#0063b0',
brown='#8c5922',
2020-05-01 06:37:16 -07:00
cyan='#07B6BC',
2020-04-29 10:40:04 -07:00
dark_green='#567a42',
dark_grey='#6d6d6d',
green='#4ee34c',
grey='#9f9f9f',
magenta='#ff0098',
orange='#ff8b0e',
pink='#ff62c6',
red='#dc1818',
violet='#a437ff',
2020-04-29 09:05:05 -07:00
white='#FFFFFF',
2020-04-29 10:40:04 -07:00
yellow='#ffe400',
2020-04-29 09:05:05 -07:00
}
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")
2020-04-28 11:48:09 -07:00
2020-05-10 12:29:06 -07:00
helicopter.helicopter_last_time_command = 0
2020-04-28 11:48:09 -07:00
2014-03-24 01:42:44 -07:00
--
2019-09-16 13:42:31 -07:00
-- helpers and co.
2014-03-24 01:42:44 -07:00
--
2019-09-16 13:42:31 -07:00
if not minetest.global_exists("matrix3") then
dofile(minetest.get_modpath("nss_helicopter") .. DIR_DELIM .. "matrix.lua")
2014-03-24 01:42:44 -07:00
end
helicopter.creative = minetest.global_exists("creative")
2019-09-17 14:47:34 -07:00
2020-05-10 12:29:06 -07:00
function helicopter.check_is_under_water(obj)
2020-04-20 07:20:57 -07:00
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
2019-09-16 13:42:31 -07:00
2019-09-17 14:47:34 -07:00