2017-05-23 00:35:56 -04:00
|
|
|
--MCmobs v0.4
|
2016-05-19 19:24:06 -04:00
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
2017-05-25 20:39:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
|
|
|
|
|
|
|
2017-05-22 22:27:00 -04:00
|
|
|
--###################
|
|
|
|
--################### ZOMBIE
|
|
|
|
--###################
|
2016-05-19 19:24:06 -04:00
|
|
|
|
|
|
|
|
2017-05-22 22:27:00 -04:00
|
|
|
local zombie = {
|
2016-05-19 19:24:06 -04:00
|
|
|
type = "monster",
|
2017-05-22 22:27:00 -04:00
|
|
|
hp_min = 20,
|
2017-06-14 19:47:33 -04:00
|
|
|
hp_max = 20,
|
2017-06-29 22:01:05 +02:00
|
|
|
armor = 90,
|
|
|
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
2017-05-23 00:35:56 -04:00
|
|
|
visual = "mesh",
|
2017-06-29 15:08:19 +02:00
|
|
|
mesh = "mobs_mc_zombie.b3d",
|
2016-05-19 19:24:06 -04:00
|
|
|
textures = {
|
2017-06-29 15:08:19 +02:00
|
|
|
{"mobs_mc_zombie.png"},
|
2016-05-19 19:24:06 -04:00
|
|
|
},
|
2017-06-29 15:08:19 +02:00
|
|
|
visual_size = {x=3, y=3},
|
2016-05-19 19:24:06 -04:00
|
|
|
makes_footstep_sound = true,
|
|
|
|
sounds = {
|
|
|
|
random = "zombie1",
|
|
|
|
death = "zombiedeath",
|
|
|
|
damage = "zombiehurt1",
|
2017-06-29 22:01:05 +02:00
|
|
|
distance = 16,
|
2016-05-19 19:24:06 -04:00
|
|
|
},
|
|
|
|
walk_velocity = .8,
|
|
|
|
run_velocity = 1.6,
|
2017-05-22 22:27:00 -04:00
|
|
|
damage = 3,
|
2017-06-29 22:01:05 +02:00
|
|
|
fear_height = 4,
|
2017-05-22 22:27:00 -04:00
|
|
|
pathfinding = 1,
|
|
|
|
jump = true,
|
2017-06-13 19:05:07 -04:00
|
|
|
--jump_height = 3,
|
2016-05-24 22:17:04 -04:00
|
|
|
group_attack = true,
|
2016-05-19 19:24:06 -04:00
|
|
|
drops = {
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.rotten_flesh,
|
2016-05-19 19:24:06 -04:00
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
|
|
|
max = 2,},
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.iron_ingot,
|
2017-05-22 22:27:00 -04:00
|
|
|
-- approximation to 8.5%
|
|
|
|
chance = 11,
|
2016-05-19 19:24:06 -04:00
|
|
|
min = 1,
|
|
|
|
max = 1,},
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.carrot,
|
2017-05-22 22:27:00 -04:00
|
|
|
-- approximation to 8.5%
|
|
|
|
chance = 11,
|
2016-05-19 19:24:06 -04:00
|
|
|
min = 1,
|
|
|
|
max = 1,},
|
2017-06-23 18:26:00 +02:00
|
|
|
{name = mobs_mc.items.potato,
|
2017-05-22 22:27:00 -04:00
|
|
|
-- approximation to 8.5%
|
|
|
|
chance = 11,
|
2016-05-19 19:24:06 -04:00
|
|
|
min = 1,
|
|
|
|
max = 1,},
|
|
|
|
},
|
|
|
|
animation = {
|
2017-06-29 18:50:25 +02:00
|
|
|
speed_normal = 25, speed_run = 50,
|
|
|
|
stand_start = 40, stand_end = 80,
|
|
|
|
walk_start = 0, walk_end = 40,
|
|
|
|
run_start = 0, run_end = 40,
|
2016-05-19 19:24:06 -04:00
|
|
|
},
|
|
|
|
drawtype = "front",
|
2017-06-29 22:01:05 +02:00
|
|
|
lava_damage = 4,
|
2017-05-22 22:27:00 -04:00
|
|
|
-- TODO: Burn mob only when in direct sunlight
|
2017-05-28 23:16:44 -04:00
|
|
|
light_damage = 2,
|
2017-06-29 22:01:05 +02:00
|
|
|
view_range = 16,
|
2016-05-19 19:24:06 -04:00
|
|
|
attack_type = "dogfight",
|
2017-05-22 22:27:00 -04:00
|
|
|
}
|
2016-05-19 19:24:06 -04:00
|
|
|
|
2017-05-22 22:27:00 -04:00
|
|
|
mobs:register_mob("mobs_mc:zombie", zombie)
|
|
|
|
|
|
|
|
-- Baby zombie.
|
|
|
|
-- A smaller and more dangerous variant of the zombie
|
|
|
|
|
|
|
|
local baby_zombie = table.copy(zombie)
|
|
|
|
baby_zombie.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
|
|
|
|
baby_zombie.visual_size = {x=0.5, y=0.5}
|
|
|
|
baby_zombie.walk_velocity = 1.2
|
|
|
|
baby_zombie.run_velocity = 2.4
|
|
|
|
baby_zombie.light_damage = 0
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:baby_zombie", baby_zombie)
|
|
|
|
|
|
|
|
-- Husk.
|
|
|
|
-- Desert variant of the zombie
|
|
|
|
local husk = table.copy(zombie)
|
|
|
|
husk.textures = {{"mobs_mc_husk.png"}}
|
|
|
|
husk.light_damage = 0
|
2017-05-28 23:16:44 -04:00
|
|
|
husk.water_damage = 3
|
2017-05-22 22:27:00 -04:00
|
|
|
-- TODO: Husks avoid water
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:husk", husk)
|
|
|
|
|
|
|
|
-- Baby husk.
|
|
|
|
-- A smaller and more dangerous variant of the husk
|
|
|
|
local baby_husk = table.copy(husk)
|
|
|
|
baby_husk.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
|
|
|
|
baby_husk.visual_size = {x=0.5, y=0.5}
|
|
|
|
baby_husk.walk_velocity = 1.2
|
|
|
|
baby_husk.run_velocity = 2.4
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:baby_husk", baby_husk)
|
|
|
|
|
|
|
|
|
|
|
|
-- Spawning
|
|
|
|
|
2017-06-24 19:09:38 +02:00
|
|
|
mobs:register_spawn("mobs_mc:zombie", mobs_mc.spawn.solid, 7, 0, 6000, 4, 31000)
|
2017-05-22 22:27:00 -04:00
|
|
|
-- Baby zombie is 20 times less likely than regular zombies
|
2017-06-24 19:09:38 +02:00
|
|
|
mobs:register_spawn("mobs_mc:baby_zombie", mobs_mc.spawn.solid, 7, 0, 60000, 4, 31000)
|
|
|
|
mobs:register_spawn("mobs_mc:husk", mobs_mc.spawn.desert, 7, 0, 6500, 4, 31000)
|
|
|
|
mobs:register_spawn("mobs_mc:baby_husk", mobs_mc.spawn.desert, 7, 0, 65000, 4, 31000)
|
2016-05-19 19:24:06 -04:00
|
|
|
|
|
|
|
|
2017-05-22 22:27:00 -04:00
|
|
|
-- Compatibility
|
2016-05-19 19:24:06 -04:00
|
|
|
mobs:alias_mob("mobs:zombie", "mobs_mc:zombie")
|
|
|
|
|
2017-05-22 22:27:00 -04:00
|
|
|
-- Spawn eggs
|
2017-06-27 15:15:00 +02:00
|
|
|
mobs:register_egg("mobs_mc:husk", "Husk", "spawn_egg_husk.png", 0) -- TODO: Replace spawn icon
|
|
|
|
mobs:register_egg("mobs_mc:zombie", "Zombie", "mobs_mc_spawn_icon_zombie.png", 0)
|
2016-05-19 19:24:06 -04:00
|
|
|
|
2017-06-21 00:20:06 -04:00
|
|
|
if minetest.settings:get_bool("log_mods") then
|
2016-05-19 19:24:06 -04:00
|
|
|
minetest.log("action", "MC Zombie loaded")
|
2017-05-22 22:27:00 -04:00
|
|
|
end
|