mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-24 00:49:34 +01:00
looting
This commit is contained in:
parent
a7ff5be28b
commit
da7240d6c1
28 changed files with 188 additions and 87 deletions
|
@ -643,11 +643,13 @@ end
|
||||||
|
|
||||||
|
|
||||||
-- drop items
|
-- drop items
|
||||||
local item_drop = function(self, cooked)
|
local item_drop = function(self, cooked, looting_level)
|
||||||
|
|
||||||
-- no drops if disabled by setting
|
-- no drops if disabled by setting
|
||||||
if not mobs_drop_items then return end
|
if not mobs_drop_items then return end
|
||||||
|
|
||||||
|
looting_level = looting_level or 0
|
||||||
|
|
||||||
-- no drops for child mobs (except monster)
|
-- no drops for child mobs (except monster)
|
||||||
if (self.child and self.type ~= "monster") then
|
if (self.child and self.type ~= "monster") then
|
||||||
return
|
return
|
||||||
|
@ -659,11 +661,33 @@ local item_drop = function(self, cooked)
|
||||||
self.drops = self.drops or {} -- nil check
|
self.drops = self.drops or {} -- nil check
|
||||||
|
|
||||||
for n = 1, #self.drops do
|
for n = 1, #self.drops do
|
||||||
|
local dropdef = self.drops[n]
|
||||||
|
local chance = 1 / dropdef.chance
|
||||||
|
local looting_type = dropdef.looting
|
||||||
|
|
||||||
if random(1, self.drops[n].chance) == 1 then
|
if looting_level > 0 then
|
||||||
|
local chance_function = dropdef.looting_chance_function
|
||||||
|
if chance_function then
|
||||||
|
chance = chance_function(looting_level)
|
||||||
|
elseif looting_type == "rare" then
|
||||||
|
chance = chance + (dropdef.looting_factor or 0.01) * looting_level
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
num = random(self.drops[n].min or 1, self.drops[n].max or 1)
|
local num = 0
|
||||||
item = self.drops[n].name
|
local do_common_looting = (looting_level > 0 and looting_type == "common")
|
||||||
|
if random() < chance then
|
||||||
|
num = random(dropdef.min or 1, dropdef.max or 1)
|
||||||
|
elseif not dropdef.looting_ignore_chance then
|
||||||
|
do_common_looting = false
|
||||||
|
end
|
||||||
|
|
||||||
|
if do_common_looting then
|
||||||
|
num = num + math.floor(math.random(0, looting_level) + 0.5)
|
||||||
|
end
|
||||||
|
|
||||||
|
if num > 0 then
|
||||||
|
item = dropdef.name
|
||||||
|
|
||||||
-- cook items when true
|
-- cook items when true
|
||||||
if cooked then
|
if cooked then
|
||||||
|
|
|
@ -41,7 +41,8 @@ mobs:register_mob("mobs_mc:blaze", {
|
||||||
{name = mobs_mc.items.blaze_rod,
|
{name = mobs_mc.items.blaze_rod,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
stand_speed = 25,
|
stand_speed = 25,
|
||||||
|
|
|
@ -32,11 +32,13 @@ mobs:register_mob("mobs_mc:chicken", {
|
||||||
{name = mobs_mc.items.chicken_raw,
|
{name = mobs_mc.items.chicken_raw,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.feather,
|
{name = mobs_mc.items.feather,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
fall_damage = 0,
|
fall_damage = 0,
|
||||||
fall_speed = -2.25,
|
fall_speed = -2.25,
|
||||||
|
|
|
@ -23,11 +23,13 @@ local cow_def = {
|
||||||
{name = mobs_mc.items.beef_raw,
|
{name = mobs_mc.items.beef_raw,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 3,},
|
max = 3,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.leather,
|
{name = mobs_mc.items.leather,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
runaway = true,
|
runaway = true,
|
||||||
sounds = {
|
sounds = {
|
||||||
|
|
|
@ -78,7 +78,7 @@ mobs:register_mob("mobs_mc:creeper", {
|
||||||
end,
|
end,
|
||||||
on_die = function(self, pos)
|
on_die = function(self, pos)
|
||||||
-- Drop a random music disc
|
-- Drop a random music disc
|
||||||
-- TODO: Only do this if killed by skeleton
|
-- TODO: Only do this if killed by skeleton or stray
|
||||||
if math.random(1, 200) == 1 then
|
if math.random(1, 200) == 1 then
|
||||||
local r = math.random(1, #mobs_mc.items.music_discs)
|
local r = math.random(1, #mobs_mc.items.music_discs)
|
||||||
minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, mobs_mc.items.music_discs[r])
|
minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, mobs_mc.items.music_discs[r])
|
||||||
|
@ -89,7 +89,8 @@ mobs:register_mob("mobs_mc:creeper", {
|
||||||
{name = mobs_mc.items.gunpowder,
|
{name = mobs_mc.items.gunpowder,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
|
|
||||||
-- Head
|
-- Head
|
||||||
-- TODO: Only drop if killed by charged creeper
|
-- TODO: Only drop if killed by charged creeper
|
||||||
|
|
|
@ -220,7 +220,8 @@ mobs:register_mob("mobs_mc:enderman", {
|
||||||
{name = mobs_mc.items.ender_pearl,
|
{name = mobs_mc.items.ender_pearl,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common"},
|
||||||
},
|
},
|
||||||
animation = select_enderman_animation("normal"),
|
animation = select_enderman_animation("normal"),
|
||||||
_taken_node = "",
|
_taken_node = "",
|
||||||
|
|
|
@ -38,8 +38,8 @@ mobs:register_mob("mobs_mc:ghast", {
|
||||||
walk_velocity = 1.6,
|
walk_velocity = 1.6,
|
||||||
run_velocity = 3.2,
|
run_velocity = 3.2,
|
||||||
drops = {
|
drops = {
|
||||||
{name = mobs_mc.items.gunpowder, chance = 1, min = 0, max = 2,},
|
{name = mobs_mc.items.gunpowder, chance = 1, min = 0, max = 2, looting = "common"},
|
||||||
{name = mobs_mc.items.ghast_tear, chance = 3,min = 0,max = 1,},
|
{name = mobs_mc.items.ghast_tear, chance = 10/6, min = 0, max = 1, looting = "common", looting_ignore_chance = true},
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
stand_speed = 50, walk_speed = 50, run_speed = 50,
|
stand_speed = 50, walk_speed = 50, run_speed = 50,
|
||||||
|
|
|
@ -46,7 +46,8 @@ mobs:register_mob("mobs_mc:guardian", {
|
||||||
{name = mobs_mc.items.prismarine_shard,
|
{name = mobs_mc.items.prismarine_shard,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 32,},
|
max = 32,
|
||||||
|
looting = "common",},
|
||||||
-- TODO: Reduce of drops when ocean monument is ready.
|
-- TODO: Reduce of drops when ocean monument is ready.
|
||||||
|
|
||||||
-- The following drops are approximations
|
-- The following drops are approximations
|
||||||
|
@ -54,29 +55,39 @@ mobs:register_mob("mobs_mc:guardian", {
|
||||||
{name = mobs_mc.items.fish_raw,
|
{name = mobs_mc.items.fish_raw,
|
||||||
chance = 4,
|
chance = 4,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.prismarine_crystals,
|
{name = mobs_mc.items.prismarine_crystals,
|
||||||
chance = 4,
|
chance = 4,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
|
|
||||||
-- Rare drop: fish
|
-- Rare drop: fish
|
||||||
{name = mobs_mc.items.fish_raw,
|
{name = mobs_mc.items.fish_raw,
|
||||||
chance = 160, -- 2.5% / 4
|
chance = 160, -- 2.5% / 4
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.0025,},
|
||||||
{name = mobs_mc.items.salmon_raw,
|
{name = mobs_mc.items.salmon_raw,
|
||||||
chance = 160,
|
chance = 160,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.0025,},
|
||||||
{name = mobs_mc.items.clownfish_raw,
|
{name = mobs_mc.items.clownfish_raw,
|
||||||
chance = 160,
|
chance = 160,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.0025,},
|
||||||
{name = mobs_mc.items.pufferfish_raw,
|
{name = mobs_mc.items.pufferfish_raw,
|
||||||
chance = 160,
|
chance = 160,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.0025,},
|
||||||
},
|
},
|
||||||
fly = true,
|
fly = true,
|
||||||
makes_footstep_sound = false,
|
makes_footstep_sound = false,
|
||||||
|
|
|
@ -51,7 +51,8 @@ mobs:register_mob("mobs_mc:guardian_elder", {
|
||||||
{name = mobs_mc.items.prismarine_shard,
|
{name = mobs_mc.items.prismarine_shard,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 64,},
|
max = 64,
|
||||||
|
looting = "common",},
|
||||||
|
|
||||||
-- TODO: Only drop if killed by player
|
-- TODO: Only drop if killed by player
|
||||||
{name = mobs_mc.items.wet_sponge,
|
{name = mobs_mc.items.wet_sponge,
|
||||||
|
@ -64,29 +65,39 @@ mobs:register_mob("mobs_mc:guardian_elder", {
|
||||||
{name = mobs_mc.items.fish_raw,
|
{name = mobs_mc.items.fish_raw,
|
||||||
chance = 4,
|
chance = 4,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.prismarine_crystals,
|
{name = mobs_mc.items.prismarine_crystals,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 10,},
|
max = 10,
|
||||||
|
looting = "common",},
|
||||||
|
|
||||||
-- Rare drop: fish
|
-- Rare drop: fish
|
||||||
{name = mobs_mc.items.fish_raw,
|
{name = mobs_mc.items.fish_raw,
|
||||||
chance = 160, -- 2.5% / 4
|
chance = 160, -- 2.5% / 4
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 4,},
|
||||||
{name = mobs_mc.items.salmon_raw,
|
{name = mobs_mc.items.salmon_raw,
|
||||||
chance = 160,
|
chance = 160,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 4,},
|
||||||
{name = mobs_mc.items.clownfish_raw,
|
{name = mobs_mc.items.clownfish_raw,
|
||||||
chance = 160,
|
chance = 160,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 4,},
|
||||||
{name = mobs_mc.items.pufferfish_raw,
|
{name = mobs_mc.items.pufferfish_raw,
|
||||||
chance = 160,
|
chance = 160,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 4,},
|
||||||
},
|
},
|
||||||
fly = true,
|
fly = true,
|
||||||
makes_footstep_sound = false,
|
makes_footstep_sound = false,
|
||||||
|
|
|
@ -127,7 +127,8 @@ local horse = {
|
||||||
{name = mobs_mc.items.leather,
|
{name = mobs_mc.items.leather,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
|
|
||||||
do_custom = function(self, dtime)
|
do_custom = function(self, dtime)
|
||||||
|
|
|
@ -54,7 +54,8 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
{name = mobs_mc.items.leather,
|
{name = mobs_mc.items.leather,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
sounds = {
|
sounds = {
|
||||||
|
|
|
@ -37,7 +37,8 @@ mobs:register_mob("mobs_mc:parrot", {
|
||||||
{name = mobs_mc.items.feather,
|
{name = mobs_mc.items.feather,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
stand_speed = 50,
|
stand_speed = 50,
|
||||||
|
|
|
@ -27,7 +27,8 @@ mobs:register_mob("mobs_mc:pig", {
|
||||||
{name = mobs_mc.items.porkchop_raw,
|
{name = mobs_mc.items.porkchop_raw,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 3,},
|
max = 3,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
sounds = {
|
sounds = {
|
||||||
|
|
|
@ -36,12 +36,14 @@ mobs:register_mob("mobs_mc:polar_bear", {
|
||||||
{name = mobs_mc.items.fish_raw,
|
{name = mobs_mc.items.fish_raw,
|
||||||
chance = 2,
|
chance = 2,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
-- 1/4 to drop raw salmon
|
-- 1/4 to drop raw salmon
|
||||||
{name = mobs_mc.items.salmon_raw,
|
{name = mobs_mc.items.salmon_raw,
|
||||||
chance = 4,
|
chance = 4,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
|
|
||||||
},
|
},
|
||||||
floats = 1,
|
floats = 1,
|
||||||
|
|
|
@ -41,11 +41,9 @@ local rabbit = {
|
||||||
runaway = true,
|
runaway = true,
|
||||||
jump = true,
|
jump = true,
|
||||||
drops = {
|
drops = {
|
||||||
{name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1},
|
{name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1, looting = "common",},
|
||||||
{name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1},
|
{name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1, looting = "common",},
|
||||||
{name = mobs_mc.items.rabbit_foot, chance = 10, min = 0, max = 1},
|
{name = mobs_mc.items.rabbit_foot, chance = 10, min = 0, max = 1, looting = "rare", looting_factor = 0.03,},
|
||||||
-- TODO: Drop rabbit's foot when it's useful
|
|
||||||
--{name = mobs_mc.items.rabbit_foot, chance = 10, min = 1, max = 1},
|
|
||||||
},
|
},
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
animation = {
|
animation = {
|
||||||
|
|
|
@ -63,11 +63,13 @@ mobs:register_mob("mobs_mc:sheep", {
|
||||||
{name = mobs_mc.items.mutton_raw,
|
{name = mobs_mc.items.mutton_raw,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
{name = colors["unicolor_white"][1],
|
{name = colors["unicolor_white"][1],
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
sounds = {
|
sounds = {
|
||||||
|
|
|
@ -35,9 +35,11 @@ mobs:register_mob("mobs_mc:shulker", {
|
||||||
jump = false,
|
jump = false,
|
||||||
drops = {
|
drops = {
|
||||||
{name = mobs_mc.items.shulker_shell,
|
{name = mobs_mc.items.shulker_shell,
|
||||||
chance = 1,
|
chance = 2,
|
||||||
min = 0,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.0625},
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
stand_speed = 25, walk_speed = 25, run_speed = 50, punch_speed = 25,
|
stand_speed = 25, walk_speed = 25, run_speed = 50, punch_speed = 25,
|
||||||
|
|
|
@ -46,15 +46,18 @@ local skeleton = {
|
||||||
{name = mobs_mc.items.arrow,
|
{name = mobs_mc.items.arrow,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.bow,
|
{name = mobs_mc.items.bow,
|
||||||
chance = 11,
|
chance = 100 / 8.5,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",},
|
||||||
{name = mobs_mc.items.bone,
|
{name = mobs_mc.items.bone,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
|
|
||||||
-- Head
|
-- Head
|
||||||
-- TODO: Only drop if killed by charged creeper
|
-- TODO: Only drop if killed by charged creeper
|
||||||
|
@ -116,12 +119,21 @@ stray.textures = {
|
||||||
-- TODO: different sound (w/ echo)
|
-- TODO: different sound (w/ echo)
|
||||||
-- TODO: stray's arrow inflicts slowness status
|
-- TODO: stray's arrow inflicts slowness status
|
||||||
table.insert(stray.drops, {
|
table.insert(stray.drops, {
|
||||||
-- Chance to drop additional arrow.
|
name = "mcl_potions:slowness_arrow",
|
||||||
-- TODO: Should be tipped arrow of slowness
|
|
||||||
name = mobs_mc.items.arrow,
|
|
||||||
chance = 2,
|
chance = 2,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_chance_function = function(lvl)
|
||||||
|
local chance = 0.5
|
||||||
|
for i = 1, lvl do
|
||||||
|
if chance > 1 then
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
chance = chance + (1 - chance) / 2
|
||||||
|
end
|
||||||
|
return chance
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:stray", stray)
|
mobs:register_mob("mobs_mc:stray", stray)
|
||||||
|
|
|
@ -45,17 +45,20 @@ mobs:register_mob("mobs_mc:witherskeleton", {
|
||||||
{name = mobs_mc.items.coal,
|
{name = mobs_mc.items.coal,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.bone,
|
{name = mobs_mc.items.bone,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
|
|
||||||
-- Head
|
-- Head
|
||||||
{name = mobs_mc.items.head_wither_skeleton,
|
{name = mobs_mc.items.head_wither_skeleton,
|
||||||
chance = 40, -- 2.5% chance
|
chance = 40, -- 2.5% chance
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",},
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
stand_start = 0,
|
stand_start = 0,
|
||||||
|
|
|
@ -49,8 +49,10 @@ local spider = {
|
||||||
view_range = 16,
|
view_range = 16,
|
||||||
floats = 1,
|
floats = 1,
|
||||||
drops = {
|
drops = {
|
||||||
{name = mobs_mc.items.string, chance = 1, min = 0, max = 2,},
|
{name = mobs_mc.items.string, chance = 1, min = 0, max = 2, looting = "common"},
|
||||||
{name = mobs_mc.items.spider_eye, chance = 3, min = 1, max = 1,},
|
{name = mobs_mc.items.spider_eye, chance = 3, min = 1, max = 1, looting = "common", looting_chance_function = function(lvl)
|
||||||
|
return 1 - 2 / (lvl + 3)
|
||||||
|
end},
|
||||||
},
|
},
|
||||||
specific_attack = { "player", "mobs_mc:iron_golem" },
|
specific_attack = { "player", "mobs_mc:iron_golem" },
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
|
|
|
@ -42,7 +42,8 @@ mobs:register_mob("mobs_mc:squid", {
|
||||||
{name = mobs_mc.items.black_dye,
|
{name = mobs_mc.items.black_dye,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 3,},
|
max = 3,
|
||||||
|
looting = "common",},
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=3, y=3},
|
||||||
makes_footstep_sound = false,
|
makes_footstep_sound = false,
|
||||||
|
|
|
@ -55,7 +55,8 @@ mobs:register_mob("mobs_mc:evoker", {
|
||||||
{name = mobs_mc.items.emerald,
|
{name = mobs_mc.items.emerald,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.totem,
|
{name = mobs_mc.items.totem,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
|
|
|
@ -41,11 +41,13 @@ mobs:register_mob("mobs_mc:vindicator", {
|
||||||
{name = mobs_mc.items.emerald,
|
{name = mobs_mc.items.emerald,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.iron_axe,
|
{name = mobs_mc.items.iron_axe,
|
||||||
chance = 11,
|
chance = 100 / 8.5,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",},
|
||||||
},
|
},
|
||||||
-- TODO: sounds
|
-- TODO: sounds
|
||||||
animation = {
|
animation = {
|
||||||
|
|
|
@ -44,19 +44,26 @@ mobs:register_mob("mobs_mc:villager_zombie", {
|
||||||
{name = mobs_mc.items.rotten_flesh,
|
{name = mobs_mc.items.rotten_flesh,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.iron_ingot,
|
{name = mobs_mc.items.iron_ingot,
|
||||||
chance = 120, -- 2.5% / 3
|
chance = 120, -- 2.5% / 3
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 3,},
|
||||||
{name = mobs_mc.items.carrot,
|
{name = mobs_mc.items.carrot,
|
||||||
chance = 120, -- 2.5% / 3
|
chance = 120, -- 2.5% / 3
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 3,},
|
||||||
{name = mobs_mc.items.potato,
|
{name = mobs_mc.items.potato,
|
||||||
chance = 120, -- 2.5% / 3
|
chance = 120, -- 2.5% / 3
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 3,},
|
||||||
},
|
},
|
||||||
sounds = {
|
sounds = {
|
||||||
random = "mobs_mc_zombie_growl",
|
random = "mobs_mc_zombie_growl",
|
||||||
|
|
|
@ -41,13 +41,13 @@ mobs:register_mob("mobs_mc:witch", {
|
||||||
dogshoot_count_max =1.8,
|
dogshoot_count_max =1.8,
|
||||||
max_drops = 3,
|
max_drops = 3,
|
||||||
drops = {
|
drops = {
|
||||||
{name = mobs_mc.items.glass_bottle, chance = 8, min = 0, max = 2,},
|
{name = mobs_mc.items.glass_bottle, chance = 8, min = 0, max = 2, looting = "common",},
|
||||||
{name = mobs_mc.items.glowstone_dust, chance = 8, min = 0, max = 2,},
|
{name = mobs_mc.items.glowstone_dust, chance = 8, min = 0, max = 2, looting = "common",},
|
||||||
{name = mobs_mc.items.gunpowder, chance = 8, min = 0, max = 2,},
|
{name = mobs_mc.items.gunpowder, chance = 8, min = 0, max = 2, looting = "common",},
|
||||||
{name = mobs_mc.items.redstone, chance = 8, min = 0, max = 2,},
|
{name = mobs_mc.items.redstone, chance = 8, min = 0, max = 2, looting = "common",},
|
||||||
{name = mobs_mc.items.spider_eye, chance = 8, min = 0, max = 2,},
|
{name = mobs_mc.items.spider_eye, chance = 8, min = 0, max = 2, looting = "common",},
|
||||||
{name = mobs_mc.items.sugar, chance = 8, min = 0, max = 2,},
|
{name = mobs_mc.items.sugar, chance = 8, min = 0, max = 2, looting = "common",},
|
||||||
{name = mobs_mc.items.stick, chance = 4, min = 0, max = 2,},
|
{name = mobs_mc.items.stick, chance = 4, min = 0, max = 2, looting = "common",},
|
||||||
},
|
},
|
||||||
-- TODO: sounds
|
-- TODO: sounds
|
||||||
animation = {
|
animation = {
|
||||||
|
|
|
@ -13,19 +13,26 @@ local drops_common = {
|
||||||
{name = mobs_mc.items.rotten_flesh,
|
{name = mobs_mc.items.rotten_flesh,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 2,},
|
max = 2,
|
||||||
|
looting = "common",},
|
||||||
{name = mobs_mc.items.iron_ingot,
|
{name = mobs_mc.items.iron_ingot,
|
||||||
chance = 120, -- 2.5% / 3
|
chance = 120, -- 2.5% / 3
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 3,},
|
||||||
{name = mobs_mc.items.carrot,
|
{name = mobs_mc.items.carrot,
|
||||||
chance = 120, -- 2.5% / 3
|
chance = 120, -- 2.5% / 3
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 3,},
|
||||||
{name = mobs_mc.items.potato,
|
{name = mobs_mc.items.potato,
|
||||||
chance = 120, -- 2.5% / 3
|
chance = 120, -- 2.5% / 3
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare",
|
||||||
|
looting_factor = 0.01 / 3,},
|
||||||
}
|
}
|
||||||
|
|
||||||
local drops_zombie = table.copy(drops_common)
|
local drops_zombie = table.copy(drops_common)
|
||||||
|
|
|
@ -50,19 +50,23 @@ local pigman = {
|
||||||
{name = mobs_mc.items.rotten_flesh,
|
{name = mobs_mc.items.rotten_flesh,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common"},
|
||||||
{name = mobs_mc.items.gold_nugget,
|
{name = mobs_mc.items.gold_nugget,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "common"},
|
||||||
{name = mobs_mc.items.gold_ingot,
|
{name = mobs_mc.items.gold_ingot,
|
||||||
chance = 40, -- 2.5%
|
chance = 40, -- 2.5%
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare"},
|
||||||
{name = mobs_mc.items.gold_sword,
|
{name = mobs_mc.items.gold_sword,
|
||||||
chance = 12, -- 8.333%, approximation to 8.5%
|
chance = 100 / 8.5,
|
||||||
min = 1,
|
min = 1,
|
||||||
max = 1,},
|
max = 1,
|
||||||
|
looting = "rare"},
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
stand_speed = 25,
|
stand_speed = 25,
|
||||||
|
|
|
@ -341,8 +341,8 @@ function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool
|
||||||
return knockback
|
return knockback
|
||||||
end
|
end
|
||||||
|
|
||||||
-- unimplemented
|
-- implemented in mcl_mobs and mobs_mc
|
||||||
--[[mcl_enchanting.enchantments.looting = {
|
mcl_enchanting.enchantments.looting = {
|
||||||
name = S("Looting"),
|
name = S("Looting"),
|
||||||
max_level = 3,
|
max_level = 3,
|
||||||
primary = {sword = true},
|
primary = {sword = true},
|
||||||
|
@ -356,7 +356,7 @@ end
|
||||||
requires_tool = false,
|
requires_tool = false,
|
||||||
treasure = false,
|
treasure = false,
|
||||||
power_range_table = {{15, 61}, {24, 71}, {33, 81}},
|
power_range_table = {{15, 61}, {24, 71}, {33, 81}},
|
||||||
}]]--
|
}
|
||||||
|
|
||||||
-- requires missing MineClone2 feature
|
-- requires missing MineClone2 feature
|
||||||
--[[mcl_enchanting.enchantments.loyalty = {
|
--[[mcl_enchanting.enchantments.loyalty = {
|
||||||
|
@ -375,6 +375,7 @@ end
|
||||||
power_range_table = {{12, 50}, {19, 50}, {26, 50}},
|
power_range_table = {{12, 50}, {19, 50}, {26, 50}},
|
||||||
}]]--
|
}]]--
|
||||||
|
|
||||||
|
-- implemented in mcl_fishing
|
||||||
mcl_enchanting.enchantments.luck_of_the_sea = {
|
mcl_enchanting.enchantments.luck_of_the_sea = {
|
||||||
name = S("Luck of the Sea"),
|
name = S("Luck of the Sea"),
|
||||||
max_level = 3,
|
max_level = 3,
|
||||||
|
|
Loading…
Reference in a new issue