2017-07-05 01:15:46 +00:00
|
|
|
--MCmobs v0.4
|
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
2019-03-07 19:43:39 +00:00
|
|
|
local S = minetest.get_translator("mobs_mc")
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### ZOMBIE PIGMAN
|
|
|
|
--###################
|
|
|
|
|
|
|
|
|
|
|
|
local pigman = {
|
|
|
|
-- type="animal", passive=false: This combination is needed for a neutral mob which becomes hostile, if attacked
|
|
|
|
type = "animal",
|
|
|
|
passive = false,
|
2020-04-11 00:46:03 +00:00
|
|
|
spawn_class = "passive",
|
2017-07-05 01:15:46 +00:00
|
|
|
hp_min = 20,
|
|
|
|
hp_max = 20,
|
2020-12-06 14:46:42 +00:00
|
|
|
xp_min = 6,
|
|
|
|
xp_max = 6,
|
2020-11-09 17:59:08 +00:00
|
|
|
armor = {undead = 90, fleshy = 90},
|
2017-07-05 01:15:46 +00:00
|
|
|
attack_type = "dogfight",
|
2019-03-09 00:50:00 +00:00
|
|
|
group_attack = { "mobs_mc:pigman", "mobs_mc:baby_pigman" },
|
2017-07-05 01:15:46 +00:00
|
|
|
damage = 9,
|
2017-07-25 22:26:18 +00:00
|
|
|
reach = 2,
|
2017-07-05 01:15:46 +00:00
|
|
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "mobs_mc_zombie_pigman.b3d",
|
2018-05-30 14:59:27 +00:00
|
|
|
textures = { {
|
2018-05-30 14:41:28 +00:00
|
|
|
"blank.png", --baby
|
|
|
|
"default_tool_goldsword.png", --sword
|
|
|
|
"mobs_mc_zombie_pigman.png", --pigman
|
2018-05-30 14:59:27 +00:00
|
|
|
} },
|
2017-07-05 01:15:46 +00:00
|
|
|
visual_size = {x=3, y=3},
|
|
|
|
sounds = {
|
2020-12-07 00:22:28 +00:00
|
|
|
random = "mobs_mc_zombiepig_random",
|
|
|
|
war_cry = "mobs_mc_zombiepig_war_cry",
|
|
|
|
death = "mobs_mc_zombiepig_death",
|
|
|
|
damage = "mobs_mc_zombiepig_hurt",
|
2017-07-05 01:15:46 +00:00
|
|
|
distance = 16,
|
|
|
|
},
|
|
|
|
jump = true,
|
|
|
|
makes_footstep_sound = true,
|
|
|
|
walk_velocity = .8,
|
|
|
|
run_velocity = 2.6,
|
|
|
|
pathfinding = 1,
|
|
|
|
drops = {
|
|
|
|
{name = mobs_mc.items.rotten_flesh,
|
|
|
|
chance = 1,
|
|
|
|
min = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "common"},
|
2017-07-05 01:15:46 +00:00
|
|
|
{name = mobs_mc.items.gold_nugget,
|
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "common"},
|
2017-07-05 01:15:46 +00:00
|
|
|
{name = mobs_mc.items.gold_ingot,
|
|
|
|
chance = 40, -- 2.5%
|
|
|
|
min = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "rare"},
|
2017-07-05 01:15:46 +00:00
|
|
|
{name = mobs_mc.items.gold_sword,
|
2020-12-23 16:41:42 +00:00
|
|
|
chance = 100 / 8.5,
|
2017-07-05 01:15:46 +00:00
|
|
|
min = 1,
|
2020-12-23 16:41:42 +00:00
|
|
|
max = 1,
|
|
|
|
looting = "rare"},
|
2017-07-05 01:15:46 +00:00
|
|
|
},
|
|
|
|
animation = {
|
2018-05-30 14:41:28 +00:00
|
|
|
stand_speed = 25,
|
|
|
|
walk_speed = 25,
|
|
|
|
run_speed = 50,
|
|
|
|
stand_start = 40,
|
|
|
|
stand_end = 80,
|
|
|
|
walk_start = 0,
|
|
|
|
walk_end = 40,
|
|
|
|
run_start = 0,
|
|
|
|
run_end = 40,
|
|
|
|
punch_start = 90,
|
|
|
|
punch_end = 130,
|
2017-07-05 01:15:46 +00:00
|
|
|
},
|
|
|
|
lava_damage = 0,
|
2019-10-02 16:43:48 +00:00
|
|
|
fire_damage = 0,
|
2017-07-05 01:15:46 +00:00
|
|
|
fear_height = 4,
|
|
|
|
view_range = 16,
|
2020-07-12 20:56:41 +00:00
|
|
|
harmed_by_heal = true,
|
2020-12-29 21:08:38 +00:00
|
|
|
fire_damage_resistant = true,
|
2017-07-05 01:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:pigman", pigman)
|
|
|
|
|
|
|
|
-- Baby pigman.
|
|
|
|
-- A smaller and more dangerous variant of the pigman
|
|
|
|
|
|
|
|
local baby_pigman = table.copy(pigman)
|
|
|
|
baby_pigman.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
|
2020-12-06 14:46:42 +00:00
|
|
|
baby_pigman.xp_min = 13
|
|
|
|
baby_pigman.xp_max = 13
|
2017-08-16 20:08:17 +00:00
|
|
|
baby_pigman.visual_size = {x=pigman.visual_size.x/2, y=pigman.visual_size.y/2}
|
2018-05-30 14:59:27 +00:00
|
|
|
baby_pigman.textures = { {
|
|
|
|
"mobs_mc_zombie_pigman.png", --baby
|
|
|
|
"default_tool_goldsword.png", --sword
|
|
|
|
"mobs_mc_zombie_pigman.png", --pigman
|
|
|
|
} }
|
2017-07-05 01:15:46 +00:00
|
|
|
baby_pigman.walk_velocity = 1.2
|
|
|
|
baby_pigman.run_velocity = 2.4
|
|
|
|
baby_pigman.light_damage = 0
|
2019-03-08 22:52:41 +00:00
|
|
|
baby_pigman.child = 1
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
mobs:register_mob("mobs_mc:baby_pigman", baby_pigman)
|
|
|
|
|
2017-08-16 20:08:17 +00:00
|
|
|
-- Regular spawning in the Nether
|
|
|
|
mobs:spawn_specific("mobs_mc:pigman", mobs_mc.spawn.solid, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max)
|
2017-07-05 01:15:46 +00:00
|
|
|
-- Baby zombie is 20 times less likely than regular zombies
|
2017-08-16 20:08:17 +00:00
|
|
|
mobs:spawn_specific("mobs_mc:baby_pigman", mobs_mc.spawn.solid, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 100000, 4, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
2017-08-16 20:08:17 +00:00
|
|
|
-- Spawning in Nether portals in the Overworld
|
|
|
|
mobs:spawn_specific("mobs_mc:pigman", mobs_mc.spawn.nether_portal, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 500, 4, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
|
2017-07-05 01:15:46 +00:00
|
|
|
|
|
|
|
-- spawn eggs
|
|
|
|
mobs:register_egg("mobs_mc:pigman", S("Zombie Pigman"), "mobs_mc_spawn_icon_zombie_pigman.png", 0)
|