added noob mode
This commit is contained in:
parent
f7fcd544cf
commit
511a972d55
|
@ -239,7 +239,7 @@ minetest.register_entity("automobiles_buggy:buggy", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.45, -0.1, 0.1, 1, 0.1},
|
||||
selectionbox = {-1.5, 0.0, -1.5, 1.5, 2, 1.5},
|
||||
stepheight = 0.7,
|
||||
stepheight = 0.7 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_buggy_body.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
|
@ -216,7 +216,7 @@ minetest.register_entity("automobiles_catrelle:catrelle", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.4, -0.1, 0.1, 1.8, 0.1},
|
||||
selectionbox = {-2.0, 0.0, -2.0, 2.0, 2, 2.0},
|
||||
stepheight = 0.65,
|
||||
stepheight = 0.65 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_catrelle_body.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
|
@ -247,7 +247,7 @@ minetest.register_entity("automobiles_coupe:coupe", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.2, -0.1, 0.1, 1, 0.1},
|
||||
selectionbox = {-1.5, 0.0, -1.5, 1.5, 2, 1.5},
|
||||
stepheight = 0.65,
|
||||
stepheight = 0.65 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_coupe_body.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
|
@ -356,7 +356,7 @@ minetest.register_entity("automobiles_delorean:delorean", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.2, -0.1, 0.1, 1, 0.1},
|
||||
selectionbox = {-1.5, 0.0, -1.5, 1.5, 2, 1.5},
|
||||
stepheight = 0.65,
|
||||
stepheight = 0.65 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_delorean_body.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
|
@ -141,6 +141,7 @@ function automobiles_lib.eval_interception(initial_pos, end_pos)
|
|||
if pos then
|
||||
local nodename = minetest.get_node(thing.under).name
|
||||
local drawtype = get_nodedef_field(nodename, "drawtype")
|
||||
|
||||
if drawtype ~= "plantlike" then
|
||||
if initial_pos.y >= pos.y then
|
||||
ret_y = pos.y
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
automobiles_lib = {}
|
||||
|
||||
local storage = minetest.get_mod_storage()
|
||||
|
||||
automobiles_lib.fuel = {['biofuel:biofuel'] = 1,['biofuel:bottle_fuel'] = 1,
|
||||
['biofuel:phial_fuel'] = 0.25, ['biofuel:fuel_can'] = 10,
|
||||
['airutils:biofuel'] = 1,}
|
||||
|
@ -10,6 +12,16 @@ automobiles_lib.fuel = {['biofuel:biofuel'] = 1,['biofuel:bottle_fuel'] = 1,
|
|||
automobiles_lib.gravity = 9.8
|
||||
automobiles_lib.is_creative = minetest.settings:get_bool("creative_mode", false)
|
||||
|
||||
|
||||
local load_noob_mode = storage:get_int("noob_mode")
|
||||
automobiles_lib.noob_mode = false
|
||||
automobiles_lib.extra_stepheight = 0
|
||||
-- 1 == true ---- 2 == false
|
||||
if load_noob_mode == 1 then
|
||||
automobiles_lib.load_noob_mode = true
|
||||
automobiles_lib.extra_stepheight = 1
|
||||
end
|
||||
|
||||
--cars colors
|
||||
automobiles_lib.colors ={
|
||||
black='#2b2b2b',
|
||||
|
@ -636,3 +648,25 @@ minetest.register_chatcommand("transfer_vehicle", {
|
|||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("noobfy_the_vehicles", {
|
||||
params = "<true/false>",
|
||||
description = "Enable/disable the NOOB mode for the vehicles",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
local command = param
|
||||
|
||||
if command == "false" then
|
||||
automobiles_lib.noob_mode = false
|
||||
automobiles_lib.extra_stepheight = 0
|
||||
minetest.chat_send_player(name, ">>> Noob mode is disabled - A restart is required to changes take full effect")
|
||||
else
|
||||
automobiles_lib.noob_mode = true
|
||||
automobiles_lib.extra_stepheight = 1
|
||||
minetest.chat_send_player(name, ">>> Noob mode is enabled - A restart is required to changes take full effect")
|
||||
end
|
||||
local save = 2
|
||||
if automobiles_lib.noob_mode == true then save = 1 end
|
||||
storage:set_int("noob_mode", save)
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -98,7 +98,7 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.4, -0.1, 0.1, 1, 0.1},
|
||||
selectionbox = {-1, 1, -1, 1, -1, 1},
|
||||
stepheight = 0.8,
|
||||
stepheight = 0.8 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_motorcycle_body.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
|
@ -215,7 +215,7 @@ minetest.register_entity("automobiles_roadster:roadster", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.5, -0.1, 0.1, 1, 0.1},
|
||||
selectionbox = {-1.5, 0.0, -1.5, 1.5, 2, 1.5},
|
||||
stepheight = 0.6,
|
||||
stepheight = 0.6 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_roadster.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
|
@ -297,7 +297,7 @@ minetest.register_entity("automobiles_trans_am:trans_am", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.2, -0.1, 0.1, 1.8, 0.1},
|
||||
selectionbox = {-2.0, 0.0, -2.0, 2.0, 2, 2.0},
|
||||
stepheight = 0.65,
|
||||
stepheight = 0.65 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_trans_am_body.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
|
@ -98,7 +98,7 @@ minetest.register_entity("automobiles_vespa:vespa", {
|
|||
collide_with_objects = true,
|
||||
collisionbox = {-0.1, -0.24, -0.1, 0.1, 1, 0.1},
|
||||
selectionbox = {-1, 1, -1, 1, -1, 1},
|
||||
stepheight = 0.8,
|
||||
stepheight = 0.8 + automobiles_lib.extra_stepheight,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_vespa_body.b3d",
|
||||
--use_texture_alpha = true,
|
||||
|
|
Loading…
Reference in New Issue