Adjust mushrooms and goblins.

Remove dirt from desert caves.
This commit is contained in:
Duane Robertson 2016-05-23 09:53:37 -05:00
parent 11e404c23a
commit c93090b4e8
12 changed files with 39 additions and 38 deletions

View file

@ -14,9 +14,9 @@ function fun_caves.decorate_cave(data, area, minp, y, ivm, biome_val_in)
local stone_type = node("default:stone") local stone_type = node("default:stone")
local stone_depth = 1 local stone_depth = 1
if y > -500 then --if y > -500 then
biome_val = biome_val / math.max(1, math.log(500 + y)) -- biome_val = biome_val / math.max(1, math.log(500 + y))
end --end
------------------- -------------------
--biome_val = 0.7 --biome_val = 0.7
------------------- -------------------
@ -62,7 +62,7 @@ function fun_caves.decorate_cave(data, area, minp, y, ivm, biome_val_in)
end end
end end
if node_above == node("air") and (stone_type == node("fun_caves:stone_with_algae") or stone_type == node("fun_caves:stone_with_lichen")) and math.random(4) == 1 then if node_above == node("air") and (stone_type == node("fun_caves:stone_with_algae") or stone_type == node("fun_caves:stone_with_lichen")) and math.random(10) == 1 then
return node("dirt") return node("dirt")
end end

View file

@ -2,7 +2,7 @@
mobs:register_mob("fun_caves:goblin_coal", { mobs:register_mob("fun_caves:goblin_coal", {
description = "Coal Goblin", description = "Coal Goblin",
type = "animal", type = "monster",
passive = false, passive = false,
damage = 1, damage = 1,
attack_type = "dogfight", attack_type = "dogfight",
@ -110,7 +110,7 @@ mobs:register_mob("fun_caves:goblin_coal", {
do_custom = function(self) do_custom = function(self)
fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, {"group:stone"}, "fun_caves:stone_with_coal_trap") fun_caves.search_replace(self.object:getpos(), 500, {"group:stone"}, "fun_caves:stone_with_coal_trap")
fun_caves.surface_damage(self) fun_caves.surface_damage(self)
end, end,
@ -124,7 +124,7 @@ minetest.register_node("fun_caves:stone_with_coal_trap", {
description = "Coal Trap", description = "Coal Trap",
tiles = {"default_cobble.png^default_mineral_coal.png"}, tiles = {"default_cobble.png^default_mineral_coal.png"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:coal_lump', --drop = 'default:coal_lump',
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })

View file

@ -2,8 +2,8 @@
mobs:register_mob("fun_caves:goblin_cobble", { mobs:register_mob("fun_caves:goblin_cobble", {
description = "Cobble Goblin", description = "Cobble Goblin",
type = "animal", type = "monster",
passive = true, passive = false,
damage = 1, damage = 1,
attack_type = "dogfight", attack_type = "dogfight",
attacks_monsters = true, attacks_monsters = true,

View file

@ -110,7 +110,7 @@ mobs:register_mob("fun_caves:goblin_copper", {
do_custom = function(self) do_custom = function(self)
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap") fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap")
fun_caves.surface_damage(self) fun_caves.surface_damage(self)
end, end,
@ -123,7 +123,7 @@ minetest.register_node("fun_caves:stone_with_copper_trap", {
description = "Copper Trap", description = "Copper Trap",
tiles = {"default_cobble.png^default_mineral_copper.png"}, tiles = {"default_cobble.png^default_mineral_copper.png"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:copper_lump', --drop = 'default:copper_lump',
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })

View file

@ -112,7 +112,7 @@ mobs:register_mob("fun_caves:goblin_diamond", {
do_custom = function(self) do_custom = function(self)
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_diamond_trap") fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_diamond_trap")
fun_caves.surface_damage(self) fun_caves.surface_damage(self)
end, end,
@ -126,7 +126,7 @@ minetest.register_node("fun_caves:stone_with_diamond_trap", {
description = "Diamond Trap", description = "Diamond Trap",
tiles = {"default_cobble.png^default_mineral_diamond.png"}, tiles = {"default_cobble.png^default_mineral_diamond.png"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:diamond', --drop = 'default:diamond',
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })

View file

@ -97,8 +97,8 @@ end
mobs:register_mob("fun_caves:goblin_digger", { mobs:register_mob("fun_caves:goblin_digger", {
description = "Digger Goblin", description = "Digger Goblin",
type = "animal", type = "monster",
passive = true, passive = false,
damage = 1, damage = 1,
attack_type = "dogfight", attack_type = "dogfight",
attacks_monsters = true, attacks_monsters = true,

View file

@ -110,7 +110,7 @@ mobs:register_mob("fun_caves:goblin_gold", {
do_custom = function(self) do_custom = function(self)
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap") fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap")
fun_caves.surface_damage(self) fun_caves.surface_damage(self)
end, end,
@ -219,7 +219,7 @@ minetest.register_node("fun_caves:stone_with_gold_trap", {
description = "Gold Trap", description = "Gold Trap",
tiles = {"default_cobble.png^default_mineral_gold.png"}, tiles = {"default_cobble.png^default_mineral_gold.png"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:gold_lump', --drop = 'default:gold_lump',
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })

View file

@ -109,7 +109,7 @@ mobs:register_mob("fun_caves:goblin_ice", {
do_custom = function(self) do_custom = function(self)
fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air")
--fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble") --fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, {"default:ice"}, "fun_caves:ice_trap") fun_caves.search_replace(self.object:getpos(), 500, {"default:ice"}, "fun_caves:ice_trap")
fun_caves.surface_damage(self, true) fun_caves.surface_damage(self, true)
end, end,

View file

@ -112,7 +112,7 @@ mobs:register_mob("fun_caves:goblin_iron", {
do_custom = function(self) do_custom = function(self)
fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 5, 1, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, 1, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap") fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap")
fun_caves.surface_damage(self) fun_caves.surface_damage(self)
end, end,
@ -125,7 +125,7 @@ minetest.register_node("fun_caves:stone_with_iron_trap", {
description = "Iron Trap", description = "Iron Trap",
tiles = {"default_cobble.png^default_mineral_iron.png"}, tiles = {"default_cobble.png^default_mineral_iron.png"},
groups = {cracky = 3}, groups = {cracky = 3},
drop = 'default:iron_lump', --drop = 'default:iron_lump',
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })

View file

@ -111,11 +111,11 @@ mobs:register_mob("fun_caves:goblin_king", {
do_custom = function(self) do_custom = function(self)
fun_caves.search_replace(self.object:getpos(), 2, {"default:torch"}, "air") fun_caves.search_replace(self.object:getpos(), 2, {"default:torch"}, "air")
fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble") fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble")
fun_caves.search_replace(self.object:getpos(), 50, {"default:mossycobble"}, "fun_caves:mossycobble_trap") fun_caves.search_replace(self.object:getpos(), 500, {"default:mossycobble"}, "fun_caves:mossycobble_trap")
fun_caves.search_replace(self.object:getpos(), 50, {"group:stone"}, "fun_caves:stone_with_coal_trap") fun_caves.search_replace(self.object:getpos(), 500, {"group:stone"}, "fun_caves:stone_with_coal_trap")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap") fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap") fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap")
fun_caves.search_replace(self.object:getpos(), 50, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap") fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap")
fun_caves.surface_damage(self) fun_caves.surface_damage(self)
end, end,

View file

@ -208,7 +208,8 @@ function fun_caves.generate(p_minp, p_maxp, seed)
if bullshit_heightmap or y <= heightmap[index] - 20 then if bullshit_heightmap or y <= heightmap[index] - 20 then
data[ivm] = fun_caves.decorate_cave(data, area, minp, y, ivm, biome_n[index3d]) or data[ivm] data[ivm] = fun_caves.decorate_cave(data, area, minp, y, ivm, biome_n[index3d]) or data[ivm]
elseif y < heightmap[index] and not bullshit_heightmap then elseif y < heightmap[index] and not bullshit_heightmap then
if data[ivm] == node("air") and data[ivm - area.ystride] ~= node('air') then --if data[ivm] == node("air") and data[ivm - area.ystride] ~= node('air') then
if data[ivm] == node("air") and (data[ivm - area.ystride] == node('default:stone') or data[ivm - area.ystride] == node('default:sandstone')) then
data[ivm - area.ystride] = node("dirt") data[ivm - area.ystride] = node("dirt")
end end
else else

View file

@ -423,8 +423,8 @@ end)
-- mushroom growth -- mushroom growth
minetest.register_abm({ minetest.register_abm({
nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"}, nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"},
interval = 50 * fun_caves.time_factor, interval = 200 * fun_caves.time_factor,
chance = 100, chance = 25,
action = function(pos, node) action = function(pos, node)
local pos_up = {x=pos.x,y=pos.y+1,z=pos.z} local pos_up = {x=pos.x,y=pos.y+1,z=pos.z}
local node_up = minetest.get_node_or_nil(pos_up) local node_up = minetest.get_node_or_nil(pos_up)
@ -449,8 +449,8 @@ minetest.register_abm({
-- mushroom growth -- mushroom growth
minetest.register_abm({ minetest.register_abm({
nodenames = {"fun_caves:huge_mushroom_cap"}, nodenames = {"fun_caves:huge_mushroom_cap"},
interval = 100 * fun_caves.time_factor, interval = 500 * fun_caves.time_factor,
chance = 150, chance = 30,
action = function(pos, node) action = function(pos, node)
if minetest.get_node_light(pos, nil) >= 14 then if minetest.get_node_light(pos, nil) >= 14 then
minetest.set_node(pos, {name = "air"}) minetest.set_node(pos, {name = "air"})
@ -483,8 +483,8 @@ minetest.register_abm({
-- mushroom growth -- mushroom growth
minetest.register_abm({ minetest.register_abm({
nodenames = {"fun_caves:giant_mushroom_stem"}, nodenames = {"fun_caves:giant_mushroom_stem"},
interval = 5 * fun_caves.time_factor, interval = 15 * fun_caves.time_factor,
chance = 5, chance = 10,
action = function(pos, node) action = function(pos, node)
local pos_up = {x=pos.x,y=pos.y+1,z=pos.z} local pos_up = {x=pos.x,y=pos.y+1,z=pos.z}
local node_up = minetest.get_node_or_nil(pos_up) local node_up = minetest.get_node_or_nil(pos_up)
@ -503,8 +503,8 @@ minetest.register_abm({
-- mushroom spread -- mushroom spread
minetest.register_abm({ minetest.register_abm({
nodenames = {"fun_caves:giant_mushroom_cap", "fun_caves:huge_mushroom_cap"}, nodenames = {"fun_caves:giant_mushroom_cap", "fun_caves:huge_mushroom_cap"},
interval = 3 * fun_caves.time_factor, interval = 15 * fun_caves.time_factor,
chance = 40, chance = 10,
action = function(pos, node) action = function(pos, node)
if minetest.get_node_light(pos, nil) >= 14 then if minetest.get_node_light(pos, nil) >= 14 then
minetest.set_node(pos, {name = "air"}) minetest.set_node(pos, {name = "air"})
@ -533,8 +533,8 @@ minetest.register_abm({
-- Mushroom spread and death -- Mushroom spread and death
minetest.register_abm({ minetest.register_abm({
nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"}, nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"},
interval = 3 * fun_caves.time_factor, interval = 15 * fun_caves.time_factor,
chance = 50, chance = 10,
action = function(pos, node) action = function(pos, node)
if minetest.get_node_light(pos, nil) == 15 then if minetest.get_node_light(pos, nil) == 15 then
minetest.remove_node(pos) minetest.remove_node(pos)
@ -612,8 +612,8 @@ end
minetest.register_abm({ minetest.register_abm({
nodenames = hot_spikes, nodenames = hot_spikes,
--neighbors = {"default:lava_source", "default:lava_flowing"}, --neighbors = {"default:lava_source", "default:lava_flowing"},
interval = 6 * fun_caves.time_factor, interval = 30 * fun_caves.time_factor,
chance = 50, chance = 10,
action = function(pos, node) action = function(pos, node)
local spike_num local spike_num
for i = 1, #hot_spikes do for i = 1, #hot_spikes do