clean jelly

This commit is contained in:
Gundul 2022-07-10 14:11:33 +02:00
parent fbc6242e6a
commit 4fd152a81b

View File

@ -1,6 +1,3 @@
local function jellyfish_brain(self)
if not mobkit.is_alive(self) then
mobkit.clear_queue_high(self)
@ -10,7 +7,6 @@ local function jellyfish_brain(self)
end
if mobkit.timer(self,1) then
if not self.isinliquid then
--minetest.chat_send_all(dump(self.isinliquid))
mobkit.hurt(self,1)
end
local plyr = mobkit.get_nearby_player(self)
@ -25,15 +21,7 @@ local function jellyfish_brain(self)
end
end
---------------
-- the Entities
---------------
minetest.register_entity("water_life:jellyfish",{
-- common props
physical = true,
stepheight = 0.3,
collide_with_objects = false,
@ -44,21 +32,18 @@ minetest.register_entity("water_life:jellyfish",{
visual_size = {x = 1.5, y = 1.5}, --2.5
static_save = true,
makes_footstep_sound = false,
on_step = mobkit.stepfunc, -- required
on_activate = mobkit.actfunc, -- required
on_step = mobkit.stepfunc,
on_activate = mobkit.actfunc,
get_staticdata = mobkit.statfunc,
-- api props
springiness=0,
buoyancy = 1.0, -- portion of hitbox submerged
buoyancy = 1.0,
max_speed = 1,
jump_height = 0.5,
view_range = 4,
-- lung_capacity = 0, -- seconds
max_hp = 10,
timeout = 30,
glow = 4,
drops = {
--{name = "default:diamond", chance = 90, min = 1, max = 1,},
{name = "water_life:meat_raw", chance = 5, min = 1, max = 1,},
},
brainfunc = jellyfish_brain,
@ -66,22 +51,16 @@ minetest.register_entity("water_life:jellyfish",{
if mobkit.is_alive(self) then
if water_life.bloody then water_life.spilltheblood(self.object) end
mobkit.hurt(self,tool_capabilities.damage_groups.fleshy or 1)
end
end,
on_rightclick = function(self, clicker)
if not clicker or not clicker:is_player() then return end
local inv = clicker:get_inventory()
local item = clicker:get_wielded_item()
if not item or (item:get_name() ~= "fireflies:bug_net" and item:get_name() ~= water_life.catchNet) then return end
if not item or (item:get_name() ~= "fireflies:bug_net" and
item:get_name() ~= water_life.catchNet) then return end
if not inv:room_for_item("main", "water_life:jellyfish_item") then return end
inv:add_item("main", "water_life:jellyfish_item")
self.object:remove()
end,
})