From f8678a3d4403ad7a900eb918c2633594e8f58d1f Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Thu, 26 May 2016 00:28:36 -0500 Subject: [PATCH] Correct errors in search. --- deco_caves.lua | 2 +- goblin_coal.lua | 6 +++--- goblin_cobbler.lua | 6 +++--- goblin_copper.lua | 6 +++--- goblin_diamond.lua | 6 +++--- goblin_digger.lua | 9 +++++---- goblin_gold.lua | 6 +++--- goblin_ice.lua | 4 ++-- goblin_iron.lua | 6 +++--- goblin_king.lua | 14 +++++++------- mobs.lua | 2 ++ 11 files changed, 35 insertions(+), 32 deletions(-) diff --git a/deco_caves.lua b/deco_caves.lua index 86a4a3c..f95e85c 100644 --- a/deco_caves.lua +++ b/deco_caves.lua @@ -23,7 +23,7 @@ function fun_caves.decorate_cave(node, data, area, minp, y, ivm, biome_val_in) stone_type = node("default:ice") stone_depth = 2 elseif biome_val < -0.6 then - stone_type = node("fun_caves:thinice") + stone_type = node("fun_caves:thin_ice") stone_depth = 2 elseif biome_val < -0.5 then stone_type = node("fun_caves:stone_with_lichen") diff --git a/goblin_coal.lua b/goblin_coal.lua index 8f56613..df9d1df 100644 --- a/goblin_coal.lua +++ b/goblin_coal.lua @@ -108,9 +108,9 @@ mobs:register_mob("fun_caves:goblin_coal", { end, do_custom = function(self) - 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(), 500, {"group:stone"}, "fun_caves:stone_with_coal_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_coal_trap") fun_caves.surface_damage(self) end, diff --git a/goblin_cobbler.lua b/goblin_cobbler.lua index bc78f4e..b8b8ced 100644 --- a/goblin_cobbler.lua +++ b/goblin_cobbler.lua @@ -112,9 +112,9 @@ mobs:register_mob("fun_caves:goblin_cobble", { end, do_custom = function(self) - fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") - fun_caves.search_replace(self.object:getpos(), 5, {"default:stone", "default:desert_stone", "default:sandstone"}, "default:mossycobble") - fun_caves.search_replace(self.object:getpos(), 50, {"default:mossycobble"}, "fun_caves:mossycobble_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone", "default:desert_stone", "default:sandstone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:mossycobble"}, "fun_caves:mossycobble_trap") fun_caves.surface_damage(self) end, diff --git a/goblin_copper.lua b/goblin_copper.lua index 68d624c..fc57b13 100644 --- a/goblin_copper.lua +++ b/goblin_copper.lua @@ -108,9 +108,9 @@ mobs:register_mob("fun_caves:goblin_copper", { end, do_custom = function(self) - 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(), 500, 5, {"group:stone"}, "fun_caves:stone_with_copper_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_copper_trap") fun_caves.surface_damage(self) end, diff --git a/goblin_diamond.lua b/goblin_diamond.lua index e57b3f3..1dc5561 100644 --- a/goblin_diamond.lua +++ b/goblin_diamond.lua @@ -110,9 +110,9 @@ mobs:register_mob("fun_caves:goblin_diamond", { end, do_custom = function(self) - 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(), 500, 5, {"group:stone"}, "fun_caves:stone_with_diamond_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_diamond_trap") fun_caves.surface_damage(self) end, diff --git a/goblin_digger.lua b/goblin_digger.lua index 99ebf2d..c730ce0 100644 --- a/goblin_digger.lua +++ b/goblin_digger.lua @@ -4,7 +4,8 @@ -- He destroys everything diggable in his path. It's too much trouble -- to fudge around with particulars. Besides, I don't want them to -- mine for me. -local diggable_nodes = {"group:stone", "group:sand", "group:soil", "group:plant"} +--local diggable_nodes = {"group:stone", "group:sand", "group:soil", "group:plant", "default:stone_with_coal", "default:stone_with_iron", "default:stone_with_copper", "default:stone_with_gold", "default:stone_with_mese", "default:stone_with_diamond", "default:mese", "default:coalblock"} +local diggable_nodes = {"group:cracky", "group:snappy", "group:crumbly"} -- This translates yaw into vectors. local cardinals = {{x=0,y=0,z=0.75}, {x=-0.75,y=0,z=0}, {x=0,y=0,z=-0.75}, {x=0.75,y=0,z=0}} @@ -205,9 +206,9 @@ mobs:register_mob("fun_caves:goblin_digger", { do_custom = function(self) goblin_tunneling(self, "digger") - fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") - fun_caves.search_replace(self.object:getpos(), 10, {"default:stone", "default:desert_stone", "default:sandstone"}, "default:mossycobble") - fun_caves.search_replace(self.object:getpos(), 50, {"default:mossycobble"}, "fun_caves:mossycobble_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone", "default:desert_stone", "default:sandstone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:mossycobble"}, "fun_caves:mossycobble_trap") fun_caves.surface_damage(self) end, diff --git a/goblin_gold.lua b/goblin_gold.lua index 10907a6..388163d 100644 --- a/goblin_gold.lua +++ b/goblin_gold.lua @@ -108,9 +108,9 @@ mobs:register_mob("fun_caves:goblin_gold", { end, do_custom = function(self) - 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(), 500, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_gold_trap") fun_caves.surface_damage(self) end, diff --git a/goblin_ice.lua b/goblin_ice.lua index 6a623de..158fe4a 100644 --- a/goblin_ice.lua +++ b/goblin_ice.lua @@ -107,9 +107,9 @@ mobs:register_mob("fun_caves:goblin_ice", { end, do_custom = function(self) - fun_caves.search_replace(self.object:getpos(), 5, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") --fun_caves.search_replace(self.object:getpos(), 20, {"default:stone"}, "default:mossycobble") - fun_caves.search_replace(self.object:getpos(), 500, {"default:ice"}, "fun_caves:ice_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:ice"}, "fun_caves:ice_trap") fun_caves.surface_damage(self, true) end, diff --git a/goblin_iron.lua b/goblin_iron.lua index f46d0bd..0349e40 100644 --- a/goblin_iron.lua +++ b/goblin_iron.lua @@ -110,9 +110,9 @@ mobs:register_mob("fun_caves:goblin_iron", { end, do_custom = function(self) - 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(), 500, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_iron_trap") fun_caves.surface_damage(self) end, diff --git a/goblin_king.lua b/goblin_king.lua index 56bd305..a862712 100644 --- a/goblin_king.lua +++ b/goblin_king.lua @@ -109,13 +109,13 @@ mobs:register_mob("fun_caves:goblin_king", { end, do_custom = function(self) - 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(), 500, {"default:mossycobble"}, "fun_caves:mossycobble_trap") - fun_caves.search_replace(self.object:getpos(), 500, {"group:stone"}, "fun_caves:stone_with_coal_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(), 500, 5, {"group:stone"}, "fun_caves:stone_with_gold_trap") - fun_caves.search_replace(self.object:getpos(), 500, 5, {"group:stone"}, "fun_caves:stone_with_iron_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_torch_freq, {"default:torch"}, "air") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:stone"}, "default:mossycobble") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"default:mossycobble"}, "fun_caves:mossycobble_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_coal_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_copper_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_gold_trap") + fun_caves.search_replace(self.object:getpos(), fun_caves.goblin_trap_freq, {"group:stone"}, "fun_caves:stone_with_iron_trap") fun_caves.surface_damage(self) end, diff --git a/mobs.lua b/mobs.lua index 79299ca..1dbb26d 100644 --- a/mobs.lua +++ b/mobs.lua @@ -88,6 +88,8 @@ end fun_caves.goblin_spawn_frequency = 150 +fun_caves.goblin_trap_freq = 500 +fun_caves.goblin_torch_freq = 10 fun_caves.goblin_drops = { "default:pick_steel", "default:sword_steel", "default:shovel_steel", "farming:bread", "bucket:bucket_water", "default:pick_stone", "default:sword_stone" } --{"group:stone"} = { "default:stone", "default:mossycobble", "default:sandstone", "default:desert_stone", "default:stone_with_coal", "default:stone_with_iron", "default:stone_with_copper", "default:stone_with_gold", "default:stone_with_diamond" }