1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-01-11 18:40:25 +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 default
stairs stairs
zmobs mobs
worldedit worldedit

View File

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

View File

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

View File

@ -25,7 +25,7 @@ mobs:register_mob("mobs:mese_monster", {
view_range = 16, view_range = 16,
walk_velocity = 1, walk_velocity = 1,
run_velocity = 3, run_velocity = 3,
damage = 5, damage = 7,
drops = { drops = {
{name = "default:mese_crystal", {name = "default:mese_crystal",
chance = 9, chance = 9,
@ -82,7 +82,7 @@ mobs:register_arrow("mobs:mese_arrow", {
player:punch(self.object, 1.0, { player:punch(self.object, 1.0, {
full_punch_interval=1.0, full_punch_interval=1.0,
damage_groups = {fleshy=1}, 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, end,
hit_node = function(self, pos, node) hit_node = function(self, pos, node)