removed mobkit dependency

master
Alexsandro Percy 2022-05-29 13:49:23 -03:00
parent 861c2b5cce
commit 02978510dc
4 changed files with 10 additions and 10 deletions

View File

@ -38,6 +38,6 @@ function demoiselle.physics(self)
self.object:set_velocity(vnew) self.object:set_velocity(vnew)
end end
self.object:set_acceleration({x=0,y=mobkit.gravity,z=0}) self.object:set_acceleration({x=0,y=airutils.gravity,z=0})
end end

View File

@ -119,7 +119,7 @@ minetest.register_entity("demoiselle:demoiselle", {
end, end,
on_activate = function(self, staticdata, dtime_s) 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 if staticdata ~= "" and staticdata ~= nil then
local data = minetest.deserialize(staticdata) or {} local data = minetest.deserialize(staticdata) or {}
self._energy = data.stored_energy self._energy = data.stored_energy
@ -147,11 +147,11 @@ minetest.register_entity("demoiselle:demoiselle", {
self.object:set_armor_groups({immortal=1}) self.object:set_armor_groups({immortal=1})
end, end,
--on_step = mobkit.stepfunc, --on_step = airutils.stepfunc,
on_step = function(self,dtime,colinfo) on_step = function(self,dtime,colinfo)
self.dtime = math.min(dtime,0.2) self.dtime = math.min(dtime,0.2)
self.colinfo = colinfo self.colinfo = colinfo
self.height = mobkit.get_box_height(self) self.height = airutils.get_box_height(self)
-- physics comes first -- physics comes first
local vel = self.object:get_velocity() local vel = self.object:get_velocity()
@ -230,8 +230,8 @@ minetest.register_entity("demoiselle:demoiselle", {
-- deal with painting or destroying -- deal with painting or destroying
if not self.driver and toolcaps and toolcaps.damage_groups if not self.driver and toolcaps and toolcaps.damage_groups
and toolcaps.damage_groups.fleshy and item_name ~= airutils.fuel then and toolcaps.damage_groups.fleshy and item_name ~= airutils.fuel then
--mobkit.hurt(self,toolcaps.damage_groups.fleshy - 1) --airutils.hurt(self,toolcaps.damage_groups.fleshy - 1)
--mobkit.make_sound(self,'hit') --airutils.make_sound(self,'hit')
self.hp_max = self.hp_max - 10 self.hp_max = self.hp_max - 10
minetest.sound_play("collision", { minetest.sound_play("collision", {
object = self.object, object = self.object,

View File

@ -138,7 +138,7 @@ function demoiselle.testImpact(self, velocity, position)
if self._last_vel == nil then return end if self._last_vel == nil then return end
--lets calculate the vertical speed, to avoid the bug on colliding on floor with hard lag --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 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 if (noded and noded.drawtype ~= 'airlike') then
collision = true collision = true
else else
@ -245,7 +245,7 @@ function demoiselle.flightstep(self)
if newroll > 360 then newroll = newroll - 360 end if newroll > 360 then newroll = newroll - 360 end
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 nhdir = {x=hull_direction.z,y=0,z=-hull_direction.x} -- lateral unit vector
local longit_speed = vector.dot(velocity,hull_direction) local longit_speed = vector.dot(velocity,hull_direction)
@ -259,7 +259,7 @@ function demoiselle.flightstep(self)
local accel = vector.add(longit_drag,later_drag) local accel = vector.add(longit_drag,later_drag)
local stop = false local stop = false
local node_bellow = mobkit.nodeatpos(mobkit.pos_shift(curr_pos,{y=-0.1})) local node_bellow = airutils.nodeatpos(airutils.pos_shift(curr_pos,{y=-0.1}))
local is_flying = true local is_flying = true
if self.colinfo then if self.colinfo then
is_flying = not self.colinfo.touching_ground is_flying = not self.colinfo.touching_ground

View File

@ -1,5 +1,5 @@
name = demoiselle name = demoiselle
depends = mobkit,default,biofuel,airutils depends = default,biofuel,airutils
author = APercy author = APercy
description = Adds a Demoiselle, an historical airplane description = Adds a Demoiselle, an historical airplane
title = Demoiselle title = Demoiselle