grass changes in fall.
parent
de7bac4983
commit
b04fcbe35d
|
@ -0,0 +1,22 @@
|
|||
Year
|
||||
12 months
|
||||
14 days per month
|
||||
2 weeks per month
|
||||
7 days per week
|
||||
4 seasons
|
||||
42 days per season
|
||||
|
||||
function month(day)
|
||||
return (((day - 35) % 168) / (168/12)) + 1
|
||||
end
|
||||
|
||||
|
||||
what needs saved
|
||||
|
||||
day_counter
|
||||
month
|
||||
month_counter
|
||||
season
|
||||
|
||||
day_speed
|
||||
night_speed
|
Binary file not shown.
After Width: | Height: | Size: 727 KiB |
|
@ -0,0 +1,34 @@
|
|||
minetest.register_node("mymonths:fall_grass", {
|
||||
description = "Dirt with Grass",
|
||||
tiles = {"default_grass.png^[colorize:brown:50", "default_dirt.png",
|
||||
{name = "default_dirt.png^default_grass_side.png^[colorize:brown:50",
|
||||
tileable_vertical = false}},
|
||||
groups = {crumbly = 3, soil = 1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name = "default_grass_footstep", gain = 0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {'default:dirt_with_grass'},
|
||||
interval = 60,
|
||||
chance = 40,
|
||||
action = function (pos, node, active_object_count, active_object_count_wider)
|
||||
if mymonths.month_counter == 9
|
||||
or mymonths.month_counter == 10 then
|
||||
minetest.set_node(pos, {name = 'mymonths:fall_grass'})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodename = {'mymonths:fall_grass'},
|
||||
interval = 60,
|
||||
chance = 40,
|
||||
action = function (pos, node, active_object_count, active_object_count_wider)
|
||||
if mymonths.month_counter == 4 then
|
||||
minetest.set_node(pos, {name = 'default:dirt_with_grass'})
|
||||
end
|
||||
end
|
||||
})
|
7
init.lua
7
init.lua
|
@ -19,6 +19,9 @@ mymonths.use_puddles = true
|
|||
--Flowers die in winter, grown in spring
|
||||
mymonths.flowers_die = true
|
||||
|
||||
--Grass changes color in fall, and spring
|
||||
mymonths.grass_change = true
|
||||
|
||||
if minetest.get_modpath("lightning") then
|
||||
lightning.auto = false
|
||||
end
|
||||
|
@ -49,6 +52,10 @@ if mymonths.use_weather == true then
|
|||
dofile(minetest.get_modpath("mymonths").."/weather.lua")
|
||||
end
|
||||
|
||||
if mymonths.grass_change == true then
|
||||
dofile(minetest.get_modpath("mymonths").."/grass.lua")
|
||||
end
|
||||
|
||||
if mymonths.use_weather == false then
|
||||
minetest.register_alias("mymonths:puddle", "air")
|
||||
minetest.register_alias("mymonths:snow_cover_1", "air")
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue