update mobs mod, move unused monster sounds(ramivore)

master
crabman77 2016-02-03 09:12:32 +01:00
parent 23de56d7bd
commit 1cae7bb59b
49 changed files with 1126 additions and 5755 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,9 @@ mobs:register_mob("mobs:bunny", {
passive = true,
reach = 1,
-- health & armor
hp_min = 3, hp_max = 6, armor = 200,
hp_min = 3,
hp_max = 6,
armor = 200,
-- textures and model
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
visual = "mesh",
@ -18,13 +20,14 @@ mobs:register_mob("mobs:bunny", {
{"mobs_bunny_grey.png"},
{"mobs_bunny_brown.png"},
{"mobs_bunny_white.png"},
{"mobs_bunny_evil.png"},
},
-- sounds
sounds = {},
makes_footstep_sound = false,
-- speed and jump
walk_velocity = 1, run_velocity = 2,
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
-- drops meat when dead
-- drops = {
@ -35,12 +38,16 @@ mobs:register_mob("mobs:bunny", {
water_damage = 1,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
-- model animation
animation = {
speed_normal = 15,
stand_start = 1, stand_end = 15,
walk_start = 16, walk_end = 24,
punch_start = 16, punch_end = 24,
stand_start = 1,
stand_end = 15,
walk_start = 16,
walk_end = 24,
punch_start = 16,
punch_end = 24,
},
-- follows carrot from farming redo
follow = {"farming:carrot", "farming_plus:carrot_item"},
@ -51,25 +58,35 @@ mobs:register_mob("mobs:bunny", {
replace_with = "air",
-- right click to pick up rabbit
on_rightclick = function(self, clicker)
if not mobs:feed_tame(self, clicker, 4, true, true) then
-- Monty Python tribute
local item = clicker:get_wielded_item()
if item:get_name() == "mobs:lava_orb" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_bunny_evil.png"},
})
self.type = "monster"
self.object:set_hp(20)
return
-- feed or tame
if mobs:feed_tame(self, clicker, 4, true, true) then
return
end
-- Monty Python tribute
local item = clicker:get_wielded_item()
if item:get_name() == "mobs:lava_orb" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_bunny_evil.png"},
})
self.type = "monster"
self.object:set_hp(20)
return
end
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
end,
attack_type = "dogfight",
damage = 5,
})

View File

@ -7,7 +7,9 @@ mobs:register_mob("mobs:chicken", {
-- is it aggressive
passive = true,
-- health & armor
hp_min = 4, hp_max = 8, armor = 200,
hp_min = 4,
hp_max = 8,
armor = 200,
-- textures and model
collisionbox = {-0.3, -0.75, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
@ -31,6 +33,8 @@ mobs:register_mob("mobs:chicken", {
},
-- speed and jump
walk_velocity = 1,
run_velocity = 3,
runaway = true,
jump = true,
-- drops raw chicken when dead
-- drops = {
@ -43,6 +47,7 @@ mobs:register_mob("mobs:chicken", {
light_damage = 0,
fall_damage = 0,
fall_speed = -8,
fear_height = 5,
-- model animation
animation = {
speed_normal = 15,
@ -56,7 +61,9 @@ mobs:register_mob("mobs:chicken", {
view_range = 8,
on_rightclick = function(self, clicker)
mobs:feed_tame(self, clicker, 8, true, true)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
end,
@ -134,12 +141,12 @@ mobs:register_arrow("mobs:egg_entity", {
end
})
-- snowball throwing item
-- egg throwing item
local egg_GRAVITY = 9
local egg_VELOCITY = 19
-- shoot snowball
-- shoot egg
local mobs_shoot_egg = function (item, player, pointed_thing)
local playerpos = player:getpos()
minetest.sound_play("default_place_node_hard", {
@ -152,8 +159,10 @@ local mobs_shoot_egg = function (item, player, pointed_thing)
y = playerpos.y +1.5,
z = playerpos.z
}, "mobs:egg_entity")
local ent = obj:get_luaentity()
local dir = player:get_look_dir()
obj:get_luaentity().velocity = egg_VELOCITY -- needed for api internal timing
ent.velocity = egg_VELOCITY -- needed for api internal timing
ent.switch = 1 -- needed so that egg doesn't despawn straight away
obj:setvelocity({
x = dir.x * egg_VELOCITY,
y = dir.y * egg_VELOCITY,

View File

@ -48,40 +48,63 @@ mobs:register_mob("mobs:cow", {
light_damage = 0,
-- model animation
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 30,
walk_start = 35, walk_end = 65,
run_start = 105, run_end = 135,
punch_start = 70, punch_end = 100,
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 30,
walk_start = 35,
walk_end = 65,
run_start = 105,
run_end = 135,
punch_start = 70,
punch_end = 100,
},
follow = "farming:wheat",
view_range = 8,
replace_rate = 50,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "air",
fear_height = 2,
on_rightclick = function(self, clicker)
if not mobs:feed_tame(self, clicker, 8, true, true) then
local tool = clicker:get_wielded_item()
-- milk cow with empty bucket
if tool:get_name() == "bucket:bucket_empty" then
if self.gotten == true
or self.child == true then
return
end
local inv = clicker:get_inventory()
inv:remove_item("main", "bucket:bucket_empty")
if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
else
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {name = "mobs:bucket_milk"})
end
self.gotten = true -- milked
-- feed or tame
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
local tool = clicker:get_wielded_item()
-- milk cow with empty bucket
if tool:get_name() == "bucket:bucket_empty" then
--if self.gotten == true
if self.child == true then
return
end
if self.gotten == true then
minetest.chat_send_player(clicker:get_player_name(),
"Cow already milked!")
return
end
local inv = clicker:get_inventory()
inv:remove_item("main", "bucket:bucket_empty")
if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
else
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {name = "mobs:bucket_milk"})
end
self.gotten = true -- milked
return
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
})

View File

@ -1,3 +1,15 @@
-- nametag
minetest.register_craftitem("mobs:nametag", {
description = "Nametag",
inventory_image = "mobs_nametag.png",
})
core.register_craft({
type = "shapeless",
output = "mobs:nametag",
recipe = {"default:paper", "dye:black", "farming:string"},
})
-- leather
minetest.register_craftitem("mobs:leather", {
description = "Leather",

View File

@ -8,6 +8,7 @@ mobs:register_mob("mobs:goat", {
passive = true,
group_attack = true,
attack_type = "dogfight",
reach = 2,
damage = 4,
-- health & armor
hp_min = 15,

View File

@ -10,7 +10,7 @@ dofile(path.."/chicken.lua") -- JKmurray
dofile(path.."/cow.lua") -- KrupnoPavel
dofile(path.."/rat.lua") -- PilzAdam
dofile(path.."/sheep.lua") -- PilzAdam
dofile(path.."/warthog.lua") -- KrupnoPavel
dofile(path.."/pig.lua") -- farfadet46
dofile(path.."/bee.lua") -- KrupnoPavel
dofile(path.."/bunny.lua") -- ExeterDad
dofile(path.."/kitten.lua") -- Jordach/BFD
@ -58,6 +58,9 @@ dofile(path.."/npc_female.lua") -- nuttmeg20
-- Mob Items
dofile(path.."/crafts.lua")
-- Spawner
--dofile(path.."/spawner.lua")
-- Mob menu spawner special MFF
dofile(path.."/mff_menu.lua")

View File

@ -7,7 +7,9 @@ mobs:register_mob("mobs:kitten", {
-- is it aggressive
passive = true,
-- health & armor
hp_min = 4, hp_max = 8, armor = 200,
hp_min = 4,
hp_max = 8,
armor = 200,
-- textures and model
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
@ -27,6 +29,8 @@ mobs:register_mob("mobs:kitten", {
},
-- speed and jump
walk_velocity = 0.6,
run_velocity = 2,
runaway = true,
jump = false,
-- drops string
-- drops = {
@ -36,18 +40,23 @@ mobs:register_mob("mobs:kitten", {
-- damaged by
water_damage = 1,
lava_damage = 5,
fear_height = 3,
-- model animation
animation = {
speed_normal = 42,
stand_start = 97, stand_end = 192,
walk_start = 0, walk_end = 96,
stand_start = 97,
stand_end = 192,
walk_start = 0,
walk_end = 96,
},
-- follows Rat and Raw Fish
follow = {"mobs:rat", "ethereal:fish_raw"},
view_range = 10,
-- feed with raw fish to tame or right click to pick up
on_rightclick = function(self, clicker)
mobs:feed_tame(self, clicker, 4, true, true)
if mobs:feed_tame(self, clicker, 4, true, true) then
return
end
mobs:capture_mob(self, clicker, 50, 50, 90, false, nil)
end
})

BIN
mods/mobs/models/mobs_pig.b3d Executable file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,6 @@ mobs.npc_drops = { "farming:meat", "farming:donut", "farming:bread", "default:a
"default:cobble", "default:gravel", "default:clay_lump", "default:sand", "default:dirt_with_grass",
"default:dirt", "default:chest", "default:torch"}
mobs.npc_max_hp = 20
mobs:register_mob("mobs:npc", {
-- animal, monster, npc
@ -20,7 +19,9 @@ mobs:register_mob("mobs:npc", {
attack_type = "dogfight",
attacks_monsters = true,
-- health & armor
hp_min = 20, hp_max = 20, armor = 100,
hp_min = 20,
hp_max = 20,
armor = 100,
-- textures and model
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
visual = "mesh",
@ -65,16 +66,23 @@ mobs:register_mob("mobs:npc", {
-- set owner and order
owner = "",
order = "follow",
fear_height = 3,
-- model animation
animation = {
speed_normal = 30, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
speed_normal = 30,
speed_run = 30,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219,
},
-- right clicking with "cooked meat" or "bread" will give npc more health
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
@ -99,10 +107,11 @@ mobs:register_mob("mobs:npc", {
item:take_item()
clicker:set_wielded_item(item)
end
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {
name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]
name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]
})
return
-- if owner switch between follow and stand
@ -115,6 +124,7 @@ mobs:register_mob("mobs:npc", {
end
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
end
end,
})

View File

@ -35,9 +35,9 @@ mobs:register_mob("mobs:npc_female", {
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_fnpc", -- 2 sounds
random = "mobs_fnpc", -- 2 sounds
damage = "mobs_fnpc_hit", -- 2 sounds
attack = "mobs_fnpc_attack", -- 1 sound
attack = "mobs_fnpc_attack", -- 1 sound
death = "mobs_fnpc_death", -- 1 sound
},
-- speed and jump
@ -69,16 +69,23 @@ mobs:register_mob("mobs:npc_female", {
-- set owner and order
owner = "",
order = "follow",
fear_height = 3,
-- model animation
animation = {
speed_normal = 30, speed_run = 30,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 187,
run_start = 168, run_end = 187,
punch_start = 200, punch_end = 219,
speed_normal = 30,
speed_run = 30,
stand_start = 0,
stand_end = 79,
walk_start = 168,
walk_end = 187,
run_start = 168,
run_end = 187,
punch_start = 200,
punch_end = 219,
},
-- right clicking with "cooked meat" or "bread" will give npc more health
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
if item:get_name() == "default:diamond" then --/MFF (Crabman|07/14/2015) tamed with diamond
@ -105,7 +112,9 @@ mobs:register_mob("mobs:npc_female", {
end
local pos = self.object:getpos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
minetest.add_item(pos, {
name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]
})
return
-- if owner switch between follow and stand
elseif self.owner and self.owner == clicker:get_player_name() then

89
mods/mobs/pig.lua Executable file
View File

@ -0,0 +1,89 @@
-- Piggy by farfadet46
mobs:register_mob("mobs:pig", {
-- animal, monster, npc, barbarian
type = "animal",
-- aggressive, does 5 damage to player when threatened
passive = false,
group_attack = true,
attack_type = "dogfight",
reach = 2,
damage = 4,
-- health & armor
hp_min = 15,
hp_max = 20,
armor = 200,
-- textures and model
collisionbox = {-0.8, -0.01, -0.8, 0.8, 1.1, 0.8},
visual = "mesh",
mesh = "mobs_pig.b3d",
drawtype = "front",
textures = {
{"mobs_pig_pink.png"},
},
visual_size = {x=1,y=1},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_pig",
attack = "mobs_pig_angry",
},
-- speed and jump
walk_velocity = 2,
run_velocity = 3,
jump = true,
-- follows apple and potato
follow = {"default:apple", "farming:potato"},
view_range = 10,
-- drops raw pork when dead
drops = {
{name = "mobs:pork_raw",
chance = 1, min = 2, max = 3,},
{name = "maptools:silver_coin",
chance = 10, min = 1, max = 1,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
fear_height = 2,
-- model animation
animation = {
speed_normal = 15,
stand_start = 25, stand_end = 55,
walk_start = 60, walk_end = 100,
punch_start = 60, punch_end = 100,
},
-- can be tamed by feeding 8 wheat (will not attack when tamed)
on_rightclick = function(self, clicker)
mobs:feed_tame(self, clicker, 8, true, true)
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
-- spawns on dirt or junglegrass, between 8 and 20 light, 1 in 15000 chance, 1 in area up to 31000 in height
mobs:spawn_specific("mobs:pig", {"default:dirt", "default:junglegrass", "default:dirt_with_dry_grass"}, {"air"}, 8, 20, 30, 10000, 1, -31000, 31000, true)
-- register spawn egg
mobs:register_egg("mobs:pig", "Pig", "mobs_pig_inv.png", 1)
-- porkchop (raw and cooked)
minetest.register_craftitem("mobs:pork_raw", {
description = "Raw Porkchop",
inventory_image = "mobs_pork_raw.png",
on_use = minetest.item_eat(4),
})
-- cooked porkchop
minetest.register_craftitem("mobs:pork_cooked", {
description = "Cooked Porkchop",
inventory_image = "mobs_pork_cooked.png",
on_use = minetest.item_eat(8),
})
minetest.register_craft({
type = "cooking",
output = "mobs:pork_cooked",
recipe = "mobs:pork_raw",
cooktime = 5,
})

View File

@ -26,6 +26,8 @@ mobs:register_mob("mobs:rat", {
},
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
-- no drops
drops = {},
@ -33,6 +35,7 @@ mobs:register_mob("mobs:rat", {
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
-- right click to pick up rat
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, 25, 80, 0, true, nil)
@ -42,7 +45,7 @@ mobs:register_mob("mobs:rat", {
local pos = self.object:getpos()
print("rat pos", pos.x, pos.y, pos.z)
end,
]]
--]]
})
-- spawn on stone between 1 and 20 light, 1 in 7000 chance, 1 per area up to 31000 in height
mobs:spawn_specific("mobs:rat", {"default:stone", "default:sandstone"}, {"air"}, 0, 20, 30, 10000, 1, -31000, 31000, true)

View File

@ -6,7 +6,7 @@ local all_colours = {
-- Sheep by PilzAdam
for _, col in ipairs(all_colours) do
for _, col in pairs(all_colours) do
mobs:register_mob("mobs:sheep_"..col, {
-- animal, monster, npc, barbarian
@ -18,7 +18,8 @@ for _, col in ipairs(all_colours) do
hp_max = 15,
armor = 200,
-- textures and model
collisionbox = {-0.4, -1, -0.4, 0.4, 0.3, 0.4},
--collisionbox = {-0.4, -1, -0.4, 0.4, 0.3, 0.4},
collisionbox = {-0.5, -1, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "mobs_sheep.b3d",
textures = {
@ -35,6 +36,7 @@ for _, col in ipairs(all_colours) do
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
-- drops raw meat and woll of its color when dead
-- drops = {
@ -49,9 +51,12 @@ for _, col in ipairs(all_colours) do
light_damage = 0,
-- model animation
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 80,
walk_start = 81, walk_end = 100,
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 80,
walk_start = 81,
walk_end = 100,
},
follow = {"farming:wheat", "default:grass_5"},
view_range = 10,
@ -61,6 +66,7 @@ for _, col in ipairs(all_colours) do
replace_with = "air",
-- right click sheep to shear sheep and get wood, feed 8 wheat for wool to grow back
replace_offset = -1,
fear_height = 3,
on_rightclick = function(self, clicker)
local shpcolor = string.split(self.name,"_")[2]
if shpcolor =="dark" then
@ -89,7 +95,7 @@ for _, col in ipairs(all_colours) do
if minetest.get_modpath("wool") then
local pos = self.object:getpos()
pos.y = pos.y + 0.5
local obj = minetest.add_item(pos, ItemStack("wool:"..shpcolor.." "..math.random(2,3)))
local obj = minetest.add_item(pos, ItemStack("wool:"..shpcolor.." "..math.random(1,3)))
if obj then
obj:setvelocity({
x = math.random(-1,1),
@ -112,7 +118,10 @@ for _, col in ipairs(all_colours) do
--are we coloring?
if itemname:find("dye:") then
if self.gotten == false and self.child == false and self.tamed == true and name == self.owner then
if self.gotten == false
and self.child == false
and self.tamed == true
and name == self.owner then
local col = string.split(itemname,":")[2]
for _,c in pairs(all_colours) do
if c == col then
@ -168,6 +177,7 @@ minetest.register_entity("mobs:sheep", {
end,
on_step = function(self, dtime)
self.timer = self.timer + dtime
if self.timer >= 1 then
self.timer = 0
@ -180,17 +190,3 @@ minetest.register_entity("mobs:sheep", {
end,
})
-- -- shears (right click sheep to shear wool)
-- minetest.register_tool("mobs:shears", {
-- description = "Steel Shears (right-click sheep to shear)",
-- inventory_image = "mobs_shears.png",
-- tool_capabilities = { -- Modif MFF /DEBUT
-- full_punch_interval = 1,
-- max_drop_level=1,
-- groupcaps={
-- snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
-- },
-- damage_groups = {fleshy=0},
-- }
-- }) -- Modif MFF /FIN

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B