2017-07-05 04:15:46 +03:00
|
|
|
-- daufinsyd
|
|
|
|
-- My work is under the LGPL terms
|
2021-04-07 19:47:40 +03:00
|
|
|
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models -hi 22i ~jordan4ibanez
|
2017-07-05 04:15:46 +03:00
|
|
|
-- blaze.lua partial copy of mobs_mc/ghast.lua
|
|
|
|
|
2019-03-07 22:43:39 +03:00
|
|
|
local S = minetest.get_translator("mobs_mc")
|
2017-07-05 04:15:46 +03:00
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### BLAZE
|
|
|
|
--###################
|
|
|
|
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:blaze", {
|
|
|
|
type = "monster",
|
2020-04-11 03:46:03 +03:00
|
|
|
spawn_class = "hostile",
|
2017-07-05 04:15:46 +03:00
|
|
|
hp_min = 20,
|
|
|
|
hp_max = 20,
|
2020-12-06 17:46:42 +03:00
|
|
|
xp_min = 10,
|
|
|
|
xp_max = 10,
|
2017-07-05 04:15:46 +03:00
|
|
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3},
|
|
|
|
rotate = -180,
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_blaze.b3d",
|
|
|
|
textures = {
|
|
|
|
{"mobs_mc_blaze.png"},
|
|
|
|
},
|
2020-08-05 19:33:53 +03:00
|
|
|
armor = { fleshy = 100, snowball_vulnerable = 100, water_vulnerable = 100 },
|
2017-07-05 04:15:46 +03:00
|
|
|
visual_size = {x=3, y=3},
|
|
|
|
sounds = {
|
|
|
|
random = "mobs_mc_blaze_breath",
|
|
|
|
death = "mobs_mc_blaze_died",
|
|
|
|
damage = "mobs_mc_blaze_hurt",
|
|
|
|
distance = 16,
|
|
|
|
},
|
|
|
|
walk_velocity = .8,
|
|
|
|
run_velocity = 1.6,
|
|
|
|
damage = 6,
|
2017-07-26 01:26:18 +03:00
|
|
|
reach = 2,
|
2017-07-05 04:15:46 +03:00
|
|
|
pathfinding = 1,
|
|
|
|
drops = {
|
|
|
|
{name = mobs_mc.items.blaze_rod,
|
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
2020-12-23 19:41:42 +03:00
|
|
|
max = 1,
|
|
|
|
looting = "common",},
|
2017-07-05 04:15:46 +03:00
|
|
|
},
|
|
|
|
animation = {
|
2018-05-31 04:17:41 +03:00
|
|
|
stand_speed = 25,
|
|
|
|
stand_start = 0,
|
|
|
|
stand_end = 100,
|
|
|
|
walk_speed = 25,
|
|
|
|
walk_start = 0,
|
|
|
|
walk_end = 100,
|
|
|
|
run_speed = 50,
|
|
|
|
run_start = 0,
|
|
|
|
run_end = 100,
|
2017-07-05 04:15:46 +03:00
|
|
|
},
|
|
|
|
-- MC Wiki: takes 1 damage every half second while in water
|
|
|
|
water_damage = 2,
|
|
|
|
lava_damage = 0,
|
2019-10-02 19:43:48 +03:00
|
|
|
fire_damage = 0,
|
2017-07-05 04:15:46 +03:00
|
|
|
fall_damage = 0,
|
|
|
|
fall_speed = -2.25,
|
|
|
|
light_damage = 0,
|
|
|
|
view_range = 16,
|
|
|
|
attack_type = "dogshoot",
|
|
|
|
arrow = "mobs_mc:blaze_fireball",
|
|
|
|
shoot_interval = 3.5,
|
2019-12-10 02:16:09 +03:00
|
|
|
shoot_offset = 1.0,
|
2017-07-05 04:15:46 +03:00
|
|
|
passive = false,
|
|
|
|
jump = true,
|
|
|
|
jump_height = 4,
|
|
|
|
fly = true,
|
2020-12-05 16:48:58 +03:00
|
|
|
makes_footstep_sound = false,
|
2019-03-09 02:54:49 +03:00
|
|
|
fear_height = 0,
|
2019-03-08 05:40:46 +03:00
|
|
|
glow = 14,
|
2020-12-24 19:48:40 +03:00
|
|
|
fire_resistant = true,
|
2021-04-05 02:32:58 +03:00
|
|
|
do_custom = function(self)
|
2021-04-05 02:46:44 +03:00
|
|
|
if self.state == "attack" and vector.distance(self.object:get_pos(), self.attack:get_pos()) < 1.2 then
|
|
|
|
mcl_burning.set_on_fire(self.attack, 5)
|
2021-04-05 02:32:58 +03:00
|
|
|
end
|
|
|
|
local pos = self.object:get_pos()
|
|
|
|
minetest.add_particle({
|
|
|
|
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2},
|
|
|
|
velocity = {x=0, y=math.random(1,1), z=0},
|
|
|
|
expirationtime = math.random(),
|
|
|
|
size = math.random(1, 4),
|
|
|
|
collisiondetection = true,
|
|
|
|
vertical = false,
|
|
|
|
texture = "mcl_particles_smoke_anim.png^[colorize:#2c2c2c:255",
|
|
|
|
animation = {
|
|
|
|
type = "vertical_frames",
|
|
|
|
aspect_w = 8,
|
|
|
|
aspect_h = 8,
|
|
|
|
length = 2.05,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.add_particle({
|
|
|
|
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2},
|
|
|
|
velocity = {x=0, y=math.random(1,1), z=0},
|
|
|
|
expirationtime = math.random(),
|
|
|
|
size = math.random(1, 4),
|
|
|
|
collisiondetection = true,
|
|
|
|
vertical = false,
|
|
|
|
texture = "mcl_particles_smoke_anim.png^[colorize:#424242:255",
|
|
|
|
animation = {
|
|
|
|
type = "vertical_frames",
|
|
|
|
aspect_w = 8,
|
|
|
|
aspect_h = 8,
|
|
|
|
length = 2.05,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
minetest.add_particle({
|
|
|
|
pos = {x=pos.x+math.random(-0.7,0.7)*math.random()/2,y=pos.y+math.random(0.7,1.2),z=pos.z+math.random(-0.7,0.7)*math.random()/2},
|
|
|
|
velocity = {x=0, y=math.random(1,1), z=0},
|
|
|
|
expirationtime = math.random(),
|
|
|
|
size = math.random(1, 4),
|
|
|
|
collisiondetection = true,
|
|
|
|
vertical = false,
|
|
|
|
texture = "mcl_particles_smoke_anim.png^[colorize:#0f0f0f:255",
|
|
|
|
animation = {
|
|
|
|
type = "vertical_frames",
|
|
|
|
aspect_w = 8,
|
|
|
|
aspect_h = 8,
|
|
|
|
length = 2.05,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end,
|
2017-07-05 04:15:46 +03:00
|
|
|
})
|
|
|
|
|
2021-04-07 19:47:40 +03:00
|
|
|
mobs:spawn_specific("mobs_mc:blaze", "nether", "ground", 0, minetest.LIGHT_MAX+1, 30, 5000, 3, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max)
|
2017-08-16 23:08:17 +03:00
|
|
|
|
2017-07-05 04:15:46 +03:00
|
|
|
-- Blaze fireball
|
|
|
|
mobs:register_arrow("mobs_mc:blaze_fireball", {
|
|
|
|
visual = "sprite",
|
|
|
|
visual_size = {x = 0.3, y = 0.3},
|
|
|
|
textures = {"mcl_fire_fire_charge.png"},
|
2019-12-10 02:16:09 +03:00
|
|
|
velocity = 15,
|
2017-07-05 04:15:46 +03:00
|
|
|
|
|
|
|
-- Direct hit, no fire... just plenty of pain
|
|
|
|
hit_player = function(self, player)
|
2020-11-13 14:21:36 +03:00
|
|
|
if rawget(_G, "armor") and armor.last_damage_types then
|
|
|
|
armor.last_damage_types[player:get_player_name()] = "fireball"
|
|
|
|
end
|
2021-02-22 12:55:14 +03:00
|
|
|
mcl_burning.set_on_fire(player, 5, "blaze")
|
2017-07-05 04:15:46 +03:00
|
|
|
player:punch(self.object, 1.0, {
|
|
|
|
full_punch_interval = 1.0,
|
|
|
|
damage_groups = {fleshy = 5},
|
|
|
|
}, nil)
|
|
|
|
end,
|
|
|
|
|
2019-03-11 15:25:06 +03:00
|
|
|
hit_mob = function(self, mob)
|
2021-02-22 12:55:14 +03:00
|
|
|
mcl_burning.set_on_fire(mob, 5)
|
2019-03-11 15:25:06 +03:00
|
|
|
mob:punch(self.object, 1.0, {
|
2017-07-05 04:15:46 +03:00
|
|
|
full_punch_interval = 1.0,
|
|
|
|
damage_groups = {fleshy = 5},
|
|
|
|
}, nil)
|
|
|
|
end,
|
|
|
|
|
2020-01-31 01:11:16 +03:00
|
|
|
hit_object = function(self, object)
|
|
|
|
local lua = object:get_luaentity()
|
|
|
|
if lua then
|
|
|
|
if lua.name == "mcl_minecarts:tnt_minecart" then
|
|
|
|
lua:on_activate_by_rail(2)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
|
2017-07-05 04:15:46 +03:00
|
|
|
-- Node hit, make fire
|
|
|
|
hit_node = function(self, pos, node)
|
2017-09-19 18:16:04 +03:00
|
|
|
if node.name == "air" then
|
2017-07-05 04:15:46 +03:00
|
|
|
minetest.set_node(pos_above, {name=mobs_mc.items.fire})
|
2017-09-19 18:16:04 +03:00
|
|
|
else
|
2019-03-06 06:38:57 +03:00
|
|
|
local v = self.object:get_velocity()
|
2017-09-19 18:16:04 +03:00
|
|
|
v = vector.normalize(v)
|
|
|
|
local crashpos = vector.subtract(pos, v)
|
|
|
|
local crashnode = minetest.get_node(crashpos)
|
|
|
|
-- Set fire if node is air, or a replacable flammable node (e.g. a plant)
|
|
|
|
if crashnode.name == "air" or
|
|
|
|
(minetest.registered_nodes[crashnode.name].buildable_to and minetest.get_item_group(crashnode.name, "flammable") >= 1) then
|
|
|
|
minetest.set_node(crashpos, {name=mobs_mc.items.fire})
|
|
|
|
end
|
2017-07-05 04:15:46 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
-- spawn eggs
|
|
|
|
mobs:register_egg("mobs_mc:blaze", S("Blaze"), "mobs_mc_spawn_icon_blaze.png", 0)
|