VoxeLibre/mods/ENTITIES/mobs_mc/ender_dragon.lua

101 lines
2.4 KiB
Lua
Raw Normal View History

2017-07-05 04:15:46 +03:00
--###################
--################### ENDERDRAGON
--###################
local S = minetest.get_translator("mobs_mc")
2017-07-05 04:15:46 +03:00
mobs:register_mob("mobs_mc:enderdragon", {
type = "monster",
2020-04-11 03:46:03 +03:00
spawn_class = "hostile",
2017-07-05 04:15:46 +03:00
pathfinding = 1,
attacks_animals = true,
walk_chance = 100,
hp_max = 200,
hp_min = 200,
collisionbox = {-2, 3, -2, 2, 5, 2},
physical = false,
visual = "mesh",
mesh = "mobs_mc_dragon.b3d",
textures = {
{"mobs_mc_dragon.png"},
},
visual_size = {x=3, y=3},
view_range = 35,
walk_velocity = 6,
run_velocity = 6,
sounds = {
-- TODO: more sounds
2017-07-05 04:15:46 +03:00
shoot_attack = "mobs_mc_ender_dragon_shoot",
attack = "mobs_mc_ender_dragon_attack",
distance = 60,
},
physical = true,
damage = 10,
jump = true,
jump_height = 14,
fly = true,
dogshoot_switch = 1,
dogshoot_count_max =5,
dogshoot_count2_max = 5,
passive = false,
attack_animals = true,
lava_damage = 0,
fire_damage = 0,
2017-07-05 04:15:46 +03:00
on_rightclick = nil,
attack_type = "dogshoot",
2019-12-10 03:01:04 +03:00
arrow = "mobs_mc:dragon_fireball",
2017-07-05 04:15:46 +03:00
shoot_interval = 0.5,
2019-12-10 03:01:04 +03:00
shoot_offset = -1.0,
2017-07-05 04:15:46 +03:00
animation = {
fly_speed = 8, stand_speed = 8,
stand_start = 0, stand_end = 20,
walk_start = 0, walk_end = 20,
run_start = 0, run_end = 20,
},
ignores_nametag = true,
2020-07-25 14:32:35 +03:00
on_die = function(self, own_pos)
if self._egg_spawn_pos then
local pos = minetest.string_to_pos(self._egg_spawn_pos)
--if minetest.get_node(pos).buildable_to then
minetest.set_node(pos, {name = mobs_mc.items.dragon_egg})
return
--end
end
minetest.add_item(own_pos, mobs_mc.items.dragon_egg)
end
2017-07-05 04:15:46 +03:00
})
2018-03-25 23:27:06 +03:00
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
2017-07-05 04:15:46 +03:00
2019-12-10 03:01:04 +03:00
-- dragon fireball (projectile)
mobs:register_arrow("mobs_mc:dragon_fireball", {
2017-07-05 04:15:46 +03:00
visual = "sprite",
2019-12-10 03:01:04 +03:00
visual_size = {x = 1.25, y = 1.25},
2017-07-12 23:09:37 +03:00
textures = {"mobs_mc_dragon_fireball.png"},
2017-07-05 04:15:46 +03:00
velocity = 6,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 0.5,
2019-12-10 03:01:04 +03:00
damage_groups = {fleshy = 12},
2017-07-05 04:15:46 +03:00
}, nil)
end,
2017-08-06 15:09:25 +03:00
hit_mob = function(self, mob)
2020-04-07 01:55:45 +03:00
minetest.sound_play("tnt_explode", {pos = mob:get_pos(), gain = 1.5, max_hear_distance = 2*64}, true)
2017-08-06 15:09:25 +03:00
mob:punch(self.object, 1.0, {
2017-07-05 04:15:46 +03:00
full_punch_interval = 0.5,
damage_groups = {fleshy = 12},
}, nil)
end,
2019-12-10 03:01:04 +03:00
-- node hit, explode
2017-07-05 04:15:46 +03:00
hit_node = function(self, pos, node)
2019-12-10 03:01:04 +03:00
mobs:boom(self, pos, 2)
2017-07-05 04:15:46 +03:00
end
})
2019-12-11 02:46:55 +03:00
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0, true)