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")
|
|
|
|
local mod_bows = minetest.get_modpath("mcl_bows") ~= nil
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### SKELETON
|
|
|
|
--###################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local skeleton = {
|
2021-04-25 15:30:15 +00:00
|
|
|
description = S("Skeleton"),
|
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 = 6,
|
|
|
|
xp_max = 6,
|
2019-10-02 16:31:16 +00:00
|
|
|
breath_max = -1,
|
2020-11-09 17:59:08 +00:00
|
|
|
armor = {undead = 100, fleshy = 100},
|
2017-07-05 01:15:46 +00:00
|
|
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
|
|
|
|
pathfinding = 1,
|
|
|
|
group_attack = true,
|
2022-10-06 01:30:02 +00:00
|
|
|
head_swivel = "Head_Control",
|
|
|
|
bone_eye_height = 2.35,
|
|
|
|
curiosity = .1,
|
2017-07-05 01:15:46 +00:00
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_skeleton.b3d",
|
2022-02-13 20:40:12 +00:00
|
|
|
textures = { {
|
|
|
|
"mcl_bows_bow_0.png", -- bow
|
|
|
|
"mobs_mc_skeleton.png", -- skeleton
|
|
|
|
} },
|
2021-04-14 23:51:17 +00:00
|
|
|
visual_size = {x=1, y=1},
|
2017-07-05 01:15:46 +00:00
|
|
|
makes_footstep_sound = true,
|
2021-04-14 23:51:17 +00:00
|
|
|
textures = {
|
|
|
|
{
|
|
|
|
"mobs_mc_empty.png", -- armor
|
|
|
|
"mobs_mc_skeleton.png", -- texture
|
|
|
|
"mcl_bows_bow_0.png", -- wielded_item
|
|
|
|
}
|
2017-07-05 01:15:46 +00:00
|
|
|
},
|
|
|
|
walk_velocity = 1.2,
|
|
|
|
run_velocity = 2.4,
|
|
|
|
damage = 2,
|
2022-02-13 20:40:12 +00:00
|
|
|
reach = 2,
|
2017-07-05 01:15:46 +00:00
|
|
|
drops = {
|
2022-05-25 21:25:15 +00:00
|
|
|
{name = "mcl_bows:arrow",
|
2017-07-05 01:15:46 +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_bows:bow",
|
2020-12-23 16:41:42 +00:00
|
|
|
chance = 100 / 8.5,
|
2017-07-05 01:15:46 +00:00
|
|
|
min = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "rare",},
|
2022-05-25 21:25:15 +00:00
|
|
|
{name = "mcl_mobitems:bone",
|
2017-07-05 01:15:46 +00:00
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 2,
|
|
|
|
looting = "common",},
|
2017-07-05 22:43:34 +00:00
|
|
|
|
|
|
|
-- Head
|
|
|
|
-- TODO: Only drop if killed by charged creeper
|
2022-05-25 21:25:15 +00:00
|
|
|
{name = "mcl_heads:skeleton",
|
2017-07-05 22:43:34 +00:00
|
|
|
chance = 200, -- 0.5% chance
|
|
|
|
min = 1,
|
2017-07-05 01:15:46 +00:00
|
|
|
max = 1,},
|
|
|
|
},
|
|
|
|
animation = {
|
2018-05-30 15:11:07 +00:00
|
|
|
stand_speed = 15,
|
2017-07-05 01:15:46 +00:00
|
|
|
stand_start = 0,
|
|
|
|
stand_end = 40,
|
2018-05-30 15:11:07 +00:00
|
|
|
walk_speed = 15,
|
2017-07-05 01:15:46 +00:00
|
|
|
walk_start = 40,
|
|
|
|
walk_end = 60,
|
2017-07-26 15:04:34 +00:00
|
|
|
run_speed = 30,
|
2018-05-30 15:11:07 +00:00
|
|
|
shoot_start = 70,
|
|
|
|
shoot_end = 90,
|
|
|
|
die_start = 160,
|
|
|
|
die_end = 170,
|
|
|
|
die_speed = 15,
|
|
|
|
die_loop = false,
|
2017-07-05 01:15:46 +00:00
|
|
|
},
|
2021-01-02 11:43:50 +00:00
|
|
|
ignited_by_sunlight = true,
|
2017-07-05 01:15:46 +00:00
|
|
|
view_range = 16,
|
|
|
|
fear_height = 4,
|
2022-02-13 20:40:12 +00:00
|
|
|
attack_type = "dogshoot",
|
2019-12-09 08:29:19 +00:00
|
|
|
arrow = "mcl_bows:arrow_entity",
|
|
|
|
shoot_arrow = function(self, pos, dir)
|
2019-12-09 08:56:38 +00:00
|
|
|
if mod_bows then
|
|
|
|
-- 2-4 damage per arrow
|
2022-02-13 20:40:12 +00:00
|
|
|
local dmg = math.max(4, math.random(2, 8))
|
|
|
|
mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
|
2019-12-09 08:56:38 +00:00
|
|
|
end
|
2019-12-09 08:29:19 +00:00
|
|
|
end,
|
2019-12-09 08:56:38 +00:00
|
|
|
shoot_interval = 2,
|
|
|
|
shoot_offset = 1.5,
|
2017-07-05 01:15:46 +00:00
|
|
|
dogshoot_switch = 1,
|
|
|
|
dogshoot_count_max =1.8,
|
2020-07-12 20:56:41 +00:00
|
|
|
harmed_by_heal = true,
|
2017-07-05 01:15:46 +00:00
|
|
|
}
|
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:register_mob("mobs_mc:skeleton", skeleton)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### STRAY
|
|
|
|
--###################
|
|
|
|
|
|
|
|
local stray = table.copy(skeleton)
|
2021-04-25 15:30:15 +00:00
|
|
|
stray.description = S("Stray")
|
2021-04-15 21:53:22 +00:00
|
|
|
stray.mesh = "mobs_mc_skeleton.b3d"
|
2017-07-05 01:15:46 +00:00
|
|
|
stray.textures = {
|
2018-05-30 14:59:27 +00:00
|
|
|
{
|
|
|
|
"mobs_mc_stray_overlay.png",
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc_stray.png",
|
|
|
|
"mcl_bows_bow_0.png",
|
2018-05-30 14:59:27 +00:00
|
|
|
},
|
2017-07-05 01:15:46 +00:00
|
|
|
}
|
|
|
|
-- TODO: different sound (w/ echo)
|
|
|
|
-- TODO: stray's arrow inflicts slowness status
|
|
|
|
table.insert(stray.drops, {
|
2020-12-23 16:41:42 +00:00
|
|
|
name = "mcl_potions:slowness_arrow",
|
2017-07-05 01:15:46 +00:00
|
|
|
chance = 2,
|
|
|
|
min = 1,
|
|
|
|
max = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
looting = "rare",
|
|
|
|
looting_chance_function = function(lvl)
|
|
|
|
local chance = 0.5
|
|
|
|
for i = 1, lvl do
|
|
|
|
if chance > 1 then
|
|
|
|
return 1
|
|
|
|
end
|
|
|
|
chance = chance + (1 - chance) / 2
|
|
|
|
end
|
|
|
|
return chance
|
|
|
|
end,
|
2017-07-05 01:15:46 +00:00
|
|
|
})
|
|
|
|
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:register_mob("mobs_mc:stray", stray)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
2017-08-16 20:08:17 +00:00
|
|
|
-- Overworld spawn
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc:skeleton",
|
|
|
|
"overworld",
|
2021-04-08 11:39:18 +00:00
|
|
|
"ground",
|
|
|
|
{
|
|
|
|
"Mesa",
|
|
|
|
"FlowerForest",
|
|
|
|
"Swampland",
|
|
|
|
"Taiga",
|
|
|
|
"ExtremeHills",
|
|
|
|
"Jungle",
|
|
|
|
"Savanna",
|
|
|
|
"BirchForest",
|
|
|
|
"MegaSpruceTaiga",
|
|
|
|
"MegaTaiga",
|
|
|
|
"ExtremeHills+",
|
|
|
|
"Forest",
|
|
|
|
"Plains",
|
|
|
|
"Desert",
|
|
|
|
"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",
|
|
|
|
"RoofedForest_ocean",
|
|
|
|
"JungleEdgeM_ocean",
|
|
|
|
"BirchForestM_ocean",
|
|
|
|
"BirchForest_ocean",
|
|
|
|
"IcePlains_deep_ocean",
|
|
|
|
"Jungle_deep_ocean",
|
|
|
|
"Savanna_ocean",
|
|
|
|
"MesaPlateauF_ocean",
|
|
|
|
"ExtremeHillsM_deep_ocean",
|
|
|
|
"Savanna_deep_ocean",
|
|
|
|
"SunflowerPlains_ocean",
|
|
|
|
"Swampland_deep_ocean",
|
|
|
|
"Swampland_ocean",
|
|
|
|
"MegaSpruceTaiga_deep_ocean",
|
|
|
|
"ExtremeHillsM_ocean",
|
|
|
|
"JungleEdgeM_deep_ocean",
|
|
|
|
"SunflowerPlains_deep_ocean",
|
|
|
|
"BirchForest_deep_ocean",
|
|
|
|
"IcePlainsSpikes_ocean",
|
|
|
|
"Mesa_ocean",
|
|
|
|
"StoneBeach_ocean",
|
|
|
|
"Plains_deep_ocean",
|
|
|
|
"JungleEdge_deep_ocean",
|
|
|
|
"SavannaM_deep_ocean",
|
|
|
|
"Desert_deep_ocean",
|
|
|
|
"Mesa_deep_ocean",
|
|
|
|
"ColdTaiga_deep_ocean",
|
|
|
|
"Plains_ocean",
|
|
|
|
"MesaPlateauFM_ocean",
|
|
|
|
"Forest_deep_ocean",
|
|
|
|
"JungleM_deep_ocean",
|
|
|
|
"FlowerForest_deep_ocean",
|
|
|
|
"MegaTaiga_ocean",
|
|
|
|
"StoneBeach_deep_ocean",
|
|
|
|
"IcePlainsSpikes_deep_ocean",
|
|
|
|
"ColdTaiga_ocean",
|
|
|
|
"SavannaM_ocean",
|
|
|
|
"MesaPlateauF_deep_ocean",
|
|
|
|
"MesaBryce_deep_ocean",
|
|
|
|
"ExtremeHills+_deep_ocean",
|
|
|
|
"ExtremeHills_ocean",
|
|
|
|
"Forest_ocean",
|
|
|
|
"MegaTaiga_deep_ocean",
|
|
|
|
"JungleEdge_ocean",
|
|
|
|
"MesaBryce_ocean",
|
|
|
|
"MegaSpruceTaiga_ocean",
|
|
|
|
"ExtremeHills+_ocean",
|
|
|
|
"Jungle_ocean",
|
|
|
|
"RoofedForest_deep_ocean",
|
|
|
|
"IcePlains_ocean",
|
|
|
|
"FlowerForest_ocean",
|
|
|
|
"ExtremeHills_deep_ocean",
|
|
|
|
"MesaPlateauFM_deep_ocean",
|
|
|
|
"Desert_ocean",
|
|
|
|
"Taiga_ocean",
|
|
|
|
"BirchForestM_deep_ocean",
|
|
|
|
"Taiga_deep_ocean",
|
|
|
|
"JungleM_ocean",
|
|
|
|
"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",
|
|
|
|
},
|
2021-04-14 23:51:17 +00:00
|
|
|
0,
|
|
|
|
7,
|
|
|
|
20,
|
|
|
|
17000,
|
|
|
|
2,
|
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
|
|
|
|
|
|
|
|
2017-08-16 20:08:17 +00:00
|
|
|
-- Nether spawn
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc:skeleton",
|
|
|
|
"nether",
|
|
|
|
"ground",
|
2021-04-08 11:39:18 +00:00
|
|
|
{
|
2022-06-18 14:28:03 +00:00
|
|
|
"SoulsandValley",
|
2021-04-08 11:39:18 +00:00
|
|
|
},
|
2021-04-14 23:51:17 +00:00
|
|
|
0,
|
2022-06-18 14:28:03 +00:00
|
|
|
minetest.LIGHT_MAX+1,
|
2021-04-14 23:51:17 +00:00
|
|
|
30,
|
|
|
|
10000,
|
|
|
|
3,
|
2022-05-25 21:25:15 +00:00
|
|
|
mcl_vars.mg_nether_min,
|
|
|
|
mcl_vars.mg_nether_max)
|
2017-08-16 20:08:17 +00:00
|
|
|
|
|
|
|
-- Stray spawn
|
2017-07-05 01:15:46 +00:00
|
|
|
-- TODO: Spawn directly under the sky
|
2022-05-25 12:44:49 +00:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-14 23:51:17 +00:00
|
|
|
"mobs_mc:stray",
|
|
|
|
"overworld",
|
2021-04-08 11:39:18 +00:00
|
|
|
"ground",
|
|
|
|
{
|
|
|
|
"ColdTaiga",
|
|
|
|
"IcePlainsSpikes",
|
|
|
|
"IcePlains",
|
|
|
|
"ExtremeHills+_snowtop",
|
|
|
|
},
|
2021-04-14 23:51:17 +00:00
|
|
|
0,
|
|
|
|
7,
|
|
|
|
20,
|
|
|
|
19000,
|
|
|
|
2,
|
2022-05-25 21:25:15 +00:00
|
|
|
mobs_mc.water_level,
|
|
|
|
mcl_vars.mg_overworld_max)
|
2017-08-16 20:08:17 +00:00
|
|
|
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
-- spawn eggs
|
2022-10-03 17:52:22 +00:00
|
|
|
mcl_mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "#c1c1c1", "#494949", 0)
|
2022-10-02 15:50:43 +00:00
|
|
|
|
2022-10-03 17:52:22 +00:00
|
|
|
mcl_mobs:register_egg("mobs_mc:stray", S("Stray"), "#5f7476", "#dae8e7", 0)
|