removed mobkit dependency
parent
6cc5b2168a
commit
c2138d2cef
2
mod.conf
2
mod.conf
|
@ -1,5 +1,5 @@
|
|||
name = supercub
|
||||
depends = mobkit,default,biofuel,airutils
|
||||
depends = default,biofuel,airutils
|
||||
author = APercy
|
||||
description = Adds a craftable Super Cub
|
||||
title = Super Cub
|
||||
|
|
|
@ -38,6 +38,6 @@ function supercub.physics(self)
|
|||
self.object:set_velocity(vnew)
|
||||
end
|
||||
|
||||
self.object:set_acceleration({x=0,y=mobkit.gravity,z=0})
|
||||
self.object:set_acceleration({x=0,y=airutils.gravity,z=0})
|
||||
|
||||
end
|
||||
|
|
|
@ -194,7 +194,7 @@ minetest.register_entity("supercub:supercub", {
|
|||
end,
|
||||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
mobkit.actfunc(self, staticdata, dtime_s)
|
||||
airutils.actfunc(self, staticdata, dtime_s)
|
||||
if staticdata ~= "" and staticdata ~= nil then
|
||||
local data = minetest.deserialize(staticdata) or {}
|
||||
self._energy = data.stored_energy
|
||||
|
@ -268,11 +268,11 @@ minetest.register_entity("supercub:supercub", {
|
|||
end
|
||||
end,
|
||||
|
||||
--on_step = mobkit.stepfunc,
|
||||
--on_step = airutils.stepfunc,
|
||||
on_step = function(self,dtime,colinfo)
|
||||
self.dtime = math.min(dtime,0.2)
|
||||
self.colinfo = colinfo
|
||||
self.height = mobkit.get_box_height(self)
|
||||
self.height = airutils.get_box_height(self)
|
||||
|
||||
-- physics comes first
|
||||
local vel = self.object:get_velocity()
|
||||
|
@ -355,8 +355,8 @@ minetest.register_entity("supercub:supercub", {
|
|||
if airutils.set_paint(self, puncher, itmstck, "supercub_painting.png") == false then
|
||||
if not self.driver and toolcaps and toolcaps.damage_groups
|
||||
and toolcaps.damage_groups.fleshy and item_name ~= airutils.fuel then
|
||||
--mobkit.hurt(self,toolcaps.damage_groups.fleshy - 1)
|
||||
--mobkit.make_sound(self,'hit')
|
||||
--airutils.hurt(self,toolcaps.damage_groups.fleshy - 1)
|
||||
--airutils.make_sound(self,'hit')
|
||||
self.hp_max = self.hp_max - 10
|
||||
minetest.sound_play("supercub_collision", {
|
||||
object = self.object,
|
||||
|
|
|
@ -198,7 +198,7 @@ function supercub.testImpact(self, velocity, position)
|
|||
if self._last_vel == nil then return end
|
||||
--lets calculate the vertical speed, to avoid the bug on colliding on floor with hard lag
|
||||
if abs(velocity.y - self._last_vel.y) > 2 then
|
||||
local noded = mobkit.nodeatpos(mobkit.pos_shift(p,{y=-2.8}))
|
||||
local noded = airutils.nodeatpos(airutils.pos_shift(p,{y=-2.8}))
|
||||
if (noded and noded.drawtype ~= 'airlike') then
|
||||
collision = true
|
||||
else
|
||||
|
@ -217,7 +217,7 @@ function supercub.testImpact(self, velocity, position)
|
|||
end
|
||||
|
||||
if impact > 1.2 and self._longit_speed > 2 then
|
||||
local noded = mobkit.nodeatpos(mobkit.pos_shift(p,{y=-2.8}))
|
||||
local noded = airutils.nodeatpos(airutils.pos_shift(p,{y=-2.8}))
|
||||
if (noded and noded.drawtype ~= 'airlike') then
|
||||
minetest.sound_play("supercub_touch", {
|
||||
--to_player = self.driver_name,
|
||||
|
@ -396,7 +396,7 @@ function supercub.flightstep(self)
|
|||
if newroll > 360 then newroll = newroll - 360 end
|
||||
if newroll < -360 then newroll = newroll + 360 end
|
||||
|
||||
local hull_direction = mobkit.rot_to_dir(rotation) --minetest.yaw_to_dir(yaw)
|
||||
local hull_direction = airutils.rot_to_dir(rotation) --minetest.yaw_to_dir(yaw)
|
||||
local nhdir = {x=hull_direction.z,y=0,z=-hull_direction.x} -- lateral unit vector
|
||||
|
||||
local longit_speed = vector.dot(velocity,hull_direction)
|
||||
|
@ -410,7 +410,7 @@ function supercub.flightstep(self)
|
|||
local accel = vector.add(longit_drag,later_drag)
|
||||
local stop = false
|
||||
|
||||
local node_bellow = mobkit.nodeatpos(mobkit.pos_shift(curr_pos,{y=-1.3}))
|
||||
local node_bellow = airutils.nodeatpos(airutils.pos_shift(curr_pos,{y=-1.3}))
|
||||
local is_flying = true
|
||||
if self.colinfo then
|
||||
is_flying = not self.colinfo.touching_ground
|
||||
|
@ -565,7 +565,7 @@ function supercub.flightstep(self)
|
|||
--[[if player then
|
||||
supercub.attach(self, player, self._instruction_mode)
|
||||
end]]--
|
||||
mobkit.set_acceleration(self.object, new_accel)
|
||||
airutils.set_acceleration(self.object, new_accel)
|
||||
else
|
||||
if stop == true then
|
||||
self.object:set_acceleration({x=0,y=0,z=0})
|
||||
|
|
Loading…
Reference in New Issue