From 9a7f058659ae8d982abd4435d568a63b61d84198 Mon Sep 17 00:00:00 2001 From: Duane Date: Thu, 30 Jun 2016 15:24:00 -0500 Subject: [PATCH] Add savages to villages. --- goblin.lua | 10 +++--- village.lua | 93 +++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 89 insertions(+), 14 deletions(-) diff --git a/goblin.lua b/goblin.lua index f8b0748..6abceba 100644 --- a/goblin.lua +++ b/goblin.lua @@ -306,7 +306,7 @@ m.drops = drops['copper'] minetest.registered_entities["fun_caves:goblin_copper"] = m mobs.spawning_mobs["fun_caves:goblin_copper"] = true -mobs:register_spawn("fun_caves:goblin_copper", {"default:mossycobble"}, 100, 0, 2 * spawn_frequency, 3, 2000) +mobs:register_spawn("fun_caves:goblin_copper", {"default:mossycobble"}, 100, 0, spawn_frequency, 3, 2000) mobs:register_egg("fun_caves:goblin_copper", "Goblin Egg (copper)", "default_mossycobble.png", 1) @@ -322,7 +322,7 @@ m.drops = drops['diamond'] minetest.registered_entities["fun_caves:goblin_diamond"] = m mobs.spawning_mobs["fun_caves:goblin_diamond"] = true -mobs:register_spawn("fun_caves:goblin_diamond", {"default:mossycobble"}, 100, 0, 2 * spawn_frequency, 3, 2000) +mobs:register_spawn("fun_caves:goblin_diamond", {"default:mossycobble"}, 100, 0, spawn_frequency, 3, 2000) mobs:register_egg("fun_caves:goblin_diamond", "Goblin Egg (diamond)", "default_mossycobble.png", 1) @@ -338,7 +338,7 @@ m.drops = drops['gold'] minetest.registered_entities["fun_caves:goblin_gold"] = m mobs.spawning_mobs["fun_caves:goblin_gold"] = true -mobs:register_spawn("fun_caves:goblin_gold", {"default:mossycobble"}, 100, 0, 2 * spawn_frequency, 3, 2000) +mobs:register_spawn("fun_caves:goblin_gold", {"default:mossycobble"}, 100, 0, spawn_frequency, 3, 2000) mobs:register_egg("fun_caves:goblin_gold", "Goblin Egg (gold)", "default_mossycobble.png", 1) @@ -366,7 +366,7 @@ m.drops = drops['iron'] minetest.registered_entities["fun_caves:goblin_iron"] = m mobs.spawning_mobs["fun_caves:goblin_iron"] = true -mobs:register_spawn("fun_caves:goblin_iron", {"default:mossycobble"}, 100, 0, 2 * spawn_frequency, 3, 2000) +mobs:register_spawn("fun_caves:goblin_iron", {"default:mossycobble"}, 100, 0, spawn_frequency, 3, 2000) mobs:register_egg("fun_caves:goblin_iron", "Goblin Egg (iron)", "default_mossycobble.png", 1) @@ -382,7 +382,7 @@ m.drops = drops['king'] minetest.registered_entities["fun_caves:goblin_king"] = m mobs.spawning_mobs["fun_caves:goblin_king"] = true -mobs:register_spawn("fun_caves:goblin_king", {"default:mossycobble"}, 100, 0, 3 * spawn_frequency, 3, 2000) +mobs:register_spawn("fun_caves:goblin_king", {"default:mossycobble"}, 100, 0, 2 * spawn_frequency, 3, 2000) mobs:register_egg("fun_caves:goblin_king", "Goblin Egg (king)", "default_mossycobble.png", 1) diff --git a/village.lua b/village.lua index ea6e51e..5caf437 100644 --- a/village.lua +++ b/village.lua @@ -1,22 +1,97 @@ +local newnode = fun_caves.clone_node("default:dirt") +newnode.drop = "default:dirt" +newnode.groups.soil = 0 +minetest.register_node("fun_caves:hut_floor", newnode) + + +local drops = { + {name = "default:axe_stone", chance = 3, min = 1, max = 1}, + {name = "default:hoe_stone", chance = 3, min = 1, max = 1}, + {name = "default:sword_stone", chance = 3, min = 1, max = 1}, + {name = "default:apple", chance = 2, min = 1, max = 3}, + {name = "farming:bread", chance = 3, min = 1, max = 3}, + {name = "default:cobble", chance = 2, min = 1, max = 3}, +} + +if minetest.registered_items['mobs:leather'] then + drops[#drops+1] = {name = "mobs:leather", chance = 4, min = 1, max = 2} +end + +mobs:register_mob("fun_caves:savage", { + description = "Primitive Savage", + type = "monster", + passive = false, + damage = 1, + attack_type = "dogfight", + attacks_monsters = true, + hp_min = 5, + hp_max = 20, + armor = 100, + fear_height = 4, + collisionbox = {-0.35,-1,-0.35, 0.35,0.9,0.35}, + visual = "mesh", + mesh = "character.b3d", + drawtype = "front", + textures = { + {"fun_caves_savage_1.png"}, + }, + makes_footstep_sound = true, + --sounds = { + -- random = "goblins_goblin_ambient", + -- warcry = "goblins_goblin_attack", + -- attack = "goblins_goblin_attack", + -- damage = "goblins_goblin_damage", + -- death = "goblins_goblin_death", + -- distance = 15, + --}, + walk_velocity = 2, + run_velocity = 3, + jump = true, + drops = drops, + water_damage = 1, + lava_damage = 2, + light_damage = 0, + --lifetimer = 360, + view_range = 10, + owner = "", + animation = { + stand_start = 0, + stand_end = 79, + sit_start = 81, + sit_end = 160, + sleep_start = 162, + sleep_end = 166, + walk_start = 168, + walk_end = 187, + mine_start = 189, + mine_end = 198, + walkmine_start = 200, + walkmine_end = 219, + }, + animation_speed = 30, + on_rightclick = nil, + do_custom = nil, +}) + + +--mobs:register_egg("fun_caves:savage", "Primitive Savage", "farming_straw.png", 1) +mobs:register_spawn("fun_caves:savage", {'fun_caves:hut_floor'}, 100, 0, 20, 3, 2000) + + local function build_hut(data, area, node, pos, turf) local door = {x = ({2,7})[math.random(2)], z = ({2,7})[math.random(2)]} - if math.random(2) == 1 then - door.x = nil - else - door.z = nil - end for z = 1, 8 do for x = 1, 8 do local ivm = area:index(pos.x + x - 1, pos.y, pos.z + z - 1) if x > 1 and x < 8 and z > 1 and z < 8 then - data[ivm] = node['default:dirt'] + data[ivm] = node['fun_caves:hut_floor'] ivm = ivm + area.ystride for y = 2, 4 do if x == 2 or x == 7 or z == 2 or z == 7 then - if y <= 3 and ((z == 4 and x == door.x) or (x == 4 and z == door.z)) then - data[ivm] = node['air'] - elseif y == 3 and ((z % 3 == 0 and (x == 2 or x == 7)) or (x % 3 == 0 and (z == 2 or z == 7))) then + --if y <= 3 and ((z == 4 and x == door.x) or (x == 4 and z == door.z)) then + -- data[ivm] = node['air'] + if y <= 3 and ((z % 3 == 0 and (x == 2 or x == 7)) or (x % 3 == 0 and (z == 2 or z == 7))) then data[ivm] = node['air'] else data[ivm] = node['default:wood']