Fish and skybox change

>Skybox changes to blue when underwater (this can be disabled in the
settings)
>Added fish
>More bubbles when underwater
master
D00Med 2018-07-23 08:08:42 +10:00
parent fb378caeb3
commit 8a3493f68d
12 changed files with 111 additions and 7 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

Binary file not shown.

63
mods/mobs_loz/seafish.lua Normal file
View File

@ -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)

View File

@ -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({

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

View File

@ -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"},