Organize mods into modpacks for better overview
This commit is contained in:
parent
f9db58bf50
commit
3696ee3761
1683 changed files with 0 additions and 0 deletions
1
mods/ENTITIES/drippingwater/depends.txt
Normal file
1
mods/ENTITIES/drippingwater/depends.txt
Normal file
|
@ -0,0 +1 @@
|
|||
mcl_core
|
118
mods/ENTITIES/drippingwater/init.lua
Normal file
118
mods/ENTITIES/drippingwater/init.lua
Normal file
|
@ -0,0 +1,118 @@
|
|||
--Dripping Water Mod
|
||||
--by kddekadenz
|
||||
|
||||
-- License of code, textures & sounds: CC0
|
||||
|
||||
--Random
|
||||
math.randomseed(3)
|
||||
|
||||
|
||||
--Drop entities
|
||||
|
||||
--water
|
||||
|
||||
minetest.register_entity("drippingwater:drop_water", {
|
||||
hp_max = 1,
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
visual = "cube",
|
||||
visual_size = {x=0.05, y=0.1},
|
||||
textures = {"default_water.png","default_water.png","default_water.png","default_water.png", "default_water.png", "default_water.png"},
|
||||
spritediv = {x=1, y=1},
|
||||
initial_sprite_basepos = {x=0, y=0},
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:setsprite({x=0,y=0}, 1, 1, true)
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
local k = math.random(1,222)
|
||||
local ownpos = self.object:getpos()
|
||||
|
||||
if k==1 then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
||||
self.object:remove()
|
||||
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
--lava
|
||||
|
||||
minetest.register_entity("drippingwater:drop_lava", {
|
||||
hp_max = 1,
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
visual = "cube",
|
||||
visual_size = {x=0.05, y=0.1},
|
||||
textures = {"default_lava.png","default_lava.png","default_lava.png","default_lava.png", "default_lava.png", "default_lava.png"},
|
||||
spritediv = {x=1, y=1},
|
||||
initial_sprite_basepos = {x=0, y=0},
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:setsprite({x=0,y=0}, 1, 0, true)
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
local k = math.random(1,222)
|
||||
local ownpos = self.object:getpos()
|
||||
|
||||
if k==1 then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
||||
self.object:setacceleration({x=0, y=-5, z=0})
|
||||
end
|
||||
|
||||
|
||||
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
||||
self.object:remove()
|
||||
minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
--Create drop
|
||||
|
||||
minetest.register_abm(
|
||||
{nodenames = {"group:crumbly", "group:cracky"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 2,
|
||||
chance = 22,
|
||||
action = function(pos)
|
||||
if minetest.get_node({x=pos.x, y=pos.y -1, z=pos.z}).name == "air" and
|
||||
minetest.get_node({x=pos.x, y=pos.y -2, z=pos.z}).name == "air" then
|
||||
local i = math.random(-45,45) / 100
|
||||
minetest.add_entity({x=pos.x + i, y=pos.y - 0.501, z=pos.z + i}, "drippingwater:drop_water")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
--Create lava drop
|
||||
|
||||
minetest.register_abm(
|
||||
{nodenames = {"group:crumbly", "group:cracky"},
|
||||
neighbors = {"group:lava"},
|
||||
interval = 2,
|
||||
chance = 22,
|
||||
action = function(pos)
|
||||
if minetest.get_node({x=pos.x, y=pos.y -1, z=pos.z}).name == "air" and
|
||||
minetest.get_node({x=pos.x, y=pos.y -2, z=pos.z}).name == "air" then
|
||||
local i = math.random(-45,45) / 100
|
||||
minetest.add_entity({x=pos.x + i, y=pos.y - 0.501, z=pos.z + i}, "drippingwater:drop_lava")
|
||||
end
|
||||
end,
|
||||
})
|
28
mods/ENTITIES/drippingwater/readme.txt
Normal file
28
mods/ENTITIES/drippingwater/readme.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
Dripping Water Mod
|
||||
by kddekadenz
|
||||
|
||||
|
||||
Installing instructions:
|
||||
|
||||
1. Copy the drippingwater mod folder into games/gamemode/mods
|
||||
|
||||
2. Start game and enjoy :)
|
||||
|
||||
|
||||
Manual:
|
||||
|
||||
-> drops are generated rarely under crumbly nodes (dirt,grass,sandstone)
|
||||
-> waterdrops are generated under cloudstone massively
|
||||
-> they will stay some time at the generated block and than they fall down
|
||||
-> when they collide with the ground, a sound is played and they are destroyed
|
||||
|
||||
|
||||
License:
|
||||
|
||||
code & sounds: CC0
|
||||
|
||||
|
||||
Changelog:
|
||||
|
||||
16.04.2012 - first release
|
||||
28.04.2012 - drops are now 3D; added lava drops; fixed generating of drops (not at edges now)
|
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_drip.1.ogg
Normal file
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_drip.1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_drip.2.ogg
Normal file
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_drip.2.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_drip.3.ogg
Normal file
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_drip.3.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_lavadrip.1.ogg
Normal file
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_lavadrip.1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_lavadrip.2.ogg
Normal file
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_lavadrip.2.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_lavadrip.3.ogg
Normal file
BIN
mods/ENTITIES/drippingwater/sounds/drippingwater_lavadrip.3.ogg
Normal file
Binary file not shown.
28
mods/ENTITIES/mcl_item_entity/README.txt
Normal file
28
mods/ENTITIES/mcl_item_entity/README.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
===ITEM_DROP MOD for MINETEST-C55===
|
||||
by PilzAdam
|
||||
|
||||
Introduction:
|
||||
This mod adds Minecraft like drop/pick up of items to Minetest.
|
||||
|
||||
This mod has been forked from item_drop in the VoxBox subgame.
|
||||
|
||||
License:
|
||||
Sourcecode: WTFPL (see below)
|
||||
Sound: WTFPL (see below)
|
||||
|
||||
See also:
|
||||
http://minetest.net/
|
||||
|
||||
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.
|
1
mods/ENTITIES/mcl_item_entity/description.txt
Normal file
1
mods/ENTITIES/mcl_item_entity/description.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Dropped items will be attracted to the player like a magnet.
|
445
mods/ENTITIES/mcl_item_entity/init.lua
Normal file
445
mods/ENTITIES/mcl_item_entity/init.lua
Normal file
|
@ -0,0 +1,445 @@
|
|||
--basic settings
|
||||
item_drop_settings = {} --settings table
|
||||
item_drop_settings.age = 1 --how old an item has to be before collecting
|
||||
item_drop_settings.radius_magnet = 2 --radius of item magnet
|
||||
item_drop_settings.radius_collect = 0.1 --radius of collection
|
||||
item_drop_settings.player_collect_height = 1.5 --added to their pos y value
|
||||
item_drop_settings.collection_safety = false --do this to prevent items from flying away on laggy servers
|
||||
item_drop_settings.collect_by_default = true --make item entities automatically collect in the item entity code
|
||||
--versus setting it in the item drop code, setting true might interfere with
|
||||
--mods that use item entities (like pipeworks)
|
||||
item_drop_settings.random_item_velocity = true --this sets random item velocity if velocity is 0
|
||||
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
if player:get_hp() > 0 or not minetest.setting_getbool("enable_damage") then
|
||||
local pos = player:getpos()
|
||||
local inv = player:get_inventory()
|
||||
|
||||
--collection
|
||||
|
||||
for _,object in ipairs(minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y + item_drop_settings.player_collect_height,z=pos.z}, item_drop_settings.radius_collect)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
|
||||
if object:get_luaentity().collect and object:get_luaentity().age > item_drop_settings.age then
|
||||
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
|
||||
if object:get_luaentity().itemstring ~= "" then
|
||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||
minetest.sound_play("item_drop_pickup", {
|
||||
pos = pos,
|
||||
max_hear_distance = 100,
|
||||
gain = 10.0,
|
||||
})
|
||||
object:get_luaentity().itemstring = ""
|
||||
object:remove()
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--magnet
|
||||
for _,object in ipairs(minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y + item_drop_settings.player_collect_height,z=pos.z}, item_drop_settings.radius_magnet)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
|
||||
if object:get_luaentity().collect and object:get_luaentity().age > item_drop_settings.age then
|
||||
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
|
||||
--modified simplemobs api
|
||||
|
||||
local pos1 = pos
|
||||
local pos2 = object:getpos()
|
||||
local vec = {x=pos1.x-pos2.x, y=(pos1.y+item_drop_settings.player_collect_height)-pos2.y, z=pos1.z-pos2.z}
|
||||
|
||||
vec.x = pos2.x + (vec.x/3)
|
||||
vec.y = pos2.y + (vec.y/3)
|
||||
vec.z = pos2.z + (vec.z/3)
|
||||
object:moveto(vec)
|
||||
|
||||
|
||||
|
||||
object:get_luaentity().physical_state = false
|
||||
object:get_luaentity().object:set_properties({
|
||||
physical = false
|
||||
})
|
||||
|
||||
--fix eternally falling items
|
||||
minetest.after(0, function()
|
||||
object:setacceleration({x=0, y=0, z=0})
|
||||
end)
|
||||
|
||||
|
||||
--this is a safety to prevent items flying away on laggy servers
|
||||
if item_drop_settings.collection_safety == true then
|
||||
if object:get_luaentity().init ~= true then
|
||||
object:get_luaentity().init = true
|
||||
minetest.after(1, function(args)
|
||||
local lua = object:get_luaentity()
|
||||
if object == nil or lua == nil or lua.itemstring == nil then
|
||||
return
|
||||
end
|
||||
if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
|
||||
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
|
||||
if object:get_luaentity().itemstring ~= "" then
|
||||
minetest.sound_play("item_drop_pickup", {
|
||||
pos = pos,
|
||||
max_hear_distance = 100,
|
||||
gain = 10.0,
|
||||
})
|
||||
end
|
||||
object:get_luaentity().itemstring = ""
|
||||
object:remove()
|
||||
else
|
||||
object:setvelocity({x=0,y=0,z=0})
|
||||
object:get_luaentity().physical_state = true
|
||||
object:get_luaentity().object:set_properties({
|
||||
physical = true
|
||||
})
|
||||
end
|
||||
end, {player, object})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function minetest.handle_node_drops(pos, drops, digger)
|
||||
local inv
|
||||
if minetest.setting_getbool("creative_mode") and digger and digger:is_player() then
|
||||
inv = digger:get_inventory()
|
||||
end
|
||||
for _,item in ipairs(drops) do
|
||||
local count, name
|
||||
if type(item) == "string" then
|
||||
count = 1
|
||||
name = item
|
||||
else
|
||||
count = item:get_count()
|
||||
name = item:get_name()
|
||||
end
|
||||
if not inv or not inv:contains_item("main", ItemStack(name)) then
|
||||
for i=1,count do
|
||||
local obj = minetest.env:add_item(pos, name)
|
||||
if obj ~= nil then
|
||||
obj:get_luaentity().collect = true
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
x = -x
|
||||
end
|
||||
local z = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
z = -z
|
||||
end
|
||||
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
|
||||
obj:get_luaentity().age = 0.6
|
||||
-- FIXME this doesnt work for deactiveted objects
|
||||
if minetest.setting_get("remove_items") and tonumber(minetest.setting_get("remove_items")) then
|
||||
minetest.after(tonumber(minetest.setting_get("remove_items")), function(obj)
|
||||
obj:remove()
|
||||
end, obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--throw single items by default
|
||||
function minetest.item_drop(itemstack, dropper, pos)
|
||||
if dropper and dropper:is_player() then
|
||||
local v = dropper:get_look_dir()
|
||||
local p = {x=pos.x, y=pos.y+1.2, z=pos.z}
|
||||
local cs = 1
|
||||
if dropper:get_player_control().sneak then
|
||||
cs = itemstack:get_count()
|
||||
end
|
||||
local item = itemstack:take_item(cs)
|
||||
local obj = core.add_item(p, item)
|
||||
if obj then
|
||||
v.x = v.x*4
|
||||
v.y = v.y*4 + 2
|
||||
v.z = v.z*4
|
||||
obj:setvelocity(v)
|
||||
obj:get_luaentity().collect = true
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--add food particles
|
||||
function core.item_eat(hp_change, replace_with_item)
|
||||
return function(itemstack, user, pointed_thing) -- closure
|
||||
local pos = user:getpos()
|
||||
pos.y = pos.y + item_drop_settings.player_collect_height
|
||||
local itemname = itemstack:get_name()
|
||||
local texture = minetest.registered_items[itemname].inventory_image
|
||||
minetest.add_item(pos, drop)
|
||||
minetest.add_particlespawner({
|
||||
amount = 20,
|
||||
time = 0.1,
|
||||
minpos = {x=pos.x, y=pos.y, z=pos.z},
|
||||
maxpos = {x=pos.x, y=pos.y, z=pos.z},
|
||||
minvel = {x=-1, y=1, z=-1},
|
||||
maxvel = {x=1, y=2, z=1},
|
||||
minacc = {x=0, y=-5, z=0},
|
||||
maxacc = {x=0, y=-9, z=0},
|
||||
minexptime = 1,
|
||||
maxexptime = 1,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
collisiondetection = true,
|
||||
vertical = false,
|
||||
texture = texture,
|
||||
})
|
||||
minetest.sound_play("bite_item_drop", {
|
||||
pos = pos,
|
||||
max_hear_distance = 100,
|
||||
gain = 10.0,
|
||||
})
|
||||
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)
|
||||
end
|
||||
end
|
||||
|
||||
--modify builtin:item
|
||||
|
||||
local time_to_live = tonumber(core.setting_get("item_entity_ttl"))
|
||||
if not time_to_live then
|
||||
time_to_live = 900
|
||||
end
|
||||
|
||||
core.register_entity(":__builtin:item", {
|
||||
initial_properties = {
|
||||
hp_max = 1,
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||
visual = "wielditem",
|
||||
visual_size = {x = 0.4, y = 0.4},
|
||||
textures = {""},
|
||||
spritediv = {x = 1, y = 1},
|
||||
initial_sprite_basepos = {x = 0, y = 0},
|
||||
is_visible = false,
|
||||
infotext = "",
|
||||
},
|
||||
|
||||
itemstring = '',
|
||||
physical_state = true,
|
||||
age = 0,
|
||||
|
||||
set_item = function(self, itemstring)
|
||||
self.itemstring = itemstring
|
||||
local stack = ItemStack(itemstring)
|
||||
local count = stack:get_count()
|
||||
local max_count = stack:get_stack_max()
|
||||
if count > max_count then
|
||||
count = max_count
|
||||
self.itemstring = stack:get_name().." "..max_count
|
||||
end
|
||||
local s = 0.2 + 0.1 * (count / max_count)
|
||||
local c = s
|
||||
local itemtable = stack:to_table()
|
||||
local itemname = nil
|
||||
local description = ""
|
||||
if itemtable then
|
||||
itemname = stack:to_table().name
|
||||
end
|
||||
local item_texture = nil
|
||||
local item_type = ""
|
||||
if core.registered_items[itemname] then
|
||||
item_texture = core.registered_items[itemname].inventory_image
|
||||
item_type = core.registered_items[itemname].type
|
||||
description = core.registered_items[itemname].description
|
||||
end
|
||||
local prop = {
|
||||
is_visible = true,
|
||||
visual = "wielditem",
|
||||
textures = {itemname},
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c},
|
||||
automatic_rotate = math.pi * 0.5,
|
||||
infotext = description,
|
||||
}
|
||||
self.object:set_properties(prop)
|
||||
if item_drop_settings.collect_by_default then
|
||||
self.collect = true
|
||||
end
|
||||
if item_drop_settings.random_item_velocity == true then
|
||||
minetest.after(0, function()
|
||||
local vel = self.object:getvelocity()
|
||||
if vel.x == 0 and vel.z == 0 then
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
x = -x
|
||||
end
|
||||
local z = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
z = -z
|
||||
end
|
||||
local y = math.random(2,4)
|
||||
self.object:setvelocity({x=1/x, y=y, z=1/z})
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return core.serialize({
|
||||
itemstring = self.itemstring,
|
||||
always_collect = self.always_collect,
|
||||
age = self.age,
|
||||
dropped_by = self.dropped_by,
|
||||
collect = self.collect
|
||||
})
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
if string.sub(staticdata, 1, string.len("return")) == "return" then
|
||||
local data = core.deserialize(staticdata)
|
||||
if data and type(data) == "table" then
|
||||
self.itemstring = data.itemstring
|
||||
self.always_collect = data.always_collect
|
||||
if data.age then
|
||||
self.age = data.age + dtime_s
|
||||
else
|
||||
self.age = dtime_s
|
||||
end
|
||||
--remember collection data
|
||||
if data.collect then
|
||||
self.collect = data.collect
|
||||
end
|
||||
self.dropped_by = data.dropped_by
|
||||
end
|
||||
else
|
||||
self.itemstring = staticdata
|
||||
end
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
self.object:setvelocity({x = 0, y = 2, z = 0})
|
||||
self.object:setacceleration({x = 0, y = -10, z = 0})
|
||||
self:set_item(self.itemstring)
|
||||
end,
|
||||
|
||||
try_merge_with = function(self, own_stack, object, obj)
|
||||
local stack = ItemStack(obj.itemstring)
|
||||
if own_stack:get_name() == stack:get_name() and stack:get_free_space() > 0 then
|
||||
local overflow = false
|
||||
local count = stack:get_count() + own_stack:get_count()
|
||||
local max_count = stack:get_stack_max()
|
||||
if count > max_count then
|
||||
overflow = true
|
||||
count = count - max_count
|
||||
else
|
||||
self.itemstring = ''
|
||||
end
|
||||
local pos = object:getpos()
|
||||
pos.y = pos.y + (count - stack:get_count()) / max_count * 0.15
|
||||
object:moveto(pos, false)
|
||||
local s, c
|
||||
local max_count = stack:get_stack_max()
|
||||
local name = stack:get_name()
|
||||
if not overflow then
|
||||
obj.itemstring = name .. " " .. count
|
||||
s = 0.2 + 0.1 * (count / max_count)
|
||||
c = s
|
||||
object:set_properties({
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c}
|
||||
})
|
||||
self.object:remove()
|
||||
-- merging succeeded
|
||||
return true
|
||||
else
|
||||
s = 0.4
|
||||
c = 0.3
|
||||
object:set_properties({
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c}
|
||||
})
|
||||
obj.itemstring = name .. " " .. max_count
|
||||
s = 0.2 + 0.1 * (count / max_count)
|
||||
c = s
|
||||
self.object:set_properties({
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c}
|
||||
})
|
||||
self.itemstring = name .. " " .. count
|
||||
end
|
||||
end
|
||||
-- merging didn't succeed
|
||||
return false
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
self.age = self.age + dtime
|
||||
if time_to_live > 0 and self.age > time_to_live then
|
||||
self.itemstring = ''
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
local p = self.object:getpos()
|
||||
p.y = p.y - 0.5
|
||||
local node = core.get_node_or_nil(p)
|
||||
local in_unloaded = (node == nil)
|
||||
if in_unloaded then
|
||||
-- Don't infinetly fall into unloaded map
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
self.physical_state = false
|
||||
self.object:set_properties({physical = false})
|
||||
return
|
||||
end
|
||||
local nn = node.name
|
||||
-- If node is not registered or node is walkably solid and resting on nodebox
|
||||
local v = self.object:getvelocity()
|
||||
if not core.registered_nodes[nn] or core.registered_nodes[nn].walkable and v.y == 0 then
|
||||
if self.physical_state then
|
||||
local own_stack = ItemStack(self.object:get_luaentity().itemstring)
|
||||
-- Merge with close entities of the same item
|
||||
for _, object in ipairs(core.get_objects_inside_radius(p, 0.8)) do
|
||||
local obj = object:get_luaentity()
|
||||
if obj and obj.name == "__builtin:item"
|
||||
and obj.physical_state == false then
|
||||
if self:try_merge_with(own_stack, object, obj) then
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
self.physical_state = false
|
||||
self.object:set_properties({physical = false})
|
||||
end
|
||||
else
|
||||
if not self.physical_state then
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = -10, z = 0})
|
||||
self.physical_state = true
|
||||
self.object:set_properties({physical = true})
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
on_punch = function(self, hitter)
|
||||
local inv = hitter:get_inventory()
|
||||
if inv and self.itemstring ~= '' then
|
||||
local left = inv:add_item("main", self.itemstring)
|
||||
if left and not left:is_empty() then
|
||||
self.itemstring = left:to_string()
|
||||
return
|
||||
end
|
||||
end
|
||||
self.itemstring = ''
|
||||
self.object:remove()
|
||||
end,
|
||||
})
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "item drop reloaded loaded")
|
||||
end
|
1
mods/ENTITIES/mcl_item_entity/mod.conf
Normal file
1
mods/ENTITIES/mcl_item_entity/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = mcl_item_entity
|
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.1.ogg
Normal file
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.2.ogg
Normal file
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.2.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.3.ogg
Normal file
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.3.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.4.ogg
Normal file
BIN
mods/ENTITIES/mcl_item_entity/sounds/item_drop_pickup.4.ogg
Normal file
Binary file not shown.
3106
mods/ENTITIES/mobs/api.lua
Normal file
3106
mods/ENTITIES/mobs/api.lua
Normal file
File diff suppressed because it is too large
Load diff
259
mods/ENTITIES/mobs/api.txt
Normal file
259
mods/ENTITIES/mobs/api.txt
Normal file
|
@ -0,0 +1,259 @@
|
|||
|
||||
MOB API (28th September 2016)
|
||||
|
||||
The mob api is a function that can be called on by other mods to add new animals or monsters into minetest.
|
||||
|
||||
minetest.conf settings*
|
||||
|
||||
'enable_damage' if true monsters will attack players (default is true)
|
||||
'only_peaceful_mobs' if true only animals will spawn in game (default is false)
|
||||
'mobs_disable_blood' if false blood effects appear when mob is hit (default is false)
|
||||
'mobs_spawn_protected' if set to 1 then mobs will not spawn in protected areas (default is 0)
|
||||
'remove_far_mobs' if true then mobs that are outside players visual range will be removed (default is false)
|
||||
'mobname' can change specific mob chance rate (0 to disable) and spawn number e.g. mobs_animal:cow = 1000,5
|
||||
'mob_difficulty' sets difficulty level (health and hit damage multiplied by this number), defaults to 1.0.
|
||||
|
||||
|
||||
mobs:register_mob(name, definition)
|
||||
|
||||
This functions registers a new mob as a Minetest entity.
|
||||
|
||||
'name' is the name of the mob (e.g. "mobs:dirt_monster")
|
||||
definition is a table with the following fields
|
||||
'type' the type of the mob ("monster", "animal" or "npc")
|
||||
'passive' will mob defend itself, set to false to attack
|
||||
'docile_by_day' when true, mob will not attack during daylight hours unless provoked
|
||||
'attacks_monsters' 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
|
||||
'attack_specific' has a table of entity names that monsters can attack {"player", "mobs_animal:chicken"}
|
||||
'hp_min' minimum health
|
||||
'hp_max' maximum health (mob health is randomly selected between both)
|
||||
'physical' same is in minetest.register_entity()
|
||||
'collisionbox' same is in minetest.register_entity()
|
||||
'visual' same is in minetest.register_entity()
|
||||
'visual_size' same is in minetest.register_entity()
|
||||
'textures' same is in minetest.register_entity()
|
||||
although you can add multiple lines for random textures {{"texture1.png"},{"texture2.png"}},
|
||||
'gotten_texture' alt. texture for when self.gotten value is set to true (used for shearing sheep)
|
||||
'child_texture' texture of mod for when self.child is set to true
|
||||
'mesh' same is in minetest.register_entity()
|
||||
'gotten_mesh' alternative mesh for when self.gotten is true (used for sheep)
|
||||
'makes_footstep_sound' same is in minetest.register_entity()
|
||||
'follow' item when held will cause mob to follow player, can be single string "default:apple" or table {"default:apple", "default:diamond"}
|
||||
'view_range' the range in that the monster will see the playerand follow him
|
||||
'walk_chance' chance of mob walking around
|
||||
'jump_chance' chance of mob jumping around, set above to 0 for jumping mob only
|
||||
'walk_velocity' the velocity when the monster is walking around
|
||||
'run_velocity' the velocity when the monster is attacking a player
|
||||
'runaway' when true mob will turn and run away when punched
|
||||
'stepheight' minimum node height mob can walk onto without jumping (default: 0.6)
|
||||
'jump' can mob jump, true or false
|
||||
'jump_height' height mob can jump, default is 6
|
||||
'fly' can mob fly, true or false (used for swimming mobs also)
|
||||
'fly_in' node name that mob flys inside, e.g "air", "default:water_source" for fish
|
||||
'damage' the damage per second
|
||||
'recovery_time' how much time from when mob is hit to recovery (default: 0.5)
|
||||
'knock_back' strength of knock-back when mob hit (default: 3)
|
||||
'immune_to' table holding special tool/item names and damage the incur e.g.
|
||||
{"default:sword_wood", 0}, {"default:gold_lump", -10} immune to sword, gold lump heals
|
||||
'blood_amount' number of droplets that appear when hit
|
||||
'blood_texture' texture of blood droplets (default: "mobs_blood.png")
|
||||
'drops' is list of tables with the following fields:
|
||||
'name' itemname e.g. default:stone
|
||||
'chance' the inverted chance (same as in abm) to get the item
|
||||
'min' the minimum number of items
|
||||
'max' the maximum number of items
|
||||
'armor' the armor (integer)(3=lowest; 1=highest)(fleshy group is used)
|
||||
'drawtype' "front" or "side" (DEPRECATED, replaced with below)
|
||||
'rotate' set mob rotation, 0=front, 90=side, 180=back, 270=other side
|
||||
'water_damage' the damage per second if the mob is in water
|
||||
'lava_damage' the damage per second if the mob is in lava
|
||||
'light_damage' the damage per second if the mob is in light
|
||||
'fall_damage' will mob be hurt when falling from height
|
||||
'fall_speed' speed mob falls (default: -10 and has to be lower than -2)
|
||||
'fear_height' when mob walks near a drop then anything over this value makes it stop and turn back (default is 0 to disable)
|
||||
'on_die' a function that is called when the mob is killed the parameters are (self, pos)
|
||||
'floats' 1 to float in water, 0 to sink
|
||||
'on_rightclick' its same as in minetest.register_entity()
|
||||
'pathfinding' set to 1 for mobs to use pathfinder feature to locate player, set to 2 so they can build/break also (only works with dogfight attack)
|
||||
'attack_type' the attack type of a monster
|
||||
'dogfight' follows player in range and attacks when in reach
|
||||
'shoot' shoots defined arrows when player is within range
|
||||
'explode' follows player in range and will flash and explode when in reach
|
||||
'dogshoot' shoots arrows when in range and one on one attack when in reach
|
||||
'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
|
||||
'dogshoot_count_max' number of seconds before switching above modes.
|
||||
'custom_attack' is a function that is called when mob is in range to attack player, parameters are (self, to_attack)
|
||||
'double_melee_attack' if false then api will choose randomly between 'punch' and 'punch2' attack animations
|
||||
'on_blast' is called when TNT explodes near mob, function uses (object, damage) and returns (do_damage, do_knockback, drops)
|
||||
'explosion_radius' radius of explosion attack (defaults to 1)
|
||||
'arrow' if the attack_type is "shoot" or "dogshoot" then the entity name of the arrow is required
|
||||
'shoot_interval' the minimum shoot interval
|
||||
'shoot_offset' +/- value to position arrow/fireball when fired
|
||||
'reach' how far a reach this mob has, default is 3
|
||||
'sounds' this is a table with sounds of the mob
|
||||
'random' random sounds during gameplay
|
||||
'war_cry' sound when starting to attack player
|
||||
'attack' sound when attacking player
|
||||
'shoot_attack' sound when attacking player by shooting arrow/entity
|
||||
'damage' sound when being hit
|
||||
'death' sound when killed
|
||||
'jump' sound when jumping
|
||||
'explode' sound when exploding
|
||||
'distance' maximum distance sounds are heard from (default is 10)
|
||||
'animation' a table with the animation ranges and speed of the model
|
||||
'stand_start' start frame of stand animation
|
||||
'stand_end' end frame of stand animation
|
||||
'walk_start' start frame of walk animation
|
||||
'walk_end' end frame of walk animation
|
||||
'run_start' start frame of run animation
|
||||
'run_end' end frame of run animation
|
||||
'punch_start' start frame of punch animation
|
||||
'punch_end' end frame of punch animation
|
||||
'punch2_start' start frame of alt.punch animation
|
||||
'punch2_end' end frame of alt.punch animation
|
||||
'shoot_start' start frame of shoot animation
|
||||
'shoot_end' end frame of shoot animation
|
||||
'speed_normal' normal animation speed
|
||||
'speed_run' running animation speed
|
||||
'speed_punch' punching animation speed
|
||||
'speed_punch2' alternative punching animation speed
|
||||
'speed_shoot' shooting animation speed
|
||||
'replace_what' group if items to replace e.g. {"farming:wheat_8", "farming:carrot_8"}
|
||||
'replace_with' replace with what e.g. "air" or in chickens case "mobs:egg"
|
||||
'replace_rate' how random should the replace rate be (typically 10)
|
||||
'replace_offset' +/- value to check specific node to replace
|
||||
|
||||
|
||||
The mob api also has some preset variables and functions that it will remember for each mob
|
||||
|
||||
'self.gotten' this is used for obtaining milk from cow and wool from sheep
|
||||
'self.horny' when animal fed enough it is set to true and animal can breed with same animal
|
||||
'self.child' used for when breeding animals have child, will use child_texture and be half size
|
||||
'self.owner' string used to set owner of npc mobs, typically used for dogs
|
||||
'self.order' set to "follow" or "stand" so that npc will follow owner or stand it's ground
|
||||
'on_die' a function that is called when mob is killed
|
||||
'do_custom' a custom function that is called while mob is active and which has access to all of the self.* variables e.g. (self.health for health or self.standing_in for node status), return with 'false' to skip remainder of mob API.
|
||||
|
||||
|
||||
mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, day_toggle)
|
||||
|
||||
mobs:spawn_specfic(name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height, day_toggle, on_spawn)
|
||||
|
||||
These functions register a spawn algorithm for the mob. Without this function the call the mobs won't spawn.
|
||||
|
||||
'name' is the name of the animal/monster
|
||||
'nodes' is a list of nodenames on that the animal/monster can spawn on top of
|
||||
'neighbors' is a list of nodenames on that the animal/monster will spawn beside (default is {"air"} for mobs:register_spawn)
|
||||
'max_light' is the maximum of light
|
||||
'min_light' is the minimum of light
|
||||
'interval' is same as in register_abm() (default is 30 for mobs:register_spawn)
|
||||
'chance' is same as in register_abm()
|
||||
'active_object_count' mob is only spawned if active_object_count_wider of ABM is <= this
|
||||
'min_height' is the maximum height the mob can spawn
|
||||
'max_height' is the maximum height the mob can spawn
|
||||
'day_toggle' true for day spawning, false for night or nil for anytime
|
||||
'on_spawn' is a custom function which runs after mob has spawned and gives self and pos values.
|
||||
|
||||
... also a simpler way to handle mob spawns has been added with the mobs:spawn(def) command which uses above names to make settings clearer:
|
||||
|
||||
mobs:spawn({name = "mobs_monster:tree_monster",
|
||||
nodes = {"group:leaves"},
|
||||
max_light = 7,
|
||||
})
|
||||
|
||||
|
||||
Players can override the spawn chance for each mob registered by adding a line to their minetest.conf file with a new value, the lower the value the more each mob will spawn e.g.
|
||||
|
||||
mobs_animal:sheep_chance 11000 or mobs_monster:sand_monster_chance 100
|
||||
|
||||
For each mob that spawns with this function is a field in mobs.spawning_mobs. It tells if the mob should spawn or not. Default is true. So other mods can only use the API of this mod by disabling the spawning of the default mobs in this mod.
|
||||
|
||||
|
||||
mobs:register_arrow(name, definition)
|
||||
|
||||
This function registers a arrow for mobs with the attack type shoot.
|
||||
|
||||
'name' is the name of the arrow
|
||||
-definition' is a table with the following values:
|
||||
'visual' same is in minetest.register_entity()
|
||||
'visual_size' same is in minetest.register_entity()
|
||||
'textures' same is in minetest.register_entity()
|
||||
'velocity' the velocity of the arrow
|
||||
'drop' if set to true any arrows hitting a node will drop as item
|
||||
'hit_player' a function that is called when the arrow hits a player; this function should hurt the player
|
||||
the parameters are (self, player)
|
||||
'hit_mob' a function that is called when the arrow hits a mob; this function should hurt the mob
|
||||
the parameters are (self, player)
|
||||
'hit_node' a function that is called when the arrow hits a node
|
||||
the parameters are (self, pos, node)
|
||||
'tail' when set to 1 adds a trail or tail to mob arrows
|
||||
'tail_texture' texture string used for above effect
|
||||
'tail_size' has size for above texture (defaults to between 5 and 10)
|
||||
'on_step' is a custom function when arrow is active, nil for default.
|
||||
|
||||
|
||||
mobs:register_egg(name, description, background, addegg)
|
||||
|
||||
This function registers a spawn egg which can be used by admin to properly spawn in a mob.
|
||||
|
||||
'name' this is the name of your new mob to spawn e.g. "mob:sheep"
|
||||
'description' the name of the new egg you are creating e.g. "Spawn Sheep"
|
||||
'background' the texture displayed for the egg in inventory
|
||||
'addegg' would you like an egg image in front of your texture (1=yes, 0=no)
|
||||
'no_creative' when set to true this stops spawn egg appearing in creative mode for destructive mobs like Dungeon Masters
|
||||
|
||||
|
||||
mobs:explosion(pos, radius, fire, smoke)
|
||||
|
||||
This function generates an explosion which removes nodes in a specific radius and replace them with fire or air. Protection nodes, obsidian and locked chests will not be destroyed although a normal chest will drop it's contents.
|
||||
|
||||
'pos' centre position of explosion
|
||||
'radius' radius of explosion (typically set to 3)
|
||||
'fire' should fire appear in explosion (1=yes, 0=no)
|
||||
'smoke' should smoke appear in explosion (1=yes, 0=no)
|
||||
'sound' sound played when mob explodes
|
||||
|
||||
|
||||
mobs:capture_mob(self, clicker, chance_hand, chance_net, chance_lasso, force_take, replacewith)
|
||||
|
||||
This function is generally called inside the on_rightclick section of the mob api code, it provides a chance of capturing the mob by hand, using the net or magic lasso items, and can also have the player take the mob by force if tamed and replace with another item entirely.
|
||||
|
||||
'self' mob information
|
||||
'clicker' player information
|
||||
'chance_hand' chance of capturing mob by hand (1 to 100) 0 to disable
|
||||
'chance_net' chance of capturing mob using net (1 to 100) 0 to disable
|
||||
'chance_lasso' chance of capturing mob using magic lasso (1 to 100) 0 to disable
|
||||
'force_take' take mob by force, even if tamed (true or false)
|
||||
'replacewith' once captured replace mob with this item instead
|
||||
|
||||
|
||||
mobs:feed_tame(self, clicker, feed_count, breed)
|
||||
|
||||
This function allows the mob to be fed the item inside self.follow be it apple, wheat or whatever a set number of times and be tamed or bred as a result.
|
||||
|
||||
'self' mob information
|
||||
'clicker' player information
|
||||
'feed_count' number of times mob must be fed to tame or breed
|
||||
'breed' true or false stating if mob can be bred and a child created afterwards
|
||||
'tame' true or false stating if mob can be tamed so player can pick them up
|
||||
|
||||
|
||||
mobs:protect(self, clicker)
|
||||
|
||||
This function can be used to right-click any tamed mob with mobs:protector item, this will protect the mob from harm inside of a protected area from other players.
|
||||
|
||||
'self' mob information
|
||||
'clicker' player information
|
||||
|
||||
|
||||
Useful Internal Variables
|
||||
|
||||
'self.health' contains current health of mob
|
||||
'self.texture_list' contains list of all mob textures
|
||||
'self.child_texture' contains mob child texture when growing up
|
||||
'self.base_texture' contains current skin texture which was randomly selected from textures list
|
||||
'self.gotten' true when sheep have been sheared or cows have been milked, a toggle switch which can be used for many functions
|
||||
'self.child' true when mob is currently a child (when two mobs have bred and current mob is the outcome)
|
||||
'self.hornytimer' background timer that controls breeding functions and mob childhood timings
|
12
mods/ENTITIES/mobs/crafts.lua
Normal file
12
mods/ENTITIES/mobs/crafts.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
local S = mobs.intllib
|
||||
|
||||
-- name tag
|
||||
minetest.register_craftitem("mobs:nametag", {
|
||||
description = S("Name Tag"),
|
||||
inventory_image = "mobs_nametag.png",
|
||||
wield_image = "mobs_nametag.png",
|
||||
stack_max = 64,
|
||||
groups = { tool=1 },
|
||||
})
|
||||
|
5
mods/ENTITIES/mobs/depends.txt
Normal file
5
mods/ENTITIES/mobs/depends.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
mcl_core
|
||||
mcl_sounds
|
||||
invisibility?
|
||||
intllib?
|
||||
lucky_block?
|
1
mods/ENTITIES/mobs/description.txt
Normal file
1
mods/ENTITIES/mobs/description.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Adds a mob api for mods to add animals or monsters etc.
|
16
mods/ENTITIES/mobs/init.lua
Normal file
16
mods/ENTITIES/mobs/init.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
local path = minetest.get_modpath("mobs")
|
||||
|
||||
-- Mob API
|
||||
dofile(path .. "/api.lua")
|
||||
|
||||
-- Mob Items
|
||||
dofile(path .. "/crafts.lua")
|
||||
|
||||
-- Mob Spawner
|
||||
dofile(path .. "/spawner.lua")
|
||||
|
||||
-- Lucky Blocks
|
||||
dofile(path .. "/lucky_block.lua")
|
||||
|
||||
print ("[MOD] Mobs Redo loaded")
|
21
mods/ENTITIES/mobs/license.txt
Normal file
21
mods/ENTITIES/mobs/license.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 TenPlus1
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
38
mods/ENTITIES/mobs/locale/de.txt
Normal file
38
mods/ENTITIES/mobs/locale/de.txt
Normal file
|
@ -0,0 +1,38 @@
|
|||
# German Translation for mobs_redo mod
|
||||
# Deutsche Übersetzung der mobs_redo Mod
|
||||
# last update: 2016/June/10
|
||||
# Author: Xanthin
|
||||
|
||||
#init.lua
|
||||
[MOD] Mobs Redo loaded = [MOD] Mobs Redo geladen
|
||||
|
||||
#api.lua
|
||||
[MOBS] mod profiling enabled, damage not enabled = [MOBS] Modanalyse aktiviert, Schaden deaktiviert
|
||||
lifetimer expired, removed @1 = Lebensdauer abgelaufen, @1 wurde entfernt
|
||||
[Mobs Redo] @1 has spawning disabled = [Mobs Redo] Spawnen von @1 ist deaktiviert
|
||||
[Mobs Redo] Chance setting for @1 is now @2 = [Mobs Redo] Wahrscheinlichkeitswert für @1 ist jetzt @2
|
||||
[mobs] @1 failed to spawn at @2 = [mobs] @1 konnte nicht bei @2 spawnen
|
||||
Not tamed! = Nicht gezähmt!
|
||||
@1 is owner! = @1 ist Besitzer!
|
||||
Missed! = Verfehlt!
|
||||
@1 at full health (@2) = @1 bei voller Gesundheit (@2)
|
||||
@1 has been tamed! = @1 ist gezähmt worden!
|
||||
Enter name: = Namen eingeben:
|
||||
Rename = Umbenennen
|
||||
|
||||
#crafts.lua
|
||||
Name Tag = Namensschild
|
||||
Leather = Leder
|
||||
Raw Meat = Rohes Fleisch
|
||||
Meat = Fleisch
|
||||
Magic Lasso (right-click animal to put in inventory) = Magisches Lasso (Rechtsklick auf Tier,\num es ins Inventar zu legen)
|
||||
Net (right-click animal to put in inventory) = Netz (Rechtsklick auf Tier,\num es ins Inventar zu legen)
|
||||
Steel Shears (right-click to shear) = Stahlschere (Rechtsklick zum Scheren)
|
||||
|
||||
#spawner.lua
|
||||
Monster Spawner = Monsterspawner
|
||||
Mob MinLight MaxLight Amount PlayerDist = Mob MinLicht MaxLicht Menge SpielerEntfng
|
||||
Spawner Not Active (enter settings) = Spawner nicht aktiv (Einstellungen eintragen)
|
||||
Spawner Active (@1) = Spawner aktiv (@1)
|
||||
Mob Spawner settings failed! = Mobspawnereinstellungen gescheitert!
|
||||
> name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] distance[1-20] y_offset[-10 to 10] = Name min. Licht[0-14] max. Licht[0-14] max. Mobs in Gebiet[0 zum deaktivieren] Entfernung zum Spieler[1-20] Höhe[-10 bis 10]
|
38
mods/ENTITIES/mobs/locale/pt.txt
Normal file
38
mods/ENTITIES/mobs/locale/pt.txt
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Portuguese Translation for mobs_redo mod
|
||||
# Tradução em Portugues do mod mobs_redo
|
||||
# Ultima revisao: 30/Ago/2016
|
||||
# Autor: BrunoMine
|
||||
|
||||
#init.lua
|
||||
[MOD] Mobs Redo loaded = [MOD] Mobs Redo carregado
|
||||
|
||||
#api.lua
|
||||
[MOBS] mod profiling enabled, damage not enabled = [MOBS] Mod criador de perfis ativado, dano desabilitado
|
||||
lifetimer expired, removed @1 = tempo de vida expirado, @1 removido
|
||||
[Mobs Redo] @1 has spawning disabled = [Mobs Redo] @1 teve spawn desabilitado
|
||||
[Mobs Redo] Chance setting for @1 is now @2 = [Mobs Redo] Chances para @1 agora vai ser @2
|
||||
[mobs] @1 failed to spawn at @2 = [mobs] @1 falhou ao spawnar em @2
|
||||
Not tamed! = Indomesticado!
|
||||
@1 is owner! = Dono @1!
|
||||
Missed! = Faltou!
|
||||
@1 at full health (@2) = @1 em plena saude (@2)
|
||||
@1 has been tamed! = @1 foi domesticado!
|
||||
Enter name: = Insira um nome:
|
||||
Rename = Renomear
|
||||
|
||||
#crafts.lua
|
||||
Name Tag = Etiqueta
|
||||
Leather = Couro
|
||||
Raw Meat = Carne crua
|
||||
Meat = Carne
|
||||
Magic Lasso (right-click animal to put in inventory) = Laço Magico (clique-direito no animal para por no inventario)
|
||||
Net (right-click animal to put in inventory) = Net (clique-direito no animal para por no inventario)
|
||||
Steel Shears (right-click to shear) = Tesoura de Aço (clique-direito para tosquiar)
|
||||
|
||||
#spawner.lua
|
||||
Monster Spawner =
|
||||
Mob MinLight MaxLight Amount PlayerDist = Mob LuzMinima LuzMaxima Valor DistJogador
|
||||
Spawner Not Active (enter settings) = Spawnador Inativo (configurar)
|
||||
Spawner Active (@1) = Spawnador Ativo (@1)
|
||||
Mob Spawner settings failed! = Configuraçao de Spawnador do Mob falhou!
|
||||
> name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] distance[1-20] y_offset[-10 to 10] = > nome luz_min[0-14] luz_max[0-14] max_mobs_na_area[0 para desabilitar] distancia[1-20] y_offset[-10 a 10]
|
36
mods/ENTITIES/mobs/locale/template.txt
Normal file
36
mods/ENTITIES/mobs/locale/template.txt
Normal file
|
@ -0,0 +1,36 @@
|
|||
# Template for translations of mobs_redo mod
|
||||
# last update: 2016/June/10
|
||||
|
||||
#init.lua
|
||||
[MOD] Mobs Redo loaded =
|
||||
|
||||
#api.lua
|
||||
[MOBS] mod profiling enabled, damage not enabled =
|
||||
lifetimer expired, removed @1 =
|
||||
[Mobs Redo] @1 has spawning disabled =
|
||||
[Mobs Redo] Chance setting for @1 is now @2 =
|
||||
[mobs] @1 failed to spawn at @2 =
|
||||
Not tamed! =
|
||||
@1 is owner! =
|
||||
Missed! =
|
||||
@1 at full health (@2) =
|
||||
@1 has been tamed! =
|
||||
Enter name: =
|
||||
Rename =
|
||||
|
||||
#crafts.lua
|
||||
Name Tag =
|
||||
Leather =
|
||||
Raw Meat =
|
||||
Meat =
|
||||
Magic Lasso (right-click animal to put in inventory) =
|
||||
Net (right-click animal to put in inventory) =
|
||||
Steel Shears (right-click to shear) =
|
||||
|
||||
#spawner.lua
|
||||
Monster Spawner =
|
||||
Mob MinLight MaxLight Amount PlayerDist =
|
||||
Spawner Not Active (enter settings) =
|
||||
Spawner Active (@1) =
|
||||
Mob Spawner settings failed! =
|
||||
> name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] distance[1-20] y_offset[-10 to 10] =
|
8
mods/ENTITIES/mobs/lucky_block.lua
Normal file
8
mods/ENTITIES/mobs/lucky_block.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
if minetest.get_modpath("lucky_block") then
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"dro", {"mobs:nametag"}, 1},
|
||||
{"lig"},
|
||||
})
|
||||
end
|
1
mods/ENTITIES/mobs/mod.conf
Normal file
1
mods/ENTITIES/mobs/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = mobs
|
68
mods/ENTITIES/mobs/readme.MD
Normal file
68
mods/ENTITIES/mobs/readme.MD
Normal file
|
@ -0,0 +1,68 @@
|
|||
|
||||
MOBS REDO for MINETEST
|
||||
|
||||
Built from PilzAdam's original Simple Mobs with additional mobs by KrupnoPavel, Zeg9, ExeterDad and AspireMint.
|
||||
|
||||
|
||||
This mod contains the API only for adding your own mobs into the world, so please use the additional modpacks to add animals, monsters etc.
|
||||
|
||||
|
||||
https://forum.minetest.net/viewtopic.php?f=11&t=9917
|
||||
|
||||
|
||||
Crafts:
|
||||
|
||||
- Nametag (paper, black dye, string) can be used right-click on a tamed mob to give them a name.
|
||||
- Nets can be used to right-click tamed mobs to pick them up and place inside inventory as a spawn egg.
|
||||
- Magic Lasso is similar to nets but with a better chance of picking up larger mobs.
|
||||
- Shears are used to right-click sheep and return 1-3 wool.
|
||||
- Protection Rune lets you protect tamed mobs from harm by other players
|
||||
|
||||
Lucky Blocks: 9
|
||||
|
||||
|
||||
Changelog:
|
||||
|
||||
- 1.32- Added new spawn check to count specific mobs AND new minetest.conf setting to chance spawn chance and numbers, added ability to protect tamed mobs
|
||||
- 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks, also 'mob_difficulty' .conf setting to make mobs harder.
|
||||
- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code
|
||||
- 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod
|
||||
- 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :)
|
||||
- 1.27- Added new sheep, lava flan and spawn egg textures. New Lava Pick tool smelts what you dig. New atan checking function.
|
||||
- 1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :)
|
||||
- 1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak.
|
||||
- 1.24- Added feature where certain animals run away when punched (runaway = true in mob definition)
|
||||
- 1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings)
|
||||
- 1.22- Added ability to name tamed animals and npc using nametags, also npc will attack anyone who punches them apart from owner
|
||||
- 1.21- Added some more error checking to reduce serialize.h error and added height checks for falling off cliffs (thanks cmdskp)
|
||||
- 1.20- Error checking added to remove bad mobs, out of map limit mobs and stop serialize.h error
|
||||
- 1.19- Chickens now drop egg items instead of placing the egg, also throwing eggs result in 1/8 chance of spawning chick
|
||||
- 1.18- Added docile_by_day flag so that monsters will not attack automatically during daylight hours unless hit first
|
||||
- 1.17- Added 'dogshoot' attack type, shoots when out of reach, melee attack when in reach, also api tweaks and self.reach added
|
||||
- 1.16- Mobs follow multiple items now, Npc's can breed
|
||||
- 1.15- Added Feeding/Taming/Breeding function, right-click to pick up any sheep with X mark on them and replace with new one to fix compatibility.
|
||||
- 1.14- All .self variables saved in staticdata, Fixed self.health bug
|
||||
- 1.13- Added capture function (thanks blert2112) chance of picking up mob with hand; net; magic lasso, replaced some .x models with newer .b3d one's
|
||||
- 1.12- Added animal ownership so that players cannot steal your tamed animals
|
||||
- 1.11- Added flying mobs (and swimming), fly=true and fly_in="air" or "deafult:water_source" for fishy
|
||||
- 1,10- Footstep removed (use replace), explosion routine added for exploding mobs.
|
||||
- 1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals
|
||||
- 1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added
|
||||
- 1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables
|
||||
- beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop
|
||||
- 1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal)
|
||||
- 1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten
|
||||
- 1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :)
|
||||
- 1.03- Added mob drop/replace feature so that chickens can drop eggs, cow/sheep can eat grass/wheat etc.
|
||||
- 1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions
|
||||
- 1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items
|
||||
- 1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :)
|
||||
- 0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked
|
||||
- 0.8 - Added sounds to monster mobs (thanks Cyberpangolin for the sfx) and also chicken sound
|
||||
- 0.7 - mobs.protected switch added to api.lua, when set to 1 mobs no longer spawn in protected areas, also bug fixes
|
||||
- 0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have random skins when spawning (sheep fix TODO), also new Honey block
|
||||
- 0.5 - Mobs now float in water, die from falling, and some code improvements
|
||||
- 0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :)
|
||||
- 0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :)
|
||||
- 0.2 - Cooking bucket of milk into cheese now returns empty bucket
|
||||
- 0.1 - Initial Release
|
BIN
mods/ENTITIES/mobs/sounds/default_punch.ogg
Normal file
BIN
mods/ENTITIES/mobs/sounds/default_punch.ogg
Normal file
Binary file not shown.
165
mods/ENTITIES/mobs/spawner.lua
Normal file
165
mods/ENTITIES/mobs/spawner.lua
Normal file
|
@ -0,0 +1,165 @@
|
|||
|
||||
local S = mobs.intllib
|
||||
|
||||
-- mob spawner
|
||||
|
||||
local spawner_default = "mobs_mc:chicken 10 15 0 0"
|
||||
|
||||
minetest.register_node("mobs:spawner", {
|
||||
tiles = {"mob_spawner.png"},
|
||||
drawtype = "glasslike",
|
||||
paramtype = "light",
|
||||
walkable = true,
|
||||
description = S("Monster Spawner"),
|
||||
groups = {cracky = 1, not_in_creative_inventory = 1},
|
||||
drop = "",
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
-- text entry formspec
|
||||
meta:set_string("formspec",
|
||||
"field[text;" .. S("Mob MinLight MaxLight Amount PlayerDist") .. ";${command}]")
|
||||
meta:set_string("infotext", S("Spawner Not Active (enter settings)"))
|
||||
meta:set_string("command", spawner_default)
|
||||
end,
|
||||
|
||||
on_right_click = function(pos, placer)
|
||||
|
||||
if minetest.is_protected(pos, placer:get_player_name()) then
|
||||
return
|
||||
end
|
||||
end,
|
||||
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
|
||||
if not fields.text or fields.text == "" then
|
||||
return
|
||||
end
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
local comm = fields.text:split(" ")
|
||||
local name = sender:get_player_name()
|
||||
|
||||
if minetest.is_protected(pos, name) then
|
||||
minetest.record_protection_violation(pos, name)
|
||||
return
|
||||
end
|
||||
|
||||
local mob = comm[1] -- mob to spawn
|
||||
local mlig = tonumber(comm[2]) -- min light
|
||||
local xlig = tonumber(comm[3]) -- max light
|
||||
local num = tonumber(comm[4]) -- total mobs in area
|
||||
local pla = tonumber(comm[5]) -- player distance (0 to disable)
|
||||
local yof = tonumber(comm[6]) or 0 -- Y offset to spawn mob
|
||||
|
||||
if mob and mob ~= "" and mobs.spawning_mobs[mob] == true
|
||||
and num and num >= 0 and num <= 10
|
||||
and mlig and mlig >= 0 and mlig <= 15
|
||||
and xlig and xlig >= 0 and xlig <= 15
|
||||
and pla and pla >=0 and pla <= 20
|
||||
and yof and yof > -10 and yof < 10 then
|
||||
|
||||
meta:set_string("command", fields.text)
|
||||
meta:set_string("infotext", S("Spawner Active (@1)", mob))
|
||||
|
||||
else
|
||||
minetest.chat_send_player(name, S("Mob Spawner settings failed!"))
|
||||
minetest.chat_send_player(name,
|
||||
S("> name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] distance[1-20] y_offset[-10 to 10]"))
|
||||
end
|
||||
end,
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
})
|
||||
|
||||
-- spawner abm
|
||||
minetest.register_abm({
|
||||
nodenames = {"mobs:spawner"},
|
||||
interval = 10,
|
||||
chance = 4,
|
||||
catch_up = false,
|
||||
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
|
||||
-- get meta and command
|
||||
local meta = minetest.get_meta(pos)
|
||||
local comm = meta:get_string("command"):split(" ")
|
||||
|
||||
-- get settings from command
|
||||
local mob = comm[1]
|
||||
local mlig = tonumber(comm[2])
|
||||
local xlig = tonumber(comm[3])
|
||||
local num = tonumber(comm[4])
|
||||
local pla = tonumber(comm[5]) or 0
|
||||
local yof = tonumber(comm[6]) or 0
|
||||
|
||||
-- if amount is 0 then do nothing
|
||||
if num == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- check objects inside 9x9 area around spawner
|
||||
local objs = minetest.get_objects_inside_radius(pos, 9)
|
||||
local count = 0
|
||||
local ent = nil
|
||||
|
||||
-- count mob objects of same type in area
|
||||
for k, obj in pairs(objs) do
|
||||
|
||||
ent = obj:get_luaentity()
|
||||
|
||||
if ent and ent.name == mob then
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- is there too many of same type?
|
||||
if count >= num then
|
||||
return
|
||||
end
|
||||
|
||||
-- spawn mob if player detected and in range
|
||||
if pla > 0 then
|
||||
|
||||
local in_range = 0
|
||||
local objs = minetest.get_objects_inside_radius(pos, pla)
|
||||
|
||||
for _,oir in pairs(objs) do
|
||||
|
||||
if oir:is_player() then
|
||||
|
||||
in_range = 1
|
||||
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- player not found
|
||||
if in_range == 0 then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- find air blocks within 5 nodes of spawner
|
||||
local air = minetest.find_nodes_in_area(
|
||||
{x = pos.x - 5, y = pos.y + yof, z = pos.z - 5},
|
||||
{x = pos.x + 5, y = pos.y + yof, z = pos.z + 5},
|
||||
{"air"})
|
||||
|
||||
-- spawn in random air block
|
||||
if air and #air > 0 then
|
||||
|
||||
local pos2 = air[math.random(#air)]
|
||||
local lig = minetest.get_node_light(pos2) or 0
|
||||
|
||||
pos2.y = pos2.y + 0.5
|
||||
|
||||
-- only if light levels are within range
|
||||
if lig >= mlig and lig <= xlig then
|
||||
minetest.add_entity(pos2, mob)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
})
|
BIN
mods/ENTITIES/mobs/textures/mob_spawner.png
Normal file
BIN
mods/ENTITIES/mobs/textures/mob_spawner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 261 B |
BIN
mods/ENTITIES/mobs/textures/mobs_blood.png
Normal file
BIN
mods/ENTITIES/mobs/textures/mobs_blood.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 267 B |
BIN
mods/ENTITIES/mobs/textures/mobs_nametag.png
Normal file
BIN
mods/ENTITIES/mobs/textures/mobs_nametag.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
108
mods/ENTITIES/mobs_mc/blaze.lua
Normal file
108
mods/ENTITIES/mobs_mc/blaze.lua
Normal file
|
@ -0,0 +1,108 @@
|
|||
-- daufinsyd
|
||||
-- My work is under the LGPL terms
|
||||
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models
|
||||
-- blaze.lua partial copy of mobs_mc/ghast.lua
|
||||
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:blaze", {
|
||||
type = "monster",
|
||||
hp_min = 20,
|
||||
hp_max = 20,
|
||||
collisionbox = {-0.4, 0.4, -0.4, 0.4, 1.9, 0.4},
|
||||
textures = {
|
||||
{"mobs_blaze.png"}
|
||||
},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_blaze.b3d",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "blaze_breath",
|
||||
death = "blaze_died",
|
||||
damage = "blaze_hurt1",
|
||||
attack = "default_punch3",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 1.6,
|
||||
damage = 2.5,
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
armor = 80,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:blaze_rod",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
stand_start = 1,
|
||||
stand_end = 40,
|
||||
walk_start = 1,
|
||||
walk_end = 40,
|
||||
run_start = 1,
|
||||
run_end = 40,
|
||||
shoot_start = 1,
|
||||
shoot_end = 40,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 10,
|
||||
lava_damage = 0,
|
||||
fall_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "shoot",
|
||||
arrow = "mobs_mc:blaze_fireball",
|
||||
shoot_interval = 3.5,
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 4,
|
||||
floats = 1,
|
||||
fly = true,
|
||||
jump_chance = 98,
|
||||
fear_height = 120,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:blaze", {"mcl_core:lava_flowing", "mcl_nether:netherrack","air"}, 30, -1, 5000, 1, -2000)
|
||||
|
||||
-- Blaze fireball
|
||||
mobs:register_arrow("mobs_mc:blaze_fireball", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.3, y = 0.3},
|
||||
textures = {"mcl_fire_fire_charge.png"},
|
||||
velocity = 12,
|
||||
|
||||
-- Direct hit, no fire... just plenty of pain
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 5},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 5},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
-- Node hit, make fire
|
||||
hit_node = function(self, pos, node)
|
||||
local pos_above = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
if minetest.registered_nodes[minetest.get_node(pos_above).name].buildable_to then
|
||||
minetest.set_node(pos_above, {name="mcl_fire:basic_flame"})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:blaze", "Spawn Blaze", "spawn_egg_blaze.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Blaze loaded")
|
||||
end
|
134
mods/ENTITIES/mobs_mc/chicken.lua
Normal file
134
mods/ENTITIES/mobs_mc/chicken.lua
Normal file
|
@ -0,0 +1,134 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:chicken", {
|
||||
type = "animal",
|
||||
hp_min = 4,
|
||||
hp_max = 4,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_chicken.x",
|
||||
textures = {
|
||||
{"mobs_mc_chicken.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:chicken_raw",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = "mcl_mobitems:feather",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
sounds = {
|
||||
random = "Chicken1",
|
||||
death = "Chickenhurt1",
|
||||
hurt = "Chickenhurt1",
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
fly_start = 181,
|
||||
fly_end = 187,
|
||||
},
|
||||
--[[
|
||||
follow = "farming:seed_wheat",
|
||||
view_range = 5,
|
||||
on_rightclick = function(self, clicker)
|
||||
if clicker:get_inventory() then
|
||||
if minetest.registered_items[":mobs:egg"] then
|
||||
clicker:get_inventory():add_item("main", ItemStack(":mobs:egg 1"))
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
do_custom = function(self)
|
||||
|
||||
if self.child
|
||||
or math.random(1, 5000) > 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = self.object:getpos()
|
||||
|
||||
minetest.add_item(pos, ":mobs:egg")
|
||||
|
||||
minetest.sound_play("default_place_node_hard", {
|
||||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5,
|
||||
})
|
||||
end,
|
||||
]]
|
||||
--from mobs_animals
|
||||
follow = {"mcl_farming:wheat_seeds", "mcl_farming:beetroot_seeds", "mcl_farming:pumpkin_seeds", "mcl_farming:melon_seeds"},
|
||||
view_range = 5,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
|
||||
end,
|
||||
|
||||
do_custom = function(self)
|
||||
|
||||
if self.child
|
||||
or math.random(1, 5000) > 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = self.object:getpos()
|
||||
|
||||
minetest.add_item(pos, "mcl_throwing:egg")
|
||||
|
||||
minetest.sound_play("default_place_node_hard", {
|
||||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5,
|
||||
})
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:chicken", {"mcl_core:dirt_with_grass"}, 20, 8, 7000, 1, 31000)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:chicken", "mobs_mc:chicken")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:chicken", "Spawn Chicken", "spawn_egg_chicken.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC chicken loaded")
|
||||
end
|
140
mods/ENTITIES/mobs_mc/cow.lua
Normal file
140
mods/ENTITIES/mobs_mc/cow.lua
Normal file
|
@ -0,0 +1,140 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:cow", {
|
||||
type = "animal",
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.6, -0.01, -0.6, 0.6, 1.8, 0.6},
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_cow.x",
|
||||
textures = {
|
||||
{"mobs_mc_cow.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:beef_raw",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 3,},
|
||||
{name = "mcl_mobitems:leather",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 3,
|
||||
sounds = {
|
||||
random = "Cow1",
|
||||
death = "Cowhurt1",
|
||||
damage = "Cowhurt1",
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
},
|
||||
--[[
|
||||
follow = "farming:wheat",
|
||||
view_range = 5,
|
||||
on_rightclick = function(self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == "bucket:bucket_empty" and clicker:get_inventory() then
|
||||
local inv = clicker:get_inventory()
|
||||
inv:remove_item("main", "bucket:bucket_empty")
|
||||
-- if room add bucket of milk to inventory, otherwise drop as item
|
||||
if inv:room_for_item("main", {name="mobs:bucket_milk"}) then
|
||||
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = "mobs:bucket_milk"})
|
||||
end
|
||||
end
|
||||
end,
|
||||
]]
|
||||
--from mobs_animals
|
||||
follow = "mcl_farming:wheat_item",
|
||||
view_range = 7,
|
||||
replace_rate = 10,
|
||||
replace_what = {"mcl_core:tallgrass",},
|
||||
replace_with = "air",
|
||||
fear_height = 2,
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
local tool = clicker:get_wielded_item()
|
||||
|
||||
-- milk cow with empty bucket
|
||||
if tool:get_name() == "bucket:bucket_empty" then
|
||||
|
||||
--if self.gotten == true
|
||||
if self.child == true then
|
||||
return
|
||||
end
|
||||
|
||||
if self.gotten == true then
|
||||
minetest.chat_send_player(clicker:get_player_name(),
|
||||
"Cow already milked!")
|
||||
return
|
||||
end
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
|
||||
inv:remove_item("main", "bucket:bucket_empty")
|
||||
|
||||
if inv:room_for_item("main", {name = "mcl_mobitems:milk_bucket"}) then
|
||||
clicker:get_inventory():add_item("main", "mcl_mobitems:milk_bucket")
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = "mcl_mobitems:milk_bucket"})
|
||||
end
|
||||
|
||||
self.gotten = true -- milked
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:cow", {"mcl_core:dirt_with_grass"}, 20, 8, 7000, 1, 31000)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:cow", "mobs_mc:cow")
|
||||
|
||||
-- spawn egg
|
||||
mobs:register_egg("mobs_mc:cow", "Spawn Cow", "spawn_egg_cow.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Cow loaded")
|
||||
end
|
80
mods/ENTITIES/mobs_mc/creeper.lua
Normal file
80
mods/ENTITIES/mobs_mc/creeper.lua
Normal file
|
@ -0,0 +1,80 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:creeper", {
|
||||
type = "monster",
|
||||
hp_min = 20,
|
||||
hp_max = 20,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.6, 0.4},
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
visual = "mesh",
|
||||
visual_size = {x=.75, y=.75, z=.75},
|
||||
mesh = "mobs_creeper.x",
|
||||
textures = {
|
||||
{"mobs_creeper.png"}
|
||||
},
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
attack = "Fuse",
|
||||
death = "Creeperdeath",
|
||||
damage = "Creeper4",
|
||||
war_cry = "Fuse",
|
||||
explode = "explo",
|
||||
},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 3,
|
||||
damage = 1,
|
||||
explosion_radius = 3,
|
||||
armor = 100,
|
||||
maxdrops = 3,
|
||||
drops = {
|
||||
{name = "mcl_core:gunpowder",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
run_start = 24,
|
||||
run_end = 49,
|
||||
hurt_start = 110,
|
||||
hurt_end = 139,
|
||||
death_start = 140,
|
||||
death_end = 189,
|
||||
look_start = 50,
|
||||
look_end = 108,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "explode",
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:creeper", {"group:crumbly", "group:cracky", "group:choppy", "group:snappy"}, 7, -1, 5000, 4, 31000)
|
||||
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:creeper", "mobs_mc:creeper")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:creeper", "Spawn Creeper", "spawn_egg_creeper.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Creeper loaded")
|
||||
end
|
5
mods/ENTITIES/mobs_mc/depends.txt
Normal file
5
mods/ENTITIES/mobs_mc/depends.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
mcl_core
|
||||
mcl_fire
|
||||
mobs
|
||||
mcl_tnt
|
||||
mcl_mobitems
|
1
mods/ENTITIES/mobs_mc/description.txt
Normal file
1
mods/ENTITIES/mobs_mc/description.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Adds Minecraft-like monsters and animals.
|
73
mods/ENTITIES/mobs_mc/enderman.lua
Normal file
73
mods/ENTITIES/mobs_mc/enderman.lua
Normal file
|
@ -0,0 +1,73 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:enderman", {
|
||||
type = "monster",
|
||||
hp_min = 40,
|
||||
hp_max = 40,
|
||||
collisionbox = {-0.4, -2.4, -0.4, 0.4, 1.8, 0.4},
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "mobs_sand_monster.b3d",
|
||||
textures = {
|
||||
{"mobs_endermen.png"}
|
||||
},
|
||||
visual_size = {x=1.2, y=2.5},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_sandmonster",
|
||||
death = "green_slime_death",
|
||||
damage = "Creeperdeath",
|
||||
},
|
||||
walk_velocity = 3.2,
|
||||
run_velocity = 5.4,
|
||||
damage = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_throwing:ender_pearl",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 45,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 39,
|
||||
walk_start = 41,
|
||||
walk_end = 72,
|
||||
run_start = 74,
|
||||
run_end = 105,
|
||||
punch_start = 74,
|
||||
punch_end = 105,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "dogfight",
|
||||
replace_rate = 1,
|
||||
replace_what = {"mcl_flowers:allium", "mcl_flowers:azure_bluet", "mcl_flowers:blue_orchid", "mcl_flowers:dandelion", "mcl_flowers:tulip_orange", "mcl_flowers:tulip_red", "mcl_flowers:tulip_pink", "mcl_flowers:tulip_white", "mcl_flowers:oxeye_daisy", "mcl_flowers:poppy", "mcl_core:cactus", "mcl_core:clay", "mcl_core:coarse_dirt", "mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:gravel", "mcl_farming:melon", "mcl_farming:pumpkin_face", "mcl_core:mycelium", "mcl_core:podzol", "mcl_farming:mushroom_red", "mcl_farming:mushroom_brown", "mcl_core:redsand", "mcl_core:sand", "mcl_tnt:tnt", "mcl_nether:netherrack"},
|
||||
replace_with = "air",
|
||||
replace_offset = -1,
|
||||
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:enderman", { "mcl_core:sand", "mcl_core:redsand"}, 5, -1, 5000, 4, 31000)
|
||||
|
||||
|
||||
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:enderman", "Spawn Enderman", "spawn_egg_enderman.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Enderman loaded")
|
||||
end
|
122
mods/ENTITIES/mobs_mc/ghast.lua
Normal file
122
mods/ENTITIES/mobs_mc/ghast.lua
Normal file
|
@ -0,0 +1,122 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:ghast", {
|
||||
type = "monster",
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-1.45, -1.45, -1.45 ,1.45, 1.45, 1.45},
|
||||
visual_size = {x=3.0, y=3.0},
|
||||
textures = {
|
||||
{"ghast_white.png", "ghast_white.png", "ghast_front.png", "ghast_white.png", "ghast_white.png", "ghast_white.png"}
|
||||
},
|
||||
visual = "cube",
|
||||
blood_texture ="mobs_blood.png",
|
||||
rotate = 270,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
shoot = "mobs_fireball",
|
||||
death = "zombiedeath",
|
||||
damage = "ghast_damage",
|
||||
attack = "mobs_fireball",
|
||||
random = "mobs_eerie",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 2.6,
|
||||
damage = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:ghast_tear",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
{name = "mcl_core:gunpowder",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
hurt_start = 64,
|
||||
hurt_end = 86,
|
||||
death_start = 88,
|
||||
death_end = 118,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 10,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 16,
|
||||
--attack_type = "dogshoot",
|
||||
attack_type = "dogshoot",
|
||||
arrow = "mobs_mc:ghast_fireball",
|
||||
shoot_interval = 3.5,
|
||||
shoot_offset = 1,
|
||||
--'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
|
||||
--'dogshoot_count_max' number of seconds before switching above modes.
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max =1,
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 4,
|
||||
floats=1,
|
||||
fly = true,
|
||||
jump_chance = 98,
|
||||
fear_height = 120,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_spawn("mobs_mc:ghast", {"mcl_core:lava_flowing", "mcl_nether:netherrack", "air"}, 17, -1, 5000, 1, -2000)
|
||||
|
||||
-- Ghast fireball
|
||||
mobs:register_arrow("mobs_mc:ghast_fireball", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.8, y = 0.8},
|
||||
textures = {"mcl_fire_fire_charge.png"},
|
||||
velocity = 6,
|
||||
|
||||
-- direct hit, no fire... just plenty of pain
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 6},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 6},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
-- node hit, bursts into flame
|
||||
hit_node = function(self, pos, node)
|
||||
mobs:explosion(pos, 1, 1, 0)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:ghast", "Spawn Ghast", "spawn_egg_ghast.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Ghast loaded")
|
||||
end
|
339
mods/ENTITIES/mobs_mc/horse.lua
Normal file
339
mods/ENTITIES/mobs_mc/horse.lua
Normal file
|
@ -0,0 +1,339 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
-------------------------
|
||||
--KPGMOBS HORSE
|
||||
-------------------------
|
||||
--By: KrupnovPavel
|
||||
--Tweaked by: maikerumine
|
||||
local function is_ground(pos)
|
||||
local nn = minetest.get_node(pos).name
|
||||
return minetest.get_item_group(nn, "crumbly") ~= 0 or
|
||||
minetest.get_item_group(nn, "choppy") ~= 0 or
|
||||
minetest.get_item_group(nn, "cracky") ~= 0 or
|
||||
minetest.get_item_group(nn, "snappy") ~= 0 or
|
||||
minetest.get_item_group(nn, "unbreakable") ~= 0 or
|
||||
minetest.get_item_group(nn, "immortal") ~= 0
|
||||
end
|
||||
|
||||
local function get_sign(i)
|
||||
if i == 0 then
|
||||
return 0
|
||||
else
|
||||
return i/math.abs(i)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_velocity(v, yaw, y)
|
||||
local x = math.cos(yaw)*v
|
||||
local z = math.sin(yaw)*v
|
||||
return {x=x, y=y, z=z}
|
||||
end
|
||||
|
||||
local function get_v(v)
|
||||
return math.sqrt(v.x^2+v.z^2)
|
||||
end
|
||||
|
||||
local function merge(a, b)
|
||||
if type(a) == 'table' and type(b) == 'table' then
|
||||
for k,v in pairs(b) do if type(v)=='table' and type(a[k] or false)=='table' then merge(a[k],v) else a[k]=v end end
|
||||
end
|
||||
return a
|
||||
end
|
||||
|
||||
-- HORSE go go goooo :)
|
||||
local horse = {
|
||||
physical = true,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
visual = "mesh",
|
||||
stepheight = 1.1,
|
||||
visual_size = {x=1,y=1},
|
||||
mesh = "mobs_horseh1.x",
|
||||
driver = nil,
|
||||
v = 0,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
if self.driver and clicker == self.driver then
|
||||
self.driver = nil
|
||||
clicker:set_detach()
|
||||
elseif not self.driver then
|
||||
self.driver = clicker
|
||||
clicker:set_attach(self.object, "", {x=0,y=11,z=0}, {x=0,y=0,z=0})
|
||||
self.object:setyaw(clicker:get_look_yaw())
|
||||
end
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
print (self.texture, self.jmp)
|
||||
end,
|
||||
|
||||
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, direction)
|
||||
if puncher and puncher:is_player() then
|
||||
puncher:get_inventory():add_item("main", self.name)
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
|
||||
self.v = get_v(self.object:getvelocity())*get_sign(self.v)
|
||||
|
||||
if self.driver then
|
||||
local ctrl = self.driver:get_player_control()
|
||||
if ctrl.up then
|
||||
self.v = self.v + self.jmp
|
||||
end
|
||||
if ctrl.down then
|
||||
self.v = self.v-0.1
|
||||
end
|
||||
if ctrl.left then
|
||||
self.object:setyaw(self.object:getyaw()+math.pi/120+dtime*math.pi/120)
|
||||
end
|
||||
if ctrl.right then
|
||||
self.object:setyaw(self.object:getyaw()-math.pi/120-dtime*math.pi/120)
|
||||
end
|
||||
if ctrl.jump then
|
||||
local p = self.object:getpos()
|
||||
p.y = p.y-0.5
|
||||
if is_ground(p) then
|
||||
local pos = self.object:getpos()
|
||||
pos.y = math.floor(pos.y)+4
|
||||
self.object:setpos(pos)
|
||||
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), 0))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local s = get_sign(self.v)
|
||||
self.v = self.v - 0.02*s
|
||||
if s ~= get_sign(self.v) then
|
||||
self.object:setvelocity({x=0, y=0, z=0})
|
||||
self.v = 0
|
||||
return
|
||||
end
|
||||
|
||||
if math.abs(self.v) > 4.5 then
|
||||
self.v = 4.5*get_sign(self.v)
|
||||
end
|
||||
|
||||
local p = self.object:getpos()
|
||||
p.y = p.y-0.5
|
||||
|
||||
if not is_ground(p) then
|
||||
if minetest.registered_nodes[minetest.get_node(p).name].walkable then
|
||||
self.v = 0
|
||||
end
|
||||
self.object:setacceleration({x=0, y=-10, z=0})
|
||||
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y))
|
||||
else
|
||||
p.y = p.y+1
|
||||
if is_ground(p) then
|
||||
self.object:setacceleration({x=0, y=3, z=0})
|
||||
local y = self.object:getvelocity().y
|
||||
if y > 2 then
|
||||
y = 2
|
||||
end
|
||||
if y < 0 then
|
||||
self.object:setacceleration({x=0, y=10, z=0})
|
||||
end
|
||||
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), y))
|
||||
else
|
||||
self.object:setacceleration({x=0, y=0, z=0})
|
||||
if math.abs(self.object:getvelocity().y) < 1 then
|
||||
local pos = self.object:getpos()
|
||||
pos.y = math.floor(pos.y)+0.5
|
||||
self.object:setpos(pos)
|
||||
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), 0))
|
||||
else
|
||||
self.object:setvelocity(get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y))
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
--END HORSE
|
||||
|
||||
-- backup table
|
||||
local hbak = horse
|
||||
|
||||
-- Brown Horse
|
||||
local hrs = {
|
||||
textures = {"mobs_horseh1.png"},
|
||||
jmp = 2,
|
||||
}
|
||||
minetest.register_entity("mobs_mc:horseh1", merge(hrs, horse))
|
||||
|
||||
-- White Horse
|
||||
horse = hbak
|
||||
local peg = {
|
||||
textures = {"mobs_horsepegh1.png"},
|
||||
jmp = 2,
|
||||
}
|
||||
minetest.register_entity("mobs_mc:horsepegh1", merge(peg, horse))
|
||||
|
||||
-- Black Horse
|
||||
horse = hbak
|
||||
local ara = {
|
||||
textures = {"mobs_horsearah1.png"},
|
||||
jmp = 3,
|
||||
}
|
||||
minetest.register_entity("mobs_mc:horsearah1", merge(ara, horse))
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:horse", {
|
||||
type = "animal",
|
||||
hp_min = 5,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
textures = {
|
||||
{"mobs_horseh.png"},
|
||||
},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_horse.x",
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 200,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:leather",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 6,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
stand_start = 25, stand_end = 75,
|
||||
walk_start = 75, walk_end = 100,
|
||||
},
|
||||
follow = "mcl_farming:wheat_item",
|
||||
view_range = 5,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
local tool = clicker:get_wielded_item()
|
||||
if tool:get_name() == "mcl_mobitems:saddle" then
|
||||
clicker:get_inventory():remove_item("main", "mcl_mobitems:saddle")
|
||||
local pos = self.object:getpos()
|
||||
self.object:remove()
|
||||
minetest.add_entity(pos, "mobs_mc:horseh1")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_mob("mobs_mc:horse2", {
|
||||
type = "animal",
|
||||
hp_min = 15,
|
||||
hp_max = 30,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
textures = {
|
||||
{"mobs_horsepegh.png"},
|
||||
},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_horse.x",
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 200,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:leather",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 6,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
stand_start = 25, stand_end = 75,
|
||||
walk_start = 75, walk_end = 100,
|
||||
},
|
||||
follow = "mcl_farming:wheat_item",
|
||||
view_range = 5,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
local tool = clicker:get_wielded_item()
|
||||
if tool:get_name() == "mcl_mobitems:saddle" then
|
||||
clicker:get_inventory():remove_item("main", "mcl_mobitems:saddle")
|
||||
local pos = self.object:getpos()
|
||||
self.object:remove()
|
||||
minetest.add_entity(pos, "mobs_mc:horsepegh1")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_mob("mobs_mc:horse3", {
|
||||
type = "animal",
|
||||
hp_min = 15,
|
||||
hp_max = 30,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
textures = {
|
||||
{"mobs_horsearah.png"},
|
||||
},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_horse.x",
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:leather",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 6,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
stand_start = 25, stand_end = 75,
|
||||
walk_start = 75, walk_end = 100,
|
||||
},
|
||||
follow = "mcl_farming:wheat_item",
|
||||
view_range = 5,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
local tool = clicker:get_wielded_item()
|
||||
if tool:get_name() == "mcl_mobitems:saddle" then
|
||||
clicker:get_inventory():remove_item("main", "mcl_mobitems:saddle")
|
||||
local pos = self.object:getpos()
|
||||
self.object:remove()
|
||||
minetest.add_entity(pos, "mobs_mc:horsearah1")
|
||||
end
|
||||
end,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:horse", {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, 20, 12, 21000, 1, 12)
|
||||
mobs:register_spawn("mobs_mc:horse2", {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, 20, 12, 23000, 1, 31000)
|
||||
mobs:register_spawn("mobs_mc:horse3", {"mcl_core:sand", "mcl_core:redsand"}, 20, 8, 17000, 1, 5)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:horse", "mobs_mc:horse")
|
||||
mobs:alias_mob("mobs:horse2", "mobs_mc:horse2")
|
||||
mobs:alias_mob("mobs:horse3", "mobs_mc:horse3")
|
||||
|
||||
-- spawn eggs
|
||||
-- KPV wild horse spawn eggs
|
||||
mobs:register_egg("mobs_mc:horse", "Spawn Brown Horse", "spawn_egg_horse.png", 0)
|
||||
mobs:register_egg("mobs_mc:horse2", "Spawn White Horse", "spawn_egg_horse.png", 0)
|
||||
mobs:register_egg("mobs_mc:horse3", "Spawn Arabic Horse", "spawn_egg_horse.png", 0)
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Horse loaded")
|
||||
end
|
33
mods/ENTITIES/mobs_mc/init.lua
Normal file
33
mods/ENTITIES/mobs_mc/init.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local path = minetest.get_modpath("mobs_mc")
|
||||
|
||||
-- Animals
|
||||
dofile(path .. "/chicken.lua") -- Mesh and animation by Pavel_S
|
||||
dofile(path .. "/cow.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/sheep.lua") -- Mesh and animation by Pavel_S
|
||||
dofile(path .. "/pig.lua") -- Mesh and animation by Pavel_S
|
||||
dofile(path .. "/horse.lua") -- KrupnoPavel
|
||||
dofile(path .. "/wolf.lua") -- KrupnoPavel
|
||||
dofile(path .. "/horse.lua") -- KrupnoPavel
|
||||
|
||||
|
||||
-- NPC
|
||||
dofile(path .. "/villager.lua") -- KrupnoPavel
|
||||
|
||||
--Monsters
|
||||
dofile(path .. "/creeper.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/skeleton.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/zombie.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/zombiepig.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/slimes.lua") -- Tomas J. Luis
|
||||
dofile(path .. "/spider.lua") -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
|
||||
dofile(path .. "/enderman.lua") -- maikerumine
|
||||
dofile(path .. "/ghast.lua") -- maikerumine
|
||||
|
||||
dofile(path .. "/blaze.lua") -- Animation by daufinsyd
|
||||
|
||||
print ("[MOD] Mobs Redo 'MC' loaded")
|
269
mods/ENTITIES/mobs_mc/license.txt
Normal file
269
mods/ENTITIES/mobs_mc/license.txt
Normal file
|
@ -0,0 +1,269 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes such as this one.
|
||||
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
cows: right-click with empty bucket gets milk
|
||||
sheep: right-click gets wool
|
||||
chicken: right-click to get an egg
|
||||
|
||||
Milk and eggs need a food mod to be installed.
|
||||
|
||||
Textures are from Faithful 32x32 pack (http://www.minecraftforum.net/topic/72747-faithful-32x32-pack-updateocelot-two-cats-new-saplings-ctm-17/)
|
||||
|
||||
Sounds are from the Minecraft Wiki (Freesound license)
|
||||
|
||||
=====Pig=====(at layer 1)
|
||||
=====Cow=====(at layer 2)
|
||||
=====Sheep=====(at layer 3)
|
||||
|
||||
Ver.0.3
|
||||
Mesh by Morn76
|
||||
Animation by Pavel_S
|
||||
|
||||
===Chicken===
|
||||
Mesh and animation by Pavel_S
|
||||
|
||||
Meshes : Pig, Cow, Sheep
|
||||
Armatures : Pig_Rig, Cow_Rig, Sheep_Rig
|
||||
|
||||
==Animation==
|
||||
Optimized for 24fps.
|
||||
(the last frame equal to first in each animation)
|
||||
The first frame of each animation is default pose.
|
||||
=List of animations :
|
||||
standing (head bobbing slightly up and down) : 1-24
|
||||
walking : 24-50
|
||||
eating (head goes to the ground) : 50-79
|
||||
eating cycle : 58-73
|
||||
look around
|
||||
right : 79-99
|
||||
looking left pose : 89
|
||||
left : 99-119
|
||||
looking right pose : 109
|
||||
hurt (quick half jump with legs slightly crossed) : 119-155
|
||||
death (falls on left side) : 155-180
|
||||
|
||||
There is no delays for looking around and repeats for eating!
|
||||
|
||||
==Rig==
|
||||
See Pig_Rig.png
|
||||
|
||||
==ChangeLog==
|
||||
0.3
|
||||
Added Cow, Sheep
|
||||
Added Cow and Sheep animations
|
||||
Fixed UVunwraps
|
||||
Extended hurt and death animation
|
||||
|
||||
0.2
|
||||
Added Pig animation
|
||||
Fixed UVunwrap
|
||||
|
||||
=====Creeper=====
|
||||
Ver.0.3
|
||||
Mesh by Morn76
|
||||
Animation by Pavel_S
|
||||
|
||||
Meshes : Creeper
|
||||
Armatures : Creeper_Rig
|
||||
|
||||
==Animation==
|
||||
Optimized for 24fps.
|
||||
(the last frame equal to first in each animation)
|
||||
The first frame of each animation is default pose.
|
||||
=List of animations :
|
||||
standing : 1-25
|
||||
walking : 25-50
|
||||
look around
|
||||
right : 50-80
|
||||
looking left pose : 65
|
||||
left : 80-110
|
||||
looking right pose : 95
|
||||
hurt : 110-140
|
||||
death : 140-190
|
||||
|
||||
=====Skeleton=====
|
||||
Ver.0.3
|
||||
Mesh by Morn76
|
||||
Animation by Pavel_S
|
||||
|
||||
Meshes : Skeleton
|
||||
Armatures : Skeleton_Rig
|
||||
|
||||
==Animation==
|
||||
Optimized for 30fps.
|
||||
(the last frame equal to first in each animation)
|
||||
The first frame of each animation is default pose.
|
||||
=List of animations :
|
||||
standing (head bobbing slightly up and down) : 1-25
|
||||
walking : 25-50
|
||||
hurt (quick half jump with legs slightly crossed) : 85-117
|
||||
death (falls on left side) : 117-146
|
||||
|
||||
=====Zombie=====
|
||||
Mesh by Morn76
|
||||
Animation by Pavel_S
|
||||
|
||||
1 - 24 - standing
|
||||
24 - 48 - walking
|
||||
48 - 64 - running
|
||||
64 - 88 - hurm
|
||||
88 - 120 - death
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
|
||||
Original "Slimes Redone" README follows
|
||||
|
||||
"Slimes Redone" - Mod for Minetest (http://www.minetest.net/)
|
||||
|
||||
Introduction
|
||||
==========================================================================================================================
|
||||
This mod adds two type of mobs in the world of Minetest: green slimes and lava slimes. They are hostile and will attack the
|
||||
players as soon as they see them. If they are defeated, the slimes maybe will reward the player with useful resources.
|
||||
|
||||
Green slimes live in the tall grass of the jungles and in the ancient ruins of lost temples. And lava slimes live deep
|
||||
underground near the lava pools.
|
||||
|
||||
I've made this mod inspired by this other: https://forum.minetest.net/viewtopic.php?f=11&t=2979&hilit=slimes which adds friendly
|
||||
slimes. Thank you Jeija!
|
||||
|
||||
Details
|
||||
==========================================================================================================================
|
||||
- Adds two new hostile mobs: green slimes and lava slimes.
|
||||
- They attack players and hurt them on touch. (i'm not sure if the amount of damage is enough or too much...:/)
|
||||
- The biger ones split in a random amout of smaller versions when defeated: big > medium > small.
|
||||
- They can get different enviromental damage: water, lava, sunlight and falling.
|
||||
- They use custom textures and sounds. (more work needs to be done here ;P)
|
||||
- Cartoonish animation (they deform a bit when landing and stretch out when jumping).
|
||||
- Effects (blood, smoke, bubbles, footprints,..).
|
||||
- API to add new slimes.
|
||||
|
||||
Green slimes:
|
||||
> spawn in jungle grass or in temples mossy cobble (default:mossycobble).
|
||||
> on die, they drop a randomish amount of slimeballs
|
||||
> Lava hurts them.
|
||||
|
||||
Lava slimes:
|
||||
> spawn in lava pools deep under ground.
|
||||
> on die, they drop a randomish amount of gunpowder (from default tnt mod).
|
||||
> water hurts them.
|
||||
> when they jump they leave behind a footprint of fire. ^^
|
||||
|
||||
Install
|
||||
==========================================================================================================================
|
||||
Unzip the archive an place it in minetest-base-directory/mods/minetest/
|
||||
If you have a windows client or a linux run-in-place client.
|
||||
If you have a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
|
||||
If you want to install this mod only in one world create the folder worldmods/ in your world directory.
|
||||
For further information or help see: http://wiki.minetest.com/wiki/Installing_Mods
|
||||
|
||||
How to use the mod:
|
||||
==========================================================================================================================
|
||||
Just install it an everything should work.
|
||||
|
||||
Mod Information
|
||||
==========================================================================================================================
|
||||
Version: 0.1
|
||||
Required Minetest Version: >=0.4.12
|
||||
Dependencies: default, default:tnt, mesecon (https://forum.minetest.net/viewtopic.php?f=11&t=628&hilit=mesecon)
|
||||
Soft Dependencies: (none)
|
||||
Highly Recommended: (none)
|
||||
Craft Recipies: (none)
|
||||
Git Repo: https://github.com/TomasJLuis/mt-slimes-redone
|
||||
|
||||
Modders/Developers
|
||||
=========================================================================================================================
|
||||
If you are a modder, you should know that I've never used LUA before. this is my first mod for Mintetest, and I've used
|
||||
this mod to learn how to mod on Minetest. So may be you will find a code full of mistakes and bad practices... ;P
|
||||
If you spot someting that can/must be improved/changed/removed and want to help me to improve this mode and my knowledge,
|
||||
please tell me here: https://forum.minetest.net/viewtopic.php?f=9&t=11743&p=175186#p175186
|
||||
Thank you!
|
||||
|
||||
Version history
|
||||
==========================================================================================================================
|
||||
0.1 - Initial release
|
||||
|
||||
Copyright and Licensing
|
||||
==========================================================================================================================
|
||||
|
||||
- Author: Tomas J. Luis
|
||||
|
||||
- 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/
|
||||
|
||||
- Source code and images by Tomas J. Luis under WTFPL.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
|
||||
Original "simple mobs" README follows
|
||||
|
||||
=== MOBS-MOD for MINETEST-C55 ===
|
||||
by PilzAdam
|
||||
|
||||
Inroduction:
|
||||
This mod adds some basic hostile and friendly mobs to the game.
|
||||
|
||||
How to install:
|
||||
Unzip the archive an place it in minetest-base-directory/mods/minetest/
|
||||
if you have a windows client or a linux run-in-place client. If you have
|
||||
a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
|
||||
If you want to install this mod only in one world create the folder
|
||||
worldmods/ in your worlddirectory.
|
||||
For further information or help see:
|
||||
http://wiki.minetest.com/wiki/Installing_Mods
|
||||
|
||||
How to use the mod:
|
||||
See https://github.com/PilzAdam/mobs/wiki
|
||||
|
||||
For developers:
|
||||
The API documentation is moved to https://github.com/PilzAdam/mobs/wiki/API
|
||||
|
||||
License:
|
||||
Sourcecode: WTFPL (see below)
|
||||
Grahpics: WTFPL (see below)
|
||||
Models: WTFPL (by Pavel_S, see below)
|
||||
|
||||
See also:
|
||||
http://minetest.net/
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
1
mods/ENTITIES/mobs_mc/mod.conf
Normal file
1
mods/ENTITIES/mobs_mc/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = mobs_mc
|
BIN
mods/ENTITIES/mobs_mc/models/3d_armor_character.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/3d_armor_character.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_blaze.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_blaze.b3d
Normal file
Binary file not shown.
6032
mods/ENTITIES/mobs_mc/models/mobs_chicken.x
Normal file
6032
mods/ENTITIES/mobs_mc/models/mobs_chicken.x
Normal file
File diff suppressed because it is too large
Load diff
6137
mods/ENTITIES/mobs_mc/models/mobs_cow.x
Normal file
6137
mods/ENTITIES/mobs_mc/models/mobs_cow.x
Normal file
File diff suppressed because it is too large
Load diff
6167
mods/ENTITIES/mobs_mc/models/mobs_creeper.x
Normal file
6167
mods/ENTITIES/mobs_mc/models/mobs_creeper.x
Normal file
File diff suppressed because it is too large
Load diff
5739
mods/ENTITIES/mobs_mc/models/mobs_horse.x
Normal file
5739
mods/ENTITIES/mobs_mc/models/mobs_horse.x
Normal file
File diff suppressed because it is too large
Load diff
5820
mods/ENTITIES/mobs_mc/models/mobs_horseh1.x
Normal file
5820
mods/ENTITIES/mobs_mc/models/mobs_horseh1.x
Normal file
File diff suppressed because it is too large
Load diff
6032
mods/ENTITIES/mobs_mc/models/mobs_mc_chicken.x
Normal file
6032
mods/ENTITIES/mobs_mc/models/mobs_mc_chicken.x
Normal file
File diff suppressed because it is too large
Load diff
6137
mods/ENTITIES/mobs_mc/models/mobs_mc_cow.x
Normal file
6137
mods/ENTITIES/mobs_mc/models/mobs_mc_cow.x
Normal file
File diff suppressed because it is too large
Load diff
5997
mods/ENTITIES/mobs_mc/models/mobs_pig.x
Normal file
5997
mods/ENTITIES/mobs_mc/models/mobs_pig.x
Normal file
File diff suppressed because it is too large
Load diff
BIN
mods/ENTITIES/mobs_mc/models/mobs_sand_monster.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_sand_monster.b3d
Normal file
Binary file not shown.
7050
mods/ENTITIES/mobs_mc/models/mobs_sheep.x
Normal file
7050
mods/ENTITIES/mobs_mc/models/mobs_sheep.x
Normal file
File diff suppressed because it is too large
Load diff
5448
mods/ENTITIES/mobs_mc/models/mobs_skeleton.x
Normal file
5448
mods/ENTITIES/mobs_mc/models/mobs_skeleton.x
Normal file
File diff suppressed because it is too large
Load diff
6102
mods/ENTITIES/mobs_mc/models/mobs_spider.x
Normal file
6102
mods/ENTITIES/mobs_mc/models/mobs_spider.x
Normal file
File diff suppressed because it is too large
Load diff
5462
mods/ENTITIES/mobs_mc/models/mobs_villager.x
Normal file
5462
mods/ENTITIES/mobs_mc/models/mobs_villager.x
Normal file
File diff suppressed because it is too large
Load diff
7420
mods/ENTITIES/mobs_mc/models/mobs_wolf.x
Normal file
7420
mods/ENTITIES/mobs_mc/models/mobs_wolf.x
Normal file
File diff suppressed because it is too large
Load diff
4293
mods/ENTITIES/mobs_mc/models/mobs_zombie.x
Normal file
4293
mods/ENTITIES/mobs_mc/models/mobs_zombie.x
Normal file
File diff suppressed because it is too large
Load diff
182
mods/ENTITIES/mobs_mc/pig.lua
Normal file
182
mods/ENTITIES/mobs_mc/pig.lua
Normal file
|
@ -0,0 +1,182 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:pig", {
|
||||
type = "animal",
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "mobs_pig.x",
|
||||
textures = {
|
||||
{"mobs_pig.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:porkchop",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 3,},
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 3,
|
||||
sounds = {
|
||||
random = "Pig2",
|
||||
death = "Pigdeath",
|
||||
damage = "Pig2",
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
},
|
||||
follow = {"mcl_core:apple", "mcl_farming:beetroot_item", "mcl_farming:carrot_item", "mcl_mobitems:carrot_on_a_stick"},
|
||||
view_range = 5,
|
||||
on_rightclick = function(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == "mcl_mobitems:saddle" and self.saddle ~= "yes" then
|
||||
self.object:set_properties({
|
||||
textures = {"mobs_pig_with_saddle.png"},
|
||||
})
|
||||
self.saddle = "yes"
|
||||
self.tamed = true
|
||||
self.drops = {
|
||||
{name = "mcl_mobitems:porkchop",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 3,},
|
||||
{name = "mcl_mobitems:saddle",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
}
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
local inv = clicker:get_inventory()
|
||||
local stack = inv:get_stack("main", clicker:get_wield_index())
|
||||
stack:take_item()
|
||||
inv:set_stack("main", clicker:get_wield_index(), stack)
|
||||
end
|
||||
return
|
||||
end
|
||||
-- from boats mod
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
if self.driver and clicker == self.driver then
|
||||
self.driver = nil
|
||||
clicker:set_detach()
|
||||
mcl_player.player_attached[name] = false
|
||||
mcl_player.player_set_animation(clicker, "stand" , 30)
|
||||
elseif not self.driver and self.saddle == "yes" then
|
||||
self.driver = clicker
|
||||
clicker:set_attach(self.object, "", {x = 0, y = 19, z = 0}, {x = 0, y = 0, z = 0})
|
||||
mcl_player.player_attached[name] = true
|
||||
minetest.after(0.2, function()
|
||||
mcl_player.player_set_animation(clicker, "sit" , 30)
|
||||
end)
|
||||
----[[
|
||||
-- ridable pigs
|
||||
if self.name == "mobs_mc:pig" and self.saddle == "yes" and self.driver then
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == "mcl_mobitems:carrot_on_a_stick" then
|
||||
local yaw = self.driver:get_look_yaw() - math.pi / 2
|
||||
local velo = self.object:getvelocity()
|
||||
local v = 1.5
|
||||
if math.abs(velo.x) + math.abs(velo.z) < .6 then velo.y = 5 end
|
||||
self.state = "walk"
|
||||
self.object:setyaw(yaw)
|
||||
self.object:setvelocity({x = -math.sin(yaw) * v, y = velo.y, z = math.cos(yaw) * v})
|
||||
|
||||
local inv = self.driver:get_inventory()
|
||||
-- 26 uses
|
||||
if item:get_wear() > 63000 then
|
||||
item = {name = "mcl_fishing:fishing_rod", count = 1}
|
||||
else
|
||||
item:add_wear(2521)
|
||||
end
|
||||
inv:set_stack("main", self.driver:get_wield_index(), item)
|
||||
return
|
||||
end
|
||||
end
|
||||
--]]
|
||||
--self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
|
||||
end
|
||||
--from mobs_animals
|
||||
if mobs:feed_tame(self, clicker, 8, true, true) then
|
||||
return
|
||||
end
|
||||
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:pig", {"mcl_core:dirt_with_grass"}, 20, 12, 5000, 1, 31000)
|
||||
|
||||
|
||||
--api code to fix
|
||||
--[[
|
||||
|
||||
on_step = function(self, dtime)
|
||||
-- ridable pigs
|
||||
if self.name == "mobs:pig" and self.saddle == "yes" and self.driver then
|
||||
local item = self.driver:get_wielded_item()
|
||||
if item:get_name() == "mobs:carrotstick" then
|
||||
local yaw = self.driver:get_look_yaw() - math.pi / 2
|
||||
local velo = self.object:getvelocity()
|
||||
local v = 1.5
|
||||
if math.abs(velo.x) + math.abs(velo.z) < .6 then velo.y = 5 end
|
||||
self.state = "walk"
|
||||
self.object:setyaw(yaw)
|
||||
self.object:setvelocity({x = -math.sin(yaw) * v, y = velo.y, z = math.cos(yaw) * v})
|
||||
|
||||
local inv = self.driver:get_inventory()
|
||||
local stack = inv:get_stack("main", self.driver:get_wield_index())
|
||||
stack:add_wear(100)
|
||||
if stack:get_wear() > 65400 then
|
||||
stack = {name = "fishing:pole", count = 1}
|
||||
end
|
||||
inv:set_stack("main", self.driver:get_wield_index(), stack)
|
||||
return
|
||||
end
|
||||
end
|
||||
end,
|
||||
]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:pig", "mobs_mc:pig")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:pig", "Spawn Pig", "spawn_egg_pig.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Pig loaded")
|
||||
end
|
21
mods/ENTITIES/mobs_mc/readme.md
Normal file
21
mods/ENTITIES/mobs_mc/readme.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
MC MOBS
|
||||
WIP
|
||||
assembled by maikerumine
|
||||
compatable with mobs redo api
|
||||
|
||||
|
||||
Chicken
|
||||
|
||||
- Found in green areas (bamboo biome in ethereal) and lays eggs on flat ground, Can be picked up and placed in inventory and gives 1-2 raw chicken when killed. Feed 8x wheat seed to breed.
|
||||
|
||||
Cow
|
||||
|
||||
- Wanders around eating grass/wheat and can be right-clicked with empty bucket to get milk. Cows will defend themselves when hit and can be right-clicked with 8x wheat to tame and breed.
|
||||
|
||||
Sheep
|
||||
|
||||
- Green grass and wheat munchers that can be clipped using shears to give 1-3 wool. Feed sheep 8x wheat to regrow wool, tame and breed. Will drop 1-3 meat when killed.
|
||||
|
||||
|
||||
Note: After breeding animals need to rest for 4 minutes, baby animals take 4 minutes to grow up and feeding them helps them grow quicker...
|
139
mods/ENTITIES/mobs_mc/sheep.lua
Normal file
139
mods/ENTITIES/mobs_mc/sheep.lua
Normal file
|
@ -0,0 +1,139 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
--mcsheep
|
||||
mobs:register_mob("mobs_mc:sheep", {
|
||||
type = "animal",
|
||||
hp_min = 8,
|
||||
hp_max = 8,
|
||||
collisionbox = {-0.5, -0.01, -0.5, 0.5, 1.5, 0.5},
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "mobs_sheep.x",
|
||||
textures = {
|
||||
{"mobs_sheep.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobs:mutton_raw",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
{name = "mcl_wool:white",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 3,
|
||||
sounds = {
|
||||
random = "Sheep3",
|
||||
death = "Sheep3",
|
||||
damage = "Sheep3",
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
},
|
||||
follow = "mcl_farming:wheat_item",
|
||||
view_range = 5,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == "mcl_farming:wheat_item" then
|
||||
if not self.tamed then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
self.tamed = true
|
||||
elseif self.naked then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
self.food = (self.food or 0) + 1
|
||||
if self.food >= 4 then
|
||||
self.food = 0
|
||||
self.naked = false
|
||||
self.object:set_properties({
|
||||
textures = {"sheep.png"},
|
||||
})
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
if item:get_name() == "mcl_core:shears" and not self.naked then
|
||||
self.naked = true
|
||||
local pos = self.object:getpos()
|
||||
minetest.sound_play("shears", {pos = pos})
|
||||
pos.y = pos.y + 0.5
|
||||
if not self.color then
|
||||
minetest.add_item(pos, ItemStack("mcl_wool:white "..math.random(1,3)))
|
||||
else
|
||||
minetest.add_item(pos, ItemStack("mcl_wool:"..self.color.." "..math.random(1,3)))
|
||||
end
|
||||
self.object:set_properties({
|
||||
textures = {"sheep_sheared.png"},
|
||||
})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
item:add_wear(300)
|
||||
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
|
||||
end
|
||||
end
|
||||
if minetest.get_item_group(item:get_name(), "dye") == 1 and not self.naked then
|
||||
print(item:get_name(), minetest.get_item_group(item:get_name(), "dye"))
|
||||
local name = item:get_name()
|
||||
local pname = name:split(":")[2]
|
||||
|
||||
self.object:set_properties({
|
||||
textures = {"mobs_sheep_"..pname..".png"},
|
||||
})
|
||||
self.color = pname
|
||||
self.drops = {
|
||||
{name = "mcl_mobs:mutton_raw",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
{name = "mcl_wool:"..self.color,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
}
|
||||
end
|
||||
end,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:sheep", {"mcl_core:dirt_with_grass"}, 20, 12, 5000, 2, 31000)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:sheep", "mobs_mc:sheep")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:sheep", "Spawn Sheep", "spawn_egg_sheep.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Sheep loaded")
|
||||
end
|
156
mods/ENTITIES/mobs_mc/skeleton.lua
Normal file
156
mods/ENTITIES/mobs_mc/skeleton.lua
Normal file
|
@ -0,0 +1,156 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:skeleton", {
|
||||
type = "monster",
|
||||
hp_min = 30,
|
||||
hp_max = 30,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
visual = "mesh",
|
||||
mesh = "mobs_skeleton.x",
|
||||
textures = {
|
||||
{"mobs_skeleton.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "skeleton1",
|
||||
death = "skeletondeath",
|
||||
damage = "skeletonhurt1",
|
||||
},
|
||||
walk_velocity = 1.2,
|
||||
run_velocity = 2.4,
|
||||
damage = 1,
|
||||
armor = 200,
|
||||
drops = {
|
||||
{name = "mcl_throwing:arrow",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
{name = "mcl_mobitems:bone",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 30,
|
||||
speed_run = 60,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
run_start = 24,
|
||||
run_end = 49,
|
||||
hurt_start = 85,
|
||||
hurt_end = 115,
|
||||
death_start = 117,
|
||||
death_end = 145,
|
||||
shoot_start = 50,
|
||||
shoot_end = 82,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 1,
|
||||
view_range = 16,
|
||||
attack_type = "dogshoot",
|
||||
arrow = "mcl_throwing:arrow_entity",
|
||||
shoot_interval = 2.5,
|
||||
shoot_offset = 1,
|
||||
--'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
|
||||
--'dogshoot_count_max' number of seconds before switching above modes.
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max =3,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:skeleton", {"group:crumbly", "group:cracky", "group:choppy", "group:snappy"}, 7, -1, 5000, 4, 31000)
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:skeleton2", {
|
||||
type = "monster",
|
||||
hp_max = 60,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
visual = "mesh",
|
||||
mesh = "mobs_skeleton.x",
|
||||
textures = {
|
||||
{"mobs_skeleton2.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "skeleton1",
|
||||
death = "skeletondeath",
|
||||
damage = "skeletonhurt1",
|
||||
},
|
||||
walk_velocity = 1.2,
|
||||
run_velocity = 2.4,
|
||||
damage = 3,
|
||||
armor = 200,
|
||||
drops = {
|
||||
{name = "mcl_core:coal_lump",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
{name = "mcl_mobitems:bone",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
{name = "mcl_heads:wither_skeleton",
|
||||
chance = 40,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 30,
|
||||
speed_run = 60,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
run_start = 24,
|
||||
run_end = 49,
|
||||
hurt_start = 85,
|
||||
hurt_end = 115,
|
||||
death_start = 117,
|
||||
death_end = 145,
|
||||
shoot_start = 50,
|
||||
shoot_end = 82,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "dogshoot",
|
||||
arrow = "mcl_throwing:arrow_entity",
|
||||
shoot_interval = 0.5,
|
||||
shoot_offset = 1,
|
||||
--'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
|
||||
--'dogshoot_count_max' number of seconds before switching above modes.
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max =6,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:skeleton2", {"group:crumbly", "group:cracky", "group:choppy", "group:snappy"}, 7, -1, 5000, 4, -3000)
|
||||
|
||||
|
||||
local arrows = {
|
||||
{"mcl_throwing:arrow", "mcl_throwing:arrow_entity" },
|
||||
}
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:skeleton", "mobs_mc:skeleton")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:skeleton", "Spawn Skeleton", "spawn_egg_skeleton.png")
|
||||
mobs:register_egg("mobs_mc:skeleton2", "Spawn Wither Skeleton", "spawn_egg_wither_skeleton.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Skeleton loaded")
|
||||
end
|
334
mods/ENTITIES/mobs_mc/slimes.lua
Normal file
334
mods/ENTITIES/mobs_mc/slimes.lua
Normal file
|
@ -0,0 +1,334 @@
|
|||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:greensmall", {
|
||||
type = "monster",
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
hp_min = 1,
|
||||
hp_max = 1,
|
||||
collisionbox = {-0.2, -0.4, -0.2, 0.2, 0.2, 0.2},
|
||||
visual_size = {x=0.5, y=0.5},
|
||||
textures = {
|
||||
{"green_slime_top.png", "green_slime_bottom.png", "green_slime_front.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png"}
|
||||
},
|
||||
visual = "cube",
|
||||
blood_texture ="green_slime_blood.png",
|
||||
rotate = 270,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
jump = "green_slime_jump",
|
||||
death = "green_slime_death",
|
||||
damage = "green_slime_damage",
|
||||
attack = "green_slime_attack",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 2.6,
|
||||
damage = 0,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:slimeball",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
hurt_start = 64,
|
||||
hurt_end = 86,
|
||||
death_start = 88,
|
||||
death_end = 118,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 0,
|
||||
lava_damage = 10,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "dogfight",
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 4,
|
||||
jump_chance = 98,
|
||||
fear_height = 12,
|
||||
})
|
||||
|
||||
mobs:register_mob("mobs_mc:greenmedium", {
|
||||
type = "monster",
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
hp_min = 4,
|
||||
hp_max = 4,
|
||||
collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
|
||||
visual_size = {x=1.0, y=1.0},
|
||||
textures = {
|
||||
{"green_slime_top.png", "green_slime_bottom.png", "green_slime_front.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png"}
|
||||
},
|
||||
visual = "cube",
|
||||
blood_texture ="green_slime_blood.png",
|
||||
rotate = 270,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
jump = "green_slime_jump",
|
||||
death = "green_slime_death",
|
||||
damage = "green_slime_damage",
|
||||
attack = "green_slime_attack",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 2.0,
|
||||
damage = 2,
|
||||
armor = 100,
|
||||
drops = {},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
hurt_start = 64,
|
||||
hurt_end = 86,
|
||||
death_start = 88,
|
||||
death_end = 118,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 0,
|
||||
lava_damage = 10,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "dogfight",
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 8,
|
||||
jump_chance = 100,
|
||||
fear_height = 60,
|
||||
on_die =function(self, pos)
|
||||
for i=1,4 do
|
||||
minetest.add_entity(self.object:getpos(), "mobs_mc:greensmall")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
mobs:register_mob("mobs_mc:greenbig", {
|
||||
type = "monster",
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
hp_min = 16,
|
||||
hp_max = 16,
|
||||
collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75},
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
textures = {
|
||||
{"green_slime_top.png", "green_slime_bottom.png", "green_slime_front.png", "green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png"}
|
||||
},
|
||||
visual = "cube",
|
||||
blood_texture ="green_slime_blood.png",
|
||||
rotate = 270,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
jump = "green_slime_jump",
|
||||
death = "green_slime_death",
|
||||
damage = "green_slime_damage",
|
||||
attack = "green_slime_attack",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 1.6,
|
||||
damage = 4,
|
||||
armor = 100,
|
||||
drops = {},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
hurt_start = 64,
|
||||
hurt_end = 86,
|
||||
death_start = 88,
|
||||
death_end = 118,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 0,
|
||||
lava_damage = 10,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "dogfight",
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 8,
|
||||
jump_chance = 100,
|
||||
fear_height = 60,
|
||||
on_die = function(self, pos)
|
||||
for i=1,2 do
|
||||
minetest.add_entity(self.object:getpos(), "mobs_mc:greenmedium")
|
||||
end
|
||||
end,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:greensmall", {"mcl_core:water_flowing", "mcl_core:mossycobble"}, 7, -1, 5000, 4, 31000)
|
||||
mobs:register_spawn("mobs_mc:greenmedium", {"mcl_core:water_flowing", "mcl_core:mossycobble"}, 7, -1, 5000, 4, 31000)
|
||||
mobs:register_spawn("mobs_mc:greenbig", {"mcl_core:water_flowing", "mcl_core:mossycobble"}, 7, -1, 5000, 4, 31000)
|
||||
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:lavasmall", {
|
||||
type = "monster",
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
hp_min = 4,
|
||||
hp_max = 4,
|
||||
collisionbox = {-0.2, -0.4, -0.2, 0.2, 0.2, 0.2},
|
||||
visual_size = {x=0.5, y=0.5},
|
||||
textures = {
|
||||
{"lava_slime_top.png", "lava_slime_bottom.png", "lava_slime_front.png", "lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png"}
|
||||
},
|
||||
visual = "cube",
|
||||
blood_texture ="lava_slime_blood.png",
|
||||
rotate = 270,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
jump = "green_slime_jump",
|
||||
death = "green_slime_death",
|
||||
damage = "green_slime_damage",
|
||||
attack = "green_slime_attack",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 2.6,
|
||||
damage = 1,
|
||||
armor = 100,
|
||||
drops = {},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
hurt_start = 64,
|
||||
hurt_end = 86,
|
||||
death_start = 88,
|
||||
death_end = 118,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 10,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "dogfight",
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 4,
|
||||
jump_chance = 98,
|
||||
fear_height = 12,
|
||||
})
|
||||
|
||||
mobs:register_mob("mobs_mc:lavabig", {
|
||||
type = "monster",
|
||||
pathfinding = true,
|
||||
group_attack = true,
|
||||
hp_min = 16,
|
||||
hp_max = 16,
|
||||
collisionbox = {-0.75, -0.75, -0.75, 0.75, 0.75, 0.75},
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
textures = {
|
||||
{"lava_slime_top.png", "lava_slime_bottom.png", "lava_slime_front.png", "lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png"}
|
||||
},
|
||||
visual = "cube",
|
||||
blood_texture ="lava_slime_blood.png",
|
||||
rotate = 270,
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
jump = "green_slime_jump",
|
||||
death = "green_slime_death",
|
||||
damage = "green_slime_damage",
|
||||
attack = "green_slime_attack",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 1.6,
|
||||
damage = 2,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:magma_cream",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
hurt_start = 64,
|
||||
hurt_end = 86,
|
||||
death_start = 88,
|
||||
death_end = 118,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 10,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "dogfight",
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 8,
|
||||
jump_chance = 100,
|
||||
fear_height = 60,
|
||||
on_die = function(self, pos)
|
||||
for i=1,4 do
|
||||
minetest.add_entity(self.object:getpos(), "mobs_mc:lavasmall")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:lavasmall", {"nether:rack", "mcl_core:lava"}, 7, -1, 5000, 4, 31000)
|
||||
mobs:register_spawn("mobs_mc:lavabig", {"nether:rack", "mcl_core:lava"}, 7, -1, 5000, 4, 31000)
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:lavasmall", "mobs_mc:lavasmall")
|
||||
mobs:alias_mob("mobs:lavabig", "mobs_mc:lavabig")
|
||||
mobs:alias_mob("mobs:greensmall", "mobs_mc:greensmall")
|
||||
mobs:alias_mob("mobs:greenmediuml", "mobs_mc:greenmedium")
|
||||
mobs:alias_mob("mobs:greenbig", "mobs_mc:greenbig")
|
||||
|
||||
mobs:alias_mob("slimes:lavasmall", "mobs_mc:lavasmall")
|
||||
mobs:alias_mob("slimes:lavabig", "mobs_mc:lavabig")
|
||||
mobs:alias_mob("slimes:greensmall", "mobs_mc:greensmall")
|
||||
mobs:alias_mob("slimes:greenmediuml", "mobs_mc:greenmedium")
|
||||
mobs:alias_mob("slimes:greenbig", "mobs_mc:greenbig")
|
||||
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:lavabig", "Spawn Magma Cube", "spawn_egg_magma_cube.png")
|
||||
mobs:register_egg("mobs_mc:greenbig", "Spawn Green Slime", "spawn_egg_slime.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Slimes loaded")
|
||||
end
|
BIN
mods/ENTITIES/mobs_mc/sounds/Chicken1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Chicken1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Chickenhurt1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Chickenhurt1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Chickenplop.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Chickenplop.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Cow1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Cow1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Cowhurt1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Cowhurt1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Creeper4.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Creeper4.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Creeperdeath.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Creeperdeath.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Fuse.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Fuse.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Pig2.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Pig2.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Pigdeath.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Pigdeath.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Sheep3.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Sheep3.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Villager1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Villager1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Villageraccept.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Villageraccept.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Villagerdead.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Villagerdead.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Villagerdeny.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Villagerdeny.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Villagerhurt1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Villagerhurt1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/Villagertrade.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/Villagertrade.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/blaze_breath.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/blaze_breath.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/blaze_died.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/blaze_died.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/blaze_hurt1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/blaze_hurt1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/bowhit1.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/bowhit1.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/default_punch3.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/default_punch3.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/explo.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/explo.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_attack.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_attack.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_damage.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_damage.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_death.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_death.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_jump.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_jump.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_land.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/green_slime_land.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/mobs_eerie.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/mobs_eerie.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/mobs_fireball.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/mobs_fireball.ogg
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/sounds/mobs_sandmonster.ogg
Normal file
BIN
mods/ENTITIES/mobs_mc/sounds/mobs_sandmonster.ogg
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue