2017-07-05 03:15:46 +02:00
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
2022-02-13 21:40:12 +01:00
|
|
|
local S = minetest.get_translator("mobs_mc")
|
2017-07-05 03:15:46 +02:00
|
|
|
|
2022-05-25 14:44:49 +02:00
|
|
|
mcl_mobs:register_mob("mobs_mc:bat", {
|
2021-04-25 17:30:15 +02:00
|
|
|
description = S("Bat"),
|
2017-07-05 03:15:46 +02:00
|
|
|
type = "animal",
|
2020-04-11 02:46:03 +02:00
|
|
|
spawn_class = "ambient",
|
2018-09-14 14:48:48 +02:00
|
|
|
can_despawn = true,
|
2017-07-05 03:15:46 +02:00
|
|
|
passive = true,
|
|
|
|
hp_min = 6,
|
|
|
|
hp_max = 6,
|
|
|
|
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_bat.b3d",
|
|
|
|
textures = {
|
|
|
|
{"mobs_mc_bat.png"},
|
|
|
|
},
|
|
|
|
visual_size = {x=1, y=1},
|
|
|
|
sounds = {
|
2018-09-18 19:46:44 +02:00
|
|
|
random = "mobs_mc_bat_idle",
|
2020-12-05 18:50:43 +01:00
|
|
|
damage = "mobs_mc_bat_hurt",
|
|
|
|
death = "mobs_mc_bat_death",
|
2017-07-05 03:15:46 +02:00
|
|
|
distance = 16,
|
|
|
|
},
|
|
|
|
walk_velocity = 4.5,
|
|
|
|
run_velocity = 6.0,
|
|
|
|
-- TODO: Hang upside down
|
|
|
|
animation = {
|
2018-05-30 17:34:38 +02:00
|
|
|
stand_speed = 80,
|
|
|
|
stand_start = 0,
|
|
|
|
stand_end = 40,
|
|
|
|
walk_speed = 80,
|
|
|
|
walk_start = 0,
|
|
|
|
walk_end = 40,
|
|
|
|
run_speed = 80,
|
|
|
|
run_start = 0,
|
|
|
|
run_end = 40,
|
2020-12-05 04:33:23 +01:00
|
|
|
die_speed = 60,
|
2018-05-30 17:34:38 +02:00
|
|
|
die_start = 40,
|
|
|
|
die_end = 80,
|
|
|
|
die_loop = false,
|
2017-07-05 03:15:46 +02:00
|
|
|
},
|
2020-12-05 03:21:39 +01:00
|
|
|
walk_chance = 100,
|
2017-07-05 03:15:46 +02:00
|
|
|
fall_damage = 0,
|
|
|
|
view_range = 16,
|
2020-12-05 03:21:39 +01:00
|
|
|
fear_height = 0,
|
2022-02-13 21:40:12 +01:00
|
|
|
|
2020-12-05 03:21:39 +01:00
|
|
|
jump = false,
|
2022-02-13 21:40:12 +01:00
|
|
|
fly = true,
|
2020-12-05 14:48:58 +01:00
|
|
|
makes_footstep_sound = false,
|
2017-07-05 03:15:46 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
-- Spawning
|
|
|
|
|
|
|
|
--[[ If the game has been launched between the 20th of October and the 3rd of November system time,
|
|
|
|
-- the maximum spawn light level is increased. ]]
|
|
|
|
local date = os.date("*t")
|
|
|
|
local maxlight
|
|
|
|
if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then
|
|
|
|
maxlight = 6
|
|
|
|
else
|
|
|
|
maxlight = 3
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Spawn on solid blocks at or below Sea level and the selected light level
|
2022-05-25 14:44:49 +02:00
|
|
|
mcl_mobs:spawn_specific(
|
2021-04-08 12:57:24 +02:00
|
|
|
"mobs_mc:bat",
|
2021-04-08 14:13:46 +02:00
|
|
|
"overworld",
|
2021-04-08 14:12:43 +02:00
|
|
|
"ground",
|
2021-04-08 12:57:24 +02:00
|
|
|
{
|
|
|
|
"FlowerForest_underground",
|
|
|
|
"JungleEdge_underground",
|
|
|
|
"StoneBeach_underground",
|
|
|
|
"MesaBryce_underground",
|
|
|
|
"Mesa_underground",
|
|
|
|
"RoofedForest_underground",
|
|
|
|
"Jungle_underground",
|
|
|
|
"Swampland_underground",
|
|
|
|
"MushroomIsland_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",
|
|
|
|
"Desert",
|
|
|
|
"ColdTaiga",
|
|
|
|
"MushroomIsland",
|
|
|
|
"IcePlainsSpikes",
|
|
|
|
"SunflowerPlains",
|
|
|
|
"IcePlains",
|
|
|
|
"RoofedForest",
|
|
|
|
"ExtremeHills+_snowtop",
|
|
|
|
"MesaPlateauFM_grasstop",
|
|
|
|
"JungleEdgeM",
|
|
|
|
"ExtremeHillsM",
|
|
|
|
"JungleM",
|
|
|
|
"BirchForestM",
|
|
|
|
"MesaPlateauF",
|
|
|
|
"MesaPlateauFM",
|
|
|
|
"MesaPlateauF_grasstop",
|
|
|
|
"MesaBryce",
|
|
|
|
"JungleEdge",
|
|
|
|
"SavannaM",
|
|
|
|
},
|
|
|
|
0,
|
|
|
|
maxlight,
|
|
|
|
20,
|
|
|
|
5000,
|
|
|
|
2,
|
|
|
|
mobs_mc.spawn_height.overworld_min,
|
|
|
|
mobs_mc.spawn_height.water-1)
|
2017-07-05 03:15:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
-- spawn eggs
|
2022-05-25 14:44:49 +02:00
|
|
|
mcl_mobs:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)
|