From 8a3493f68db1296a96909b90166b1100c71ca539 Mon Sep 17 00:00:00 2001 From: D00Med Date: Mon, 23 Jul 2018 08:08:42 +1000 Subject: [PATCH] Fish and skybox change >Skybox changes to blue when underwater (this can be disabled in the settings) >Added fish >More bubbles when underwater --- minetest.conf | 1 + mods/hyrule_weather/init.lua | 19 ++++++- mods/hyruletools/init.lua | 16 +++++- mods/mobs_loz/init.lua | 1 + mods/mobs_loz/models/seafish.b3d | Bin 0 -> 8951 bytes mods/mobs_loz/seafish.lua | 63 +++++++++++++++++++++++ mods/mobs_loz/spawns.lua | 14 +++-- mods/mobs_loz/textures/mobs_seafish.png | Bin 0 -> 211 bytes mods/mobs_loz/textures/mobs_seafish2.png | Bin 0 -> 198 bytes mods/mobs_loz/textures/mobs_seafish3.png | Bin 0 -> 199 bytes mods/mobs_loz/textures/mobs_seafish4.png | Bin 0 -> 230 bytes mods/moreplants/init.lua | 4 +- 12 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 mods/mobs_loz/models/seafish.b3d create mode 100644 mods/mobs_loz/seafish.lua create mode 100644 mods/mobs_loz/textures/mobs_seafish.png create mode 100644 mods/mobs_loz/textures/mobs_seafish2.png create mode 100644 mods/mobs_loz/textures/mobs_seafish3.png create mode 100644 mods/mobs_loz/textures/mobs_seafish4.png diff --git a/minetest.conf b/minetest.conf index 34ddd53..cc9de99 100644 --- a/minetest.conf +++ b/minetest.conf @@ -8,6 +8,7 @@ tnt_radius = 3 enable_bed_respawn = true give_initial_stuff = true enable_weather = true +underwater_effects = true loz_mode = true enable_armour = true ARMOR_UPDATE_TIME = 1.5 diff --git a/mods/hyrule_weather/init.lua b/mods/hyrule_weather/init.lua index db15f3f..cb1d2d9 100644 --- a/mods/hyrule_weather/init.lua +++ b/mods/hyrule_weather/init.lua @@ -152,7 +152,11 @@ local apply_weather = function(player, pos, weather_type) elseif weather_type == "insects" then player:set_sky(nil, "regular", nil, true) elseif weather_type == "none" then + if underwater then + player:set_sky({r=10, g=20, b=75}, "plain", nil, true) + else player:set_sky(nil, "regular", nil, true) + end return end end @@ -168,6 +172,7 @@ minetest.register_on_joinplayer(function() end) local sound_ready = true +local underwater = false minetest.register_globalstep(function(dtime) if math.random(1,4) ~= 4 or hyrule_weather.weather == "twilight" then return end @@ -199,7 +204,7 @@ minetest.register_globalstep(function(dtime) end if pos.y <= -20 then display_weather = false end --apply weather effect - if display_weather then + if display_weather and not underwater then apply_weather(player, pos, hyrule_weather.weather) if sound_ready and hyrule_weather.weather ~= nil then local weather_name = hyrule_weather.weather @@ -213,6 +218,18 @@ minetest.register_globalstep(function(dtime) else apply_weather(player, pos, "none") end + --underwater effects + if minetest.setting_get("underwater_effects") then + if minetest.get_node({x=pos.x, y=pos.y+0.5, z=pos.z}).name == "default:water_source" and minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z}).name == "default:water_source" then + underwater = true + player:set_sky({r=10, g=20, b=75}, "plain", nil, true) + else + underwater = false + if not display_weather then + player:set_sky(nil, "regular", nil, true) + end + end + end end end) diff --git a/mods/hyruletools/init.lua b/mods/hyruletools/init.lua index 8c0c5be..b4c9c28 100644 --- a/mods/hyruletools/init.lua +++ b/mods/hyruletools/init.lua @@ -191,7 +191,7 @@ minetest.register_globalstep(function(dtime) --bubbles if math.random(1,10) == 1 then local pos = player:getpos() - local water = minetest.find_node_near({x=pos.x+math.random(-7,7), y=pos.y+math.random(-6,-3), z=pos.z+math.random(-7,7)}, 5, {"default:water_source", "default:river_water_source"}, true) + local water = minetest.find_node_near({x=pos.x+math.random(-7,7), y=pos.y+math.random(-10,-7), z=pos.z+math.random(-7,7)}, 5, {"default:water_source", "default:river_water_source"}, true) if not water then return end minetest.add_particle({ pos = {x=water.x, y=water.y, z=water.z}, @@ -205,6 +205,20 @@ minetest.register_globalstep(function(dtime) texture = "bubble.png", glow = 5 }) + local water2 = minetest.find_node_near({x=pos.x+math.random(-7,7), y=pos.y+math.random(-10,-7), z=pos.z+math.random(-7,7)}, 5, {"default:water_source", "default:river_water_source"}, true) + if not water2 then return end + minetest.add_particle({ + pos = {x=water2.x, y=water2.y, z=water2.z}, + velocity = {x=math.random(-5,5)/10, y=math.random(3,5), z=math.random(-5,5)/10}, + acceleration = {x=math.random(-1,1)/10, y=math.random(-10,-5)/10, z=math.random(-1,1)/10}, + expirationtime = 3, + size = math.random(3,5), + collisiondetection = true, + collision_removal = true, + vertical = false, + texture = "bubble.png", + glow = 5 + }) end if player:get_wielded_item():get_name() == "hyruletools:sail" then diff --git a/mods/mobs_loz/init.lua b/mods/mobs_loz/init.lua index 3f1e8b9..d5afc56 100644 --- a/mods/mobs_loz/init.lua +++ b/mods/mobs_loz/init.lua @@ -34,6 +34,7 @@ dofile(path.."/gibido.lua") dofile(path.."/biri.lua") dofile(path.."/keese.lua") dofile(path.."/skulltula.lua") +dofile(path.."/seafish.lua") dofile(path.."/spawns.lua") end diff --git a/mods/mobs_loz/models/seafish.b3d b/mods/mobs_loz/models/seafish.b3d new file mode 100644 index 0000000000000000000000000000000000000000..47f361d9fcb4b147cee9752e906a2a188c202ff0 GIT binary patch literal 8951 zcmd^D32;@_8GbB66$&A;uThh*6wLCjj5FrmLl!6z2$--)36ZwKbVDm;=~R^4GPVe` z(6Gohoj?JFN*w|SNZvc7p|(LRAQTy)$fzJo!ZKw^0Gs~bJ?A`5PVRfbjx(K3&&-#5 zPyYY@_doylpYy%|EKk_>I}|e)YT=A2}$yXG46% zmifURmd{6GhO(%>^RRm`;w!rs8$L#Uu*0V8UVV)C%EsV_`XRr<58H5h)>-_Umf?}F^+w+W z=FZLZ?7?7=Nqe}VJ>G$R=O05@TiB}0aq2%GPxb4f>`p^F`0c`8$l=J{NfpmiF7@9J zdtDt1r!=sO_dmX_E#*8YyiDY;Julub?M`t6yLi7^|0hF|v3~VDLw&UMIb_HBG<*H^ z``NKRRX@M@`uaZ>@o6pI`XldG`F|$z)9m%vf7ZvY;-h}2eB#5teDc6;fj}I^eS_BK z62zeOd;HzC4u7oax&V+7qj{Ba39)#|M zUUH6m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yvo!J9YsZOmm!o}bH-<+ZoGif?0IosdQ2Z$I(3f%pp%f5VAC zeBdY|uG>nk+tQkvNWPCsu74?gA!LP`uih8R_f6>wA%kx_pB_RE>nVpr(icJoU%lV- z9FQ;i4f#UIkgtl1eAQu~dK3AgHz8ybjJT%nVHp=fhMMVd%^X%rUkDj;h?cL~AIKL% z7A@{ES%+y9cNqCX$YSxfPOBM&OwU2*?YQI^bwFGQnI2d7RlKRSLC8!lRLzvH;sQdZ z=b-n4*=P8m8Lf8?P`v*3~}3Ny`#8L9COJ9giK$XUk-nez7R6>gW_2CRXL!4 zkpqNG=S}xT4yq^N3n4?k@jiRVAY|s+R2@t%AY{6)zAsb`D`Y=F$aLQP z`a$h^2$>mI<$(SLZ>wZ|A!P7XyyK3$td1kfjG!9xr#) zMy=I;68cuwD^As@W7}`O)MNXY0ke#6WdG|wE4toSZfsofv!d&LRmS|@epYnZLsWG5 zi=P!;_K2J(de_E&R{ZLOY*iHgo+kb-YWzXSRz&fgK)x5GZvk-)A%m|HJ-si?xDYZk zt~wAAx0>SCQV$_6glx5z!!51f;Cq>TuS#DC8P=u_qucVQO2mdQdh??6g^-y!;FBMG z(Z_0S=wk>O;;O?4IjDS#q;D0)9ZkLvGQ?Fm#Hs^?OwZSh3og#dxDYbzJ5^t^4yc)` z1B6WXHS2)2U6yr#km)(-zJ;_l#JwVYA!LZF4x<{43;3QV-x}!)A&YiSnEe1D(|gB^ zi#ptqaUo>)8W%!_wdrS-;td>MqPW*&TnHKZOmTci<9L$vRUAXeqUB(ofeVW=L`xruIa;)~T*=PR-Kko}F literal 0 HcmV?d00001 diff --git a/mods/mobs_loz/seafish.lua b/mods/mobs_loz/seafish.lua new file mode 100644 index 0000000..e9834bc --- /dev/null +++ b/mods/mobs_loz/seafish.lua @@ -0,0 +1,63 @@ + +-- seafish by D00Med + +mobs:register_mob("mobs_loz:seafish", { + type = "animal", + passive = true, + damage = 0, + attack_type = "dogfight", + hp_min = 10, + hp_max = 25, + armor = 110, + collisionbox = {-0.05, -0.05, -0.05, 0.05, 0.05, 0.05}, + visual = "mesh", + mesh = "seafish.b3d", + textures = { + {"mobs_seafish.png"}, + {"mobs_seafish2.png"}, + {"mobs_seafish3.png"}, + {"mobs_seafish4.png"}, + }, + blood_texture = "bubble.png", + makes_footstep_sound = false, + view_range = 5, + walk_velocity = 1, + run_velocity = 3, + runaway = true, + runaway_timer = 40, + jump = false, + stepheight = 0, + fly = true, + fly_in = {"default:water_source", "moreplants:coral", "moreplants:seaweed1", "moreplants:seaweed2", "moreplants:seaweed3", "moreplants:seaweed4", "moreplants:coral2", "moreplants:coral3"}, + jump_height = 0, + fall_damage = 0, + fall_speed = -6, + drops = { + {name = "fishing:fish_raw", + chance = 5, min = 1, max = 1}, + }, + --[[on_die = function(self) + local pos = self.object:getpos() + if math.random(1,7) == 2 then + minetest.env:add_entity(pos, "hyruletools:heart_entity") + end + minetest.env:add_entity(pos, "experience:orb") + end,]] + water_damage = 0, + lava_damage = 1, + light_damage = 0, + animation = { + speed_normal = 19, + speed_run = 20, + normal_speed = 19, + run_speed = 20, + stand_start = 1, + stand_end = 28, + walk_start = 1, + walk_end = 28, + run_start = 1, + run_end = 28, + }, +}) + +mobs:register_egg("mobs_loz:seafish", "Sea Fish", "wool_orange.png", 1) diff --git a/mods/mobs_loz/spawns.lua b/mods/mobs_loz/spawns.lua index 64f075d..7a6e12f 100644 --- a/mods/mobs_loz/spawns.lua +++ b/mods/mobs_loz/spawns.lua @@ -1,11 +1,19 @@ --friendlies +mobs:spawn({ + name = "mobs_loz:seafish", + nodes = {"default:water_source"}, + min_light = 10, + chance = 15000, + min_height = -20, + day_toggle = true, +}) mobs:spawn({ name = "mobs_loz:zora_male", nodes = {"default:water_source"}, min_light = 10, chance = 15000, - min_height = 0, + min_height = -10, day_toggle = true, }) mobs:spawn({ @@ -13,7 +21,7 @@ mobs:spawn({ nodes = {"default:water_source"}, min_light = 10, chance = 15000, - min_height = 0, + min_height = -10, day_toggle = true, }) mobs:spawn({ @@ -21,7 +29,7 @@ mobs:spawn({ nodes = {"default:water_source"}, min_light = 10, chance = 15000, - min_height = 0, + min_height = -20, day_toggle = true, }) mobs:spawn({ diff --git a/mods/mobs_loz/textures/mobs_seafish.png b/mods/mobs_loz/textures/mobs_seafish.png new file mode 100644 index 0000000000000000000000000000000000000000..b6eab80b3672ef70b0c807e3d19282a5d35e57a6 GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQk(@Ik;M!Q+`=Ht$S`Y;1W>Tm z)5S4F<9u?$0+v7XrT+c@Kb!ske}CTp|Le1U{14x^=Kue>x4!(Js{b0y+4wSX(FwO1 zC;tma{Qtkd@WcQAEZ6?u(c$_3KRn~_|M-QhiOMG*ZvE)Zqa9{edf-3T+W#ls{1=TX zP=CnO^MWaUvBbaPjT?;&JXRPPl*J?;St@wA-@w;|nL%@}OKVkiS~t)^44$rjF6*2U FngG)$TFw9f literal 0 HcmV?d00001 diff --git a/mods/mobs_loz/textures/mobs_seafish2.png b/mods/mobs_loz/textures/mobs_seafish2.png new file mode 100644 index 0000000000000000000000000000000000000000..24038f2d4794d7c95cc1e1c67197a3f1eaba656d GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQk(@Ik;M!Q+`=Ht$S`Y;1W>TT z)5S4FMgx8$2pcAaxH0;5jhQX1B0ilpUXO@geCx7FiWuj literal 0 HcmV?d00001 diff --git a/mods/mobs_loz/textures/mobs_seafish3.png b/mods/mobs_loz/textures/mobs_seafish3.png new file mode 100644 index 0000000000000000000000000000000000000000..d6884f3323a090fec5f945d298a868b522a17c2b GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQk(@Ik;M!Q+`=Ht$S`Y;1W>Tj z)5S4F1f!fj59zv+K8Lkcej2#dDRxkFL+mskqaSQ{We1BXYmQ{P*l1QD+0*GatR2 u-SvO2$yw{Ic6)DL314e^>E)usKNxQ31XhTz-M$>?2nJ7AKbLh*2~7ar2}Yg( literal 0 HcmV?d00001 diff --git a/mods/mobs_loz/textures/mobs_seafish4.png b/mods/mobs_loz/textures/mobs_seafish4.png new file mode 100644 index 0000000000000000000000000000000000000000..0aa8ef7ba8ef9e31d7505db29d059fa7de671d03 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQk(@Ik;M!Q+`=Ht$S`Y;1W<5> zr;B5V#`(1q47m;gyItHLzi0t2@H*Vp-rdCSR5V^Yd?nw(noUprdhS^$ee=J;9m{q6xPTYN~d# zJJqo$6jwJ*sZCExw9{kLy#MU~g37gr*Ho_6np#&Z#PGQ6Z#Mt+Lst)9GScFkc{(R# b))C=zPP)GH9wt=)-N@kS>gTe~DWM4f)tgd| literal 0 HcmV?d00001 diff --git a/mods/moreplants/init.lua b/mods/moreplants/init.lua index 56e862e..4d3b864 100644 --- a/mods/moreplants/init.lua +++ b/mods/moreplants/init.lua @@ -887,7 +887,7 @@ minetest.register_node("moreplants:coral2", { }) minetest.register_node("moreplants:kelp", { - description = "Kelp", + description = "Short Kelp", drawtype = "mesh", mesh = "kelp_3.obj", tiles = {{name = "moreplants_kelp.png",animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00},}, "default_sand.png"}, @@ -925,7 +925,7 @@ minetest.register_node("moreplants:kelp2", { }) minetest.register_node("moreplants:kelp3", { - description = "Kelp", + description = "Tall Kelp", drawtype = "mesh", mesh = "kelp_6.obj", tiles = {{name = "moreplants_kelp.png",animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00},}, "default_sand.png"},