playerplus compatibility, removed fire sounds for defaults

This commit is contained in:
TenPlus1 2018-03-24 09:43:55 +00:00
parent 2ae4f6b7a5
commit bc940749f0
6 changed files with 27 additions and 7 deletions

View File

@ -1,4 +1,5 @@
Ambience Redo mod for Minetest Ambience Redo mod for Minetest
by TenPlus1
Based on Immersive Sounds .36 mod by Neuromancer and optimized to run on servers with new fire sounds added when Fire Redo mod is detected... Based on Immersive Sounds .36 mod by Neuromancer and optimized to run on servers with new fire sounds added when Fire Redo mod is detected...
@ -13,5 +14,6 @@ Based on Immersive Sounds .36 mod by Neuromancer and optimized to run on servers
- 0.9 - Plays music files on server or local client when found at midnight, files to be named "ambience_music.1.ogg" changing number each up to 9. - 0.9 - Plays music files on server or local client when found at midnight, files to be named "ambience_music.1.ogg" changing number each up to 9.
- 1.0 - Added icecrack sound when walking on snow/ice flows, also tidied code - 1.0 - Added icecrack sound when walking on snow/ice flows, also tidied code
- 1.1 - Using newer functions, Minetest 0.4.16 and above needed to run - 1.1 - Using newer functions, Minetest 0.4.16 and above needed to run
- 1.2 - Added PlayerPlus compatibility and removed fire sounds for defaults
Code license: MIT Code license: MIT

View File

@ -1,3 +1,3 @@
default default
fire? fire?
ethereal? playerplus?

View File

@ -16,6 +16,9 @@ local music_handler = nil
local MUSICVOLUME = 1 local MUSICVOLUME = 1
local play_music = minetest.settings:get_bool("ambience_music") ~= false local play_music = minetest.settings:get_bool("ambience_music") ~= false
-- is playerplus running?
local pplus = minetest.get_modpath("playerplus")
-- sound sets (gain defaults to 0.3 unless specifically set) -- sound sets (gain defaults to 0.3 unless specifically set)
local night = { local night = {
@ -63,6 +66,7 @@ local beach = {
local desert = { local desert = {
handler = {}, frequency = 20, handler = {}, frequency = 20,
{name = "coyote", length = 2.5}, {name = "coyote", length = 2.5},
{name = "wind", length = 9},
{name = "desertwind", length = 8} {name = "desertwind", length = 8}
} }
@ -121,6 +125,8 @@ local jungle_night = {
local ice = { local ice = {
handler = {}, frequency = 250, handler = {}, frequency = 250,
{name = "icecrack", length = 23}, {name = "icecrack", length = 23},
{name = "desertwind", length = 8},
{name = "wind", length = 9},
} }
local radius = 6 local radius = 6
@ -130,18 +136,30 @@ local num_fire, num_lava, num_water_flowing, num_water_source, num_air,
-- check where player is and which sounds are played -- check where player is and which sounds are played
local get_ambience = function(player) local get_ambience = function(player)
-- who and where am I? -- where am I?
--local player_name = player:get_player_name() --local player_name = player:get_player_name()
local pos = player:get_pos() local pos = player:get_pos()
-- what is around me? -- what is around me?
pos.y = pos.y + 1.4 -- head level local nod_head, nod_feet
local nod_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- foot level -- is playerplus in use?
local nod_feet = minetest.get_node(pos).name if pplus then
pos.y = pos.y - 0.2 -- reset pos local name = player:get_player_name()
nod_head = playerplus[name].nod_head
nod_feet = playerplus[name].nod_feet
else
pos.y = pos.y + 1.4 -- head level
local nod_head = minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- foot level
local nod_feet = minetest.get_node(pos).name
pos.y = pos.y - 0.2 -- reset pos
end
local tod = minetest.get_timeofday() local tod = minetest.get_timeofday()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 B