2017-07-05 03:15:46 +02:00
|
|
|
--MCmobs v0.4
|
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
|
|
|
-- intllib
|
|
|
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
|
|
local S, NS = dofile(MP.."/intllib.lua")
|
|
|
|
|
|
|
|
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
|
|
|
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### SKELETON
|
|
|
|
--###################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local skeleton = {
|
|
|
|
type = "monster",
|
|
|
|
hp_min = 20,
|
|
|
|
hp_max = 20,
|
|
|
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
|
|
|
|
pathfinding = 1,
|
|
|
|
group_attack = true,
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_skeleton.b3d",
|
2018-05-30 16:59:27 +02:00
|
|
|
textures = { {
|
|
|
|
"mcl_bows_bow_0.png", -- bow
|
|
|
|
"mobs_mc_skeleton.png", -- skeleton
|
|
|
|
} },
|
2017-07-05 03:15:46 +02:00
|
|
|
visual_size = {x=3, y=3},
|
|
|
|
makes_footstep_sound = true,
|
|
|
|
sounds = {
|
2018-09-14 15:58:31 +02:00
|
|
|
random = "mobs_mc_skeleton_random",
|
|
|
|
death = "mobs_mc_skeleton_death",
|
|
|
|
damage = "mobs_mc_skeleton_hurt",
|
2018-09-14 16:05:47 +02:00
|
|
|
shoot_attack = "mcl_bows_bow_shoot",
|
2017-07-05 03:15:46 +02:00
|
|
|
distance = 16,
|
|
|
|
},
|
|
|
|
walk_velocity = 1.2,
|
|
|
|
run_velocity = 2.4,
|
|
|
|
damage = 2,
|
2017-07-26 00:26:18 +02:00
|
|
|
reach = 2,
|
2017-07-05 03:15:46 +02:00
|
|
|
drops = {
|
|
|
|
{name = mobs_mc.items.arrow,
|
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
|
|
|
max = 2,},
|
|
|
|
{name = mobs_mc.items.bow,
|
|
|
|
chance = 11,
|
|
|
|
min = 1,
|
|
|
|
max = 1,},
|
|
|
|
{name = mobs_mc.items.bone,
|
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
|
|
|
max = 2,},
|
2017-07-06 00:43:34 +02:00
|
|
|
|
|
|
|
-- Head
|
|
|
|
-- TODO: Only drop if killed by charged creeper
|
|
|
|
{name = mobs_mc.items.head_skeleton,
|
|
|
|
chance = 200, -- 0.5% chance
|
|
|
|
min = 1,
|
2017-07-05 03:15:46 +02:00
|
|
|
max = 1,},
|
|
|
|
},
|
|
|
|
animation = {
|
2018-05-30 17:11:07 +02:00
|
|
|
stand_speed = 15,
|
2017-07-05 03:15:46 +02:00
|
|
|
stand_start = 0,
|
|
|
|
stand_end = 40,
|
2018-05-30 17:11:07 +02:00
|
|
|
walk_speed = 15,
|
2017-07-05 03:15:46 +02:00
|
|
|
walk_start = 40,
|
|
|
|
walk_end = 60,
|
2017-07-26 17:04:34 +02:00
|
|
|
run_speed = 30,
|
2018-05-30 17:11:07 +02:00
|
|
|
shoot_start = 70,
|
|
|
|
shoot_end = 90,
|
|
|
|
die_start = 160,
|
|
|
|
die_end = 170,
|
|
|
|
die_speed = 15,
|
|
|
|
die_loop = false,
|
2017-07-05 03:15:46 +02:00
|
|
|
},
|
|
|
|
water_damage = 1,
|
|
|
|
lava_damage = 4,
|
2018-05-31 03:09:27 +02:00
|
|
|
sunlight_damage = 1,
|
2017-07-05 03:15:46 +02:00
|
|
|
view_range = 16,
|
|
|
|
fear_height = 4,
|
|
|
|
attack_type = "dogshoot",
|
|
|
|
arrow = "mobs_mc:arrow_entity",
|
|
|
|
shoot_interval = 2.5,
|
|
|
|
shoot_offset = 1,
|
|
|
|
dogshoot_switch = 1,
|
|
|
|
dogshoot_count_max =1.8,
|
|
|
|
blood_amount = 0,
|
|
|
|
}
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:skeleton", skeleton)
|
|
|
|
|
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### STRAY
|
|
|
|
--###################
|
|
|
|
|
|
|
|
local stray = table.copy(skeleton)
|
|
|
|
stray.mesh = "mobs_mc_stray.b3d"
|
|
|
|
stray.textures = {
|
2018-05-30 16:59:27 +02:00
|
|
|
{
|
|
|
|
"mcl_bows_bow_0.png",
|
|
|
|
"mobs_mc_stray.png",
|
|
|
|
"mobs_mc_stray_overlay.png",
|
|
|
|
},
|
2017-07-05 03:15:46 +02:00
|
|
|
}
|
|
|
|
-- TODO: different sound (w/ echo)
|
|
|
|
-- TODO: stray's arrow inflicts slowness status
|
|
|
|
table.insert(stray.drops, {
|
|
|
|
-- Chance to drop additional arrow.
|
|
|
|
-- TODO: Should be tipped arrow of slowness
|
|
|
|
name = mobs_mc.items.arrow,
|
|
|
|
chance = 2,
|
|
|
|
min = 1,
|
|
|
|
max = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:stray", stray)
|
|
|
|
|
|
|
|
-- compatibility
|
|
|
|
mobs:alias_mob("mobs:skeleton", "mobs_mc:skeleton")
|
|
|
|
|
2017-08-16 22:08:17 +02:00
|
|
|
-- Overworld spawn
|
|
|
|
mobs:spawn_specific("mobs_mc:skeleton", mobs_mc.spawn.solid, {"air"}, 0, 7, 20, 17000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
|
|
|
|
-- Nether spawn
|
|
|
|
mobs:spawn_specific("mobs_mc:skeleton", mobs_mc.spawn.nether_fortress, {"air"}, 0, 7, 30, 10000, 3, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max)
|
|
|
|
|
|
|
|
-- Stray spawn
|
2017-07-05 03:15:46 +02:00
|
|
|
-- TODO: Spawn directly under the sky
|
2017-08-16 22:08:17 +02:00
|
|
|
mobs:spawn_specific("mobs_mc:stray", mobs_mc.spawn.snow, {"air"}, 0, 7, 20, 19000, 2, mobs_mc.spawn_height.water, mobs_mc.spawn_height.overworld_max)
|
|
|
|
|
2017-07-05 03:15:46 +02:00
|
|
|
|
|
|
|
-- spawn eggs
|
|
|
|
mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "mobs_mc_spawn_icon_skeleton.png", 0)
|
|
|
|
mobs:register_egg("mobs_mc:stray", S("Stray"), "mobs_mc_spawn_icon_stray.png", 0)
|
|
|
|
|
|
|
|
if minetest.settings:get_bool("log_mods") then
|
|
|
|
minetest.log("action", "MC Skeleton loaded")
|
|
|
|
end
|