1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

bugfix lavatemple and mobs tweaks

- tweak depends.txt of lavatemple
- tweak mobs (Dungeon_Master and Mese_Monster) shoots accuracy
This commit is contained in:
Ombridride 2014-11-01 14:51:14 +01:00
parent cdd55a16f1
commit e2ddca88c4
4 changed files with 10 additions and 9 deletions

2
mods/lavatemple/depends.txt Executable file → Normal file
View File

@ -1,4 +1,4 @@
default
stairs
zmobs
mobs
worldedit

View File

@ -1,8 +1,9 @@
mobs = {}
mobs.mod = "redo"
function mobs:register_mob(name, def)
minetest.register_entity(name, {
name = name,
hp_min = def.hp_min or 5, --
hp_min = def.hp_min or 5,
hp_max = def.hp_max,
physical = true,
collisionbox = def.collisionbox,
@ -46,6 +47,7 @@ function mobs:register_mob(name, def)
blood_texture = def.blood_texture or "mobs_blood.png",
rewards = def.rewards or nil,
animaltype = def.animaltype,
shoot_offset = def.shoot_offset or 0,
stimer = 0,
timer = 0,
@ -572,7 +574,7 @@ function mobs:register_mob(name, def)
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+1
vec.y = vec.y + self.shoot_offset -- 2
vec.x = vec.x*v/amount
vec.y = vec.y*v/amount
vec.z = vec.z*v/amount
@ -844,7 +846,7 @@ 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
self.hit_node(self, pos, node)
self.object:remove()
return

View File

@ -77,11 +77,10 @@ mobs:register_arrow("mobs:fireball", {
hit_player = function(self, player)
local s = self.object:getpos()
local p = player:getpos()
local vec = {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z}
player:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups = {fleshy=6},
}, vec)
damage_groups = {fleshy=8},
}, 0) -- {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z})
end,
-- node hit, bursts into flame (cannot blast through obsidian)

View File

@ -25,7 +25,7 @@ mobs:register_mob("mobs:mese_monster", {
view_range = 16,
walk_velocity = 1,
run_velocity = 3,
damage = 5,
damage = 7,
drops = {
{name = "default:mese_crystal",
chance = 9,
@ -82,7 +82,7 @@ mobs:register_arrow("mobs:mese_arrow", {
player:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups = {fleshy=1},
}, {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z})
}, 0) -- {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z})
end,
hit_node = function(self, pos, node)