Bug fixes galore

master
tenplus1 2014-12-02 09:43:00 +00:00
parent 790135e497
commit 9c31f0fb80
3 changed files with 61 additions and 33 deletions

View File

@ -1,27 +1,32 @@
-= MOBS-MOD for MINETEST =-
by PilzAdam, KrupnovPavel, Zeg9 and TenPlus1
All my models and change code on valid license The MIT License
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
The MIT License (MIT)
..with the following new features:
Copyright (c) 2014 Krupnov Pavel
- 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
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Changelog:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
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

30
api.lua
View File

@ -172,7 +172,7 @@ function mobs:register_mob(name, def)
end,
on_step = function(self, dtime)
local yaw = 0
if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then
self.object:remove()
end
@ -194,7 +194,7 @@ function mobs:register_mob(name, def)
-- drop egg
if self.animaltype == "clucky" then
if math.random(1, 1500) < 2
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"})
@ -456,7 +456,7 @@ function mobs:register_mob(name, def)
self.set_animation(self, "walk")
end
elseif self.state == "walk" then
if math.random(1, 100) < 31 then
if math.random(1, 100) <= 30 then
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/180*math.pi))
end
if self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
@ -466,7 +466,7 @@ function mobs:register_mob(name, def)
end
self:set_animation("walk")
self.set_velocity(self, self.walk_velocity)
if math.random(1, 100) < 31 then
if math.random(1, 100) <= 30 then
self.set_velocity(self, 0)
self.state = "stand"
self:set_animation("stand")
@ -532,7 +532,7 @@ function mobs:register_mob(name, def)
full_punch_interval=1.0,
damage_groups = {fleshy=self.damage}
}, vec)
if self.attack.player:get_hp() < 1 then
if self.attack.player:get_hp() <= 0 then
self.state = "stand"
self:set_animation("stand")
end
@ -574,7 +574,7 @@ function mobs:register_mob(name, def)
self.object:setyaw(yaw)
self.set_velocity(self, 0)
if self.timer > self.shoot_interval and math.random(1, 100) < 61 then
if self.timer > self.shoot_interval and math.random(1, 100) <= 60 then
self.timer = 0
self:set_animation("punch")
@ -627,7 +627,7 @@ function mobs:register_mob(name, def)
self.object:set_properties(tmp.textures)
end]]
end
if self.lifetimer < 1 and not self.tamed and self.type ~= "npc" then
if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then
self.object:remove()
end
end,
@ -792,14 +792,15 @@ function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_o
end
pos.y = pos.y+1
if not minetest.get_node_light(pos)
or minetest.get_node_light(pos) > max_light
or minetest.get_node_light(pos) < min_light then
--print ("LIGHT", name)
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
return
end
@ -858,7 +859,8 @@ 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
if minetest.registered_nodes[minetest.get_node(self.object:getpos()).name].walkable 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

21
license.txt Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Krupnov Pavel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.