rob_opr_base = {}
rob_opr_base.act_menu = {}
rob_opr_base.config = {}
rob_opr_base.anger = 51
rob_opr_base.alert = 1
rob_opr_base.win = false

dofile(minetest.get_modpath('rob_opr_base')..'/action_menu.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/alert_level.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/boss_anger.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/ceiling_support.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/chat_replies.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/computer_1.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/computer_2.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/computer_3.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/configurator.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/doors.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/drones.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/end_screens.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/intro.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/effects.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/lights.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/meshnodes.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/pathways.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/program_cards.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/robot_1.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/robot_2.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/static_nodes.lua')
dofile(minetest.get_modpath('rob_opr_base')..'/vent.lua')

minetest.register_item(':', {
   type = 'none',
   wield_image = 'rob_opr_base_wieldhand.png',
   wield_scale = {x=1,y=1,z=2.5},
   range = 3,
   tool_capabilities = {
      full_punch_interval = 0.9,
      max_drop_level = 0,
      damage_groups = {fleshy=1},
   }
})

minetest.register_on_joinplayer(function(player)
   --player:set_inventory_formspec('')
      player:set_properties({
         eye_height = .65,
         collisionbox = {-0.3, 0.0, -0.3, 0.3, .75, 0.3},
      })
      player:set_physics_override({speed=.25})
      player:set_pos({x=-5, y=8, z=-6})
      player:hud_set_flags({minimap=false})
      player:set_hp(20)
end)

local function player_heal()
   for _, player in pairs(minetest.get_connected_players()) do
      local hp = player:get_hp()
      local breath = player:get_breath()
      local max_hp = player:get_properties().hp_max
      if hp > 0 and hp < max_hp and breath > 0 then
         player:set_hp(hp + 1)
      end
      local physics = player:get_physics_override()
      local old_speed = physics.speed
      player:set_physics_override({speed=old_speed + .2})
   end
   minetest.after(60, player_heal)
end
minetest.after(60, player_heal)
