add new texture and animation to riverfish

This commit is contained in:
berengma 2019-11-23 10:20:39 +01:00
parent bf9b6ab904
commit f4f57faabf
5 changed files with 26 additions and 15 deletions

View File

@ -2,7 +2,7 @@
local pi = math.pi local pi = math.pi
function water_life.handle_drops(self) function water_life.handle_drops(self) -- drop on death what is definded in the entity table
if not self.drops then return end if not self.drops then return end
for _,item in ipairs(self.drops) do for _,item in ipairs(self.drops) do
@ -94,7 +94,7 @@ function water_life.get_yaw_to_object(self,target)
return yaw return yaw
end end
function water_life.hq_swimfrom(self,prty,tgtobj) function water_life.hq_swimfrom(self,prty,tgtobj,speed) -- turn around 180degrees from tgtob and swim away until out of sight
local func = function(self) local func = function(self)
@ -116,7 +116,7 @@ function water_life.hq_swimfrom(self,prty,tgtobj)
vel.y = vel.y+0.1 vel.y = vel.y+0.1
self.object:set_velocity(vel) self.object:set_velocity(vel)
end end
mobkit.hq_aqua_turn(self,51,swimto,3) mobkit.hq_aqua_turn(self,51,swimto,speed)
else else
return true return true

View File

@ -442,9 +442,9 @@ local function fish_brain(self)
if mobkit.timer(self,1) then if mobkit.timer(self,1) then
local plyr = mobkit.get_nearby_player(self) local plyr = mobkit.get_nearby_player(self)
if plyr then if plyr then
water_life.hq_swimfrom(self,50,plyr) water_life.hq_swimfrom(self,50,plyr,-3)
end end
if mobkit.is_queue_empty_high(self) then mobkit.hq_aqua_roam(self,10,1) end if mobkit.is_queue_empty_high(self) then mobkit.hq_aqua_roam(self,10,-1) end
end end
end end
@ -590,9 +590,9 @@ minetest.register_entity("water_life:fish",{
collide_with_objects = false, collide_with_objects = false,
collisionbox = {-0.2, -0.2, -0.2, 0.2, 0.2, 0.2}, collisionbox = {-0.2, -0.2, -0.2, 0.2, 0.2, 0.2},
visual = "mesh", visual = "mesh",
mesh = "water_life_fish.obj", mesh = "water_life_riverfish.b3d",
textures = {"water_life_fish.png"}, textures = {"water_life_riverfish.png"},
visual_size = {x = 0.3, y = 0.3}, visual_size = {x = 2.5, y = 2.5},
static_save = false, static_save = false,
makes_footstep_sound = true, makes_footstep_sound = true,
on_step = mobkit.stepfunc, -- required on_step = mobkit.stepfunc, -- required
@ -601,16 +601,21 @@ minetest.register_entity("water_life:fish",{
-- api props -- api props
springiness=0, springiness=0,
buoyancy = 1.07, -- portion of hitbox submerged buoyancy = 1.07, -- portion of hitbox submerged
max_speed = 3, -- no matter which number is here, sharks always at same speed max_speed = -3, -- negative speed as long as model is not rotatet in head direction
jump_height = 0.5, jump_height = 0.5,
view_range = 3, view_range = 3,
-- lung_capacity = 0, -- seconds -- lung_capacity = 0, -- seconds
max_hp = 15, max_hp = 10,
timeout=60, timeout=60,
drops = { drops = {
{name = "default:diamond", chance = 10, min = 1, max = 1,}, {name = "default:diamond", chance = 20, min = 1, max = 1,},
{name = "water_life:meat_raw", chance = 2, min = 1, max = 2,}, {name = "water_life:meat_raw", chance = 2, min = 1, max = 1,},
}, },
animation = {
def={range={x=1,y=35},speed=40,loop=true},
fast={range={x=1,y=35},speed=80,loop=true},
idle={range={x=36,y=75},speed=20,loop=true},
},
brainfunc = fish_brain, brainfunc = fish_brain,
on_punch=function(self, puncher, time_from_last_punch, tool_capabilities, dir) on_punch=function(self, puncher, time_from_last_punch, tool_capabilities, dir)
if mobkit.is_alive(self) then if mobkit.is_alive(self) then

View File

@ -3,7 +3,7 @@
License for Code License for Code
---------------- ----------------
Copyright (C) 2016 D00Med <heiselong@gmx.com> Copyright (C) 2019 by Gundul
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
@ -19,11 +19,17 @@ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc., with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
License for Textures, Models License for Textures, Models
--------------------------------------- ---------------------------------------
the Wahle:
CC BY-SA 3.0 UNPORTED. Created by D00Med CC BY-SA 3.0 UNPORTED. Created by D00Med
whale_1.ogg - CC0 Public Domain - https://en.wikipedia.org/wiki/File:Humpbackwhale2.ogg whale_1.ogg - CC0 Public Domain - https://en.wikipedia.org/wiki/File:Humpbackwhale2.ogg
the shark:
MIT License, Copyright (c) 2019 TheTermos
the riverfish:
CC-BY-NC-SA 3.0 by Melkor (https://forum.minetest.net/memberlist.php?mode=viewprofile&u=301)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B