first commit

master
xisd 2019-05-02 08:59:34 +02:00
commit d863472d72
205 changed files with 55770 additions and 0 deletions

3
depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
mobs
treasurer?

73
init.lua Normal file
View File

@ -0,0 +1,73 @@
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
-- Load support for intllib.
local S, NS = dofile(modpath.."/intllib.lua")
mobs.intllib = S
mobs.textstrings = {}
mobs.textstrings.longdesc = {}
mobs.textstrings.usagehelp = {}
-- General functions, items, nodes
dofile(modpath .. "/mobs_textstrings.lua")
dofile(modpath .. "/mobs_api.lua")
dofile(modpath .. "/mobs_craftitems.lua")
--~ do return end
--
-- Animals
--
dofile(modpath .. "/mobs/animal_birds.lua")
dofile(modpath .. "/mobs/animal_bunny.lua")
dofile(modpath .. "/mobs/animal_chicken.lua")
dofile(modpath .. "/mobs/animal_fish.lua")
--dofile(modpath .. "/mobs/animal_flying_pig.lua")
dofile(modpath .. "/mobs/animal_jellyfish.lua")
dofile(modpath .. "/mobs/animal_kitten.lua")
dofile(modpath .. "/mobs/animal_penguin.lua")
dofile(modpath .. "/mobs/animal_sheep.lua")
dofile(modpath .. "/mobs/animal_turtles.lua")
--
-- Monsters
--
dofile(modpath .. "/mobs/monster_slimes.lua")
dofile(modpath .. "/mobs/monster_zombies.lua")
dofile(modpath .. "/mobs/monster_sand_monster.lua")
dofile(modpath .. "/mobs/monster_oerkki.lua")
dofile(modpath .. "/mobs/monster_lava_flan.lua")
--dofile(modpath .. "/mobs/dragon.lua")
--
-- NPCs
--
--
-- Map generation
--
dofile(modpath .. "/mobs_mapgen.lua")
--
-- Compatibility
--
dofile(modpath .. "/lucky_block.lua")
--
-- Notification
--
print ("[MOD] Mobs Redo 'mobs_bundle' loaded")

44
intllib.lua Executable file
View File

@ -0,0 +1,44 @@
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext

21
licenses/LICENSE_mummy.txt Executable file
View File

@ -0,0 +1,21 @@
License of source code and textures: WTFPL
License of mesh model: WTFPL, (c) Copyright Pavel_S (2013)
Textures by BlockMen, License WTFPL
Licenses of sounds
------------------
The authors are : (freesound.org)
-mummy.1.ogg by Raventhornn, CC0
-mummy.2.ogg by Raventhornn, CC0
-mummy_hurt.1.ogg by Under7dude, CC0
-mummy_death.1.ogg by Michel88, CC-Sampling Plus 1.0
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.

View File

@ -0,0 +1,5 @@
Licenses
Model and textures:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@ -0,0 +1,6 @@
Licenses
Model/Textures: CC-BY-SA 3.0
Author: Sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@ -0,0 +1,21 @@
Licenses
Model/Textures: WTFPL
Author: blert2112
***************
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -0,0 +1,4 @@
Licenses
Model/textures: unknown
Author: AspireMint

View File

@ -0,0 +1,6 @@
-- SETTINGS
ENABLE_GULLS = true
ENABLE_LARGE_BIRDS = true
ENABLE_SMALL_BIRDS = true

View File

@ -0,0 +1,19 @@
**CODE**
--------
See Mobs.Redo license
**MODELS/TEXTURES**
-------------------
WTFPL
Author/origin: Tomas J. Luis
Jeija_glue texture by: Jeija
**SOUNDS**
----------
Original sound for slime damage by RandomationPictures under licence CC0 1.0.
http://www.freesound.org/people/RandomationPictures/sounds/138481/
Original sounds for slime jump, land and death by Dr. Minky under licence CC BY 3.0.
http://www.freesound.org/people/DrMinky/sounds/

View File

@ -0,0 +1,15 @@
**CODE**
--------
See Mobs.Redo license
**MODELS/TEXTURES**
-------------------
Unknown
Artist/origin: Blockmen
**SOUNDS**
----------
Unknown
Artist/origin: assuming Blockmen

21
lucky_block.lua Normal file
View File

@ -0,0 +1,21 @@
if minetest.get_modpath("lucky_block") then
lucky_block:add_blocks({
{"spw", "mobs:sheep", 5},
{"spw", "mobs:rat", 5},
{"dro", {"mobs:rat_cooked"}, 5},
{"spw", "mobs:bunny", 3},
{"nod", "mobs:honey_block", 0},
{"spw", "mobs:pumba", 5},
{"nod", "mobs:cheeseblock", 0},
{"spw", "mobs:chicken", 5},
{"dro", {"mobs:egg"}, 5},
{"spw", "mobs:cow", 5},
{"dro", {"mobs:bucket_milk"}, 8},
{"spw", "mobs:kitten", 2},
{"tro", "default:nyancat", "mobs_kitten", true},
{"exp"},
})
end

243
mobs/animal_birds.lua Normal file
View File

@ -0,0 +1,243 @@
-- Small Birds, Larges birds, Gulls
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
-- Other variables
local mob_id
--
-- Documentation for help/doc modpack
--
-- Gulls
-- TODO Make them eat fish
local longdesc = {}
local usagehelp = {}
longdesc.gull = ''
longdesc.gull = longdesc.gull..'\n'..mobs.textstrings.longdesc.peacefull_sky
usagehelp.gull = ''
usagehelp.gull = usagehelp.gull..'\n'..mobs.textstrings.usagehelp.wild_catch_net
-- Other brids
longdesc.bird = ''
longdesc.bird = longdesc.bird..'\n'..mobs.textstrings.longdesc.peacefull_sky
usagehelp.bird = ''
usagehelp.bird = usagehelp.bird..'\n'..mobs.textstrings.usagehelp.wild_catch_net
--
-- Minetest settings
--
local ENABLE_GULLS = minetest.settings:get_bool("mobs.animal_birds.enable_gulls") or true
local ENABLE_LARGE_BIRDS = minetest.settings:get_bool("mobs.animal_birds.enable_large_birds") or false
local ENABLE_SMALL_BIRDS = minetest.settings:get_bool("mobs.animal_birds.enable_small_birds")or true
--
-- local variables
--
local l_skins_gull = {
{"mobs_gull_mesh.png"},
{"mobs_gull_black.png"},
{"mobs_gull_gray.png"},
{"mobs_gull_grayblue.png"}
}
local l_skins_bird = {
{"mobs_bird_blueish.png"},
{"mobs_bird_brown.png"},
{"mobs_bird_gray.png"},
{"mobs_bird_grayblue.png"},
{"mobs_bird_red.png"},
{"mobs_bird_redish.png"}
}
local l_anims = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
run_start = 1, run_end = 95
}
local l_model = "mobs_gull.b3d"
local l_egg_texture_bird = "mobs_bird_inv.png"
local l_egg_texture_gull = "mobs_gull_inv.png"
local l_capture_chance_h = 1
local l_capture_chance_n = 30
local l_spawn_in = {"air"}
local l_spawn_near_gull = {"default:water_source", "default:water_flowing"}
local l_spawn_near_bird = {"default:leaves", "default:pine_needles", "default:jungleleaves", "default:cactus"}
local l_spawn_chance_gull = 24000
local l_spawn_chance_bird = 36000
local l_drop = {
{name = "mobs:feather", chance = 3, min = 1, max = 2},
}
-- load settings
if not ENABLE_LARGE_BIRDS then
l_spawn_chance_bird = l_spawn_chance_bird - 18000
end
if not ENABLE_SMALL_BIRDS then
l_spawn_chance_bird = l_spawn_chance_bird - 18000
end
-----------------------------------------------------------------------
-- Gulls
-----------------------------------------------------------------------
if ENABLE_GULLS then
longdesc = longdesc.gull
usagehelp = usagehelp.gull
mob_id = modname..":gull"
mob_name = S("Gull")
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 5,
hp_max = 10,
armor = 100,
collisionbox = {-1, -0.3, -1, 1, 0.3, 1},
visual = "mesh",
mesh = l_model,
textures = l_skins_gull,
rotate = 270,
walk_velocity = 4,
run_velocity = 6,
fall_speed = 0,
stepheight = 3,
drops = l_drop,
fly = true,
water_damage = 0,
lava_damage = 10,
light_damage = 0,
view_range = 14,
animation = l_anims,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_capture_chance_h, l_capture_chance_n, 0, true, nil)
end
})
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
mobs:spawn({
name = mob_id,
nodes = l_spawn_in,
neighbors = l_spawn_near_gull,
min_light = 10,
interval = 90, --30
chance = l_spawn_chance_gull,
active_object_count = 1,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg(mob_id, S("Gull"), l_egg_texture_gull, 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:custom_captured_name(mob_id,S("Wild @1",mob_name))
end
-----------------------------------------------------------------------
-- Large Birds
-----------------------------------------------------------------------
if ENABLE_LARGE_BIRDS then
longdesc = longdesc.bird
usagehelp = usagehelp.bird
mob_id = modname..":bird_lg"
mob_name = S("Bird")
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 5,
hp_max = 10,
armor = 100,
collisionbox = {-0.5, -0.3, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = l_model,
textures = l_skins_bird,
visual_size = {x=.5, y=.5},
rotate = 270,
walk_velocity = 4,
run_velocity = 6,
fall_speed = 0,
stepheight = 3,
drops = l_drop,
fly = true,
water_damage = 0,
lava_damage = 10,
light_damage = 0,
view_range = 12,
animation = l_anims,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_capture_chance_h, l_capture_chance_n, 0, true, nil)
end
})
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
--mobs:spawn_specific(mob_id, l_spawn_in, l_spawn_near_bird, 5, 20, 30, l_spawn_chance_bird, 1, 0, 31000)
mobs:spawn({
name = mob_id,
nodes = l_spawn_in,
neighbors = l_spawn_near_bird,
min_light = 10,
interval = 90, --30
chance = l_spawn_chance_bird,
active_object_count = 1,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg(mob_id, "Large bird", l_egg_texture_bird, 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:custom_captured_name(mob_id,S("Wild @1",mob_name))
end
-----------------------------------------------------------------------
-- Small Birds
-----------------------------------------------------------------------
if ENABLE_SMALL_BIRDS then
longdesc = longdesc.bird
usagehelp = usagehelp.bird
mob_id = modname..":bird_sm"
mob_name = S("Bird")
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 2,
hp_max = 5,
armor = 100,
collisionbox = {-0.25, -0.3, -0.25, 0.25, 0.3, 0.25},
visual = "mesh",
mesh = l_model,
textures = l_skins_bird,
visual_size = {x=.25, y=.25},
rotate = 270,
walk_velocity = 4,
run_velocity = 6,
fall_speed = 0,
stepheight = 3,
drops = l_drop,
fly = true,
water_damage = 0,
lava_damage = 10,
light_damage = 0,
view_range = 10,
animation = l_anims,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_capture_chance_h, l_capture_chance_n, 0, true, nil)
end
})
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
mobs:spawn({
name = mob_id,
nodes = l_spawn_in,
neighbors = l_spawn_near_bird,
min_light = 10,
interval = 90, --30
chance = l_spawn_chance_bird,
active_object_count = 1,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg(mob_id, "Small bird", l_egg_texture_bird, 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:custom_captured_name(mob_id,S("Wild @1",mob_name))
end

160
mobs/animal_bunny.lua Normal file
View File

@ -0,0 +1,160 @@
-- Adapted from Bunny by ExeterDad
-- TODO Edit evil bunny conditions
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.peacefull_land
usagehelp = ''
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.tamed_catch_net
local grass = S("grass")
local carrots = S("carrots")
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.feed_with(grass..' '..S("or")..' '..carrots)
--
--- --[ Definition ]--
--- ------------------------------------------
local mob_id = modname..":bunny"
mobs:register_mob(mob_id, {
-- Rabbit are peacefull animals
type = "animal",
passive = true,
reach = 1,
hp_min = 1,
hp_max = 4,
armor = 200,
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
visual = "mesh",
mesh = "mobs_bunny.b3d",
drawtype = "front",
textures = {
{"mobs_bunny_grey.png"},
{"mobs_bunny_brown.png"},
{"mobs_bunny_white.png"},
},
sounds = {},
makes_footstep_sound = false,
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
drops = {
{name = "mobs:meat_raw", chance = 0.75, min = 1, max = 1},
{name = "mobs:rabbit_hide", chance = 0.25, min = 1, max = 1},
},
water_damage = 1,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
animation = {
speed_normal = 15,
stand_start = 1,
stand_end = 15,
walk_start = 16,
walk_end = 24,
punch_start = 16,
punch_end = 24,
},
follow = {"farming:carrot", "farming_plus:carrot_item", "default:grass_1"},
view_range = 8,
replace_rate = 10,
replace_what = {"farming:carrot_7", "farming:carrot_8", "farming_plus:carrot"},
replace_with = "air",
on_rightclick = function(self, clicker)
-- feed or tame
if mobs:feed_tame(self, clicker, 4, true, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 10, 30, 0, false, nil) then return end
-- Monty Python tribute
local item = clicker:get_wielded_item()
if item:get_name() == "mobs:lava_orb" then
if not mobs.is_creative(clicker:get_player_name()) then
item:take_item()
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_bunny_evil.png"},
})
self.type = "monster"
self.health = 20
return
end
end,
on_spawn = function(self)
local pos = self.object:get_pos() ; pos.y = pos.y - 1
-- white snowy bunny
if minetest.find_node_near(pos, 1,
{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
self.base_texture = {"mobs_bunny_white.png"}
self.object:set_properties({textures = self.base_texture})
-- brown desert bunny
elseif minetest.find_node_near(pos, 1,
{"default:desert_sand", "default:desert_stone"}) then
self.base_texture = {"mobs_bunny_brown.png"}
self.object:set_properties({textures = self.base_texture})
-- grey stone bunny
elseif minetest.find_node_near(pos, 1,
{"default:stone", "default:gravel"}) then
self.base_texture = {"mobs_bunny_grey.png"}
self.object:set_properties({textures = self.base_texture})
end
return true -- run only once, false/nil runs every activation
end,
attack_type = "dogfight",
damage = 5,
})
--
--- --[ Spawn ]--
--- ------------------------------------------
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:prairie_dirt"
end
mobs:spawn({
name = mob_id,
nodes = {spawn_on},
min_light = 10,
interval = 150,
chance = 25000,
min_height = 0,
day_toggle = true,
})
mobs:register_egg(mob_id, S("Bunny"), "mobs_bunny_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:bunny", modname..":bunny") -- compatibility

237
mobs/animal_chicken.lua Normal file
View File

@ -0,0 +1,237 @@
-- Adapted from Chicken by JK Murray
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local flesh, longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.peacefull_land
longdesc = longdesc..'\n'..S("Chicken are birds, they lay eggs, they like eating seeds and they will like you if you give them some.")
usagehelp = ''
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.feed_with(S("seeds"))
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.tamed_catch_net_or_lasso
--
-- Settings
--
local CHICKEN_MEAT = minetest.settings:get_bool("mobs.animal_chicken.enable_chicken_meat") or false
local mob_id = modname..":chicken"
if not CHICKEN_MEAT then flesh = "mobs:chicken_raw" else flesh = "mobs:meat_raw" end
local chicken_drop = {
{name = "mobs:feather", chance = 5, min = 1, max = 2},
{name = flesh, chance = 6, min = 1, max = 2},
}
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 5,
hp_max = 10,
armor = 200,
collisionbox = {-0.3, -0.75, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
mesh = "mobs_chicken.x",
-- seems a lot of textures but this fixes the problem with the model
textures = {
{"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png"},
{"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png",
"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png"},
},
child_texture = {
{"mobs_chick.png", "mobs_chick.png", "mobs_chick.png", "mobs_chick.png",
"mobs_chick.png", "mobs_chick.png", "mobs_chick.png", "mobs_chick.png", "mobs_chick.png"},
},
makes_footstep_sound = true,
sounds = {
random = "mobs_chicken",
},
walk_velocity = 1,
run_velocity = 3,
runaway = true,
drops = chicken_drop,
water_damage = 1,
lava_damage = 5,
light_damage = 0,
fall_damage = 0,
fall_speed = -8,
fear_height = 5,
animation = {
speed_normal = 15,
stand_start = 0,
stand_end = 1, -- 20
walk_start = 20,
walk_end = 40,
},
follow = {"farming:seed_wheat", "farming:seed_cotton",
"crops:pumpkin_seed", "crops:tomato_seed", "crops:green_bean_seed",
"crops:melon_seed", "crops:potato_eyes", "crops:corn"},
view_range = 5,
replace_rate = 10,
replace_what = {"group:flora", "group:horsetail", "group:seed", "group:plant"},
replace_with = "air",
replace_offset = 0,
--~ on_replace = function(self, pos, oldnode, newnode)
--~ --return false to keep node, true to replace
--~ return false
--~ end,
on_rightclick = function(self, clicker)
-- Grow new feathers
if mobs:feed_tame(self, clicker, 8, true, true) then
-- New Feather whan eating (sometimes)
if self.gotten == true and math.random(1,3) == 1 then
self.gotten = false
end
return
end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 5, 30, 30, false, nil) then return end
-- Take feathers
if not self.gotten then
local item = "mobs:feather"
local num = math.random(1,3)
local pos = self.object:get_pos()
for n=1,num do
local p = {x=pos.x + math.random(-1, 1), y=pos.y + 1, z=pos.z + (math.random(-1, 1))}
minetest.add_item(p, item)
end
minetest.sound_play("mobs_chicken", {
pos = pos,
gain = 0.7,
max_hear_distance = 3,
})
self.gotten = true
end
end,
do_custom = function(self, dtime)
self.egg_timer = (self.egg_timer or 0) + dtime
if self.egg_timer < 10 then
return
end
self.egg_timer = 0
if self.child
or math.random(1, 100) > 1 then
return
end
local pos = self.object:get_pos()
minetest.add_item(pos, "mobs:egg")
minetest.sound_play("default_place_node_hard", {
pos = pos,
gain = 1.0,
max_hear_distance = 5,
})
end,
})
local spawn_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter",
"default:dirt_with_coniferous_litter", "ethereal:bamboo_dirt"}
mobs:spawn({
name = mob_id,
nodes = spawn_on,
min_light = 10,
interval = 150, --30
chance = 25000,
active_object_count = 2,
min_height = 0,
day_toggle = true,
})
mobs:register_egg(mob_id, S("Chicken"), "mobs_chicken_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:chicken", mob_id) -- compatibility
--[[
-- egg entity
mobs:register_arrow(modname..":egg_entity", {
visual = "sprite",
visual_size = {x=.5, y=.5},
textures = {"mobs_chicken_egg.png"},
velocity = 6,
hit_player = function(self, player)
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
end,
hit_mob = function(self, player)
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
end,
hit_node = function(self, pos, node)
if math.random(1, 10) > 1 then
return
end
pos.y = pos.y + 1
local nod = minetest.get_node_or_nil(pos)
if not nod
or not minetest.registered_nodes[nod.name]
or minetest.registered_nodes[nod.name].walkable == true then
return
end
local mob = minetest.add_entity(pos, mob_id)
local ent2 = mob:get_luaentity()
mob:set_properties({
textures = ent2.child_texture[1],
visual_size = {
x = ent2.base_size.x / 2,
y = ent2.base_size.y / 2
},
collisionbox = {
ent2.base_colbox[1] / 2,
ent2.base_colbox[2] / 2,
ent2.base_colbox[3] / 2,
ent2.base_colbox[4] / 2,
ent2.base_colbox[5] / 2,
ent2.base_colbox[6] / 2
},
})
ent2.child = true
ent2.tamed = true
ent2.owner = self.playername
end
})
--]]

134
mobs/animal_fish.lua Normal file
View File

@ -0,0 +1,134 @@
-- Fishes
--
-- TODO make them look for coral
-- TODO add stick_fish ?
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local mob_id
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.peacefull_water
usagehelp = ''
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.wild_catch_net
-- setting to use upright sprites instead of meshes
local SPRITE_VERSION = minetest.settings:get_bool("mobs.animal_fish.sprite_version") or false
-- local variables
local l_spawn_in = {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"}
local l_spawn_near = {"default:sand","default:dirt","group:seaplants","group:seacoral"}
local l_spawn_chance = 10000
local l_cc_hand = 25
local l_cc_net = 80
local l_water_level = minetest.settings:get("water_level") - 1
local l_anims = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 80,
walk_start = 81, walk_end = 155,
run_start = 81, run_end = 155
}
local l_visual = "mesh"
local l_visual_size = {x=.75, y=.75}
local l_clown_mesh = "mobs_clownfish.b3d"
local l_trop_mesh = "mobs_fish.b3d"
local l_clown_textures = {
{"mobs_clownfish.png"},
{"mobs_clownfish2.png"}
}
local l_trop_textures = {
{"mobs_fish.png"},
{"mobs_fish2.png"},
{"mobs_fish3.png"}
}
local l_clown_textures_inv = "mobs_clownfish_inv.png"
local l_trop_textures_inv = "mobs_fish_tropical_inv.png"
if SPRITE_VERSION then
l_visual = "upright_sprite"
l_visual_size = {x=.5, y=.5}
l_clown_mesh = nil
l_trop_mesh = nil
l_clown_textures = {{l_clown_textures_inv"mobs_clownfish_inv.png"}}
l_trop_textures = {{l_clown_textures_inv"mobs_fish_tropical_inv.png"}}
end
-- Clownfish
mob_id = modname..":clownfish"
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 1,
hp_max = 4,
armor = 100,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
rotate = 270,
visual = l_visual,
mesh = l_clown_mesh,
textures = l_clown_textures,
visual_size = l_visual_size,
makes_footstep_sound = false,
stepheight = 0.1,
fly = true,
fly_in = "default:water_source",
fall_speed = 0,
view_range = 8,
water_damage = 0,
lava_damage = 5,
light_damage = 0,
animation = l_anims,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_cc_hand, l_cc_net, 0, true, nil)
end
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific(mob_id, l_spawn_in, l_spawn_near, 5, 20, 30, l_spawn_chance, 1, -31000, l_water_level)
mobs:register_egg(mob_id, "Clownfish", l_clown_textures_inv, 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:clownfish", mob_id) -- compatibility
-- Tropical fish
mob_id = modname..":fish_tropical"
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 1,
hp_max = 4,
armor = 100,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
rotate = 270,
visual = l_visual,
mesh = l_trop_mesh,
textures = l_trop_textures,
visual_size = l_visual_size,
makes_footstep_sound = false,
stepheight = 0.1,
fly = true,
fly_in = "default:water_source",
fall_speed = 0,
view_range = 8,
water_damage = 0,
lava_damage = 5,
light_damage = 0,
animation = l_anims,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_cc_hand, l_cc_net, 0, true, nil)
end
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific(mob_id, l_spawn_in, l_spawn_near, 5, 20, 30, l_spawn_chance, 1, -31000, l_water_level)
mobs:register_egg(mob_id, "Tropical fish", l_trop_textures_inv, 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:fish_tropical", mob_id) -- compatibility

60
mobs/animal_jellyfish.lua Normal file
View File

@ -0,0 +1,60 @@
-- Jellyfishs
-- TODO make them harm players if too close
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.peacefull_water
usagehelp = ''
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.wild_catch_net
local mob_id = modname..":jellyfish"
mobs:register_mob(mob_id, {
type = "animal",
attack_type = "dogfight",
damage = 5,
reach = 1,
hp_min = 5,
hp_max = 10,
armor = 100,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "mesh",
mesh = "mobs_jellyfish.b3d",
textures = {
{"mobs_jellyfish.png"}
},
makes_footstep_sound = false,
walk_velocity = 0.1,
run_velocity = 0.1,
fly = true,
fly_in = "default:water_source",
fall_speed = 0,
view_range = 10,
water_damage = 0,
lava_damage = 5,
light_damage = 0,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, 3, 40, 0, true, nil)
end
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific(mob_id,
{"default:water_source"},
{"default:water_flowing","default:water_source"},
5, 20, 30, 10000, 1, -31000, 0)
mobs:register_egg(mob_id, "Jellyfish", "mobs_jellyfish_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:jellyfish", mob_id) -- compatibility

92
mobs/animal_kitten.lua Normal file
View File

@ -0,0 +1,92 @@
-- Adapted from Kitten by Jordach / BFD
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.peacefull_land
longdesc = longdesc..'\n'..S(".")
usagehelp = ''
local food = S("fish")
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.feed_with(food)
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.tamed_catch_net_or_lasso
local mob_id = modname..":kitten"
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 5,
hp_max = 10,
armor = 200,
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
visual_size = {x = 0.5, y = 0.5},
mesh = "mobs_kitten.b3d",
textures = {
{"mobs_kitten_striped.png"},
{"mobs_kitten_splotchy.png"},
{"mobs_kitten_ginger.png"},
{"mobs_kitten_sandy.png"},
},
makes_footstep_sound = false,
sounds = {
random = "mobs_kitten",
},
walk_velocity = 0.6,
run_velocity = 2,
runaway = true,
jump = false,
drops = {
{name = "farming:string", chance = 1, min = 1, max = 1},
},
water_damage = 1,
lava_damage = 5,
fear_height = 3,
animation = {
speed_normal = 42,
stand_start = 97,
stand_end = 192,
walk_start = 0,
walk_end = 96,
},
follow = {"ethereal:fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical",
modname..":clownfish", modname..":fish_tropical",
"mobs:clownfish", "mobs:fish_tropical",
"mobs_animal:rat", modname..":rat", "mobs:rat"},
view_range = 8,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 4, true, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 30, 40, 40, false, nil) then return end
end
})
mobs:spawn({
name = mob_id,
nodes = {"default:dirt_with_grass", "ethereal:grove_dirt"},
min_light = 12,
interval = 900, --30
chance = 72000,
min_height = 45,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg(mob_id, S("Kitten"), "mobs_kitten_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:kitten", mob_id) -- compatibility

92
mobs/animal_penguin.lua Normal file
View File

@ -0,0 +1,92 @@
--Adapted form Penguin by D00Med
-- TODO hunt fish
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..S("Penguins are funny little animals who lives in snowy regions. They likes to eat fishs and to slide on ice.")
usagehelp = ''
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.feed_with(S("fish"))
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.tamed_catch_net_or_lasso
local mob_id = modname..":penguin"
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
reach = 1,
hp_min = 5,
hp_max = 10,
armor = 200,
collisionbox = {-0.2, -0.0, -0.2, 0.2, 0.5, 0.2},
visual = "mesh",
mesh = "mobs_penguin.b3d",
visual_size = {x = 0.25, y = 0.25},
textures = {
{"mobs_penguin.png"},
},
sounds = {},
makes_footstep_sound = true,
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = false,
stepheight = 1.1,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
animation = {
speed_normal = 15,
stand_start = 1,
stand_end = 20,
walk_start = 25,
walk_end = 45,
fly_start = 75, -- swim animation
fly_end = 95,
-- 50-70 is slide/water idle
},
fly_in = {"default:water_source", "default:water_flowing"},
floats = 0,
follow = {"ethereal:fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical",
modname..":clownfish", modname..":fish_tropical",
"mobs:clownfish", "mobs:fish_tropical"},
view_range = 5,
on_rightclick = function(self, clicker)
-- Feed, Protect, or Tame
if mobs:feed_tame(self, clicker, 4, false, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 0, 40, 30, false, nil) then return end
end,
})
mobs:spawn({
name = mob_id,
nodes = {"default:snowblock"},
min_light = 10,
chance = 20000,
min_height = 0,
day_toggle = true,
})
mobs:register_egg(mob_id, S("Penguin"), "mobs_penguin_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:penguin", mob_id) -- compatibility

356
mobs/animal_sheep.lua Normal file
View File

@ -0,0 +1,356 @@
--Adapted from Sheep by PilzAdam, texture converted to minetest by AMMOnym from Summerfield pack
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Minetest settings
--
local ENABLE_RIDING = minetest.settings:get_bool("mobs.animal_sheep.enable_riding") or true
local ENABLE_DYE = minetest.settings:get_bool("mobs.animal_sheep.enable_dye") or true
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.peacefull_land
longdesc = longdesc..'\n'..S(".")
usagehelp = ''
usagehelp = usagehelp..'\n'..S("Right-click with shears to get wool.")
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.feed_with(S("wheat"))
usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.tamed_catch_net_or_lasso
if ENABLE_DYE then usagehelp = usagehelp..'\n'..S("When tamed, can be dyed using right-click.") end
if ENABLE_RIDING then usagehelp = usagehelp..'\n'..mobs.textstrings.usagehelp.tamed_ride end
local mob_id = modname..":sheep"
local sheep = {}
sheep.stepheight = 0.6
--
-- Colors
--
local all_colours = {
{"black", S("Black"), "#000000b0"}, -- 1
{"blue", S("Blue"), "#015dbb70"}, -- 2
{"brown", S("Brown"), "#663300a0"}, -- 3
{"cyan", S("Cyan"), "#01ffd870"}, -- 4
{"dark_green", S("Dark Green"), "#005b0770"}, -- 5
{"dark_grey", S("Dark Grey"), "#303030b0"}, -- 6
{"green", S("Green"), "#61ff0170"}, -- 7
{"grey", S("Grey"), "#5b5b5bb0"}, -- 8
{"magenta", S("Magenta"), "#ff05bb70"}, -- 9
{"orange", S("Orange"), "#ff840170"}, -- 10
{"pink", S("Pink"), "#ff65b570"}, -- 11
{"red", S("Red"), "#ff0000a0"}, -- 12
{"violet", S("Violet"), "#2000c970"}, -- 13
{"white", S("White"), "#abababc0"}, -- 14
{"yellow", S("Yellow"), "#e3ff0070"}, -- 15
}
local wild_colours = { 1, 3, 6, 8, 14 }
sheep.set_color = function(self,colordata)
self.base_texture = {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. colordata[3] .. ")"}
self._wool_color = colordata[1]
if not self.gotten then
self.object:set_properties({textures = self.base_texture})
end
end
--
-- Riding
--
sheep.ride_on_rightclik = function(self, clicker, itemname)
if not ENABLE_RIDING then return end
local name = clicker:get_player_name()
-- Return if not tamed
if not ( self.tamed and self.owner == clicker:get_player_name() ) then
minetest.chat_send_player(name, S("Not tamed!"))
return
end
if not (item and itemname) then
item = clicker:get_wielded_item()
itemname = item:get_name()
end
local inv = clicker:get_inventory()
-- Are we ridding? --
-- detatch player already riding horse
if self.driver and clicker == self.driver then
mobs.detach(clicker, {x = 1, y = 0, z = 1})
self.object:set_properties({stepheight = sheep.stepheight})
-- add saddle back to inventory
if inv:room_for_item("main", "mobs:saddle") then
inv:add_item("main", "mobs:saddle")
else
minetest.add_item(clicker.getpos(), "mobs:saddle")
end
return true
-- attach player to horse
elseif not self.driver and itemname == "mobs:saddle" then
self.object:set_properties({stepheight = 1.1})
mobs.attach(self, clicker)
-- take saddle from inventory
inv:remove_item("main", "mobs:saddle")
return true
end
end
sheep.ride_do_custom = function(self, dtime)
if not ENABLE_RIDING then return end
-- set needed values if not already present
if not self.v2 then
self.v2 = 0
self.max_speed_forward = 6
self.max_speed_reverse = 2
self.accel = 6
self.terrain_type = 3
self.driver_attach_at = {x = 0, y = 0, z = -2} -- y == 20
self.driver_eye_offset = {x = 0, y = 0.5, z = 0}
self.driver_scale = {x = 1, y = 1}
end
-- if driver present allow control of sheep
if self.driver then
mobs.drive(self, "walk", "stand", false, dtime)
return false -- skip rest of mob functions
end
return true
end
--
-- Coloring
--
sheep.dye_on_rightclik= function(self, clicker)
local name = clicker:get_player_name()
if not (item and itemname) then
item = clicker:get_wielded_item()
itemname = item:get_name()
end
if not itemname:find("dye:") then return end
local can_dye = ( self.gotten == false
and self.child == false
and self.tamed == true
and name == self.owner )
-- Return if not allow
if not can_dye then
minetest.chat_send_player(name, S("Impossible!"))
return
end
local colr = string.split(itemname, ":")[2]
for _,c in ipairs(all_colours) do
if c[1] == colr then
-- set color
sheep.set_color(self,c)
-- take item
if not mobs.is_creative(clicker:get_player_name()) then
item:take_item()
clicker:set_wielded_item(item)
end
break
end
end
return true
end
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 8,
hp_max = 10,
armor = 200,
collisionbox = {-0.5, -1, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "mobs_sheep.b3d",
textures = {
{"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. "#abababc0" .. ")"},
},
gotten_texture = {"mobs_sheep_shaved.png"},
gotten_mesh = "mobs_sheep_shaved.b3d",
makes_footstep_sound = true,
sounds = {
random = "mobs_sheep",
},
walk_velocity = 1,
run_velocity = 2,
runaway = true,
stepheight = sheep.stepheight,
-- jump = false,
jump = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
--{name = "wool:"..col[1], chance = 1, min = 1, max = 1},
},
water_damage = 1,
lava_damage = 5,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 80,
walk_start = 81,
walk_end = 100,
},
follow = {"farming:wheat", "default:grass_5", "default:grass_3"},
view_range = 8,
replace_rate = 10,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "air",
replace_offset = -1,
fear_height = 3,
--[[
on_replace = function(self, pos, oldnode, newnode)
print ("---- replaced") ; return false -- false to keep node, true to replace
end,
]]
-- Select random color on spawn
on_spawn = function(self)
local k = math.random(1,#wild_colours)
local l = wild_colours[k]
local c = all_colours[l]
sheep.set_color(self,c)
return true -- run only once, false/nil runs every activation
end,
do_custom = function(self, dtime)
if sheep.ride_do_custom(self, dtime) then return true end
end,
on_die = function(self, pos)
-- drop saddle when horse is killed while riding
-- also detach from horse properly
if self.driver then
minetest.add_item(pos, "mobs:saddle")
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
end
end,
on_rightclick = function(self, clicker)
-- Are we feeding? --
if mobs:feed_tame(self, clicker, 8, true, true) then
--if full grow fuzz (sometimes)
if self.gotten == true and math.random(1,3) == 1 then
self.object:set_properties({
textures = self.base_texture,
mesh = "mobs_sheep.b3d",
})
self.gotten = false
end
return
end
local item = clicker:get_wielded_item()
local itemname = item:get_name()
-- Are we giving a haircut ? --
--if itemname == "mobs:shears" or itemname == "vines:shears" then
-- Any kind of shears will do
if itemname:find(":shears") then
if self.gotten ~= false
or self.child ~= false
or not minetest.get_modpath("wool") then
return
end
self.gotten = true -- shaved
local obj = minetest.add_item(
self.object:get_pos(),
ItemStack( "wool:" .. self._wool_color .. " " .. math.random(1, 3) )
)
if obj then
obj:setvelocity({
x = math.random(-1, 1),
y = 5,
z = math.random(-1, 1)
})
end
item:add_wear(650) -- 100 uses
clicker:set_wielded_item(item)
self.object:set_properties({
textures = {"mobs_sheep_shaved.png"},
mesh = "mobs_sheep_shaved.b3d",
})
return
end
-- Coloring --
if sheep.dye_on_rightclik(self, clicker, item, itemname) then return end
-- Riding
if sheep.ride_on_rightclik(self, clicker, item, itemname) then return end
-- protect mod with mobs:protector item
if mobs:protect(self, clicker) then return end
-- Are we capturing? --
if mobs:capture_mob(self, clicker, 0, 5, 40, false, nil) then return end
end
})
mobs:register_egg(mob_id, S("Sheep"), "mobs_sheep_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:green_dirt"
end
mobs:spawn({
name = mob_id,
nodes = {spawn_on},
min_light = 10,
interval = 150, --30
chance = 15000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:alias_mob("mobs:sheep", mob_id) -- compatibility

156
mobs/animal_turtles.lua Normal file
View File

@ -0,0 +1,156 @@
-- Turtles
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
-- Other variables
local mob_id, mob_name, longdesc_seaturtles, usagehelp_seaturtle, longdesc_landturtle, usagehelp_landturtle, longdesc, usagehelp
--
-- Documentation for help/doc modpack
--
-- Land turtles
longdesc_landturtle = ''
longdesc_landturtle = longdesc_landturtle..'\n'..mobs.textstrings.longdesc.peacefull_land
longdesc_landturtle = longdesc_landturtle..'\n'..S(".")
usagehelp_landturtle = ''
usagehelp_landturtle = usagehelp_landturtle..'\n'..mobs.textstrings.usagehelp.wild_catch_net_or_lasso
-- Sea turtles
-- TODO make them eat jellyfish
longdesc_seaturtle = ''
longdesc_seaturtle = longdesc_seaturtle..'\n'..mobs.textstrings.longdesc.peacefull_water
usagehelp_seaturtle = ''
usagehelp_seaturtle = usagehelp_seaturtle..'\n'..mobs.textstrings.usagehelp.wild_catch_net_or_lasso
local l_colors = {
"#604000:175", --brown
"#604000:100", --brown2
"#ffffff:150", --white
"#404040:150", --dark_grey
"#a0a0a0:150", --grey
"#808000:150", --olive
"#ff0000:150" --red
}
local l_skins = {
{"mobs_turtle1.png^mobs_turtle2.png^mobs_turtle3.png^mobs_turtle4.png^mobs_turtle5.png^mobs_turtle6.png^mobs_turtle7.png"},
{"mobs_turtle1.png^(mobs_turtle2.png^[colorize:"..l_colors[5]..")^(mobs_turtle3.png^[colorize:"..l_colors[4]..")^(mobs_turtle4.png^[colorize:"..l_colors[1]..")^(mobs_turtle5.png^[colorize:"..l_colors[2]..")^(mobs_turtle6.png^[colorize:"..l_colors[6]..")^mobs_turtle7.png"}
}
local l_anims = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 50,
walk_start = 60, walk_end = 90,
run_start = 60, run_end = 90,
hide_start = 95, hide_end = 100
}
local l_model = "mobs_turtle.x"
local l_spawn_chance = 30000
------------------------------------------------------------------------
-- land turtle
------------------------------------------------------------------------
longdesc = longdesc_landturtle
usagehelp = usagehelp_landturtle
mob_id = modname..":turtle"
mob_name = S("Turtle")
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 15,
hp_max = 20,
armor = 200,
collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.35, 0.4},
visual = "mesh",
mesh = l_model,
textures = l_skins,
makes_footstep_sound = false,
view_range = 8,
rotate = 270,
walk_velocity = 0.1,
run_velocity = 0.3,
jump = false,
fly = false,
floats = 1,
water_damage = 0,
lava_damage = 5,
light_damage = 0,
fall_damage = 1,
animation = l_anims,
follow = {"farming:carrot","default:jungle_grass"},
on_rightclick = function(self, clicker)
self.state = ""
self.object:set_velocity({x=0,y=0,z=0})
self.object:set_animation({x=self.animation.hide_start, y=self.animation.hide_end}, self.animation.speed_normal, 0)
local t = math.random(4,12)
minetest.after(t, function()
self.state = "stand"
end)
mobs:capture_mob(self, clicker, 0, 40, 30, true, nil)
end
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific(mob_id,
{"default:dirt_with_grass","default:jungle_grass","default:sand","default:desert_sand"},
{"default:dirt_with_grass","default:jungle_grass","default:sand","default:desert_sand","default:papyrus","default:cactus","dryplants:juncus","dryplants:reedmace"},
5, 20, 150, l_spawn_chance, 1, 1, 31000)
mobs:register_egg(mob_id, mob_name, "mobs_turtle_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:custom_captured_name(mob_id,S("Wild @1",mob_name))
mobs:alias_mob("mobs:turtle", mob_id) -- compatibility
------------------------------------------------------------------------
-- sea turtle
------------------------------------------------------------------------
longdesc = longdesc_seaturtle
usagehelp = usagehelp_seaturtle
mob_id = modname..":seaturtle"
mob_name = S("Sea Turtle")
mobs:register_mob(mob_id, {
type = "animal",
passive = true,
hp_min = 20,
hp_max = 30,
armor = 250,
collisionbox = {-0.8, 0.0, -0.8, 0.8, 0.7, 0.8},
visual = "mesh",
visual_size = {x=2,y=2},
mesh = l_model,
textures = l_skins,
makes_footstep_sound = false,
view_range = 10,
rotate = 270,
walk_velocity = 1,
run_velocity = 1.5,
stepheight = 1,
jump = false,
fly = true,
fly_in = "default:water_source",
fall_speed = 0,
floats = 1,
water_damage = 0,
lava_damage = 5,
light_damage = 0,
fall_damage = 0,
animation = l_anims,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, 0, 30, 30, true, nil)
end
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific(mob_id,
{"default:water_flowing","default:water_source"},
{"default:water_flowing","default:water_source","group:seaplants","seawrecks:woodship","seawrecks:uboot"},
5, 20, 150, l_spawn_chance, 1, -31000, 0)
mobs:register_egg(mob_id, mob_name, "mobs_seaturtle_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:custom_captured_name(mob_id,S("Wild @1",mob_name))
mobs:alias_mob("mobs:seaturtle", mob_id) -- compatibility

210
mobs/monster_lava_flan.lua Normal file
View File

@ -0,0 +1,210 @@
-- Lava Flan by Zeg9 (additional textures by JurajVajda)
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.hostile_custom(S("near lava"))
longdesc = longdesc..'\n'..S("Is is hurt by water and healed by lava or fire")
usagehelp = ''
usagehelp = usagehelp..'\n'..S("Turns to obsidian when hit with a bucket of water")
local mob_id = modname..":lava_flan"
mobs:register_mob(mob_id, {
type = "monster",
passive = false,
attack_type = "dogfight",
reach = 1,
damage = 3,
hp_min = 10,
hp_max = 35,
armor = 80,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
visual = "mesh",
mesh = "mobs_lava_flan.x",
textures = {
{"mobs_lava_flan.png"},
{"mobs_lava_flan2.png"},
{"mobs_lava_flan3.png"},
},
blood_texture = "fire_basic_flame.png",
makes_footstep_sound = false,
sounds = {
random = "mobs_lavaflan",
war_cry = "mobs_lavaflan",
},
walk_velocity = 0.5,
run_velocity = 2,
step_height = 0.6, -- FIXME : They keep climbing one block steps
jump = false,
jump_height = 0,
replace_rate = 300, -- Nether rack is everywhere so don't replace too often unless you want everything turned to lava
replace_what = {"nether:rack"},
replace_with = "default:lava_source",
replace_offset = -1,
view_range = 10,
floats = 1,
drops = {
{name = "default:coal_lump", chance = 6, min = 1, max = 2},
{name = "default:coal", chance = 36, min = 1, max = 1},
{name = "mobs:lava_orb", chance = 15, min = 1, max = 1},
},
water_damage = 5,
lava_damage = -0.5,
light_damage = 0,
animation = {
speed_normal = 15,
speed_run = 15,
stand_start = 0,
stand_end = 8,
walk_start = 10,
walk_end = 18,
run_start = 20,
run_end = 28,
punch_start = 20,
punch_end = 28,
},
on_die = function(self, pos)
minetest.set_node(pos, {name = "fire:basic_flame"})
self.object:remove()
minetest.add_particlespawner({
amount = 20,
time = 0.25,
minpos = pos,
maxpos = pos,
minvel = {x = -2, y = -2, z = -2},
maxvel = {x = 2, y = 2, z = 2},
minacc = {x = 0, y = -10, z = 0},
maxacc = {x = 0, y = -10, z = 0},
minexptime = 0.1,
maxexptime = 1,
minsize = 0.5,
maxsize = 1.0,
texture = "fire_basic_flame.png",
})
end,
})
mobs:spawn({
name = mob_id,
nodes = {"nether:rack"}, --{"default:lava_source"},
neighbors = {"air"},
interval = 50,
chance = 700,
active_object_count = 2,
max_height = -100,
})
mobs:register_egg(mob_id, S("Lava Flan"), "mobs_lava_flan_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:lava_flan", mob_id) -- compatibility
-- lava orb
minetest.register_craftitem(":mobs:lava_orb", {
description = S("Lava orb"),
inventory_image = "mobs_lava_orb.png",
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
minetest.register_craft({
type = "fuel",
recipe = "mobs:lava_orb",
burntime = 80,
})
--[[
-- Lava Pick (digs and smelts at same time)
local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger)
-- are we holding Lava Pick?
if digger:get_wielded_item():get_name() ~= ("mobs:pick_lava") then
return old_handle_node_drops(pos, drops, digger)
end
-- reset new smelted drops
local hot_drops = {}
-- loop through current node drops
for _, drop in pairs(drops) do
-- get cooked output of current drops
local stack = ItemStack(drop)
local output = minetest.get_craft_result({
method = "cooking",
width = 1,
items = {drop}
})
-- if we have cooked result then add to new list
if output
and output.item
and not output.item:is_empty() then
table.insert(hot_drops,
ItemStack({
name = output.item:get_name(),
count = output.item:to_table().count,
})
)
else -- if not then return normal drops
table.insert(hot_drops, stack)
end
end
return old_handle_node_drops(pos, hot_drops, digger)
end
minetest.register_tool(":mobs:pick_lava", {
description = S("Lava Pickaxe"),
inventory_image = "mobs_pick_lava.png",
tool_capabilities = {
full_punch_interval = 0.4,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=1.80, [2]=0.80, [3]=0.40}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=6},
},
})
minetest.register_craft({
output = "mobs:pick_lava",
recipe = {
{"mobs:lava_orb", "mobs:lava_orb", "mobs:lava_orb"},
{"", "default:obsidian_shard", ""},
{"", "default:obsidian_shard", ""},
}
})
-- Add [toolranks] mod support if found
if minetest.get_modpath("toolranks") then
minetest.override_item("mobs:pick_lava", {
original_description = "Lava Pickaxe",
description = toolranks.create_description("Lava Pickaxe", 0, 1),
after_use = toolranks.new_afteruse})
end
-]]

146
mobs/monster_oerkki.lua Normal file
View File

@ -0,0 +1,146 @@
-- Adapted from Oerkki by PilzAdam
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
--- --[ Documentation for help/doc modpack ]--
-- ------------------------------------------
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.hostile_dark
longdesc = longdesc..'\n'..S("Hurted by bright light")..', '
longdesc = longdesc..' '..S("they thrive in darkness and will blow torches out on their way.")
longdesc = longdesc..'\n'.. mobs.textstrings.longdesc.a_long_time_ago_2
longdesc = longdesc..' '.. mobs.textstrings.longdesc.history_oerkki_1
--usagehelp = ''
--usagehelp = usagehelp..'\n'..S(".")
--
--- --[ Variables ]--
-- ------------------------------------------
local mob_id = modname..":oerkki"
-- Will not spawn above this height
local max_spawn_height = -200
local dm = 1
if mobs.mobs_bundle_settings.damages.nopositional then dm = 2 end
--
--- --[ Definition ]--
-- ------------------------------------------
mobs:register_mob(mob_id, {
type = "monster",
passive = false,
attack_type = "dogfight",
pathfinding = true,
reach = 1,
damage = 2*dm,
hp_min = 4*dm,
hp_max = 16*dm,
armor = 100,
collisionbox = {-0.4, -1, -0.4, 0.4, 0.9, 0.4},
visual = "mesh",
mesh = "mobs_oerkki.b3d",
textures = {
{"mobs_oerkki.png"},
{"mobs_oerkki2.png"},
},
makes_footstep_sound = false,
sounds = {
random = "mobs_oerkki",
},
walk_velocity = 1,
run_velocity = 3,
view_range = 10,
step_height = 0.6,
jump = true,
jump_height = 1.1,
drops = {
{name = "default:obsidian", chance = 18, min = 1, max = 2},
{name = "default:obsidian_shard", chance = 3, min = 1, max = 2},
},
water_damage = 2,
lava_damage = 4,
light_damage = 1,
fear_height = 4,
animation = {
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 36,
run_start = 37,
run_end = 49,
punch_start = 37,
punch_end = 49,
speed_normal = 15,
speed_run = 15,
},
replace_rate = 5,
replace_what = {"default:torch"},
replace_with = "air",
replace_offset = -1,
immune_to = {
{"default:sword_wood", 0}, -- no damage
{"default:gold_lump", -10}, -- heals by 10 points
},
on_die = function(self, pos)
if math.random(1,5) < 2 then mobs:drop_something_from_treasurer(self, pos, max_spawn_height) end
end
})
--
--- --[ Spawn ]--
--- ------------------------------------------
mobs:spawn({
name = mob_id,
nodes = {"default:stone"},
max_light = 4,
chance = 17000,
interval = 50,
max_height = max_spawn_height,
day_toggle = false,
on_spawn = mobs.custom_on_spawn,
})
--- --[ Nether Spawn ]--
if minetest.get_modpath('nether') then
local NETHER_DEPTH = tonumber(minetest.settings:get("nether_depth")) or -5000
mobs:spawn({
name = mob_id,
nodes = {"nether:rack"},
max_light = 8,
chance = 1700,
interval = 50,
max_height = NETHER_DEPTH,
})
end
--
--- --[ Egg ]--
--- ------------------------------------------
mobs:register_egg(mob_id, S("Oerkki"), "mobs_oerkki_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
--
--- --[ Alias ]--
--- ------------------------------------------
mobs:alias_mob("mobs:oerkki", mob_id) -- compatiblity

View File

@ -0,0 +1,106 @@
-- Sand Monster by PilzAdam
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'..mobs.textstrings.longdesc.hostile_custom(S("in deserts and pyramids"))
longdesc = longdesc..'\n'.. mobs.textstrings.longdesc.a_long_time_ago_3
longdesc = longdesc..' '.. mobs.textstrings.longdesc.history_mummy_1
longdesc = longdesc..' '.. mobs.textstrings.longdesc.history_mummy_2
--usagehelp = ''
--usagehelp = usagehelp..'\n'..S(".")
local mob_id = modname..":sand_monster"
mobs:register_mob(mob_id, {
type = "monster",
passive = false,
attack_type = "dogfight",
pathfinding = false,
--specific_attack = {"player", "mobs_npc:npc"},
reach = 2,
damage = 1,
hp_min = 4,
hp_max = 20,
armor = 100,
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
visual = "mesh",
mesh = "mobs_sand_monster.b3d",
textures = {
{"mobs_mummy.png"},
-- {"mobs_sand_monster.png"},
},
makes_footstep_sound = true,
sounds = {
random = "creatures_mummy", --"mobs_sandmonster",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "creatures_mummy_hit",
death = "creatures_mummy_death",
},
walk_velocity = 0.5,
run_velocity = 1,
view_range = 8, --15
jump = false,
-- jump_height=0,
-- step_height=0,
runaway = true,
floats = 0,
drops = {
{name = "mobs:rotten_flesh", chance = 7, min = 1, max = 2,},
{name = "default:papyrus", chance = 6, min = 1, max = 2,},
{name = "default:paper", chance = 16, min = 1, max = 3,},
{name = "default:desert_sand", chance = 10, min = 3, max = 5},
},
water_damage = 3,
lava_damage = 4,
light_damage = 0,
fear_height = 4,
animation = {
speed_normal = 15,
speed_run = 20,
stand_start = 0,
stand_end = 39,
walk_start = 74, --41,
walk_end = 105, --72,
run_start = 74,
run_end = 105,
punch_start = 74,
punch_end = 105,
},
--[[
custom_attack = function(self, p)
local pos = self.object:get_pos()
minetest.add_item(pos, "default:sand")
end,
]]
})
mobs:spawn({
name = mob_id,
nodes = {"default:sand", "default:desert_sand", "default:silver_sand", "default:desert_stone"},
neighbors = {"air"},
chance = 20000,
active_object_count = 2,
max_light = 5,
max_height = 100,
day_toggle = false,
})
mobs:register_egg(mob_id, S("Sand Monster"), "mobs_mummy_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:sand_monster", mob_id) -- compatibility
mobs:alias_mob("mobs:mummy", mob_id) -- compatibility

161
mobs/monster_slimes.lua Normal file
View File

@ -0,0 +1,161 @@
-- Slimes
-- TODO change drops, attact player who holds something
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
local longdesc, usagehelp
longdesc = ''
--longdesc = longdesc..'\n'..mobs.textstrings.longdesc.peacefull_land
usagehelp = ''
usagehelp = usagehelp..'\n'
-- sounds
local green_sounds = {
damage = "slimes_damage",
death = "slimes_death",
jump = "slimes_jump",
attack = "slimes_attack"
}
local l_spawn_elevation_min = tonumber(minetest.settings:get("water_level"))
if l_spawn_elevation_min then
l_spawn_elevation_min = l_spawn_elevation_min + 2
else
l_spawn_elevation_min = 2
end
-- textures
local green_textures = {"mobs_green_slime_sides.png", "mobs_green_slime_sides.png", "mobs_green_slime_sides.png",
"mobs_green_slime_sides.png", "mobs_green_slime_front.png", "mobs_green_slime_sides.png"}
-- local green_attack = { modname..":sheep", modname..":bunny", modname..":chicken", modname..":gull", modname..":bird_sm", modname..":bird_lg", modname..":kitten", modname..":penguin", modname..":turtle", modname.."_npcs:npc"}
local green_attack = { modname..":bunny", modname..":gull", modname..":bird_sm", modname..":bird_lg", modname..":kitten", modname..":penguin", modname..":turtle", modname.."_npcs:npc"}
local green_def = {
--type = "animal",
type = "monster",
passive = true,
visual = "cube",
textures = { green_textures },
sounds = green_sounds,
armor = 100,
blood_amount = 3,
blood_texture = "mobs_green_slime_blood.png",
fall_damage = 0,
attack_type = "dogfight",
-- attacks_monsters = true -- usually for npc's to attack monsters in area
group_attack = true, -- to defend same kind of mobs from attack in area
attack_animals = true, -- for monster to attack animals as well as player and npc's
specific_attack = green_attack,
-- docile_by_day = true,
view_range = 10,
walk_chance = 0,
walk_velocity = 2,
jump_chance = 60,
}
-------------------------------------------------
-- Small
-------------------------------------------------
local green_small_id = modname..":green_small"
local green_small_def = green_def
green_small_def.visual_size = {x = 0.5, y = 0.5}
green_small_def.collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}
green_small_def.hp_min = 2
green_small_def.hp_max = 4
green_small_def.knock_back = 3
green_small_def.blood_amount = 3
green_small_def.lava_damage = 3
green_small_def.damage = 1
green_small_def.reach = 1
green_small_def.stepheight = 0.6
green_small_def.drops = {
{name = "mobs:green_slimeball", chance = 3, min = 1, max = 2},
}
green_small_def.on_die = function(self, pos)
if math.random(1,5) < 2 then mobs:drop_something_from_treasurer(self, pos, l_spawn_elevation_min) end
end
mobs:register_mob(green_small_id,green_small_def)
mobs:spawn({
name = green_small_id,
nodes = {"default:dirt_with_grass", "default:junglegrass",
--"default:mossycobble",
"ethereal:green_dirt_top"},
neighbors = {"air"},
min_light = 6,
interval = 1500, --30
chance = 4000,
active_object_count= 3,
min_height = l_spawn_elevation_min,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg(green_small_id, "Small Green Slime", "mobs_green_slime_inv.png", 0)
mobs:doc_identifier_compat(green_small_id, longdesc, usagehelp)
-------------------------------------------------
-- Medium
-------------------------------------------------
local green_medium_id = modname..":green_medium"
green_medium_def = green_def
green_medium_def.visual_size = {x = 1, y = 1}
green_medium_def.collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
green_medium_def.hp_min = 4
green_medium_def.hp_max = 8
green_medium_def.knock_back = 2
green_medium_def.blood_amount = 4
green_medium_def.lava_damage = 7
green_medium_def.damage = 2
green_medium_def.reach = 2
green_medium_def.stepheight = 1.1
green_medium_def.on_die = function(self, pos)
-- inherit attack state and target
local staticdata = {}
if self.state == 'attack' then
staticdata = {
attack = self.attack,
state = self.state,
}
end
local num = math.random(2, 4)
for i=1,num do
local p = {x=pos.x + math.random(-2, 2), y=pos.y + 1, z=pos.z + (math.random(-2, 2))}
local obj = minetest.add_entity(p, modname..":green_small")
end
end
mobs:register_mob(green_medium_id, green_medium_def)
mobs:spawn({
name = green_medium_id,
nodes = {"default:dirt_with_grass", "default:junglegrass", "ethereal:green_dirt_top"},
neighbors = {"air"},
min_light = 6,
interval = 180,
chance = 8000,
min_height = l_spawn_elevation_min,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg(green_medium_id, "Medium Green Slime", "mobs_green_slime_inv.png", 0)
mobs:doc_identifier_compat(green_medium_id, longdesc, usagehelp)

154
mobs/monster_zombies.lua Normal file
View File

@ -0,0 +1,154 @@
-- Zombies
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Documentation for help/doc modpack
--
local longdesc, usagehelp
longdesc = ''
longdesc = longdesc..'\n'.. mobs.textstrings.longdesc.hostile_dark
longdesc = longdesc..'\n'.. mobs.textstrings.longdesc.a_long_time_ago_1
longdesc = longdesc..' '.. mobs.textstrings.longdesc.history_zombie_1
usagehelp = ''
usagehelp = usagehelp..'\n'..S("")
local mob_id = modname..":zombie"
local dm = 1
if mobs.mobs_bundle_settings.damages.nopositional then dm = 2 end
local ENABLE_MINI_ZOMBIE = minetest.settings:get_bool("mobs.monster_zombie.enable_mini_zombies") or false
local zombie_do_custom
if ENABLE_MINI_ZOMBIE then
zombie_do_custom = dofile(modpath .. "/monster_zombies_mini.lua") -- D00Med
end
-- Will not spawn above this height
local max_spawn_height = -15
-- zombie
mobs:register_mob(mob_id, {
type = "monster",
visual = "mesh",
mesh = "mobs_creatures_mob.x",
textures = {
{"mobs_zombie.png"},
},
collisionbox = {-0.25, -1, -0.3, 0.25, 0.75, 0.3},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_zombie.1",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death",
},
hp_min = 5*dm,
hp_max = 15*dm,
armor = 200,
knock_back = 1,
lava_damage = 10,
damage = 2*dm,
reach = 1,
attack_type = "dogfight",
group_attack = true,
view_range = 10,
walk_chance = 75,
walk_velocity = 0.5,
run_velocity = 0.6,
step_height = 0.6,
jump = true,
jump_height = 1.1,
drops = {
{name = "mobs:rotten_flesh", chance = 6, min = 1, max = 3,}
},
lifetimer = 180, -- 3 minutes
shoot_interval = 135, -- (lifetimer - (lifetimer / 4)), borrowed for do_custom timer
do_custom = zombie_do_custom,
--on_breed = function(self, ent) return false end
on_die = function(self, pos)
mobs:drop_something_from_treasurer(self, pos, max_spawn_height)
end
})
mobs:spawn({
name = mob_id,
nodes = {"default:stone","nether:rack"},
neighbors = {"air"},
--~ min_light = -1,
max_light = 5,
interval = 500,
chance = 2000,
active_object_count = 2,
max_height = max_spawn_height,
day_toggle = false,
on_spawn = mobs.custom_on_spawn,
})
if minetest.get_modpath('nether') then
local NETHER_DEPTH = tonumber(minetest.settings:get("nether_depth")) or -5000
mobs:spawn({
name = mob_id,
nodes = {"nether:rack"},
max_light = 8,
chance = 1700,
active_object_count = 2,
interval = 50,
max_height = NETHER_DEPTH,
})
end
mobs:register_egg(mob_id, "Zombie", "mobs_zombie_inv.png", 0)
mobs:doc_identifier_compat(mob_id, longdesc, usagehelp)
mobs:alias_mob("mobs:zombie", mob_id) -- compatibility
mobs:register_special_spawner({
id = "zombie",
description = S("Zombie Spawner"),
longdesc = S("Hostiles Zombie will spawn around this block"),
-- abm definition
neighbors = {"air"},
--interval = 2.0,
-- chance = 20,
--min_light = -1,
max_light = 4,
-- min_height = -31000,
-- max_height = 31000,
-- day_toggle = false,
-- on_spawn nil,
-- Range of spawner
-- range = 17,
-- max_mobs = 6,
-- base texture for the spawner
texture_face = "all", --"sides",
base_texture = "default_stone_block.png",--"default_stone_block.png",
-- Image drawn on the spawner block
glyph = "mobs_zombie_spawner.png",
-- Number of mobs spawned when spawner is destructed
-- last_spawn = 1
-- Chances that spawner drop nothing
-- empty_drop_chance = 2
-- Mob Spawned by spawner
mob = mob_id,
})

View File

@ -0,0 +1,64 @@
-- Mini Zombies
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local mob_id = modname..":zombie_mini"
local zombie_do_custom = function(self)
if self.lifetimer <= self.shoot_interval then
if math.random(100) <= 50 then
minetest.add_entity(self.object:getpos(), mob_id)
end
self.shoot_interval = self.shoot_interval - 45
end
end
mobs:register_mob(mob_id, {
type = "monster",
visual = "mesh",
mesh = "mobs_creatures_mob.x",
textures = {
{"mobs_zombie.png"},
},
visual_size = {x = 0.5, y = 0.5},
collisionbox = {-0.125, -0.5, -0.15, 0.125, 0.375, 0.15},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "mobs_zombie.1",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "mobs_zombie_hit",
death = "mobs_zombie_death"
},
hp_min = 20,
hp_max = 45,
armor = 150,
knock_back = 1,
lava_damage = 10,
damage = 6,
reach = 1,
attack_type = "dogfight",
group_attack = true,
view_range = 10,
walk_chance = 75,
walk_velocity = 0.8,
run_velocity = 0.8,
jump = false,
drops = {
{name = "mobs:rotten_flesh", chance = 1, min = 1, max = 1,}
}
})
return zombie_do_custom

479
mobs_api.lua Normal file
View File

@ -0,0 +1,479 @@
--
-- This file adds function to complete the mobs_redo api
--
local S = mobs.intllib
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
mobs.mobs_bundle_settings = {}
mobs.mobs_bundle_settings.damages = {}
mobs.mobs_bundle_settings.damages.nopositional = tonumber(minetest.settings:get("mobs.damages.nopositional")) or false
local animal_attack_ignore_player = true
-- Settings for positional damage
local pdam = {}
-- Disable positional damages
pdam.disable = tonumber(minetest.settings:get("mobs.damages.nopositional")) or false
-- Min and max multiplier
pdam.max = tonumber(minetest.settings:get("mobs.damages.max_multiplier")) or 11
pdam.min = tonumber(minetest.settings:get("mobs.damages.min_multiplier")) or 1
-- Upper limit for distant where to multiply -- Uuuh not clear
pdam.max_radius = tonumber(minetest.settings:get("mobs.damages.max_radius")) or minetest.settings:get("mapgen_limit") or 310000
-- Mutilpication to allow different incerases on axis
pdam.y_mult = tonumber(minetest.settings:get("mobs.damages.y_multiplier")) or 1
pdam.x_mult = tonumber(minetest.settings:get("mobs.damages.x_multiplier")) or 1
pdam.z_mult = tonumber(minetest.settings:get("mobs.damages.z_multiplier")) or 1
pdam.change_walk_velocity = tonumber(minetest.settings:get("mobs.damages.change_walk_velocity")) or true
pdam.speed_factor = tonumber(minetest.settings:get("mobs.damages.speed_factor")) or 0.1
local passive_mob_radius = tonumber(minetest.settings:get("mobs.passive_mob_radius")) or 128
local no_monster_radius = tonumber(minetest.settings:get("mobs.no_monster_radius")) or 100
local hardness = (pdam.max_radius / pdam.max) / pdam.min
-- Add leather and saddles to chests because there is not other way to get it yet
if minetest.get_modpath('treasurer') then
treasurer.register_treasure("mobs:lether",0.01,5,{1,4},nil,"crafting_component")
treasurer.register_treasure("mobs:saddle",0.0002,7,1,nil,"tool")
end
-----------------------------------------------------------------------
-- Custom check before spawning
-----------------------------------------------------------------------
function mobs:spawn_abm_check(pos, node, name)
-- global function to add additional spawn checks
-- return true to stop spawning mob
--- [ Allow spawning only outside or only inside a specific radius] ---
local ent = minetest.registered_entities[name]
--~ print('----'..name..' is spawning at '..minetest.pos_to_string(pos))
--~ print(dump(ent))
local apos = math.max(math.abs(pos.x), math.abs(pos.y), math.abs(pos.z))
if nohostile_radius and ( ent.type == "monster" ) and apos < nohostile_radius then
return true
end
end
-----------------------------------------------------------------------
-- Positional promotion
-----------------------------------------------------------------------
function mobs:promote(self,pos)
if pdam.disable then return true end
if ( not self.initial_promotion ) and self.hp_max and self.object and self.health and self.damage then
if not pos then pos = self.object:get_pos() end
pos.x = pos.x * pdam.z_mult
pos.y = pos.y * pdam.y_mult
pos.z = pos.z * pdam.z_mult
local apos = math.max(math.abs(pos.x), math.abs(pos.y), math.abs(pos.z))
if apos > pdam.max_radius then apos = pdam.max_radius end
local factor = 1 + ( apos * pdam.min / hardness)
-- These all expect that a mob will never be promoted twice,
self.hp_max = math.floor(self.hp_max * factor)
self.damage = math.floor(self.damage * factor)
self.health = math.floor(self.health * factor)
if pdam.change_walk_velocity then
self.walk_velocity = self.walk_velocity * math.max(1, pdam.speed_factor * factor)
end
self.run_velocity = self.run_velocity * math.max(1, pdam.speed_factor * factor)
self.difficulty = factor
local name = self.object:get_entity_name() or ''
--~ self.old_on_die = mob.on_die
--~ self.on_die = extra_loot_on_die
self.object:set_hp(self.health)
self.initial_promotion = true
--~ check_for_death(mob)
print('Promoting '..name..': '..self.health..' health, '..self.damage..' damage (x'..(math.floor(factor * 100) / 100)..')')
end
return true
end
mobs.custom_on_spawn = function (self,pos)
local prom = mobs:promote(self,pos)
local apos = math.max(math.abs(pos.x), math.abs(pos.y), math.abs(pos.z))
if passive_mob_radius and apos < passive_mob_radius then
if self.type == "monster" then self.type = "animal" end
self.passive = true
self.runaway = true
if not self.runaway_from then self.runaway_from = {} end
table.insert(self.runaway_from,'player')
end
return prom
end
-----------------------------------------------------------------------
-- Throw eggs
-----------------------------------------------------------------------
if not mobs.throw_egg then
-- egg throwing item
local egg_GRAVITY = 9
local egg_VELOCITY = 19
-- shoot egg
mobs.throw_egg = function(item, player, pointed_thing)
local playerpos = player:get_pos()
minetest.sound_play("default_place_node_hard", {
pos = playerpos,
gain = 1.0,
max_hear_distance = 5,
})
local obj = minetest.add_entity({
x = playerpos.x,
y = playerpos.y +1.5,
z = playerpos.z
}, modname..":egg_entity")
local ent = obj:get_luaentity()
local dir = player:get_look_dir()
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,
z = dir.z * egg_VELOCITY
})
obj:setacceleration({
x = dir.x * -3,
y = -egg_GRAVITY,
z = dir.z * -3
})
-- pass player name to egg for chick ownership
local ent2 = obj:get_luaentity()
ent2.playername = player:get_player_name()
item:take_item()
return item
end
end
-----------------------------------------------------------------------
-- Attack
-----------------------------------------------------------------------
function mobs:animal_attack(self)
-- Return there is a reason to prevent agressive behavior
-- if self.type ~= "monster"
if not damage_enabled
or creative
or self.state == "attack"
or day_docile(self) then
return
end
-- Return if there is not target
if not ( type(self.specific_attack) == "table"
or self.attack_animal
or self.attacks_monsters ) then return end
local s = self.object:get_pos()
local p, sp, dist
local player, obj, min_player
local type, name = "", ""
local min_dist = self.view_range + 1
local objs = minetest.get_objects_inside_radius(s, self.view_range)
for n = 1, #objs do
if objs[n]:is_player() then
if animal_attack_ignore_player or mobs.invis[ objs[n]:get_player_name() ] then
type = ""
else
player = objs[n]
type = "player"
name = "player"
end
else
obj = objs[n]:get_luaentity()
if obj then
player = obj.object
type = obj.type
name = obj.name or ""
end
end
-- Find a specific target
local has_prey
local targets = self.specific_attack
if type(targets) == "table" then
for no = 1, #targets do
if targets[no] == name then
has_prey = true
end
end
end
local target_is_monster = (type == "monster")
local target_is_not_monster = (type == "player" or type == "npc" or type == "animal")
local can_attack_not_monster = (self.attack_animals == true)
-- find specific mob to attack, failing that attack player/npc/animal
if has_prey and (target_is_monster or (target_is_not_monster and can_attack_not_monster )) then
s = self.object:get_pos()
p = player:get_pos()
sp = s
-- aim higher to make looking up hills more realistic
p.y = p.y + 1
sp.y = sp.y + 1
dist = get_distance(p, s)
if dist < self.view_range then
-- field of view check goes here
-- choose closest target to attack
if line_of_sight(self, sp, p, 2) == true
and dist < min_dist then
min_dist = dist
min_player = player
end
end
end
end
-- attack player
if min_player then
self.attack = min_player
self.state = "attack"
if random(0, 100) < 90 then
local sound = self.sounds.war_cry
if sound then
minetest.sound_play(sound, {
object = self.object,
gain = 1.0,
max_hear_distance = self.sounds.distance
})
end
end
end
end
function mobs:doc_identifier_compat(mob_id,longdesc,usagehelp)
minetest.override_item(mob_id, {
_doc_items_longdesc = longdesc,
_doc_items_usagehelp = usagehelp,
})
if minetest.get_modpath("doc_identifier") and doc then
doc.sub.identifier.register_object(mob_id, "craftitems", mob_id)
end
end
function mobs:custom_captured_name(mob_id,desc)
minetest.override_item(mob_id..'_set', {
description = desc,
})
end
function get_preciousness(dpth,min_abs,max_abs)
local abs_dpth = math.abs(dpth)
-- Get depth range
if not min_abs then min_abs = 0 end
if not max_abs then max_abs = 31000 end
min_abs = math.abs(min_abs)
max_abs = math.abs(max_abs)
local h_max, h_min
if min_abs > max_abs then h_max = min_abs ; h_min = max_abs
else h_max = max_abs ; h_min = min_abs end
local l = (h_max - h_min) / 12
-- Preciousness step up the deeper (or higher) we go
local v = { minp = 1, maxp = 3 }
if dpth > 8*l then v = { minp = 8, maxp = 10 }
elseif dpth > 5*l then v = { minp = 7, maxp = 9 }
elseif dpth > 3*l then v = { minp = 6, maxp = 8 }
elseif dpth > 2*l then v = { minp = 5, maxp = 6 }
elseif dpth > 1*l then v = { minp = 3, maxp = 5 }
end
return v
end
function mobs:drop_something_from_treasurer(self, pos, min_abs, max_abs)
-- Might drop something from treasurer
-- Unless treasurer is not present
if not minetest.get_modpath('treasurer') then return end
-- And only after a fight
if self.state ~= "attack" then return end
local drops = {}
local n = 1 -- Only one treasure
local tresure_types = {
"ranged_weapon", "melee_weapon", "minetool",
"food", "crafting_component", "default",
}
local pre = get_preciousness(pos.y, min_abs, max_abs)
local treasure = treasurer.select_random_treasures(n,pre[minp],pre[maxp],tresure_types)
for _,itemstack in ipairs(treasure) do
drops[#drops+1] = itemstack
end
-- if chance == 1 and minetest.get_modpath('cursedstone') and opt.spawner_use_cursedstone then
-- Drop something from the drops table
if #drops > 0 then
local i = math.random(1,#drops)
minetest.add_item(pos, drops[i])
end
end
function mobs:register_special_spawner(def)
if not ( def and def.id and def.description ) then return end
local peaceful = minetest.settings:get_bool("only_peaceful_mobs")
local drop_use_default = true
local drop_use_treasurer = true
local spawnerdef = {}
spawnerdef.id = def.id
spawnerdef.name = modname..":spawner_"..spawnerdef.id
spawnerdef.description = def.description
spawnerdef.longdesc = def.longdesc
-- abm definition
spawnerdef.neighbors = def.neighbors
spawnerdef.interval = def.interval or 2.0
spawnerdef.chance = def.chance or 20
spawnerdef.min_light = def.min_light or -1
spawnerdef.max_light = def.max_light or 15
spawnerdef.min_height = def.min_height or -31000
spawnerdef.max_height = def.max_height or 31000
spawnerdef.day_toggle = def.day_toggle or true
spawnerdef.on_spawn = def.on_spawn
-- Range of spawner
spawnerdef.range = def.range or 17
-- base texture for the spawner
spawnerdef.texture_face = def.texture_face or "sides"
spawnerdef.base_texture = def.base_texture or "default_sandstone_block.png"
-- Image drawn on the spawner block
spawnerdef.glyph = def.glyph or modname.."_spawner_face.png"
-- Number of mobs spawned when spawner is destructed
spawnerdef.last_spawn = def.last_spawn or 3
-- Chances that spawner drop nothing
spawnerdef.empty_drop_chance = def.empty_drop_chance or 2
-- Mob Spawned by spawner
spawnerdef.mob = def.mob
spawnerdef.after_dig_node = def.after_dig_node or function (pos, oldnode)
-- -- Might spawn a mob -- --
if spawnerdef.mob and spawnerdef.last_spawn
and spawnerdef.last_spawn > 0 and not peaceful then
local n = spawnerdef.last_spawn or 1
for i=1,n do
if ( math.random(1,3) == 1 ) then
local sp = {
x = pos.x + math.random(-2,2),
y = pos.y + 1,
z = pos.x + math.random(-2,2),
}
minetest.add_entity(sp, spawnerdef.mob)
end
end
end
-- -- Drops things (or not) -- --
local drops = {}
-- Might drop nothing
if spawnerdef.last_spawn and spawnerdef.last_spawn > 0 then
local n = spawnerdef.last_spawn
for i=1,n do
table.insert(drops, "")
end
end
-- Might drop diamond or other small rare things
if minetest.get_modpath('default') and drop_use_default then
table.insert(drops, "default:diamond")
table.insert(drops, "default:obsidian_shard")
table.insert(drops, "default:mese_crystal_fragment ")
end
-- Might drop something from treasurer
if minetest.get_modpath('treasurer') and drop_use_treasurer then
local n = 2
local treasure = treasurer.select_random_treasures(n,1,5,spawner_treasures_types)
for _,itemstack in ipairs(treasure) do
table.insert(drops, itemstack)
end
end
-- if chance == 1 and minetest.get_modpath('cursedstone') and opt.spawner_use_cursedstone then
-- Drop something from the drops table
if drops ~= "" then
local i = math.random(1,#drops)
minetest.add_item(pos, drops[i])
end
end
local ttr = spawnerdef.base_texture
local tls = {ttr,ttr,ttr..'^' .. spawnerdef.glyph } --sides
if spawnerdef.texture_face == "all" then
tls = {ttr..'^' .. spawnerdef.glyph }
end
minetest.register_node(spawnerdef.name, {
description = spawnerdef.description,
_doc_items_longdesc = spawnerdef.longdesc,
paramtype = "light",
tiles = tls,
is_ground_content = false,
drawtype = "normal",
groups = {cracky = 3, stone = 2},
drop = "",
after_dig_node = spawnerdef.after_dig_node
})
minetest.register_alias("mobs:spawner_"..spawnerdef.id, spawnerdef.name)
if spawnerdef.mob and not peaceful then
mobs:spawn_specific(
spawnerdef.mob,
{spawnerdef.name},
spawnerdef.neighbors,
spawnerdef.min_light,
spawnerdef.max_light,
spawnerdef.interval,
spawnerdef.chance,
spawnerdef.range,
spawnerdef.min_height,
spawnerdef.max_height,
spawnerdef.day_toggle,
spawnerdef.on_spawn
)
end
end

99
mobs_craftitems.lua Normal file
View File

@ -0,0 +1,99 @@
--
-- This file register nodes and items needed by this mod
--
local S = mobs.intllib
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Chicken
--
local CHICKEN_MEAT = minetest.settings:get_bool("mobs.animal_chicken.enable_chicken_meat") or false
-- Override existing mobs chicken egg
minetest.register_node(":mobs:egg", {
description = S("Chicken Egg"),
tiles = {"mobs_chicken_egg.png"},
inventory_image = "mobs_chicken_egg.png",
visual_scale = 0.7,
drawtype = "plantlike",
wield_image = "mobs_chicken_egg.png",
paramtype = "light",
walkable = false,
is_ground_content = true,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
},
groups = {snappy = 2, dig_immediate = 3},
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then
minetest.set_node(pos, {name = "mobs:egg", param2 = 1})
end
end,
on_use = mobs.throw_egg
})
-- fried egg
minetest.register_craftitem(":mobs:chicken_egg_fried", {
description = S("Fried Egg"),
inventory_image = "mobs_chicken_egg_fried.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
type = "cooking",
recipe = "mobs:egg",
output = "mobs:chicken_egg_fried",
})
if CHICKEN_MEAT then
-- raw chicken
minetest.register_craftitem(":mobs:chicken_raw", {
description = S("Raw Chicken"),
inventory_image = "mobs_chicken_raw.png",
on_use = minetest.item_eat(2),
})
-- cooked chicken
minetest.register_craftitem(":mobs:chicken_cooked", {
description = S("Cooked Chicken"),
inventory_image = "mobs_chicken_cooked.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
type = "cooking",
recipe = "mobs:chicken_raw",
output = "mobs:chicken_cooked",
})
end
-- feather
minetest.register_craftitem(":mobs:feather", {
description = S("Feather"),
inventory_image = "mobs_feather.png",
})
--
-- Zombie
--
-- rotten flesh
minetest.register_craftitem(":mobs:rotten_flesh", {
description = "Rotten Flesh",
inventory_image = S("mobs_rotten_flesh.png"),
on_use = minetest.item_eat(1),
})
--
-- Slimes
--
-- crafts
minetest.register_craftitem(":mobs:green_slimeball", {
image = "mobs_green_slime_ball.png",
description=S("Green Slime Goo"),
})

44
mobs_mapgen.lua Normal file
View File

@ -0,0 +1,44 @@
--
-- This file adds elements for the map generation
--
local S = mobs.intllib
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
--
-- Place spawners in dungeons
--
local mapgen_elements = {
dungeon = {"mobs:spawner_zombie"},
temple = {"mobs:spawner_zombie", "mobs:spawner_mummy" },
}
local g_tab = {}
for k,_ in pairs(mapgen_elements) do
g_tab[k] = true
-- minetest.set_gen_notify(k)
end
minetest.set_gen_notify(g_tab)
minetest.register_on_generated(function(minp, maxp, seed)
local g = minetest.get_mapgen_object("gennotify")
--print('MOBS GENNOTIFY : '..dump(g))
for k,v in pairs(mapgen_elements) do
if g and g[k] and #g[k] > 3 then
minetest.after(3, function(d)
if d == nil or #d < 1 then
return
end
for i=1,2 do
local p = d[math.random(1, #d)]
if minetest.get_node({x=p.x, y =p.y-1, z=p.z}).name ~= "air" then
local spwnr = v[math.random(1, #v)]
if minetest.registered_nodes[spwnr] or minetest.registered_aliases[spwnr] then
minetest.set_node(p, {name = spwnr})
end
end
end
end, table.copy(g[k]))
end
end
end)

78
mobs_textstrings.lua Normal file
View File

@ -0,0 +1,78 @@
--
-- This file register generic strings to be used in mob registration
--
-- Intllib
local S = mobs.intllib
-- Mod related infos
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
mobs.textstrings = {}
mobs.textstrings.longdesc = {}
mobs.textstrings.usagehelp = {}
--
-- Mobs type and habitat
--
local peacefull_animal = S("Peacefull animal")
local live_in_sky = S("flying in the sky")
local live_on_land = S("living on land")
local live_in_water = S("living in water")
local hostile_creature = S("Hostile creature")
local lurk_in_dark = S("lurking in the dark caves")
mobs.textstrings.longdesc.peacefull_sky = peacefull_animal..', '..live_in_sky..'.'
mobs.textstrings.longdesc.peacefull_land = peacefull_animal..', '..live_on_land..'.'
mobs.textstrings.longdesc.peacefull_water = peacefull_animal..', '..live_in_water..'.'
mobs.textstrings.longdesc.hostile_dark= hostile_creature..', '..lurk_in_dark..'.'
mobs.textstrings.longdesc.hostile_custom = function(where)
return hostile_creature..', '..S("can be found @1.",where)
end
mobs.textstrings.longdesc.light_hurt = S("Is hurted by bright light.")
--
-- Mobs usage, feed, capture, ride
--
mobs.textstrings.usagehelp.feed_with = function(what)
return S("Right-click with @1 to feed.",what)
end
function possible_to_catch(what)
return S("it is possible to catch it using @1",what)
end
local net = S("a net")
local lasso = S("a lasso")
local net_or_lasso = net..' '..S("or")..' '..lasso
local when_tamed = S("When tamed")
local cannot_tame = S("Cannot be tamed but")
local even_not_tamed = S("even if not tamed")
local can_ride = S("can be ridden with a saddle")
mobs.textstrings.usagehelp.wild_catch_net = cannot_tame..', '..possible_to_catch(net)..'.'
mobs.textstrings.usagehelp.wild_catch_lasso = cannot_tame..', '..possible_to_catch(lasso)..'.'
mobs.textstrings.usagehelp.wild_catch_net_or_lasso = cannot_tame..', '..possible_to_catch(net_or_lasso)..'.'
mobs.textstrings.usagehelp.tamed_catch_net = when_tamed..', '..possible_to_catch(net)..'.'
mobs.textstrings.usagehelp.tamed_catch_lasso = when_tamed..', '..possible_to_catch(lasso)..'.'
mobs.textstrings.usagehelp.tamed_catch_net_or_lasso = when_tamed..', '..possible_to_catch(net_or_lasso)..'.'
-- TODO UPERCASE first letter
mobs.textstrings.usagehelp.wild_ride = can_ride..', '..even_not_tamed..'.'
mobs.textstrings.usagehelp.tamed_ride = when_tamed..', '..can_ride..'.'
--
-- Story, gameplay elements
--
mobs.textstrings.longdesc.a_long_time_ago_1 = S("A long time ago, this world was home of a great and thriving civilization.")
mobs.textstrings.longdesc.a_long_time_ago_2 = S("History is full of mysteries.")
mobs.textstrings.longdesc.a_long_time_ago_3 = S("The ancient world still echo into our present.")
mobs.textstrings.longdesc.history_zombie_1 = S("To this days, no one knows exactly what turned a wise people into roaming brainless monsters")
mobs.textstrings.longdesc.history_oerkki_1 = S("Knowing whether these shady creatures are a cause or a terrible consequence of the tragic falling of an ancient society remains a unanswered question.")
mobs.textstrings.longdesc.history_mummy_1 = S("Deads of the past times are haunting ancients tombs, and they are clearly not at rest.")
mobs.textstrings.longdesc.history_mummy_2 = S("These mummies walking around might be a good clue of it")

BIN
models/base/animal_gull.xcf Normal file

Binary file not shown.

BIN
models/base/clownfish.blend Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
models/base/mobs_gull.blend Normal file

Binary file not shown.

7645
models/mobs_bee.x Normal file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_bunny.b3d Normal file

Binary file not shown.

3080
models/mobs_chicken.x Normal file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_clownfish.b3d Normal file

Binary file not shown.

7420
models/mobs_cow.x Normal file

File diff suppressed because it is too large Load Diff

5524
models/mobs_creatures_mob.x Normal file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_fish.b3d Normal file

Binary file not shown.

BIN
models/mobs_gull.b3d Normal file

Binary file not shown.

BIN
models/mobs_jellyfish.b3d Normal file

Binary file not shown.

BIN
models/mobs_kitten.b3d Executable file

Binary file not shown.

3506
models/mobs_lava_flan.x Normal file

File diff suppressed because it is too large Load Diff

8573
models/mobs_mummy.x Executable file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_oerkki.b3d Normal file

Binary file not shown.

BIN
models/mobs_penguin.b3d Normal file

Binary file not shown.

5316
models/mobs_pumba.x Normal file

File diff suppressed because it is too large Load Diff

BIN
models/mobs_rat.b3d Normal file

Binary file not shown.

Binary file not shown.

BIN
models/mobs_sheep.b3d Normal file

Binary file not shown.

Binary file not shown.

11058
models/mobs_turtle.x Normal file

File diff suppressed because it is too large Load Diff

BIN
old/animal_sheep.lua.tar.gz Normal file

Binary file not shown.

209
old/animal_sheep_copy.lua Normal file
View File

@ -0,0 +1,209 @@
local S = mobs.intllib
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local all_colours = {
{"black", S("Black"), "#000000b0"},
{"blue", S("Blue"), "#015dbb70"},
{"brown", S("Brown"), "#663300a0"},
{"cyan", S("Cyan"), "#01ffd870"},
{"dark_green", S("Dark Green"), "#005b0770"},
{"dark_grey", S("Dark Grey"), "#303030b0"},
{"green", S("Green"), "#61ff0170"},
{"grey", S("Grey"), "#5b5b5bb0"},
{"magenta", S("Magenta"), "#ff05bb70"},
{"orange", S("Orange"), "#ff840170"},
{"pink", S("Pink"), "#ff65b570"},
{"red", S("Red"), "#ff0000a0"},
{"violet", S("Violet"), "#2000c970"},
{"white", S("White"), "#abababc0"},
{"yellow", S("Yellow"), "#e3ff0070"},
}
-- Sheep by PilzAdam, texture converted to minetest by AMMOnym from Summerfield pack
for _, col in ipairs(all_colours) do
mobs:register_mob(modname..":sheep_"..col[1], {
type = "animal",
passive = true,
hp_min = 8,
hp_max = 10,
armor = 200,
collisionbox = {-0.5, -1, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "mobs_sheep.b3d",
textures = {
{"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. col[3] .. ")"},
},
gotten_texture = {"mobs_sheep_shaved.png"},
gotten_mesh = "mobs_sheep_shaved.b3d",
makes_footstep_sound = true,
sounds = {
random = "mobs_sheep",
},
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = true,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 2},
--{name = "wool:"..col[1], chance = 1, min = 1, max = 1},
},
water_damage = 1,
lava_damage = 5,
light_damage = 0,
animation = {
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 = 8,
replace_rate = 10,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "air",
replace_offset = -1,
fear_height = 3,
--[[
on_replace = function(self, pos, oldnode, newnode)
print ("---- replaced") ; return false -- false to keep node, true to replace
end,
]]
on_rightclick = function(self, clicker)
--are we feeding?
if mobs:feed_tame(self, clicker, 8, true, true) then
--if full grow fuzz
if self.gotten == false then
self.object:set_properties({
textures = {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. col[3] .. ")"},
mesh = "mobs_sheep.b3d",
})
end
return
end
local item = clicker:get_wielded_item()
local itemname = item:get_name()
--are we giving a haircut>
if itemname == "mobs:shears" then
if self.gotten ~= false
or self.child ~= false
or not minetest.get_modpath("wool") then
return
end
self.gotten = true -- shaved
local obj = minetest.add_item(
self.object:get_pos(),
ItemStack( "wool:" .. col[1] .. " " .. math.random(1, 3) )
)
if obj then
obj:setvelocity({
x = math.random(-1, 1),
y = 5,
z = math.random(-1, 1)
})
end
item:add_wear(650) -- 100 uses
clicker:set_wielded_item(item)
self.object:set_properties({
textures = {"mobs_sheep_shaved.png"},
mesh = "mobs_sheep_shaved.b3d",
})
return
end
local name = clicker:get_player_name()
--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
local colr = string.split(itemname, ":")[2]
for _,c in pairs(all_colours) do
if c[1] == colr then
local pos = self.object:get_pos()
self.object:remove()
local mob = minetest.add_entity(pos, modname..":sheep_" .. colr)
local ent = mob:get_luaentity()
ent.owner = name
ent.tamed = true
-- take item
if not mobs.is_creative(clicker:get_player_name()) then
item:take_item()
clicker:set_wielded_item(item)
end
break
end
end
end
return
end
-- protect mod with mobs:protector item
if mobs:protect(self, clicker) then return end
--are we capturing?
if mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) then return end
end
})
if col[1] == "white" then
mobs:register_egg(modname..":sheep_"..col[1], S("@1 Sheep", col[2]), "wool_"..col[1]..".png", 1)
end
-- compatibility
mobs:alias_mob("mobs:sheep_" .. col[1], modname..":sheep_" .. col[1])
end
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:green_dirt"
end
mobs:spawn({
name = modname..":sheep_white",
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:alias_mob("mobs:sheep", modname..":sheep_white") -- compatibility

58
old/monster_mummy.lua Normal file
View File

@ -0,0 +1,58 @@
local S = mobs.intllib
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
-- mummy
mobs:register_mob(modname..":mummy", {
type = "monster",
visual = "mesh",
mesh = "mobs_sand_monster.b3d",
textures = {
{"creatures_mummy.png"},
},
collisionbox = {-0.25, -1, -0.3, 0.25, 0.75, 0.3},
animation = {
speed_normal = 10, speed_run = 15,
stand_start = 0, stand_end = 79,
walk_start = 168, walk_end = 188,
run_start = 168, run_end = 188
},
makes_footstep_sound = true,
sounds = {
random = "creatures_mummy",
war_cry = "mobs_zombie.3",
attack = "mobs_zombie.2",
damage = "creatures_mummy_hit",
death = "creatures_mummy_death",
},
hp_min = 12, -- 12
hp_max = 15, -- 35
armor = 200,
knock_back = 1,
lava_damage = 10,
damage = 4,
reach = 2,
attack_type = "dogfight",
group_attack = true,
view_range = 10,
walk_chance = 75,
walk_velocity = 0.5,
run_velocity = 0.7,
jump = false,
runaway = true,
drops = {
{name = modname..":rotten_flesh", chance = 2, min = 1, max = 2,},
{name = "default:papyrus", chance = 2, min = 1, max = 3,},
},
lifetimer = 180, -- 3 minutes
shoot_interval = 135, -- (lifetimer - (lifetimer / 4)), borrowed for do_custom timer
})
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
mobs:spawn_specific(modname..":zombie",
{"default:sand", "default:desert_sand"},
{"air"},
-1, 5, 30, 20000, 2, -31000, 31000
)
mobs:register_egg(modname..":mummy", "Mummy", "creatures_mummy.png", 1)

57
readme.md Normal file
View File

@ -0,0 +1,57 @@
--
This is a bundle of mobs for mobs_redo
Most of them are taken from various existing mods
(Tell me if someone who should be credited isn't)
The aim is to occasionally encounter mobs and be able to interact with them
* No immediate threats on the surface : Player must be able to wander around and build things without being constantly attacked of annoyed by wildlife.
* Choosed hack and slash situations : monsters can be a real challenge in some particular sitations (some areas, specific carried item...).
* Minimalistic framework : Avoid adding a lot of craftitems and nodes that will lack proper integration and recipe
* Maximal integration : compatibility with other mods, interaction betweed mobs, mobs and player, mobs and world
*
**Warning** : This is still not finished and should be considered very unstable
--
-[x] Inventory image for all mobs
-[ ] Alternative 'square pokeball' option for piched up mobs
-[-] Support for doc_identifier ( long description and usage )
-[-] Proper long descriptions and usage help
TODO : complete with wikipedia, reread
TODO : slime description
-[ ] Gameplay elements in textual description
-[ ] Traductions
-[ ] Special modes features
-[ ] Trigger (node or something) for a tower defense mode
-[ ] Nether integration with hostiles behaviors
-[ ] Evil bunny trigger !!!!
-[ ] Evil slime trigger !!!!
-[ ] Chat commands
-[ ] Mesh, textures and sounds list for basic_robot users
-[ ] Treasurer support
-[ ] Updated lucky block support
-[ ] Useful drop or no new item
-[ ] Slimeball drop
-[ ] Lava flan drop orb ??
-[ ] Zombie spawners in dungeons
-[ ] Mummy spawners in pyramids
-[ ] Special features
-[x] Rideable sheeps
-[ ] Rideable dragons
-[ ] Some "uniques" item
-[ ] Potions to cure zombies
-[ ] books
-[ ] npcs
___________________________________________________

15
settingtypes.txt Normal file
View File

@ -0,0 +1,15 @@
# This file contains settings of mobs_bundle that can be changed in
# minetest.conf
# General
# Birds
mobs.animal_birds.enable_gulls bool true
mobs.animal_birds.enable_large_birds bool false
mobs.animal_birds.enable_large_birds bool true
# Fish
mobs.animal_fish.sprite_version bool false
# Zombies
mobs.monster_zombie.enable_mini_zombies bool false

BIN
sounds/creatures_mummy.1.ogg Executable file

Binary file not shown.

BIN
sounds/creatures_mummy.2.ogg Executable file

Binary file not shown.

Binary file not shown.

BIN
sounds/creatures_mummy_hurt.1.ogg Executable file

Binary file not shown.

BIN
sounds/mobs_bee.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_chicken.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_cow.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_fireball.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_kitten.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_lavaflan.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_oerkki.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_pig.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_pig_angry.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_rat.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_sandmonster.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_sheep.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_zombie.1.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_zombie.2.ogg Normal file

Binary file not shown.

BIN
sounds/mobs_zombie.3.ogg Normal file

Binary file not shown.

Binary file not shown.

BIN
sounds/mobs_zombie_hit.ogg Normal file

Binary file not shown.

BIN
sounds/slimes_attack.ogg Normal file

Binary file not shown.

BIN
sounds/slimes_damage.ogg Normal file

Binary file not shown.

BIN
sounds/slimes_death.ogg Normal file

Binary file not shown.

BIN
sounds/slimes_jump.ogg Normal file

Binary file not shown.

BIN
textures/creatures_egg_mummy.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

BIN
textures/creatures_egg_sheep.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

BIN
textures/jeija_glue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

BIN
textures/mobs_bee.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
textures/mobs_bee_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

BIN
textures/mobs_beehive.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
textures/mobs_bird_gray.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
textures/mobs_bird_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
textures/mobs_bird_red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Some files were not shown because too many files have changed in this diff Show More