Removed the following mods from 'animals_modpack': 'animal_big_red',

'animal_creeper', 'animal_vombie', 'animal_wolf', 'mob_archer',
'mob_guard', 'mob_miner', & 'mob_npc'.
This commit is contained in:
AntumDeluge
2016-08-31 11:50:40 -07:00
parent 82359a9a40
commit 404de568d7
117 changed files with 0 additions and 4840 deletions

View File

@@ -1,9 +0,0 @@
Licenses
CC0
sounds/animal_big_red_hit.ogg
sounds/animal_big_red_random_1.ogg
Everything not mentioned:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@@ -1,5 +0,0 @@
default
animalmaterials
mob_environments
mobf
intllib?

View File

@@ -1,217 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file init.lua
--! @brief big_red implementation
--! @copyright Sapier
--! @author Sapier
--! @date 2013-01-27
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
minetest.log("action","MOD: animal_big_red mod loading ...")
local version = "0.2.0"
local big_red_groups = {
not_in_creative_inventory=1
}
local selectionbox_big_red = {-0.75, -1.9, -0.75, 0.75, 1.9, 0.75}
local big_red_prototype = {
name="big_red",
modname="animal_big_red",
factions = {
member = {
"underground",
"monsters",
"daemonic"
}
},
generic = {
description= S("Big Red"),
base_health=8,
kill_result="animalmaterials:meat_toxic 3",
armor_groups= {
fleshy=10,
deamon=20,
},
groups = big_red_groups,
envid="simple_air",
population_density=1000,
},
movement = {
default_gen="probab_mov_gen",
min_accel=0.2,
max_accel=0.4,
max_speed=2,
pattern="stop_and_go",
canfly=false,
follow_speedup=30,
},
harvest = {
tool="",
tool_consumed=false,
result="",
transforms_to="",
min_delay=-1,
},
combat = {
angryness=0.95,
starts_attack=true,
sun_sensitive=true,
melee = {
maxdamage=2,
range=2,
speed=2,
},
distance = {
attack="animal_resources:plasmaball_entity",
range=10,
speed=2,
},
self_destruct = nil,
},
sound = {
random = {
name="animal_big_red_random_1",
min_delta = 30,
chance = 0.5,
gain = 1,
max_hear_distance = 5,
},
},
animation = {
walk = {
start_frame = 91,
end_frame = 170,
},
stand = {
start_frame = 11,
end_frame = 90,
},
combat = {
start_frame = 171,
end_frame = 250,
},
throw_plasmaball = {
start_frame = 1,
end_frame = 10,
}
},
states = {
{
name = "default",
movgen = "none",
chance = 0,
animation = "stand",
graphics_3d = {
visual = "mesh",
mesh = "animal_big_red.b3d",
textures = {"animal_big_red_mesh.png"},
collisionbox = selectionbox_big_red,
visual_size= {x=1,y=1,z=1},
},
graphics = {
sprite_scale={x=6,y=6},
sprite_div = {x=1,y=1},
visible_height = 3.2,
visible_width = 1,
},
typical_state_time = 30,
},
{
name = "walking",
movgen = "probab_mov_gen",
chance = 0.25,
animation = "walk",
typical_state_time = 180,
},
{
movgen="follow_mov_gen",
name = "combat",
chance = 0,
animation = "combat",
typical_state_time = 0,
},
},
}
--compatibility code
minetest.register_entity("animal_big_red:big_red_spawner_shadows",
{
physical = false,
collisionbox = { 0.0,0.0,0.0,0.0,0.0,0.0},
visual = "sprite",
textures = { "invisible.png^[makealpha:128,0,0^[makealpha:128,128,0" },
on_activate = function(self,staticdata)
local pos = self.object:getpos();
minetest.add_entity(pos,"mobf:compat_spawner")
self.object:remove()
end,
})
--spawning code
local big_red_name = big_red_prototype.modname .. ":" .. big_red_prototype.name
local big_red_env = mobf_environment_by_name(big_red_prototype.generic.envid)
local spawnbox = minetest.deserialize(minetest.serialize(selectionbox_big_red))
spawnbox[5] = 3
mobf_spawner_register("big_red_spawner_1",big_red_name,
{
spawnee = big_red_name,
spawn_interval = 60,
spawn_inside = big_red_env.media,
entities_around =
{
{ type="MAX",distance=1,threshold=0 },
{ type="MAX",entityname=big_red_name,
distance=100,threshold=2 },
},
light_around =
{
{ type="CURRENT_MAX", distance = 2, threshold=6 }
},
absolute_height = {
max = -100,
},
mapgen =
{
enabled = true,
retries = 10,
spawntotal = 3,
},
surfaces = { "default:dirt",
"default:cobble",
"default:stone",
"default:desert_stone",
"default:gravel"},
collisionbox = spawnbox
})
--register with animals mod
minetest.log("action","\tadding mob "..big_red_prototype.name)
mobf_add_mob(big_red_prototype)
minetest.log("action","MOD: animal_big_red mod version " .. version .. " loaded")

View File

@@ -1,3 +0,0 @@
# Translation by Xanthin
Big Red = Grosser Roter

View File

@@ -1,5 +0,0 @@
# Spanish translation for Animals Modpack.
# Traducción al español de Animals Modpack.
# Author/Autor: Diego Martínez <kaeza>
Big Red = Gran Rojo

View File

@@ -1,3 +0,0 @@
# Template
Big Red =

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 KiB

View File

@@ -1,9 +0,0 @@
Licenses
CC0
sounds/bomb_explosion.ogg
sounds/animal_creeper_random1.ogg
Everything not mentioned:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@@ -1,5 +0,0 @@
default
mobf
fire
mob_environments
intllib?

View File

@@ -1,189 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file init.lua
--! @brief boombomb implementation
--! @copyright Sapier
--! @author Sapier
--! @date 2013-01-27
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
minetest.log("action","MOD: animal_creeper mod loading ...")
local version = "0.2.0"
local creeper_groups = {
not_in_creative_inventory=1
}
local selectionbox_creeper = {-1, -1, -1, 1, 1, 1}
local creeper_prototype = {
name="creeper",
modname="animal_creeper",
factions = {
member = {
"monsters"
}
},
generic = {
description= S("BoomBomb"),
base_health=3,
kill_result="",
armor_groups= {
monster=90,
fleshy=45
},
groups = creeper_groups,
envid="on_ground_2",
population_density=500,
},
movement = {
min_accel=0.4,
max_accel=0.6,
max_speed=2,
pattern="stop_and_go",
canfly=false,
follow_speedup=5,
},
combat = {
angryness=0.95,
starts_attack=true,
sun_sensitive=true,
melee = {
maxdamage=0,
range=2,
speed=1,
},
distance = nil,
self_destruct = {
damage=15,
range=5,
node_damage_range = 1.5,
delay=5,
},
},
sound = {
random = {
name="animal_creeper_random_1",
min_delta = 10,
chance = 0.5,
gain = 1,
max_hear_distance = 75,
},
self_destruct = {
name="animal_creeper_bomb_explosion",
gain = 2,
max_hear_distance = 150,
},
},
states = {
{
name = "default",
movgen = "probab_mov_gen",
typical_state_time = 30,
chance = 0,
graphics = {
sprite_scale={x=4,y=4},
sprite_div = {x=6,y=1},
visible_height = 1.5,
},
graphics_3d = {
visual = "mesh",
mesh = "boombomb.b3d",
textures = {"boombomb_mesh.png"},
collisionbox = selectionbox_creeper,
visual_size= {x=1,y=1,z=1},
},
},
}
}
--compatibility code
minetest.register_entity("animal_creeper:creeper_spawner",
{
physical = false,
collisionbox = { 0.0,0.0,0.0,0.0,0.0,0.0},
visual = "sprite",
textures = { "invisible.png^[makealpha:128,0,0^[makealpha:128,128,0" },
on_activate = function(self,staticdata)
local pos = self.object:getpos();
minetest.add_entity(pos,"mobf:compat_spawner")
self.object:remove()
end,
})
minetest.register_entity("animal_creeper:creeper_spawner_at_night",
{
physical = false,
collisionbox = { 0.0,0.0,0.0,0.0,0.0,0.0},
visual = "sprite",
textures = { "invisible.png^[makealpha:128,0,0^[makealpha:128,128,0" },
on_activate = function(self,staticdata)
local pos = self.object:getpos();
minetest.add_entity(pos,"mobf:compat_spawner")
self.object:remove()
end,
})
local creeper_name = creeper_prototype.modname .. ":" .. creeper_prototype.name
local creeper_env = mobf_environment_by_name(creeper_prototype.generic.envid)
mobf_spawner_register("boombomb_spawner_1",creeper_name,
{
spawnee = creeper_name,
spawn_interval = 10,
spawn_inside = creeper_env.media,
entities_around =
{
{ type="MAX",distance=1,threshold=0 },
{ type="MAX",entityname=creeper_name,
distance=creeper_prototype.generic.population_density,threshold=1 },
},
absolute_height =
{
min = -10,
},
light_around =
{
{ type="TIMED_MIN", distance = 0, threshold=LIGHT_MAX +1,time=0.5 },
{ type="TIMED_MAX", distance = 0, threshold=6,time=0.0 },
{ type="CURRENT_MAX", distance = 0, threshold=5 }
},
daytimes =
{
{ begin = 0.75, stop=0.99 },
{ begin = 0.0, stop=0.25 },
},
surfaces = creeper_env.surfaces.good,
collisionbox = selectionbox_creeper
})
--register with animals mod
minetest.log("action","\tadding mob "..creeper_prototype.name)
mobf_add_mob(creeper_prototype)
minetest.log("action","MOD: animal_creeper mod version " .. version .. " loaded")

View File

@@ -1,3 +0,0 @@
# Translation by Xanthin
BoomBomb = BummBombe

View File

@@ -1,5 +0,0 @@
# Spanish translation for Animals Modpack.
# Traducción al español de Animals Modpack.
# Author/Autor: Diego Martínez <kaeza>
BoomBomb = BoomBomba

View File

@@ -1,3 +0,0 @@
# Template
BoomBomb =

View File

@@ -1,12 +0,0 @@
--creeper--
random:
animal_creeper_random_1.ogg
hit:
--missing--
self_destruct:
animal_creeper_bomb_explosion.ogg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,9 +0,0 @@
Licenses
CCO
sounds/animal_vombie_sun_damage.ogg
sounds/animal_vombie_random_1.ogg
Everything not mentioned:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@@ -1,3 +0,0 @@
default
mob_environments
mobf

View File

@@ -1,67 +0,0 @@
--! @class vombie_flame
--! @ingroup weapons
--! @brief a plasmaball weapon entity
vombie_flame = {
physical = false,
textures = {"animal_vombie_flames.png"},
visual = "sprite",
collisionbox = {0,0,0,0,0,0},
spritediv = {x=1,y=16},
--vizual_size = {x=0.1,y=0.1},
velocity = 1.0,
gravity = -0.1,
damage = 8,
leveltime = 2.5,
created = -1,
leveldtime = 0,
level = 0,
}
-------------------------------------------------------------------------------
-- name: vombie_flame.on_activate = function(self, staticdata)
--
--! @brief onactivate callback for plasmaball
--! @memberof vombie_flame
--! @private
--
--! @param self fireball itself
--! @param staticdata
-------------------------------------------------------------------------------
function vombie_flame.on_activate(self,staticdata)
self.created = mobf_get_current_time()
self.object:setsprite({x=0,y=self.level}, 1, 0, true)
self.object:setvelocity({x=0,y=self.velocity,z=0})
end
-------------------------------------------------------------------------------
-- name: vombie_flame.on_step = function(self, dtime)
--
--! @brief onstep callback for vombie flame
--! @memberof vombie_flame
--! @private
--
--! @param vombie_flame itself
--! @param dtime time since last callback
-------------------------------------------------------------------------------
function vombie_flame.on_step(self, dtime)
local pos = self.object:getpos()
local node = minetest.get_node(pos)
self.leveldtime = self.leveldtime + dtime
if (self.leveldtime *10) > math.random()*self.leveltime then
self.level = self.level +1
if (self.level < 16) then
self.object:setsprite({x=0,y=self.level}, 1, 0, true)
else
self.object:remove()
end
self.leveldtime = 0
end
end
minetest.register_entity(":animal_vombie:vombie_flame", vombie_flame)

View File

@@ -1,324 +0,0 @@
local version = "0.2.2"
minetest.log("action","MOD: loading animal_vombie ... ")
local vombie_groups = {
not_in_creative_inventory=1
}
local selectionbox_vombie = {-0.3, -1.0, -0.3, 0.3, 0.7, 0.3}
local modpath = minetest.get_modpath("animal_vombie")
dofile (modpath .. "/flame.lua")
function vombie_drop()
local result = {}
if math.random() < 0.05 then
table.insert(result,"animalmaterials:bone 2")
else
table.insert(result,"animalmaterials:bone 1")
end
table.insert(result,"animalmaterials:meat_undead 1")
return result
end
function vombie_on_step_handler(entity,now,dtime)
local pos = entity.getbasepos(entity)
local current_light = minetest.get_node_light(pos)
--print("vombie on step: current_light:" .. current_light .. " max light: "
-- .. LIGHT_MAX .. " 3dmode:" .. dump(minetest.world_setting_get("disable_animals_3d_mode")))
if current_light ~= nil and
current_light > LIGHT_MAX and
minetest.world_setting_get("mobf_disable_3d_mode") ~= true and
minetest.world_setting_get("vombie_3d_burn_animation_enabled") == true then
local xdelta = (math.random()-0.5)
local zdelta = (math.random()-0.5)
--print("receiving sun damage: " .. xdelta .. " " .. zdelta)
local newobject=minetest.add_entity( { x=pos.x + xdelta,
y=pos.y,
z=pos.z + zdelta },
"animal_vombie:vombie_flame")
--add particles
end
if entity.dynamic_data.spawning.spawner == "at_night" or
entity.dynamic_data.spawning.spawner == "at_night_mapgen" then
local current_time = minetest.get_timeofday()
if (current_time > 0.15) and
(current_time < 0.30) then
if entity.last_time ~= nil then
local last_step_size = dtime / 86400 -- (24*3600)
local time_step = current_time - entity.last_time
if time_step > last_step_size * 1000 then
print("Vombie: time jump detected removing mob: " .. time_step .. " last_step_size: " .. (last_step_size * 1000))
spawning.remove(entity)
--return false to abort procession of other hooks
return false
end
end
end
entity.last_time = current_time
end
end
function vombie_on_activate_handler(entity)
local pos = entity.object:getpos()
local current_light = minetest.get_node_light(pos)
if current_light == nil then
minetest.log(LOGLEVEL_ERROR,
"ANIMALS:Vombie Bug!!! didn't get a light value for ".. printpos(pos))
return
end
--check if animal is in sunlight
if ( current_light > LIGHT_MAX) then
--don't spawn vombie in sunlight
spawning.remove(entity)
end
end
local vombie_prototype = {
name="vombie",
modname="animal_vombie",
factions = {
member = {
"monsters",
"undead"
}
},
generic = {
description="Vombie",
base_health=8,
kill_result=vombie_drop,
armor_groups= {
fleshy=95,
daemon=30,
},
groups = vombie_groups,
envid="simple_air",
custom_on_step_handler = vombie_on_step_handler,
custom_on_activate_handler = vombie_on_activate_handler,
population_density=20,
stepheight = 0.51,
},
movement = {
min_accel=0.3,
max_accel=0.75,
max_speed=1,
pattern="stop_and_go",
canfly=false,
follow_speedup=20,
},
combat = {
angryness=1,
starts_attack=true,
sun_sensitive=true,
melee = {
maxdamage=2,
range=2,
speed=1,
},
distance = nil,
self_destruct = nil,
},
sound = {
random = {
name="animal_vombie_random_1",
min_delta = 10,
chance = 0.5,
gain = 0.05,
max_hear_distance = 5,
},
sun_damage = {
name="animal_vombie_sun_damage",
gain = 0.25,
max_hear_distance = 7,
},
hit = {
name="animal_vombie_hit",
gain = 0.25,
max_hear_distance = 5,
},
},
animation = {
stand = {
start_frame = 0,
end_frame = 80,
},
walk = {
start_frame = 168,
end_frame = 188,
},
attack = {
start_frame = 81,
end_frame = 110,
},
},
states = {
{
name = "default",
movgen = "none",
typical_state_time = 30,
chance = 0,
animation = "stand",
graphics = {
sprite_scale={x=4,y=4},
sprite_div = {x=6,y=2},
visible_height = 2.2,
visible_width = 1,
},
graphics_3d = {
visual = "mesh",
mesh = "animal_vombie_vombie.b3d",
textures = {"animal_vombie_vombie_mesh.png"},
collisionbox = selectionbox_vombie,
visual_size= {x=1,y=1,z=1},
},
},
{
name = "walking",
movgen = "probab_mov_gen",
typical_state_time = 120,
chance = 0.5,
animation = "walk",
},
{
name = "combat",
typical_state_time = 9999,
chance = 0.0,
animation = "attack",
movgen="mgen_path",
},
}
}
--compatibility code
minetest.register_entity("animal_vombie:vombie_spawner",
{
physical = false,
collisionbox = { 0.0,0.0,0.0,0.0,0.0,0.0},
visual = "sprite",
textures = { "invisible.png^[makealpha:128,0,0^[makealpha:128,128,0" },
on_activate = function(self,staticdata)
local pos = self.object:getpos();
minetest.add_entity(pos,"mobf:compat_spawner")
self.object:remove()
end,
})
minetest.register_entity("animal_vombie:vombie_spawner_at_night",
{
physical = false,
collisionbox = { 0.0,0.0,0.0,0.0,0.0,0.0},
visual = "sprite",
textures = { "invisible.png^[makealpha:128,0,0^[makealpha:128,128,0" },
on_activate = function(self,staticdata)
local pos = self.object:getpos();
minetest.add_entity(pos,"mobf:compat_spawner")
self.object:remove()
end,
})
minetest.register_entity("animal_vombie:vombie_spawner_shadows",
{
physical = false,
collisionbox = { 0.0,0.0,0.0,0.0,0.0,0.0},
visual = "sprite",
textures = { "invisible.png^[makealpha:128,0,0^[makealpha:128,128,0" },
on_activate = function(self,staticdata)
local pos = self.object:getpos();
minetest.add_entity(pos,"mobf:compat_spawner")
self.object:remove()
end,
})
--spawning code
local vombie_name = vombie_prototype.modname .. ":" .. vombie_prototype.name
local vombie_env = mobf_environment_by_name(vombie_prototype.generic.envid)
mobf_spawner_register("vombie_spawner_1",vombie_name,
{
spawnee = vombie_name,
spawn_interval = 10,
spawn_inside = vombie_env.media,
entities_around =
{
{ type="MAX",distance=1,threshold=0 },
{ type="MAX",entityname=vombie_name,
distance=vombie_prototype.generic.population_density,threshold=2 },
},
absolute_height =
{
min = -10,
},
light_around =
{
{ type="TIMED_MIN", distance = 0, threshold=LIGHT_MAX +1,time=0.5 },
{ type="TIMED_MAX", distance = 0, threshold=6,time=0.0 },
{ type="CURRENT_MAX", distance = 0, threshold=5 }
},
daytimes =
{
{ begin = 0.85, stop=0.99 },
{ begin = 0.0, stop=0.15 },
},
surfaces = { "default:dirt_with_grass", "default:sand", "default:desert_sand"},
collisionbox = selectionbox_vombie
})
mobf_spawner_register("vombie_spawner_2",vombie_name,
{
spawnee = vombie_name,
spawn_interval = 60,
spawn_inside = vombie_env.media,
entities_around =
{
{ type="MAX",distance=1,threshold=0 },
{ type="MAX",entityname=vombie_name,
distance=50,threshold=2 },
},
light_around =
{
{ type="OVERALL_MAX", distance = 2, threshold=6 }
},
absolute_height = {
max = 100,
},
mapgen =
{
enabled = true,
retries = 10,
spawntotal = 3,
},
collisionbox = selectionbox_vombie
})
--register with animals mod
minetest.log("action","\tadding mob "..vombie_prototype.name)
mobf_add_mob(vombie_prototype)
minetest.log("action","MOD: animal_vombie mod version " .. version .. " loaded")

View File

@@ -1,16 +0,0 @@
--vombie--
random:
random_1.ogg
hit:
animal_vombie_hit.ogg
die:
--missing--
melee:
--missing--
sun_damage:
sun_damage.ogg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -1,9 +0,0 @@
Licenses
CC0:
animal_wolf_attack.ogg
animal_wolf_melee.ogg
animal_wolf_hit.*.ogg
Everything not mentioned:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@@ -1,5 +0,0 @@
default
mobf
animalmaterials
mob_environments
intllib?

View File

@@ -1,293 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allowed to pretend you have written it.
--
--! @file init.lua
--! @brief wolf implementation
--! @copyright Sapier
--! @author Sapier
--! @date 2013-01-27
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
minetest.log("action","MOD: mob_wolf loading ...")
local version = "0.2.1"
local wolf_groups = {
not_in_creative_inventory=1
}
local selectionbox_wolf = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
wolf_prototype = {
name="wolf",
modname="animal_wolf",
factions = {
member = {
"animals",
"forrest_animals",
"wolfs"
}
},
generic = {
description= S("Wolf"),
base_health=10,
kill_result="animalmaterials:fur 1",
armor_groups= {
fleshy=90,
},
groups = wolf_groups,
addoncatch = "animal_wolf:tamed_wolf",
envid="on_ground_2",
population_density=800,
},
movement = {
canfly=false,
guardspawnpoint = true,
teleportdelay = 60,
min_accel=0.5,
max_accel=0.9,
max_speed=1.5,
follow_speedup=10,
},
catching = {
tool="animalmaterials:net",
consumed=true,
},
combat = {
starts_attack=true,
sun_sensitive=false,
melee = {
maxdamage=5,
range=2,
speed=1,
},
distance = nil,
self_destruct = nil,
},
sound = {
random = nil,
melee = {
name="animal_wolf_melee",
gain = 0.8,
max_hear_distance = 10
},
hit = {
name="animal_wolf_hit",
gain = 0.8,
max_hear_distance = 5
},
start_attack = {
name="animal_wolf_attack",
gain = 0.8,
max_hear_distance = 20
},
},
animation = {
stand = {
start_frame = 0,
end_frame = 60,
},
walk = {
start_frame = 61,
end_frame = 120,
},
sleep = {
start_frame = 121,
end_frame = 180,
},
},
attention = {
hear_distance = 5,
hear_distance_value = 20,
view_angle = math.pi/2,
own_view_value = 0.2,
remote_view = false,
remote_view_value = 0,
attention_distance_value = 0.2,
watch_threshold = 10,
attack_threshold = 20,
attention_distance = 10,
attention_max = 25,
},
states = {
{
name = "default",
movgen = "follow_mov_gen",
typical_state_time = 30,
chance = 0,
animation = "stand",
graphics_3d = {
visual = "mesh",
mesh = "animal_wolf.b3d",
textures = {"animal_wolf_mesh.png"},
collisionbox = selectionbox_wolf,
visual_size= {x=1,y=1,z=1},
},
},
{
name = "sleeping",
--TODO replace by check for night
custom_preconhandler = nil,
movgen = "none",
typical_state_time = 300,
chance = 0.10,
animation = "sleep",
},
{
name = "combat",
typical_state_time = 9999,
chance = 0.0,
animation = "walk",
movgen = "follow_mov_gen"
},
}
}
tamed_wolf_prototype = {
name="tamed_wolf",
modname="animal_wolf",
generic = {
description= S("Tamed Wolf"),
base_health=10,
kill_result="animalmaterials:fur 1",
armor_groups= {
fleshy=90,
},
groups = wolf_groups,
envid="on_ground_2",
--this needs to be done by animal as first on_activate handler is called
--before placer is known to entity
custom_on_place_handler = function(entity, placer, pointed_thing)
if placer:is_player(placer) then
if entity.dynamic_data ~= nil and
entity.dynamic_data.movement ~= nil then
entity.dynamic_data.movement.target = placer
else
print("ANIMAL tamed wolf: unable to set owner maybe wolf has been already deleted")
end
end
end,
custom_on_activate_handler = function(entity)
print("ANIMAL tamed wolf: custom on activate handler called")
if (entity.dynamic_data.spawning.spawner ~= nil) then
print("ANIMAL tamed wolf: setting target to: " .. entity.dynamic_data.spawning.spawner )
entity.dynamic_data.movement.target = minetest.get_player_by_name(entity.dynamic_data.spawning.spawner)
end
end,
custom_on_step_handler = function(entity,now,dstep)
if entity.dynamic_data.spawning.spawner == nil and
now - entity.dynamic_data.spawning.original_spawntime > 30 then
print("ANIMAL tamed wolf: tamed wolf without owner removing")
spawning.remove(entity)
end
end
},
movement = {
canfly=false,
guardspawnpoint = false,
teleportdelay = 20,
min_accel=0.3,
max_accel=0.9,
max_speed=1.5,
max_distance=2,
follow_speedup=20,
},
catching = {
tool="animalmaterials:net",
consumed=true,
},
sound = {
random = nil,
},
animation = {
stand = {
start_frame = 0,
end_frame = 60,
},
walk = {
start_frame = 61,
end_frame = 120,
},
},
states = {
{
name = "default",
movgen = "follow_mov_gen",
typical_state_time = 60,
chance = 0,
animation = "stand",
graphics_3d = {
visual = "mesh",
mesh = "animal_wolf.b3d",
textures = {"animal_wolf_tamed_mesh.png"},
collisionbox = selectionbox_wolf,
visual_size= {x=1,y=1,z=1},
},
},
}
}
local wolf_name = wolf_prototype.modname .. ":" .. wolf_prototype.name
local wolf_env = mobf_environment_by_name(wolf_prototype.generic.envid)
mobf_spawner_register("wolf_spawner_1",wolf_name,
{
spawnee = wolf_name,
spawn_interval = 300,
spawn_inside = wolf_env.media,
entities_around =
{
{ type="MAX",distance=1,threshold=0 },
{ type="MAX",entityname=wolf_name,
distance=wolf_prototype.generic.population_density,threshold=1 },
},
nodes_around =
{
{ type="MIN", name = { "default:leaves","default:tree"},distance=3,threshold=4}
},
absolute_height =
{
min = -10,
},
mapgen =
{
enabled = true,
retries = 5,
spawntotal = 1,
},
surfaces = wolf_env.surfaces.good,
collisionbox = selectionbox_wolf
})
if factions~= nil and
type(factions.set_base_reputation) == "function" then
factions.set_base_reputation("wolfs","players",-25)
end
minetest.log("action","\tadding mob "..wolf_prototype.name)
mobf_add_mob(wolf_prototype)
minetest.log("action","\tadding mob "..tamed_wolf_prototype.name)
mobf_add_mob(tamed_wolf_prototype)
minetest.log("action","MOD: animal_wolf mod version " .. version .. " loaded")

View File

@@ -1,4 +0,0 @@
# Translation by Xanthin
Wolf = Wolf
Tamed Wolf = Gezaehmter Wolf

View File

@@ -1,6 +0,0 @@
# Spanish translation for Animals Modpack.
# Traducción al español de Animals Modpack.
# Author/Autor: Diego Martínez <kaeza>
Wolf = Lobo
Tamed Wolf = Lobo Domesticado

View File

@@ -1,4 +0,0 @@
# Template
Wolf =
Tamed Wolf =

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -1,9 +0,0 @@
Licenses
CC0:
mob_archer_melee.ogg
mob_archer_shoot.ogg
Everything not mentioned:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@@ -1,5 +0,0 @@
default
mob_environments
mobf
intllib?
animal_resources

View File

@@ -1,162 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file init.lua
--! @brief npc implementation
--! @copyright Sapier
--! @author Sapier
--! @date 2013-01-27
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
minetest.log("action","MOD: mob_archer mod loading ...")
local version = "0.2.1"
local archer_groups = {
not_in_creative_inventory=1
}
archer_prototype = {
name="archer",
modname="mob_archer",
factions = {
member = {
"npc",
"hireling"
}
},
generic = {
description= S("Archer"),
base_health=40,
kill_result="",
armor_groups= {
fleshy=75,
},
groups = archer_groups,
envid="simple_air",
stepheight = 0.51,
},
movement = {
guardspawnpoint = true,
teleportdelay = 60,
min_accel=0.3,
max_accel=0.7,
max_speed=1.5,
min_speed=0.01,
pattern="stop_and_go",
canfly=false,
max_distance=0.1,
},
catching = {
tool="animalmaterials:contract",
consumed=true,
},
combat = {
angryness=0.99,
starts_attack=true,
sun_sensitive=false,
attack_hostile_mobs = true,
melee = {
maxdamage=1,
range=2,
speed=1,
},
distance = {
attack="animal_resources:arrow_entity",
range=17,
min_range=5,
speed = 1,
balistic = true,
},
self_destruct = nil,
},
states = {
{
name = "combat_distance",
movgen = "none",
typical_state_time = 9999,
chance = 0.0,
animation = "shoot",
state_mode = "combat",
},
{
name = "combat",
movgen = "none",
typical_state_time = 9999,
chance = 0.0,
animation = "punch",
state_mode = "combat",
},
{
name = "default",
movgen = "follow_mov_gen",
typical_state_time = 180,
chance = 1.00,
animation = "stand",
state_mode = "auto",
graphics_3d = {
visual = "mesh",
mesh = "mob_archer_archer.b3d",
textures = {"mob_archer_archer_mesh.png"},
collisionbox = {-0.3,-1.0,-0.3, 0.3,0.8,0.3},
visual_size= {x=1, y=1},
},
},
},
animation = {
walk = {
start_frame = 168,
end_frame = 187,
basevelocity = 18,
},
stand = {
start_frame = 0,
end_frame = 79,
},
punch = {
start_frame = 189,
end_frame = 199,
},
shoot = {
start_frame = 221,
end_frame = 250,
},
},
sound = {
shoot_distance = {
name="mob_archer_shoot",
gain = 0.5,
max_hear_distance = 17,
},
melee = {
name="mob_archer_meele",
gain = 0.5,
max_hear_distance = 5,
},
hit = {
name="animal_resources_mattgarkusha_human_male_grunt",
gain = 0.5,
max_hear_distance = 5,
}
},
}
minetest.log("action","\tadding mob "..archer_prototype.name)
mobf_add_mob(archer_prototype)
minetest.log("action","MOD: mob_archer mod version " .. version .. " loaded")

View File

@@ -1,3 +0,0 @@
# Translation by Xanthin
Archer = Bogenschuetze

View File

@@ -1,5 +0,0 @@
# Spanish translation for Animals Modpack.
# Traducción al español de Animals Modpack.
# Author/Autor: Diego Martínez <kaeza>
Archer = Arquero

View File

@@ -1,3 +0,0 @@
# Template
Archer =

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

View File

@@ -1,10 +0,0 @@
Licenses
CCO:
mob_guard_melee.0.ogg
mob_guard_melee.1.ogg
mob_guard_melee.2.ogg
Everything not mentioned:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@@ -1,5 +0,0 @@
default
mob_environments
mobf
intllib?
animal_resources

View File

@@ -1,159 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file init.lua
--! @brief npc implementation
--! @copyright Sapier
--! @author Sapier
--! @date 2013-01-27
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
minetest.log("action","MOD: mob_guard mod loading ...")
local version = "0.2.1"
local guard_groups = {
not_in_creative_inventory=1
}
guard_prototype = {
name="guard",
modname="mob_guard",
factions = {
member = {
"npc",
"hireling"
}
},
generic = {
description= S("Guard"),
base_health=40,
kill_result="",
armor_groups= {
fleshy=60,
},
groups = guard_groups,
envid="simple_air",
stepheight = 0.51,
},
movement = {
guardspawnpoint = true,
teleportdelay = 60,
min_accel=0.3,
max_accel=0.7,
max_speed=1.5,
min_speed=0.01,
pattern="stop_and_go",
canfly=false,
follow_speedup=10,
max_distance=0.2,
},
catching = {
tool="animalmaterials:contract",
consumed=true,
},
combat = {
angryness=0.99,
starts_attack=true,
sun_sensitive=false,
attack_hostile_mobs = true,
melee = {
maxdamage=2,
range=2,
speed=1,
},
self_destruct = nil,
},
patrol = {
state = "patrol",
cycle_path = true,
},
states = {
{
name = "combat_melee",
movgen = "none",
typical_state_time = 9999,
chance = 0.0,
animation = "punch",
state_mode = "combat",
},
{
name = "combat",
movgen = "follow_mov_gen",
typical_state_time = 9999,
chance = 0.0,
animation = "walk",
state_mode = "combat",
},
{
name = "default",
movgen = "follow_mov_gen",
typical_state_time = 180,
chance = 1.00,
animation = "stand",
state_mode = "auto",
graphics_3d = {
visual = "mesh",
mesh = "mob_guard_guard.b3d",
textures = {"mob_guard_guard_mesh.png"},
collisionbox = {-0.3,-1.0,-0.3, 0.3,0.8,0.3},
visual_size= {x=1, y=1},
},
},
{
name = "patrol",
movgen = "mgen_path",
typical_state_time = 9999,
chance = 0.0,
animation = "walk",
state_mode = "user_def",
},
},
animation = {
walk = {
start_frame = 168,
end_frame = 188,
basevelocity = 18,
},
stand = {
start_frame = 0,
end_frame = 80,
},
punch = {
start_frame = 189,
end_frame = 199,
},
},
sound = {
hit = {
name="animal_resources_mattgarkusha_human_male_grunt",
gain = 0.5,
max_hear_distance = 5,
},
melee = {
name="mob_guard_melee",
gain = 0.5,
max_hear_distance = 5,
}
}
}
minetest.log("action","\tadding mob "..guard_prototype.name)
mobf_add_mob(guard_prototype)
minetest.log("action","MOD: mob_guard mod version " .. version .. " loaded")

View File

@@ -1,3 +0,0 @@
# Translation by Xanthin
Guard = Wache

View File

@@ -1,5 +0,0 @@
# Spanish translation for Animals Modpack.
# Traducción al español de Animals Modpack.
# Author/Autor: Diego Martínez <kaeza>
Guard = Guardia

View File

@@ -1,3 +0,0 @@
# Template
Guard =

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 KiB

View File

@@ -1,39 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file constants.lua
--! @brief constants used within miner mob
--! @copyright Sapier
--! @author Sapier
--! @date 2015-12-20
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
MINER_MAX_TUNNEL_SIZE = 5
MINER_DIG_SOUND_INTERVAL = 0.6
MINER_HAND_TOOLDEF = {
tool_capabilities =
{
full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
},
damage_groups = {fleshy=1},
}
}
MINER_GROUPS = { not_in_creative_inventory=1 }
DIR_NORTH = "zplus"
DIR_SOUTH = "zminus"
DIR_EAST = "xplus"
DIR_WEST = "xminus"

View File

@@ -1,95 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file crack_entity.lua
--! @brief crack simulation entity
--! @copyright Sapier
--! @author Sapier
--! @date 2015-12-27
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
local ANIMATIONSTEPS = 5 +1
minetest.register_entity("mob_miner:cracksim",
{
collisionbox = { -0.49,-0.49,-0.49,0.49,0.49,0.49 },
visual = "cube",
visual_size = {x=1.01, y=1.01, z=1.01},
textures = { "mob_miner_blank16x16.png","mob_miner_blank16x16.png","mob_miner_blank16x16.png",
"mob_miner_blank16x16.png","mob_miner_blank16x16.png","mob_miner_blank16x16.png" },
physical = false,
groups = { "immortal" },
on_activate = function(self, staticdata, dtime_s)
if staticdata ~= nil and staticdata == "delme" then
print("Staticdata on activation is: " .. dump(staticdata))
self.object:remove()
end
self.timepassed = 0
local ownnode = minetest.get_node_or_nil(self.object:getpos())
if ownnode == nil then
self.object:remove()
end
local nodedef = minetest.registered_nodes[ownnode.name]
self.tiledef = nodedef.tiles
self.laststep = nil
end,
on_step = function(self, dtime)
self.timepassed = self.timepassed + dtime
if self.timetotal ~= nil then
if (self.timepassed > self.timetotal) then
self.object:remove()
return
end
self:update_texture()
end
if self.timepassed > 20 then
self.object:remove()
return
end
end,
get_staticdata = function(self)
return "delme"
end,
update_texture = function(self)
local current_step = math.floor(self.timepassed / (self.timetotal/ANIMATIONSTEPS))
if self.last_step ~= current_step then
if (current_step ~= 0) then
local properties = self.object:get_properties()
--local texturename = "mob_miner_blank16x16.png^[crack:" .. (ANIMATIONSTEPS-1) .. ":" .. current_step
local texturename = "mob_miner_blank16x16.png^[crack:1:" .. current_step
print("New animstep detected: " .. current_step .. " Texture is: " .. texturename)
properties.textures = {
texturename, texturename, texturename,
texturename, texturename, texturename
}
self.object:set_properties(properties)
end
self.last_step = current_step
end
end
}
)

View File

@@ -1,6 +0,0 @@
default
mob_environments
mobf
mobf_settings
intllib?
animal_resources

View File

@@ -1,548 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file init.lua
--! @brief npc implementation
--! @copyright Sapier
--! @author Sapier
--! @date 2015-12-20
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
mobf_assert_backtrace(not core.global_exists("mob_miner"))
mob_miner = {}
--!path of mod
local miner_modpath = minetest.get_modpath("mob_miner")
local version = "0.1.1"
--include debug trace functions
dofile (miner_modpath .. "/constants.lua")
dofile (miner_modpath .. "/utils.lua")
dofile (miner_modpath .. "/ui.lua")
dofile (miner_modpath .. "/names_m_de.lua")
dofile (miner_modpath .. "/crack_entity.lua")
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
minetest.log("action","MOD: mob_miner mod loading ...")
local miner_activate = function(entity)
local mydata = entity:get_persistent_data()
--!initialize custom entity functions
entity.getDirection = mob_miner.getDirection
entity.completeDig = mob_miner.complete_dig
entity.add_item = mob_miner.add_to_inventory
entity.add_wear = mob_miner.add_wear
entity.stepforward = mob_miner.stepforward
entity.update_digpos = mob_miner.update_digpos
if (mydata.control == nil ) then
mydata.control = {
digstate = "idle",
}
end
if (mydata.inventory == nil) then
mydata.inventory = {}
end
if type(mydata.control.digpos) ~= "table" then
mydata.control.digpos= nil
end
if (mydata.control.digstate == "idle_nothing_to_dig") then
mydata.control.digstate = "idle"
end
if (mydata.control.digstate == "idle") then
entity:set_state("default")
elseif (mydata.control.digstate == "digging") then
entity:set_state("digging")
elseif (mydata.control.digstate == "follow") then
entity:set_state("relocate")
end
if mydata.name == nil then
mydata.name = MINER_NAMES[math.random(#MINER_NAMES)]
end
if mydata.inventory == nil then
mydata.inventory = {}
end
if mydata.inventory.tools == nil then
mydata.inventory.tools = {}
end
if mydata.inventory.digged == nil then
mydata.inventory.digged = {}
end
if mydata.digspec == nil or
#mydata.digspec ~= MINER_MAX_TUNNEL_SIZE then
mydata.digspec = {}
end
for x = 1, MINER_MAX_TUNNEL_SIZE, 1 do
if mydata.digspec[x] == nil or
#mydata.digspec[x] ~= MINER_MAX_TUNNEL_SIZE then
mydata.digspec[x] = {}
for y = 1, MINER_MAX_TUNNEL_SIZE, 1 do
mydata.digspec[x][y] = false
end
end
end
mydata.digspec[3][1] = true
mydata.digspec[3][2] = true
if mydata.control.soundtime == nil then
mydata.control.soundtime = 0
end
mydata.unique_entity_id = string.gsub(tostring(entity),"table: ","")
entity.dynamic_data.miner_formspec_data = {}
entity.dynamic_data.miner_data = {}
if entity.dynamic_data.spawning.spawner ~= nil then
entity.dynamic_data.movement.target = core.get_player_by_name(entity.dynamic_data.spawning.spawner)
end
end
mob_miner.stepforward = function(entity)
local pos = entity.object:getpos()
local basepos = entity:getbasepos()
local direction = entity:getDirection()
local targetpos = pos
local targetbasepos = basepos
if (direction == DIR_EAST) then
targetpos = {x=pos.x+1, z=pos.z, y=pos.y}
targetbasepos = {x=basepos.x+1, z=basepos.z, y=basepos.y}
elseif(direction == DIR_WEST) then
targetpos = {x=pos.x-1, z=pos.z, y=pos.y}
targetbasepos = {x=basepos.x-1, z=basepos.z, y=basepos.y}
elseif (direction == DIR_NORTH) then
targetpos = {x=pos.x, z=pos.z+1, y=pos.y}
targetbasepos = {x=basepos.x, z=basepos.z+1, y=basepos.y}
elseif (direction == DIR_SOUTH) then
targetpos = {x=pos.x, z=pos.z-1, y=pos.y}
targetbasepos = {x=basepos.x, z=basepos.z-1, y=basepos.y}
end
if (environment.pos_is_ok(targetbasepos,entity,true) == "ok") then
entity.object:moveto( targetpos, true)
return true
end
return false
end
mob_miner.add_wear = function(entity, toolname, wear)
local inventory = entity:get_persistent_data().inventory.tools
--! digging using hand
if (toolname == "") then
return true
end
local old_count = #inventory
for i = 1, #inventory, 1 do
if (inventory[i] ~= nil) then
if (inventory[i].name == toolname) then
inventory[i].wear = inventory[i].wear + wear
if (inventory[i].wear > 65535) then
local new_inventory = {}
inventory[i] = nil
for i=1, old_count, 1 do
if inventory[i] ~= nil then
table.insert(new_inventory, inventory[i])
end
end
entity:get_persistent_data().inventory.tools = new_inventory
end
return true
end
end
end
return false
end
mob_miner.add_to_inventory = function(entity, itemname)
local inventory = entity:get_persistent_data().inventory.digged
local done = false
local temp_stack = ItemStack( { name=itemname })
local stack_max = temp_stack:get_stack_max()
for i = 1, #inventory, 1 do
if (inventory[i].name == itemname) then
if (inventory[i].count < stack_max) then
inventory[i].count = inventory[i].count +1
done = true
end
end
end
if not done and #inventory < 16 then
table.insert(inventory, temp_stack:to_table())
done = true
end
return done
end
mob_miner.update_digpos = function(entity)
local data = entity:get_persistent_data()
local basepos = entity:getbasepos()
local direction = entity:getDirection()
local non_air_node_detected = false
local digpositions = mob_miner.get_pos2dig_list(direction, basepos, data.digspec)
for i, v in ipairs(digpositions) do
local nodeat = core.get_node(v)
if (nodeat.name ~= "air") then
non_air_node_detected = true;
--! use hand time as reference
local digtime, wear, group = mob_miner_calc_digtime(MINER_HAND_TOOLDEF, nodeat.name)
local used_tool = ""
for i=1, #data.inventory.tools, 1 do
if (data.inventory.tools[i] ~= nil) then
local toolname = data.inventory.tools[i].name
local tooldef = core.registered_tools[toolname]
if ( tooldef ~= nil) then
local tooldigtime, toolwear, toolgroup = mob_miner_calc_digtime(tooldef, nodeat.name)
if (digtime < 0) or
((tooldigtime > 0) and (tooldigtime < digtime)) then
used_tool = toolname
digtime = tooldigtime
wear = toolwear
group = toolgroup
end
end
end
end
if (digtime > 0) then
data.control.digpos = v
data.control.digtime = 0
if (data.control.soundtime < 0) or (data.control.soundtime == nil) then
data.control.soundtime = MINER_DIG_SOUND_INTERVAL
end
data.control.used_tool = used_tool
data.control.diggroup = group
--print("Using " .. used_tool .. " to dig " .. nodeat.name .. " in " .. digtime .. " seconds group is: " .. group)
data.control.timetocomplete = digtime
data.control.add_wear_oncomplete = wear
break
else
local description = core.registered_nodes[nodeat.name].description
if (description ~= nil) then
core.chat_send_player(entity:owner(), data.name .. ": " ..
S("I don't have a tool to dig ") .. S(description))
end
end
end
end
return non_air_node_detected
end
mob_miner.complete_dig = function(entity)
local data = entity:get_persistent_data()
local nodeat = core.get_node(data.control.digpos)
local nodedef = core.registered_nodes[nodeat.name]
local tooldef = core.registered_tools[data.control.used_tool]
if (entity:add_wear(data.control.used_tool,
data.control.add_wear_oncomplete)) then
core.dig_node(data.control.digpos)
local toadd = nodeat.name
if (nodedef.drop ~= nil) then
toadd = nodedef.drop
end
if (not entity:add_item(toadd)) then
core.add_item(data.control.digpos, toadd)
end
else
print("BUG: Minder didn't find the tool we're supposed to digging with")
end
data.control.add_wear_on_complete = nil
data.control.digpos = nil
end
local miner_onstep = function(entity, now, dtime)
local mydata = entity:get_persistent_data()
if (mydata.control.digstate == "digging") then
local non_air_node_found = false
if (mydata.control.digpos == nil) then
non_air_node_found = entity:update_digpos()
else
mydata.control.digtime = mydata.control.digtime + dtime
mydata.control.soundtime = mydata.control.soundtime + dtime
end
if mydata.control.digpos ~= nil and not miner_is_dig_safe(mydata.control.digpos) then
--! TODO send message to owner
core.chat_send_player(entity:owner(), mydata.name .. ": " ..
S("I won't continue to dig here there's something bad behind!"))
mydata.control.digpos = nil
end
--! stop digging if we reached the requested depth
if (mydata.control.digdepth <= 0) then
mydata.control.digstate = "idle"
--print ("Miner: reached requested depth nothing to do setting to idle")
entity:set_state("default")
return
end
--! move ahead if we don't have any node left to dig
if (mydata.control.digpos == nil) and (not non_air_node_found) then
if mydata.control.dig_wait_time == nil then
mydata.control.dig_wait_time = 0
end
mydata.control.dig_wait_time = mydata.control.dig_wait_time + dtime
if mydata.control.dig_wait_time < 1 then
return
end
mydata.control.dig_wait_time = 0
mydata.control.digdepth = mydata.control.digdepth -1
if (entity:stepforward()) then
return
end
end
--! stop digging if there ain't any node left
if (mydata.control.digpos == nil) then
mydata.control.digstate = "idle"
mydata.control.soundtime = -1
--print ("Miner: no diggable node found setting to idle")
entity:set_state("default")
return
end
if mydata.control.digtime == 0 then
local entitypos = vector.round(mydata.control.digpos)
print("Adding entity at: " .. dump(mydata.control.digpos) .. " --> " .. dump(entitypos))
local added = minetest.add_entity(entitypos, "mob_miner:cracksim")
if added ~= nil then
added:get_luaentity().timetotal = (mydata.control.timetocomplete - 0.05)
end
end
--! check if dig is completed
if (mydata.control.digtime ~= nil) and
(mydata.control.timetocomplete ~= nil) and
(mydata.control.digtime > mydata.control.timetocomplete) then
entity:completeDig()
end
if ((mydata.control.soundtime >= MINER_DIG_SOUND_INTERVAL) and (mydata.control.diggroup ~= nil)) then
local soundspec =
{ name="default_dig_" .. mydata.control.diggroup, gain=1.0, max_hear_distance=10 }
sound.play(mydata.control.digpos, soundspec )
mydata.control.soundtime = mydata.control.soundtime - MINER_DIG_SOUND_INTERVAL
end
end
end
local miner_precatch_check = function(entity)
local mydata = entity:get_persistent_data()
for t1 = 1, #mydata.inventory.tools, 1 do
if (mydata.inventory.tools[t1] ~= nil ) then
core.chat_send_player(entity:owner(), mydata.name .. ":" ..
S("I've still got tools!"))
return false
end
end
for t1 = 1, #mydata.inventory.digged, 1 do
if (mydata.inventory.digged[t1] ~= nil ) then
core.chat_send_player(entity:owner(), mydata.name .. ": " ..
S("I've still got some nodes!"))
return false
end
end
return true
end
miner_prototype = {
name="miner",
modname="mob_miner",
factions = {
member = {
"npc",
"hireling"
}
},
generic = {
description= S("Miner"),
base_health=40,
kill_result="",
armor_groups= {
fleshy=20,
},
groups = MINER_GROUPS,
envid="simple_air",
stepheight = 0.51,
custom_on_activate_handler = miner_activate,
custom_on_step_handler = miner_onstep,
on_rightclick_callbacks = {
{
handler = mob_miner.rightclick_control,
name = "miner_control_rightclick",
visiblename = mob_miner.rightclick_control_label
},
{
handler = mob_miner.rightclick_relocate,
name = "miner_relocate_rightclick",
visiblename = mob_miner.rightclick_relocate_label
}
}
},
movement = {
guardspawnpoint = true,
teleportdelay = 30,
min_accel=0.3,
max_accel=0.7,
max_speed=1.5,
min_speed=0.01,
pattern="stop_and_go",
canfly=false,
follow_speedup=10,
max_distance=2,
},
catching = {
tool="animalmaterials:contract",
consumed=true,
can_be_cought = miner_precatch_check,
},
states = {
{
name = "default",
movgen = "none",
typical_state_time = 180,
chance = 1.00,
animation = "stand",
state_mode = "auto",
graphics_3d = {
visual = "mesh",
mesh = "character.b3d",
textures = {"character.png"},
collisionbox = {-0.3,-1.0,-0.3, 0.3,0.8,0.3},
visual_size= {x=1, y=1},
},
},
{
name = "digging",
movgen = "none",
typical_state_time = 180,
chance = 0,
animation = "dig",
state_mode = "user_def",
graphics_3d = {
visual = "mesh",
mesh = "character.b3d",
textures = {"character.png"},
collisionbox = {-0.3,-1.0,-0.3, 0.3,0.8,0.3},
visual_size= {x=1, y=1},
},
},
{
name = "relocate",
movgen = "follow_mov_gen",
typical_state_time = 60,
chance = 0,
animation_walk = "walk",
animation_next_to_target = "stand",
graphics_3d =
{
visual = "mesh",
mesh = "character.b3d",
textures = {"character.png"},
collisionbox = {-0.3,-1.0,-0.3, 0.3,0.8,0.3},
visual_size= {x=1,y=1,z=1},
model_orientation_fix = math.pi/2
},
},
},
animation = {
stand = {
start_frame = 0,
end_frame = 80,
},
walk = {
start_frame = 168,
end_frame = 188,
basevelocity = 18,
},
dig = {
start_frame = 189,
end_frame = 199,
},
digwalk = {
start_frame = 200,
end_frame = 220,
basevelocity = 18
}
},
}
minetest.log("action","\tadding mob " .. miner_prototype.name)
mobf_add_mob(miner_prototype)
minetest.log("action","MOD: mob_miner mod version " .. version .. " loaded")

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,352 +0,0 @@
-------------------------------------------------------------------------------
-- Mob Framework Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allow to pretend you have written it.
--
--! @file ui.lua
--! @brief ui functions for miner mob
--! @copyright Sapier
--! @author Sapier
--! @date 2015-12-20
--
-- Contact sapier a t gmx net
-------------------------------------------------------------------------------
mobf_assert_backtrace(core.global_exists("mob_miner"))
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
-------------------------------------------------------------------------------
-- @function [parent=#mob_miner] show_formspec(playername, entity, data)
--
--! @brief show formspec to some player
--! @memberof mob_miner
--
--! @param playername name of player to show to
--! @param entity showing the formspec
--! @param data entity specific data
-------------------------------------------------------------------------------
mob_miner.show_formspec = function(playername, entity, data)
local storageid = mobf_global_data_store(entity)
local formname = "mobf_miner:" ..storageid
entity.dynamic_data.miner_formspec_data.tools_inventory =
core.create_detached_inventory(data.unique_entity_id,
{
allow_put = function(inv, listname, index, stack, player)
if (listname == "tools") then
if (stack:get_tool_capabilities() == nil ) then
return 0
else
return 1
end
else
return 0
end
end,
})
local inv = entity.dynamic_data.miner_formspec_data.tools_inventory
entity.dynamic_data.miner_formspec_data.tools_inventory:set_size("tools",4)
for i,v in ipairs(data.inventory.tools) do
inv:set_stack("tools", i, ItemStack(v))
end
entity.dynamic_data.miner_formspec_data.tools_inventory:set_size("digged",12)
for i,v in ipairs(data.inventory.digged) do
inv:set_stack("digged", i, ItemStack(v))
end
local digdepth = data.last_digdepth or 1
local miner_formspec = "size[10,8.5;]" ..
"label[1,0;"..S("Miner %s"):format(data.name).."]" ..
"label[0,1;"..S("Tools:").."]"..
"label[6,1;"..S("Tunnel shape:").."]" ..
"label[0,2.5;"..S("Minerinventory:").."]"..
"list[detached:" .. data.unique_entity_id .. ";tools;0,1.5;4,1;]" ..
"list[detached:" .. data.unique_entity_id .. ";digged;0,3;4,3;]" ..
"list[current_player;main;1,7.5;8,1;]" ..
"field[0.25,7;1,0.5;te_digdepth;Dig depth;" .. digdepth .."]" ..
"button_exit[1,6.8;2,0.25;btn_start_digging;" .. S("start digging") .. "]" ..
"button_exit[8,6.8;2,0.25;btn_take_all_items;" .. S("take all items") .. "]" ..
"image[7.1,4.25;1.5,2;mob_miner_miner_item.png]"
for x = 1, MINER_MAX_TUNNEL_SIZE, 1 do
for y = MINER_MAX_TUNNEL_SIZE, 1, -1 do
if ( x == 3 ) and (y == 1) or
( x == 3 ) and (y == 2) then
--! miners size
else
if data.digspec[x][y] then
miner_formspec = miner_formspec ..
"image_button[" .. ((x*0.825)+4.85) .. "," .. (6- (y*0.9)) .. ";1,1;" ..
"blank.png;" ..
"btn_tunnelshape_" .. x .. "x" .. y .. ";;" ..
"false;false;crack_anylength.png]"
else
miner_formspec = miner_formspec ..
"image_button[" .. ((x*0.825)+4.85) .. "," .. (6-(y*0.9)) .. ";1,1;" ..
"default_stone.png;" ..
"btn_tunnelshape_" .. x .. "x" .. y .. ";;" ..
"false;false;crack_anylength.png]"
end
end
end
end
core.show_formspec(playername, formname, miner_formspec)
end
-------------------------------------------------------------------------------
-- @function [parent=#mob_miner] formspec_handler(player, formname, fields)
--
--! @brief handle events triggered by formspec
--! @memberof mob_miner
--
--! @param player player causing the formspec action
--! @param formname name of form causing the event
--! @param fields all fields passed from form
-------------------------------------------------------------------------------
mob_miner.formspec_handler = function(player, formname, fields)
if formname:find("mobf_miner:") == 1 then
local storageid = formname:sub(12)
local entity = mobf_global_data_get(storageid)
if entity ~= nil then
local mydata = entity:get_persistent_data()
local minerinv = entity.dynamic_data.miner_formspec_data.tools_inventory
local toolinv = minerinv:get_list("tools")
mydata.inventory.tools = {}
for i,v in ipairs (toolinv) do
table.insert(mydata.inventory.tools, v:to_table())
end
local inventory = minerinv:get_list("digged")
mydata.inventory.digged = {}
for i,v in ipairs (inventory) do
table.insert(mydata.inventory.digged, v:to_table())
end
if fields["btn_start_digging"] ~= nil and
tonumber(fields["te_digdepth"]) ~= nil then
mydata.control.digstate = "digging"
mydata.control.digtime = 0
mydata.control.digpos = nil
mydata.control.digdepth = tonumber(fields["te_digdepth"]) or 0
mydata.last_digdepth = mydata.control.digdepth
entity:set_state("digging")
end
local update_spec = false
for x = 1, MINER_MAX_TUNNEL_SIZE, 1 do
for y = 1, MINER_MAX_TUNNEL_SIZE, 1 do
if (fields["btn_tunnelshape_" .. x .. "x" .. y]) then
mydata.digspec[x][y] = not mydata.digspec[x][y]
update_spec = true
end
end
end
if fields["btn_take_all_items"] ~= nil then
local playerinventory =
core.get_inventory({type="player", name=player:get_player_name()})
for t1 = 1, #mydata.inventory.tools, 1 do
if mydata.inventory.tools[t1] ~= nil then
local toadd = ItemStack(mydata.inventory.tools[t1])
if (playerinventory:room_for_item( "main", toadd)) then
playerinventory:add_item("main", toadd)
mydata.inventory.tools[t1] = nil
end
end
end
for t1 = 1, #mydata.inventory.digged, 1 do
if (mydata.inventory.digged[t1] ~= nil ) then
local toadd = ItemStack(mydata.inventory.digged[t1])
if (playerinventory:room_for_item( "main", toadd)) then
playerinventory:add_item("main", toadd)
mydata.inventory.digged[t1] = nil
end
end
end
update_spec = false
end
if (update_spec) then
mob_miner.show_formspec(player:get_player_name(), entity, mydata)
end
end
end
end
-------------------------------------------------------------------------------
-- @function [parent=#mob_miner] rightclick_control_label(entity)
--
--! @brief provide label for rightclick contol button
--! @memberof mob_miner
--
--! @param entity entity to show button for
--! @return label for button
-------------------------------------------------------------------------------
mob_miner.rightclick_control_label = function(entity, player)
if not player:is_player() then
return "You aren't even human!"
end
if player:get_player_name() ~= entity.dynamic_data.spawning.spawner then
print("Playername: " .. player:get_player_name() .. " spawned by: " .. entity.dynamic_data.spawning.spawner)
return "Ask my boss!"
end
local mydata = entity:get_persistent_data()
if mydata.control.digstate == "idle" then
local basepos = entity:getbasepos()
local direction = entity:getDirection()
local nodestodig = mob_miner.filter_nodes(
mob_miner.get_pos2dig_list(direction,basepos, mydata.digspec),
{ "air", "default:torch"}
)
if #nodestodig ~= 0 then
return S("give orders")
else
mydata.control.digstate = "idle_nothing_to_dig"
return S("move ahead")
end
elseif (mydata.control.digstate == "idle_nothing_to_dig") then
return S("move ahead")
elseif (mydata.control.digstate == "follow") then
return S("following you")
else
return S("stop digging") .. " (" .. mydata.control.digdepth .. ")"
end
end
-------------------------------------------------------------------------------
-- @function [parent=#mob_miner] rightclick_relocate_label(entity)
--
--! @brief provide label for rightclick relocate button
--! @memberof mob_miner
--
--! @param entity entity to show button for
--! @return label for button
-------------------------------------------------------------------------------
mob_miner.rightclick_relocate_label = function(entity, player)
if not player:is_player() then
return "You aren't even human!"
end
if player:get_player_name() ~= entity.dynamic_data.spawning.spawner then
print("Playername: " .. player:get_player_name() .. " spawned by: " .. entity.dynamic_data.spawning.spawner)
return "Ask my boss!"
end
local mydata = entity:get_persistent_data()
if mydata.control.digstate == "follow" then
return S("stay here")
else
return S("follow me")
end
end
-------------------------------------------------------------------------------
-- @function [parent=#mob_miner] rightclick_control(entity, player)
--
--! @brief handle rightclick of control button
--! @memberof mob_miner
--
--! @param entity being rightclicked
--! @param player player clicking entity
-------------------------------------------------------------------------------
mob_miner.rightclick_control = function(entity, player)
if not player:is_player() then
return
end
if player:get_player_name() ~= entity.dynamic_data.spawning.spawner then
print("Playername: " .. player:get_player_name() .. " spawned by: " .. entity.dynamic_data.spawning.spawner)
return
end
local mydata = entity:get_persistent_data()
if mydata.control.digstate == "idle" then
mob_miner.show_formspec(player:get_player_name(), entity, mydata )
elseif mydata.control.digstate == "idle_nothing_to_dig" then
entity:stepforward()
mydata.control.digstate = "idle"
elseif mydata.control.digstate == "digging" then
mydata.control.digstate = "idle"
entity:set_state("default")
end
end
-------------------------------------------------------------------------------
-- @function [parent=#mob_miner] rightclick_relocate(entity, player)
--
--! @brief handle rightclick of relocate button
--! @memberof mob_miner
--
--! @param entity being rightclicked
--! @param player player clicking entity
-------------------------------------------------------------------------------
mob_miner.rightclick_relocate = function(entity, player)
if not player:is_player() then
return
end
if player:get_player_name() ~= entity.dynamic_data.spawning.spawner then
print("Playername: " .. player:get_player_name() .. " spawned by: " .. entity.dynamic_data.spawning.spawner)
return
end
local mydata = entity:get_persistent_data()
if mydata.control.digstate == "idle" or
mydata.control.digstate == "idle_nothing_to_dig" then
mydata.control.digstate = "follow"
if not entity:set_state("relocate") then
print ("Miner: relocate state not specified")
end
entity.dynamic_data.movement.target =
core.get_player_by_name(entity.dynamic_data.spawning.spawner)
elseif mydata.control.digstate == "follow" then
entity:set_state("default")
mydata.control.digstate = "idle"
end
end
minetest.register_on_player_receive_fields(mob_miner.formspec_handler)

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