UPDATE 1.8

master
maikerumine 2016-04-11 21:53:56 -04:00
parent 1f86a71578
commit 5dbf9e13ec
17 changed files with 457 additions and 31 deletions

68
cavespace.lua Normal file
View File

@ -0,0 +1,68 @@
--Version 0.2
--by emperor_genshin
--modified for ESM game by: maikerumine
--https://forum.minetest.net/viewtopic.php?f=9&t=13775&hilit=[mod]skybox
pos = {x=0, y=0, z=0}
local space = 9000 --value for space, change the value to however you like.
local cave = -40 --value for cave, change the value to however you like.
--The skybox for space, feel free to change it to however you like.
local spaceskybox = {
"sky_pos_y.png",
"sky_neg_y.png",
"sky_pos_z.png",
"sky_neg_z.png",
"sky_neg_x.png",
"sky_pos_x.png",
}
local caveskybox = {
"black.png",
"black.png",
"black.png",
"black.png",
"black.png",
"black.png",
}
local time = 0
minetest.register_globalstep(function(dtime)
time = time + dtime
if time > 1 then for _, player in ipairs(minetest.get_connected_players()) do
time = 0
local name = player:get_player_name()
local pos = player:getpos()
--If the player has reached Space
if minetest.get_player_by_name(name) and pos.y >= space then
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
player:set_sky({}, "skybox", spaceskybox) -- Sets skybox
--If the player is on Earth
elseif minetest.get_player_by_name(name) and pos.y < space then
player:set_physics_override(1, 1, 1) -- speed, jump, gravity [default]
player:set_sky({}, "regular", {}) -- Sets skybox, in this case it sets the skybox to it's default setting if and only if the player's Y value is less than the value of space.
--If the player has reached Cave
if minetest.get_player_by_name(name) and pos.y <=cave then
player:set_physics_override(1, 1, 1.2) -- speed, jump, gravity
player:set_sky({}, "cavebox", caveskybox) -- Sets skybox
end
end
end
end
end)
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
if name then
player:set_sky({}, "regular", {})
end
end)

View File

@ -2,6 +2,7 @@
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--https://github.com/maikerumine
--version 1.8
--License:
--~~~~~~~~
@ -35,6 +36,8 @@ dofile(modpath.."/tools.lua")
dofile(modpath.."/extra.lua")
dofile(modpath.."/nodes.lua")
dofile(modpath.."/oregen.lua")
dofile(modpath.."/cavespace.lua")
--dofile(modpath.."/invis.lua")
--dofile(modpath.."/map.lua")
-- Climate very laggy
--dofile(minetest.get_modpath("es").."/freeze.lua")

93
invis.lua Normal file
View File

@ -0,0 +1,93 @@
-- Code by UjEdwin
--[[
License: CC-BY-SA
Name: Invisible
Created by: UjEdwin
Date: 2016-04-09
Version: 1
Hides players nametag when they are sneaking, or invisible if you have the invisible privilege.
Give yourself the invisible stick, to toggle your invisible on/off
/giveme i
]]
minetest.register_alias("i", "es:tool")
invisible={time=0}
minetest.register_privilege("invisible", {
description = "Be invisible",
give_to_singleplayer= false,
})
invisible.toogle=function(user,sneak)
local name=user:get_player_name()
if minetest.check_player_privs(user:get_player_name(), {invisible=true}) then
if not invisible[name] then
user:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}})
invisible[name]={}
invisible[name].tool=sneak
invisible[name].textures=user:get_properties().textures
invisible[name].collisionbox=user:get_properties().collisionbox
invisible[name].visual_size=user:get_properties().visual_size
user:set_properties({
--visual = "mesh",
visual = "node",
textures={"invisible_hidden.png"},
visual_size = {x=1, y=1},
collisionbox = {0,0,0, 0,0,0},
})
minetest.chat_send_player(name, "invisible on")
else
user:set_nametag_attributes({color = {a = 255, r = 255, g = 0, b = 0}})
user:set_properties({
--visual = "mesh",
visual = "mesh",
textures=invisible[name].textures,
visual_size = invisible[name].visual_size,
collisionbox=invisible[name].collisionbox
})
invisible[name]=nil
minetest.chat_send_player(name, "invisible off")
end
else
if not invisible[name] then
invisible[name]={}
user:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}})
else
user:set_nametag_attributes({color = {a = 255, r = 255, g = 255, b = 255}})
invisible[name]=nil
end
end
end
minetest.register_tool("es:tool", {
description = "invisible",
inventory_image = "default_stick.png",
groups = {not_in_creative_inventory=1},
on_use = function(itemstack, user, pointed_thing)
if minetest.check_player_privs(user:get_player_name(), {invisible=true}) then
invisible.toogle(user,true)
else
itemstack:replace(nil)
end
return itemstack
end
})
minetest.register_globalstep(function(dtime)
invisible.time=invisible.time+dtime
if invisible.time<0.5 then return end
invisible.time=0
for _, player in pairs(minetest.get_connected_players()) do
local name=player:get_player_name()
local sneak=player:get_player_control().sneak
if (sneak and not invisible[name]) or (sneak==false and invisible[name] and not invisible[name].tool) then
invisible.toogle(player)
end
end
end)

View File

@ -861,7 +861,7 @@ function default.register_biomes()
heat_point = 42,
humidity_point = 36,
})
minetest.register_biome({
name = "strangeland_ocean",
--node_dust = "",
@ -878,8 +878,8 @@ function default.register_biomes()
y_max = 4,
heat_point = 42,
humidity_point = 36,
})
})
minetest.register_biome({
name = "barren",
--node_dust = "",
@ -897,7 +897,7 @@ function default.register_biomes()
heat_point = 82,
humidity_point = 20,
})
minetest.register_biome({
name = "barren_ocean",
--node_dust = "",
@ -914,9 +914,9 @@ function default.register_biomes()
y_max = 31000,
heat_point = 82,
humidity_point = 20,
})
})
minetest.register_biome({
name = "clay",
--node_dust = "",
@ -1144,7 +1144,7 @@ function default.register_decorations()
--The buildings found in this mod (in the schems/ folder) have been built by
--AgentNagel42. See https://forum.minetest.net/viewtopic.php?f=5&t=13297
minetest.register_decoration({
deco_type = "schematic",
place_on = {"es:dry_dirt","es:aiden_grass","es:strange_grass","es:strange_clay_brown"},
@ -1164,8 +1164,8 @@ function default.register_decorations()
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"es:dry_dirt","es:aiden_grass","es:strange_clay_brown"},
@ -1184,8 +1184,8 @@ function default.register_decorations()
schematic = minetest.get_modpath("es").."/schematics/church_old.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"es:dry_dirt","es:aiden_grass","es:strange_clay_brown"},
@ -1204,7 +1204,7 @@ function default.register_decorations()
schematic = minetest.get_modpath("es").."/schematics/watchtower_old.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
})
minetest.register_decoration({
deco_type = "schematic",
@ -1633,6 +1633,43 @@ function default.register_decorations()
y_max = 31000,
decoration = "default:dry_shrub",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"es:strange_grass","es:aiden_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.002,
spread = {x = 200, y = 200, z = 200},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {"strangeland","aidenland"},
y_min = 2,
y_max = 31000,
decoration = "default:junglesapling",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"es:strange_grass","es:aiden_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.04,
spread = {x = 20, y = 10, z = 20},
seed = 329,
octaves = 3,
persist = 0.6
},
biomes = {"strangeland","aidenland"},
y_min = 2,
y_max = 31000,
decoration = "es:strange_shrub",
})
--ES
-- Junglegrass
@ -1733,10 +1770,9 @@ function default.register_decorations()
})
--bunker
--rubycane
minetest.register_decoration({
deco_type = "schematic",
place_on = {"es:aiden_grass"},
place_on = {"es:aiden_grass","default:dirt_with_snow"},
sidelen = 16,
noise_params = {
offset = 0,
@ -1746,7 +1782,7 @@ function default.register_decorations()
octaves = 3,
persist = 0.6
},
biomes = {"aidenland"},
biomes = {"aidenland","tundra","tiaga"},
y_min = 1,
y_max = 31000,
schematic = minetest.get_modpath("es").."/schematics/bunker.mts",

115
nodes.lua
View File

@ -252,12 +252,27 @@ minetest.register_node("es:hgglass", {
tiles = {"default_glass.png", "default_glass_detail.png"},
inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light",
buildable_to = false,
pointable = false,
sunlight_propagates = true,
is_ground_content = false,
groups = {immortal=1,cracky=0,not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_node("es:hgglass2", {
description = "High Density Glass II",
drawtype = "glasslike",
tiles = { "default_obsidian_glass.png"},
inventory_image = minetest.inventorycube("default_obsidian_glass.png"),
paramtype = "light",
buildable_to = false,
pointable = false,
sunlight_propagates = true,
is_ground_content = false,
groups = {immortal=1,cracky=0,not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_node("es:steelblock", {
description = "High Density Steel Block",
tiles = {"default_steel_block.png"},
@ -520,7 +535,7 @@ minetest.register_node("es:strange_grass", {
"default_clay.png",
{name = "default_clay.png^(default_dry_grass_side.png^[colorize:#00BBFF:130)",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1},
groups = {crumbly = 3, soil = 1, es_grass = 1},
drop = 'es:dry_dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
@ -531,9 +546,9 @@ minetest.register_node("es:aiden_grass", {
description = "Aiden Grass",
tiles = {("default_dry_grass.png^[colorize:#8A084B:160"),
"default_clay.png",
{name = "default_clay.png^(default_dry_grass_side.png^[colorize:#FFBBFF:160)",
{name = "default_clay.png^(default_dry_grass_side.png^[colorize:#8A084B:160)",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1},
groups = {crumbly = 3, soil = 1, es_grass = 1},
drop = 'es:dry_dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.25},
@ -604,11 +619,42 @@ minetest.register_node("es:strange_leaves", {
after_place_node = default.after_place_leaves,
})
minetest.register_node("es:strange_shrub", {
description = "Strange shrub",
drawtype = "plantlike",
light_source = 14,
paramtype = "light",
sunlight_propagates = true,
walkable = false,
tiles = {"default_jungleleaves.png^default_dry_shrub.png^[colorize:#0000FF:170"},
groups = {snappy = 3, flammable = 2, leaves = 1},
--[[
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:apple'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'default:stick'},
}
}
},
]]
sounds = default.node_sound_leaves_defaults(),
--after_place_node = default.after_place_leaves,
})
minetest.register_node("es:strange_clay_blue", {
description = "Strange Clay",
tiles = {"default_clay.png^[colorize:#00BBFF:180"},
groups = {crumbly = 3},
drop = 'default:clay_lump 4',
--drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})
@ -617,7 +663,7 @@ minetest.register_node("es:strange_clay_red", {
--tiles = {"default_clay.png^[colorize:#FA5858:180"},
tiles = {"default_clay.png^[colorize:#8A0829:180"},
groups = {crumbly = 3},
drop = 'default:clay_lump 4',
--drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})
@ -626,7 +672,7 @@ minetest.register_node("es:strange_clay_maroon", {
--tiles = {"default_clay.png^[colorize:#8A0808:180"},
tiles = {"default_clay.png^[colorize:#610B21:180"},
groups = {crumbly = 3},
drop = 'default:clay_lump 4',
--drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})
@ -1035,3 +1081,60 @@ minetest.register_node("es:lava_flowing", {
groups = {lava = 3, liquid = 2, hot = 3, igniter = 1,
not_in_creative_inventory = 1},
})
--[[
way too aggro
--From ethereal mod
-- check surrounding grass and change dirt to same colour (by Sokomine)
minetest.register_abm({
nodenames = {"default:dirt_with_grass","default:dirt_with_dry_grass"},
interval = 5,
chance = 2,
action = function(pos, node)
local count_grasses = {}
local curr_max = 0
local curr_type = "es:strange_grass" -- fallback Colour
local positions = minetest.find_nodes_in_area(
{x=(pos.x-2), y=(pos.y-2), z=(pos.z-2)},
{x=(pos.x+2), y=(pos.y+2), z=(pos.z+2)},
"group:es_grass")
-- count new grass nodes
for _,p in ipairs(positions) do
local n = minetest.get_node(p)
if n and n.name then
if not count_grasses[n.name] then
count_grasses[n.name] = 1
else
count_grasses[n.name] = count_grasses[n.name] + 1
end
-- we found a grass type with more than current max
if count_grasses[n.name] > curr_max then
curr_max = count_grasses[n.name]
curr_type = n.name
end
end
end
minetest.set_node(pos, {name = curr_type})
end
})
-- if grass devoid of light, change to dirt
minetest.register_abm({
nodenames = {"group:es_grass"},
interval = 2,
chance = 20,
action = function(pos, node)
local name = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"})
end
end
})
]]

View File

@ -379,7 +379,7 @@ minetest.register_ore({
y_max = -256,
})
minetest.register_ore({
minetest.register_ore({
ore_type = "scatter",
ore = "es:stone_with_mese",
wherein = "default:stone",
@ -411,7 +411,19 @@ minetest.register_ore({
y_max = -256,
})
minetest.register_ore({
minetest.register_ore({
ore_type = "scatter",
ore = "default:stone_with_diamond",
wherein = "default:stone",
clust_scarcity = 14 * 14 * 14,
clust_num_ores = 6,
clust_size = 5,
y_min = -15000,
y_max = -1256,
})
--liquids
minetest.register_ore({
ore_type = "blob",
ore = "default:lava_source",
wherein = "default:desert_stone",
@ -422,7 +434,7 @@ minetest.register_ore({
y_max = 1140,
})
minetest.register_ore({
minetest.register_ore({
ore_type = "blob",
ore = "default:lava_source",
wherein = "default:stone",
@ -433,7 +445,7 @@ minetest.register_ore({
y_max = 1140,
})
minetest.register_ore({
minetest.register_ore({
ore_type = "blob",
ore = "default:water_source",
wherein = "default:stone",
@ -446,7 +458,7 @@ minetest.register_ore({
minetest.register_ore({
minetest.register_ore({
ore_type = "scatter",
ore = "es:desert_stone_with_coal",
wherein = "default:desert_stone",
@ -458,7 +470,7 @@ minetest.register_ore({
})
-- Iron
minetest.register_ore({
minetest.register_ore({
ore_type = "scatter",
ore = "es:desert_stone_with_iron",
wherein = "default:desert_stone",
@ -470,7 +482,7 @@ minetest.register_ore({
})
minetest.register_ore({
minetest.register_ore({
ore_type = "scatter",
ore = "es:desert_stone_with_gold",
wherein = "default:desert_stone",

111
shutdown - Copy.lua Normal file
View File

@ -0,0 +1,111 @@
--Extreme Survival created by maikerumine
-- Minetest 0.4.13 mod: "Extreme Survival"
-- namespace: es
--https://github.com/maikerumine
--License:
--~~~~~~~~
--Code:
--(c) Copyright 2015 maikerumine; modified zlib-License
--see "LICENSE.txt" for details.
--Media(if not stated differently):
--(c) Copyright (2014-2015) maikerumine; CC-BY-SA 3.0
es = {}
--Fixer's code--v
--Modified by maikerumine
-- Time to shut down server.
-- Default is twice a day: at 06:05 and 18:05
local H = 00
local X = 06
local Y = 12
local Z = 18
local M = 00
local N = 01
-- Day to shut down server.
-- Default is daily shutdown
-- 1=Sunday, ..., 7=Saturday, nil=Shutdown daily
local D = nil
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer < 1 then return end
timer = 0
local t = os.date("*t")
if ((t.hour == H or t.hour == X or t.hour == Y or t.hour == Z) and (t.min == M) and (t.sec <= 2)
and ((D == nil) or (t.wday == D))) then
minetest.chat_send_all("Scheduled shutdown. 02, 06, 12, 18 Hours Eastern Time Zone "
.."Shutting down in ONE minute.")
minetest.chat_send_all("Do not use chests or inventory at this time. "
.."Shutting down in ONE minute.")
--minetest.after(2, minetest.request_shutdown)
end
if ((t.hour == H or t.hour == X or t.hour == Y or t.hour == Z) and (t.min ==N) and (t.sec <= 2)
and ((D == nil) or (t.wday == D))) then
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.after(2, minetest.request_shutdown)
end
end)
--[[
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer < 1 then return end
timer = 0
local t = os.date("*t")
if ((t.hour == H or t.hour == X or t.hour == Y or t.hour == Z) and (t.min ==N) and (t.sec <= 2)
and ((D == nil) or (t.wday == D))) then
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.chat_send_all("SHUTTING SERVER DOWN NOW!"
.." Please come back in a minute.")
minetest.after(2, minetest.request_shutdown)
end
end)
]]
--MAPFIX CODE
minetest.register_chatcommand("mapfix", {
params = "<size>",
description = "Recalculate the flowing liquids of a chunk",
func = function(name, param)
local pos = minetest.get_player_by_name(name):getpos()
local size = tonumber(param) or 40
if size > 50 and not minetest.check_player_privs(name, {server=true}) then
return false, "You need the server privilege to exceed the radius of 50 blocks"
end
local minp, maxp = {x = math.floor(pos.x - size), y = math.floor(pos.y - size), z = math.floor(pos.z - size)}, {x = math.ceil(pos.x + size), y = math.ceil(pos.y + size), z = math.ceil(pos.z + size)}
local vm = minetest.get_voxel_manip()
vm:read_from_map(minp, maxp)
vm:calc_lighting()
vm:update_liquids()
vm:write_to_map()
vm:update_map()
return true, "Done."
end,
})

View File

@ -41,7 +41,7 @@ minetest.register_globalstep(function(dtime)
local t = os.date("*t")
if ((t.hour == H or t.hour == X or t.hour == Y or t.hour == Z) and (t.min == M) and (t.sec <= 2)
and ((D == nil) or (t.wday == D))) then
minetest.chat_send_all("Scheduled shutdown. 02, 06, 12, 18 Hours Eastern Time Zone "
minetest.chat_send_all("Scheduled shutdown. 12:00 P.M. Eastern Time Zone --1600 UTC--"
.."Shutting down in ONE minute.")
minetest.chat_send_all("Do not use chests or inventory at this time. "
.."Shutting down in ONE minute.")

View File

@ -4,7 +4,7 @@ local spawn_limit_max = 180; -- how much time must elapse to be able to use spaw
spawn_prison = {}
spawn_prison.pos = {x=0, y=3, z=0}
spawn_prison.pos = {x=0, y=10006, z=0}
if minetest.setting_get_pos("static_spawnpoint") then
spawn_prison.pos = minetest.setting_get_pos("static_spawnpoint")

BIN
textures/black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

BIN
textures/sky_neg_x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 KiB

BIN
textures/sky_neg_y.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

BIN
textures/sky_neg_z.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

BIN
textures/sky_pos_x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 KiB

BIN
textures/sky_pos_y.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

BIN
textures/sky_pos_z.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB