From f4f57faabf76fa83621978add5acef44669fd208 Mon Sep 17 00:00:00 2001 From: berengma Date: Sat, 23 Nov 2019 10:20:39 +0100 Subject: [PATCH] add new texture and animation to riverfish --- api.lua | 6 +++--- init.lua | 23 ++++++++++++++--------- license.txt | 12 +++++++++--- models/water_life_riverfish.b3d | Bin 0 -> 29910 bytes textures/water_life_riverfish.png | Bin 0 -> 796 bytes 5 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 models/water_life_riverfish.b3d create mode 100644 textures/water_life_riverfish.png diff --git a/api.lua b/api.lua index fd01de1..afb620f 100644 --- a/api.lua +++ b/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 diff --git a/init.lua b/init.lua index 0235b05..723227b 100644 --- a/init.lua +++ b/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 diff --git a/license.txt b/license.txt index 24d5745..0823ed7 100644 --- a/license.txt +++ b/license.txt @@ -3,7 +3,7 @@ License for Code ---------------- -Copyright (C) 2016 D00Med +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) diff --git a/models/water_life_riverfish.b3d b/models/water_life_riverfish.b3d new file mode 100644 index 0000000000000000000000000000000000000000..22770d3e243016ef385ea53d7e7b936a792e01b1 GIT binary patch literal 29910 zcmeHw33OCN*8dBFs340Xq>-gTy4fK~HxQO|g%DO*B8#B1DofZD0oh5OA|r|@iXd@~ z%H}e3cb*#qY2t!|4i2CwGHx(#=!oJrLR|RYU)8Pd_mb||p7a0C@tbezoT8Tgz58z6 zx^-XGuV0#+9AEC==Nm?fVHi2XM~&!6CF(;a&7U%N`lMOL>-z=^oejej^qB;pJVR;d zu-v|DNWk3b3#QDSI(=R~KCmTRVb8IThV&gVpw;c55~<};Rmr1L%R`@( z$MP#Qnb&+4%eXS87nY)!Q=|142eNc$* zQOSp(YaCzG`ay=)S&tWe+Ag{e_tbs*TJ*_l1ALgsle4vj~{Cn80jp|$> zM$kR%y2$a#zSy-vL3Y3}=Il0% zJi_ZfT&w%Etu=0r#?fsw4t@F_x-ZYxr>{kyz6biWetLZNK0QABwX%=KX7AJ2;=Wp* zT^HSlYqVYT*kqq=98sOA51;94kK$TNmF~fPT3$t4*~hE>K#qZQwfmYLEAFA^SC0#Q z`dZn?*J}N6t<;a~qV+?c)THU9wMIWwRRf_TQbAj3>^`kEucc~9p)kpeRQmbem ze;d{#VDf^cG7*>6q|IPyp}G<{p|AKTNQEWE3;h-c}Qip zYmWv-4j(w8`dR7|8lQoEAriXKMmn2v4a(Ii*W@p0je0Z6O({2_+??B}x1`*HvYYZH zl+i}rOW8xY73J34M!g;7wv^jYZqIGhJ5k0Ky#wXW+(tcvaysQS%06zR-j#9}%6`h- zxQ%)b%H1hvQtruZ)G-k>IYuwaa0awd&!OC#ayI2Yl+i}LALYK3b1C=dHtK^Y52QSR z@}=BHeJJH2lm}BD#%T@Yy zPk9dIdE7>Q0p%Mg&!@bQ+o&(0yqNML%1gP8dI9C-l$TL18Pa*Gkc$mftt=KB5*8j379CPORmeq$Di$CT79UarRmjDM zDi$IV79moqD&!(W6$=sxixH`bD&%5BwHddYbLr-?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MbqIr-py_FFURN^t@ocBq|s3 UG!}b;J#U`nFFRTWz9jPh0G1fl5&!@I literal 0 HcmV?d00001 diff --git a/textures/water_life_riverfish.png b/textures/water_life_riverfish.png new file mode 100644 index 0000000000000000000000000000000000000000..d9bbb69cfff3fd291bc9a596652ac7dd02de6649 GIT binary patch literal 796 zcmV+%1LOROP)7|B^s4}y3L8bMK*up&uz&F=P2@4Ve_cX?P%b~RNL4+T|EeNd$kM8CR( z(}oahoVJ8m?eYyFM&gZcd73Ew%98vW!oXz+!uX>v(EqKpJGp5a zMrlqf!ZY~{2n_rVN#Cc80bMl_Z!C2a=~+hNZA3M~H}NRfK68{+z*$RK1%?bs)+Yt`9{x$HHIopKC`@A@ zvmR$HqpXkWD0(g>BJ9g^dd_noACZutzdrRjuYGkEK{3c(ZamXa(f3`7?Gl4xquwHOo^q?EXFZLA`QDK2I&gb@hoQ0DxcGtMg$r+p zi1brQWh5i<;>C#*BSy4n=}1QqM2QlfqS`FX@Z$S#Zpa1U*xRQuiz9e6p))r_eg6Ts zE?!p%A_(Wy&HtTpQvJ1!84ig=Zojvz^!kL+;vBuA4qD9M>EFHI9s+B(_7 zEV8n}t;@^*ydQf|-@E%0-(UMwB_AfD=Lfh)Tlm@iG^+)Jg9oVB*0}lZvf}biTj$uj ahra;|Bu+F!j)l(v0000