forked from VoxeLibre/VoxeLibre
Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
|
36ad5a9ee9 | |
|
a03ca6cf76 | |
|
a9c8fdc616 | |
|
13f39cbf8d | |
|
f0fd0cd6aa |
|
@ -114,6 +114,7 @@ dofile(path .. "/squid.lua") -- Animation, sound and egg texture by daufinsyd
|
|||
dofile(path .. "/villager.lua") -- KrupnoPavel Mesh and animation by toby109tt / https://github.com/22i
|
||||
|
||||
-- Illagers and witch
|
||||
dofile(path .. "/pillager.lua") -- Mesh by KrupnoPavel and MrRar, animation by MrRar
|
||||
dofile(path .. "/villager_evoker.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/villager_vindicator.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/villager_zombie.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
|
|
|
@ -65,3 +65,4 @@ Nitwit=
|
|||
Cod=
|
||||
Salmon=
|
||||
Dolphin=
|
||||
Pillager=
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,162 @@
|
|||
local S = minetest.get_translator("mobs_mc")
|
||||
local mod_bows = minetest.get_modpath("mcl_bows") ~= nil
|
||||
|
||||
local function reload(self)
|
||||
if not self or not self.object then return end
|
||||
minetest.sound_play("mcl_bows_crossbow_drawback_1", {object = self.object, max_hear_distance=16}, true)
|
||||
local props = self.object:get_properties()
|
||||
if not props then return end
|
||||
props.textures[2] = "mcl_bows_crossbow_3.png^[resize:16x16"
|
||||
self.object:set_properties(props)
|
||||
end
|
||||
|
||||
local function reset_animation(self, animation)
|
||||
if not self or not self.object or self.current_animation ~= animation then return end
|
||||
self.animation.current = "stand_reload" -- Mobs Redo won't set the animation unless we do this
|
||||
mcl_mobs:set_animation(self, animation)
|
||||
end
|
||||
|
||||
pillager = {
|
||||
description = S("Pillager"),
|
||||
type = "monster",
|
||||
spawn_class = "hostile",
|
||||
hostile = true,
|
||||
rotate = 0,
|
||||
hp_min = 24,
|
||||
hp_max = 24,
|
||||
xp_min = 6,
|
||||
xp_max = 6,
|
||||
breath_max = -1,
|
||||
eye_height = 1.5,
|
||||
projectile_cooldown = 3, -- Useless
|
||||
shoot_interval = 3, -- Useless
|
||||
shoot_offset = 1.5,
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max = 1.8,
|
||||
projectile_cooldown_min = 3,
|
||||
projectile_cooldown_max = 2.5,
|
||||
armor = {fleshy = 100},
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
|
||||
pathfinding = 1,
|
||||
group_attack = true,
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_pillager.b3d",
|
||||
|
||||
--head code
|
||||
has_head = false,
|
||||
head_bone = "head",
|
||||
|
||||
swap_y_with_x = true,
|
||||
reverse_head_yaw = true,
|
||||
|
||||
head_bone_pos_y = 2.4,
|
||||
head_bone_pos_z = 0,
|
||||
|
||||
head_height_offset = 1.1,
|
||||
head_direction_offset = 0,
|
||||
head_pitch_modifier = 0,
|
||||
--end head code
|
||||
|
||||
visual_size = {x=2.75, y=2.75},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1.2,
|
||||
run_velocity = 4,
|
||||
damage = 2,
|
||||
reach = 8,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
attack_type = "shoot",
|
||||
arrow = "mcl_bows:arrow_entity",
|
||||
sounds = {
|
||||
random = "mobs_mc_pillager_grunt2",
|
||||
war_cry = "mobs_mc_pillager_grunt1",
|
||||
death = "mobs_mc_pillager_ow2",
|
||||
damage = "mobs_mc_pillager_ow1",
|
||||
distance = 16,
|
||||
},
|
||||
textures = {
|
||||
{
|
||||
"mobs_mc_pillager.png", -- Skin
|
||||
"mcl_bows_crossbow_3.png^[resize:16x16", -- Wielded item
|
||||
}
|
||||
},
|
||||
drops = {
|
||||
{
|
||||
name = "mcl_bows:arrow",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,
|
||||
looting = "common",
|
||||
},
|
||||
{
|
||||
name = "mcl_bows:crossbow",
|
||||
chance = 100 / 8.5,
|
||||
min = 1,
|
||||
max = 1,
|
||||
looting = "rare",
|
||||
},
|
||||
},
|
||||
animation = {
|
||||
unloaded_walk_start = 1,
|
||||
unloaded_walk_end = 40,
|
||||
unloaded_stand_start = 41,
|
||||
unloaded_stand_end = 60,
|
||||
|
||||
reload_stand_speed = 20,
|
||||
reload_stand_start = 61,
|
||||
reload_stand_end = 100,
|
||||
|
||||
stand_speed = 6,
|
||||
stand_start = 101,
|
||||
stand_end = 109,
|
||||
|
||||
walk_speed = 25,
|
||||
walk_start = 111,
|
||||
walk_end = 150,
|
||||
run_speed = 40,
|
||||
run_start = 111,
|
||||
run_end = 150,
|
||||
|
||||
reload_run_speed = 20,
|
||||
reload_run_start = 151,
|
||||
reload_run_end = 190,
|
||||
|
||||
die_speed = 15,
|
||||
die_start = 191,
|
||||
die_end = 192,
|
||||
die_loop = false,
|
||||
|
||||
stand_unloaded_start = 40,
|
||||
stand_unloaded_end = 59,
|
||||
},
|
||||
shoot_arrow = function(self, pos, dir)
|
||||
minetest.sound_play("mcl_bows_crossbow_shoot", {object = self.object, max_hear_distance=16}, true)
|
||||
local props = self.object:get_properties()
|
||||
props.textures[2] = "mcl_bows_crossbow_0.png^[resize:16x16"
|
||||
self.object:set_properties(props)
|
||||
local old_anim = self.animation.current
|
||||
if old_anim == "run" then
|
||||
mcl_mobs:set_animation(self, "reload_run")
|
||||
end
|
||||
if old_anim == "stand" then
|
||||
mcl_mobs:set_animation(self, "reload_stand")
|
||||
end
|
||||
self.animation.current = old_anim -- Mobs Redo will imediately reset the animation otherwise
|
||||
minetest.after(1, reload, self)
|
||||
minetest.after(2, reset_animation, self, old_anim)
|
||||
if mod_bows then
|
||||
-- 2-4 damage per arrow
|
||||
local dmg = math.max(4, math.random(2, 8))
|
||||
mcl_bows_s.shoot_arrow_crossbow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
|
||||
end
|
||||
|
||||
-- While we are at it, change the sounds since there is no way to do this in Mobs Redo
|
||||
if self.sounds and self.sounds.random then
|
||||
self.sounds = table.copy(self.sounds)
|
||||
self.sounds.random = "mobs_mc_pillager_grunt" .. math.random(2)
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
mcl_mobs:register_mob("mobs_mc:pillager", pillager)
|
||||
mcl_mobs:register_egg("mobs_mc:pillager", S("Pillager"), "mobs_mc_spawn_icon_pillager.png", 0)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 477 B |
|
@ -57,11 +57,25 @@ mcl_structures.register_structure("pillager_outpost",{
|
|||
after_place = function(p,def,pr)
|
||||
local p1 = vector.offset(p,-7,0,-7)
|
||||
local p2 = vector.offset(p,7,14,7)
|
||||
local spawnon = {"mcl_core:stripped_oak"}
|
||||
local sp = minetest.find_nodes_in_area_under_air(p1,p2,spawnon)
|
||||
for _,n in pairs(minetest.find_nodes_in_area(p1,p2,{"group:wall"})) do
|
||||
local def = minetest.registered_nodes[minetest.get_node(n).name:gsub("_%d+$","")]
|
||||
if def and def.on_construct then
|
||||
def.on_construct(n)
|
||||
end
|
||||
end
|
||||
if sp and #sp > 0 then
|
||||
for i=1,5 do
|
||||
local pos = sp[pr:next(1,#sp)]
|
||||
if pos then
|
||||
minetest.add_entity(pos,"mobs_mc:pillager")
|
||||
end
|
||||
end
|
||||
local pos = sp[pr:next(1,#sp)]
|
||||
if pos then
|
||||
minetest.add_entity(pos,"mobs_mc:evoker")
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue