new stuff, atmos with environmental damage over time
BIN
mods/.DS_Store
vendored
@ -1,2 +1,3 @@
|
||||
lightning
|
||||
hudclock
|
||||
hudbars
|
||||
|
@ -1,8 +1,8 @@
|
||||
-- atmos, control of skies, weather (when doable.)
|
||||
-- atmos, control of skies, weather, and various other visual tasks
|
||||
|
||||
atmos = {}
|
||||
|
||||
minetest.register_chatcommand("ratio", {
|
||||
minetest.register_chatcommand("weather", {
|
||||
|
||||
description = "debugs the current atmos based weather system",
|
||||
param = "use a number to select the weather type.",
|
||||
@ -209,6 +209,10 @@ function atmos.sync_skybox()
|
||||
|
||||
player:override_day_night_ratio(atmos.weather_light_level[15])
|
||||
|
||||
elseif player:get_pos().y > 10000 then
|
||||
|
||||
-- change to low orbit skybox here
|
||||
|
||||
else
|
||||
|
||||
-- sync weather to players that are above -32, lightning effects (and flashes) only affects players above -16
|
||||
@ -404,3 +408,310 @@ minetest.after(math.random(43, 156), atmos.thunderstrike)
|
||||
lightning.light_level = atmos.weather_light_level
|
||||
|
||||
-- abm to remove fires when it's raining, snowing or hailing?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- logic to support taking damage when either too cold or too hot
|
||||
|
||||
hb.register_hudbar("overheat",
|
||||
0xFFFFFF,
|
||||
"Overheat",
|
||||
{bar = "atmos_heatstroke_bar.png", icon = "atmos_heatstroke_icon.png", bgicon = "atmos_heatstroke_icon.png"},
|
||||
0,
|
||||
100,
|
||||
false
|
||||
)
|
||||
|
||||
hb.register_hudbar("frostbite",
|
||||
0xFFFFFF,
|
||||
"Frostbite",
|
||||
{bar = "atmos_frostbite_bar.png", icon = "atmos_frostbite_icon.png", bgicon = "atmos_frostbite_icon.png"},
|
||||
0,
|
||||
100,
|
||||
false
|
||||
)
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
|
||||
hb.init_hudbar(player, "overheat")
|
||||
hb.init_hudbar(player, "frostbite")
|
||||
|
||||
local meta = player:get_meta()
|
||||
|
||||
if meta:get_int("overheat") == "" then
|
||||
|
||||
meta:set_int("overheat", 0)
|
||||
|
||||
end
|
||||
|
||||
if meta:get_int("frostbite") == "" then
|
||||
|
||||
meta:set_int("frostbite", 0)
|
||||
|
||||
end
|
||||
|
||||
local frosty = meta:get_int("frostbite")
|
||||
local toasty = meta:get_int("overheat")
|
||||
|
||||
hb.change_hudbar(player, "overheat", toasty)
|
||||
hb.change_hudbar(player, "frostbite", frosty)
|
||||
|
||||
end)
|
||||
|
||||
local np_temp = {
|
||||
offset = 50,
|
||||
scale = 50,
|
||||
spread = {x = 1000, y = 1000, z = 1000},
|
||||
seed = 5349,
|
||||
octaves = 3,
|
||||
persist = 0.5,
|
||||
lacunarity = 2.0,
|
||||
--flags = ""
|
||||
}
|
||||
|
||||
local np_humid = {
|
||||
offset = 50,
|
||||
scale = 50,
|
||||
spread = {x = 1000, y = 1000, z = 1000},
|
||||
seed = 842,
|
||||
octaves = 3,
|
||||
persist = 0.5,
|
||||
lacunarity = 2.0,
|
||||
--flags = ""
|
||||
}
|
||||
|
||||
local function local_area_stamina()
|
||||
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
|
||||
local pos = player:get_pos()
|
||||
|
||||
local pposx = math.floor(pos.x)
|
||||
local pposz = math.floor(pos.z)
|
||||
|
||||
local nobj_temp = nobj_temp or minetest.get_perlin(np_temp)
|
||||
local nobj_humid = nobj_humid or minetest.get_perlin(np_humid)
|
||||
|
||||
local nval_temp = nobj_temp:get2d({x = pposx, y = pposz})
|
||||
local nval_humid = nobj_humid:get2d({x = pposx, y = pposz})
|
||||
|
||||
if nval_humid > 100 then
|
||||
nval_humid = 100
|
||||
elseif nval_humid < 0 then
|
||||
nval_humid = 0
|
||||
end
|
||||
|
||||
nval_temp = ((nval_temp / 2) - 12) + (nval_humid * 0.02)
|
||||
|
||||
if hudclock.month == 1 then
|
||||
nval_temp = nval_temp - 20
|
||||
elseif hudclock.month == 2 then
|
||||
nval_temp = nval_temp - 15
|
||||
elseif hudclock.month == 3 then
|
||||
nval_temp = nval_temp - 10
|
||||
elseif hudclock.month == 4 then
|
||||
nval_temp = nval_temp - 5
|
||||
elseif hudclock.month == 5 then
|
||||
nval_temp = nval_temp + 0
|
||||
elseif hudclock.month == 6 then
|
||||
nval_temp = nval_temp + 5
|
||||
elseif hudclock.month == 7 then
|
||||
nval_temp = nval_temp + 5
|
||||
elseif hudclock.month == 8 then
|
||||
nval_temp = nval_temp + 0
|
||||
elseif hudclock.month == 9 then
|
||||
nval_temp = nval_temp - 5
|
||||
elseif hudclock.month == 10 then
|
||||
nval_temp = nval_temp - 10
|
||||
elseif hudclock.month == 11 then
|
||||
nval_temp = nval_temp - 15
|
||||
elseif hudclock.month == 12 then
|
||||
nval_temp = nval_temp - 20
|
||||
end
|
||||
|
||||
-- for every 1 block 0.001c is added to the temparature gauge. any lower than -15km and heat will always be above
|
||||
|
||||
local y = math.abs(pos.y) * 0.001
|
||||
|
||||
if pos.y < 1 then
|
||||
|
||||
nval_temp = nval_temp + y
|
||||
|
||||
else
|
||||
|
||||
nval_temp = nval_temp - y
|
||||
|
||||
end
|
||||
|
||||
if pos.y >= 10000 then
|
||||
|
||||
nval_temp = -271
|
||||
|
||||
nval_humid = 0
|
||||
|
||||
end
|
||||
|
||||
if pos.y < -14999 then
|
||||
|
||||
nval_humid = 0
|
||||
|
||||
nval_temp = nval_temp + 1000
|
||||
|
||||
end
|
||||
|
||||
-- if the local temp is less than -15 C then decrement frostbite every now and then, if the heatstroke bar is not at 100,
|
||||
-- then start replenishing it
|
||||
-- if the local temp is more than +35 C then decrement heatstroke every now and then, if the frostbite bar is not at 100,
|
||||
-- then start replenishing it
|
||||
-- if not under or over those values, slowly restore the bar to 0.
|
||||
-- environmental timer is 15 seconds
|
||||
|
||||
local meta = player:get_meta()
|
||||
|
||||
local frosty = meta:get_int("frostbite") -- nice combo into uppercut, just wait for the kahn.
|
||||
local toasty = meta:get_int("overheat")
|
||||
|
||||
if nval_temp < -15 then
|
||||
|
||||
if toasty > 0 then
|
||||
|
||||
meta:set_int("overheat", toasty - 1)
|
||||
|
||||
else
|
||||
|
||||
meta:set_int("frostbite", frosty + 1)
|
||||
|
||||
end
|
||||
|
||||
elseif nval_temp > 35 then
|
||||
|
||||
if frosty > 0 then
|
||||
|
||||
meta:set_int("frostbite", frosty - 1)
|
||||
|
||||
else
|
||||
|
||||
meta:set_int("overheat", toasty + 1)
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
frosty = meta:get_int("frostbite")
|
||||
toasty = meta:get_int("overheat")
|
||||
|
||||
frosty = frosty - 1
|
||||
toasty = toasty - 1
|
||||
|
||||
if toasty > 100 then toasty = 100 end
|
||||
if toasty < 0 then toasty = 0 end
|
||||
|
||||
if frosty > 100 then frosty = 100 end
|
||||
if frosty < 0 then frosty = 0 end
|
||||
|
||||
meta:set_int("overheat", toasty)
|
||||
meta:set_int("frostbite", frosty)
|
||||
|
||||
end
|
||||
|
||||
frosty = meta:get_int("frostbite")
|
||||
toasty = meta:get_int("overheat")
|
||||
|
||||
hb.change_hudbar(player, "overheat", toasty)
|
||||
hb.change_hudbar(player, "frostbite", frosty)
|
||||
|
||||
if frosty > 94 then
|
||||
|
||||
player:set_hp(player:get_hp() - 15, "atmos_frostbite")
|
||||
|
||||
elseif frosty > 89 then
|
||||
|
||||
player:set_hp(player:get_hp() - 5, "atmos_frostbite")
|
||||
|
||||
elseif frosty > 79 then
|
||||
|
||||
player:set_hp(player:get_hp() - 2, "atmos_frostbite") -- do 1 hearts worth of damage
|
||||
|
||||
end
|
||||
|
||||
if toasty > 94 then
|
||||
|
||||
player:set_hp(player:get_hp() - 15, "atmos_overheat")
|
||||
|
||||
elseif toasty > 89 then
|
||||
|
||||
player:set_hp(player:get_hp() - 5, "atmos_overheat")
|
||||
|
||||
elseif toasty > 80 then
|
||||
|
||||
player:set_hp(player:get_hp() - 2, "atmos_overheat")
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
minetest.after(math.random(15, 30), local_area_stamina)
|
||||
|
||||
end
|
||||
|
||||
local_area_stamina()
|
||||
|
||||
minetest.register_chatcommand("frosty", {
|
||||
|
||||
description = "debugs the current frostbite level",
|
||||
param = "use 0-100 to set frostbite level.",
|
||||
func = function(name, param)
|
||||
|
||||
if not minetest.check_player_privs(name, "server") then
|
||||
return false, "You are not allowed to be more or less frosty, you scrub. \n \n This incident WILL be reported."
|
||||
end
|
||||
|
||||
local player = minetest.get_player_by_name(name)
|
||||
|
||||
player:get_meta():set_int("frostbite", tonumber(param))
|
||||
|
||||
hb.change_hudbar(player, "frostbite", tonumber(param))
|
||||
|
||||
return true, "Current frostbite levels updated."
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("toasty", {
|
||||
|
||||
description = "debugs the current overheat level",
|
||||
param = "use 0-100 to set overheat level.",
|
||||
func = function(name, param)
|
||||
|
||||
if not minetest.check_player_privs(name, "server") then
|
||||
return false, "You are not allowed to be more or less toasty, you scrub. \n \n This incident WILL be reported."
|
||||
end
|
||||
|
||||
local player = minetest.get_player_by_name(name)
|
||||
|
||||
player:get_meta():set_int("overheat", tonumber(param))
|
||||
|
||||
hb.change_hudbar(player, "overheat", tonumber(param))
|
||||
|
||||
return true, "Current overheat levels updated."
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
-- handle dying so that values are set to 1/4 of what they were when the player dies
|
||||
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
|
||||
local meta = player:get_meta()
|
||||
|
||||
local frosty = meta:get_int("frostbite")
|
||||
local toasty = meta:get_int("overheat")
|
||||
|
||||
meta:set_int("overheat", math.floor(toasty / 4))
|
||||
meta:set_int("frostbite", math.floor(frosty / 4))
|
||||
|
||||
end)
|
BIN
mods/atmos/textures/atmos_frostbite_bar.png
Normal file
After Width: | Height: | Size: 78 B |
BIN
mods/atmos/textures/atmos_frostbite_icon.png
Normal file
After Width: | Height: | Size: 164 B |
BIN
mods/atmos/textures/atmos_heatstroke_bar.png
Normal file
After Width: | Height: | Size: 78 B |
BIN
mods/atmos/textures/atmos_heatstroke_icon.png
Normal file
After Width: | Height: | Size: 157 B |
BIN
mods/atvomat/.DS_Store
vendored
Normal file
@ -1,7 +1,7 @@
|
||||
-- avtomat - (automatico, automation)
|
||||
-- part of solar plains, by jordach
|
||||
|
||||
-- table of nodes not to dig or collect;
|
||||
-- table of nodes not to dig or collect; supersede this at somepoint by just adding a custom
|
||||
|
||||
atvomat.breaker_blacklist = {}
|
||||
|
||||
@ -20,6 +20,7 @@ atvomat.breaker_blacklist["ignore"] = ""
|
||||
atvomat.breaker_blacklist["atvomat:breaker_1"] = ""
|
||||
atvomat.breaker_blacklist["atvomat:breaker_2"] = ""
|
||||
atvomat.breaker_blacklist["atvomat:sorter"] = ""
|
||||
atvomat.breaker_blacklist["atvomat:placer"] = ""
|
||||
atvomat.breaker_blacklist["atvomat:mover"] = ""
|
||||
|
||||
local atbreaker =
|
||||
|
@ -1,2 +1,3 @@
|
||||
core
|
||||
farming
|
||||
farming?
|
||||
naturum?
|
||||
|
@ -4,6 +4,7 @@
|
||||
atvomat = {} -- i like global namespaces for people who like making silly dependancies
|
||||
|
||||
dofile(minetest.get_modpath("atvomat").."/breaker.lua") -- automated block breaker
|
||||
dofile(minetest.get_modpath("atvomat").."/placer.lua") -- automated block breaker
|
||||
dofile(minetest.get_modpath("atvomat").."/compressor.lua") -- compresses ingots/gems into block form
|
||||
dofile(minetest.get_modpath("atvomat").."/crusher.lua") -- crushes ore blocks, and other blocks
|
||||
dofile(minetest.get_modpath("atvomat").."/logger.lua") -- automatically kills and plants trees
|
||||
|
@ -86,6 +86,13 @@ atvomat.mover_input["atvomat:breaker_2"] = {
|
||||
|
||||
}
|
||||
|
||||
atvomat.mover_input["atvomat:logger"] = {
|
||||
|
||||
16,
|
||||
"main"
|
||||
|
||||
}
|
||||
|
||||
-- registration of insertable containers:
|
||||
|
||||
atvomat.mover_output["core:chest"] = {
|
||||
@ -126,6 +133,20 @@ atvomat.mover_output["atvomat:sorter"] = {
|
||||
|
||||
}
|
||||
|
||||
atvomat.mover_output["atvomat:logger"] = {
|
||||
|
||||
"main",
|
||||
"fuel",
|
||||
true
|
||||
}
|
||||
|
||||
atvomat.mover_output["atvomat:placer"] = {
|
||||
|
||||
"main",
|
||||
"main",
|
||||
true
|
||||
}
|
||||
|
||||
local atmover =
|
||||
|
||||
"size[8,9]" ..
|
||||
@ -143,7 +164,7 @@ local atmover =
|
||||
-- end
|
||||
|
||||
minetest.register_node("atvomat:mover",{
|
||||
description = "Mover (Moves Items from Red to Green)",
|
||||
description = "Mover",
|
||||
drawtype = "mesh",
|
||||
mesh = "atvomat_mover.b3d",
|
||||
paramtype2 = "facedir",
|
||||
|
139
mods/atvomat/placer.lua
Normal file
@ -0,0 +1,139 @@
|
||||
-- placer.lua, part of atvomat, solar plains
|
||||
|
||||
atvomat.placer_blacklist = {}
|
||||
|
||||
-- depend on this mod and in your own mod, write atvomat.placer_blacklist["node:name"] = ""
|
||||
-- it doesn't matter what value the key value contains, it's just better that the key value exists, so that looping through
|
||||
-- atvomat.placer_blacklist is considerably easier than say having to filter through hundreds of potential values derived from keys
|
||||
|
||||
-- actual blacklist starts here:
|
||||
|
||||
atvomat.placer_blacklist["core:chest"] = ""
|
||||
atvomat.placer_blacklist["core:chest_locked"] = ""
|
||||
atvomat.placer_blacklist["core:lava_source"] = ""
|
||||
atvomat.placer_blacklist["core:lava_flowing"] = ""
|
||||
atvomat.placer_blacklist["core:water_source"] = ""
|
||||
atvomat.placer_blacklist["core:water_flowing"] = ""
|
||||
atvomat.placer_blacklist["core:furnace"] = ""
|
||||
atvomat.placer_blacklist["core:furnace_active"] = ""
|
||||
atvomat.placer_blacklist["air"] = ""
|
||||
atvomat.placer_blacklist["ignore"] = ""
|
||||
atvomat.placer_blacklist["atvomat:breaker_1"] = ""
|
||||
atvomat.placer_blacklist["atvomat:breaker_2"] = ""
|
||||
atvomat.placer_blacklist["atvomat:placer"] = ""
|
||||
atvomat.placer_blacklist["atvomat:sorter"] = ""
|
||||
atvomat.placer_blacklist["atvomat:mover"] = ""
|
||||
|
||||
-- note, if you're implementing your own mod with node meta, or similar, feel free to blacklist them so that the placer will refuse
|
||||
-- any nodes with meta. in future - i could probably do this with a custom node field.
|
||||
|
||||
local at_placer = "size[8,9]" ..
|
||||
"list[current_name;main;2.5,0;3,3]" ..
|
||||
"list[current_player;main;0,4.5;8,1;]" ..
|
||||
"list[current_player;main;0,6;8,3;8]" ..
|
||||
"listring[current_name;main]" ..
|
||||
"listring[current_player;main]" ..
|
||||
"background[-0.45,-0.5;8.9,10;atvomat_placer_interface.png]"..
|
||||
"listcolors[#3a4466;#8b9bb4;#ffffff;#4e5765;#ffffff]"
|
||||
|
||||
local function place_block(pos, elapsed)
|
||||
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
|
||||
local fpos = mcore.get_node_from_front(table.copy(pos)) -- lets get the position for the node where the targeter is
|
||||
|
||||
if minetest.get_node_or_nil(fpos).name == nil then return true end
|
||||
if minetest.get_node_or_nil(fpos).name ~= "air" then return true end
|
||||
|
||||
if minetest.get_node_or_nil(fpos).name == "air" then
|
||||
|
||||
for i=1,9 do
|
||||
|
||||
local stack = inv:get_stack("main", i)
|
||||
local stackname = stack:get_name()
|
||||
|
||||
if stackname ~= "" then
|
||||
|
||||
-- let's check if the node is blacklisted or not
|
||||
|
||||
for k, v in pairs(atvomat.placer_blacklist) do
|
||||
|
||||
minetest.chat_send_all("stackname: " .. stackname)
|
||||
minetest.chat_send_all("blacklist: " .. k)
|
||||
|
||||
if stackname == k then
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
meta:set_string("infotext", "Auto Block Placer, ERROR, please remove:\n" .. minetest.registered_items[stackname]["description"] .. " (" .. stackname .. ")\nfrom the inventory.\nPunch twice to restart.")
|
||||
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
minetest.add_node(fpos, {name=stackname})
|
||||
minetest.get_meta(pos):set_string("infotext", "Auto Block Placer, Enabled.")
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
minetest.register_node("atvomat:placer", {
|
||||
|
||||
description = "Placer (Target is highlighted)",
|
||||
drawtype = "mesh",
|
||||
tiles = {"atvomat_breaker_t1_body.png"},
|
||||
mesh = "atvomat_breaker.b3d",
|
||||
|
||||
paramtype2 = "facedir",
|
||||
|
||||
sounds = mcore.sound_metallic,
|
||||
|
||||
on_place = mcore.rotate_axis,
|
||||
|
||||
groups = {oddly_breakable_by_hand=2},
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
meta:set_string("infotext", "Auto Block Placer, Disabled.")
|
||||
|
||||
meta:set_string("formspec", at_placer)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 9)
|
||||
|
||||
minetest.get_node_timer(pos):start(1)
|
||||
|
||||
end,
|
||||
|
||||
on_timer = place_block,
|
||||
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
if meta:get_string("active") == "false" then
|
||||
|
||||
meta:set_string("active", "true")
|
||||
minetest.get_node_timer(pos):start(1)
|
||||
meta:set_string("infotext", "Auto Block Placer, Enabled.")
|
||||
|
||||
else
|
||||
|
||||
meta:set_string("active", "false")
|
||||
minetest.get_node_timer(pos):stop()
|
||||
meta:set_string("infotext", "Auto Block Placer, Disabled.")
|
||||
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
})
|
@ -250,7 +250,7 @@ end
|
||||
|
||||
minetest.register_node("atvomat:sorter", {
|
||||
|
||||
description = "Sorter (Sorts things based on items inside of it.)",
|
||||
description = "Sorter",
|
||||
paramtype = "light",
|
||||
tiles = {"atvomat_sorter_mesh.png"},
|
||||
drawtype = "mesh",
|
||||
|
BIN
mods/atvomat/textures/.DS_Store
vendored
Normal file
BIN
mods/atvomat/textures/atvomat_placer_interface.png
Normal file
After Width: | Height: | Size: 794 B |
@ -1,3 +1,3 @@
|
||||
hudbars
|
||||
|
||||
farming
|
||||
farming?
|
||||
|
BIN
mods/hbsprint/.DS_Store
vendored
Normal file
@ -1,3 +1 @@
|
||||
player_monoids?
|
||||
hudbars?
|
||||
hbhunger?
|
||||
hudbars
|
||||
|
@ -92,6 +92,11 @@ minetest.register_globalstep(function(dtime)
|
||||
if sprint_timer >= sprint_timer_step then
|
||||
for _,player in pairs(minetest.get_connected_players()) do
|
||||
|
||||
local meta = player:get_meta()
|
||||
|
||||
local frosty = meta:get_int("frostbite")
|
||||
local toasty = meta:get_int("overheat")
|
||||
|
||||
local ctrl = player:get_player_control()
|
||||
local key_press = ctrl.aux1 and ctrl.up
|
||||
|
||||
@ -106,24 +111,40 @@ minetest.register_globalstep(function(dtime)
|
||||
local name = player:get_player_name()
|
||||
local pos = player:get_pos()
|
||||
local ground = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local player_stamina = tonumber(player:get_attribute("stamina"))
|
||||
local player_stamina = tonumber(meta:get_string("stamina"))
|
||||
|
||||
if player_stamina > 1 then
|
||||
|
||||
player:set_physics_override({speed = speed, jump = jump})
|
||||
|
||||
player:set_attribute("stamina", player_stamina - stamina_drain)
|
||||
|
||||
if hudbars then
|
||||
meta:set_string("stamina", player_stamina - stamina_drain)
|
||||
|
||||
if autohide and player_stamina < 20 then hb.unhide_hudbar(player, "stamina") end
|
||||
|
||||
hb.change_hudbar(player, "stamina", player_stamina - stamina_drain)
|
||||
|
||||
create_particles(player, name, pos, ground)
|
||||
|
||||
-- generate overheat or reduce frostbite
|
||||
|
||||
if frosty > 0 then
|
||||
|
||||
frosty = frosty - 1
|
||||
|
||||
else
|
||||
|
||||
toasty = toasty + 1
|
||||
|
||||
end
|
||||
|
||||
create_particles(player, name, pos, ground)
|
||||
if toasty > 100 then toasty = 100 end
|
||||
if frosty < 0 then frosty = 0 end
|
||||
|
||||
meta:set_int("overheat", toasty)
|
||||
meta:set_int("frostbite", frosty)
|
||||
|
||||
hb.change_hudbar(player, "overheat", toasty)
|
||||
hb.change_hudbar(player, "frostbite", frosty)
|
||||
|
||||
else
|
||||
|
||||
@ -137,11 +158,11 @@ minetest.register_globalstep(function(dtime)
|
||||
|
||||
if stamina_timer >= replenish then
|
||||
|
||||
local player_stamina = tonumber(player:get_attribute("stamina"))
|
||||
local player_stamina = tonumber(meta:get_string("stamina"))
|
||||
|
||||
if player_stamina < 20 then
|
||||
|
||||
player:set_attribute("stamina", player_stamina + stam_charge)
|
||||
meta:set_string("stamina", player_stamina + stam_charge)
|
||||
|
||||
end
|
||||
|
||||
|
@ -43,6 +43,6 @@ if sorting ~= nil then
|
||||
hb.settings.sorting_reverse[tonumber(v)] = k
|
||||
end
|
||||
else
|
||||
hb.settings.sorting = { ["health"] = 0, ["satiation"] = 1, ["stamina"] = 2, ["breath"] = 3 }
|
||||
hb.settings.sorting = { ["health"] = 0, ["satiation"] = 1, ["overheat"] = 3, ["frostbite"] = 2, ["stamina"] = 4, ["breath"] = 5 }
|
||||
hb.settings.sorting_reverse = { [0] = "health", [1] = "breath" }
|
||||
end
|
||||
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 77 B |
@ -10,7 +10,7 @@ local last_time = os.time()
|
||||
local totaldays = 1
|
||||
|
||||
hudclock.day = 1
|
||||
hudclock.month = 1
|
||||
hudclock.month = 6
|
||||
hudclock.year = 1
|
||||
|
||||
ymd = {}
|
||||
|
@ -4,7 +4,7 @@ hudinfo = {} -- namespaces;
|
||||
|
||||
hudinfo.player_data = {}
|
||||
|
||||
-- paramat's snowdrif to get mapgen heat and humidity since get_heat() doesn't work?
|
||||
-- paramat's snowdrift to get mapgen heat and humidity since get_heat() doesn't work?
|
||||
|
||||
local np_temp = {
|
||||
offset = 50,
|
||||
@ -43,44 +43,30 @@ function hudinfo.player_env_data(player)
|
||||
|
||||
locale = "Eterra Deep Core,"
|
||||
|
||||
icon = "hudinfo_eterra_deep_core.png"
|
||||
|
||||
elseif pos.y >= -16000 and pos.y < -32 then
|
||||
|
||||
locale = "Eterra Underground,"
|
||||
|
||||
icon = "hudinfo_eterra_underground.png"
|
||||
|
||||
elseif pos.y >= -32 and pos.y < 10000 then
|
||||
|
||||
locale = "Eterra Surface,"
|
||||
|
||||
icon = "hudinfo_eterra_surface.png"
|
||||
|
||||
elseif pos.y >= 10000 and pos.y < 26000 then
|
||||
|
||||
locale = "Eterra Orbit,"
|
||||
|
||||
icon = "hudinfo_eterra_orbit.png"
|
||||
|
||||
elseif pos.y >= 26000 and pos.y < 28000 then
|
||||
|
||||
locale = "Arkhos Asteroid Fields,"
|
||||
|
||||
icon = "hudinfo_arkhos_asteroids.png"
|
||||
|
||||
elseif pos.y >= 28000 and pos.y < 30000 then
|
||||
|
||||
locale = "Z12X!C34VB5'6NM7&&8QASW%E^^DFR)TGH(YUJKIO_+LP?,"
|
||||
|
||||
icon = "hudinfo_unknown.png"
|
||||
|
||||
elseif pos.y >= 30000 then
|
||||
|
||||
locale = "Aetherus."
|
||||
|
||||
icon = "hudinfo_aetherus.png"
|
||||
|
||||
end
|
||||
|
||||
-- let's get a temparature reading for the local area.
|
||||
@ -152,6 +138,19 @@ function hudinfo.player_env_data(player)
|
||||
nval_temp = nval_temp - 20
|
||||
end
|
||||
|
||||
local y = math.abs(pos.y) * 0.001
|
||||
|
||||
if pos.y < 1 then
|
||||
|
||||
nval_temp = nval_temp + y
|
||||
|
||||
else
|
||||
|
||||
nval_temp = nval_temp - y
|
||||
|
||||
end
|
||||
|
||||
|
||||
if pos.y >= 10000 then
|
||||
|
||||
nval_temp = -271
|
||||
@ -160,6 +159,14 @@ function hudinfo.player_env_data(player)
|
||||
|
||||
end
|
||||
|
||||
if pos.y < -14999 then
|
||||
|
||||
nval_humid = 0
|
||||
|
||||
nval_temp = nval_temp + 1000
|
||||
|
||||
end
|
||||
|
||||
-- let's understand the current weather from atmos:
|
||||
|
||||
local weather_str, weather_icon
|
||||
|
91
mods/naturum/init.lua
Normal file
@ -0,0 +1,91 @@
|
||||
-- naturum
|
||||
-- replacement for farming_plus by tenplus1
|
||||
-- License: WTFPL because i simply do not give a shit since this is a hobby at this point
|
||||
|
||||
-- things to alias from farming plus:
|
||||
|
||||
--[[
|
||||
|
||||
hoes
|
||||
|
||||
wheat, seeds, flour, toast
|
||||
potatos
|
||||
carrots
|
||||
pumpkins
|
||||
melons
|
||||
berry bushes (alias the actual plantables, not things)
|
||||
cocoa
|
||||
corn
|
||||
cotton -> rename to flax and hemp respectively
|
||||
cucumbers
|
||||
rhubarb
|
||||
sugar
|
||||
tomatos
|
||||
strawberries (the food, not nodes)
|
||||
|
||||
]]
|
||||
|
||||
-- add the crushing hammer
|
||||
|
||||
--[[
|
||||
|
||||
list of known in world recipes:
|
||||
|
||||
stone -> cobble
|
||||
cobble -> gravel
|
||||
gravel -> sand
|
||||
sand -> dust
|
||||
|
||||
]]
|
||||
|
||||
-- compost barrel
|
||||
|
||||
--[[
|
||||
|
||||
compost barrel recipes:
|
||||
|
||||
dust + water = clay
|
||||
8 compostable foods + time = 1 dirt
|
||||
water + lava + iron compost barrel = obsidian
|
||||
|
||||
]]
|
||||
|
||||
-- berry bushes
|
||||
|
||||
--[[
|
||||
|
||||
starfruit (only grows during day, rare)
|
||||
moonfruit (only grows at night, rare)
|
||||
blueberries
|
||||
raspberries
|
||||
blackberries
|
||||
grapes
|
||||
|
||||
]]
|
||||
|
||||
-- salt ore
|
||||
|
||||
-- used for making crisps and such
|
||||
|
||||
-- cookware (reuseable)
|
||||
|
||||
--[[
|
||||
|
||||
knife? see below
|
||||
chopping board (knife included?)
|
||||
frying pan
|
||||
saucepan
|
||||
bowl
|
||||
mixing spoon
|
||||
baking tray
|
||||
|
||||
]]
|
||||
|
||||
-- to add:
|
||||
|
||||
--[[
|
||||
|
||||
coffee (and lava coffee)
|
||||
coffee machine
|
||||
|
||||
]]
|
@ -1,52 +0,0 @@
|
||||
--solarinfuser, a neat and fancy energy mod
|
||||
|
||||
-- namespacing, as per usual.
|
||||
|
||||
solarinfuser = {}
|
||||
|
||||
-- create the pipe nodeboxes
|
||||
|
||||
solarinfuser.pipe_middle = {-0.125, -0.125, -0.125, 0.125, 0.125, 0.125}, -- Core
|
||||
|
||||
solarinfuser.pipe_north = {
|
||||
|
||||
{-0.125, -0.125, 0.125, 0.125, 0.125, 0.5}, -- PipeNorth
|
||||
{-0.1875, -0.1875, 0.3125, 0.1875, 0.1875, 0.375}, -- RingNorth
|
||||
|
||||
}
|
||||
|
||||
solarinfuser.pipe_east = {
|
||||
|
||||
{0.125, -0.125, -0.125, 0.5, 0.125, 0.125}, -- PipeEast
|
||||
{0.3125, -0.1875, -0.1875, 0.375, 0.1875, 0.1875}, -- RingEast
|
||||
|
||||
}
|
||||
|
||||
solarinfuser.pipe_south = {
|
||||
|
||||
{-0.125, -0.125, -0.5, 0.125, 0.125, -0.125}, -- PipeSouth
|
||||
{-0.1875, -0.1875, -0.375, 0.1875, 0.1875, -0.3125}, -- RingSouth
|
||||
|
||||
}
|
||||
|
||||
solarinfuser.pipe_west = {
|
||||
|
||||
{-0.5, -0.125, -0.125, -0.125, 0.125, 0.125}, -- PipeWest
|
||||
{-0.375, -0.1875, -0.1875, -0.3125, 0.1875, 0.1875}, -- RingWest
|
||||
|
||||
|
||||
}
|
||||
|
||||
solarinfuser.pipe_top = {
|
||||
|
||||
{-0.125, 0.125, -0.125, 0.125, 0.5, 0.125}, -- PipeTop
|
||||
{-0.1875, 0.3125, -0.1875, 0.1875, 0.375, 0.1875}, -- RingTop
|
||||
|
||||
}
|
||||
|
||||
solarinfuser.pipe_bottom = {
|
||||
|
||||
{-0.125, -0.5, -0.125, 0.125, -0.125, 0.125}, -- PipeBottom
|
||||
{-0.1875, -0.375, -0.1875, 0.1875, -0.3125, 0.1875}, -- RingBottom
|
||||
|
||||
}
|