Add mobs.

master
Duane Robertson 2016-10-05 21:14:31 -05:00
parent 23a27481b6
commit ba89b97bb1
45 changed files with 7595 additions and 11 deletions

539
dmobs.lua Normal file
View File

@ -0,0 +1,539 @@
-- This was taken more or less intact from loud_walking by D00Med
mobs:register_mob("loud_walking:fox", {
type = "animal",
attacks_monsters = true,
reach = 1,
damage = 1,
attack_type = "dogfight",
hp_min = 4,
hp_max = 8,
armor = 100,
collisionbox = {-0.4, -0.6, -0.4, 0.3, 0.3, 0.3},
runaway = true,
pathfinding = true,
visual = "mesh",
mesh = "fox.b3d",
textures = {
{"dmobs_fox.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=1.5, y=1.5},
makes_footstep_sound = true,
walk_velocity = 1,
run_velocity = 2.5,
jump = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},
water_damage = 0,
lava_damage = 2,
light_damage = 0,
replace_rate = 10,
replace_what = {"farming:wheat_5", "default:fence_wood", "default:grass_5", "default:dirt_with_grass"},
replace_with = "air",
follow = {"mobs:meat_raw"},
view_range = 14,
animation = {
speed_normal = 6,
speed_run = 15,
walk_start = 25,
walk_end = 35,
stand_start = 51,
stand_end = 60,
run_start = 1,
run_end = 16,
punch_start = 36,
punch_end = 51,
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
mobs:register_spawn("loud_walking:fox", {"default:dirt_with_grass","default:dirt"}, 20, 10, 15000, 2, 31000)
mobs:register_egg("loud_walking:fox", "Fox", "wool_orange.png", 1)
mobs:register_mob("loud_walking:hedgehog", {
type = "animal",
passive = true,
hp_min = 1,
hp_max = 2,
armor = 100,
collisionbox = {-0.1, -0.1, -0.2, 0.2, 0.2, 0.2},
visual = "mesh",
mesh = "hedgehog.b3d",
textures = {
{"dmobs_hedgehog.png"},
},
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},
blood_texture = "mobs_blood.png",
visual_size = {x=2, y=2},
makes_footstep_sound = true,
walk_velocity = 0.5,
run_velocity = 1,
jump = true,
water_damage = 2,
lava_damage = 2,
light_damage = 0,
view_range = 14,
follow = {"farming:bread"},
animation = {
speed_normal = 5,
speed_run = 10,
walk_start = 1,
walk_end = 10,
stand_start = 1,
stand_end = 10,
run_start = 1,
run_end = 10,
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
mobs:register_spawn("loud_walking:hedgehog", {"default:dirt_with_grass","default:pine_needles"}, 20, 10, 15000, 2, 31000)
mobs:register_egg("loud_walking:hedgehog", "Hedgehog", "wool_brown.png", 1)
mobs:register_mob("loud_walking:elephant", {
type = "monster",
passive = false,
reach = 3,
damage = 5,
attack_type = "dogfight",
hp_min = 24,
hp_max = 40,
armor = 75,
collisionbox = {-0.9, -1.2, -0.9, 0.9, 0.9, 0.9},
visual = "mesh",
mesh = "elephant.b3d",
textures = {
{"dmobs_elephant.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=2.5, y=2.5},
makes_footstep_sound = true,
walk_velocity = 0.5,
run_velocity = 1,
jump = false,
water_damage = 0,
lava_damage = 2,
light_damage = 0,
replace_rate = 10,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "ethereal:bamboo"},
replace_with = "air",
follow = {"farming:wheat"},
view_range = 14,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 9},
},
animation = {
speed_normal = 5,
speed_run = 10,
walk_start = 3,
walk_end = 19,
stand_start = 20,
stand_end = 30,
run_start = 3,
run_end = 19,
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
mobs:register_spawn("loud_walking:elephant", {"default:dirt_with_dry_grass","default:desert_sand"}, 20, 10, 15000, 2, 31000)
mobs:register_egg("loud_walking:elephant", "Elephant", "default_dry_grass.png", 1)
mobs:register_mob("loud_walking:whale", {
type = "animal",
passive = false,
reach = 2,
damage = 5,
attack_type = "dogfight",
hp_min = 52,
hp_max = 82,
armor = 100,
collisionbox = {-0.9, -1.2, -0.9, 0.9, 0.9, 0.9},
visual = "mesh",
mesh = "whale.b3d",
rotate = 180,
textures = {
{"dmobs_whale.png"},
},
sounds = {
random = "whale_1",
death = "whale_1",
distance = 128,
},
blood_texture = "mobs_blood.png",
visual_size = {x=2.5, y=2.5},
makes_footstep_sound = true,
walk_velocity = 0.5,
run_velocity = 1,
jump = false,
stepheight = 1.5,
fall_damage = 0,
fall_speed = -6,
fly = true,
fly_in = "default:water_source",
water_damage = 0,
lava_damage = 2,
light_damage = 0,
follow = {"fishing:fish_cooked"},
view_range = 14,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},
animation = {
speed_normal = 5,
speed_run = 10,
walk_start = 2,
walk_end = 39,
stand_start = 2,
stand_end = 39,
run_start = 2,
run_end = 39,
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
mobs:register_spawn("loud_walking:whale", {"default:water_source"}, 20, 1, 15000, -20, 1000)
mobs:register_egg("loud_walking:whale", "Whale", "default_water_source.png", 1)
mobs:register_mob("loud_walking:orc", {
type = "monster",
passive = false,
reach = 2,
damage = 2,
attack_type = "dogfight",
hp_min = 12,
hp_max = 22,
armor = 100,
collisionbox = {-0.4, -1.3, -0.4, 0.4, 1, 0.4},
visual = "mesh",
mesh = "orc.b3d",
textures = {
{"dmobs_orc.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=3, y=3},
makes_footstep_sound = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 4},
},
walk_velocity = 1,
run_velocity = 2,
jump = true,
water_damage = 0,
lava_damage = 2,
light_damage = 0,
view_range = 14,
animation = {
speed_normal = 10,
speed_run = 20,
walk_start = 2,
walk_end = 18,
stand_start = 30,
stand_end = 40,
run_start = 2,
run_end = 18,
punch_start = 20,
punch_end = 30,
},
})
mobs:register_spawn("loud_walking:orc", {'group:stone', "default:snow","default:snow_block", "default:desert_sand"}, 20, -1, 11000, 2, 31000)
mobs:register_egg("loud_walking:orc", "Orc", "default_desert_sand.png", 1)
mobs:register_mob("loud_walking:ogre", {
type = "monster",
passive = false,
reach = 3,
damage = 3,
attack_type = "dogfight",
hp_min = 15,
hp_max = 26,
armor = 70,
collisionbox = {-0.6, -1.3, -0.6, 0.6, 1.5, 0.6},
visual = "mesh",
mesh = "ogre.b3d",
textures = {
{"dmobs_ogre.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=3.5, y=3.5},
makes_footstep_sound = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 9},
},
walk_velocity = 1,
run_velocity = 2,
jump = true,
rotate = 180,
water_damage = 0,
lava_damage = 2,
light_damage = 0,
view_range = 14,
animation = {
speed_normal = 10,
speed_run = 20,
walk_start = 3,
walk_end = 38,
stand_start = 40,
stand_end = 70,
run_start = 3,
run_end = 38,
punch_start = 70,
punch_end = 100,
},
})
mobs:register_spawn("loud_walking:ogre", {"default:snow","default:dirt_with_dry_grass", "default:desert_sand"}, 20, 10, 15000, 2, 31000)
mobs:register_egg("loud_walking:ogre", "Ogre", "default_desert_sand.png", 1)
mobs:register_mob("loud_walking:badger", {
type = "animal",
passive = false,
reach = 1,
damage = 2,
attack_type = "dogfight",
hp_min = 6,
hp_max = 12,
armor = 100,
collisionbox = {-0.3, -0.15, -0.3, 0.3, 0.4, 0.3},
visual = "mesh",
mesh = "badger.b3d",
textures = {
{"dmobs_badger.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=2, y=2},
makes_footstep_sound = true,
walk_velocity = 0.7,
run_velocity = 1,
jump = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
},
water_damage = 0,
lava_damage = 2,
light_damage = 0,
follow = {"mobs:meat_raw"},
view_range = 14,
animation = {
speed_normal = 12,
speed_run = 18,
walk_start = 34,
walk_end = 58,
stand_start = 1,
stand_end = 30,
run_start = 34,
run_end = 58,
punch_start = 60,
punch_end = 80,
},
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
mobs:register_spawn("loud_walking:badger", {"default:dirt_with_grass","default:dirt"}, 20, 10, 15000, 2, 31000)
mobs:register_egg("loud_walking:badger", "Badger", "default_obsidian.png", 1)
--dragon
mobs:register_mob("loud_walking:dragon", {
type = "monster",
passive = false,
attacks_monsters = true,
damage = 6,
reach = 3,
attack_type = "dogshoot",
shoot_interval = 2.5,
dogshoot_switch = 2,
dogshoot_count = 0,
dogshoot_count_max =5,
arrow = "loud_walking:fireball",
shoot_offset = 1,
hp_min = 30,
hp_max = 40,
armor = 50,
collisionbox = {-0.6, -1.2, -0.6, 0.6, 0.6, 0.6},
visual = "mesh",
mesh = "dragon.b3d",
textures = {
{"dmobs_dragon.png"},
{"dmobs_dragon2.png"},
{"dmobs_dragon3.png"},
{"dmobs_dragon4.png"},
},
blood_texture = "mobs_blood.png",
visual_size = {x=2, y=2},
makes_footstep_sound = true,
runaway = false,
jump_chance = 30,
walk_chance = 80,
fall_speed = 0,
pathfinding = true,
fall_damage = 0,
sounds = {
shoot_attack = "mobs_fireball",
},
walk_velocity = 3,
run_velocity = 5,
jump = true,
fly = true,
drops = {
{name = "mobs:lava_orb", chance = 1, min = 1, max = 1},
{name = "mobs:meat_raw", chance = 1, min = 1, max = 9},
},
fall_speed = 0,
stepheight = 10,
water_damage = 2,
lava_damage = 0,
light_damage = 0,
view_range = 20,
animation = {
speed_normal = 10,
speed_run = 20,
walk_start = 1,
walk_end = 22,
stand_start = 1,
stand_end = 22,
run_start = 1,
run_end = 22,
punch_start = 22,
punch_end = 47,
},
knock_back = 2,
})
--Thanks to Tenplus1
mobs:register_arrow("loud_walking:fireball", {
visual = "sprite",
visual_size = {x = 0.5, y = 0.5},
textures = {"dmobs_fire.png"},
velocity = 8,
tail = 1, -- enable tail
tail_texture = "fire_basic_flame.png",
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end,
hit_node = function(self, pos, node)
mobs:explosion(pos, 2, 1, 1)
end,
})
mobs:spawn_specific("loud_walking:dragon", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000)
mobs:register_egg("loud_walking:dragon", "Dragon", "default_apple.png", 1)
if minetest.registered_entities["mobs_yeti:yeti"] then
local m = table.copy(minetest.registered_entities["loud_walking:dragon"])
m.name = 'loud_walking:snow_dragon'
m.lava_damage = 4
m.textures = { {"squaresville_snow_dragon.png"}, }
m.base_texture = m.textures[1]
m.arrow = "loud_walking:snow_blast"
m.attack_type = 'dogshoot'
m.shoot_interval = .7
m.shoot_offset = 2
m.drops = {
{name = "default:ice", chance = 1, min = 1, max = 3},
{name = "mobs:meat_raw", chance = 1, min = 1, max = 9},
}
minetest.registered_entities["loud_walking:snow_dragon"] = m
mobs.spawning_mobs["loud_walking:snow_dragon"] = true
local m = table.copy(minetest.registered_entities["mobs_yeti:snowball"])
m.hit_player = function(self, player)
if not (self and player) then
return
end
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end
m.hit_mob = function(self, player)
if not (self and player) then
return
end
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 8},
}, nil)
end
minetest.registered_entities["loud_walking:snow_blast"] = m
mobs:spawn_specific("loud_walking:snow_dragon", {"air"}, {'default:snow', 'default:ice', 'default:snow_block'}, -1, 20, 300, 15000, 2, -100, 31000)
end

699
goblin.lua Normal file
View File

@ -0,0 +1,699 @@
---------------------------------------------------------------
-- GOBLINS
---------------------------------------------------------------
local spawn_frequency = 3000 -- 350
local dig_freq = 5 -- 5
local trap_freq = 25 -- 25
local torch_freq = 2 -- 2
local diggable = {
'default:dirt',
'default:dirt_with_grass',
'default:dirt_with_dry_grass',
'default:dirt_with_snow',
'default:sand',
'default:stone',
'default:sandstone',
'default:desert_stone',
'default:stone_with_coal',
'default:stone_with_copper',
'default:stone_with_diamond',
'default:stone_with_gold',
'default:stone_with_iron',
'default:stone_with_mese',
'loud_walking:stone_with_coal_trap',
'loud_walking:stone_with_copper_trap',
'loud_walking:stone_with_diamond_trap',
'loud_walking:stone_with_gold_trap',
'loud_walking:stone_with_iron_trap',
'loud_walking:stone_with_salt',
'loud_walking:stone_with_algae',
'loud_walking:stone_with_lichen',
'loud_walking:stone_with_moss',
'loud_walking:giant_mushroom_cap',
'loud_walking:huge_mushroom_cap',
'loud_walking:giant_mushroom_stem',
'loud_walking:stalactite',
'loud_walking:stalagmite',
'loud_walking:stalactite_slimy',
'loud_walking:stalagmite_slimy',
'loud_walking:stalactite_mossy',
'loud_walking:stalagmite_mossy',
'flowers:mushroom_red',
'flowers:mushroom_brown'
}
local traps = {
'loud_walking:mossycobble_trap',
'loud_walking:stone_with_coal_trap',
'loud_walking:stone_with_copper_trap',
'loud_walking:stone_with_diamond_trap',
'loud_walking:stone_with_gold_trap',
'loud_walking:stone_with_iron_trap',
}
local function goblin_do(self)
if not (self and loud_walking.custom_ready and loud_walking.search_replace and loud_walking.surface_damage and loud_walking.custom_ready(self)) then
return
end
local cold_natured = false
local pos = self.object:getpos()
pos.y = pos.y + 0.5
-- dig
if self.name == 'loud_walking:goblin_digger' then
loud_walking.search_replace(pos, 1, diggable, 'air')
else
loud_walking.search_replace(pos, dig_freq, diggable, 'air')
end
--loud_walking.search_replace(pos, dig_freq * 3, burnable, 'fire:basic_flame')
-- steal torches
loud_walking.search_replace(self.object:getpos(), torch_freq, {"default:torch"}, "air")
pos.y = pos.y - 0.5
-- place a mossycobble
local cobbling = trap_freq
if self.name == 'loud_walking:goblin_cobbler' then
cobbling = torch_freq
end
loud_walking.search_replace(pos, cobbling, {"group:stone", "default:sandstone"}, "default:mossycobble")
-- place a trap
local trap = 'loud_walking:mossycobble_trap'
if self.name == 'loud_walking:goblin_ice' then
cold_natured = true
trap = 'loud_walking:ice_trap'
loud_walking.search_replace(pos, trap_freq, {"default:ice"}, trap)
else
if self.name == 'loud_walking:goblin_coal' then
trap = 'loud_walking:stone_with_coal_trap'
elseif self.name == 'loud_walking:goblin_copper' then
trap = 'loud_walking:stone_with_copper_trap'
elseif self.name == 'loud_walking:goblin_diamond' then
trap = 'loud_walking:stone_with_diamond_trap'
elseif self.name == 'loud_walking:goblin_gold' then
trap = 'loud_walking:stone_with_gold_trap'
elseif self.name == 'loud_walking:goblin_iron' then
trap = 'loud_walking:stone_with_iron_trap'
elseif self.name == 'loud_walking:goblin_king' then
trap = traps[math.random(#traps)]
end
loud_walking.search_replace(pos, trap_freq, {"group:stone", "default:sandstone"}, trap)
end
loud_walking.surface_damage(self, cold_natured)
end
local drops = {
digger = {
{name = "default:mossycobble", chance = 1, min = 1, max = 3},
},
--cobbler = {
-- {name = "loud_walking:glowing_fungus", chance = 1, min = 2, max = 5},
--},
coal = {
{name = "default:coal_lump", chance = 1, min = 1, max = 3},
},
copper = {
{name = "default:copper_lump", chance = 1, min = 1, max = 3},
},
diamond = {
{name = "default:diamond", chance = 5, min = 1, max = 3},
},
gold = {
{name = "default:gold_lump", chance = 1, min = 1, max = 3},
},
ice = {
{name = "default:coal_lump", chance = 1, min = 1, max = 3},
},
iron = {
{name = "default:iron_lump", chance = 1, min = 1, max = 3},
},
king = {
{name = "default:mese_crystal", chance = 1, min = 1, max = 3},
},
}
for name, drop in pairs(drops) do
if name == 'digger' or name == 'cobbler' or name == 'coal' or name == 'ice' then
drop[#drop+1] = {name = "default:pick_stone", chance = 3, min = 1, max = 3}
drop[#drop+1] = {name = "default:sword_stone", chance = 5, min = 1, max = 1}
elseif name == 'copper' or name == 'iron' then
drop[#drop+1] = {name = "default:pick_steel", chance = 3, min = 1, max = 3}
drop[#drop+1] = {name = "default:sword_steel", chance = 5, min = 1, max = 1}
elseif name == 'diamond' or name == 'gold' then
drop[#drop+1] = {name = "default:pick_diamond", chance = 3, min = 1, max = 3}
drop[#drop+1] = {name = "default:sword_diamond", chance = 5, min = 1, max = 1}
elseif name == 'king' then
drop[#drop+1] = {name = "default:pick_mese", chance = 3, min = 1, max = 3}
drop[#drop+1] = {name = "default:sword_mese", chance = 5, min = 1, max = 1}
end
drop[#drop+1] = {name = "loud_walking:rotten_flesh", chance = 2, min = 1, max = 2}
drop[#drop+1] = {name = "default:torch", chance = 3, min = 1, max = 10}
end
mobs:register_mob("loud_walking:goblin_digger", {
description = "Digger Goblin",
type = "monster",
passive = false,
damage = 1,
attack_type = "dogfight",
attacks_monsters = true,
hp_min = 5,
hp_max = 10,
armor = 100,
fear_height = 4,
collisionbox = {-0.35,-1,-0.35, 0.35,-.1,0.35},
visual = "mesh",
mesh = "goblins_goblin.b3d",
drawtype = "front",
textures = {
{"goblins_goblin_digger.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['digger'],
water_damage = 0,
lava_damage = 2,
light_damage = 0,
lifetimer = 60,
follow = {"default:diamond"},
view_range = 10,
owner = "",
order = "follow",
animation = {
speed_normal = 30,
speed_run = 30,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219,
},
on_rightclick = nil,
do_custom = goblin_do,
})
mobs:register_egg("loud_walking:goblin_digger", "Goblin Egg (digger)", "default_mossycobble.png", 1)
--mobs:register_spawn("loud_walking:goblin_digger", {"default:mossycobble"}, 100, 0, 3 * spawn_frequency, 3, 2000)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_cobbler'
m.textures = { {"goblins_goblin_cobble1.png"}, {"goblins_goblin_cobble2.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['cobbler']
minetest.registered_entities["loud_walking:goblin_cobbler"] = m
--mobs.spawning_mobs["loud_walking:goblin_cobbler"] = true
--mobs:register_spawn("loud_walking:goblin_cobbler", {"default:mossycobble"}, 100, 0, 3 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_cobbler", "Goblin Egg (cobbler)", "default_mossycobble.png", 1)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_coal'
m.hp_min = 7
m.hp_max = 15
m.armor = 90
m.textures = { {"goblins_goblin_coal1.png"}, {"goblins_goblin_coal2.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['coal']
minetest.registered_entities["loud_walking:goblin_coal"] = m
--mobs.spawning_mobs["loud_walking:goblin_coal"] = true
--mobs:register_spawn("loud_walking:goblin_coal", {"default:mossycobble"}, 100, 0, 4 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_coal", "Goblin Egg (coal)", "default_mossycobble.png", 1)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_copper'
m.damage = 2
m.hp_min = 7
m.hp_max = 15
m.armor = 70
m.textures = { {"goblins_goblin_copper1.png"}, {"goblins_goblin_copper2.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['copper']
minetest.registered_entities["loud_walking:goblin_copper"] = m
--mobs.spawning_mobs["loud_walking:goblin_copper"] = true
--mobs:register_spawn("loud_walking:goblin_copper", {"default:mossycobble"}, 100, 0, 6 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_copper", "Goblin Egg (copper)", "default_mossycobble.png", 1)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_diamond'
m.damage = 3
m.hp_min = 7
m.hp_max = 15
m.armor = 50
m.textures = { {"goblins_goblin_diamond1.png"}, {"goblins_goblin_diamond2.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['diamond']
minetest.registered_entities["loud_walking:goblin_diamond"] = m
--mobs.spawning_mobs["loud_walking:goblin_diamond"] = true
--mobs:register_spawn("loud_walking:goblin_diamond", {"default:mossycobble"}, 100, 0, 8 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_diamond", "Goblin Egg (diamond)", "default_mossycobble.png", 1)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_gold'
m.damage = 3
m.hp_min = 7
m.hp_max = 15
m.armor = 60
m.textures = { {"goblins_goblin_gold1.png"}, {"goblins_goblin_gold2.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['gold']
minetest.registered_entities["loud_walking:goblin_gold"] = m
--mobs.spawning_mobs["loud_walking:goblin_gold"] = true
--mobs:register_spawn("loud_walking:goblin_gold", {"default:mossycobble"}, 100, 0, 7 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_gold", "Goblin Egg (gold)", "default_mossycobble.png", 1)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_ice'
m.textures = { {"squaresville_goblin_ice2.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['ice']
minetest.registered_entities["loud_walking:goblin_ice"] = m
--mobs.spawning_mobs["loud_walking:goblin_ice"] = true
--mobs:register_spawn("loud_walking:goblin_ice", {"default:ice"}, 100, 0, 20 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_ice", "Goblin Egg (ice)", "default_mossycobble.png", 1)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_iron'
m.damage = 2
m.hp_min = 7
m.hp_max = 15
m.armor = 80
m.textures = { {"goblins_goblin_iron1.png"}, {"goblins_goblin_iron2.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['iron']
minetest.registered_entities["loud_walking:goblin_iron"] = m
--mobs.spawning_mobs["loud_walking:goblin_iron"] = true
--mobs:register_spawn("loud_walking:goblin_iron", {"default:mossycobble"}, 100, 0, 5 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_iron", "Goblin Egg (iron)", "default_mossycobble.png", 1)
local m = table.copy(minetest.registered_entities["loud_walking:goblin_digger"])
m.name = 'loud_walking:goblin_king'
m.damage = 3
m.hp_min = 10
m.hp_max = 20
m.armor = 40
m.textures = { {"goblins_goblin_king.png"}, }
m.base_texture = m.textures[1]
m.drops = drops['king']
minetest.registered_entities["loud_walking:goblin_king"] = m
--mobs.spawning_mobs["loud_walking:goblin_king"] = true
--mobs:register_spawn("loud_walking:goblin_king", {"default:mossycobble"}, 100, 0, 9 * spawn_frequency, 3, 2000)
mobs:register_egg("loud_walking:goblin_king", "Goblin Egg (king)", "default_mossycobble.png", 1)
---------------------------------------------------------------
-- Traps
---------------------------------------------------------------
minetest.register_node("loud_walking:mossycobble_trap", {
description = "Messy Gobblestone",
tiles = {"default_mossycobble.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1, trap = 1},
sounds = default.node_sound_stone_defaults(),
paramtype = "light",
light_source = 4,
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "loud_walking:mossycobble_trap",
})
minetest.register_node("loud_walking:stone_with_coal_trap", {
description = "Coal Trap",
tiles = {"default_cobble.png^default_mineral_coal.png"},
groups = {cracky = 3, trap = 1},
drop = 'default:coal_lump',
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
})
if minetest.registered_nodes['tnt:tnt_burning'] then
-- 5... 4... 3... 2... 1...
loud_walking.diamond_trap = function(pos, player)
if not (pos and player) then
return
end
minetest.set_node(pos, {name="tnt:tnt_burning"})
local timer = minetest.get_node_timer(pos)
if timer then
timer:start(5)
end
minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
end
else
-- wimpier trap for non-tnt settings
loud_walking.diamond_trap = function(pos, player)
if not (pos and player) then
return
end
minetest.set_node(pos, {name="default:lava_source"})
local hp = player:get_hp()
if hp > 0 then
player:set_hp(hp - 2)
minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
end
end
end
minetest.register_node("loud_walking:stone_with_diamond_trap", {
description = "Diamond Trap",
tiles = {"default_cobble.png^(default_mineral_diamond.png^[colorize:#000000:160)"},
groups = {cracky = 3, trap = 1},
drop = 'default:diamond',
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_dig = function(pos, node, digger)
if not (pos and digger) then
return
end
if math.random(3) == 1 then
loud_walking.diamond_trap(pos, digger)
else
minetest.node_dig(pos, node, digger)
end
end
})
newnode = loud_walking.clone_node("default:lava_source")
newnode.description = "Molten Gold Source"
newnode.wield_image = "goblins_molten_gold.png"
newnode.tiles[1].name = "goblins_molten_gold_source_animated.png"
newnode.special_tiles[1].name = "goblins_molten_gold_source_animated.png"
newnode.liquid_alternative_flowing = "loud_walking:molten_gold_flowing"
newnode.liquid_alternative_source = "loud_walking:molten_gold_source"
newnode.liquid_renewable = false
newnode.post_effect_color = {a=192, r=255, g=64, b=0}
minetest.register_node("loud_walking:molten_gold_source", newnode)
newnode = loud_walking.clone_node("default:lava_flowing")
newnode.description = "Flowing Molten Gold"
newnode.wield_image = "goblins_molten_gold.png"
newnode.tiles = {"goblins_molten_gold.png"}
newnode.special_tiles[1].name = "goblins_molten_gold_flowing_animated.png"
newnode.liquid_alternative_flowing = "loud_walking:molten_gold_flowing"
newnode.liquid_alternative_source = "loud_walking:molten_gold_source"
newnode.liquid_renewable = false
newnode.post_effect_color = {a=192, r=255, g=64, b=0}
minetest.register_node("loud_walking:molten_gold_flowing", newnode)
bucket.register_liquid(
"loud_walking:molten_gold_source",
"loud_walking:molten_gold_flowing",
"loud_walking:bucket_molten_gold",
"squaresville_bucket_molten_gold.png",
"Bucket of Molten Gold",
{}
)
loud_walking.gold_trap = function(pos, player)
if not (pos and player) then
return
end
minetest.set_node(pos, {name="loud_walking:molten_gold_source"})
minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
local hp = player:get_hp()
if hp > 0 then
player:set_hp(hp - 2)
end
end
minetest.register_node("loud_walking:stone_with_gold_trap", {
description = "Gold Trap",
tiles = {"default_cobble.png^(default_mineral_gold.png^[colorize:#000000:160)"},
groups = {cracky = 3, trap = 1},
drop = 'default:gold_lump',
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_dig = function(pos, node, digger)
if not (pos and digger) then
return
end
if math.random(3) == 1 then
loud_walking.gold_trap(pos, digger)
else
minetest.node_dig(pos, node, digger)
end
end
})
loud_walking.ice_trap = function(pos, player)
if not (pos and player) then
return
end
local ppos = player:getpos()
if ppos then
ppos.y = ppos.y + 1
local p1 = vector.subtract(ppos, 2)
local p2 = vector.add(ppos, 2)
local nodes = minetest.find_nodes_in_area(p1, p2, 'air')
if not (nodes and type(nodes) == 'table') then
return
end
for _, npos in pairs(nodes) do
minetest.set_node(npos, {name="default:ice"})
end
minetest.set_node(pos, {name="default:ice"})
end
end
minetest.register_node("loud_walking:ice_trap", {
description = "Ice Trap",
tiles = {"default_ice.png^squaresville_mineral_moonstone.png"},
groups = {cracky = 3, trap = 1},
drop = 'default:ice',
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_dig = function(pos, node, digger)
if not (pos and digger) then
return
end
if math.random(3) == 1 then
loud_walking.ice_trap(pos, digger)
else
minetest.node_dig(pos, node, digger)
end
end
})
local function lightning_effects(pos, radius)
if not (pos and radius) then
return
end
minetest.add_particlespawner({
amount = 30,
time = 1,
minpos = vector.subtract(pos, radius / 2),
maxpos = vector.add(pos, radius / 2),
minvel = {x=-10, y=-10, z=-10},
maxvel = {x=10, y=10, z=10},
minacc = vector.new(),
maxacc = vector.new(),
minexptime = 1,
maxexptime = 3,
minsize = 16,
maxsize = 32,
texture = "goblins_lightning.png",
})
end
loud_walking.copper_trap = function(pos, player)
if not (pos and player) then
return
end
local hp = player:get_hp()
if hp > 0 then
player:set_hp(hp - 1)
lightning_effects(pos, 3)
minetest.sound_play("default_dig_crumbly", {pos = pos, gain = 0.5, max_hear_distance = 10})
end
end
minetest.register_node("loud_walking:stone_with_copper_trap", {
description = "Copper Trap",
tiles = {"default_cobble.png^(default_mineral_copper.png^[colorize:#000000:160)"},
groups = {cracky = 3, trap = 1},
drop = 'default:copper_lump',
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_dig = function(pos, node, digger)
if not (pos and digger) then
return
end
if math.random(3) == 1 then
loud_walking.copper_trap(pos, digger)
else
minetest.node_dig(pos, node, digger)
end
end
})
-- summon a metallic goblin?
-- pit of iron razors?
minetest.register_node("loud_walking:stone_with_iron_trap", {
description = "Iron Trap",
tiles = {"default_cobble.png^(default_mineral_iron.png^[colorize:#000000:160)"},
groups = {cracky = 3, trap = 1},
drop = 'default:iron_lump',
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
on_dig = function(pos, node, digger)
if not (pos and digger) then
return
end
if math.random(3) == 1 then
loud_walking.copper_trap(pos, digger)
else
minetest.node_dig(pos, node, digger)
end
end
})
-- goblin spawner
minetest.register_node("loud_walking:goblin_spawner", {
--tiles = {"default_obsidian.png^[colorize:#00FF00:10"},
tiles = {"default_obsidian.png"},
paramtype = "light",
description = "Goblin Throne",
groups = {cracky = 2, falling_node = 1},
light_source = 4,
drop = 'default:mossycobble',
drawtype = "nodebox",
node_box = { type = "fixed",
fixed = {
{-0.25, -0.5, -0.4, 0.25, 0.0, 0.4}, -- seat
{-0.25, 0.0, -0.25, -0.2, 0.5, 0.25}, -- back
{-0.25, 0.5, -0.4, -0.2, 1.0, 0.4}, -- back
} },
})
local goblins = {}
goblins['loud_walking:goblin_king'] = 1
goblins['loud_walking:goblin_diamond'] = 2
goblins['loud_walking:goblin_gold'] = 2
goblins['loud_walking:goblin_copper'] = 4
goblins['loud_walking:goblin_iron'] = 4
goblins['loud_walking:goblin_coal'] = 8
goblins['loud_walking:goblin_digger'] = 8
goblins['loud_walking:goblin_cobbler'] = 8
local goblins_total = 0
for name, rate in pairs(goblins) do
goblins_total = goblins_total + rate
end
-- spawner abm
minetest.register_abm({
nodenames = {"loud_walking:goblin_spawner"},
interval = 4,
chance = 6,
catch_up = false,
action = function(pos, node, active_object_count, active_object_count_wider)
-- check objects inside 9x9 area around spawner
local objs = minetest.get_objects_inside_radius(pos, 9)
local count = 0
-- count mob objects of same type in area
for k, obj in pairs(objs) do
local ent = obj:get_luaentity()
if ent and string.find(ent.name, 'goblin') then
count = count + 1
end
end
-- Are there too many of same type?
if count >= 12 then
return
end
-- find air blocks within 5 nodes of spawner
local air = minetest.find_nodes_in_area(
{x = pos.x - 5, y = pos.y, z = pos.z - 5},
{x = pos.x + 5, y = pos.y, z = pos.z + 5},
{"air"})
-- spawn in random air block
if air and #air > 0 then
local choose
local r = math.random(goblins_total)
for name, rate in pairs(goblins) do
if r <= rate then
choose = name
break
else
r = r - rate
end
end
local pos2 = air[math.random(#air)]
--local lig = minetest.get_node_light(pos2) or 0
pos2.y = pos2.y + 0.5
-- only if light levels are within range
--if lig >= mlig and lig <= xlig then
minetest.add_entity(pos2, choose)
--end
end
end
})

156
greenslimes.lua Normal file
View File

@ -0,0 +1,156 @@
-- **CODE**
-- --------
-- See Mobs.Redo license
--
--
-- **MODELS/TEXTURES**
-- -------------------
-- WTFPL
-- Author/origin: Tomas J. Luis
--
-- Jeija_glue texture by: Jeija
--
-- **SOUNDS**
-- ----------
-- Original sound for slime damage by RandomationPictures under licence CC0 1.0.
-- http://www.freesound.org/people/RandomationPictures/sounds/138481/
--
-- Original sounds for slime jump, land and death by Dr. Minky under licence CC BY 3.0.
-- http://www.freesound.org/people/DrMinky/sounds/
local ENABLE_SPAWN_NODE = true
-- sounds
local green_sounds = {
damage = "slimes_damage",
death = "slimes_death",
jump = "slimes_jump",
attack = "slimes_attack"
}
-- textures
local green_textures = {"green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png",
"green_slime_sides.png", "green_slime_front.png", "green_slime_sides.png"}
-- small
mobs:register_mob("loud_walking:green_small", {
type = "monster",
visual = "cube",
textures = { green_textures },
visual_size = {x = 0.5, y = 0.5},
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
sounds = green_sounds,
hp_min = 2,
hp_max = 4,
armor = 100,
knock_back = 3,
blood_amount = 3,
blood_texture = "green_slime_blood.png",
lava_damage = 3,
fall_damage = 0,
damage = 1,
reach = 1,
attack_type = "dogfight",
attacks_monsters = true,
view_range = 10,
walk_chance = 0,
walk_velocity = 2,
stepheight = 0.6,
jump_chance = 60,
drops = {
{name = "loud_walking:green_slimeball", chance = 2, min = 1, max = 2},
}
})
-- medium
mobs:register_mob("loud_walking:green_medium", {
type = "monster",
visual = "cube",
textures = { green_textures },
visual_size = {x = 1, y = 1},
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
sounds = green_sounds,
hp_min = 4,
hp_max = 8,
armor = 100,
knock_back = 2,
blood_amount = 4,
blood_texture = "green_slime_blood.png",
lava_damage = 7,
fall_damage = 0,
damage = 2,
reach = 2,
attack_type = "dogfight",
attacks_monsters = true,
view_range = 10,
walk_chance = 0,
walk_velocity = 2,
stepheight = 1.1,
jump_chance = 60,
on_die = function(self, pos)
local num = math.random(2, 4)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "loud_walking:green_small")
end
end
})
-- big
mobs:register_mob("loud_walking:green_big", {
type = "monster",
visual = "cube",
textures = { green_textures },
visual_size = {x = 2, y = 2},
collisionbox = {-1, -1, -1, 1, 1, 1},
sounds = green_sounds,
hp_min = 6,
hp_max = 12,
armor = 100,
knock_back = 1,
blood_amount = 5,
blood_texture = "green_slime_blood.png",
lava_damage = 11,
fall_damage = 0,
damage = 3,
reach = 3,
attack_type = "dogfight",
attacks_monsters = true,
view_range = 10,
walk_chance = 0,
walk_velocity = 2,
stepheight = 1.1,
jump_chance = 60,
on_die = function(self, pos)
local num = math.random(1, 2)
for i=1,num do
minetest.add_entity({x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}, "loud_walking:green_medium")
end
end
})
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific("loud_walking:green_big",
{"default:dirt_with_grass", "default:junglegrass", "default:mossycobble"},
{"air"},
-1, 20, 30, 30000, 1, -31000, 31000
)
mobs:spawn_specific("loud_walking:green_medium",
{"default:dirt_with_grass", "default:junglegrass", "default:mossycobble"},
{"air"},
-1, 20, 30, 30000, 2, -31000, 31000
)
mobs:spawn_specific("loud_walking:green_small",
{"default:dirt_with_grass", "default:junglegrass", "default:mossycobble"},
{"air"},
-1, 20, 30, 30000, 3, -31000, 31000
)
mobs:register_egg("loud_walking:green_small", "Small Green Slime", "green_slime_front.png", 0)
mobs:register_egg("loud_walking:green_medium", "Medium Green Slime", "green_slime_front.png", 0)
mobs:register_egg("loud_walking:green_big", "Big Green Slime", "green_slime_front.png", 0)
-- crafts
minetest.register_craftitem("loud_walking:green_slimeball", {
image = "jeija_glue.png",
description="Green Slime Ball",
})

View File

@ -62,6 +62,13 @@ if loud_walking.quick_leaf_decay == nil then
loud_walking.quick_leaf_decay = false
end
loud_walking.goblin_rarity = minetest.setting_get('loud_walking_goblin_rarity')
if loud_walking.goblin_rarity == nil then
loud_walking.goblin_rarity = 9
end
loud_walking.goblin_rarity = 11 - loud_walking.goblin_rarity
print(loud_walking.goblin_rarity)
loud_walking.DEBUG = false -- for maintenance only
@ -184,17 +191,17 @@ dofile(loud_walking.path .. "/deco_caves.lua")
--dofile(loud_walking.path .. "/schematics.lua")
--dofile(loud_walking.path .. "/wallhammer.lua")
dofile(loud_walking.path .. "/mapgen.lua")
--dofile(loud_walking.path .. "/wooden_buckets.lua")
dofile(loud_walking.path .. "/wooden_buckets.lua")
--dofile(loud_walking.path .. "/tools.lua")
--dofile(loud_walking.path .. "/molotov.lua")
--dofile(loud_walking.path .. "/elixir.lua")
--dofile(loud_walking.path .. "/chat.lua")
if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then
--dofile(loud_walking.path .. "/mobs.lua")
dofile(loud_walking.path .. "/mobs.lua")
end
--dofile(loud_walking.path .. "/abms.lua")
dofile(loud_walking.path .. "/abms.lua")
--loud_walking.print_recipes()
@ -434,7 +441,7 @@ local breakable = {}
breakable['loud_walking:wood_rotten'] = true
breakable['loud_walking:glowing_fungal_wood'] = true
if not loud_walking.breakable_wood then
print('* Fun Caves: Wood is NOT breakable by hand.')
print('* Loud Walking: Wood is NOT breakable by hand.')
for _, item in pairs(minetest.registered_items) do
if (item.groups.tree or item.groups.wood) and not breakable[item.name] then
local groups = table.copy(item.groups)

View File

@ -253,7 +253,6 @@ local function get_height(fdx, fdz, y, index, heights, terrain_scale, ocean)
end
if not heights[py] then
print('new height')
heights[py] = minetest.get_perlin_map(terrain_noise, csize):get2dMap_flat({x=minp.x, y=minp.z})
end
@ -292,6 +291,10 @@ local function generate(p_minp, p_maxp, seed)
local heights = {}
cloud = minetest.get_perlin_map(cloud_noise, csize):get2dMap_flat(minp)
cave = minetest.get_perlin_map(cave_noise, csize):get3dMap_flat(minp)
local goblin_spawner
if minetest.registered_nodes['loud_walking:goblin_spawner'] then
goblin_spawner = node['loud_walking:goblin_spawner']
end
local t1 = os.clock()
@ -486,6 +489,8 @@ local function generate(p_minp, p_maxp, seed)
data[ivm] = node["loud_walking:stalagmite"]
elseif not in_cave and node_stone == "default:ice" and math.random(10) == 1 then
data[ivm] = node["loud_walking:icicle_up"]
elseif not in_cave and goblin_spawner and loud_walking.goblin_rarity < 11 and math.random(loud_walking.goblin_rarity * 1000) == 1 then
data[ivm] = goblin_spawner
else
--data[ivm] = node["air"]
end
@ -582,13 +587,13 @@ local function generate(p_minp, p_maxp, seed)
vm:set_data(data)
minetest.generate_ores(vm, minp, maxp)
--vm:set_param2_data(p2data)
vm:set_lighting({day = 0, night = 0}, minp, maxp)
vm:set_lighting({day = 15, night = 15}, minp, maxp)
vm:update_liquids()
vm:calc_lighting(minp, maxp, false)
vm:write_to_map()
local t5 = os.clock()
print(' times: '..(t1 - t0)..', '..(t2 - t1)..', '..(t3 - t2)..', '..(t5 - t4)..' = '..(t5 - t0))
--print(' times: '..(t1 - t0)..', '..(t2 - t1)..', '..(t3 - t2)..', '..(t5 - t4)..' = '..(t5 - t0))
--print(' also: '..ta1..', '..ta2)
end
@ -598,7 +603,7 @@ local function pgenerate(...)
local status, err = true
generate(...)
if not status then
print('Squaresville: Could not generate terrain:')
print('Loud Walking: Could not generate terrain:')
print(dump(err))
collectgarbage("collect")
end

412
mobs.lua Normal file
View File

@ -0,0 +1,412 @@
-- search/replace -- lets mobs change the terrain
-- used for goblin traps and torch thieving
loud_walking.search_replace = function(pos, search_rate, replace_what, replace_with)
if not (pos and search_rate and replace_what and replace_with and type(search_rate) == 'number' and (type(replace_what) == 'string' or type(replace_what) == 'table') and type(replace_with) == 'string') then
return
end
if math.random(search_rate) == 1 then
local p1 = vector.subtract(pos, 1)
local p2 = vector.add(pos, 1)
--look for nodes
local nodelist = minetest.find_nodes_in_area(p1, p2, replace_what)
if not (nodelist and type(nodelist) == 'table') then
return
end
if #nodelist > 0 then
for _, new_pos in pairs(nodelist) do
minetest.set_node(new_pos, {name = replace_with})
return true -- only one at a time
end
end
end
end
-- causes mobs to take damage from hot/cold surfaces
loud_walking.surface_damage = function(self, cold_natured)
if not self then
return
end
local pos = self.object:getpos()
if not pos then
return
end
local minp = vector.subtract(pos, 1.5)
local maxp = vector.add(pos, 1.5)
local counts = 0
if self.lava_damage > 1 then
counts = minetest.find_nodes_in_area(minp, maxp, {"group:surface_hot"})
if not (counts and type(counts) == 'table') then
return
end
if #counts > 0 then
self.health = self.health - math.floor(self.lava_damage / 2)
effect(pos, 5, "fire_basic_flame.png")
end
end
if not cold_natured then
counts = minetest.find_nodes_in_area(minp, maxp, {"group:surface_cold"})
if not (counts and type(counts) == 'table') then
return
end
if #counts > 0 then
self.health = self.health - 1
end
end
check_for_death(self)
end
-- executed in a mob's do_custom() to regulate their actions
-- if false, do nothing
local custom_delay = 2000000
loud_walking.custom_ready = function(self, delay)
if not self then
return
end
local time = minetest.get_us_time()
if not (time and type(time) == 'number') then
return
end
if not delay then
delay = custom_delay
end
if not self.custom_time or time - self.custom_time > delay then
self.custom_time = time
return true
else
return false
end
end
-- Try to standardize creature stats based on (log of) mass.
local mob_stats = {
{name = 'kpgmobs:deer', hp = 20, damage = 2, armor = 100, reach = 2},
{name = 'kpgmobs:horse2', hp = 30, damage = 3, armor = 100, reach = 2},
{name = 'kpgmobs:horse3', hp = 30, damage = 3, armor = 100, reach = 2},
{name = 'kpgmobs:horse', hp = 30, damage = 3, armor = 100, reach = 2},
{name = 'kpgmobs:jeraf', hp = 32, damage = 3, armor = 100, reach = 2},
{name = 'kpgmobs:medved', hp = 26, damage = 3, armor = 100, reach = 2},
{name = 'kpgmobs:wolf', hp = 18, damage = 3, armor = 100, reach = 1},
{name = 'mobs_animal:bee', hp = 1, damage = 1, armor = 200, reach = 1},
{name = 'mobs_animal:bunny', hp = 2, damage = 1, armor = 100, reach = 1},
{name = 'mobs_animal:chicken', hp = 8, damage = 1, armor = 150, reach = 1},
{name = 'mobs_animal:cow', hp = 30, damage = 3, armor = 150, reach = 1},
{name = 'mobs_animal:kitten', hp = 8, damage = 1, armor = 100, reach = 1},
{name = 'mobs_animal:pumba', hp = 20, damage = 2, armor = 100, reach = 1},
{name = 'mobs_animal:rat', hp = 2, damage = 1, armor = 100, reach = 1},
{name = 'mobs_animal:sheep', hp = 18, damage = 1, armor = 150, reach = 1},
{name = 'mobs_bat:bat', hp = 2, damage = 1, armor = 150, reach = 1},
{name = 'mobs_birds:bird_lg', hp = 4, damage = 1, armor = 150, reach = 1},
{name = 'mobs_birds:bird_sm', hp = 2, damage = 1, armor = 150, reach = 1},
{name = 'mobs_birds:gull', hp = 4, damage = 1, armor = 150, reach = 1},
{name = 'mobs_butterfly:butterfly', hp = 1, damage = 0, armor = 200, reach = 1},
{name = 'mobs_creeper:creeper', hp = 14, damage = 2, armor = 150, reach = 1},
{name = 'mobs_crocs:crocodile_float', hp = 26, damage = 3, armor = 75, reach = 2},
{name = 'mobs_crocs:crocodile', hp = 26, damage = 3, armor = 75, reach = 2},
{name = 'mobs_crocs:crocodile_swim', hp = 26, damage = 3, armor = 75, reach = 2},
{name = 'mobs_fish:clownfish', hp = 2, damage = 0, armor = 100, reach = 1},
{name = 'mobs_fish:tropical', hp = 2, damage = 0, armor = 100, reach = 1},
{name = 'mobs_jellyfish:jellyfish', hp = 2, damage = 2, armor = 200, reach = 1},
{name = 'mobs_monster:dirt_monster', hp = 20, damage = 2, armor = 100, reach = 2},
{name = 'mobs_monster:dungeon_master', hp = 30, damage = 5, armor = 50, reach = 2},
{name = 'mobs_monster:lava_flan', hp = 16, damage = 3, armor = 50, reach = 2},
{name = 'mobs_monster:mese_monster', hp = 10, damage = 2, armor = 40, reach = 2},
{name = 'mobs_monster:oerkki', hp = 16, damage = 2, armor = 100, reach = 2},
{name = 'mobs_monster:sand_monster', hp = 20, damage = 2, armor = 200, reach = 2},
{name = 'mobs_monster:spider', hp = 22, damage = 2, armor = 100, reach = 2},
{name = 'mobs_monster:stone_monster', hp = 20, damage = 2, armor = 50, reach = 2},
{name = 'mobs_monster:tree_monster', hp = 18, damage = 2, armor = 75, reach = 2},
{name = 'mobs_sandworm:sandworm', hp = 42, damage = 7, armor = 100, reach = 3},
{name = 'mobs_sharks:shark_lg', hp = 34, damage = 5, armor = 80, reach = 3},
{name = 'mobs_sharks:shark_md', hp = 25, damage = 3, armor = 80, reach = 2},
{name = 'mobs_sharks:shark_sm', hp = 16, damage = 2, armor = 80, reach = 1},
{name = 'mobs_turtles:seaturtle', hp = 18, damage = 2, armor = 75, reach = 1},
{name = 'mobs_turtles:turtle', hp = 10, damage = 1, armor = 50, reach = 1},
{name = 'mobs_yeti:yeti', hp = 22, damage = 2, armor = 100, reach = 2},
}
local colors = { 'black', 'blue', 'brown', 'cyan', 'dark_green', 'dark_grey', 'green', 'grey', 'magenta', 'orange', 'pink', 'red', 'violet', 'white', 'yellow',}
for _, color in pairs(colors) do
mob_stats[#mob_stats+1] = {name = 'mobs_animal:sheep_'..color, hp = 18, damage = 1, armor = 150}
end
for _, mob in pairs(mob_stats) do
if string.find(mob.name, 'mobs_monster') or string.find(mob.name, 'mobs_animal') then
local i, j = string.find(mob.name, ':')
local suff = string.sub(mob.name, i)
mob_stats[#mob_stats+1] = {name = 'mobs'..suff, hp = mob.hp, damage = mob.damage, armor = mob.armor}
end
end
for _, mob in pairs(mob_stats) do
if minetest.registered_entities[mob.name] then
minetest.registered_entities[mob.name].damage = mob.damage
minetest.registered_entities[mob.name].hp_min = math.ceil(mob.hp * 0.5)
minetest.registered_entities[mob.name].hp_max = math.ceil(mob.hp * 1.5)
minetest.registered_entities[mob.name].armor = mob.armor
if mob.reach then
minetest.registered_entities[mob.name].reach = mob.reach
end
if mob.meat then
minetest.registered_entities[mob.name].drops[#minetest.registered_entities[mob.name].drops+1] = {name = "mobs:meat_raw", chance = 1, min = 1, max = mob.damage ^ 2}
end
end
end
if minetest.registered_entities["mobs:bee"] then
mobs:register_spawn("mobs_animal:bee", {"group:flower"}, 20, 10, 300, 1, 31000, true)
end
if minetest.registered_entities["kpgmobs:wolf"] then
local m = table.copy(minetest.registered_entities["kpgmobs:wolf"])
m.name = 'loud_walking:white_wolf'
m.textures = { {"squaresville_white_wolf.png"}, }
m.base_texture = m.textures[1]
minetest.registered_entities["loud_walking:white_wolf"] = m
mobs.spawning_mobs["loud_walking:white_wolf"] = true
mobs:register_spawn("loud_walking:white_wolf", {"default:dirt_with_snow"}, 20, -1, 11000, 3, 31000)
mobs:register_egg("loud_walking:white_wolf", "White Wolf", "wool_white.png", 1)
end
if minetest.registered_entities["kpgmobs:medved"] then
local m = table.copy(minetest.registered_entities["kpgmobs:medved"])
m.name = 'loud_walking:moon_bear'
m.textures = { {"squaresville_moon_bear.png"}, }
m.type = 'monster'
m.base_texture = m.textures[1]
minetest.registered_entities["loud_walking:moon_bear"] = m
mobs.spawning_mobs["loud_walking:moon_bear"] = true
mobs:register_spawn("loud_walking:moon_bear", {"default:dirt_with_snow"}, 20, -1, 11000, 3, 31000, false)
mobs:register_egg("loud_walking:moon_bear", "Moon Bear", "wool_white.png", 1)
end
if minetest.registered_entities["mobs_monster:spider"] then
-- Deep spider
local m = table.copy(minetest.registered_entities["mobs_monster:spider"])
m.name = 'loud_walking:spider'
m.docile_by_day = false
m.drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
{name = "wool:black", chance = 1, min = 1, max = 3},
}
m.water_damage = 0
m.do_custom = function(self)
if not (self and loud_walking.custom_ready(self)) then
return
end
loud_walking.surface_damage(self)
end
minetest.registered_entities["loud_walking:spider"] = m
mobs.spawning_mobs["loud_walking:spider"] = true
mobs:register_spawn("loud_walking:spider", 'group:stone', 5, 0, 2000, 2, 31000)
mobs:register_egg("loud_walking:spider", "Deep Spider", "mobs_cobweb.png", 1)
-- ice spider
m = table.copy(minetest.registered_entities["mobs_monster:spider"])
m.name = 'loud_walking:spider_ice'
m.docile_by_day = false
m.textures = { {"squaresville_spider_ice.png"}, }
m.base_texture = m.textures[1]
m.drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
{name = "wool:white", chance = 1, min = 1, max = 3},
}
m.water_damage = 0
m.do_custom = function(self)
if not (self and loud_walking.custom_ready(self)) then
return
end
loud_walking.surface_damage(self, true)
end
minetest.registered_entities["loud_walking:spider_ice"] = m
mobs.spawning_mobs["loud_walking:spider_ice"] = true
mobs:register_spawn("loud_walking:spider_ice", {"default:ice"}, 14, 0, 1000, 2, 31000)
mobs:register_egg("loud_walking:spider_ice", "Ice Spider", "mobs_cobweb.png", 1)
-- dangling spiders
m = table.copy(minetest.registered_entities["mobs_monster:spider"])
m.name = 'loud_walking:dangler'
m.docile_by_day = false
m.attacks_monsters = true
m.damage = 2
m.hp_min = 9
m.hp_max = 27
m.armor = 100
m.water_damage = 0
m.fall_damage = 0
m.collisionbox = {-0.32, -0.0, -0.25, 0.25, 0.25, 0.25}
m.visual_size = {x = 1.5, y = 1.5}
m.drops = {
{name = "mobs:meat_raw", chance = 2, min = 1, max = 4},
{name = "farming:cotton", chance = 2, min = 1, max = 4},
}
m.do_custom = function(self)
if not (self and loud_walking.custom_ready(self)) then
return
end
loud_walking.climb(self)
loud_walking.search_replace(self.object:getpos(), 30, {"air"}, "mobs:cobweb")
loud_walking.surface_damage(self)
end
minetest.registered_entities["loud_walking:dangler"] = m
mobs.spawning_mobs["loud_walking:dangler"] = true
--mobs:register_spawn("loud_walking:dangler", squaresville_stones, 14, 0, 1000, 3, -51)
mobs:register_egg("loud_walking:dangler", "Dangling Spider", "mobs_cobweb.png", 1)
-- tarantula
m = table.copy(minetest.registered_entities["mobs_monster:spider"])
m.name = 'loud_walking:tarantula'
m.type = "animal"
m.reach = 1
m.damage = 1
m.hp_min = 1
m.hp_max = 2
m.collisionbox = {-0.15, -0.01, -0.15, 0.15, 0.1, 0.15}
m.textures = { {"squaresville_tarantula.png"}, }
m.base_texture = m.textures[1]
m.visual_size = {x = 1, y = 1}
m.sounds = {}
m.run_velocity = 2
m.jump = false
m.drops = { {name = "mobs:meat_raw", chance = 1, min = 1, max = 1}, }
m.do_custom = function(self)
if not self then
return
end
if not self.squaresville_damage_timer then
self.squaresville_damage_timer = 0
end
loud_walking.surface_damage(self)
end
minetest.registered_entities["loud_walking:tarantula"] = m
mobs.spawning_mobs["loud_walking:tarantula"] = true
mobs:register_spawn("loud_walking:tarantula", {"default:desert_sand", "default:dirt_with_dry_grass"}, 99, 0, 4000, 2, 31000)
mobs:register_egg("loud_walking:tarantula", "Tarantula", "mobs_cobweb.png", 1)
end
if minetest.registered_entities["mobs_monster:sand_monster"] then
local m = table.copy(minetest.registered_entities["mobs_monster:sand_monster"])
m.name = 'loud_walking:tar_monster'
m.damage = 2
m.hp_min = 10
m.hp_max = 30
m.armor = 200
m.textures = { {"squaresville_tar_monster.png"}, }
m.base_texture = m.textures[1]
m.drops = { {name = "default:coal_lump", chance = 1, min = 3, max = 5}, }
m.water_damage = 1
m.lava_damage = 2
m.light_damage = 1
minetest.registered_entities["loud_walking:tar_monster"] = m
mobs.spawning_mobs["loud_walking:tar_monster"] = true
--mobs:register_spawn("loud_walking:tar_monster", {"loud_walking:black_sand"}, 20, 0, 4000, 1, 31000)
mobs:register_egg("loud_walking:tar_monster", "Tar Monster", "squaresville_black_sand.png", 1)
m = table.copy(minetest.registered_entities["mobs_monster:sand_monster"])
m.name = 'loud_walking:sand_monster'
m.textures = { {"squaresville_sand_monster.png"}, }
m.base_texture = m.textures[1]
m.drops = { {name = "default:sand", chance = 1, min = 3, max = 5}, }
minetest.registered_entities["loud_walking:sand_monster"] = m
mobs.spawning_mobs["loud_walking:sand_monster"] = true
--mobs:register_spawn("loud_walking:sand_monster", {"default:sand"}, 20, 0, 4000, 3, -50)
mobs:register_egg("loud_walking:sand_monster", "Deep Sand Monster", "default_sand.png", 1)
--mobs:register_spawn("loud_walking:sand_monster", {"loud_walking:pyramid_1"}, 20, 0, 150, 5, 31000)
end
if minetest.registered_entities["mobs_monster:stone_monster"] then
--mobs:register_spawn("mobs_monster:stone_monster", {"loud_walking:pyramid_1"}, 20, 0, 300, 5, 31000)
--local stones = table.copy(squaresville_stones)
--stones[#stones+1] = 'loud_walking:hot_cobble'
--stones[#stones+1] = 'loud_walking:salt'
--mobs:register_spawn("mobs_monster:stone_monster", stones, 7, 0, 7000, 1, 0)
m = table.copy(minetest.registered_entities["mobs_monster:stone_monster"])
m.name = 'loud_walking:radiated_stone_monster'
m.damage = 4
m.hp_min = 20
m.hp_max = 45
m.armor = 70
m.textures = { {"squaresville_radiated_stone_monster.png"}, }
m.base_texture = m.textures[1]
m.drops = { {name = "loud_walking:radioactive_ore", chance = 1, min = 3, max = 5}, }
minetest.registered_entities["loud_walking:radiated_stone_monster"] = m
mobs.spawning_mobs["loud_walking:radiated_stone_monster"] = true
--mobs:register_spawn("loud_walking:radiated_stone_monster", {"loud_walking:salt"}, 20, 0, 7000, 3, -50)
mobs:register_egg("loud_walking:radiated_stone_monster", "Radiated Stone Monster", "squaresville_radioactive_ore.png", 1)
end
if minetest.registered_entities["mobs_monster:dungeon_master"] then
mobs:register_spawn("mobs_monster:dungeon_master", 'group:stone', 7, 0, 7000, 1, 31000)
end
if minetest.registered_entities["mobs_monster:oerkki"] then
mobs:register_spawn("mobs_monster:oerkki", 'group:stone', 7, 0, 7000, 1, 31000)
end
if minetest.registered_entities["mobs_monster:mese_monster"] then
mobs:register_spawn("mobs_monster:mese_monster", 'group:stone', 7, 0, 5000, 1, 31000)
end
if minetest.registered_entities["mobs_bat:bat"] then
mobs:spawn_specific("mobs_bat:bat", {"air"}, 'group:stone', 0, 6, 30, 20000, 2, -31000, 31000)
end
if minetest.registered_entities["mobs_monster:dirt_monster"] then
-- check this
mobs:register_spawn("mobs_monster:dirt_monster", {"default:dirt_with_dry_grass"}, 7, 0, 7000, 1, 31000, false)
end
if loud_walking.path then
dofile(loud_walking.path.."/greenslimes.lua")
dofile(loud_walking.path.."/zombie.lua")
dofile(loud_walking.path.."/dmobs.lua")
dofile(loud_walking.path.."/goblin.lua")
end

BIN
models/badger.b3d Normal file

Binary file not shown.

5524
models/creatures_mob.x Normal file

File diff suppressed because it is too large Load Diff

BIN
models/dragon.b3d Normal file

Binary file not shown.

BIN
models/egg.b3d Normal file

Binary file not shown.

BIN
models/elephant.b3d Normal file

Binary file not shown.

BIN
models/fox.b3d Normal file

Binary file not shown.

BIN
models/goblins_goblin.b3d Normal file

Binary file not shown.

BIN
models/hedgehog.b3d Normal file

Binary file not shown.

13
models/model_licenses.txt Normal file
View File

@ -0,0 +1,13 @@
The car model was created by Melkor, and distributed under the CC-BY-NC-SA license:
http://creativecommons.org/licenses/by-nc-sa/3.0/
The cars_car.obj model was taken from cheapie's non-laggy cars mod (https://github.com/cheapie/cars/blob/master/README), and is also CC-BY-NC-SA.
All of the goblin code and art are taken from FreeLikeGNU's Goblins mod,
distributed under the CC-by-SA license.
https://forum.minetest.net/viewtopic.php?f=9&t=13004&hilit=goblins
http://creativecommons.org/licenses/by-sa/3.0/
Many of the creatures were created by D00Med <heiselong@gmx.com> and are distributed under CC BY-SA 3.0.

BIN
models/ogre.b3d Normal file

Binary file not shown.

BIN
models/orc.b3d Normal file

Binary file not shown.

BIN
models/water_dragon.b3d Normal file

Binary file not shown.

BIN
models/whale.b3d Normal file

Binary file not shown.

BIN
models/wyvern.b3d Normal file

Binary file not shown.

View File

@ -41,14 +41,14 @@ node.tiles = {"loud_walking_glass_detail.png"}
minetest.register_node("loud_walking:transparent_scrith", node)
node = loud_walking.clone_node("air")
node.light_source = 15
node.light_source = minetest.LIGHT_MAX
minetest.register_node("loud_walking:light_air", node)
minetest.register_node("loud_walking:control_floor", {
description = "Floor",
paramtype = "light",
tiles = {"loud_walking_control_floor.png"},
light_source = 16,
light_source = minetest.LIGHT_MAX,
use_texture_alpha = true,
is_ground_content = false,
groups = {},
@ -70,7 +70,7 @@ minetest.register_node("loud_walking:control_wall", {
paramtype = "light",
tiles = {"loud_walking_control_wall.png"},
use_texture_alpha = true,
light_source = 16,
light_source = minetest.LIGHT_MAX,
is_ground_content = false,
groups = {},
sounds = default.node_sound_stone_defaults(),

View File

@ -27,3 +27,6 @@ loud_walking_starting_equipment (Starting Equipment) bool false
# Set to use experimental leaf decay.
loud_walking_quick_leaf_decay (Experimental Decay) bool false
# Rarity of goblins from 0 to 10
loud_walking_goblin_rarity (Goblin Rarity) int 2

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

145
wooden_buckets.lua Normal file
View File

@ -0,0 +1,145 @@
local function register_liquid_wood(source, itemname, inventory_image, name, groups)
if not (source and itemname and inventory_image and name and type(source) == 'string' and type(itemname) == 'string' and type(inventory_image) == 'string') then
return
end
inventory_image = inventory_image..'^squaresville_wood_bucket_overlay.png'
minetest.register_craftitem(itemname, {
description = name,
inventory_image = inventory_image,
stack_max = 1,
liquids_pointable = true,
groups = groups,
on_place = function(itemstack, user, pointed_thing)
if not (user and pointed_thing) then
return
end
-- Must be pointing to node
if pointed_thing.type ~= "node" then
return
end
local node = minetest.get_node_or_nil(pointed_thing.under)
local ndef = node and minetest.registered_nodes[node.name]
-- Call on_rightclick if the pointed node defines it
if ndef and ndef.on_rightclick and
user and not user:get_player_control().sneak then
return ndef.on_rightclick(pointed_thing.under, node, user, itemstack)
end
local lpos
-- Check if pointing to a buildable node
if ndef and ndef.buildable_to then
-- buildable; replace the node
lpos = pointed_thing.under
else
-- not buildable to; place the liquid above
-- check if the node above can be replaced
lpos = pointed_thing.above
local node = minetest.get_node_or_nil(lpos)
if not node then
return
end
local above_ndef = node and minetest.registered_nodes[node.name]
if not above_ndef or not above_ndef.buildable_to then
-- do not remove the bucket with the liquid
return itemstack
end
end
if minetest.is_protected(lpos, user and user:get_player_name() or "") then
return
end
minetest.set_node(lpos, {name = source})
return ItemStack("loud_walking:bucket_wood_empty")
end
})
end
for fluid, def in pairs(bucket.liquids) do
if not fluid:find('flowing') and not fluid:find('lava') and not fluid:find('molten') and not fluid:find('weightless') then
local item_name = def.itemname:gsub('[^:]+:bucket', 'loud_walking:bucket_wood')
local original = minetest.registered_items[def.itemname]
if original and item_name and item_name ~= def.itemname then
local new_name = original.description:gsub('Bucket', 'Wooden Bucket')
local new_image = original.inventory_image
register_liquid_wood(fluid, item_name, new_image, new_name, original.groups)
end
end
end
minetest.register_craft({
output = 'loud_walking:bucket_wood_empty 1',
recipe = {
{'group:wood', '', 'group:wood'},
{'', 'group:wood', ''},
}
})
minetest.register_craftitem("loud_walking:bucket_wood_empty", {
description = "Empty Wooden Bucket",
inventory_image = "squaresville_wood_bucket.png",
stack_max = 99,
liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing)
-- Must be pointing to node
if not (user and pointed_thing and pointed_thing.type == "node") then
return
end
-- Check if pointing to a liquid source
local node = minetest.get_node(pointed_thing.under)
if not node then
return
end
local liquiddef = bucket.liquids[node.name]
if not liquiddef or node.name ~= liquiddef.source then
return
end
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
return
end
if node and node.name:find('lava') or node.name:find('molten') then
itemstack:set_count(itemstack:get_count() - 1)
return itemstack
end
local item_count = user:get_wielded_item():get_count()
-- default set to return filled bucket
local giving_back = liquiddef.itemname:gsub('^[^:]+:bucket', 'loud_walking:bucket_wood')
-- check if holding more than 1 empty bucket
if item_count > 1 then
-- if space in inventory add filled bucket, otherwise drop as item
local inv = user:get_inventory()
if inv:room_for_item("main", {name=giving_back}) then
inv:add_item("main", giving_back)
else
local pos = user:getpos()
pos.y = math.floor(pos.y + 0.5)
minetest.add_item(pos, giving_back)
end
-- set to return empty buckets minus 1
giving_back = "loud_walking:bucket_wood_empty "..tostring(item_count-1)
end
minetest.add_node(pointed_thing.under, {name="air"})
return ItemStack(giving_back)
end,
})

81
zombie.lua Normal file
View File

@ -0,0 +1,81 @@
-- Originally by Blockmen(?)
if mobs.mod and mobs.mod == "redo" then
mobs:register_mob("loud_walking:zombie", {
type = "monster",
visual = "mesh",
mesh = "creatures_mob.x",
textures = {
{"mobs_zombie.png"},
},
collisionbox = {-0.25, -1, -0.3, 0.25, 0.75, 0.3},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_zombie.1",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death",
},
hp_min = 12,
hp_max = 35,
armor = 200,
knock_back = 1,
lava_damage = 10,
damage = 4,
reach = 2,
attack_type = "dogfight",
group_attack = true,
view_range = 10,
walk_chance = 75,
walk_velocity = 0.5,
run_velocity = 0.5,
jump = false,
drops = {
{name = "loud_walking:rotten_flesh", chance = 1, min = 1, max = 3,}
},
lifetimer = 180, -- 3 minutes
shoot_interval = 135, -- (lifetimer - (lifetimer / 4)), borrowed for do_custom timer
})
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific("loud_walking:zombie", {'group:soil'}, {"air"}, -1, 5, 30, 4000, 3, -31000, 31000)
mobs:register_egg("loud_walking:zombie", "Zombie", "zombie_head.png", 0)
local m = table.copy(minetest.registered_entities["loud_walking:zombie"])
m.name = 'loud_walking:zombie_enhanced'
m.hp_min = 24
m.hp_max = 70
m.armor = 100
m.damage = 6
m.walk_velocity = 0.5
m.run_velocity = 3.5
m.drops = {
{name = "loud_walking:rotten_flesh", chance = 1, min = 1, max = 3,},
{name = "default:mese_crystal", chance = 2, min = 1, max = 3,},
}
minetest.registered_entities["loud_walking:zombie_enhanced"] = m
mobs.spawning_mobs["loud_walking:zombie_enhanced"] = true
mobs:spawn_specific("loud_walking:zombie_enhanced", {'loud_walking:complex_block'}, {"air"}, -1, 20, 30, 1000, 6, -31000, -50)
-- rotten flesh
minetest.register_craftitem("loud_walking:rotten_flesh", {
description = "Rotten Flesh",
inventory_image = "mobs_rotten_flesh.png",
on_use = minetest.item_eat(-1),
})
minetest.register_craft({
type = "cooking",
cooktime = 30,
output = "loud_walking:barely_edible_meat",
recipe = "loud_walking:rotten_flesh"
})
end