Update Farming, Mobs, 3d_armor
Farming : minors fixe, add the straw block Mobs : better api, swimming parameter for mobs, add eggs, code optimisation 3d_armor : change the model, many new textures, new shield, and new enchanted shield (which gain compared to normal shield +1 armor and x2 durability)
73
mods/mobs/README.txt
Normal file → Executable file
@ -1,35 +1,40 @@
|
||||
-= MOBS-MOD for MINETEST =-
|
||||
by PilzAdam, KrupnovPavel, Zeg9 and TenPlus1
|
||||
|
||||
This mod contains the following additions:
|
||||
|
||||
- Giant Spiders (found in desert caves, drop string when killed)
|
||||
- Bee's (found around flowers, drop honey when killed, right-click to pick up, also Beehives)
|
||||
- Chicken (lays eggs, added fried egg, raw & cooked chicken, right-click to pick up)
|
||||
- Cow (right-click with empty bucket to get bucket of milk, feed 8 wheat to replenish milk)
|
||||
- Sheep (right-click for wool, feed 8 wheat to replenish wool)
|
||||
- Warthog (the local pig that gives raw and cooked port)
|
||||
- Rats (right-click to pick up and place, cook for a tasty treat)
|
||||
- Sand, Dirt, Stone, Tree Monsters, Oerkki and Dungeon Masters as standard
|
||||
- Lava Flan, Mese Monsters added to spice things up a bit
|
||||
- Cook milk in furnace to get cheese wedge, 9 wedges make 1 cheese block
|
||||
|
||||
..with the following new features:
|
||||
|
||||
- Hitting a mob has knock-back effect like in minecraft, and with blood effect
|
||||
- Mobs float in water, so monsters can still chase you
|
||||
- Mobs can die from falling from a height
|
||||
- Mobs have better health and drops
|
||||
- Hitting a mob also puts them into fight mode (apart from animals)
|
||||
- Compatible with Ethereal mod, mobs now spawn on ethereal worlds
|
||||
|
||||
Changelog:
|
||||
|
||||
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
|
||||
-= MOBS-MOD for MINETEST =-
|
||||
by PilzAdam, KrupnovPavel, Zeg9 and TenPlus1
|
||||
|
||||
|
||||
https://forum.minetest.net/viewtopic.php?f=9&t=9917
|
||||
|
||||
This mod contains the following additions:
|
||||
|
||||
- Giant Spiders (found in desert caves, drop string when killed)
|
||||
- Bee's (found around flowers, drop honey when killed, right-click to pick up, also Beehives)
|
||||
- Chicken (lays eggs, added fried egg, raw & cooked chicken, right-click to pick up)
|
||||
- Cow (right-click with empty bucket to get bucket of milk, feed 8 wheat to replenish milk)
|
||||
- Sheep (right-click for wool, feed 8 wheat to replenish wool)
|
||||
- Warthog (the local pig that gives raw and cooked port)
|
||||
- Rats (right-click to pick up and place, cook for a tasty treat)
|
||||
- Sand, Dirt, Stone, Tree Monsters, Oerkki and Dungeon Masters as standard
|
||||
- Lava Flan, Mese Monsters added to spice things up a bit
|
||||
- Cook milk in furnace to get cheese wedge, 9 wedges make 1 cheese block
|
||||
|
||||
..with the following new features:
|
||||
|
||||
- Hitting a mob has knock-back effect like in minecraft, and with blood effect
|
||||
- Mobs float in water, so monsters can still chase you
|
||||
- Mobs can die from falling from a height
|
||||
- Mobs have better health and drops
|
||||
- Hitting a mob also puts them into fight mode (apart from animals)
|
||||
- Compatible with Ethereal mod, mobs now spawn on ethereal worlds
|
||||
|
||||
Changelog:
|
||||
|
||||
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
|
366
mods/mobs/api.lua
Normal file → Executable file
@ -1,6 +1,16 @@
|
||||
mobs = {}
|
||||
|
||||
-- Set global for other mod checks (e.g. Better HUD uses this)
|
||||
mobs.mod = "redo"
|
||||
mobs.protected = 0 -- Set to 1 if you do not wish mobs to spawn in protected areas (default: 0)
|
||||
|
||||
-- Do mobs spawn in protected areas (0=no, 1=yes)
|
||||
mobs.protected = 0
|
||||
|
||||
-- Initial check to see if damage is enabled
|
||||
local damage_enabled = minetest.setting_getbool("enable_damage")
|
||||
|
||||
-- Check to see if in peaceful mode
|
||||
local peaceful_only = minetest.setting_getbool("only_peaceful_mobs")
|
||||
|
||||
function mobs:register_mob(name, def)
|
||||
minetest.register_entity(name, {
|
||||
@ -45,11 +55,11 @@ function mobs:register_mob(name, def)
|
||||
recovery_time = def.recovery_time or 0.5,
|
||||
knock_back = def.knock_back or 1, --knock_back = def.knock_back or 3,
|
||||
blood_offset = def.blood_offset or 0,
|
||||
blood_amount = def.blood_amount or 5, -- 15
|
||||
blood_amount = def.blood_amount or 5,
|
||||
blood_texture = def.blood_texture or "mobs_blood.png",
|
||||
rewards = def.rewards or nil,
|
||||
animaltype = def.animaltype,
|
||||
shoot_offset = def.shoot_offset or 0,
|
||||
floats = def.floats or 1, -- floats in water by default
|
||||
|
||||
stimer = 0,
|
||||
timer = 0,
|
||||
@ -62,14 +72,12 @@ function mobs:register_mob(name, def)
|
||||
tamed = false,
|
||||
last_state = nil,
|
||||
pause_timer = 0,
|
||||
|
||||
|
||||
do_attack = function(self, player, dist)
|
||||
if self.state ~= "attack" then
|
||||
-- if self.sounds.war_cry then
|
||||
-- if math.random(0,100) < 90 then
|
||||
-- if math.random(0,100) < 90 and self.sounds.war_cry then
|
||||
-- minetest.sound_play(self.sounds.war_cry,{ object = self.object })
|
||||
-- end
|
||||
-- end
|
||||
self.state = "attack"
|
||||
self.attack.player = player
|
||||
self.attack.dist = dist
|
||||
@ -123,59 +131,45 @@ function mobs:register_mob(name, def)
|
||||
self.animation.current = ""
|
||||
end
|
||||
if type == "stand" and self.animation.current ~= "stand" then
|
||||
if
|
||||
self.animation.stand_start
|
||||
and self.animation.stand_end
|
||||
and self.animation.speed_normal
|
||||
then
|
||||
self.object:set_animation(
|
||||
{x=self.animation.stand_start,y=self.animation.stand_end},
|
||||
self.animation.speed_normal, 0
|
||||
)
|
||||
if self.animation.stand_start
|
||||
and self.animation.stand_end
|
||||
and self.animation.speed_normal then
|
||||
self.object:set_animation({x=self.animation.stand_start,
|
||||
y=self.animation.stand_end},self.animation.speed_normal, 0)
|
||||
self.animation.current = "stand"
|
||||
end
|
||||
elseif type == "walk" and self.animation.current ~= "walk" then
|
||||
if
|
||||
self.animation.walk_start
|
||||
and self.animation.walk_end
|
||||
and self.animation.speed_normal
|
||||
then
|
||||
self.object:set_animation(
|
||||
{x=self.animation.walk_start,y=self.animation.walk_end},
|
||||
self.animation.speed_normal, 0
|
||||
)
|
||||
if self.animation.walk_start
|
||||
and self.animation.walk_end
|
||||
and self.animation.speed_normal then
|
||||
self.object:set_animation({x=self.animation.walk_start,y=self.animation.walk_end},
|
||||
self.animation.speed_normal, 0)
|
||||
self.animation.current = "walk"
|
||||
end
|
||||
elseif type == "run" and self.animation.current ~= "run" then
|
||||
if
|
||||
self.animation.run_start
|
||||
and self.animation.run_end
|
||||
and self.animation.speed_run
|
||||
then
|
||||
self.object:set_animation(
|
||||
{x=self.animation.run_start,y=self.animation.run_end},
|
||||
self.animation.speed_run, 0
|
||||
)
|
||||
if self.animation.run_start
|
||||
and self.animation.run_end
|
||||
and self.animation.speed_run then
|
||||
self.object:set_animation({x=self.animation.run_start,y=self.animation.run_end},
|
||||
self.animation.speed_run, 0)
|
||||
self.animation.current = "run"
|
||||
end
|
||||
elseif type == "punch" and self.animation.current ~= "punch" then
|
||||
if
|
||||
self.animation.punch_start
|
||||
and self.animation.punch_end
|
||||
and self.animation.speed_normal
|
||||
then
|
||||
self.object:set_animation(
|
||||
{x=self.animation.punch_start,y=self.animation.punch_end},
|
||||
self.animation.speed_normal, 0
|
||||
)
|
||||
if self.animation.punch_start
|
||||
and self.animation.punch_end
|
||||
and self.animation.speed_normal then
|
||||
self.object:set_animation({x=self.animation.punch_start,y=self.animation.punch_end},
|
||||
self.animation.speed_normal, 0)
|
||||
self.animation.current = "punch"
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
local yaw = 0
|
||||
if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then
|
||||
|
||||
local yaw = 0
|
||||
|
||||
if self.type == "monster" and peaceful_only then
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
@ -185,6 +179,7 @@ local yaw = 0
|
||||
for _,obj in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 10)) do
|
||||
if obj:is_player() then
|
||||
player_count = player_count+1
|
||||
break -- only really need 1 player to be found
|
||||
end
|
||||
end
|
||||
if player_count == 0 and self.state ~= "attack" then
|
||||
@ -195,37 +190,23 @@ local yaw = 0
|
||||
end
|
||||
|
||||
-- drop egg
|
||||
if self.animaltype == "clucky" then
|
||||
if name == "mobs:chicken" then
|
||||
if math.random(1, 3000) <= 1
|
||||
and minetest.get_node(self.object:getpos()).name == "air"
|
||||
and self.state == "stand" then
|
||||
minetest.set_node(self.object:getpos(), {name="mobs:egg"})
|
||||
end
|
||||
end
|
||||
|
||||
if self.object:getvelocity().y > 0.1 then
|
||||
local yaw = self.object:getyaw()
|
||||
if self.drawtype == "side" then
|
||||
yaw = yaw+(math.pi/2)
|
||||
end
|
||||
local x = math.sin(yaw) * -2
|
||||
local z = math.cos(yaw) * 2
|
||||
-- self.object:setacceleration({x=x, y=-10, z=z})
|
||||
-- else
|
||||
-- self.object:setacceleration({x=0, y=-10, z=0})
|
||||
-- end
|
||||
-- Mobs float in water now, to revert uncomment previous 4 lines and remove following block of 12
|
||||
if minetest.get_item_group(minetest.get_node(self.object:getpos()).name, "water") ~= 0 then
|
||||
self.object:setacceleration({x = x, y = 1.5, z = z})
|
||||
else
|
||||
self.object:setacceleration({x = x, y = -10, z = z}) -- 14.5
|
||||
end
|
||||
else
|
||||
|
||||
-- gravity, falling or floating in water
|
||||
if self.floats == 1 then
|
||||
if minetest.get_item_group(minetest.get_node(self.object:getpos()).name, "water") ~= 0 then
|
||||
self.object:setacceleration({x = 0, y = 1.5, z = 0})
|
||||
else
|
||||
self.object:setacceleration({x = 0, y = -10, z = 0}) -- 14.5
|
||||
end
|
||||
else
|
||||
self.object:setacceleration({x=0, y=-10, z=0})
|
||||
end
|
||||
|
||||
-- fall damage
|
||||
@ -255,7 +236,7 @@ local yaw = 0
|
||||
return
|
||||
end
|
||||
|
||||
self.timer = self.timer+dtime
|
||||
self.timer = self.timer + dtime
|
||||
if self.state ~= "attack" then
|
||||
if self.timer < 1 then
|
||||
return
|
||||
@ -268,39 +249,33 @@ local yaw = 0
|
||||
end
|
||||
|
||||
local do_env_damage = function(self)
|
||||
|
||||
local pos = self.object:getpos()
|
||||
local n = minetest.get_node(pos)
|
||||
local lit = minetest.get_node_light(pos) or 0
|
||||
local tod = minetest.get_timeofday()
|
||||
|
||||
if self.light_damage and self.light_damage ~= 0
|
||||
and pos.y>0
|
||||
and minetest.get_node_light(pos)
|
||||
and minetest.get_node_light(pos) > 4
|
||||
and minetest.get_timeofday() > 0.2
|
||||
and minetest.get_timeofday() < 0.8
|
||||
then
|
||||
self.object:set_hp(self.object:get_hp()-self.light_damage)
|
||||
if self.object:get_hp() < 1 then
|
||||
self.object:remove()
|
||||
end
|
||||
and pos.y > 0
|
||||
and lit > 4
|
||||
and tod > 0.2 and tod < 0.8 then
|
||||
self.object:set_hp(self.object:get_hp()-self.light_damage) ; --print ("light damage")
|
||||
end
|
||||
|
||||
if self.water_damage and self.water_damage ~= 0 and
|
||||
minetest.get_item_group(n.name, "water") ~= 0
|
||||
then
|
||||
self.object:set_hp(self.object:get_hp()-self.water_damage)
|
||||
if self.object:get_hp() < 1 then
|
||||
self.object:remove()
|
||||
end
|
||||
if self.water_damage and self.water_damage ~= 0
|
||||
and minetest.get_item_group(n.name, "water") ~= 0 then
|
||||
self.object:set_hp(self.object:get_hp()-self.water_damage) ; --print ("water damage")
|
||||
end
|
||||
|
||||
if self.lava_damage and self.lava_damage ~= 0 and
|
||||
minetest.get_item_group(n.name, "lava") ~= 0
|
||||
then
|
||||
self.object:set_hp(self.object:get_hp()-self.lava_damage)
|
||||
if self.object:get_hp() < 1 then
|
||||
self.object:remove()
|
||||
end
|
||||
if self.lava_damage and self.lava_damage ~= 0
|
||||
and minetest.get_item_group(n.name, "lava") ~= 0 then
|
||||
self.object:set_hp(self.object:get_hp()-self.lava_damage) ; --print ("lava damage")
|
||||
end
|
||||
|
||||
if self.object:get_hp() < 1 then
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
self.env_damage_timer = self.env_damage_timer + dtime
|
||||
@ -312,12 +287,15 @@ local yaw = 0
|
||||
end
|
||||
|
||||
-- FIND SOMEONE TO ATTACK
|
||||
if ( self.type == "monster" or self.type == "barbarian" ) and minetest.setting_getbool("enable_damage") and self.state ~= "attack" then
|
||||
if ( self.type == "monster" or self.type == "barbarian" ) and damage_enabled and self.state ~= "attack" then
|
||||
|
||||
local s = self.object:getpos()
|
||||
local inradius = minetest.get_objects_inside_radius(s,self.view_range)
|
||||
local player = nil
|
||||
local type = nil
|
||||
|
||||
for _,oir in ipairs(inradius) do
|
||||
|
||||
if oir:is_player() then
|
||||
player = oir
|
||||
type = "player"
|
||||
@ -377,6 +355,7 @@ local yaw = 0
|
||||
end
|
||||
|
||||
if self.following and self.following:is_player() then
|
||||
|
||||
if self.following:get_wielded_item():get_name() ~= self.follow then
|
||||
self.following = nil
|
||||
else
|
||||
@ -425,6 +404,7 @@ local yaw = 0
|
||||
-- if there is a player nearby look at them
|
||||
local lp = nil
|
||||
local s = self.object:getpos()
|
||||
|
||||
if self.type == "npc" then
|
||||
local o = minetest.get_objects_inside_radius(self.object:getpos(), 3)
|
||||
|
||||
@ -436,6 +416,7 @@ local yaw = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if lp ~= nil then
|
||||
local vec = {x=lp.x-s.x, y=lp.y-s.y, z=lp.z-s.z}
|
||||
yaw = math.atan(vec.z/vec.x)+math.pi/2
|
||||
@ -450,14 +431,18 @@ local yaw = 0
|
||||
end
|
||||
self.object:setyaw(yaw)
|
||||
end
|
||||
|
||||
self.set_velocity(self, 0)
|
||||
self.set_animation(self, "stand")
|
||||
|
||||
if math.random(1, 100) <= self.walk_chance then
|
||||
self.set_velocity(self, self.walk_velocity)
|
||||
self.state = "walk"
|
||||
self.set_animation(self, "walk")
|
||||
end
|
||||
|
||||
elseif self.state == "walk" then
|
||||
|
||||
if math.random(1, 100) <= 30 then
|
||||
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/180*math.pi))
|
||||
end
|
||||
@ -473,7 +458,9 @@ local yaw = 0
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
end
|
||||
|
||||
elseif self.state == "attack" and self.attack_type == "dogfight" then
|
||||
|
||||
if not self.attack.player or not self.attack.player:getpos() then
|
||||
print("stop attacking")
|
||||
self.state = "stand"
|
||||
@ -541,7 +528,9 @@ local yaw = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
elseif self.state == "attack" and self.attack_type == "shoot" then
|
||||
|
||||
if not self.attack.player or not self.attack.player:is_player() then
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
@ -590,7 +579,7 @@ local yaw = 0
|
||||
local obj = minetest.add_entity(p, self.arrow)
|
||||
local amount = (vec.x^2+vec.y^2+vec.z^2)^0.5
|
||||
local v = obj:get_luaentity().velocity
|
||||
vec.y = vec.y + self.shoot_offset -- was +1, this way shoot aim is accurate
|
||||
vec.y = vec.y + self.shoot_offset -- this makes shoot aim accurate
|
||||
vec.x = vec.x*v/amount
|
||||
vec.y = vec.y*v/amount
|
||||
vec.z = vec.z*v/amount
|
||||
@ -600,18 +589,15 @@ local yaw = 0
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
-- reset HP
|
||||
local pos = self.object:getpos()
|
||||
local distance_rating = ( ( get_distance({x=0,y=0,z=0},pos) ) / 20000 )
|
||||
local newHP = self.hp_min + math.floor( self.hp_max * distance_rating )
|
||||
self.object:set_hp( newHP )
|
||||
|
||||
-- reset HP
|
||||
self.object:set_hp( math.random(self.hp_min, self.hp_max) )
|
||||
self.object:set_armor_groups({fleshy=self.armor})
|
||||
self.object:setacceleration({x=0, y=-10, z=0})
|
||||
self.state = "stand"
|
||||
self.object:setvelocity({x=0, y=self.object:getvelocity().y, z=0})
|
||||
self.object:setyaw(math.random(1, 360)/180*math.pi)
|
||||
if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then
|
||||
if self.type == "monster" and peaceful_only then
|
||||
self.object:remove()
|
||||
end
|
||||
if self.type ~= "npc" then
|
||||
@ -619,26 +605,32 @@ local yaw = 0
|
||||
end
|
||||
if staticdata then
|
||||
local tmp = minetest.deserialize(staticdata)
|
||||
if tmp and tmp.lifetimer then
|
||||
self.lifetimer = tmp.lifetimer - dtime_s
|
||||
if tmp then
|
||||
if tmp.lifetimer then
|
||||
self.lifetimer = tmp.lifetimer - dtime_s
|
||||
end
|
||||
if tmp.tamed then
|
||||
self.tamed = tmp.tamed
|
||||
end
|
||||
if tmp.gotten then -- using this variable for obtaining something from mob (milk/wool)
|
||||
self.gotten = tmp.gotten
|
||||
end
|
||||
end
|
||||
if tmp and tmp.tamed then
|
||||
self.tamed = tmp.tamed
|
||||
end
|
||||
--[[if tmp and tmp.textures then
|
||||
self.object:set_properties(tmp.textures)
|
||||
end]]
|
||||
end
|
||||
if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
-- Internal check to see if player damage is still enabled
|
||||
damage_enabled = minetest.setting_getbool("enable_damage")
|
||||
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
local tmp = {
|
||||
lifetimer = self.lifetimer,
|
||||
tamed = self.tamed,
|
||||
--textures = { textures = self.textures },
|
||||
gotten = self.gotten,
|
||||
textures = def.available_textures["texture_"..math.random(1,def.available_textures["total"])],
|
||||
}
|
||||
self.object:set_properties(tmp)
|
||||
@ -655,62 +647,20 @@ local yaw = 0
|
||||
for _,drop in ipairs(self.drops) do
|
||||
if math.random(1, drop.chance) == 1 then
|
||||
local d = ItemStack(drop.name.." "..math.random(drop.min, drop.max))
|
||||
-- default.drop_item(pos,d)
|
||||
local pos2 = pos
|
||||
pos2.y = pos2.y + 0.5 -- drop items half block higher
|
||||
minetest.add_item(pos2,d)
|
||||
|
||||
local obj = minetest.add_item(pos2, d)
|
||||
if obj then
|
||||
obj:setvelocity({x=math.random(-1,1), y=5, z=math.random(-1,1)})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- if self.sounds.death ~= nil then
|
||||
-- minetest.sound_play(self.sounds.death,{
|
||||
-- object = self.object,
|
||||
-- })
|
||||
-- end
|
||||
-- if minetest.get_modpath("skills") and minetest.get_modpath("experience") then
|
||||
-- -- DROP experience
|
||||
-- local distance_rating = ( ( get_distance({x=0,y=0,z=0},pos) ) / ( skills.get_player_level(hitter:get_player_name()).level * 1000 ) )
|
||||
-- local emax = math.floor( self.exp_min + ( distance_rating * self.exp_max ) )
|
||||
-- local expGained = math.random(self.exp_min, emax)
|
||||
-- skills.add_exp(hitter:get_player_name(),expGained)
|
||||
-- local expStack = experience.exp_to_items(expGained)
|
||||
-- for _,stack in ipairs(expStack) do
|
||||
-- default.drop_item(pos,stack)
|
||||
-- end
|
||||
-- minetest.sound_play(self.sounds.death,{object = self.object,})
|
||||
-- end
|
||||
|
||||
-- -- see if there are any NPCs to shower you with rewards
|
||||
-- if self.type ~= "npc" then
|
||||
-- local inradius = minetest.get_objects_inside_radius(hitter:getpos(),10)
|
||||
-- for _, oir in pairs(inradius) do
|
||||
-- local obj = oir:get_luaentity()
|
||||
-- if obj then
|
||||
-- if obj.type == "npc" and obj.rewards ~= nil then
|
||||
-- local yaw = nil
|
||||
-- local lp = hitter:getpos()
|
||||
-- local s = obj.object:getpos()
|
||||
-- local vec = {x=lp.x-s.x, y=1, z=lp.z-s.z}
|
||||
-- yaw = math.atan(vec.z/vec.x)+math.pi/2
|
||||
-- if self.drawtype == "side" then
|
||||
-- yaw = yaw+(math.pi/2)
|
||||
-- end
|
||||
-- if lp.x > s.x then
|
||||
-- yaw = yaw+math.pi
|
||||
-- end
|
||||
-- obj.object:setyaw(yaw)
|
||||
-- local x = math.sin(yaw) * -2
|
||||
-- local z = math.cos(yaw) * 2
|
||||
-- acc = {x=x, y=-5, z=z}
|
||||
-- for _, r in pairs(obj.rewards) do
|
||||
-- if math.random(0,100) < r.chance then
|
||||
-- default.drop_item(obj.object:getpos(),r.item, vec, acc)
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@ -780,7 +730,7 @@ local yaw = 0
|
||||
end
|
||||
|
||||
mobs.spawning_mobs = {}
|
||||
function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, min_dist, max_dist, spawn_func)
|
||||
function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height)
|
||||
mobs.spawning_mobs[name] = true
|
||||
minetest.register_abm({
|
||||
nodenames = nodes,
|
||||
@ -788,67 +738,46 @@ function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_o
|
||||
interval = 30,
|
||||
chance = chance,
|
||||
action = function(pos, node, _, active_object_count_wider)
|
||||
if active_object_count_wider > active_object_count then
|
||||
return
|
||||
end
|
||||
if not mobs.spawning_mobs[name] then
|
||||
|
||||
-- do not spawn if too many in one active area
|
||||
if active_object_count_wider > active_object_count
|
||||
or not mobs.spawning_mobs[name] then
|
||||
return
|
||||
end
|
||||
|
||||
-- Check if protected area using bogus name so mobs will not spawn
|
||||
if mobs.protected == 1 and minetest.is_protected(pos, "-") then
|
||||
-- spawn above node
|
||||
pos.y = pos.y + 1
|
||||
|
||||
-- Check if protected area, if so mobs will not spawn
|
||||
if mobs.protected == 1 and minetest.is_protected(pos, "") then
|
||||
return
|
||||
end
|
||||
|
||||
pos.y = pos.y+1
|
||||
if not minetest.get_node_light(pos) then
|
||||
return
|
||||
end
|
||||
if minetest.get_node_light(pos) > max_light then
|
||||
return
|
||||
end
|
||||
if minetest.get_node_light(pos) < min_light then
|
||||
return
|
||||
end
|
||||
if pos.y > max_height then
|
||||
-- check if light and height levels are ok to spawn
|
||||
if not minetest.get_node_light(pos)
|
||||
or minetest.get_node_light(pos) > max_light
|
||||
or minetest.get_node_light(pos) < min_light
|
||||
or pos.y > max_height then
|
||||
return
|
||||
end
|
||||
|
||||
if not minetest.registered_nodes[minetest.get_node(pos).name] then return end
|
||||
-- are we spawning inside a node?
|
||||
if minetest.registered_nodes[minetest.get_node(pos).name].walkable then return end
|
||||
|
||||
pos.y = pos.y+1
|
||||
|
||||
if not minetest.registered_nodes[minetest.get_node(pos).name] then return end
|
||||
pos.y = pos.y + 1
|
||||
if minetest.registered_nodes[minetest.get_node(pos).name].walkable then return end
|
||||
|
||||
if min_dist == nil then
|
||||
min_dist = {x=-1,z=-1}
|
||||
end
|
||||
if max_dist == nil then
|
||||
max_dist = {x=33000,z=33000}
|
||||
end
|
||||
|
||||
if math.abs(pos.x) < min_dist.x or math.abs(pos.z) < min_dist.z
|
||||
or math.abs(pos.x) > max_dist.x or math.abs(pos.z) > max_dist.z then
|
||||
return
|
||||
end
|
||||
|
||||
if spawn_func and not spawn_func(pos, node) then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y - 1
|
||||
|
||||
if minetest.setting_getbool("display_mob_spawn") then
|
||||
minetest.chat_send_all("[mobs] Add "..name.." at "..minetest.pos_to_string(pos))
|
||||
end
|
||||
|
||||
-- spawn mob
|
||||
local mob = minetest.add_entity(pos, name)
|
||||
|
||||
-- setup the hp, armor, drops, etc... for this specific mob
|
||||
local distance_rating = ( ( get_distance({x=0,y=0,z=0},pos) ) / 15000 )
|
||||
-- set mob health (randomly between min and max)
|
||||
if mob then
|
||||
mob = mob:get_luaentity()
|
||||
local newHP = mob.hp_min + math.floor( mob.hp_max * distance_rating )
|
||||
mob.object:set_hp( newHP )
|
||||
mob.object:set_hp( math.random(mob.hp_min, mob.hp_max) )
|
||||
end
|
||||
end
|
||||
})
|
||||
@ -867,14 +796,13 @@ function mobs:register_arrow(name, def)
|
||||
|
||||
on_step = function(self, dtime)
|
||||
local pos = self.object:getpos()
|
||||
--if minetest.get_node(self.object:getpos()).name ~= "air" then
|
||||
local node = minetest.get_node(self.object:getpos()).name
|
||||
if minetest.registered_nodes[node].walkable then
|
||||
self.hit_node(self, pos, node)
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
-- pos.y = pos.y-1.0
|
||||
|
||||
for _,player in pairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||
if player:is_player() then
|
||||
self.hit_player(self, player)
|
||||
@ -886,14 +814,6 @@ function mobs:register_arrow(name, def)
|
||||
})
|
||||
end
|
||||
|
||||
function get_distance(pos1,pos2)
|
||||
if ( pos1 ~= nil and pos2 ~= nil ) then
|
||||
return math.abs(math.floor(math.sqrt( (pos1.x - pos2.x)^2 + (pos1.z - pos2.z)^2 )))
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
function process_weapon(player, time_from_last_punch, tool_capabilities)
|
||||
local weapon = player:get_wielded_item()
|
||||
if tool_capabilities ~= nil then
|
||||
@ -904,13 +824,29 @@ local weapon = player:get_wielded_item()
|
||||
|
||||
-- if weapon:get_definition().sounds ~= nil then
|
||||
-- local s = math.random(0,#weapon:get_definition().sounds)
|
||||
-- minetest.sound_play(weapon:get_definition().sounds[s], {
|
||||
-- object=player,
|
||||
-- })
|
||||
-- minetest.sound_play(weapon:get_definition().sounds[s], {object=player,})
|
||||
-- else
|
||||
-- minetest.sound_play("default_sword_wood", {
|
||||
-- object = player,
|
||||
-- })
|
||||
-- end
|
||||
-- minetest.sound_play("default_sword_wood", {object = player,})
|
||||
-- end
|
||||
end
|
||||
|
||||
-- Spawn Egg
|
||||
function mobs:register_egg(mob, desc, background, addegg)
|
||||
local invimg = background
|
||||
if addegg == 1 then
|
||||
invimg = invimg.."^mobs_chicken_egg.png"
|
||||
end
|
||||
minetest.register_craftitem(mob, {
|
||||
description = desc,
|
||||
inventory_image = invimg,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
if pointed_thing.above and not minetest.is_protected(pos, placer:get_player_name()) then
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.env:add_entity(pos, mob)
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
14
mods/mobs/bee.lua
Normal file → Executable file
@ -48,19 +48,7 @@ step = 1,
|
||||
passive = true,
|
||||
})
|
||||
mobs:register_spawn("mobs:bee", {"default:dirt_with_grass"}, 20, 4, 7500, 1, 31000)
|
||||
|
||||
minetest.register_craftitem("mobs:bee", {
|
||||
description = "bee",
|
||||
inventory_image = "mobs_bee_inv.png",
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.above then
|
||||
minetest.env:add_entity(pointed_thing.above, "mobs:bee")
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
mobs:register_egg("mobs:bee", "Bee", "mobs_bee_inv.png", 0)
|
||||
|
||||
-- Honey
|
||||
|
||||
|
16
mods/mobs/chicken.lua
Normal file → Executable file
@ -57,21 +57,7 @@ mobs:register_mob("mobs:chicken", {
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs:chicken", {"default:dirt_with_grass"}, 20, 0, 9000, 1, 31000)
|
||||
|
||||
-- Chicken (right-click chicken to place in inventory)
|
||||
|
||||
minetest.register_craftitem("mobs:chicken", {
|
||||
description = "Chicken",
|
||||
inventory_image = "mobs_chicken_inv.png",
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.above then
|
||||
minetest.env:add_entity(pointed_thing.above, "mobs:chicken")
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
mobs:register_egg("mobs:chicken", "Chicken", "mobs_chicken_inv.png", 0)
|
||||
|
||||
-- Egg (can be fried in furnace)
|
||||
|
||||
|
32
mods/mobs/cow.lua
Normal file → Executable file
@ -38,27 +38,23 @@ mobs:register_mob("mobs:cow", {
|
||||
on_rightclick = function(self, clicker)
|
||||
local tool = clicker:get_wielded_item()
|
||||
if tool:get_name() == "bucket:bucket_empty" then
|
||||
if self.milked then
|
||||
do return end
|
||||
end
|
||||
if self.gotten then return end
|
||||
clicker:get_inventory():remove_item("main", "bucket:bucket_empty")
|
||||
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
|
||||
self.milked = true
|
||||
self.gotten = true -- milked
|
||||
end
|
||||
|
||||
if tool:get_name() == "farming:wheat" then
|
||||
if self.milked then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
tool:take_item(1)
|
||||
clicker:set_wielded_item(tool)
|
||||
end
|
||||
self.food = (self.food or 0) + 1
|
||||
if self.food >= 8 then
|
||||
self.food = 0
|
||||
self.milked = false
|
||||
self.tamed = true
|
||||
minetest.sound_play("mobs_cow", {object = self.object,gain = 1.0,max_hear_distance = 32,loop = false,})
|
||||
end
|
||||
if tool:get_name() == "farming:wheat" and self.gotten then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
tool:take_item(1)
|
||||
clicker:set_wielded_item(tool)
|
||||
end
|
||||
self.food = (self.food or 0) + 1
|
||||
if self.food >= 8 then
|
||||
self.food = 0
|
||||
self.gotten = false -- ready to be milked again
|
||||
self.tamed = true
|
||||
minetest.sound_play("mobs_cow", {object = self.object,gain = 1.0,max_hear_distance = 32,loop = false,})
|
||||
end
|
||||
return tool
|
||||
end
|
||||
@ -77,12 +73,14 @@ mobs:register_mob("mobs:cow", {
|
||||
punch_start = 70,
|
||||
punch_end = 100,
|
||||
},
|
||||
|
||||
jump = true,
|
||||
step = 1,
|
||||
blood_texture = "mobs_blood.png",
|
||||
passive = true,
|
||||
})
|
||||
mobs:register_spawn("mobs:cow", {"default:dirt_with_grass"}, 20, 0, 9000, 1, 31000)
|
||||
mobs:register_egg("mobs:cow", "Cow", "default_grass.png", 1)
|
||||
|
||||
-- Bucket of Milk
|
||||
|
||||
|
0
mods/mobs/depends.txt
Normal file → Executable file
3
mods/mobs/dirtmonster.lua
Normal file → Executable file
@ -55,4 +55,5 @@ mobs:register_mob("mobs:dirt_monster", {
|
||||
step = 1,
|
||||
blood_texture = "default_dirt.png",
|
||||
})
|
||||
mobs:register_spawn("mobs:dirt_monster", {"default:dirt_with_grass"}, 3, -1, 8500, 1, 31000)
|
||||
mobs:register_spawn("mobs:dirt_monster", {"default:dirt_with_grass"}, 3, -1, 8500, 1, 31000)
|
||||
mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "default_dirt.png", 1)
|
1
mods/mobs/dungeonmaster.lua
Normal file → Executable file
@ -83,6 +83,7 @@ mobs:register_mob("mobs:dungeon_master", {
|
||||
blood_texture = "mobs_blood.png",
|
||||
})
|
||||
mobs:register_spawn("mobs:dungeon_master", {"default:stone, nether:netherrack"}, 20, -1, 6000, 1, -100)
|
||||
mobs:register_egg("mobs:dungeon_master", "Dungeon Master", "fire_basic_flame.png", 1)
|
||||
|
||||
-- Fireball (weapon)
|
||||
|
||||
|
2
mods/mobs/init.lua
Normal file → Executable file
@ -1,4 +1,4 @@
|
||||
-- Mob Api (10th Dec 2014)
|
||||
-- Mob Api (20th Feb 2015)
|
||||
|
||||
dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
|
0
mods/mobs/kitten.lua
Normal file → Executable file
2
mods/mobs/lava_flan.lua
Normal file → Executable file
@ -58,6 +58,8 @@ mobs:register_mob("mobs:lava_flan", {
|
||||
},
|
||||
jump = true,
|
||||
step = 2,
|
||||
floats = 0,
|
||||
blood_texture = "fire_basic_flame.png",
|
||||
})
|
||||
mobs:register_spawn("mobs:lava_flan", {"default:lava_source"}, 20, -1, 1000, 3, 31000)
|
||||
mobs:register_egg("mobs:lava_flan", "Lava Flan", "default_lava.png", 1)
|
0
mods/mobs/license.txt
Normal file → Executable file
3
mods/mobs/mese_monster.lua
Normal file → Executable file
@ -45,7 +45,7 @@ mobs:register_mob("mobs:mese_monster", {
|
||||
max = 5,},
|
||||
},
|
||||
light_resistant = true,
|
||||
armor = 70,
|
||||
armor = 80,
|
||||
drawtype = "front",
|
||||
water_damage = 0,
|
||||
lava_damage = 0,
|
||||
@ -74,6 +74,7 @@ mobs:register_mob("mobs:mese_monster", {
|
||||
blood_texture = "default_mese_crystal_fragment.png",
|
||||
})
|
||||
mobs:register_spawn("mobs:mese_monster", {"default:stone", }, 20, -1, 5000, 1, -25)
|
||||
mobs:register_egg("mobs:mese_monster", "Mese Monster", "default_mese_block.png", 1)
|
||||
|
||||
-- Mese Monster Crystal Shards (weapon)
|
||||
|
||||
|
0
mods/mobs/models/chicken.x
Normal file → Executable file
0
mods/mobs/models/mobs_bee.png
Normal file → Executable file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
0
mods/mobs/models/mobs_bee.x
Normal file → Executable file
0
mods/mobs/models/mobs_chicken.png
Normal file → Executable file
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
0
mods/mobs/models/mobs_chicken_black.png
Normal file → Executable file
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
mods/mobs/models/mobs_cow.png
Normal file → Executable file
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 948 B |
0
mods/mobs/models/mobs_cow.x
Normal file → Executable file
0
mods/mobs/models/mobs_dirt_monster.png
Normal file → Executable file
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
0
mods/mobs/models/mobs_dungeon_master.png
Normal file → Executable file
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
0
mods/mobs/models/mobs_dungeon_master.x
Normal file → Executable file
0
mods/mobs/models/mobs_dungeon_master_cobblestone.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/mobs/models/mobs_dungeon_master_strangewhite.png
Normal file → Executable file
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
0
mods/mobs/models/mobs_kitten.b3d
Normal file → Executable file
0
mods/mobs/models/mobs_kitten_ginger.png
Normal file → Executable file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/mobs/models/mobs_kitten_sandy.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/mobs/models/mobs_kitten_splotchy.png
Normal file → Executable file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/mobs/models/mobs_kitten_striped.png
Normal file → Executable file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
mods/mobs/models/mobs_oerkki.png
Normal file → Executable file
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.7 KiB |
0
mods/mobs/models/mobs_oerkki.x
Normal file → Executable file
0
mods/mobs/models/mobs_oerkki2.png
Normal file → Executable file
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
0
mods/mobs/models/mobs_pumba.png
Normal file → Executable file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
0
mods/mobs/models/mobs_pumba.x
Normal file → Executable file
0
mods/mobs/models/mobs_rat.png
Normal file → Executable file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
0
mods/mobs/models/mobs_rat.x
Normal file → Executable file
0
mods/mobs/models/mobs_rat_brown.png
Normal file → Executable file
Before Width: | Height: | Size: 834 B After Width: | Height: | Size: 834 B |
0
mods/mobs/models/mobs_sand_monster.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
mods/mobs/models/mobs_sand_monster.x
Normal file → Executable file
0
mods/mobs/models/mobs_sheep.png
Normal file → Executable file
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
0
mods/mobs/models/mobs_sheep.x
Normal file → Executable file
0
mods/mobs/models/mobs_sheep_shaved.png
Normal file → Executable file
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
0
mods/mobs/models/mobs_sheep_shaved.x
Normal file → Executable file
0
mods/mobs/models/mobs_spider.png
Normal file → Executable file
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
mods/mobs/models/mobs_spider.x
Normal file → Executable file
0
mods/mobs/models/mobs_stone_monster.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/mobs/models/mobs_stone_monster.x
Normal file → Executable file
0
mods/mobs/models/mobs_tree_monster.png
Normal file → Executable file
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
0
mods/mobs/models/mobs_tree_monster.x
Normal file → Executable file
0
mods/mobs/models/oerkki.png
Normal file → Executable file
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
0
mods/mobs/models/zmobs_lava_flan.png
Normal file → Executable file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/mobs/models/zmobs_lava_flan.x
Normal file → Executable file
0
mods/mobs/models/zmobs_mese_monster.png
Normal file → Executable file
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
0
mods/mobs/models/zmobs_mese_monster.x
Normal file → Executable file
1
mods/mobs/oerkki.lua
Normal file → Executable file
@ -58,3 +58,4 @@ mobs:register_mob("mobs:oerkki", {
|
||||
blood_texture = "mobs_blood.png",
|
||||
})
|
||||
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 2, -1, 6000, 2, -10)
|
||||
mobs:register_egg("mobs:oerkki", "Oerkki", "default_obsidian.png", 1)
|
16
mods/mobs/rat.lua
Normal file → Executable file
@ -37,21 +37,7 @@ passive = true,
|
||||
end,
|
||||
})
|
||||
mobs:register_spawn("mobs:rat", {"default:stone"}, 20, -1, 7000, 1, 31000)
|
||||
|
||||
-- Can Right-click Rat to Pick Up
|
||||
|
||||
minetest.register_craftitem("mobs:rat", {
|
||||
description = "Rat",
|
||||
inventory_image = "mobs_rat_inventory.png",
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.above then
|
||||
minetest.env:add_entity(pointed_thing.above, "mobs:rat")
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
mobs:register_egg("mobs:rat", "Rat", "mobs_rat_inventory.png", 0)
|
||||
|
||||
-- Cooked Rat, yummy!
|
||||
|
||||
|
6
mods/mobs/sandmonster.lua
Normal file → Executable file
@ -9,7 +9,7 @@ mobs:register_mob("mobs:sand_monster", {
|
||||
visual = "mesh",
|
||||
mesh = "mobs_sand_monster.x",
|
||||
--textures = {"mobs_sand_monster.png"},
|
||||
available_textures = {
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_sand_monster.png"},
|
||||
},
|
||||
@ -55,5 +55,7 @@ mobs:register_mob("mobs:sand_monster", {
|
||||
jump = true,
|
||||
step = 1,
|
||||
blood_texture = "mobs_blood.png",
|
||||
floats = 0,
|
||||
})
|
||||
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand", "default:sand"}, 20, -1, 5000, 1, 31000)
|
||||
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand", "default:sand"}, 20, -1, 5000, 1, 31000)
|
||||
mobs:register_egg("mobs:sand_monster", "Sand Monster", "default_desert_sand.png", 1)
|
8
mods/mobs/sheep.lua
Normal file → Executable file
@ -52,7 +52,7 @@ mobs:register_mob("mobs:sheep", {
|
||||
self.food = (self.food or 0) + 1
|
||||
if self.food >= 8 then
|
||||
self.food = 0
|
||||
self.naked = false
|
||||
self.gotten = false -- can be shaved again
|
||||
self.tamed = true
|
||||
self.object:set_properties({
|
||||
textures = {"mobs_sheep.png"},
|
||||
@ -62,8 +62,8 @@ mobs:register_mob("mobs:sheep", {
|
||||
end
|
||||
return
|
||||
end
|
||||
if clicker:get_inventory() and not self.naked then
|
||||
self.naked = true
|
||||
if clicker:get_inventory() and not self.gotten then
|
||||
self.gotten = true -- shaved
|
||||
if minetest.registered_items["wool:white"] then
|
||||
clicker:get_inventory():add_item("main", ItemStack("wool:white "..math.random(1,3)))
|
||||
end
|
||||
@ -71,7 +71,9 @@ mobs:register_mob("mobs:sheep", {
|
||||
textures = {"mobs_sheep_shaved.png"},
|
||||
mesh = "mobs_sheep_shaved.x",
|
||||
})
|
||||
else print ("shaved already!")
|
||||
end
|
||||
end,
|
||||
})
|
||||
mobs:register_spawn("mobs:sheep", {"default:dirt_with_grass"}, 20, 8, 9000, 1, 31000)
|
||||
mobs:register_egg("mobs:sheep", "Sheep", "wool_white.png", 1)
|
0
mods/mobs/sounds/mobs_bee.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_chicken.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_cow.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_dirtmonster.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_dirtmonster.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_dungeonmaster.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_dungeonmaster.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_dungeonmaster.3.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_eerie.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_fireball.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_howl.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_kitten.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_kitten.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_kitten.3.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_kitten.4.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_kitten.5.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_kitten.6.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_lavaflan.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_lavaflan.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_mesemonster.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_mesemonster.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_oerkki.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_oerkki.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_oerkki_attack.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_pig.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_rat.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_rat.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_sandmonster.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_sandmonster.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_sheep.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_spider.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_spider.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_stonemonster.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_stonemonster.2.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_treemonster.1.ogg
Normal file → Executable file
0
mods/mobs/sounds/mobs_treemonster.2.ogg
Normal file → Executable file
2
mods/mobs/spider.lua
Normal file → Executable file
@ -67,8 +67,10 @@ mobs:register_mob("mobs:spider", {
|
||||
sounds = {},
|
||||
step = 1,
|
||||
blood_texture = "mobs_blood.png",
|
||||
floats = 0,
|
||||
})
|
||||
mobs:register_spawn("mobs:spider", {"default:junglegrass", "default:jungleleaves", "default:jungletree"}, 20, -1, 7000, 1, 31000)
|
||||
mobs:register_egg("mobs:spider", "Spider", "mobs_cobweb.png", 1)
|
||||
|
||||
-- Ethereal crystal spike compatibility
|
||||
|
||||
|
2
mods/mobs/stonemonster.lua
Normal file → Executable file
@ -62,5 +62,7 @@ mobs:register_mob("mobs:stone_monster", {
|
||||
jump = true,
|
||||
step = 1,
|
||||
blood_texture = "mobs_blood.png",
|
||||
floats = 0,
|
||||
})
|
||||
mobs:register_spawn("mobs:stone_monster", {"default:stone", "nether:dirt_top"}, 3, -1, 5000, 2, -5)
|
||||
mobs:register_egg("mobs:stone_monster", "Stone Monster", "default_stone.png", 1)
|
0
mods/mobs/textures/mobs_bee_inv.png
Normal file → Executable file
Before Width: | Height: | Size: 934 B After Width: | Height: | Size: 934 B |
0
mods/mobs/textures/mobs_beehive.png
Normal file → Executable file
Before Width: | Height: | Size: 513 B After Width: | Height: | Size: 513 B |
0
mods/mobs/textures/mobs_blood.png
Normal file → Executable file
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 267 B |