Adjustments and add sand monster.

This commit is contained in:
Duane Robertson 2016-05-18 05:13:38 -05:00
parent 54cff8252b
commit 36597871fb
10 changed files with 32 additions and 35 deletions

View file

@ -46,7 +46,7 @@ mobs:register_mob("fun_caves:dangler", {
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
{name = "farming:cotton", chance = 2, min = 1, max = 2},
},
water_damage = 1,
water_damage = 0,
lava_damage = 5,
cold_damage = 1,
light_damage = 0,

View file

@ -22,13 +22,13 @@ function fun_caves.make_fungal_tree(data, area, pos, height, leaves, fruit)
local force_y = math.random(1,3) - 2
for z = -radius,radius do
for x = -radius,radius do
local sr = math.random(1,27)
local sr = math.random(1,100)
local i = pos + z*area.zstride + y*area.ystride + x
if force_x == x and force_y == y then
data[i] = leaves
elseif sr == 1 then
data[i] = fruit
elseif sr < 14 then
elseif sr < 50 then
data[i] = leaves
end
end

View file

@ -4,7 +4,6 @@ local cave_noise_1 = {offset = 0, scale = 1, seed = 3901, spread = {x = 40, y =
local cave_noise_2 = {offset = 0, scale = 1, seed = -8402, spread = {x = 40, y = 20, z = 40}, octaves = 3, persist = 1, lacunarity = 2}
local seed_noise = {offset = 0, scale = 32768, seed = 5202, spread = {x = 80, y = 80, z = 80}, octaves = 2, persist = 0.4, lacunarity = 2}
local biome_noise = {offset = 0.0, scale = 1.0, spread = {x = 400, y = 400, z = 400}, seed = 903, octaves = 3, persist = 0.5, lacunarity = 2.0}
local biome_blend = {offset = 0.0, scale = 0.1, spread = {x = 8, y = 8, z = 8}, seed = 4023, octaves = 2, persist = 1.0, lacunarity = 2.0}
local node = fun_caves.node
@ -176,14 +175,9 @@ function fun_caves.generate(p_minp, p_maxp, seed)
-- use the same seed (based on perlin noise).
math.randomseed(minetest.get_perlin(seed_noise):get2d({x=minp.x, y=minp.z}))
-- Keep this first after seeding!
local px = math.floor((minp.x + 32) / csize.x)
local pz = math.floor((minp.z + 32) / csize.z)
local cave_1 = minetest.get_perlin_map(cave_noise_1, csize):get3dMap_flat(minp)
local cave_2 = minetest.get_perlin_map(cave_noise_2, csize):get3dMap_flat(minp)
local biome_n = minetest.get_perlin_map(biome_noise, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z})
local biome_bn = minetest.get_perlin_map(biome_blend, {x=csize.x, y=csize.z}):get2dMap_flat({x=minp.x, y=minp.z})
local biome_n = minetest.get_perlin_map(biome_noise, csize):get3dMap_flat(minp)
local biome_avg = 0
local biome_ct = 0
@ -209,7 +203,7 @@ function fun_caves.generate(p_minp, p_maxp, seed)
data[ivm] = node("default:stone")
end
local biome_val = biome_n[index] + biome_bn[index]
local biome_val = biome_n[index3d]
biome_avg = biome_avg + biome_val
biome_ct = biome_ct + 1
@ -225,6 +219,7 @@ function fun_caves.generate(p_minp, p_maxp, seed)
minetest.generate_ores(vm, minp, maxp)
vm:get_data(data)
local noise_area = VoxelArea:new({MinEdge={x=0,y=0,z=0}, MaxEdge=vector.subtract(csize, 1)})
local index = 0
local index3d = 0
for z = minp.z, maxp.z do
@ -232,7 +227,7 @@ function fun_caves.generate(p_minp, p_maxp, seed)
for x = minp.x, maxp.x do
index = index + 1
local dx = x - minp.x
index3d = (dz + 1) * csize.y * csize.x + dx
index3d = noise_area:index(dx, csize.y - 1, dz)
local air_count = 0
local ivm = area:index(x, maxp.y, z)
@ -245,7 +240,7 @@ function fun_caves.generate(p_minp, p_maxp, seed)
-------------------
local stone_type = node("default:stone")
local stone_depth = 1
local biome_val = biome_n[index] + biome_bn[index]
local biome_val = biome_n[index3d]
if biome_val < -0.8 then
if true then
stone_type = node("default:ice")
@ -298,9 +293,9 @@ function fun_caves.generate(p_minp, p_maxp, seed)
local sr = math.random(1,1000)
-- fluids
if (data[ivm_below] == node("default:stone") or data[ivm_below] == node("fun_caves:hot_cobble")) and sr < 20 then
if (data[ivm_below] == node("default:stone") or data[ivm_below] == node("fun_caves:hot_cobble")) and sr < 3 then
data[ivm] = node("default:lava_source")
elseif data[ivm_below] == node("fun_caves:stone_with_moss") and sr < 5 then
elseif data[ivm_below] == node("fun_caves:stone_with_moss") and sr < 3 then
data[ivm] = node("default:water_source")
-- hanging down
elseif data[ivm_above] == node("default:ice") and sr < 80 then
@ -332,6 +327,8 @@ function fun_caves.generate(p_minp, p_maxp, seed)
elseif data[ivm_below] == node("fun_caves:stone_with_lichen") or data[ivm_above] == node("default:stone") then
data[ivm] = node("fun_caves:stalagmite")
end
elseif data[ivm_below] == node("fun_caves:stone_with_moss") and sr < 100 then
data[ivm_below] = node("fun_caves:glowing_fungal_stone")
-- vegetation
elseif (data[ivm_below] == node("fun_caves:stone_with_lichen") or data[ivm_below] == node("fun_caves:stone_with_algae")) and biome_val >= -0.7 then
if sr < 110 then
@ -387,17 +384,15 @@ function fun_caves.respawn(player)
local pos = {x=0,y=0,z=0}
local cave_1 = minetest.get_perlin(cave_noise_1):get3d(pos)
local cave_2 = minetest.get_perlin(cave_noise_2):get3d(pos)
local biome_n = minetest.get_perlin(biome_noise):get2d({x=pos.x, y=pos.z})
local biome_bn = minetest.get_perlin(biome_blend):get2d({x=pos.x, y=pos.z})
local biome = biome_n + biome_bn
local biome_n = minetest.get_perlin(biome_noise):get3d({x=pos.x, y=pos.y, z=pos.z})
local biome = biome_n
while biome < -0.3 or biome > 0.3 do
pos.x = pos.x + math.random(20) - 10
pos.z = pos.z + math.random(20) - 10
biome_n = minetest.get_perlin(biome_noise):get2d({x=pos.x, y=pos.z})
biome_bn = minetest.get_perlin(biome_blend):get2d({x=pos.x, y=pos.z})
biome = biome_n + biome_bn
biome_n = minetest.get_perlin(biome_noise):get3d({x=pos.x, y=pos.y, z=pos.z})
biome = biome_n
end
while cave_1 * cave_2 <= 0.05 do

View file

@ -26,7 +26,7 @@ dofile(fun_caves.path .. "/stone_monster.lua")
dofile(fun_caves.path .. "/lava_flan.lua")
--dofile(fun_caves.path .. "/dungeon_master.lua")
--dofile(fun_caves.path .. "/mese_monster.lua")
--dofile(fun_caves.path .. "/sand_monster.lua")
dofile(fun_caves.path .. "/sand_monster.lua")
fun_caves.goblin_spawn_frequency = 150

Binary file not shown.

View file

@ -6,10 +6,9 @@
-- These are instantiated by voxel.lua since the decoration manager
-- only works at the surface of the world.
local light_max = 15
local light_max = 13
minetest.add_group("default:ice", {surface_cold = 3})
--minetest.override_item("default:ice", {damage_per_second = 1})
minetest.register_node("fun_caves:huge_mushroom_cap", {
description = "Huge Mushroom Cap",
@ -24,7 +23,7 @@ minetest.register_node("fun_caves:huge_mushroom_cap", {
{-0.33, -0.5, -0.33, 0.33, -0.33, -0.5},
{-0.33, -0.33, -0.33, 0.33, -0.17, 0.33},
} },
light_source = 14,
light_source = 11,
groups = {fleshy=1, dig_immediate=3, flammable=2, plant=1, leafdecay=1},
})
@ -42,7 +41,7 @@ minetest.register_node("fun_caves:giant_mushroom_cap", {
{-0.4, -0.5, -0.75, 0.4, -0.25, -0.4},
{-0.4, -0.5, 0.4, 0.4, -0.25, 0.75},
} },
light_source = 12,
light_source = 14,
groups = {fleshy=1, dig_immediate=3, flammable=2, plant=1, leafdecay=1},
})
@ -116,7 +115,7 @@ minetest.register_node("fun_caves:glowing_fungal_stone", {
description = "Glowing Fungal Stone",
tiles = {"default_stone.png^vmg_glowing_fungal.png",},
is_ground_content = true,
light_source = 10,
light_source = 6,
groups = {cracky=3, stone=1},
drop = {items={ {items={"default:cobble"},}, {items={"fun_caves:glowing_fungus",},},},},
sounds = default.node_sound_stone_defaults(),
@ -343,6 +342,7 @@ minetest.register_node("fun_caves:stone_with_salt", {
sunlight_propagates = true,
is_ground_content = true,
groups = {stone=1, crumbly=3},
--light_source = 1,
sounds = default.node_sound_glass_defaults(),
})
@ -408,6 +408,7 @@ minetest.register_node("fun_caves:hot_cobble", {
tiles = {"caverealms_hot_cobble.png"},
is_ground_content = true,
groups = {crumbly=2, surface_hot=3},
--light_source = 2,
damage_per_second = 1,
sounds = default.node_sound_stone_defaults({
footstep = {name="default_stone_footstep", gain=0.25},
@ -619,6 +620,7 @@ for i in ipairs(spike_size) do
paramtype = "light",
drawtype = "plantlike",
walkable = false,
light_source = i * 2,
buildable_to = true,
visual_scale = vs,
selection_box = {
@ -631,7 +633,7 @@ end
-- Spike spread and death
minetest.register_abm({
nodenames = hot_spikes,
neighbors = {"default:lava_source", "default:lava_flowing"},
--neighbors = {"default:lava_source", "default:lava_flowing"},
interval = 6 * fun_caves.time_factor,
chance = 50,
action = function(pos, node)

View file

@ -1,7 +1,7 @@
-- Sand Monster by PilzAdam
mobs:register_mob("mobs_monster:sand_monster", {
mobs:register_mob("fun_caves:sand_monster", {
type = "monster",
passive = false,
attack_type = "dogfight",
@ -15,7 +15,7 @@ mobs:register_mob("mobs_monster:sand_monster", {
visual = "mesh",
mesh = "mobs_sand_monster.b3d",
textures = {
{"mobs_sand_monster.png"},
{"fun_caves_sand_monster.png"},
},
makes_footstep_sound = true,
sounds = {
@ -27,7 +27,7 @@ mobs:register_mob("mobs_monster:sand_monster", {
jump = true,
floats = 0,
drops = {
{name = "default:desert_sand", chance = 1, min = 3, max = 5},
{name = "default:sand", chance = 1, min = 3, max = 5},
},
water_damage = 3,
lava_damage = 4,
@ -47,9 +47,9 @@ mobs:register_mob("mobs_monster:sand_monster", {
},
})
mobs:register_spawn("mobs_monster:sand_monster", {"default:desert_sand"}, 20, 0, 7000, 1, 31000)
mobs:register_spawn("fun_caves:sand_monster", {"group:sand"}, 20, 0, 4000, 3, 31000)
mobs:register_egg("mobs_monster:sand_monster", "Sand Monster", "default_desert_sand.png", 1)
mobs:register_egg("fun_caves:sand_monster", "Sand Monster", "default_sand.png", 1)
-- compatibility
mobs:alias_mob("mobs:sand_monster", "mobs_monster:sand_monster")
mobs:alias_mob("mobs:sand_monster", "fun_caves:sand_monster")

View file

@ -32,7 +32,7 @@ mobs:register_mob("fun_caves:spider", {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
{name = "wool:black", chance = 1, min = 1, max = 3},
},
water_damage = 5,
water_damage = 0,
lava_damage = 5,
light_damage = 0,
animation = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB