mirror of
https://github.com/Splizard/minetest-mod-snow.git
synced 2024-12-28 07:30:17 +01:00
Makes ice slippery and removes messages of depreciation
This commit is contained in:
parent
e8a15bf467
commit
4f4489fc93
@ -96,7 +96,7 @@ if snow.enable_snowfall then
|
|||||||
|
|
||||||
for _, player in ipairs(minetest.get_connected_players()) do
|
for _, player in ipairs(minetest.get_connected_players()) do
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
local pos_player = player:getpos()
|
local pos_player = player:get_pos()
|
||||||
local pposy = math.floor(pos_player.y) + 2 -- Precipitation when swimming
|
local pposy = math.floor(pos_player.y) + 2 -- Precipitation when swimming
|
||||||
if pposy >= YLIMIT - 2 then
|
if pposy >= YLIMIT - 2 then
|
||||||
local pposx = math.floor(pos_player.x)
|
local pposx = math.floor(pos_player.x)
|
||||||
@ -107,9 +107,9 @@ if snow.enable_snowfall then
|
|||||||
local nobj_humid = minetest.get_perlin(np_humid)
|
local nobj_humid = minetest.get_perlin(np_humid)
|
||||||
local nobj_prec = minetest.get_perlin(np_prec)
|
local nobj_prec = minetest.get_perlin(np_prec)
|
||||||
|
|
||||||
local nval_temp = nobj_temp:get2d({x = pposx, y = pposz})
|
local nval_temp = nobj_temp:get_2d({x = pposx, y = pposz})
|
||||||
local nval_humid = nobj_humid:get2d({x = pposx, y = pposz})
|
local nval_humid = nobj_humid:get_2d({x = pposx, y = pposz})
|
||||||
local nval_prec = nobj_prec:get2d({x = os.clock() / 60, y = 0})
|
local nval_prec = nobj_prec:get_2d({x = os.clock() / 60, y = 0})
|
||||||
|
|
||||||
-- Biome system: Frozen biomes below heat 35,
|
-- Biome system: Frozen biomes below heat 35,
|
||||||
-- deserts below line 14 * t - 95 * h = -1496
|
-- deserts below line 14 * t - 95 * h = -1496
|
||||||
@ -151,14 +151,13 @@ if snow.enable_snowfall then
|
|||||||
((time - 0.1875) / 0.0521) * difsval)
|
((time - 0.1875) / 0.0521) * difsval)
|
||||||
end
|
end
|
||||||
-- Set sky to overcast bluish-grey
|
-- Set sky to overcast bluish-grey
|
||||||
player:set_sky(
|
player:set_sky({
|
||||||
{r = sval, g = sval, b = sval + 16, a = 255},
|
base_color = {r = sval, g = sval, b = sval + 16, a = 255},
|
||||||
"plain",
|
type = "plain",
|
||||||
{}
|
})
|
||||||
)
|
|
||||||
else
|
else
|
||||||
-- Reset sky to normal
|
-- Reset sky to normal
|
||||||
player:set_sky({}, "regular", {})
|
player:set_sky({type = "regular"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -66,10 +66,10 @@ end)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Christmas egg
|
-- Christmas egg
|
||||||
if minetest.global_exists"skins" then
|
if minetest.global_exists("skins") then
|
||||||
skins.add"character_snow_man"
|
skins.add("character_snow_man")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Decorated Pine Leaves
|
-- Decorated Pine Leaves
|
||||||
@ -291,8 +291,7 @@ local function snow_onto_dirt(pos)
|
|||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
if node.name == "default:dirt_with_grass"
|
if node.name == "default:dirt_with_grass"
|
||||||
or node.name == "default:dirt" then
|
or node.name == "default:dirt" then
|
||||||
node.name = "default:dirt_with_snow"
|
minetest.set_node(pos, {name = "default:dirt_with_snow"})
|
||||||
minetest.set_node(pos, node)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -312,14 +311,9 @@ nodedef = {
|
|||||||
-- by player position. ~ LazyJ
|
-- by player position. ~ LazyJ
|
||||||
-- I made this a little harder to dig than snow blocks because
|
-- I made this a little harder to dig than snow blocks because
|
||||||
-- I imagine snow brick as being much more dense and solid than fluffy snow. ~ LazyJ
|
-- I imagine snow brick as being much more dense and solid than fluffy snow. ~ LazyJ
|
||||||
groups = {cracky=2, crumbly=2, choppy=2, oddly_breakable_by_hand=2, melts=1, icemaker=1, cooks_into_ice=1},
|
groups = {cracky=2, crumbly=2, choppy=2, oddly_breakable_by_hand=2, melts=1, icemaker=1, cooks_into_ice=1, cools_lava = 1, snowy = 1},
|
||||||
--Let's use the new snow sounds instead of the old grass sounds. ~ LazyJ
|
--Let's use the new snow sounds instead of the old grass sounds. ~ LazyJ
|
||||||
sounds = default.node_sound_dirt_defaults({
|
sounds = default.node_sound_snow_defaults(),
|
||||||
footstep = {name="default_snow_footstep", gain=0.25},
|
|
||||||
dig = {name="default_dig_crumbly", gain=0.4},
|
|
||||||
dug = {name="default_snow_footstep", gain=0.75},
|
|
||||||
place = {name="default_place_node", gain=1.0}
|
|
||||||
}),
|
|
||||||
-- The "on_construct" part below, thinking in terms of layers,
|
-- The "on_construct" part below, thinking in terms of layers,
|
||||||
-- dirt_with_snow could also double as dirt_with_frost which adds subtlety
|
-- dirt_with_snow could also double as dirt_with_frost which adds subtlety
|
||||||
-- to the winterscape. ~ LazyJ
|
-- to the winterscape. ~ LazyJ
|
||||||
@ -329,17 +323,14 @@ nodedef = {
|
|||||||
-- Snow Brick
|
-- Snow Brick
|
||||||
minetest.register_node("snow:snow_brick", table.copy(nodedef))
|
minetest.register_node("snow:snow_brick", table.copy(nodedef))
|
||||||
|
|
||||||
|
|
||||||
-- hard Ice Brick, original texture from LazyJ
|
-- hard Ice Brick, original texture from LazyJ
|
||||||
local ibdef = table.copy(nodedef)
|
local ibdef = table.copy(nodedef)
|
||||||
ibdef.description = "Ice Brick"
|
ibdef.description = "Ice Brick"
|
||||||
ibdef.tiles = {"snow_ice_brick.png"}
|
ibdef.tiles = {"snow_ice_brick.png"}
|
||||||
ibdef.use_texture_alpha = true
|
ibdef.use_texture_alpha = "blend"
|
||||||
ibdef.drawtype = "glasslike"
|
ibdef.drawtype = "glasslike"
|
||||||
ibdef.groups = {cracky=1, crumbly=1, choppy=1, melts=1}
|
ibdef.groups = {cracky=1, crumbly=1, choppy=1, melts=1, cools_lava = 1, slippery = 3}
|
||||||
ibdef.sounds = default.node_sound_glass_defaults({
|
ibdef.sounds = default.node_sound_ice_defaults()
|
||||||
dug = {name="default_hard_footstep", gain=1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("snow:ice_brick", ibdef)
|
minetest.register_node("snow:ice_brick", ibdef)
|
||||||
|
|
||||||
@ -351,44 +342,38 @@ nodedef.tiles = {"snow_snow_cobble.png"}
|
|||||||
|
|
||||||
minetest.register_node("snow:snow_cobble", nodedef)
|
minetest.register_node("snow:snow_cobble", nodedef)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Override Default Nodes to Add Extra Functions
|
-- Override Default Nodes to Add Extra Functions
|
||||||
|
|
||||||
|
local groups = minetest.registered_nodes["default:ice"].groups
|
||||||
|
groups["melt"] = 1
|
||||||
minetest.override_item("default:ice", {
|
minetest.override_item("default:ice", {
|
||||||
use_texture_alpha = true,
|
drawtype = "glasslike",
|
||||||
|
use_texture_alpha = "blend",
|
||||||
param2 = 0, --param2 is reserved for how much ice will freezeover.
|
param2 = 0, --param2 is reserved for how much ice will freezeover.
|
||||||
sunlight_propagates = true, -- necessary for dirt_with_grass/snow/just dirt ABMs
|
sunlight_propagates = true, -- necessary for dirt_with_grass/snow/just dirt ABMs
|
||||||
drawtype = "glasslike",
|
tiles = {"snow_ice.png^[brighten"},
|
||||||
tiles = {"default_ice.png^[brighten"},
|
|
||||||
liquidtype = "none",
|
liquidtype = "none",
|
||||||
-- I made this a lot harder to dig than snow blocks because ice is much more dense
|
groups = groups,
|
||||||
-- and solid than fluffy snow. ~ LazyJ
|
|
||||||
groups = {cracky=2, crumbly=1, choppy=1, --[[oddly_breakable_by_hand=1,]] melts=1},
|
|
||||||
on_construct = snow_onto_dirt,
|
on_construct = snow_onto_dirt,
|
||||||
liquids_pointable = true,
|
liquids_pointable = true,
|
||||||
--Make ice freeze over when placed by a maximum of 10 blocks.
|
--Make ice freeze over when placed by a maximum of 10 blocks.
|
||||||
after_place_node = function(pos)
|
after_place_node = function(pos)
|
||||||
minetest.set_node(pos, {name="default:ice", param2=math.random(0,10)})
|
minetest.set_node(pos, {name="default:ice", param2=math.random(0,10)})
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
groups = minetest.registered_nodes["default:snowblock"].groups
|
||||||
|
for g,v in pairs({melts=1, icemaker=1, cooks_into_ice=1, falling_node=1}) do
|
||||||
|
groups[g] = v
|
||||||
|
end
|
||||||
minetest.override_item("default:snowblock", {
|
minetest.override_item("default:snowblock", {
|
||||||
-- LazyJ to make dirt below change to dirt_with_snow (see default, nodes.lua, dirt ABM)
|
|
||||||
liquidtype = "none",
|
liquidtype = "none",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
-- Snow blocks should be easy to dig because they are just fluffy snow. ~ LazyJ
|
on_construct = snow_onto_dirt,
|
||||||
groups = {cracky=3, crumbly=3, choppy=3, oddly_breakable_by_hand=3, melts=1,
|
groups = groups,
|
||||||
icemaker=1, cooks_into_ice=1, falling_node=1},
|
|
||||||
--drop = "snow:snow_cobble",
|
|
||||||
on_construct = snow_onto_dirt
|
|
||||||
-- Thinking in terms of layers, dirt_with_snow could also double as
|
|
||||||
-- dirt_with_frost which adds subtlety to the winterscape. ~ LazyJ, 2014_04_04
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.override_item("default:snow", {
|
minetest.override_item("default:snow", {
|
||||||
drop = {
|
drop = {
|
||||||
max_items = 2,
|
max_items = 2,
|
||||||
|
@ -45,7 +45,11 @@ if minetest.get_modpath("moreblocks") and
|
|||||||
ndef.groups.icemaker = nil
|
ndef.groups.icemaker = nil
|
||||||
ndef.groups.cooks_into_ice = nil
|
ndef.groups.cooks_into_ice = nil
|
||||||
ndef.after_place_node = nil
|
ndef.after_place_node = nil
|
||||||
|
if string.find(name, "ice") then
|
||||||
|
ndef.use_texture_alpha = "blend"
|
||||||
|
else
|
||||||
|
ndef.use_texture_alpha = "opaque"
|
||||||
|
end
|
||||||
stairsplus:register_all(mod, name, nodename, ndef)
|
stairsplus:register_all(mod, name, nodename, ndef)
|
||||||
|
|
||||||
if was_in_stairs[name] then
|
if was_in_stairs[name] then
|
||||||
|
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
Loading…
Reference in New Issue
Block a user