2017-07-05 01:15:46 +00:00
|
|
|
--MCmobs v0.4
|
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
2022-02-13 20:40:12 +00:00
|
|
|
local S = minetest.get_translator("mobs_mc")
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### ZOMBIE
|
|
|
|
--###################
|
|
|
|
|
2018-01-23 22:13:55 +00:00
|
|
|
local drops_common = {
|
2022-05-25 21:25:15 +00:00
|
|
|
{name = "mcl_mobitems:rotten_flesh",
|
2018-01-23 22:13:55 +00:00
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 2,
|
|
|
|
looting = "common",},
|
2022-05-25 21:25:15 +00:00
|
|
|
{name = "mcl_core:iron_ingot",
|
2018-01-23 22:13:55 +00:00
|
|
|
chance = 120, -- 2.5% / 3
|
|
|
|
min = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "rare",
|
|
|
|
looting_factor = 0.01 / 3,},
|
2022-05-25 21:25:15 +00:00
|
|
|
{name = "mcl_farming:carrot_item",
|
2018-01-23 22:13:55 +00:00
|
|
|
chance = 120, -- 2.5% / 3
|
|
|
|
min = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "rare",
|
|
|
|
looting_factor = 0.01 / 3,},
|
2022-05-25 21:25:15 +00:00
|
|
|
{name = "mcl_farming:potato_item",
|
2018-01-23 22:13:55 +00:00
|
|
|
chance = 120, -- 2.5% / 3
|
|
|
|
min = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "rare",
|
|
|
|
looting_factor = 0.01 / 3,},
|
2018-01-23 22:13:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
local drops_zombie = table.copy(drops_common)
|
|
|
|
table.insert(drops_zombie, {
|
|
|
|
-- Zombie Head
|
|
|
|
-- TODO: Only drop if killed by charged creeper
|
2022-05-25 21:25:15 +00:00
|
|
|
name = "mcl_heads:zombie",
|
2018-01-23 22:13:55 +00:00
|
|
|
chance = 200, -- 0.5%
|
|
|
|
min = 1,
|
|
|
|
max = 1,
|
|
|
|
})
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
local zombie = {
|
2021-04-25 15:30:15 +00:00
|
|
|
description = S("Zombie"),
|
2017-07-05 01:15:46 +00:00
|
|
|
type = "monster",
|
2020-04-11 00:46:03 +00:00
|
|
|
spawn_class = "hostile",
|
2017-07-05 01:15:46 +00:00
|
|
|
hp_min = 20,
|
|
|
|
hp_max = 20,
|
2020-12-06 14:46:42 +00:00
|
|
|
xp_min = 5,
|
|
|
|
xp_max = 5,
|
2019-10-02 16:31:16 +00:00
|
|
|
breath_max = -1,
|
2020-11-09 17:59:08 +00:00
|
|
|
armor = {undead = 90, fleshy = 90},
|
2022-08-26 17:47:09 +00:00
|
|
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.8, 0.3},
|
2017-07-05 01:15:46 +00:00
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_zombie.b3d",
|
|
|
|
textures = {
|
2021-04-14 23:51:17 +00:00
|
|
|
{
|
|
|
|
"mobs_mc_empty.png", -- armor
|
|
|
|
"mobs_mc_zombie.png", -- texture
|
|
|
|
"mobs_mc_empty.png", -- wielded_item
|
|
|
|
}
|
2017-07-05 01:15:46 +00:00
|
|
|
},
|
|
|
|
makes_footstep_sound = true,
|
|
|
|
sounds = {
|
2018-10-23 15:13:22 +00:00
|
|
|
random = "mobs_mc_zombie_growl",
|
2019-01-31 05:56:03 +00:00
|
|
|
war_cry = "mobs_mc_zombie_growl",
|
2017-07-20 14:34:16 +00:00
|
|
|
death = "mobs_mc_zombie_death",
|
|
|
|
damage = "mobs_mc_zombie_hurt",
|
2017-07-05 01:15:46 +00:00
|
|
|
distance = 16,
|
|
|
|
},
|
2022-02-13 20:40:12 +00:00
|
|
|
walk_velocity = .8,
|
|
|
|
run_velocity = 1.6,
|
2017-07-05 01:15:46 +00:00
|
|
|
damage = 3,
|
2017-07-25 22:26:18 +00:00
|
|
|
reach = 2,
|
2017-07-05 01:15:46 +00:00
|
|
|
fear_height = 4,
|
|
|
|
pathfinding = 1,
|
|
|
|
jump = true,
|
2019-03-09 00:50:00 +00:00
|
|
|
jump_height = 4,
|
|
|
|
group_attack = { "mobs_mc:zombie", "mobs_mc:baby_zombie", "mobs_mc:husk", "mobs_mc:baby_husk" },
|
2018-01-23 22:13:55 +00:00
|
|
|
drops = drops_zombie,
|
2017-07-05 01:15:46 +00:00
|
|
|
animation = {
|
2022-08-26 17:47:09 +00:00
|
|
|
stand_start = 40, stand_end = 49, stand_speed = 2,
|
|
|
|
walk_start = 0, walk_end = 39, speed_normal = 25,
|
|
|
|
run_start = 0, run_end = 39, speed_run = 50,
|
|
|
|
punch_start = 50, punch_end = 59, punch_speed = 20,
|
2017-07-05 01:15:46 +00:00
|
|
|
},
|
2021-01-02 11:43:50 +00:00
|
|
|
ignited_by_sunlight = true,
|
2018-05-31 01:09:27 +00:00
|
|
|
sunlight_damage = 2,
|
2017-07-05 01:15:46 +00:00
|
|
|
view_range = 16,
|
2022-02-13 20:40:12 +00:00
|
|
|
attack_type = "dogfight",
|
2020-07-12 20:56:41 +00:00
|
|
|
harmed_by_heal = true,
|
2022-08-30 12:42:03 +00:00
|
|
|
on_spawn = function(self)
|
|
|
|
-- Remove saved visual_size on old existing entites.
|
|
|
|
-- Old entities were 3 now it's 1.
|
|
|
|
self.visual_size = nil
|
|
|
|
self.object:set_properties({visual_size = self.visual_size})
|
|
|
|
self.base_size = self.visual_size
|
|
|
|
end,
|
2022-07-31 22:36:33 +00:00
|
|
|
attack_npcs = true,
|
2017-07-05 01:15:46 +00:00
|
|
|
}
|
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:register_mob("mobs_mc:zombie", zombie)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
-- Baby zombie.
|
|
|
|
-- A smaller and more dangerous variant of the zombie
|
|
|
|
|
|
|
|
local baby_zombie = table.copy(zombie)
|
2021-04-25 15:30:15 +00:00
|
|
|
baby_zombie.description = S("Baby Zombie")
|
2022-08-26 17:47:09 +00:00
|
|
|
baby_zombie.collisionbox = {-0.25, -0.01, -0.25, 0.25, 1, 0.25}
|
2020-12-06 14:46:42 +00:00
|
|
|
baby_zombie.xp_min = 12
|
|
|
|
baby_zombie.xp_max = 12
|
2022-08-26 17:47:09 +00:00
|
|
|
baby_zombie.visual_size = {x = 1 / 2, y = 1 / 2}
|
2017-07-05 01:15:46 +00:00
|
|
|
baby_zombie.walk_velocity = 1.2
|
|
|
|
baby_zombie.run_velocity = 2.4
|
2019-03-08 22:52:41 +00:00
|
|
|
baby_zombie.child = 1
|
2022-08-26 17:47:09 +00:00
|
|
|
baby_zombie.reach = 1
|
|
|
|
baby_zombie.animation = {
|
|
|
|
stand_start = 100, stand_end = 109, stand_speed = 2,
|
|
|
|
walk_start = 60, walk_end = 99, speed_normal = 40,
|
|
|
|
run_start = 60, run_end = 99, speed_run = 80,
|
|
|
|
punch_start = 109, punch_end = 119
|
|
|
|
}
|
2017-07-05 01:15:46 +00:00
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:register_mob("mobs_mc:baby_zombie", baby_zombie)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
-- Husk.
|
|
|
|
-- Desert variant of the zombie
|
|
|
|
local husk = table.copy(zombie)
|
2021-04-25 15:30:15 +00:00
|
|
|
husk.description = S("Husk")
|
2021-04-14 23:51:17 +00:00
|
|
|
husk.textures = {
|
|
|
|
{
|
|
|
|
"mobs_mc_empty.png", -- armor
|
|
|
|
"mobs_mc_husk.png", -- texture
|
|
|
|
"mobs_mc_empty.png", -- wielded_item
|
|
|
|
}
|
|
|
|
}
|
2021-01-02 11:43:50 +00:00
|
|
|
husk.ignited_by_sunlight = false
|
2018-05-31 01:09:27 +00:00
|
|
|
husk.sunlight_damage = 0
|
2018-01-23 22:13:55 +00:00
|
|
|
husk.drops = drops_common
|
2017-07-05 01:15:46 +00:00
|
|
|
-- TODO: Husks avoid water
|
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:register_mob("mobs_mc:husk", husk)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
-- Baby husk.
|
|
|
|
-- A smaller and more dangerous variant of the husk
|
2022-08-26 17:47:09 +00:00
|
|
|
local baby_husk = table.copy(baby_zombie)
|
2021-04-25 15:30:15 +00:00
|
|
|
baby_husk.description = S("Baby Husk")
|
2022-08-26 17:47:09 +00:00
|
|
|
baby_husk.textures = {{
|
|
|
|
"mobs_mc_empty.png", -- armor
|
|
|
|
"mobs_mc_husk.png", -- texture
|
|
|
|
"mobs_mc_empty.png", -- wielded_item
|
|
|
|
}}
|
|
|
|
baby_husk.ignited_by_sunlight = false
|
|
|
|
baby_husk.sunlight_damage = 0
|
|
|
|
baby_husk.drops = drops_common
|
2017-07-05 01:15:46 +00:00
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:register_mob("mobs_mc:baby_husk", baby_husk)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
-- Spawning
|
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc:zombie",
|
|
|
|
"overworld",
|
2021-04-08 11:39:18 +00:00
|
|
|
"ground",
|
|
|
|
{
|
|
|
|
"FlowerForest_underground",
|
|
|
|
"JungleEdge_underground",
|
|
|
|
"StoneBeach_underground",
|
|
|
|
"MesaBryce_underground",
|
|
|
|
"Mesa_underground",
|
|
|
|
"RoofedForest_underground",
|
|
|
|
"Jungle_underground",
|
|
|
|
"Swampland_underground",
|
|
|
|
"BirchForest_underground",
|
|
|
|
"Plains_underground",
|
|
|
|
"MesaPlateauF_underground",
|
|
|
|
"ExtremeHills_underground",
|
|
|
|
"MegaSpruceTaiga_underground",
|
|
|
|
"BirchForestM_underground",
|
|
|
|
"SavannaM_underground",
|
|
|
|
"MesaPlateauFM_underground",
|
|
|
|
"Desert_underground",
|
|
|
|
"Savanna_underground",
|
|
|
|
"Forest_underground",
|
|
|
|
"SunflowerPlains_underground",
|
|
|
|
"ColdTaiga_underground",
|
|
|
|
"IcePlains_underground",
|
|
|
|
"IcePlainsSpikes_underground",
|
|
|
|
"MegaTaiga_underground",
|
|
|
|
"Taiga_underground",
|
|
|
|
"ExtremeHills+_underground",
|
|
|
|
"JungleM_underground",
|
|
|
|
"ExtremeHillsM_underground",
|
|
|
|
"JungleEdgeM_underground",
|
|
|
|
"Mesa",
|
|
|
|
"FlowerForest",
|
|
|
|
"Swampland",
|
|
|
|
"Taiga",
|
|
|
|
"ExtremeHills",
|
|
|
|
"Jungle",
|
|
|
|
"Savanna",
|
|
|
|
"BirchForest",
|
|
|
|
"MegaSpruceTaiga",
|
|
|
|
"MegaTaiga",
|
|
|
|
"ExtremeHills+",
|
|
|
|
"Forest",
|
|
|
|
"Plains",
|
|
|
|
"ColdTaiga",
|
|
|
|
"IcePlainsSpikes",
|
|
|
|
"SunflowerPlains",
|
|
|
|
"IcePlains",
|
|
|
|
"RoofedForest",
|
|
|
|
"ExtremeHills+_snowtop",
|
|
|
|
"MesaPlateauFM_grasstop",
|
|
|
|
"JungleEdgeM",
|
|
|
|
"ExtremeHillsM",
|
|
|
|
"JungleM",
|
|
|
|
"BirchForestM",
|
|
|
|
"MesaPlateauF",
|
|
|
|
"MesaPlateauFM",
|
|
|
|
"MesaPlateauF_grasstop",
|
|
|
|
"MesaBryce",
|
|
|
|
"JungleEdge",
|
|
|
|
"SavannaM",
|
|
|
|
"FlowerForest_beach",
|
|
|
|
"Forest_beach",
|
|
|
|
"StoneBeach",
|
|
|
|
"ColdTaiga_beach_water",
|
|
|
|
"Taiga_beach",
|
|
|
|
"Savanna_beach",
|
|
|
|
"Plains_beach",
|
|
|
|
"ExtremeHills_beach",
|
|
|
|
"ColdTaiga_beach",
|
|
|
|
"Swampland_shore",
|
|
|
|
"JungleM_shore",
|
|
|
|
"Jungle_shore",
|
|
|
|
"MesaPlateauFM_sandlevel",
|
|
|
|
"MesaPlateauF_sandlevel",
|
|
|
|
"MesaBryce_sandlevel",
|
|
|
|
"Mesa_sandlevel",
|
|
|
|
},
|
2021-04-14 23:51:17 +00:00
|
|
|
0,
|
|
|
|
7,
|
|
|
|
30,
|
|
|
|
6000,
|
|
|
|
4,
|
2022-05-25 21:25:15 +00:00
|
|
|
mcl_vars.mg_overworld_min,
|
|
|
|
mcl_vars.mg_overworld_max)
|
2017-07-05 01:15:46 +00:00
|
|
|
-- Baby zombie is 20 times less likely than regular zombies
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc:baby_zombie",
|
|
|
|
"overworld",
|
2021-04-08 11:39:18 +00:00
|
|
|
"ground",
|
|
|
|
{
|
|
|
|
"FlowerForest_underground",
|
|
|
|
"JungleEdge_underground",
|
|
|
|
"StoneBeach_underground",
|
|
|
|
"MesaBryce_underground",
|
|
|
|
"Mesa_underground",
|
|
|
|
"RoofedForest_underground",
|
|
|
|
"Jungle_underground",
|
|
|
|
"Swampland_underground",
|
|
|
|
"BirchForest_underground",
|
|
|
|
"Plains_underground",
|
|
|
|
"MesaPlateauF_underground",
|
|
|
|
"ExtremeHills_underground",
|
|
|
|
"MegaSpruceTaiga_underground",
|
|
|
|
"BirchForestM_underground",
|
|
|
|
"SavannaM_underground",
|
|
|
|
"MesaPlateauFM_underground",
|
|
|
|
"Desert_underground",
|
|
|
|
"Savanna_underground",
|
|
|
|
"Forest_underground",
|
|
|
|
"SunflowerPlains_underground",
|
|
|
|
"ColdTaiga_underground",
|
|
|
|
"IcePlains_underground",
|
|
|
|
"IcePlainsSpikes_underground",
|
|
|
|
"MegaTaiga_underground",
|
|
|
|
"Taiga_underground",
|
|
|
|
"ExtremeHills+_underground",
|
|
|
|
"JungleM_underground",
|
|
|
|
"ExtremeHillsM_underground",
|
|
|
|
"JungleEdgeM_underground",
|
|
|
|
"Mesa",
|
|
|
|
"FlowerForest",
|
|
|
|
"Swampland",
|
|
|
|
"Taiga",
|
|
|
|
"ExtremeHills",
|
|
|
|
"Jungle",
|
|
|
|
"Savanna",
|
|
|
|
"BirchForest",
|
|
|
|
"MegaSpruceTaiga",
|
|
|
|
"MegaTaiga",
|
|
|
|
"ExtremeHills+",
|
|
|
|
"Forest",
|
|
|
|
"Plains",
|
|
|
|
"ColdTaiga",
|
|
|
|
"IcePlainsSpikes",
|
|
|
|
"SunflowerPlains",
|
|
|
|
"IcePlains",
|
|
|
|
"RoofedForest",
|
|
|
|
"ExtremeHills+_snowtop",
|
|
|
|
"MesaPlateauFM_grasstop",
|
|
|
|
"JungleEdgeM",
|
|
|
|
"ExtremeHillsM",
|
|
|
|
"JungleM",
|
|
|
|
"BirchForestM",
|
|
|
|
"MesaPlateauF",
|
|
|
|
"MesaPlateauFM",
|
|
|
|
"MesaPlateauF_grasstop",
|
|
|
|
"MesaBryce",
|
|
|
|
"JungleEdge",
|
|
|
|
"SavannaM",
|
|
|
|
"FlowerForest_beach",
|
|
|
|
"Forest_beach",
|
|
|
|
"StoneBeach",
|
|
|
|
"ColdTaiga_beach_water",
|
|
|
|
"Taiga_beach",
|
|
|
|
"Savanna_beach",
|
|
|
|
"Plains_beach",
|
|
|
|
"ExtremeHills_beach",
|
|
|
|
"ColdTaiga_beach",
|
|
|
|
"Swampland_shore",
|
|
|
|
"JungleM_shore",
|
|
|
|
"Jungle_shore",
|
|
|
|
"MesaPlateauFM_sandlevel",
|
|
|
|
"MesaPlateauF_sandlevel",
|
|
|
|
"MesaBryce_sandlevel",
|
|
|
|
"Mesa_sandlevel",
|
|
|
|
},
|
2021-04-14 23:51:17 +00:00
|
|
|
0,
|
|
|
|
7,
|
|
|
|
30,
|
|
|
|
60000,
|
|
|
|
4,
|
2022-05-25 21:25:15 +00:00
|
|
|
mcl_vars.mg_overworld_min,
|
|
|
|
mcl_vars.mg_overworld_max)
|
2021-04-08 11:39:18 +00:00
|
|
|
|
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc:husk",
|
|
|
|
"overworld",
|
2021-04-08 11:39:18 +00:00
|
|
|
"ground",
|
|
|
|
{
|
|
|
|
"Desert",
|
|
|
|
},
|
2021-04-14 23:51:17 +00:00
|
|
|
0,
|
|
|
|
7,
|
|
|
|
30,
|
|
|
|
6500,
|
|
|
|
4,
|
2022-05-25 21:25:15 +00:00
|
|
|
mcl_vars.mg_overworld_min,
|
|
|
|
mcl_vars.mg_overworld_max)
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc:baby_husk",
|
|
|
|
"overworld",
|
|
|
|
"ground",
|
2021-04-08 11:39:18 +00:00
|
|
|
{
|
|
|
|
"Desert",
|
|
|
|
},
|
2021-04-14 23:51:17 +00:00
|
|
|
0,
|
|
|
|
7,
|
|
|
|
30,
|
|
|
|
65000,
|
|
|
|
4,
|
2022-05-25 21:25:15 +00:00
|
|
|
mcl_vars.mg_overworld_min,
|
|
|
|
mcl_vars.mg_overworld_max)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
-- Spawn eggs
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:register_egg("mobs_mc:husk", S("Husk"), "mobs_mc_spawn_icon_husk.png", 0)
|
|
|
|
mcl_mobs:register_egg("mobs_mc:zombie", S("Zombie"), "mobs_mc_spawn_icon_zombie.png", 0)
|