add new texture and animation to riverfish
This commit is contained in:
parent
bf9b6ab904
commit
f4f57faabf
6
api.lua
6
api.lua
@ -2,7 +2,7 @@
|
||||
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
|
||||
|
||||
for _,item in ipairs(self.drops) do
|
||||
@ -94,7 +94,7 @@ function water_life.get_yaw_to_object(self,target)
|
||||
return yaw
|
||||
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)
|
||||
|
||||
@ -116,7 +116,7 @@ function water_life.hq_swimfrom(self,prty,tgtobj)
|
||||
vel.y = vel.y+0.1
|
||||
self.object:set_velocity(vel)
|
||||
end
|
||||
mobkit.hq_aqua_turn(self,51,swimto,3)
|
||||
mobkit.hq_aqua_turn(self,51,swimto,speed)
|
||||
|
||||
else
|
||||
return true
|
||||
|
23
init.lua
23
init.lua
@ -442,9 +442,9 @@ local function fish_brain(self)
|
||||
if mobkit.timer(self,1) then
|
||||
local plyr = mobkit.get_nearby_player(self)
|
||||
if plyr then
|
||||
water_life.hq_swimfrom(self,50,plyr)
|
||||
water_life.hq_swimfrom(self,50,plyr,-3)
|
||||
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
|
||||
|
||||
@ -590,9 +590,9 @@ minetest.register_entity("water_life:fish",{
|
||||
collide_with_objects = false,
|
||||
collisionbox = {-0.2, -0.2, -0.2, 0.2, 0.2, 0.2},
|
||||
visual = "mesh",
|
||||
mesh = "water_life_fish.obj",
|
||||
textures = {"water_life_fish.png"},
|
||||
visual_size = {x = 0.3, y = 0.3},
|
||||
mesh = "water_life_riverfish.b3d",
|
||||
textures = {"water_life_riverfish.png"},
|
||||
visual_size = {x = 2.5, y = 2.5},
|
||||
static_save = false,
|
||||
makes_footstep_sound = true,
|
||||
on_step = mobkit.stepfunc, -- required
|
||||
@ -601,16 +601,21 @@ minetest.register_entity("water_life:fish",{
|
||||
-- api props
|
||||
springiness=0,
|
||||
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,
|
||||
view_range = 3,
|
||||
-- lung_capacity = 0, -- seconds
|
||||
max_hp = 15,
|
||||
max_hp = 10,
|
||||
timeout=60,
|
||||
drops = {
|
||||
{name = "default:diamond", chance = 10, min = 1, max = 1,},
|
||||
{name = "water_life:meat_raw", chance = 2, min = 1, max = 2,},
|
||||
{name = "default:diamond", chance = 20, min = 1, max = 1,},
|
||||
{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,
|
||||
on_punch=function(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||
if mobkit.is_alive(self) then
|
||||
|
12
license.txt
12
license.txt
@ -3,7 +3,7 @@
|
||||
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
|
||||
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.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
|
||||
License for Textures, Models
|
||||
---------------------------------------
|
||||
|
||||
the Wahle:
|
||||
CC BY-SA 3.0 UNPORTED. Created by D00Med
|
||||
|
||||
|
||||
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)
|
||||
|
BIN
models/water_life_riverfish.b3d
Normal file
BIN
models/water_life_riverfish.b3d
Normal file
Binary file not shown.
BIN
textures/water_life_riverfish.png
Normal file
BIN
textures/water_life_riverfish.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 796 B |
Loading…
x
Reference in New Issue
Block a user