1
0
Fork 0
MineClone2/mods/ENTITIES/mobs_mc/slimes.lua

447 lines
11 KiB
Lua
Raw Normal View History

--MCmobs v0.2
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
--dofile(minetest.get_modpath("mobs").."/api.lua")
mobs:register_mob("mobs_mc:greensmall", {
type = "monster",
2017-03-03 00:27:10 +00:00
pathfinding = 1,
group_attack = true,
2017-01-20 20:24:56 +00:00
hp_min = 1,
2017-01-16 19:52:09 +00:00
hp_max = 1,
2017-02-22 20:55:25 +00:00
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
visual_size = {x=0.6, y=0.6},
textures = {
{"green_slime_top.png", "green_slime_bottom.png", "green_slime_front.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png"}
},
visual = "cube",
blood_texture ="green_slime_blood.png",
rotate = 270,
makes_footstep_sound = true,
sounds = {
jump = "green_slime_jump",
death = "green_slime_death",
damage = "green_slime_damage",
attack = "green_slime_attack",
},
2017-02-23 23:29:05 +00:00
-- FIXME: The tiny slimes deal damage although this number is set to 0. Strange.
2017-01-16 19:52:09 +00:00
damage = 0,
reach = 2.5,
armor = 100,
drops = {
2017-02-11 21:05:14 +00:00
{name = "mcl_mobitems:slimeball",
chance = 1,
2017-01-16 19:52:09 +00:00
min = 0,
max = 2,},
},
animation = {
speed_normal = 24,
speed_run = 48,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 47,
run_start = 48,
run_end = 62,
hurt_start = 64,
hurt_end = 86,
death_start = 88,
death_end = 118,
},
drawtype = "front",
water_damage = 0,
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
light_damage = 0,
fall_damage = 0,
view_range = 16,
attack_type = "dogfight",
passive = false,
jump = true,
2017-02-23 23:29:05 +00:00
walk_velocity = 0.7,
run_velocity = 0.7,
walk_chance = 0,
jump_height = 3,
jump_chance = 98,
2017-02-24 00:03:50 +00:00
fear_height = 12,
})
mobs:register_mob("mobs_mc:greenmedium", {
type = "monster",
2017-03-03 00:27:10 +00:00
pathfinding = 1,
group_attack = true,
2017-01-20 20:24:56 +00:00
hp_min = 4,
2017-01-16 19:52:09 +00:00
hp_max = 4,
2017-02-22 20:55:25 +00:00
collisionbox = {-0.6, -0.6, -0.6, 0.6, 0.6, 0.6},
visual_size = {x=1.2, y=1.2},
textures = {
{"green_slime_top.png", "green_slime_bottom.png", "green_slime_front.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png"}
},
visual = "cube",
blood_texture ="green_slime_blood.png",
rotate = 270,
makes_footstep_sound = true,
sounds = {
jump = "green_slime_jump",
death = "green_slime_death",
damage = "green_slime_damage",
attack = "green_slime_attack",
},
damage = 2,
reach = 2.75,
armor = 100,
2017-01-16 19:52:09 +00:00
drops = {},
animation = {
speed_normal = 24,
speed_run = 48,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 47,
run_start = 48,
run_end = 62,
hurt_start = 64,
hurt_end = 86,
death_start = 88,
death_end = 118,
},
drawtype = "front",
water_damage = 0,
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
light_damage = 0,
fall_damage = 0,
view_range = 16,
attack_type = "dogfight",
passive = false,
jump = true,
2017-02-23 23:29:05 +00:00
walk_chance = 0,
walk_velocity = 1.3,
run_velocity = 1.3,
jump_height = 4.3,
jump_chance = 100,
fear_height = 60,
2017-02-22 20:49:56 +00:00
on_die = function(self, pos)
local angle, posadd, dir
2017-02-22 20:49:56 +00:00
angle = math.random(0, math.pi*2)
2017-01-24 01:31:49 +00:00
for i=1,4 do
dir = {x=math.cos(angle),y=0,z=math.sin(angle)}
posadd = vector.multiply(vector.normalize(dir), 0.6)
local slime = minetest.add_entity(vector.add(pos, posadd), "mobs_mc:greensmall")
slime:setvelocity(dir)
slime:setyaw(angle)
2017-02-22 20:49:56 +00:00
angle = angle + math.pi/2
2017-01-24 01:31:49 +00:00
end
end
})
mobs:register_mob("mobs_mc:greenbig", {
type = "monster",
2017-03-03 00:27:10 +00:00
pathfinding = 1,
group_attack = true,
2017-01-20 20:24:56 +00:00
hp_min = 16,
2017-01-16 19:52:09 +00:00
hp_max = 16,
2017-02-22 20:55:25 +00:00
collisionbox = {-1.2, -1.2, -1.2, 1.2, 1.2, 1.2},
visual_size = {x=2.4, y=2.4},
textures = {
{"green_slime_top.png", "green_slime_bottom.png", "green_slime_front.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png"}
},
visual = "cube",
blood_texture ="green_slime_blood.png",
rotate = 270,
makes_footstep_sound = true,
sounds = {
jump = "green_slime_jump",
death = "green_slime_death",
damage = "green_slime_damage",
attack = "green_slime_attack",
},
2017-01-16 19:52:09 +00:00
damage = 4,
reach = 3,
armor = 100,
2017-01-16 19:52:09 +00:00
drops = {},
animation = {
speed_normal = 24,
speed_run = 48,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 47,
run_start = 48,
run_end = 62,
hurt_start = 64,
hurt_end = 86,
death_start = 88,
death_end = 118,
},
drawtype = "front",
water_damage = 0,
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
light_damage = 0,
fall_damage = 0,
view_range = 16,
attack_type = "dogfight",
passive = false,
jump = true,
2017-02-23 23:29:05 +00:00
walk_velocity = 2.5,
run_velocity = 2.5,
walk_chance = 0,
jump_height = 5.2,
jump_chance = 100,
fear_height = 60,
2017-01-24 01:31:49 +00:00
on_die = function(self, pos)
2017-02-22 20:49:56 +00:00
local angle, posadd
angle = math.random(0, math.pi*2)
2017-02-23 23:29:05 +00:00
for i=1,4 do
2017-02-22 20:49:56 +00:00
posadd = {x=math.cos(angle),y=0,z=math.sin(angle)}
posadd = vector.normalize(posadd)
local slime = minetest.add_entity(vector.add(pos, posadd), "mobs_mc:greenmedium")
slime:setvelocity(vector.multiply(posadd, 1.5))
slime:setyaw(angle)
2017-02-23 23:29:05 +00:00
angle = angle + math.pi/2
2017-01-24 01:31:49 +00:00
end
end,
})
2017-02-20 02:00:03 +00:00
mobs:register_spawn("mobs_mc:greensmall", {"mcl_core:water_flowing", "group:solid"}, 15, 0, 5000, 4, -12)
mobs:register_spawn("mobs_mc:greenmedium", {"mcl_core:water_flowing", "group:solid"}, 15, 0, 5000, 4, -12)
mobs:register_spawn("mobs_mc:greenbig", {"mcl_core:water_flowing", "group:solid"}, 15, 0, 5000, 4, -12)
mobs:register_mob("mobs_mc:lavasmall", {
type = "monster",
2017-03-03 00:27:10 +00:00
pathfinding = 1,
2017-02-24 00:03:50 +00:00
group_attack = true,
hp_min = 1,
hp_max = 1,
collisionbox = {-0.2505, -0.2505, -0.2505, 0.2505, 0.2505, 0.2505},
visual_size = {x=0.51, y=0.51},
textures = {
{"lava_slime_top.png", "lava_slime_bottom.png", "lava_slime_front.png", "lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png"}
},
visual = "cube",
blood_texture ="lava_slime_blood.png",
rotate = 270,
makes_footstep_sound = true,
sounds = {
jump = "green_slime_jump",
death = "green_slime_death",
damage = "green_slime_damage",
attack = "green_slime_attack",
},
walk_velocity = 1.02,
run_velocity = 1.02,
damage = 3,
reach = 2.5,
2017-02-24 00:03:50 +00:00
armor = 85,
drops = {},
animation = {
speed_normal = 24,
speed_run = 48,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 47,
run_start = 48,
run_end = 62,
hurt_start = 64,
hurt_end = 86,
death_start = 88,
death_end = 118,
},
drawtype = "front",
water_damage = 0,
lava_damage = 0,
light_damage = 0,
fall_damage = 0,
view_range = 16,
attack_type = "dogfight",
passive = false,
jump = true,
jump_height = 4,
walk_chance = 0,
jump_chance = 80,
fear_height = 100000,
})
mobs:register_mob("mobs_mc:lavamedium", {
type = "monster",
2017-03-03 00:27:10 +00:00
pathfinding = 1,
group_attack = true,
2017-01-20 20:24:56 +00:00
hp_min = 4,
2017-01-16 19:52:09 +00:00
hp_max = 4,
2017-02-24 00:03:50 +00:00
collisionbox = {-0.51, -0.51, -0.51, 0.51, 0.51, 0.51},
visual_size = {x=1.01, y=1.01},
textures = {
{"lava_slime_top.png", "lava_slime_bottom.png", "lava_slime_front.png", "lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png"}
},
visual = "cube",
blood_texture ="lava_slime_blood.png",
rotate = 270,
makes_footstep_sound = true,
sounds = {
jump = "green_slime_jump",
death = "green_slime_death",
damage = "green_slime_damage",
attack = "green_slime_attack",
},
walk_velocity = .8,
run_velocity = 2.6,
2017-02-24 00:03:50 +00:00
damage = 4,
reach = 2.75,
2017-02-24 00:03:50 +00:00
armor = 70,
drops = {
{name = "mcl_mobitems:magma_cream",
chance = 4,
min = 1,
max = 1,},
},
animation = {
speed_normal = 24,
speed_run = 48,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 47,
run_start = 48,
run_end = 62,
hurt_start = 64,
hurt_end = 86,
death_start = 88,
death_end = 118,
},
drawtype = "front",
water_damage = 0,
lava_damage = 0,
light_damage = 0,
fall_damage = 0,
view_range = 16,
attack_type = "dogfight",
passive = false,
jump = true,
jump_height = 4,
2017-02-24 00:03:50 +00:00
walk_chance = 0,
jump_chance = 98,
2017-02-24 00:03:50 +00:00
fear_height = 100000,
on_die = function(self, pos)
local angle, posadd, dir
2017-02-24 00:03:50 +00:00
angle = math.random(0, math.pi*2)
for i=1,4 do
dir = vector.normalize({x=math.cos(angle),y=0,z=math.sin(angle)})
posadd = vector.multiply(dir, 0.6)
local mob = minetest.add_entity(vector.add(pos, posadd), "mobs_mc:lavasmall")
mob:setvelocity(dir)
mob:setyaw(angle)
2017-02-24 00:03:50 +00:00
angle = angle + math.pi/2
end
end
})
2017-02-24 00:03:50 +00:00
mobs:register_mob("mobs_mc:lavabig", {
type = "monster",
2017-03-03 00:27:10 +00:00
pathfinding = 1,
group_attack = true,
2017-01-20 20:24:56 +00:00
hp_min = 16,
2017-01-16 19:52:09 +00:00
hp_max = 16,
2017-02-24 00:03:50 +00:00
collisionbox = {-1.02, -1.02, -1.02, 1.02, 1.02, 1.02},
visual_size = {x=2.04, y=2.04},
textures = {
{"lava_slime_top.png", "lava_slime_bottom.png", "lava_slime_front.png", "lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png"}
},
visual = "cube",
blood_texture ="lava_slime_blood.png",
rotate = 270,
makes_footstep_sound = true,
sounds = {
jump = "green_slime_jump",
death = "green_slime_death",
damage = "green_slime_damage",
attack = "green_slime_attack",
},
2017-02-24 00:03:50 +00:00
walk_velocity = 4,
run_velocity = 4,
damage = 6,
reach = 3,
2017-02-24 00:03:50 +00:00
armor = 40,
drops = {
2017-01-16 19:52:09 +00:00
{name = "mcl_mobitems:magma_cream",
2017-02-20 02:00:03 +00:00
chance = 4,
2017-02-24 00:03:50 +00:00
min = 1,
2017-01-16 19:52:09 +00:00
max = 1,},
},
animation = {
speed_normal = 24,
speed_run = 48,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 47,
run_start = 48,
run_end = 62,
hurt_start = 64,
hurt_end = 86,
death_start = 88,
death_end = 118,
},
drawtype = "front",
water_damage = 0,
lava_damage = 0,
light_damage = 0,
fall_damage = 0,
view_range = 16,
attack_type = "dogfight",
passive = false,
jump = true,
jump_height = 8,
2017-02-24 00:03:50 +00:00
walk_chance = 0,
jump_chance = 100,
2017-02-24 00:03:50 +00:00
fear_height = 100000,
2017-01-24 01:31:49 +00:00
on_die = function(self, pos)
2017-02-22 20:49:56 +00:00
local angle, posadd
angle = math.random(0, math.pi*2)
2017-02-24 00:03:50 +00:00
for i=1,3 do
2017-02-22 20:49:56 +00:00
posadd = {x=math.cos(angle),y=0,z=math.sin(angle)}
2017-02-24 00:03:50 +00:00
posadd = vector.normalize(posadd)
local mob = minetest.add_entity(vector.add(pos, posadd), "mobs_mc:lavamedium")
mob:setvelocity(vector.multiply(posadd, 1.5))
mob:setyaw(angle)
2017-02-24 00:03:50 +00:00
angle = angle + (math.pi*2) / 3
2017-01-24 01:31:49 +00:00
end
end
})
2017-02-24 00:03:50 +00:00
mobs:register_spawn("mobs_mc:lavasmall", {"group:solid"}, 15, 0, 5000, 4, -1000)
mobs:register_spawn("mobs_mc:lavamedium", {"group:solid"}, 15, 0, 5500, 4, -1000)
mobs:register_spawn("mobs_mc:lavabig", {"group:solid"}, 15, 0, 6000, 4, -1000)
mobs:register_spawn("mobs_mc:lavasmall", {"mcl_nether:nether_brick"}, 15, 0, 1000, 4, -1000)
mobs:register_spawn("mobs_mc:lavamedium", {"mcl_nether:nether_brick"}, 15, 0, 1100, 4, -1000)
mobs:register_spawn("mobs_mc:lavabig", {"mcl_nether:nether_brick"}, 15, 0, 1200, 4, -1000)
-- compatibility
mobs:alias_mob("mobs:lavasmall", "mobs_mc:lavasmall")
mobs:alias_mob("mobs:lavabig", "mobs_mc:lavabig")
mobs:alias_mob("mobs:greensmall", "mobs_mc:greensmall")
mobs:alias_mob("mobs:greenmediuml", "mobs_mc:greenmedium")
mobs:alias_mob("mobs:greenbig", "mobs_mc:greenbig")
mobs:alias_mob("slimes:lavasmall", "mobs_mc:lavasmall")
mobs:alias_mob("slimes:lavabig", "mobs_mc:lavabig")
mobs:alias_mob("slimes:greensmall", "mobs_mc:greensmall")
mobs:alias_mob("slimes:greenmediuml", "mobs_mc:greenmedium")
mobs:alias_mob("slimes:greenbig", "mobs_mc:greenbig")
-- spawn eggs
mobs:register_egg("mobs_mc:lavabig", "Spawn Magma Cube", "spawn_egg_magma_cube.png")
2017-02-22 20:55:25 +00:00
mobs:register_egg("mobs_mc:greenbig", "Spawn Slime", "spawn_egg_slime.png")
if minetest.setting_get("log_mods") then
minetest.log("action", "MC Slimes loaded")
end