Fix: temporary remove nyan cat, remove wisps and temporary remove skyrealms (not finished)
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 153 B |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 157 B |
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 137 B |
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 347 B |
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
26
mods/.skyrealms/LICENSE.txt
Normal file
|
@ -0,0 +1,26 @@
|
|||
Copyright (c) 2017, Craig Robbins and contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
48
mods/.skyrealms/README.md
Normal file
|
@ -0,0 +1,48 @@
|
|||
# caverealms-lite-plus
|
||||
|
||||
Based on Ezhh's cavereals-lite (https://github.com/Ezhh/caverealms_lite/), itself based on the original minetest-caverealms mod (https://github.com/HeroOfTheWinds/minetest-caverealms/).
|
||||
|
||||
Adds underground realms to minetest.
|
||||
|
||||
This mod may be used as a drop-in replacement for caverealms-lite. Newly generated blocks will show a sharp lurch in the biome type.
|
||||
|
||||
|
||||
## Changes from caverealms-lite
|
||||
|
||||
* Different biome algorithm based on independent Evil and Wonder noises, similar to heat and humidity above ground.
|
||||
* Biomes are larger.
|
||||
* Every biome has some sort of consistent light source
|
||||
* New biome type: geothermal hotsprings.
|
||||
* A few more node types similar to existing ones.
|
||||
* Various bug fixes.
|
||||
* Various new bugs ;)
|
||||
|
||||
|
||||
## Changes by Ezhh from caverealms to caverealms-lite
|
||||
|
||||
This caverealms fork provides all the biomes and decorations from the original caverealms, with several additions and without the overhead of generating caves. This lowers the server resources the mod requires, for example CPU and RAM. This also removes the large lava spills created by the original caverealms.
|
||||
|
||||
It is specifically written to work with the mgvalleys mapgen, but will work using other mapgens as well. The mapgen used will determine the shape and size of individual caves. Mapgens that generate only smaller caves may be less suitable for use with this fork than mgvalleys.
|
||||
|
||||
Note: For worlds where the original caverealms is already in use, this fork is not advised as a replacement. If used in this way, some unknown nodes and other minor issues should be expected.
|
||||
|
||||
|
||||
## License and Contributors
|
||||
|
||||
Source code: FreeBSD License (Simplified)
|
||||
The original caverealms was licensed as WTFPL.
|
||||
|
||||
Contributors:
|
||||
- yzziizzy - current version
|
||||
- Zeno, Shara RedCat - caverealms-lite
|
||||
- HeroOfTheWinds, Zeno - Original caverealms mod
|
||||
|
||||
|
||||
## Recommended Additions
|
||||
|
||||
- VanessaE's HDX texturepacks provide alternative textures. For example,
|
||||
https://gitlab.com/VanessaE/hdx-128.
|
||||
- ethereal mod unlocks additional content (https://notabug.org/tenplus1/ethereal).
|
||||
- mobs_monster mod allows Dungeon Masters to spawn in the Dungeon Master's Lair biome (https://notabug.org/tenplus1/mobs_monster).
|
||||
- mobs_redo is required to run mobs_monster (https://notabug.org/tenplus1/mobs_redo).
|
||||
- abritorch adds coloured torches made with caverealms items (https://github.com/Ezhh/abritorch).
|
54
mods/.skyrealms/config.lua
Normal file
|
@ -0,0 +1,54 @@
|
|||
local CONFIG_FILE_PREFIX = "caverealms."
|
||||
|
||||
caverealms.config = {}
|
||||
|
||||
-- This function based on kaeza/minetest-irc/config.lua and used under the
|
||||
-- terms of BSD 2-clause license.
|
||||
local function setting(stype, name, default)
|
||||
local value
|
||||
if stype == "bool" then
|
||||
value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name)
|
||||
elseif stype == "string" then
|
||||
value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
|
||||
elseif stype == "number" then
|
||||
value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
|
||||
end
|
||||
if value == nil then
|
||||
value = default
|
||||
end
|
||||
caverealms.config[name] = value
|
||||
end
|
||||
|
||||
--generation settings
|
||||
setting("number", "ymin", -15100) --bottom realm limit
|
||||
setting("number", "ymax", -4096) --top realm limit
|
||||
setting("number", "tcave", 0.75) --cave threshold
|
||||
|
||||
--decoration chances
|
||||
setting("number", "stagcha", 0.003) --chance of stalagmites 0.003
|
||||
setting("number", "stalcha", 0.003) --chance of stalactites 0.003
|
||||
|
||||
setting("number", "h_lag", 15) --max height for stalagmites
|
||||
setting("number", "h_lac", 20) --...stalactites
|
||||
setting("number", "crystal", 0.005) --chance of glow crystal formations (0.0004)
|
||||
setting("number", "salt_crystal", 0.005) --chance of glow crystal formations
|
||||
setting("number", "h_cry", 9) --max height of glow crystals
|
||||
setting("number", "h_clac", 13) --max height of glow crystal stalactites
|
||||
|
||||
setting("number", "gemcha", 0.03) --chance of small glow gems
|
||||
setting("number", "mushcha", 0.04) --chance of mushrooms
|
||||
setting("number", "myccha", 0.03) --chance of mycena mushrooms
|
||||
setting("number", "wormcha", 0.02) --chance of glow worms
|
||||
setting("number", "giantcha", 0.0015) --chance of giant mushrooms
|
||||
setting("number", "icicha", 0.035) --chance of icicles
|
||||
setting("number", "flacha", 0.04) --chance of constant flames
|
||||
|
||||
--realm limits for Dungeon Masters' Lair
|
||||
setting("number", "dm_top", -13000) --upper limit
|
||||
setting("number", "dm_bot", -15100) --lower limit
|
||||
|
||||
--should DMs spawn in DM Lair?
|
||||
setting("bool", "dm_spawn", true)
|
||||
|
||||
--Deep cave settings
|
||||
setting("number", "deep_cave", -7000) -- upper limit
|
181
mods/.skyrealms/crafting.lua
Normal file
|
@ -0,0 +1,181 @@
|
|||
--thin ice to water
|
||||
minetest.register_craft({
|
||||
output = "default:water_source",
|
||||
type = "shapeless",
|
||||
recipe = {"caverealms:thin_ice"}
|
||||
})
|
||||
|
||||
--use for coal dust
|
||||
minetest.register_craft({
|
||||
output = "default:coalblock",
|
||||
recipe = {
|
||||
{"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"},
|
||||
{"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"},
|
||||
{"caverealms:coal_dust","caverealms:coal_dust","caverealms:coal_dust"}
|
||||
}
|
||||
})
|
||||
|
||||
-- DM statue
|
||||
minetest.register_craft({
|
||||
output = "caverealms:dm_statue",
|
||||
recipe = {
|
||||
{"caverealms:glow_ore","caverealms:hot_cobble","caverealms:glow_ore"},
|
||||
{"caverealms:hot_cobble","caverealms:hot_cobble","caverealms:hot_cobble"},
|
||||
{"caverealms:hot_cobble","caverealms:hot_cobble","caverealms:hot_cobble"}
|
||||
}
|
||||
})
|
||||
|
||||
-- Glow obsidian brick
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_obsidian_brick 4",
|
||||
recipe = {
|
||||
{"caverealms:glow_obsidian", "caverealms:glow_obsidian"},
|
||||
{"caverealms:glow_obsidian", "caverealms:glow_obsidian"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_obsidian_brick_2 4",
|
||||
recipe = {
|
||||
{"caverealms:glow_obsidian_2", "caverealms:glow_obsidian_2"},
|
||||
{"caverealms:glow_obsidian_2", "caverealms:glow_obsidian_2"}
|
||||
}
|
||||
})
|
||||
|
||||
-- Glow obsidian glass
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_obsidian_glass 5",
|
||||
recipe = {
|
||||
{"default:glass", "default:glass", "default:glass"},
|
||||
{"default:glass", "default:glass", "caverealms:glow_obsidian"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_obsidian_glass 5",
|
||||
recipe = {
|
||||
{"default:glass", "default:glass", "default:glass"},
|
||||
{"default:glass", "default:glass", "caverealms:glow_obsidian_2"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("caverealms:glow_obsidian_shard", {
|
||||
description = "Glow Obsidian Shard",
|
||||
inventory_image = "caverealms_glow_obsidian_shard.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_obsidian_shard 9",
|
||||
type = "shapeless",
|
||||
recipe = {"caverealms:glow_obsidian"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_obsidian_shard 9",
|
||||
type = "shapeless",
|
||||
recipe = {"caverealms:glow_obsidian_2"},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_obsidian",
|
||||
recipe = {
|
||||
{"caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard"},
|
||||
{"caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard"},
|
||||
{"caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard", "caverealms:glow_obsidian_shard"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "caverealms:glow_obsidian_glass",
|
||||
recipe = "caverealms:glow_obsidian_shard",
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- Requires ethereal:fish_raw
|
||||
if minetest.get_modpath("ethereal") then
|
||||
|
||||
-- Professional Fishing Rod
|
||||
minetest.register_craftitem("caverealms:angler_rod", {
|
||||
description = "Pro Fishing Rod",
|
||||
inventory_image = "caverealms_angler_rod.png",
|
||||
wield_image = "caverealms_angler_rod.png"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "caverealms:angler_rod",
|
||||
recipe = {
|
||||
{"","","default:steel_ingot"},
|
||||
{"", "default:steel_ingot", "caverealms:mushroom_gills"},
|
||||
{"default:steel_ingot", "", "caverealms:mushroom_gills"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Glow Bait
|
||||
minetest.register_craftitem("caverealms:glow_bait", {
|
||||
description = "Glow Bait",
|
||||
inventory_image = "caverealms_glow_bait.png",
|
||||
wield_image = "caverealms_glow_bait.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "caverealms:glow_bait 9",
|
||||
recipe = {
|
||||
{"caverealms:glow_worm_green"},
|
||||
}
|
||||
})
|
||||
|
||||
-- default ethereal fish
|
||||
local fish = {
|
||||
{"ethereal:fish_raw"},
|
||||
}
|
||||
|
||||
-- Pro Fishing Rod (Baited)
|
||||
minetest.register_craftitem("caverealms:angler_rod_baited", {
|
||||
description = "Baited Pro Fishing Rod",
|
||||
inventory_image = "caverealms_angler_rod_baited.png",
|
||||
wield_image = "caverealms_angler_rod_weild.png",
|
||||
stack_max = 1,
|
||||
liquids_pointable = true,
|
||||
|
||||
on_use = function (itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pointed_thing.under).name
|
||||
|
||||
if (node == "default:water_source"
|
||||
or node == "default:river_water_source")
|
||||
and math.random(1, 100) < 35 then
|
||||
|
||||
local type = fish[math.random(1, #fish)][1]
|
||||
local inv = user:get_inventory()
|
||||
|
||||
if inv:room_for_item("main", {name = type}) then
|
||||
|
||||
inv:add_item("main", {name = type})
|
||||
|
||||
if (math.random() < 0.6) then
|
||||
return ItemStack("caverealms:angler_rod_baited")
|
||||
else
|
||||
return ItemStack("caverealms:angler_rod")
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(user:get_player_name(),
|
||||
"Inventory full, Fish Got Away!")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "caverealms:angler_rod_baited",
|
||||
recipe = {"caverealms:angler_rod", "caverealms:glow_bait"},
|
||||
})
|
||||
end
|
1
mods/.skyrealms/description.txt
Normal file
|
@ -0,0 +1 @@
|
|||
A mod for Minetest to add underground realms.
|
19
mods/.skyrealms/docs/caverealms_lite_biomes.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
Biome #, Biome name, "floor node"
|
||||
|
||||
|
||||
0, None
|
||||
1, Moss, "caverealms:stone_with_moss"
|
||||
2, Fungal, "caverealms:stone_with_lichen"
|
||||
3, Algae, "caverealms:stone_with_algae"
|
||||
4, Glaciated, "caverealms:thin_ice"
|
||||
|
||||
The following are "deep realms"
|
||||
|
||||
5, Deep Glaciated, "default:ice"
|
||||
6, DM, "caverealms:hot_cobble"
|
||||
7, Salt Crystal, "caverealms:stone_with_salt"
|
||||
8, Glow Obsidian, "caverealms:glow_obsidian"
|
||||
OR "caverealms:glow_obsidian2"
|
||||
9, Coal, "default:coalblock"
|
||||
OR "caverealms:coal_dust"
|
||||
OR "default:desert_sand"
|
16
mods/.skyrealms/dungeon_master.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
mobs:spawn({
|
||||
name = "mobs_monster:dungeon_master",
|
||||
nodes = {"caverealms:hot_cobble"},
|
||||
max_light = 12,
|
||||
min_light = 0,
|
||||
chance = 7000,
|
||||
active_object_count = 2,
|
||||
max_height = -8000,
|
||||
on_spawn = function(self, pos)
|
||||
self.hp_max = 70
|
||||
self.health = 70
|
||||
self.damage = 5
|
||||
self.shoot_interval = 1.5
|
||||
self.dogshoot_switch = 0
|
||||
end
|
||||
})
|
292
mods/.skyrealms/functions.lua
Normal file
|
@ -0,0 +1,292 @@
|
|||
local H_LAG = caverealms.config.h_lag --15 --max height for stalagmites
|
||||
local H_LAC = caverealms.config.h_lac --20 --...stalactites
|
||||
local H_CRY = caverealms.config.h_cry --9 --max height of glow crystals
|
||||
local H_CLAC = caverealms.config.h_clac --13 --max height of glow crystal stalactites
|
||||
|
||||
function caverealms:above_solid(x,y,z,area,data)
|
||||
local c_air = minetest.get_content_id("air")
|
||||
|
||||
local ai = area:index(x,y+1,z-3)
|
||||
if data[ai] == c_air then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function caverealms:below_solid(x,y,z,area,data)
|
||||
local c_air = minetest.get_content_id("air")
|
||||
|
||||
local ai = area:index(x,y-1,z-3)
|
||||
if data[ai] == c_air then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--stalagmite spawner
|
||||
function caverealms:stalagmite(x,y,z, area, data)
|
||||
|
||||
if not caverealms:below_solid(x,y,z,area,data) then
|
||||
return
|
||||
end
|
||||
|
||||
--contest ids
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
|
||||
local top = math.random(6,H_LAG) --grab a random height for the stalagmite
|
||||
for j = 0, top do --y
|
||||
for k = -3, 3 do
|
||||
for l = -3, 3 do
|
||||
if j == 0 then
|
||||
if k*k + l*l <= 9 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
elseif j <= top/5 then
|
||||
if k*k + l*l <= 4 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
elseif j <= top/5 * 3 then
|
||||
if k*k + l*l <= 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
else
|
||||
local vi = area:index(x, y+j, z-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--stalactite spawner
|
||||
function caverealms:stalactite(x,y,z, area, data)
|
||||
|
||||
if not caverealms:above_solid(x,y,z,area,data) then
|
||||
return
|
||||
end
|
||||
|
||||
--contest ids
|
||||
local c_stone = minetest.get_content_id("default:stone")--("caverealms:limestone")
|
||||
|
||||
local bot = math.random(-H_LAC, -6) --grab a random height for the stalagmite
|
||||
for j = bot, 0 do --y
|
||||
for k = -3, 3 do
|
||||
for l = -3, 3 do
|
||||
if j >= -1 then
|
||||
if k*k + l*l <= 9 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
elseif j >= bot/5 then
|
||||
if k*k + l*l <= 4 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
elseif j >= bot/5 * 3 then
|
||||
if k*k + l*l <= 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
else
|
||||
local vi = area:index(x, y+j, z-3)
|
||||
data[vi] = c_stone
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--glowing crystal stalagmite spawner
|
||||
function caverealms:crystal_stalagmite(x,y,z, area, data, ore, crystal, base)
|
||||
|
||||
if not caverealms:below_solid(x,y,z,area,data) then
|
||||
return
|
||||
end
|
||||
|
||||
--contest ids
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
|
||||
local nid_a = ore -- ore
|
||||
local nid_b = crystal -- crystal
|
||||
local nid_s = base or c_stone --base --stone base, will be rewritten to ice in certain biomes
|
||||
|
||||
local top = math.random(5,H_CRY) --grab a random height for the stalagmite
|
||||
for j = 0, top do --y
|
||||
for k = -3, 3 do
|
||||
for l = -3, 3 do
|
||||
if j == 0 then
|
||||
if k*k + l*l <= 9 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_s
|
||||
end
|
||||
elseif j <= top/5 then
|
||||
if k*k + l*l <= 4 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_a
|
||||
end
|
||||
elseif j <= top/5 * 3 then
|
||||
if k*k + l*l <= 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_b
|
||||
end
|
||||
else
|
||||
local vi = area:index(x, y+j, z-3)
|
||||
data[vi] = nid_b
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--crystal stalactite spawner
|
||||
function caverealms:crystal_stalactite(x,y,z, area, data, ore, cry, base)
|
||||
|
||||
if not caverealms:above_solid(x,y,z,area,data) then
|
||||
return
|
||||
end
|
||||
|
||||
--contest ids
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
|
||||
local nid_a = ore
|
||||
local nid_b = cry
|
||||
local nid_s = base or c_stone --stone base, will be rewritten to ice in certain biomes
|
||||
|
||||
local bot = math.random(-H_CLAC, -6) --grab a random height for the stalagmite
|
||||
for j = bot, 0 do --y
|
||||
for k = -3, 3 do
|
||||
for l = -3, 3 do
|
||||
if j >= -1 then
|
||||
if k*k + l*l <= 9 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_s
|
||||
end
|
||||
elseif j >= bot/5 then
|
||||
if k*k + l*l <= 4 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_a
|
||||
end
|
||||
elseif j >= bot/5 * 3 then
|
||||
if k*k + l*l <= 1 then
|
||||
local vi = area:index(x+k, y+j, z+l-3)
|
||||
data[vi] = nid_b
|
||||
end
|
||||
else
|
||||
local vi = area:index(x, y+j, z-3)
|
||||
data[vi] = nid_b
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--glowing crystal stalagmite spawner
|
||||
function caverealms:salt_stalagmite(x,y,z, area, data)
|
||||
|
||||
if not caverealms:below_solid(x,y,z,area,data) then
|
||||
return
|
||||
end
|
||||
|
||||
--contest ids
|
||||
-- local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_salt = minetest.get_content_id("caverealms:salt_crystal")
|
||||
local c_salt_stone = minetest.get_content_id("caverealms:stone_with_salt")
|
||||
|
||||
local scale = math.random(2, 4)
|
||||
if scale == 2 then
|
||||
for j = -3, 3 do
|
||||
for k = -3, 3 do
|
||||
local vi = area:index(x+j, y, z+k)
|
||||
data[vi] = c_salt_stone
|
||||
if math.abs(j) ~= 3 and math.abs(k) ~= 3 then
|
||||
local vi = area:index(x+j, y+1, z+k)
|
||||
data[vi] = c_salt_stone
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
for j = -4, 4 do
|
||||
for k = -4, 4 do
|
||||
local vi = area:index(x+j, y, z+k)
|
||||
data[vi] = c_salt_stone
|
||||
if math.abs(j) ~= 4 and math.abs(k) ~= 4 then
|
||||
local vi = area:index(x+j, y+1, z+k)
|
||||
data[vi] = c_salt_stone
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for j = 2, scale + 2 do --y
|
||||
for k = -2, scale - 2 do
|
||||
for l = -2, scale - 2 do
|
||||
local vi = area:index(x+k, y+j, z+l)
|
||||
data[vi] = c_salt -- make cube
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--function to create giant 'shrooms
|
||||
function caverealms:giant_shroom(x, y, z, area, data)
|
||||
|
||||
if not caverealms:below_solid(x,y,z,area,data) then
|
||||
return
|
||||
end
|
||||
|
||||
local c_cap
|
||||
local c_stem
|
||||
|
||||
--as usual, grab the content ID's
|
||||
if minetest.get_modpath("ethereal") then
|
||||
c_stem = minetest.get_content_id("ethereal:mushroom_trunk")
|
||||
c_cap = minetest.get_content_id("ethereal:mushroom")
|
||||
else
|
||||
c_stem = minetest.get_content_id("caverealms:mushroom_stem")
|
||||
c_cap = minetest.get_content_id("caverealms:mushroom_cap")
|
||||
end
|
||||
|
||||
local c_gills = minetest.get_content_id("caverealms:mushroom_gills")
|
||||
|
||||
z = z - 5
|
||||
--cap
|
||||
for k = -5, 5 do
|
||||
for l = -5, 5 do
|
||||
if k*k + l*l <= 25 then
|
||||
local vi = area:index(x+k, y+5, z+l)
|
||||
data[vi] = c_cap
|
||||
end
|
||||
if k*k + l*l <= 16 then
|
||||
local vi = area:index(x+k, y+6, z+l)
|
||||
data[vi] = c_cap
|
||||
vi = area:index(x+k, y+5, z+l)
|
||||
data[vi] = c_gills
|
||||
end
|
||||
if k*k + l*l <= 9 then
|
||||
local vi = area:index(x+k, y+7, z+l)
|
||||
data[vi] = c_cap
|
||||
end
|
||||
if k*k + l*l <= 4 then
|
||||
local vi = area:index(x+k, y+8, z+l)
|
||||
data[vi] = c_cap
|
||||
end
|
||||
end
|
||||
end
|
||||
--stem
|
||||
for j = 0, 5 do
|
||||
for k = -1,1 do
|
||||
local vi = area:index(x+k, y+j, z)
|
||||
data[vi] = c_stem
|
||||
if k == 0 then
|
||||
local ai = area:index(x, y+j, z+1)
|
||||
data[ai] = c_stem
|
||||
ai = area:index(x, y+j, z-1)
|
||||
data[ai] = c_stem
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
481
mods/.skyrealms/hotsprings.lua
Normal file
|
@ -0,0 +1,481 @@
|
|||
--[[
|
||||
minetest.register_node("caverealms:hotspring_seed", {
|
||||
description = "Hotspring seed",
|
||||
drawtype = "node",
|
||||
tiles = {"default_mese_block.png"},
|
||||
groups = {cracky=3,},
|
||||
})
|
||||
]]
|
||||
|
||||
minetest.register_node("caverealms:sulphur_deposit_1", {
|
||||
description = "Sulphur",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"default_silver_sandstone.png^[colorize:yellow:140"},
|
||||
-- drops = {},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-.3, -.5, -.3, -0.1, -.45, -0.1},
|
||||
{.3, -.5, .3, 0.1, -.45, 0.1,},
|
||||
{-.3, -.5, .3, -0.1, -.45, 0.1},
|
||||
},
|
||||
},
|
||||
groups = {cracky=3, geode_wall = 1 },
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("caverealms:fumarole", {
|
||||
description = "Fumarole",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"default_stone.png^[colorize:black:10"},
|
||||
drop = 'default:cobble',
|
||||
damage_per_second = 3,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-.4, -.5, -.4, 0.3, -.4, 0.3},
|
||||
{-.3+.05, -.4, -.3+.05, 0.2+.05, -.3, 0.2+.05},
|
||||
{-.2+.08, -.3, -.2+.08, 0.1+.08, -.2, 0.1+.08},
|
||||
},
|
||||
},
|
||||
groups = {cracky=3, },
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = "caverealms:fumarole",
|
||||
chance = 1,
|
||||
interval = 20,
|
||||
action = function(pos, node)
|
||||
pos.y = pos.y + 0
|
||||
minetest.add_particlespawner({
|
||||
amount = 20,
|
||||
time = 20,
|
||||
minpos = pos,
|
||||
maxpos = pos,
|
||||
minvel = {x=-0.1, y=.6, z=-0.1},
|
||||
maxvel = {x=0.1, y=1.6, z=0.1},
|
||||
minacc = {x=-0.1, y=.1, z=-0.1},
|
||||
maxacc = {x=0.1, y=.1, z=0.1},
|
||||
minexptime = 2.5,
|
||||
maxexptime = 4.5,
|
||||
minsize = 4.2,
|
||||
maxsize = 5.2,
|
||||
texture = "tnt_smoke.png",
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_node("caverealms:hotspring_water_source", {
|
||||
description = "Hotspring Water Source",
|
||||
drawtype = "liquid",
|
||||
light_source = 7,
|
||||
tiles = {
|
||||
{
|
||||
name = "default_river_water_source_animated.png^[colorize:yellow:50",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2.0,
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "default_river_water_source_animated.png^[colorize:yellow:50",
|
||||
backface_culling = true,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 2.0,
|
||||
},
|
||||
},
|
||||
},
|
||||
alpha = 160,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "caverealms:hotspring_water_flowing",
|
||||
liquid_alternative_source = "caverealms:hotspring_water_source",
|
||||
liquid_viscosity = 1,
|
||||
-- Not renewable to avoid horizontal spread of water sources in sloping
|
||||
-- rivers that can cause water to overflow riverbanks and cause floods.
|
||||
-- River water source is instead made renewable by the 'force renew'
|
||||
-- option used in the 'bucket' mod by the river water bucket.
|
||||
liquid_renewable = false,
|
||||
liquid_range = 2,
|
||||
damage_per_second = 1,
|
||||
post_effect_color = {a = 103, r = 60, g = 96, b = 90},
|
||||
groups = {water = 3, liquid = 3, cools_lava = 1},
|
||||
sounds = default.node_sound_water_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("caverealms:hotspring_water_flowing", {
|
||||
description = "Flowing Hotspring Water",
|
||||
drawtype = "flowingliquid",
|
||||
tiles = {"default_river_water.png^[colorize:yellow:50"},
|
||||
special_tiles = {
|
||||
{
|
||||
name = "default_river_water_flowing_animated.png^[colorize:yellow:50",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
{
|
||||
name = "default_river_water_flowing_animated.png^[colorize:yellow:50",
|
||||
backface_culling = true,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
alpha = 160,
|
||||
paramtype = "light",
|
||||
paramtype2 = "flowingliquid",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = false,
|
||||
drop = "",
|
||||
drowning = 1,
|
||||
liquidtype = "flowing",
|
||||
liquid_alternative_flowing = "caverealms:hotspring_water_flowing",
|
||||
liquid_alternative_source = "caverealms:hotspring_water_source",
|
||||
liquid_viscosity = 1,
|
||||
liquid_renewable = false,
|
||||
liquid_range = 2,
|
||||
damage_per_second = 1,
|
||||
post_effect_color = {a = 103, r = 60, g = 96, b = 90},
|
||||
groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
|
||||
cools_lava = 1},
|
||||
sounds = default.node_sound_water_defaults(),
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_node("caverealms:scalding_stone_1", {
|
||||
description = "Scalding Stone",
|
||||
tiles = {"default_stone.png^[colorize:orange:120"},
|
||||
groups = {cracky = 3, scalding_stone = 1},
|
||||
drop = 'default:cobble',
|
||||
damage_per_second = 1,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("caverealms:scalding_stone_2", {
|
||||
description = "Scalding Stone",
|
||||
tiles = {"default_stone.png^[colorize:yellow:80"},
|
||||
groups = {cracky = 3, scalding_stone = 1},
|
||||
drop = 'default:cobble',
|
||||
damage_per_second = 1,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("caverealms:scalding_stone_3", {
|
||||
description = "Scalding Stone",
|
||||
tiles = {"default_desert_stone.png^[colorize:orange:120"},
|
||||
groups = {cracky = 3, scalding_stone = 1},
|
||||
drop = 'default:cobble',
|
||||
damage_per_second = 1,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("caverealms:scalding_stone_4", {
|
||||
description = "Scalding Stone",
|
||||
tiles = {"default_desert_stone.png^[colorize:yellow:80"},
|
||||
groups = {cracky = 3, scalding_stone = 1},
|
||||
drop = 'default:cobble',
|
||||
damage_per_second = 1,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("caverealms:scalding_stone_5", {
|
||||
description = "Scalding Stone",
|
||||
tiles = {"default_stone.png^[colorize:red:80"},
|
||||
groups = {cracky = 3, scalding_stone = 1},
|
||||
drop = 'default:cobble',
|
||||
damage_per_second = 1,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
|
||||
|
||||
local scalding_stones = {
|
||||
minetest.get_content_id("caverealms:scalding_stone_1"),
|
||||
minetest.get_content_id("caverealms:scalding_stone_2"),
|
||||
minetest.get_content_id("caverealms:scalding_stone_3"),
|
||||
minetest.get_content_id("caverealms:scalding_stone_4"),
|
||||
minetest.get_content_id("caverealms:scalding_stone_5"),
|
||||
}
|
||||
|
||||
local scalding_stone_names = {
|
||||
"caverealms:scalding_stone_1",
|
||||
"caverealms:scalding_stone_2",
|
||||
"caverealms:scalding_stone_3",
|
||||
"caverealms:scalding_stone_4",
|
||||
"caverealms:scalding_stone_5",
|
||||
}
|
||||
|
||||
|
||||
local function dist3(a, b)
|
||||
local x = a.x - b.x
|
||||
local y = a.y - b.y
|
||||
local z = a.z - b.z
|
||||
return math.sqrt(x*x + y*y + z*z)
|
||||
end
|
||||
|
||||
-- local function spawn_hotspring(pos, size)
|
||||
function caverealms:spawn_hotspring(px,py,pz, area, data, size)
|
||||
|
||||
local c_hotspring = minetest.get_content_id("caverealms:hotspring_water_source")
|
||||
|
||||
|
||||
local r = size
|
||||
|
||||
local r2 = math.ceil(r+1)
|
||||
|
||||
for x = px-r2,px+r2,1 do
|
||||
for y = -r2,r2,1 do
|
||||
for z = pz-r2,pz+r2,1 do
|
||||
local p = {x=x, y=py+y, z=z}
|
||||
local p_squash = {x=x, y=py + (y*2), z=z}
|
||||
local d = dist3(p_squash, {x=px, y=py, z=pz})
|
||||
|
||||
d = d + math.random() * .5
|
||||
|
||||
local dd = d - r
|
||||
|
||||
local n = minetest.get_node(p)
|
||||
if n.name ~= "air" then
|
||||
if dd <= -.5 then
|
||||
local vi = area:index(x, py+y, z)
|
||||
data[vi] = c_hotspring
|
||||
elseif dd < 1.5 then
|
||||
local vi = area:index(x, py+y, z)
|
||||
data[vi] = scalding_stones[math.random(#scalding_stones)]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = "caverealms:hotspring_water_source",
|
||||
chance = 60,
|
||||
interval = 5,
|
||||
action = function(pos, node)
|
||||
minetest.add_particlespawner({
|
||||
amount = 1,
|
||||
time = 1,
|
||||
minpos = pos,
|
||||
maxpos = pos,
|
||||
minvel = {x=-0.1, y=.6, z=-0.1},
|
||||
maxvel = {x=0.1, y=1.6, z=0.1},
|
||||
minacc = {x=-0.1, y=.1, z=-0.1},
|
||||
maxacc = {x=0.1, y=.1, z=0.1},
|
||||
minexptime = 3.5,
|
||||
maxexptime = 6.5,
|
||||
minsize = 10.2,
|
||||
maxsize = 12.2,
|
||||
texture = "tnt_smoke.png",
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
local function random_pos(pos, dist)
|
||||
local p = {
|
||||
x=pos.x + math.random(-dist, dist),
|
||||
y=pos.y + dist,
|
||||
z=pos.z + math.random(-dist, dist),
|
||||
}
|
||||
|
||||
while p.y > pos.y - dist do
|
||||
local n = minetest.get_node(p)
|
||||
if n.name ~= "air" and n.name ~= "ignore" then
|
||||
if n.name == "default:water_source" or n.name == "default:water_flowing" then
|
||||
return nil
|
||||
end
|
||||
|
||||
return p
|
||||
end
|
||||
|
||||
p.y = p.y - 1
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- life dies near hotsprings
|
||||
minetest.register_abm({
|
||||
nodenames = "group:flora",
|
||||
neighbors = {"group:scalding_stone"},
|
||||
chance = 10,
|
||||
interval = 15,
|
||||
action = function(pos, node)
|
||||
minetest.set_node(pos, {name="air"})
|
||||
end
|
||||
})
|
||||
|
||||
-- life dies near hotsprings
|
||||
minetest.register_abm({
|
||||
nodenames = "group:flora",
|
||||
neighbors = {"group:scalding_stone"},
|
||||
chance = 80,
|
||||
interval = 15,
|
||||
action = function(pos, node)
|
||||
local p = minetest.find_node_near(pos, 15, {"group:flora", "group:sapling", "group:leaves", "group:leafdecay"})
|
||||
if p then
|
||||
minetest.set_node(p, {name="air"})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- minerals accumulate
|
||||
minetest.register_abm({
|
||||
nodenames = "group:scalding_stone",
|
||||
neighbors = {"air"},
|
||||
chance = 180,
|
||||
interval = 30,
|
||||
action = function(pos, node)
|
||||
-- TODO: place sulphur on sides too
|
||||
pos.y = pos.y + 1
|
||||
local n = minetest.get_node(pos)
|
||||
if n.name == "air" then
|
||||
minetest.set_node(pos, {name="caverealms:sulphur_deposit_1"})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- water scalds stone
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:stone", "group:dirt"},
|
||||
neighbors = {"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"},
|
||||
chance = 80,
|
||||
interval = 10,
|
||||
action = function(pos, node)
|
||||
minetest.set_node(pos, {name=scalding_stone_names[math.random(#scalding_stone_names)]})
|
||||
end
|
||||
})
|
||||
|
||||
-- stones scald dirt
|
||||
minetest.register_abm({
|
||||
nodenames = "group:soil",
|
||||
neighbors = {"group:scalding_stone"},
|
||||
chance = 80,
|
||||
interval = 10,
|
||||
action = function(pos, node)
|
||||
minetest.set_node(pos, {name="default:stone"})
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- water melts snow
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:snow", "default:snowblock"},
|
||||
neighbors = {"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"},
|
||||
chance = 80,
|
||||
interval = 10,
|
||||
action = function(pos, node)
|
||||
minetest.set_node(pos, {name="air"})
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
--[[ add hotspring seeds to mapgen
|
||||
minetest.register_decoration({
|
||||
name = "caverealms:hotspring_seed",
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass", "default:dirt_with_snow", "default:snowblock",
|
||||
"default:silver_sand", "default:sand", "default:desert_sand"
|
||||
},
|
||||
place_offset_y = 1,
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = -0.010,
|
||||
scale = 0.01,
|
||||
spread = {x = 200, y = 200, z = 200},
|
||||
seed = 65645647,
|
||||
octaves = 3,
|
||||
persist = 0.7,
|
||||
},
|
||||
biomes = {"grassland", "snowy_grassland", "tundra", "taiga", "desert", "cold_desert", "sandstone_desert"},
|
||||
y_max = 1000,
|
||||
y_min = 5,
|
||||
place_offset_y = 1,
|
||||
decoration = "caverealms:hotspring_seed",
|
||||
flags = "force_placement",
|
||||
})
|
||||
]]
|
||||
|
||||
-- hotsprings boil rivers
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:river_water_source"},
|
||||
neighbors = {"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"},
|
||||
chance = 15,
|
||||
interval = 5,
|
||||
action = function(pos, node)
|
||||
|
||||
-- only spread downhill
|
||||
local hw = minetest.find_nodes_in_area(
|
||||
{x=pos.x-1, y=pos.y, z=pos.z-1},
|
||||
{x=pos.x+1, y=pos.y+1, z=pos.z+1},
|
||||
{"caverealms:hotspring_water_source", "caverealms:hotspring_water_flowing"})
|
||||
|
||||
if not hw or #hw == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- don't spread under rivers
|
||||
pos.y = pos.y + 1
|
||||
local n = minetest.get_node(pos)
|
||||
if n.name == "default:river_water_source" or n.name == "default:river_water_flowing" then
|
||||
return
|
||||
end
|
||||
|
||||
pos.y = pos.y - 1
|
||||
|
||||
minetest.set_node(pos, {name="caverealms:hotspring_water_source"})
|
||||
end
|
||||
})
|
||||
|
868
mods/.skyrealms/init.lua
Normal file
|
@ -0,0 +1,868 @@
|
|||
caverealms = {} --create a container for functions and constants
|
||||
|
||||
local function table_contains(tbl, val)
|
||||
for _, v in pairs(tbl) do
|
||||
if v == val then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--grab a shorthand for the filepath of the mod
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
--[[
|
||||
-- debug privileges
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
|
||||
local privs = minetest.get_player_privs(name)
|
||||
|
||||
privs.fly = true
|
||||
privs.fast = true
|
||||
privs.teleport = true
|
||||
privs.noclip = true
|
||||
minetest.set_player_privs(name, privs)
|
||||
|
||||
local p = player:get_pos()
|
||||
if p.y > -100 then
|
||||
player:set_pos({x=0, y=-20000, z= 0})
|
||||
end
|
||||
end)
|
||||
--]]
|
||||
|
||||
--load companion lua files
|
||||
dofile(modpath .. "/config.lua") --configuration file; holds various constants
|
||||
dofile(modpath .. "/crafting.lua") --crafting recipes
|
||||
dofile(modpath .. "/nodes.lua") --node definitions
|
||||
dofile(modpath .. "/functions.lua") --function definitions
|
||||
dofile(modpath .. "/plants.lua")
|
||||
dofile(modpath .. "/hotsprings.lua")
|
||||
|
||||
if minetest.get_modpath("mobs_monster") then
|
||||
if caverealms.config.dm_spawn == true then
|
||||
dofile(modpath .. "/dungeon_master.lua") --special DMs for DM's Lair biome
|
||||
end
|
||||
end
|
||||
|
||||
-- Parameters
|
||||
|
||||
local YMIN = caverealms.config.ymin -- Approximate realm limits.
|
||||
local YMAX = caverealms.config.ymax
|
||||
local TCAVE = caverealms.config.tcave --0.5 -- Cave threshold. 1 = small rare caves, 0.5 = 1/3rd ground volume, 0 = 1/2 ground volume
|
||||
local BLEND = 128 -- Cave blend distance near YMIN, YMAX
|
||||
|
||||
local STAGCHA = caverealms.config.stagcha --0.002 --chance of stalagmites
|
||||
local STALCHA = caverealms.config.stalcha --0.003 --chance of stalactites
|
||||
local CRYSTAL = caverealms.config.crystal --0.0004 --chance of glow crystal formations
|
||||
local SALTCRYCHA = caverealms.config.salt_crystal --0.007 --chance of salt crystal cubes
|
||||
local GEMCHA = caverealms.config.gemcha --0.03 --chance of small glow gems
|
||||
local HOTSCHA = 0.009 --chance of hotsprings
|
||||
local MUSHCHA = caverealms.config.mushcha --0.04 --chance of mushrooms
|
||||
local MYCCHA = caverealms.config.myccha --0.03 --chance of mycena mushrooms
|
||||
local WORMCHA = caverealms.config.wormcha --0.03 --chance of glow worms
|
||||
local GIANTCHA = caverealms.config.giantcha --0.001 -- chance of giant mushrooms
|
||||
local ICICHA = caverealms.config.icicha --0.035 -- chance of icicles
|
||||
local FLACHA = caverealms.config.flacha --0.04 --chance of constant flames
|
||||
|
||||
local DM_TOP = caverealms.config.dm_top -- -4000 --level at which Dungeon Master Realms start to appear
|
||||
local DM_BOT = caverealms.config.dm_bot -- -5000 --level at which "" ends
|
||||
local DEEP_CAVE = caverealms.config.deep_cave -- -7000 --level at which deep cave biomes take over
|
||||
|
||||
-- 3D noise for caves
|
||||
|
||||
local np_cave = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = { x = 512, y = 256, z = 512 }, -- squashed 2:1
|
||||
seed = 59033,
|
||||
octaves = 6,
|
||||
persist = 0.63,
|
||||
}
|
||||
|
||||
-- 3D noise for wave
|
||||
|
||||
local np_wave = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = { x = 256, y = 256, z = 256 },
|
||||
seed = -400000000089,
|
||||
octaves = 3,
|
||||
persist = 0.67,
|
||||
}
|
||||
|
||||
-- 2D noise for biome
|
||||
|
||||
local np_biome = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = { x = 250, y = 250, z = 250 },
|
||||
seed = 9130,
|
||||
octaves = 3,
|
||||
persist = 0.5,
|
||||
}
|
||||
|
||||
-- 2D noise for biome
|
||||
|
||||
local np_biome_evil = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = { x = 200, y = 200, z = 200 },
|
||||
seed = 9130,
|
||||
octaves = 3,
|
||||
persist = 0.5,
|
||||
}
|
||||
|
||||
local np_biome_wonder = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
spread = { x = 400, y = 400, z = 400 },
|
||||
seed = 8943,
|
||||
octaves = 2,
|
||||
persist = 0.45,
|
||||
}
|
||||
|
||||
-- Stuff
|
||||
|
||||
subterrain = {}
|
||||
|
||||
local yblmin = YMIN + BLEND * 1.5
|
||||
local yblmax = YMAX - BLEND * 1.5
|
||||
|
||||
-- On generated function
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
--if out of range of caverealms limits
|
||||
if minp.y > YMAX or maxp.y < YMIN then
|
||||
return --quit; otherwise, you'd have stalagmites all over the place
|
||||
end
|
||||
|
||||
--easy reference to commonly used values
|
||||
local t1 = os.clock()
|
||||
local x1 = maxp.x
|
||||
local y1 = maxp.y
|
||||
local z1 = maxp.z
|
||||
local x0 = minp.x
|
||||
local y0 = minp.y
|
||||
local z0 = minp.z
|
||||
|
||||
--print ("[caverealms] chunk minp ("..x0.." "..y0.." "..z0..")") --tell people you are generating a chunk
|
||||
|
||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
||||
local area = VoxelArea:new({ MinEdge = emin, MaxEdge = emax })
|
||||
local data = vm:get_data()
|
||||
local vparam2 = vm:get_param2_data()
|
||||
|
||||
--grab content IDs
|
||||
local c_air = minetest.get_content_id("air")
|
||||
local c_stone = minetest.get_content_id("default:stone")
|
||||
local c_desertstone = minetest.get_content_id("default:desert_stone")
|
||||
local c_sandstone = minetest.get_content_id("default:sandstone")
|
||||
local c_obsidian = minetest.get_content_id("default:obsidian")
|
||||
local c_sand = minetest.get_content_id("default:sand")
|
||||
|
||||
local c_water = minetest.get_content_id("default:water_source")
|
||||
local c_lava = minetest.get_content_id("default:lava_source")
|
||||
local c_iced = minetest.get_content_id("default:ice")
|
||||
local c_ssand = minetest.get_content_id("default:silver_sand")
|
||||
local c_thinice = minetest.get_content_id("caverealms:thin_ice")
|
||||
local c_crystal = minetest.get_content_id("caverealms:glow_crystal")
|
||||
local c_gem = minetest.get_content_id("caverealms:glow_gem")
|
||||
local c_saltgem = minetest.get_content_id("caverealms:salt_gem")
|
||||
print(c_saltgem)
|
||||
|
||||
local c_spike = minetest.get_content_id("caverealms:spike")
|
||||
local c_moss = minetest.get_content_id("caverealms:stone_with_moss")
|
||||
local c_lichen = minetest.get_content_id("caverealms:stone_with_lichen")
|
||||
local c_algae = minetest.get_content_id("caverealms:stone_with_algae")
|
||||
local c_salt = minetest.get_content_id("caverealms:stone_with_salt")
|
||||
local c_hcobble = minetest.get_content_id("caverealms:hot_cobble")
|
||||
local c_gobsidian = minetest.get_content_id("caverealms:glow_obsidian")
|
||||
local c_gobsidian2 = minetest.get_content_id("caverealms:glow_obsidian_2")
|
||||
local c_coalblock = minetest.get_content_id("default:coalblock")
|
||||
local c_desand = minetest.get_content_id("default:desert_sand")
|
||||
local c_coaldust = minetest.get_content_id("caverealms:coal_dust")
|
||||
local c_fungus = minetest.get_content_id("caverealms:fungus")
|
||||
local c_mycena = minetest.get_content_id("caverealms:mycena")
|
||||
local c_worm_blue = minetest.get_content_id("caverealms:glow_worm")
|
||||
local c_worm_green = minetest.get_content_id("caverealms:glow_worm_green")
|
||||
local c_worm_red = minetest.get_content_id("caverealms:glow_worm_red")
|
||||
local c_fire_vine = minetest.get_content_id("caverealms:fire_vine")
|
||||
local c_iciu = minetest.get_content_id("caverealms:icicle_up")
|
||||
local c_icid = minetest.get_content_id("caverealms:icicle_down")
|
||||
local c_flame = minetest.get_content_id("caverealms:constant_flame")
|
||||
local c_bflame = minetest.get_content_id("caverealms:constant_flame_blue")
|
||||
local c_firefly = minetest.get_content_id("fireflies:firefly")
|
||||
local c_bluefly = minetest.get_content_id("caverealms:butterfly_blue")
|
||||
|
||||
-- ethereal
|
||||
--if minetest.get_modpath("ethereal") then
|
||||
local c_bluegrass = minetest.get_content_id("ethereal:crystalgrass")
|
||||
local c_greemush = minetest.get_content_id("ethereal:illumishroom2")
|
||||
local c_redmush = minetest.get_content_id("ethereal:illumishroom")
|
||||
--else
|
||||
--end
|
||||
|
||||
--too_many_stones
|
||||
--if minetest.get_modpath("too_many_stones") then
|
||||
local c_torangecrys = minetest.get_content_id("too_many_stones:crocoite_crystal")
|
||||
local c_tredcrys = minetest.get_content_id("too_many_stones:eudialite_crystal")
|
||||
local c_fakesalt = minetest.get_content_id("too_many_stones:rose_quartz_crystal") --
|
||||
local c_tyellocrys = minetest.get_content_id("too_many_stones:citrine_crystal")
|
||||
local c_tsmokecrys = minetest.get_content_id("too_many_stones:smokey_quartz_crystal")
|
||||
local c_tyellowcrys = minetest.get_content_id("too_many_stones:heliodor_crystal")
|
||||
local c_tgreen1crys = minetest.get_content_id("too_many_stones:tourmaline_green_crystal")
|
||||
local c_tgreen2crys = minetest.get_content_id("too_many_stones:prasiolite_crystal")
|
||||
local c_fakeice1 = minetest.get_content_id("too_many_stones:celestine_crystal")
|
||||
local c_fakeice2 = minetest.get_content_id("too_many_stones:moonstone_crystal")
|
||||
local c_fakeice3 = minetest.get_content_id("too_many_stones:quartz_crystal")
|
||||
print(c_fakeice3)
|
||||
|
||||
--else
|
||||
--end
|
||||
|
||||
--everness
|
||||
--if minetest.get_modpath("everness") then
|
||||
local c_bluetwist = minetest.get_content_id("everness:twisted_crystal_grass")
|
||||
local c_icevine = minetest.get_content_id("everness:lumabus_vine_1")
|
||||
local c_purplevine = minetest.get_content_id("everness:whispering_gourd_vine_1")
|
||||
local c_icicles_c = minetest.get_content_id("everness:frosted_icicle")
|
||||
local c_icicles_f = minetest.get_content_id("everness:frosted_icicle_floor")
|
||||
local c_crystcyan = minetest.get_content_id("everness:crystal_cyan") --
|
||||
local c_crystorange = minetest.get_content_id("everness:crystal_orange") --
|
||||
local c_crystpurple = minetest.get_content_id("everness:crystal_purple") --
|
||||
local c_flamepurple = minetest.get_content_id("everness:flame_permanent_purple")
|
||||
local c_frostedice = minetest.get_content_id("everness:frosted_ice")
|
||||
local c_mosspurple = minetest.get_content_id("everness:ivis_moss")
|
||||
local c_bluelant = minetest.get_content_id("everness:blue_vine_lantern")
|
||||
local c_redlant = minetest.get_content_id("everness:glowing_pillar")
|
||||
local c_redplant = minetest.get_content_id("everness:bloodspore_plant")
|
||||
|
||||
--Kristalle, die um 180° gedreht werden per param2, wenn sie auf dem Boden sind
|
||||
local erdkristall = {
|
||||
c_torangecrys,
|
||||
c_tredcrys,
|
||||
c_fakesalt,
|
||||
c_tyellocrys,
|
||||
c_tsmokecrys,
|
||||
c_tyellowcrys,
|
||||
c_tgreen1crys,
|
||||
c_tgreen2crys,
|
||||
c_fakeice1,
|
||||
c_fakeice2,
|
||||
c_fakeice3,
|
||||
c_crystcyan,
|
||||
c_crystorange,
|
||||
c_crystpurple,
|
||||
} --else
|
||||
--end
|
||||
|
||||
--herbs
|
||||
--if minetest.get_modpath("herbs") then
|
||||
local c_amanita = minetest.get_content_id("herbs:mushroom_amanita_green")
|
||||
--else
|
||||
--end
|
||||
|
||||
--riesenpilz
|
||||
-- if minetest.get_modpath("riesenpilz") then
|
||||
local c_blueglowshroom = minetest.get_content_id("riesenpilz:glowshroom")
|
||||
--else
|
||||
--end
|
||||
|
||||
--Other Wolds
|
||||
-- if minetest.get_modpath("other_worlds") then
|
||||
local c_marsgrass = minetest.get_content_id("mars:grass_1")
|
||||
local c_marsmoss = minetest.get_content_id("mars:moss")
|
||||
--else
|
||||
--end
|
||||
|
||||
-- crystals
|
||||
local c_crystore = minetest.get_content_id("caverealms:glow_ore")
|
||||
local c_emerald = minetest.get_content_id("caverealms:glow_emerald")
|
||||
local c_emore = minetest.get_content_id("caverealms:glow_emerald_ore")
|
||||
local c_mesecry = minetest.get_content_id("caverealms:glow_mese")
|
||||
local c_meseore = minetest.get_content_id("default:stone_with_mese")
|
||||
local c_ruby = minetest.get_content_id("caverealms:glow_ruby")
|
||||
local c_rubore = minetest.get_content_id("caverealms:glow_ruby_ore")
|
||||
local c_citrine = minetest.get_content_id("caverealms:glow_citrine")
|
||||
local c_citore = minetest.get_content_id("caverealms:glow_citrine_ore")
|
||||
local c_ameth = minetest.get_content_id("caverealms:glow_amethyst")
|
||||
local c_amethore = minetest.get_content_id("caverealms:glow_amethyst_ore")
|
||||
local c_hotspring = minetest.get_content_id("caverealms:hotspring_water_source")
|
||||
|
||||
local stone_nodes = {
|
||||
[c_stone] = 1,
|
||||
[c_desertstone] = 1,
|
||||
[c_sandstone] = 1,
|
||||
[c_coalblock] = 1,
|
||||
[c_sand] = 1,
|
||||
[c_desand] = 1,
|
||||
[c_obsidian] = 1,
|
||||
}
|
||||
|
||||
if nil ~= minetest.get_modpath("geology") then
|
||||
stone_nodes[minetest.get_content_id("geology:gneiss")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:slate")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:jade")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:granite")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:marble")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:basalt")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:chalk")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:ors")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:serpentine")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:shale")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:schist")] = 1
|
||||
stone_nodes[minetest.get_content_id("geology:anthracite")] = 1
|
||||
end
|
||||
|
||||
--mandatory values
|
||||
local sidelen = x1 - x0 + 1 --length of a mapblock
|
||||
local chulens = { x = sidelen, y = sidelen, z = sidelen } --table of chunk edges
|
||||
local chulens2D = { x = sidelen, y = sidelen, z = 1 }
|
||||
local minposxyz = { x = x0, y = y0, z = z0 } --bottom corner
|
||||
local minposxz = { x = x0, y = z0 } --2D bottom corner
|
||||
|
||||
local nvals_biome_e = minetest.get_perlin_map(np_biome_evil, chulens2D):get2dMap_flat({ x = x0 + 150, y = z0 + 50 }) --2D noise for biomes (will be 3D humidity/temp later)
|
||||
local nvals_biome_w =
|
||||
minetest.get_perlin_map(np_biome_wonder, chulens2D):get2dMap_flat({ x = x0 + 150, y = z0 + 50 }) --2D noise for biomes (will be 3D humidity/temp later)
|
||||
|
||||
local nixyz = 1 --3D node index
|
||||
local nixz = 1 --2D node index
|
||||
local nixyz2 = 1 --second 3D index for second loop
|
||||
|
||||
for z = z0, z1 do -- for each xy plane progressing northwards
|
||||
--increment indices
|
||||
nixyz = nixyz + 1
|
||||
|
||||
--decoration loop
|
||||
for y = y0, y1 do -- for each x row progressing upwards
|
||||
local is_deep = false
|
||||
if y < DEEP_CAVE then
|
||||
is_deep = true
|
||||
end
|
||||
|
||||
local vi = area:index(x0, y, z)
|
||||
for x = x0, x1 do -- for each node do
|
||||
local ai = area:index(x, y + 1, z) --above index
|
||||
local bi = area:index(x, y - 1, z) --below index
|
||||
|
||||
local mode = 0 -- nothing, 1 = ground, 2 = ceiling
|
||||
|
||||
if data[vi] == c_air then
|
||||
if stone_nodes[data[bi]] ~= nil then --ground
|
||||
mode = 1
|
||||
elseif stone_nodes[data[ai]] ~= nil and y < y1 then -- ceiling
|
||||
mode = 2
|
||||
end
|
||||
end
|
||||
|
||||
if mode > 0 then
|
||||
local a2i = area:index(x, y + 2, z) --above index
|
||||
|
||||
--determine biome
|
||||
local biome = 0 --preliminary declaration
|
||||
local n_biome_e = nvals_biome_e[nixz] --make an easier reference to the noise
|
||||
local n_biome_w = nvals_biome_w[nixz] --make an easier reference to the noise
|
||||
local n_biome = (n_biome_e + n_biome_w) / 2
|
||||
|
||||
local floor = c_hcobble
|
||||
local floor_depth = 1
|
||||
local worms = {}
|
||||
local worm_max_len = 1
|
||||
local no_mites = false
|
||||
local no_tites = false
|
||||
local decos = {}
|
||||
local decos2 = {}
|
||||
local deco_mul = 1
|
||||
|
||||
local wiggle = (math.random() - 0.5) / 20
|
||||
n_biome_e = n_biome_e + wiggle
|
||||
n_biome_w = n_biome_w + wiggle
|
||||
|
||||
if n_biome_e < -0.33 then
|
||||
if n_biome_w < -0.33 then -- algae
|
||||
if is_deep then --deep algae deco
|
||||
worms = { c_worm_green, c_tyellowcrys }
|
||||
decos = { c_mycena, c_tyellowcrys, c_amanita }
|
||||
else -- normal algae
|
||||
worms = { c_worm_green }
|
||||
decos = { c_mycena }
|
||||
end
|
||||
floor = c_algae
|
||||
worm_max_len = 1
|
||||
if mode == 1 and data[ai] == c_air and math.random() < 0.03 then
|
||||
data[ai] = c_firefly
|
||||
end
|
||||
elseif n_biome_w < 0.33 then -- moss
|
||||
if is_deep then --deep moss deco
|
||||
worms = { c_worm_green, c_tgreen1crys, c_tgreen2crys, c_worm_blue }
|
||||
decos = {
|
||||
c_mycena,
|
||||
c_greemush,
|
||||
c_mycena,
|
||||
c_greemush,
|
||||
c_tgreen1crys,
|
||||
c_tgreen2crys,
|
||||
}
|
||||
deco_mul = 1.
|
||||
worm_max_len = 1
|
||||
else -- normal moss
|
||||
worms = { c_worm_green }
|
||||
decos = { c_mycena }
|
||||
worm_max_len = 3
|
||||
end
|
||||
floor = c_moss
|
||||
deco_mul = 2.0
|
||||
if mode == 1 and data[ai] == c_air and math.random() < 0.001 then
|
||||
if math.random() < 0.5 then
|
||||
local pos = { x = x, y = y, z = z }
|
||||
riesenpilz.brown(pos, data, area)
|
||||
else
|
||||
caverealms:grow_green_mushroom(x, y - 1, z, area, data)
|
||||
end
|
||||
end
|
||||
else -- lichen
|
||||
if is_deep then --magical lichen deco
|
||||
worms = { c_crystpurple, c_crystpurple, c_purplevine }
|
||||
decos = {
|
||||
c_mosspurple,
|
||||
c_flamepurple,
|
||||
c_crystpurple,
|
||||
c_mosspurple,
|
||||
c_flamepurple,
|
||||
c_crystpurple,
|
||||
c_bluetwist,
|
||||
c_tyellowcrys,
|
||||
}
|
||||
deco_mul = 2
|
||||
worm_max_len = 1
|
||||
else -- normal lichen
|
||||
worms = { c_worm_blue }
|
||||
worm_max_len = 3
|
||||
decos = { c_mycena, c_fungus, c_fungus }
|
||||
deco_mul = 3.3
|
||||
end
|
||||
floor = c_lichen
|
||||
|
||||
|
||||
if mode == 1 and data[ai] == c_air and math.random() < 0.003 then
|
||||
data[ai] = c_bluefly
|
||||
end
|
||||
end
|
||||
elseif n_biome_e < 0.33 then
|
||||
if n_biome_w < -0.33 then -- desert
|
||||
if math.random() < 0.05 then
|
||||
floor = c_coalblock
|
||||
elseif math.random() < 0.15 then
|
||||
floor = c_coaldust
|
||||
else
|
||||
if is_deep then
|
||||
floor = c_hcobble
|
||||
else
|
||||
floor = c_desand
|
||||
end
|
||||
end
|
||||
if is_deep then --hot cobble
|
||||
decos = {
|
||||
c_redplant,
|
||||
c_redlant,
|
||||
c_flame,
|
||||
c_torangecrys,
|
||||
c_redplant,
|
||||
c_flame,
|
||||
c_torangecrys,
|
||||
c_crystorange,
|
||||
}
|
||||
worms = { c_worm_red, c_torangecrys }
|
||||
else --desert
|
||||
decos = {
|
||||
c_tyellocrys,
|
||||
c_flame,
|
||||
c_spike,
|
||||
c_tsmokecrys,
|
||||
c_crystorange,
|
||||
}
|
||||
worms = { c_tyellocrys, c_tsmokecrys }
|
||||
end
|
||||
deco_mul = 2
|
||||
floor_depth = 2
|
||||
worm_max_len = 1
|
||||
elseif n_biome_w < 0.33 then -- salt
|
||||
floor = c_salt
|
||||
floor_depth = 2
|
||||
worms = { c_fakesalt }
|
||||
worm_max_len = 1
|
||||
no_mites = true
|
||||
decos = { c_saltgem }
|
||||
if is_deep then
|
||||
decos = { c_saltgem, c_fakesalt }
|
||||
end
|
||||
else
|
||||
if is_deep then --magic deep glacial
|
||||
floor = c_frostedice
|
||||
floor_depth = 2
|
||||
worms = { c_icevine, c_crystcyan, c_crystcyan, c_icicles_c, c_worm_blue }
|
||||
worm_max_len = 1
|
||||
decos = {
|
||||
c_crystcyan,
|
||||
c_crystcyan,
|
||||
c_blueglowshroom,
|
||||
c_blueglowshroom,
|
||||
c_bluetwist,
|
||||
c_bflame,
|
||||
c_bflame,
|
||||
c_icicles_f,
|
||||
c_bluelant,
|
||||
c_iciu,
|
||||
c_iciu,
|
||||
c_icicles_f,
|
||||
c_bluegrass,
|
||||
c_iciu,
|
||||
c_iciu,
|
||||
c_icicles_f,
|
||||
c_bluegrass,
|
||||
}
|
||||
deco_mul = 2
|
||||
else --glacial
|
||||
floor = c_thinice
|
||||
floor_depth = 2
|
||||
worms = { c_icid, c_worm_blue }
|
||||
worm_max_len = 1
|
||||
decos = { c_gem, c_gem, c_iciu, c_fakeice2 }
|
||||
deco_mul = 2
|
||||
end
|
||||
end
|
||||
else
|
||||
if n_biome_w < -0.33 then -- hotspring
|
||||
floor = c_hcobble
|
||||
worms = { c_worm_red }
|
||||
worm_max_len = 3
|
||||
if mode == 1 and math.random() < 0.005 then
|
||||
caverealms:spawn_hotspring(x, y, z, area, data, math.random(4) + 2)
|
||||
end
|
||||
decos = { c_fire_vine, c_marsgrass, c_marsmoss }
|
||||
deco_mul = 1
|
||||
elseif n_biome_w < 0.33 then -- dungeon
|
||||
if math.random() < 0.5 then
|
||||
floor = c_gobsidian
|
||||
else
|
||||
floor = c_gobsidian2
|
||||
end
|
||||
worms = { c_worm_red, c_tredcrys }
|
||||
worm_max_len = 1
|
||||
decos = { c_flame, c_flame, c_bflame, c_fire_vine, c_tredcrys }
|
||||
else -- deep glacial
|
||||
floor = c_iced
|
||||
floor_depth = 3
|
||||
worms = { c_icid, c_icicles_c, c_icid, c_icicles_c, c_fakeice1, c_fakeice2, c_fakeice3 }
|
||||
worm_max_len = 1
|
||||
|
||||
decos = {
|
||||
c_bflame,
|
||||
c_iciu,
|
||||
c_icicles_f,
|
||||
c_bflame,
|
||||
c_iciu,
|
||||
c_icicles_f,
|
||||
c_fakeice1,
|
||||
c_fakeice2,
|
||||
c_fakeice3,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
-- place floor
|
||||
if mode == 1 then --ground
|
||||
for i = 1, floor_depth do
|
||||
local ii = area:index(x, y - i, z)
|
||||
if stone_nodes[data[bi]] ~= nil then
|
||||
data[ii] = floor
|
||||
end
|
||||
end
|
||||
-- minetest.set_node(pos + vector.new(x, y, z), {name = crystal, param2 = 1})
|
||||
-- decorations
|
||||
if math.random() < ICICHA * deco_mul and data[bi] ~= c_hotspring then
|
||||
local deco = decos[math.random(1, #decos)]
|
||||
|
||||
if table_contains(erdkristall, deco) then
|
||||
local paramzwei = minetest.dir_to_facedir((vector.new(2, 0, 0)), true)
|
||||
vparam2[vi] = paramzwei
|
||||
end
|
||||
data[vi] = deco
|
||||
end
|
||||
|
||||
-- salt crystals
|
||||
if floor == c_salt and math.random() < SALTCRYCHA then
|
||||
caverealms:salt_stalagmite(x, y - 1, z, area, data)
|
||||
end
|
||||
|
||||
-- stone stalagmites
|
||||
if math.random() < STAGCHA then
|
||||
caverealms:stalagmite(x, y, z, area, data)
|
||||
end
|
||||
|
||||
-- crystal stalagmites
|
||||
if not no_mites and math.random() < CRYSTAL then
|
||||
local ore
|
||||
local cry
|
||||
|
||||
if n_biome_e < -0.33 then -- non-evil
|
||||
if n_biome_w < -0.33 then --algae
|
||||
if math.random(10) == 1 then --chance 1/10 for mese
|
||||
ore = c_emore
|
||||
cry = c_emerald
|
||||
else
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
end
|
||||
elseif n_biome_w < 0.33 then --moss
|
||||
if is_deep then --deep moss
|
||||
if math.random(10) == 1 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_emore
|
||||
cry = c_emerald
|
||||
end
|
||||
else --normal moss
|
||||
ore = c_emore
|
||||
cry = c_emerald
|
||||
end
|
||||
else --lichen
|
||||
if is_deep then --magical lichen
|
||||
local tschu = math.random(8)
|
||||
if tschu == 1 then --chance 1/10 for mese
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
elseif tschu == 2 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_amethore
|
||||
cry = c_ameth
|
||||
end
|
||||
else --lichen
|
||||
ore = c_amethore
|
||||
cry = c_ameth
|
||||
end
|
||||
end
|
||||
elseif n_biome_e < 0.33 then -- moderately evil
|
||||
if n_biome_w < -0.33 then
|
||||
if is_deep then --hot cobble
|
||||
if math.random(3) == 1 then
|
||||
ore = c_citore
|
||||
cry = c_citrine
|
||||
else
|
||||
ore = c_rubore
|
||||
cry = c_ruby
|
||||
end
|
||||
else
|
||||
if math.random(3) == 1 then --desert / sand
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
else
|
||||
ore = c_citore
|
||||
cry = c_citrine
|
||||
end
|
||||
end
|
||||
elseif n_biome_w < 0.33 then --salt
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
else
|
||||
if is_deep then --magic deep glacial
|
||||
if math.random(3) == 1 then
|
||||
ore = c_iced
|
||||
cry = c_thinice
|
||||
else
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
end
|
||||
else --glacial
|
||||
if math.random(5) == 1 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_iced
|
||||
cry = c_thinice
|
||||
end
|
||||
end
|
||||
end
|
||||
else -- very evil
|
||||
if n_biome_w < -0.33 then --hotcobble-hotsprings
|
||||
if math.random(3) == 1 then
|
||||
ore = c_citore
|
||||
cry = c_citrine
|
||||
else
|
||||
ore = c_rubore
|
||||
cry = c_ruby
|
||||
end
|
||||
elseif n_biome_w < 0.33 then --obsidian-dungeon
|
||||
if math.random(10) == 1 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_rubore
|
||||
cry = c_ruby
|
||||
end
|
||||
else --deep_glacial
|
||||
if math.random(3) == 1 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_iced
|
||||
cry = c_thinice
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local base = floor
|
||||
caverealms:crystal_stalagmite(x, y - 1, z, area, data, ore, cry, base)
|
||||
end
|
||||
|
||||
if n_biome_w > 0.5 and n_biome_e < -0.33 and math.random() < GIANTCHA then --giant mushrooms
|
||||
caverealms:giant_shroom(x, y, z, area, data)
|
||||
end
|
||||
elseif mode == 2 then -- place ceiling
|
||||
if math.random() < ICICHA then
|
||||
local worm = worms[math.random(1, #worms)]
|
||||
local wdepth = math.random(1, worm_max_len)
|
||||
for i = 0, wdepth - 1 do
|
||||
local ii = area:index(x, y - i, z)
|
||||
if data[ii] == c_air then
|
||||
data[ii] = worm
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- stalactites
|
||||
if not no_tites and math.random() < CRYSTAL then
|
||||
local ore
|
||||
local cry
|
||||
|
||||
if n_biome_e < -0.33 then -- non-evil
|
||||
if n_biome_w < -0.33 then --algae
|
||||
if math.random(10) == 1 then --chance 1/10 for mese
|
||||
ore = c_emore
|
||||
cry = c_emerald
|
||||
else
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
end
|
||||
elseif n_biome_w < 0.33 then --moss
|
||||
ore = c_emore
|
||||
cry = c_emerald
|
||||
else --lichen
|
||||
if is_deep then --magical lichen
|
||||
local tschu = math.random(6)
|
||||
if tschu == 1 then --chance 1/10 for mese
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
elseif tschu == 2 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_amethore
|
||||
cry = c_ameth
|
||||
end
|
||||
else --lichen
|
||||
ore = c_amethore
|
||||
cry = c_ameth
|
||||
end
|
||||
end
|
||||
elseif n_biome_e < 0.33 then -- moderately evil
|
||||
if n_biome_w < -0.33 then
|
||||
if is_deep then --hot cobble
|
||||
if math.random(3) == 1 then
|
||||
ore = c_citore
|
||||
cry = c_citrine
|
||||
else
|
||||
ore = c_rubore
|
||||
cry = c_ruby
|
||||
end
|
||||
else
|
||||
if math.random(3) == 1 then --desert / sand
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
else
|
||||
ore = c_citore
|
||||
cry = c_citrine
|
||||
end
|
||||
end
|
||||
elseif n_biome_w < 0.33 then --salt
|
||||
ore = c_meseore
|
||||
cry = c_mesecry
|
||||
else
|
||||
if is_deep then --magic deep glacial
|
||||
if math.random(3) == 1 then
|
||||
ore = c_iced
|
||||
cry = c_thinice
|
||||
else
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
end
|
||||
else --glacial
|
||||
if math.random(5) == 1 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_iced
|
||||
cry = c_thinice
|
||||
end
|
||||
end
|
||||
end
|
||||
else -- very evil
|
||||
if n_biome_w < -0.33 then --hotcobble-hotsprings
|
||||
if math.random(3) == 1 then
|
||||
ore = c_citore
|
||||
cry = c_citrine
|
||||
else
|
||||
ore = c_rubore
|
||||
cry = c_ruby
|
||||
end
|
||||
elseif n_biome_w < 0.33 then --obsidian-dungeon
|
||||
if math.random(20) == 1 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_rubore
|
||||
cry = c_ruby
|
||||
end
|
||||
else --deep_glacial
|
||||
if math.random(3) == 1 then
|
||||
ore = c_crystore
|
||||
cry = c_crystal
|
||||
else
|
||||
ore = c_iced
|
||||
cry = c_thinice
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local base = c_stone
|
||||
caverealms:crystal_stalactite(x, y, z, area, data, ore, cry, base)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
nixyz2 = nixyz2 + 1
|
||||
nixz = nixz + 1
|
||||
vi = vi + 1
|
||||
end
|
||||
nixz = nixz - sidelen --shift the 2D index back
|
||||
end
|
||||
nixz = nixz + sidelen --shift the 2D index up a layer
|
||||
end
|
||||
|
||||
--send data back to voxelmanip
|
||||
vm:set_data(data)
|
||||
vm:set_param2_data(vparam2)
|
||||
--calc lighting
|
||||
vm:set_lighting({ day = 0, night = 0 })
|
||||
vm:calc_lighting()
|
||||
--write it to world
|
||||
vm:write_to_map(data)
|
||||
|
||||
--local chugent = math.ceil((os.clock() - t1) * 1000) --grab how long it took
|
||||
--print ("[caverealms] "..chugent.." ms") --tell people how long
|
||||
end)
|
||||
print("[caverealms] loaded!")
|
5
mods/.skyrealms/mod.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
name = caverealms
|
||||
depends = default, stairs, fireflies
|
||||
optional_depends = ethereal, mobs, geology
|
||||
description = Drop-in improvement of Caverealms Lite
|
||||
|
624
mods/.skyrealms/nodes.lua
Normal file
|
@ -0,0 +1,624 @@
|
|||
--glowing crystal
|
||||
minetest.register_node("caverealms:glow_crystal", {
|
||||
description = "Glow Sapphire",
|
||||
tiles = {"caverealms_glow_crystal.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 13,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
--glowing emerald
|
||||
minetest.register_node("caverealms:glow_emerald", {
|
||||
description = "Glow Emerald",
|
||||
tiles = {"caverealms_glow_emerald.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 13,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
--glowing mese crystal blocks
|
||||
minetest.register_node("caverealms:glow_mese", {
|
||||
description = "Glow Mese Crystal",
|
||||
tiles = {"caverealms_glow_mese.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 13,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
--glowing ruby
|
||||
minetest.register_node("caverealms:glow_ruby", {
|
||||
description = "Glow Ruby",
|
||||
tiles = {"caverealms_glow_ruby.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 13,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
--glowing citrine
|
||||
minetest.register_node("caverealms:glow_citrine", {
|
||||
description = "Glow Citrine",
|
||||
tiles = {"caverealms_glow_citrine.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 13,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
--glowing amethyst
|
||||
minetest.register_node("caverealms:glow_amethyst", {
|
||||
description = "Glow Amethyst",
|
||||
tiles = {"caverealms_glow_amethyst.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 13,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
--embedded crystal
|
||||
minetest.register_node("caverealms:glow_ore", {
|
||||
description = "Glow Crystal Ore",
|
||||
tiles = {"caverealms_glow_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 10,
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
--embedded emerald
|
||||
minetest.register_node("caverealms:glow_emerald_ore", {
|
||||
description = "Glow Emerald Ore",
|
||||
tiles = {"caverealms_glow_emerald_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 10,
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
--embedded ruby
|
||||
minetest.register_node("caverealms:glow_ruby_ore", {
|
||||
description = "Glow Ruby Ore",
|
||||
tiles = {"caverealms_glow_ruby_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 10,
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
--embedded citrine
|
||||
minetest.register_node("caverealms:glow_citrine_ore", {
|
||||
description = "Glow Citrine Ore",
|
||||
tiles = {"caverealms_glow_citrine_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 10,
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
--embedded amethyst
|
||||
minetest.register_node("caverealms:glow_amethyst_ore", {
|
||||
description = "Glow Amethyst Ore",
|
||||
tiles = {"caverealms_glow_amethyst_ore.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 10,
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
--thin (transparent) ice
|
||||
minetest.register_node("caverealms:thin_ice", {
|
||||
description = "Thin Ice",
|
||||
tiles = {"caverealms_thin_ice.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
freezemelt = "default:water_source",
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
--salt crystal
|
||||
minetest.register_node("caverealms:salt_crystal", {
|
||||
description = "Salt Crystal",
|
||||
tiles = {"caverealms_salt_crystal.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 11,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
})
|
||||
|
||||
--glowing crystal gem
|
||||
minetest.register_node("caverealms:glow_gem", {
|
||||
description = "Glow Gem",
|
||||
tiles = {"caverealms_glow_gem.png"},
|
||||
inventory_image = "caverealms_glow_gem.png",
|
||||
wield_image = "caverealms_glow_gem.png",
|
||||
is_ground_content = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 1, attached_node = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 11,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 0.75,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
}
|
||||
})
|
||||
|
||||
--glowing salt gem
|
||||
minetest.register_node("caverealms:salt_gem", {
|
||||
description = "Salt Gem",
|
||||
tiles = {"caverealms_salt_gem.png"},
|
||||
inventory_image = "caverealms_salt_gem.png",
|
||||
wield_image = "caverealms_salt_gem.png",
|
||||
is_ground_content = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 1, attached_node = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 11,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 0.75,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
}
|
||||
})
|
||||
|
||||
--stone spike
|
||||
minetest.register_node("caverealms:spike", {
|
||||
description = "Stone Spike",
|
||||
tiles = {"caverealms_spike.png"},
|
||||
inventory_image = "caverealms_spike.png",
|
||||
wield_image = "caverealms_spike.png",
|
||||
is_ground_content = true,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 1, attached_node = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
light_source = 3,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 0.75,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
--upward pointing icicle
|
||||
minetest.register_node("caverealms:icicle_up", {
|
||||
description = "Icicle",
|
||||
tiles = {"caverealms_icicle_up.png"},
|
||||
inventory_image = "caverealms_icicle_up.png",
|
||||
wield_image = "caverealms_icicle_up.png",
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3, oddly_breakable_by_hand=1, attached_node = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 8,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -7/16, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
--downward pointing icicle
|
||||
minetest.register_node("caverealms:icicle_down", {
|
||||
description = "Icicle",
|
||||
tiles = {"caverealms_icicle_down.png"},
|
||||
inventory_image = "caverealms_icicle_down.png",
|
||||
wield_image = "caverealms_icicle_down.png",
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3, oddly_breakable_by_hand=1, attached_node = 1},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
light_source = 8,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, 7/16, -0.5, 0.5, 0.5, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
--cave mossy cobble - bluish?
|
||||
minetest.register_node("caverealms:stone_with_moss", {
|
||||
description = "Cave Stone with Moss",
|
||||
tiles = {"default_cobble.png^caverealms_moss.png", "default_cobble.png", "default_cobble.png^caverealms_moss_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=1, cracky=3},
|
||||
-- drop = 'default:cobble',
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
--cave lichen-covered cobble - purple-ish
|
||||
minetest.register_node("caverealms:stone_with_lichen", {
|
||||
description = "Cave Stone with Lichen",
|
||||
tiles = {"default_cobble.png^caverealms_lichen.png", "default_cobble.png", "default_cobble.png^caverealms_lichen_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=1, cracky=3},
|
||||
-- drop = 'default:cobble',
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
--cave algae-covered cobble - yellow-ish
|
||||
minetest.register_node("caverealms:stone_with_algae", {
|
||||
description = "Cave Stone with Algae",
|
||||
tiles = {"default_cobble.png^caverealms_algae.png", "default_cobble.png", "default_cobble.png^caverealms_algae_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=1, cracky=3},
|
||||
-- drop = 'default:cobble',
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_grass_footstep", gain=0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
--tiny-salt-crystal-covered cobble - pink-ish
|
||||
minetest.register_node("caverealms:stone_with_salt", {
|
||||
description = "Salt Crystal",
|
||||
tiles = {"caverealms_salty2.png"},
|
||||
light_source = 9,
|
||||
paramtype = "light",
|
||||
use_texture_alpha = true,
|
||||
drawtype = "glasslike",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
--Hot Cobble - cobble with lava instead of mortar XD
|
||||
minetest.register_node("caverealms:hot_cobble", {
|
||||
description = "Hot Cobble",
|
||||
tiles = {"caverealms_hot_cobble.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, hot=1, cobble = 1, stone = 1},
|
||||
damage_per_second = 1,
|
||||
light_source = 3,
|
||||
paramtype = "light",
|
||||
sounds = default.node_sound_stone_defaults({
|
||||
footstep = {name="default_stone_footstep", gain=0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
--Glow Obsidian
|
||||
minetest.register_node("caverealms:glow_obsidian", {
|
||||
description = "Glowing Obsidian",
|
||||
tiles = {"caverealms_glow_obsidian.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, level=2},
|
||||
light_source = 7,
|
||||
paramtype = "light",
|
||||
sounds = default.node_sound_stone_defaults({
|
||||
footstep = {name="default_stone_footstep", gain=0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
--Glow Obsidian 2 - has traces of lava
|
||||
minetest.register_node("caverealms:glow_obsidian_2", {
|
||||
description = "Hot Glowing Obsidian",
|
||||
tiles = {"caverealms_glow_obsidian2.png"},
|
||||
is_ground_content = true,
|
||||
groups = {cracky=1, hot=1, level=2},
|
||||
light_source = 9,
|
||||
paramtype = "light",
|
||||
sounds = default.node_sound_stone_defaults({
|
||||
footstep = {name="default_stone_footstep", gain=0.25},
|
||||
}),
|
||||
})
|
||||
|
||||
--Glow Obsidian Bricks
|
||||
minetest.register_node("caverealms:glow_obsidian_brick", {
|
||||
description = "Glow Obsidian Brick",
|
||||
tiles = {"caverealms_glow_obsidian_brick.png"},
|
||||
light_source = 7,
|
||||
groups = {cracky = 1, level = 2},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("caverealms:glow_obsidian_brick_2", {
|
||||
description = "Glow Obsidian Brick",
|
||||
tiles = {"caverealms_glow_obsidian_brick_2.png"},
|
||||
light_source = 9,
|
||||
groups = {cracky = 1, level = 2},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
--Glow Obsidian Stairs/Slabs
|
||||
stairs.register_stair_and_slab(
|
||||
"glow_obsidian_brick",
|
||||
"caverealms:glow_obsidian_brick",
|
||||
{cracky = 1, level = 2},
|
||||
{"caverealms_glow_obsidian_brick.png"},
|
||||
"Glow Obsidian Brick Stair",
|
||||
"Glow Obsidian Brick Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
stairs.register_stair_and_slab(
|
||||
"glow_obsidian_brick_2",
|
||||
"caverealms:glow_obsidian_brick_2",
|
||||
{cracky = 1, level = 2},
|
||||
{"caverealms_glow_obsidian_brick_2.png"},
|
||||
"Glow Obsidian Brick Stair",
|
||||
"Glow Obsidian Brick Slab",
|
||||
default.node_sound_stone_defaults())
|
||||
|
||||
--Glow Obsidian Glass
|
||||
minetest.register_node("caverealms:glow_obsidian_glass", {
|
||||
description = "Glow Obsidian Glass",
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = {"caverealms_glow_obsidian_glass.png", "default_obsidian_glass_detail.png"},
|
||||
paramtype = "light",
|
||||
light_source = 13,
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 3},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
--Coal Dust
|
||||
minetest.register_node("caverealms:coal_dust", {
|
||||
description = "Coal Dust",
|
||||
tiles = {"caverealms_coal_dust.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
})
|
||||
|
||||
--glow worms
|
||||
minetest.register_node("caverealms:glow_worm", {
|
||||
description = "Blue Glow Worms",
|
||||
tiles = {"caverealms_glow_worm.png"},
|
||||
inventory_image = "caverealms_glow_worm.png",
|
||||
wield_image = "caverealms_glow_worm.png",
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand=3, },
|
||||
light_source = 9,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/6, -1/2, -1/6, 1/6, 1/2, 1/6},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("caverealms:glow_worm_green", {
|
||||
description = "Green Glow Worms",
|
||||
tiles = {"caverealms_glow_worm_green.png"},
|
||||
inventory_image = "caverealms_glow_worm_green.png",
|
||||
wield_image = "caverealms_glow_worm_green.png",
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand=3, },
|
||||
light_source = 9,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/6, -1/2, -1/6, 1/6, 1/2, 1/6},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("caverealms:glow_worm_red", {
|
||||
description = "Red Glow Worms",
|
||||
tiles = {"caverealms_glow_worm_red.png"},
|
||||
inventory_image = "caverealms_glow_worm_red.png",
|
||||
wield_image = "caverealms_glow_worm_red.png",
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand=3, },
|
||||
light_source = 9,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/6, -1/2, -1/6, 1/6, 1/2, 1/6},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("caverealms:fire_vine", {
|
||||
description = "Fire Vine",
|
||||
tiles = {"caverealms_fire_vine.png"},
|
||||
inventory_image = "caverealms_fire_vine.png",
|
||||
wield_image = "caverealms_fire_vine.png",
|
||||
is_ground_content = true,
|
||||
damage_per_second = 1,
|
||||
groups = {oddly_breakable_by_hand=3, },
|
||||
light_source = 9,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/6, -1/2, -1/6, 1/6, 1/2, 1/6},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
--define special flame so that it does not expire
|
||||
minetest.register_node("caverealms:constant_flame", {
|
||||
description = "Fire",
|
||||
drawtype = "plantlike",
|
||||
tiles = {{
|
||||
name="fire_basic_flame_animated.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
|
||||
}},
|
||||
inventory_image = "fire_basic_flame.png",
|
||||
light_source = 14,
|
||||
groups = {igniter=2, dig_immediate=3, hot=3, not_in_creative_inventory=1},
|
||||
paramtype = "light",
|
||||
drop = '',
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
damage_per_second = 4,
|
||||
})
|
||||
|
||||
minetest.register_node("caverealms:constant_flame_blue", {
|
||||
description = "Blue Fire",
|
||||
drawtype = "plantlike",
|
||||
tiles = {{
|
||||
name="caverealms_blue_flame_animated.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
|
||||
}},
|
||||
inventory_image = "fire_basic_flame.png",
|
||||
light_source = 14,
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1},
|
||||
paramtype = "light",
|
||||
drop = '',
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
damage_per_second = 4,
|
||||
})
|
||||
|
||||
--dungeon master statue (nodebox)
|
||||
minetest.register_node("caverealms:dm_statue", {
|
||||
description = "Dungeon Master Statue",
|
||||
tiles = {
|
||||
"caverealms_dm_stone.png",
|
||||
"caverealms_dm_stone.png",
|
||||
"caverealms_dm_stone.png",
|
||||
"caverealms_dm_stone.png",
|
||||
"caverealms_dm_stone.png",
|
||||
"caverealms_stone_eyes.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.5, -0.4375, 0.4375, -0.3125, 0.4375}, -- NodeBox1
|
||||
{-0.25, -0.125, -0.1875, 0.25, 0.5, 0.1875}, -- NodeBox2
|
||||
{-0.375, 0, -0.125, -0.25, 0.4375, 0.125}, -- NodeBox3
|
||||
{0.25, 0.125, -0.4375, 0.375, 0.375, 0.1875}, -- NodeBox4
|
||||
{-0.25, -0.5, -0.125, -0.125, -0.125, 0.125}, -- NodeBox5
|
||||
{0.125, -0.3125, -0.125, 0.25, 0, 0.125}, -- NodeBox6
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "regular"
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("caverealms:butterfly_blue", {
|
||||
description = desc,
|
||||
drawtype = "plantlike",
|
||||
tiles = {{
|
||||
name = "caverealms_butterfly_blue_animated.png",
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 32,
|
||||
aspect_h = 32,
|
||||
length = 3
|
||||
},
|
||||
}},
|
||||
inventory_image = "caverealms_butterfly_blue.png",
|
||||
wield_image = "caverealms_butterfly_blue.png",
|
||||
waving = 1,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
buildable_to = true,
|
||||
walkable = false,
|
||||
groups = {catchable = 1},
|
||||
light_source = 6,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
|
||||
},
|
||||
floodable = true,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local player_name = placer:get_player_name()
|
||||
local pos = pointed_thing.above
|
||||
|
||||
if not minetest.is_protected(pos, player_name) and
|
||||
not minetest.is_protected(pointed_thing.under, player_name) and
|
||||
minetest.get_node(pos).name == "air" then
|
||||
minetest.set_node(pos, {name = "caverealms:butterfly_blue"})
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Compatibility
|
||||
minetest.register_alias("caverealms:hanging_thin_ice", "caverealms:thin_ice")
|
||||
|
||||
minetest.register_alias("caverealms:spike_2", "caverealms:spike")
|
||||
minetest.register_alias("caverealms:spike_3", "caverealms:spike")
|
||||
minetest.register_alias("caverealms:spike_4", "caverealms:spike")
|
||||
minetest.register_alias("caverealms:spike_5", "caverealms:spike")
|
||||
|
||||
minetest.register_alias("caverealms:salt_gem_2", "caverealms:salt_gem")
|
||||
minetest.register_alias("caverealms:salt_gem_3", "caverealms:salt_gem")
|
||||
minetest.register_alias("caverealms:salt_gem_4", "caverealms:salt_gem")
|
||||
minetest.register_alias("caverealms:salt_gem_5", "caverealms:salt_gem")
|
||||
|
||||
minetest.register_alias("caverealms:glow_gem_2", "caverealms:glow_gem")
|
||||
minetest.register_alias("caverealms:glow_gem_3", "caverealms:glow_gem")
|
||||
minetest.register_alias("caverealms:glow_gem_4", "caverealms:glow_gem")
|
||||
minetest.register_alias("caverealms:glow_gem_5", "caverealms:glow_gem")
|
277
mods/.skyrealms/plants.lua
Normal file
|
@ -0,0 +1,277 @@
|
|||
-- Lichen biome
|
||||
|
||||
-- glowing fungi
|
||||
minetest.register_node("caverealms:fungus", {
|
||||
description = "Glowing Fungus",
|
||||
tiles = {"caverealms_fungi.png"},
|
||||
inventory_image = "caverealms_fungi.png",
|
||||
wield_image = "caverealms_fungi.png",
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand = 3, attached_node = 1},
|
||||
light_source = 5,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
-- mycena mushroom
|
||||
minetest.register_node("caverealms:mycena", {
|
||||
description = "Mycena Mushroom",
|
||||
tiles = {"caverealms_mycena.png"},
|
||||
inventory_image = "caverealms_mycena.png",
|
||||
wield_image = "caverealms_mycena.png",
|
||||
is_ground_content = true,
|
||||
groups = {oddly_breakable_by_hand = 3, attached_node = 1},
|
||||
light_source = 6,
|
||||
paramtype = "light",
|
||||
drawtype = "plantlike",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
visual_scale = 1.0,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||
},
|
||||
})
|
||||
|
||||
-- giant mushroom
|
||||
if minetest.get_modpath("ethereal") then
|
||||
minetest.register_alias("caverealms:mushroom_cap", "ethereal:mushroom")
|
||||
minetest.register_alias("caverealms:mushroom_stem", "ethereal:mushroom_trunk")
|
||||
else
|
||||
-- stem
|
||||
minetest.register_node("caverealms:mushroom_stem", {
|
||||
description = "Giant Mushroom Stem",
|
||||
tiles = {"caverealms_mushroom_stem.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1},
|
||||
})
|
||||
|
||||
-- cap
|
||||
minetest.register_node("caverealms:mushroom_cap", {
|
||||
description = "Giant Mushroom Cap",
|
||||
tiles = {"caverealms_mushroom_cap.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1,},
|
||||
light_source = 3,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"caverealms:mushroom_sapling"}, rarity = 20},
|
||||
{items = {"caverealms:mushroom_cap"}}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
-- sapling
|
||||
minetest.register_node("caverealms:mushroom_sapling", {
|
||||
description = "Mushroom Tree Sapling",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"caverealms_mushroom_sapling.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
groups = {snappy = 2, dig_immediate = 3, flammable = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
-- green mushroom
|
||||
-- cap
|
||||
minetest.register_node("caverealms:mushroom_cap_green", {
|
||||
description = "Giant Mushroom Cap, Green",
|
||||
tiles = {"caverealms_mushroom_cap_green.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1,},
|
||||
light_source = 3,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"caverealms:mushroom_sapling_green"}, rarity = 20},
|
||||
{items = {"caverealms:mushroom_cap_green"}}
|
||||
}
|
||||
},
|
||||
})
|
||||
minetest.register_node("caverealms:mushroom_cap_green_spots", {
|
||||
description = "Giant Mushroom Cap, Green",
|
||||
tiles = {"caverealms_mushroom_cap_green.png^caverealms_mushroom_cap_spots.png"},
|
||||
is_ground_content = true,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1,},
|
||||
light_source = 3,
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"caverealms:mushroom_sapling_green_spots"}, rarity = 20},
|
||||
{items = {"caverealms:mushroom_cap_green"}}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
-- sapling
|
||||
minetest.register_node("caverealms:mushroom_sapling_green", {
|
||||
description = "Mushroom Tree Sapling, Green",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"caverealms_mushroom_sapling_green.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
|
||||
},
|
||||
groups = {snappy = 2, dig_immediate = 3, flammable = 2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
|
||||
-- gills
|
||||
minetest.register_node("caverealms:mushroom_gills", {
|
||||
description = "Giant Mushroom Gills",
|
||||
tiles = {"caverealms_mushroom_gills.png"},
|
||||
is_ground_content = true,
|
||||
light_source = 10,
|
||||
groups = {choppy=2, oddly_breakable_by_hand=1},
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
})
|
||||
|
||||
|
||||
-- Saplings
|
||||
|
||||
-- grow trees
|
||||
local add_tree = function (pos, ofx, ofy, ofz, schem)
|
||||
if not schem then
|
||||
print ("Schematic not found")
|
||||
return
|
||||
end
|
||||
minetest.swap_node(pos, {name = "air"})
|
||||
minetest.place_schematic(
|
||||
{x = pos.x - ofx, y = pos.y - ofy, z = pos.z - ofz},
|
||||
schem, 0, nil, false)
|
||||
end
|
||||
|
||||
local path = minetest.get_modpath("caverealms").."/schematics/"
|
||||
|
||||
-- giant mushrooms
|
||||
function grow_caverealms_mushroom(pos)
|
||||
add_tree(pos, 5, 0, 5, path .. "shroom.mts")
|
||||
end
|
||||
|
||||
-- height check
|
||||
local function enough_height(pos, height)
|
||||
local nod = minetest.line_of_sight(
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{x = pos.x, y = pos.y + height, z = pos.z})
|
||||
if not nod then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Caverealms grow sapling",
|
||||
nodenames = {"ethereal:mushroom_sapling", "caverealms:mushroom_sapling"},
|
||||
interval = 10,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local light_level = minetest.get_node_light(pos)
|
||||
-- check light level
|
||||
if not light_level or light_level > 10 then
|
||||
return
|
||||
end
|
||||
-- get node under sapling
|
||||
local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name
|
||||
-- check if registered
|
||||
if not minetest.registered_nodes[node.name] then
|
||||
return
|
||||
end
|
||||
-- ethereal sapling on lichen stone
|
||||
if node.name == "ethereal:mushroom_sapling"
|
||||
and under == "caverealms:stone_with_lichen"
|
||||
and enough_height(pos, 10) then
|
||||
grow_caverealms_mushroom(pos)
|
||||
-- caverealms sapling on lichen stone
|
||||
elseif node.name == "caverealms:mushroom_sapling"
|
||||
and under == "caverealms:stone_with_lichen"
|
||||
and enough_height(pos, 10) then
|
||||
grow_caverealms_mushroom(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- green mushroom growth
|
||||
function caverealms:grow_green_mushroom(x,y,z, area, data)
|
||||
local c_stem = minetest.get_content_id("caverealms:mushroom_stem")
|
||||
local c_gills = minetest.get_content_id("caverealms:mushroom_gills")
|
||||
local c_cap = minetest.get_content_id("caverealms:mushroom_cap_green")
|
||||
local c_caps = minetest.get_content_id("caverealms:mushroom_cap_green_spots")
|
||||
|
||||
-- stem
|
||||
local stop = {x=x,y=y+3,z=z}--{x = x+math.random(-1,1), y = y+3, z = z+math.random(-1,1)}
|
||||
|
||||
for i = 1,3 do
|
||||
-- local vi = area:index(x+((stop.x-x) / i), y+i, z+((stop.z-z) / i))
|
||||
local vi = area:index(x, y+i, z)
|
||||
data[vi] = c_stem
|
||||
end
|
||||
|
||||
data[area:index(stop.x+1, y+3, stop.z)] = c_gills
|
||||
data[area:index(stop.x-1, y+3, stop.z)] = c_gills
|
||||
data[area:index(stop.x, y+3, stop.z+1)] = c_gills
|
||||
data[area:index(stop.x, y+3, stop.z-1)] = c_gills
|
||||
|
||||
data[area:index(stop.x+1, y+3, stop.z+1)] = c_cap
|
||||
data[area:index(stop.x-1, y+3, stop.z+1)] = c_cap
|
||||
data[area:index(stop.x+1, y+3, stop.z-1)] = c_cap
|
||||
data[area:index(stop.x-1, y+3, stop.z-1)] = c_caps
|
||||
data[area:index(stop.x+2, y+3, stop.z)] = c_cap
|
||||
data[area:index(stop.x-2, y+3, stop.z)] = c_cap
|
||||
data[area:index(stop.x, y+3, stop.z+2)] = c_caps
|
||||
data[area:index(stop.x, y+3, stop.z-2)] = c_cap
|
||||
data[area:index(stop.x+1, y+4, stop.z)] = c_caps
|
||||
data[area:index(stop.x-1, y+4, stop.z)] = c_cap
|
||||
data[area:index(stop.x, y+4, stop.z+1)] = c_caps
|
||||
data[area:index(stop.x, y+4, stop.z-1)] = c_cap
|
||||
data[area:index(stop.x, y+4, stop.z)] = c_cap
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- spread moss/lichen/algae to nearby cobblestone
|
||||
minetest.register_abm({
|
||||
label = "Caverealms stone spread",
|
||||
nodenames = {
|
||||
"caverealms:stone_with_moss",
|
||||
"caverealms:stone_with_lichen",
|
||||
"caverealms:stone_with_algae",
|
||||
},
|
||||
neighbors = {"air"},
|
||||
interval = 16,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local num = minetest.find_nodes_in_area_under_air(
|
||||
{x = pos.x - 1, y = pos.y - 2, z = pos.z - 1},
|
||||
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
|
||||
"default:cobble")
|
||||
if #num > 0 then
|
||||
minetest.set_node(num[math.random(#num)], {name = node.name})
|
||||
end
|
||||
end,
|
||||
})
|
BIN
mods/.skyrealms/schematics/shroom.mts
Normal file
BIN
mods/.skyrealms/screenshot.png
Normal file
After Width: | Height: | Size: 153 KiB |
BIN
mods/.skyrealms/textures/caverealms_algae.png
Normal file
After Width: | Height: | Size: 739 B |
BIN
mods/.skyrealms/textures/caverealms_algae_side.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
mods/.skyrealms/textures/caverealms_angler_rod.png
Normal file
After Width: | Height: | Size: 252 B |
BIN
mods/.skyrealms/textures/caverealms_angler_rod_baited.png
Normal file
After Width: | Height: | Size: 273 B |
BIN
mods/.skyrealms/textures/caverealms_angler_rod_weild.png
Normal file
After Width: | Height: | Size: 260 B |
BIN
mods/.skyrealms/textures/caverealms_blue_flame_animated.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
mods/.skyrealms/textures/caverealms_butterfly_blue.png
Normal file
After Width: | Height: | Size: 152 B |
BIN
mods/.skyrealms/textures/caverealms_butterfly_blue_animated.png
Normal file
After Width: | Height: | Size: 202 B |
BIN
mods/.skyrealms/textures/caverealms_coal_dust.png
Normal file
After Width: | Height: | Size: 288 B |
BIN
mods/.skyrealms/textures/caverealms_dm_stone.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
mods/.skyrealms/textures/caverealms_fire_vine.png
Normal file
After Width: | Height: | Size: 554 B |
BIN
mods/.skyrealms/textures/caverealms_fungi.png
Normal file
After Width: | Height: | Size: 150 B |
BIN
mods/.skyrealms/textures/caverealms_glow_amethyst.png
Normal file
After Width: | Height: | Size: 325 B |
BIN
mods/.skyrealms/textures/caverealms_glow_amethyst_ore.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
mods/.skyrealms/textures/caverealms_glow_bait.png
Normal file
After Width: | Height: | Size: 168 B |
BIN
mods/.skyrealms/textures/caverealms_glow_citrine.png
Normal file
After Width: | Height: | Size: 755 B |
BIN
mods/.skyrealms/textures/caverealms_glow_citrine_ore.png
Normal file
After Width: | Height: | Size: 637 B |
BIN
mods/.skyrealms/textures/caverealms_glow_crystal.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
mods/.skyrealms/textures/caverealms_glow_emerald.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
mods/.skyrealms/textures/caverealms_glow_emerald_ore.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
mods/.skyrealms/textures/caverealms_glow_gem.png
Normal file
After Width: | Height: | Size: 248 B |
BIN
mods/.skyrealms/textures/caverealms_glow_mese.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
mods/.skyrealms/textures/caverealms_glow_obsidian.png
Normal file
After Width: | Height: | Size: 162 B |
BIN
mods/.skyrealms/textures/caverealms_glow_obsidian2.png
Normal file
After Width: | Height: | Size: 245 B |
BIN
mods/.skyrealms/textures/caverealms_glow_obsidian_brick.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
mods/.skyrealms/textures/caverealms_glow_obsidian_brick_2.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
mods/.skyrealms/textures/caverealms_glow_obsidian_glass.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
mods/.skyrealms/textures/caverealms_glow_obsidian_shard.png
Normal file
After Width: | Height: | Size: 276 B |
BIN
mods/.skyrealms/textures/caverealms_glow_ore.png
Normal file
After Width: | Height: | Size: 345 B |
BIN
mods/.skyrealms/textures/caverealms_glow_ruby.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
mods/.skyrealms/textures/caverealms_glow_ruby_ore.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
mods/.skyrealms/textures/caverealms_glow_worm.png
Normal file
After Width: | Height: | Size: 406 B |
BIN
mods/.skyrealms/textures/caverealms_glow_worm_green.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
mods/.skyrealms/textures/caverealms_glow_worm_red.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
mods/.skyrealms/textures/caverealms_hot_cobble.png
Normal file
After Width: | Height: | Size: 431 B |
BIN
mods/.skyrealms/textures/caverealms_icicle_down.png
Normal file
After Width: | Height: | Size: 161 B |
BIN
mods/.skyrealms/textures/caverealms_icicle_up.png
Normal file
After Width: | Height: | Size: 158 B |
BIN
mods/.skyrealms/textures/caverealms_lichen.png
Normal file
After Width: | Height: | Size: 925 B |
BIN
mods/.skyrealms/textures/caverealms_lichen_side.png
Normal file
After Width: | Height: | Size: 437 B |
BIN
mods/.skyrealms/textures/caverealms_moss.png
Normal file
After Width: | Height: | Size: 754 B |
BIN
mods/.skyrealms/textures/caverealms_moss_side.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
mods/.skyrealms/textures/caverealms_mushroom_cap.png
Normal file
After Width: | Height: | Size: 172 B |
BIN
mods/.skyrealms/textures/caverealms_mushroom_cap_green.png
Normal file
After Width: | Height: | Size: 316 B |
BIN
mods/.skyrealms/textures/caverealms_mushroom_cap_spots.png
Normal file
After Width: | Height: | Size: 165 B |
BIN
mods/.skyrealms/textures/caverealms_mushroom_gills.png
Normal file
After Width: | Height: | Size: 141 B |
BIN
mods/.skyrealms/textures/caverealms_mushroom_sapling.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
mods/.skyrealms/textures/caverealms_mushroom_sapling_green.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
mods/.skyrealms/textures/caverealms_mushroom_stem.png
Normal file
After Width: | Height: | Size: 402 B |
BIN
mods/.skyrealms/textures/caverealms_mycena.png
Normal file
After Width: | Height: | Size: 240 B |
BIN
mods/.skyrealms/textures/caverealms_salt_crystal.png
Normal file
After Width: | Height: | Size: 402 B |
BIN
mods/.skyrealms/textures/caverealms_salt_gem.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
mods/.skyrealms/textures/caverealms_salty2.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
mods/.skyrealms/textures/caverealms_spike.png
Normal file
After Width: | Height: | Size: 248 B |
BIN
mods/.skyrealms/textures/caverealms_stone_eyes.png
Normal file
After Width: | Height: | Size: 662 B |
BIN
mods/.skyrealms/textures/caverealms_thin_ice.png
Normal file
After Width: | Height: | Size: 679 B |
BIN
mods/.skyrealms/textures/fire_basic_flame.png
Normal file
After Width: | Height: | Size: 719 B |
BIN
mods/.skyrealms/textures/fire_basic_flame_animated.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 ElCeejo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,394 +0,0 @@
|
|||
wisp = {}
|
||||
|
||||
wisp.wisps = {}
|
||||
wisp.jars = {}
|
||||
|
||||
-----------------
|
||||
-- Mod Storage --
|
||||
-----------------
|
||||
|
||||
local mod_storage = minetest.get_mod_storage()
|
||||
|
||||
local data = {
|
||||
wisps = minetest.deserialize(mod_storage:get_string("wisps")) or {},
|
||||
jars = minetest.deserialize(mod_storage:get_string("jars")) or {},
|
||||
}
|
||||
|
||||
local function save()
|
||||
mod_storage:set_string("wisps", minetest.serialize(data.wisps))
|
||||
mod_storage:set_string("jars", minetest.serialize(data.jars))
|
||||
end
|
||||
|
||||
minetest.register_on_shutdown(save)
|
||||
minetest.register_on_leaveplayer(save)
|
||||
|
||||
local function periodic_save()
|
||||
save()
|
||||
minetest.after(120, periodic_save)
|
||||
end
|
||||
minetest.after(120, periodic_save)
|
||||
|
||||
wisp.wisps = data.wisps
|
||||
wisp.jars = data.jars
|
||||
|
||||
----------
|
||||
-- Math --
|
||||
----------
|
||||
|
||||
local random = math.random
|
||||
local abs = math.abs
|
||||
local function interp(a, b, w) return a + (b - a) * w end
|
||||
|
||||
local function wisp_visual(pos, color)
|
||||
local random_vel = {
|
||||
x = random(-1, 1),
|
||||
y = -1,
|
||||
z = random(-1, 1)
|
||||
}
|
||||
local random_offset = {
|
||||
x = pos.x + (random(-1, 1) * 0.1),
|
||||
y = pos.y + (random(-1, 1) * 0.1),
|
||||
z = pos.z + (random(-1, 1) * 0.1)
|
||||
}
|
||||
minetest.add_particle({
|
||||
pos = random_offset,
|
||||
velocity = random_vel,
|
||||
acceleration = {
|
||||
x = 0,
|
||||
y = random(6, 8),
|
||||
z = 0,
|
||||
},
|
||||
expirationtime = 0.1,
|
||||
size = random(3, 5),
|
||||
texture = "wisp_".. color .. ".png",
|
||||
glow = 6
|
||||
})
|
||||
end
|
||||
|
||||
local function wisped_effect(pos, color)
|
||||
minetest.add_particlespawner({
|
||||
amount = 2,
|
||||
time = 0.1,
|
||||
minpos = vector.subtract(pos, 0.5),
|
||||
maxpos = vector.add(pos, 0.5),
|
||||
minvel = {
|
||||
x = -0.5,
|
||||
y = 0.5,
|
||||
z = -0.5
|
||||
},
|
||||
maxvel = {
|
||||
x = 0.5,
|
||||
y = 1,
|
||||
z = 0.5
|
||||
},
|
||||
minacc = {
|
||||
x = 0,
|
||||
y = 2,
|
||||
z = 0
|
||||
},
|
||||
maxacc = {
|
||||
x = 0,
|
||||
y = 4,
|
||||
z = 0
|
||||
},
|
||||
minexptime = 0.5,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
collisiondetection = false,
|
||||
texture = "wisp_" .. color .. "_particle.png",
|
||||
glow = 6
|
||||
})
|
||||
end
|
||||
|
||||
---------
|
||||
-- API --
|
||||
---------
|
||||
|
||||
local wisp_colors = {
|
||||
"red",
|
||||
"green",
|
||||
"blue",
|
||||
}
|
||||
|
||||
local function create_wisp(pos, color)
|
||||
local wisp_color = color
|
||||
if not color
|
||||
or string.len(color) == 0 then
|
||||
wisp_color = wisp_colors[random(3)]
|
||||
end
|
||||
local wisp_d = {
|
||||
pos = pos,
|
||||
new_pos = pos,
|
||||
self_dtime = 0,
|
||||
lifetime = 0,
|
||||
color = wisp_color
|
||||
}
|
||||
table.insert(wisp.wisps, wisp_d)
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("add_wisp", {
|
||||
params = "<color>",
|
||||
description = "Spawns a Wisp",
|
||||
privs = {server = true},
|
||||
func = function(name, color)
|
||||
local pos = minetest.get_player_by_name(name):get_pos()
|
||||
create_wisp(pos, color)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("clear_wisps", {
|
||||
params = "<color>",
|
||||
description = "Clears Wisps",
|
||||
privs = {server = true},
|
||||
func = function(name, color)
|
||||
wisp.wisps = {}
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for i = 1, #wisp.wisps do
|
||||
local c_wisp = wisp.wisps[i]
|
||||
if not c_wisp then return end
|
||||
local pos = c_wisp.pos
|
||||
local color = c_wisp.color
|
||||
local lifetime = c_wisp.lifetime or 0
|
||||
local self_dtime = c_wisp.self_dtime or 0
|
||||
local move_time = c_wisp.move_time or 0
|
||||
lifetime = lifetime + dtime
|
||||
wisp_visual(pos, color)
|
||||
c_wisp.self_dtime = self_dtime + dtime
|
||||
if self_dtime > 0.1 then
|
||||
-- Movement
|
||||
move_time = move_time + 0.1
|
||||
if move_time > 2 then
|
||||
if random(3) > 1 then
|
||||
local new_pos = vector.add(pos, random(-3, 3))
|
||||
if minetest.get_node(new_pos).name == "air" then
|
||||
c_wisp.new_pos = new_pos
|
||||
end
|
||||
else
|
||||
move_time = 0
|
||||
end
|
||||
end
|
||||
if vector.distance(pos, c_wisp.new_pos) > 0.2 then
|
||||
c_wisp.pos = {
|
||||
x = interp(pos.x, c_wisp.new_pos.x, 0.05),
|
||||
y = interp(pos.y, c_wisp.new_pos.y, 0.05),
|
||||
z = interp(pos.z, c_wisp.new_pos.z, 0.05)
|
||||
}
|
||||
end
|
||||
-- Left-click detection
|
||||
local objects = minetest.get_objects_inside_radius(pos, 6)
|
||||
for n = 1, #objects do
|
||||
local obj = objects[n]
|
||||
if obj
|
||||
and obj:is_player() then
|
||||
local p_pos = obj:get_pos()
|
||||
p_pos.y = p_pos.y + 1.4
|
||||
local dir = vector.direction(p_pos, pos)
|
||||
local flee_dir = {
|
||||
x = dir.x,
|
||||
y = random(-1, 1),
|
||||
z = dir.z
|
||||
}
|
||||
c_wisp.new_pos = vector.add(pos, flee_dir)
|
||||
if obj:get_player_control().LMB
|
||||
and obj:get_wielded_item():get_name() == "wisp:jar" then
|
||||
local look_dir = obj:get_look_dir()
|
||||
if math.abs(vector.length(vector.subtract(dir, look_dir))) < 0.1 then
|
||||
obj:set_wielded_item("wisp:jar_" .. color)
|
||||
table.remove(wisp.wisps, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self_dtime = 0
|
||||
end
|
||||
if lifetime > 60 then
|
||||
table.remove(wisp.wisps, i)
|
||||
end
|
||||
end
|
||||
for i = 1, #wisp.jars do
|
||||
if not wisp.jars[i] then return end
|
||||
local pos = wisp.jars[i].pos
|
||||
if minetest.get_node(pos).name == "ignore"
|
||||
or minetest.get_node(pos).name:match("^wisp:jar_") then
|
||||
local color = wisp.jars[i].color
|
||||
wisp_visual(pos, color)
|
||||
if color == "green"
|
||||
and random(256) < 2 then
|
||||
local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(pos, 5), vector.add(pos, 5), {"group:grass", "group:plant", "group:flora"})
|
||||
if #nodes > 0 then
|
||||
for n = 1, #nodes do
|
||||
grow_crops(nodes[n], minetest.get_node(nodes[n]).name)
|
||||
end
|
||||
end
|
||||
end
|
||||
if color == "blue"
|
||||
and random(64) < 2 then
|
||||
local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(pos, 5), vector.add(pos, 5), "group:fire")
|
||||
if #nodes > 0 then
|
||||
for n = 1, #nodes do
|
||||
minetest.remove_node(nodes[n])
|
||||
wisped_effect(nodes[n], color)
|
||||
end
|
||||
end
|
||||
end
|
||||
if color == "red"
|
||||
and random(64) < 2 then
|
||||
local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(pos, 5), vector.add(pos, 5), {"group:grass", "group:plant", "group:flora"})
|
||||
if #nodes > 0 then
|
||||
for n = 1, #nodes do
|
||||
minetest.remove_node(nodes[n])
|
||||
wisped_effect(nodes[n], color)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
table.remove(wisp.jars, i)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_abm({
|
||||
label = "wisp:spawning",
|
||||
nodenames = {"group:tree"},
|
||||
neighbors = {"air"},
|
||||
interval = 120,
|
||||
chance = 512,
|
||||
action = function(pos)
|
||||
create_wisp(vector.add(pos, random(-3, 3)))
|
||||
end
|
||||
})
|
||||
|
||||
-----------
|
||||
-- Nodes --
|
||||
-----------
|
||||
|
||||
minetest.register_node("wisp:jar", {
|
||||
description = "Jar",
|
||||
inventory_image = "wisp_jar_inv.png",
|
||||
wield_image = "wisp_jar_inv.png",
|
||||
drawtype = "mesh",
|
||||
mesh = "wisp_jar.obj",
|
||||
tiles = {"wisp_jar.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.315, -0.5, -0.315, 0.315, 0.265, 0.315},
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.315, -0.5, -0.315, 0.315, 0.265, 0.315},
|
||||
},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 2},
|
||||
stack_max = 1
|
||||
})
|
||||
|
||||
for i = 1, 3 do
|
||||
local color = wisp_colors[i]
|
||||
minetest.register_node("wisp:jar_" .. color, {
|
||||
description = "Jar with " .. color .. " Wisp",
|
||||
inventory_image = "wisp_jar_" .. color .. "_inv.png",
|
||||
wield_image = "wisp_jar_" .. color .. "_inv.png",
|
||||
drawtype = "mesh",
|
||||
mesh = "wisp_jar.obj",
|
||||
tiles = {"wisp_jar.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.315, -0.5, -0.315, 0.315, 0.265, 0.315},
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.315, -0.5, -0.315, 0.315, 0.265, 0.315},
|
||||
},
|
||||
groups = {cracky = 1, oddly_breakable_by_hand = 2},
|
||||
stack_max = 1
|
||||
})
|
||||
minetest.register_on_placenode(function(pos, newnode)
|
||||
if newnode.name == "wisp:jar_" .. color then
|
||||
table.insert(wisp.jars, {pos = pos, color = color})
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function grow_crops(pos, nodename)
|
||||
local checkname = nodename:sub(1, string.len(nodename) - 1)
|
||||
if minetest.registered_nodes[checkname .. "1"]
|
||||
and minetest.registered_nodes[checkname .. "2"]
|
||||
and minetest.registered_nodes[checkname .. "2"].drawtype == "plantlike" then -- node is more than likely a plant
|
||||
local stage = tonumber(string.sub(nodename, -1)) or 0
|
||||
local newname = checkname .. (stage + 1)
|
||||
if minetest.registered_nodes[newname] then
|
||||
local def = minetest.registered_nodes[newname]
|
||||
def = def and def.place_param2 or 0
|
||||
minetest.set_node(pos, {name = newname, param2 = def})
|
||||
minetest.add_particlespawner({
|
||||
amount = 6,
|
||||
time = 0.1,
|
||||
minpos = vector.subtract(pos, 0.5),
|
||||
maxpos = vector.add(pos, 0.5),
|
||||
minvel = {
|
||||
x = -0.5,
|
||||
y = 0.5,
|
||||
z = -0.5
|
||||
},
|
||||
maxvel = {
|
||||
x = 0.5,
|
||||
y = 1,
|
||||
z = 0.5
|
||||
},
|
||||
minacc = {
|
||||
x = 0,
|
||||
y = 2,
|
||||
z = 0
|
||||
},
|
||||
maxacc = {
|
||||
x = 0,
|
||||
y = 4,
|
||||
z = 0
|
||||
},
|
||||
minexptime = 0.5,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
collisiondetection = false,
|
||||
vertical = false,
|
||||
use_texture_alpha = true,
|
||||
texture = "wisp_green_particle.png",
|
||||
glow = 6
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--------------
|
||||
-- Crafting --
|
||||
--------------
|
||||
|
||||
if minetest.get_modpath("nc_optics")
|
||||
and minetest.get_modpath("nc_tree") then
|
||||
nodecore.register_craft({
|
||||
label = "assemble jar",
|
||||
normal = {y = 1},
|
||||
indexkeys = {"nc_optics:shelf", "nc_tree:stick"},
|
||||
nodes = {
|
||||
{match = "nc_tree:stick", replace = "air"},
|
||||
{y = -1, match = "nc_optics:shelf", replace = "wisp:jar"}
|
||||
}
|
||||
})
|
||||
else
|
||||
minetest.register_craft({
|
||||
output = "wisp:jar",
|
||||
recipe = {
|
||||
{"group:glass", "group:wood", "group:glass"},
|
||||
{"group:glass", "", "group:glass"},
|
||||
{"group:glass", "group:glass", "group:glass"}
|
||||
}
|
||||
})
|
||||
end
|
|
@ -1,7 +0,0 @@
|
|||
name = wisp
|
||||
optional_depends = nc_woodwork, nc_optics
|
||||
|
||||
release = 8770
|
||||
author = ElCeejo
|
||||
description = Adds non-entity mobs called Wisps
|
||||
title = Wisps
|
|
@ -1,13 +0,0 @@
|
|||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl m_0
|
||||
Ns 0.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 1
|
||||
map_Kd C:\\Users\\ElCeejus\\Documents\\wisp_jar.png
|
|
@ -1,126 +0,0 @@
|
|||
# Blender v2.83.9 OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib wisp_jar.mtl
|
||||
o cube.000
|
||||
v 0.312500 0.260000 0.312500
|
||||
v 0.312500 -0.490000 0.312500
|
||||
v 0.312500 0.260000 -0.312500
|
||||
v 0.312500 -0.490000 -0.312500
|
||||
v -0.312500 0.260000 -0.312500
|
||||
v -0.312500 -0.490000 -0.312500
|
||||
v -0.312500 0.260000 0.312500
|
||||
v -0.312500 -0.490000 0.312500
|
||||
v 0.187500 0.322500 0.187500
|
||||
v 0.187500 0.260000 0.187500
|
||||
v 0.187500 0.322500 -0.187500
|
||||
v 0.187500 0.260000 -0.187500
|
||||
v -0.187500 0.322500 -0.187500
|
||||
v -0.187500 0.260000 -0.187500
|
||||
v -0.187500 0.322500 0.187500
|
||||
v -0.187500 0.260000 0.187500
|
||||
v 0.312500 0.260000 0.312500
|
||||
v 0.312500 -0.490000 0.312500
|
||||
v 0.312500 0.260000 -0.312500
|
||||
v 0.312500 -0.490000 -0.312500
|
||||
v -0.312500 0.260000 -0.312500
|
||||
v -0.312500 -0.490000 -0.312500
|
||||
v -0.312500 0.260000 0.312500
|
||||
v -0.312500 -0.490000 0.312500
|
||||
vt 0.625326 0.312988
|
||||
vt 0.833008 0.312988
|
||||
vt 0.833008 0.687012
|
||||
vt 0.625326 0.687012
|
||||
vt 0.000326 0.000488
|
||||
vt 0.124674 0.000488
|
||||
vt 0.124674 0.030762
|
||||
vt 0.000326 0.030762
|
||||
vt 0.249674 0.218262
|
||||
vt 0.125326 0.218262
|
||||
vt 0.125326 0.031738
|
||||
vt 0.249674 0.031738
|
||||
vt 0.250326 0.000488
|
||||
vt 0.374674 0.000488
|
||||
vt 0.374674 0.030762
|
||||
vt 0.250326 0.030762
|
||||
vt 0.624674 0.687988
|
||||
vt 0.416992 0.687988
|
||||
vt 0.416992 0.999512
|
||||
vt 0.624674 0.999512
|
||||
vt 0.416992 0.312988
|
||||
vt 0.624674 0.312988
|
||||
vt 0.624674 0.687012
|
||||
vt 0.416992 0.687012
|
||||
vt 0.416341 0.999512
|
||||
vt 0.208659 0.999512
|
||||
vt 0.208659 0.687988
|
||||
vt 0.416341 0.687988
|
||||
vt 0.000326 0.312988
|
||||
vt 0.208008 0.312988
|
||||
vt 0.208008 0.687012
|
||||
vt 0.000326 0.687012
|
||||
vt 0.208659 0.312988
|
||||
vt 0.416341 0.312988
|
||||
vt 0.416341 0.687012
|
||||
vt 0.208659 0.687012
|
||||
vt 0.374674 0.031738
|
||||
vt 0.250326 0.031738
|
||||
vt 0.250326 0.218262
|
||||
vt 0.374674 0.218262
|
||||
vt 0.375326 0.000488
|
||||
vt 0.499674 0.000488
|
||||
vt 0.499674 0.030762
|
||||
vt 0.375326 0.030762
|
||||
vt 0.125326 0.000488
|
||||
vt 0.249674 0.000488
|
||||
vt 0.249674 0.030762
|
||||
vt 0.125326 0.030762
|
||||
vt 0.625326 0.312988
|
||||
vt 0.625326 0.687012
|
||||
vt 0.833008 0.687012
|
||||
vt 0.833008 0.312988
|
||||
vt 0.624674 0.687988
|
||||
vt 0.624674 0.999512
|
||||
vt 0.416992 0.999512
|
||||
vt 0.416992 0.687988
|
||||
vt 0.416992 0.312988
|
||||
vt 0.416992 0.687012
|
||||
vt 0.624674 0.687012
|
||||
vt 0.624674 0.312988
|
||||
vt 0.416341 0.999512
|
||||
vt 0.416341 0.687988
|
||||
vt 0.208659 0.687988
|
||||
vt 0.208659 0.999512
|
||||
vt 0.000326 0.312988
|
||||
vt 0.000326 0.687012
|
||||
vt 0.208008 0.687012
|
||||
vt 0.208008 0.312988
|
||||
vt 0.208659 0.312988
|
||||
vt 0.208659 0.687012
|
||||
vt 0.416341 0.687012
|
||||
vt 0.416341 0.312988
|
||||
vn 0.0000 -0.0000 1.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 -1.0000 -0.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
usemtl m_0
|
||||
s 1
|
||||
f 8/1/1 2/2/1 1/3/1 7/4/1
|
||||
f 10/5/2 12/6/2 11/7/2 9/8/2
|
||||
f 15/9/3 9/10/3 11/11/3 13/12/3
|
||||
f 14/13/4 16/14/4 15/15/4 13/16/4
|
||||
f 6/17/5 4/18/5 2/19/5 8/20/5
|
||||
f 6/21/4 8/22/4 7/23/4 5/24/4
|
||||
f 7/25/3 1/26/3 3/27/3 5/28/3
|
||||
f 2/29/2 4/30/2 3/31/2 1/32/2
|
||||
f 4/33/6 6/34/6 5/35/6 3/36/6
|
||||
f 14/37/5 12/38/5 10/39/5 16/40/5
|
||||
f 16/41/1 10/42/1 9/43/1 15/44/1
|
||||
f 12/45/6 14/46/6 13/47/6 11/48/6
|
||||
f 24/49/6 23/50/6 17/51/6 18/52/6
|
||||
f 22/53/3 24/54/3 18/55/3 20/56/3
|
||||
f 22/57/2 21/58/2 23/59/2 24/60/2
|
||||
f 23/61/5 21/62/5 19/63/5 17/64/5
|
||||
f 18/65/4 17/66/4 19/67/4 20/68/4
|
||||
f 20/69/1 19/70/1 21/71/1 22/72/1
|
Before Width: | Height: | Size: 696 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 368 B |