diff --git a/automobiles_beetle/entities.lua b/automobiles_beetle/entities.lua index 996d4ce..c21b11c 100755 --- a/automobiles_beetle/entities.lua +++ b/automobiles_beetle/entities.lua @@ -413,6 +413,7 @@ auto_beetle.car_properties1 = { _max_acc_factor = 5, _max_speed = 14, _min_later_speed = 3, + _consumption_divisor = 60000, get_staticdata = automobiles_lib.get_staticdata, diff --git a/automobiles_buggy/buggy_entities.lua b/automobiles_buggy/buggy_entities.lua index ae5848e..4cddd13 100755 --- a/automobiles_buggy/buggy_entities.lua +++ b/automobiles_buggy/buggy_entities.lua @@ -262,6 +262,7 @@ minetest.register_entity("automobiles_buggy:buggy", { _max_acc_factor = 5, _max_speed = 15, _min_later_speed = 4.0, + _consumption_divisor = 60000, get_staticdata = automobiles_lib.get_staticdata, diff --git a/automobiles_catrelle/entities.lua b/automobiles_catrelle/entities.lua index 8e196c2..4a6dbcc 100755 --- a/automobiles_catrelle/entities.lua +++ b/automobiles_catrelle/entities.lua @@ -301,6 +301,7 @@ catrelle.car_properties1 = { _max_acc_factor = 5, _max_speed = 14, _min_later_speed = 3, + _consumption_divisor = 50000, get_staticdata = automobiles_lib.get_staticdata, diff --git a/automobiles_coupe/coupe_entities.lua b/automobiles_coupe/coupe_entities.lua index 1422a12..b1144cd 100755 --- a/automobiles_coupe/coupe_entities.lua +++ b/automobiles_coupe/coupe_entities.lua @@ -290,6 +290,7 @@ minetest.register_entity("automobiles_coupe:coupe", { _max_acc_factor = 8, _max_speed = 22, _min_later_speed = 2, + _consumption_divisor = 50000, get_staticdata = automobiles_lib.get_staticdata, diff --git a/automobiles_delorean/entities.lua b/automobiles_delorean/entities.lua index a2b2c55..6fce77b 100755 --- a/automobiles_delorean/entities.lua +++ b/automobiles_delorean/entities.lua @@ -441,6 +441,7 @@ minetest.register_entity("automobiles_delorean:delorean", { _max_acc_factor = 8.0, _max_speed = 30, _min_later_speed = 4.5, + _consumption_divisor = 40000, _wheel_compensation = 0.8, diff --git a/automobiles_lib/entities.lua b/automobiles_lib/entities.lua index e9d4aa9..4e5d86c 100644 --- a/automobiles_lib/entities.lua +++ b/automobiles_lib/entities.lua @@ -392,8 +392,14 @@ function automobiles_lib.on_step(self, dtime) dynamic_later_drag = dynamic_later_drag/(longit_speed*2) end - local later_drag = vector.multiply(nhdir,later_speed* + local later_drag = 0 + if self._is_motorcycle == true then + later_drag = vector.multiply(nhdir,later_speed* + later_speed*self._LATER_DRAG_FACTOR*-1*automobiles_lib.sign(later_speed)) + else + later_drag = vector.multiply(nhdir,later_speed* later_speed*dynamic_later_drag*-1*automobiles_lib.sign(later_speed)) + end local accel = vector.add(longit_drag,later_drag) local stop = nil @@ -653,7 +659,11 @@ function automobiles_lib.on_step(self, dtime) local acceleration = automobiles_lib.get_hipotenuse_value(accel, zero_reference) --minetest.chat_send_all(acceleration) if automobiles_lib.is_drift_game == false then - local consumed_power = acceleration/40000 + local consumption = 40000 + if self._consumption_divisor then + consumption = self._consumption_divisor + end + local consumed_power = acceleration/consumption self._energy = self._energy - consumed_power; else self._energy = 5 diff --git a/automobiles_motorcycle/motorcycle_entities.lua b/automobiles_motorcycle/motorcycle_entities.lua index 7a3957f..2669384 100755 --- a/automobiles_motorcycle/motorcycle_entities.lua +++ b/automobiles_motorcycle/motorcycle_entities.lua @@ -186,12 +186,13 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", { _rear_lights = 'automobiles_motorcycle:r_lights', _LONGIT_DRAG_FACTOR = 0.14*0.14, - _LATER_DRAG_FACTOR = 200.0, + _LATER_DRAG_FACTOR = 25.0, _max_acc_factor = 8, _max_speed = 20, _min_later_speed = 5, _have_transmission = false, _is_motorcycle = true, + _consumption_divisor = 100000, _attach = motorcycle.attach_driver_stand, _dettach = motorcycle.dettach_driver_stand, diff --git a/automobiles_roadster/roadster_entities.lua b/automobiles_roadster/roadster_entities.lua index 93c487b..5dbf1bb 100755 --- a/automobiles_roadster/roadster_entities.lua +++ b/automobiles_roadster/roadster_entities.lua @@ -293,7 +293,8 @@ minetest.register_entity("automobiles_roadster:roadster", { _LATER_DRAG_FACTOR = 20.0, _max_acc_factor = 5, _max_speed = 12, - _min_later_speed = 2, + _min_later_speed = 5, + _consumption_divisor = 60000, get_staticdata = automobiles_lib.get_staticdata, diff --git a/automobiles_trans_am/entities.lua b/automobiles_trans_am/entities.lua index 1393bd8..035b72d 100755 --- a/automobiles_trans_am/entities.lua +++ b/automobiles_trans_am/entities.lua @@ -360,6 +360,7 @@ minetest.register_entity("automobiles_trans_am:trans_am", { _max_acc_factor = 12, _max_speed = 40, _min_later_speed = 4.5, + _consumption_divisor = 40000, _wheel_compensation = 0.8, diff --git a/automobiles_vespa/vespa_entities.lua b/automobiles_vespa/vespa_entities.lua index dfd035b..47ea8b1 100755 --- a/automobiles_vespa/vespa_entities.lua +++ b/automobiles_vespa/vespa_entities.lua @@ -180,12 +180,13 @@ minetest.register_entity("automobiles_vespa:vespa", { _rear_lights = 'automobiles_vespa:r_lights', _LONGIT_DRAG_FACTOR = 0.15*0.15, - _LATER_DRAG_FACTOR = 200.0, + _LATER_DRAG_FACTOR = 25.0, _max_acc_factor = 6, - _max_speed = 15, + _max_speed = 14, _min_later_speed = 5, _have_transmission = false, _is_motorcycle = true, + _consumption_divisor = 150000, _attach = vespa.attach_driver_stand, _dettach = vespa.dettach_driver_stand,