Update death animations of some mobs
[MineClone/MineClone2.git] / mods / ENTITIES / mobs_mc / bat.lua
blob64e0e349e65e5cfb8af07f0cc9a0af9678fb42c4
1 --License for code WTFPL and otherwise stated in readmes
3 -- intllib
4 local MP = minetest.get_modpath(minetest.get_current_modname())
5 local S, NS = dofile(MP.."/intllib.lua")
7 mobs:register_mob("mobs_mc:bat", {
8 type = "animal",
9 passive = true,
10 hp_min = 6,
11 hp_max = 6,
12 collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
13 visual = "mesh",
14 mesh = "mobs_mc_bat.b3d",
15 textures = {
16 {"mobs_mc_bat.png"},
18 visual_size = {x=1, y=1},
19 sounds = {
20 random = "mobs_rat", -- TODO: This sound is supposed to be very high-pitched and scary
21 distance = 16,
23 walk_velocity = 4.5,
24 run_velocity = 6.0,
25 -- TODO: Hang upside down
26 animation = {
27 stand_speed = 80,
28 stand_start = 0,
29 stand_end = 40,
30 walk_speed = 80,
31 walk_start = 0,
32 walk_end = 40,
33 run_speed = 80,
34 run_start = 0,
35 run_end = 40,
36 -- TODO: Less ugly death animation
37 --[[ die_speed = 60,
38 die_start = 40,
39 die_end = 80,
40 die_loop = false,
44 water_damage = 1,
45 lava_damage = 4,
46 light_damage = 0,
47 fall_damage = 0,
48 view_range = 16,
50 fly = true,
51 fly_in = "air",
55 -- Spawning
57 --[[ If the game has been launched between the 20th of October and the 3rd of November system time,
58 -- the maximum spawn light level is increased. ]]
59 local date = os.date("*t")
60 local maxlight
61 if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then
62 maxlight = 6
63 else
64 maxlight = 3
65 end
67 -- Spawn on solid blocks at or below Sea level and the selected light level
68 mobs:spawn_specific("mobs_mc:bat", mobs_mc.spawn.solid, {"air"}, 0, maxlight, 20, 5000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water-1)
71 -- spawn eggs
72 mobs:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)
75 if minetest.settings:get_bool("log_mods") then
76 minetest.log("action", "MC Bat loaded")
77 end