init.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --
  2. -- constants
  3. --
  4. helicopter = {}
  5. helicopter.friction_air_quadratic = 0.01
  6. helicopter.friction_air_constant = 0.2
  7. helicopter.friction_land_quadratic = 1
  8. helicopter.friction_land_constant = 2
  9. helicopter.friction_water_quadratic = 0.1
  10. helicopter.friction_water_constant = 1
  11. helicopter.colors ={
  12. black='#2b2b2b',
  13. blue='#0063b0',
  14. brown='#8c5922',
  15. cyan='#07B6BC',
  16. dark_green='#567a42',
  17. dark_grey='#6d6d6d',
  18. green='#4ee34c',
  19. grey='#9f9f9f',
  20. magenta='#ff0098',
  21. orange='#ff8b0e',
  22. pink='#ff62c6',
  23. red='#dc1818',
  24. violet='#a437ff',
  25. white='#FFFFFF',
  26. yellow='#ffe400',
  27. }
  28. --dofile(minetest.get_modpath(minetest.get_current_modname()) .. DIR_DELIM .. "heli_hud.lua")
  29. dofile(minetest.get_modpath("helicopter") .. DIR_DELIM .. "heli_hud.lua")
  30. dofile(minetest.get_modpath("helicopter") .. DIR_DELIM .. "heli_utilities.lua")
  31. dofile(minetest.get_modpath("helicopter") .. DIR_DELIM .. "heli_entities.lua")
  32. dofile(minetest.get_modpath("helicopter") .. DIR_DELIM .. "heli_crafts.lua")
  33. dofile(minetest.get_modpath("helicopter") .. DIR_DELIM .. "heli_control.lua")
  34. dofile(minetest.get_modpath("helicopter") .. DIR_DELIM .. "heli_fuel_management.lua")
  35. helicopter.helicopter_last_time_command = 0
  36. --
  37. -- helpers and co.
  38. --
  39. if not minetest.global_exists("matrix3") then
  40. dofile(minetest.get_modpath("helicopter") .. DIR_DELIM .. "matrix.lua")
  41. end
  42. local creative_exists = minetest.global_exists("creative")
  43. function helicopter.check_is_under_water(obj)
  44. local pos_up = obj:get_pos()
  45. pos_up.y = pos_up.y + 0.1
  46. local node_up = minetest.get_node(pos_up).name
  47. local nodedef = minetest.registered_nodes[node_up]
  48. local liquid_up = nodedef.liquidtype ~= "none"
  49. return liquid_up
  50. end