From e2ddca88c459eb361c534602f1db7582351dc316 Mon Sep 17 00:00:00 2001 From: Ombridride Date: Sat, 1 Nov 2014 14:51:14 +0100 Subject: [PATCH] bugfix lavatemple and mobs tweaks - tweak depends.txt of lavatemple - tweak mobs (Dungeon_Master and Mese_Monster) shoots accuracy --- mods/lavatemple/depends.txt | 2 +- mods/mobs/api.lua | 8 +++++--- mods/mobs/dungeonmaster.lua | 5 ++--- mods/mobs/mese_monster.lua | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) mode change 100755 => 100644 mods/lavatemple/depends.txt diff --git a/mods/lavatemple/depends.txt b/mods/lavatemple/depends.txt old mode 100755 new mode 100644 index c2421e34..f23aeaa1 --- a/mods/lavatemple/depends.txt +++ b/mods/lavatemple/depends.txt @@ -1,4 +1,4 @@ default stairs -zmobs +mobs worldedit diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index bad162f7..90179778 100644 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -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 diff --git a/mods/mobs/dungeonmaster.lua b/mods/mobs/dungeonmaster.lua index 9608f047..d496a2f4 100644 --- a/mods/mobs/dungeonmaster.lua +++ b/mods/mobs/dungeonmaster.lua @@ -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) diff --git a/mods/mobs/mese_monster.lua b/mods/mobs/mese_monster.lua index 2961fc2e..c8ce6809 100644 --- a/mods/mobs/mese_monster.lua +++ b/mods/mobs/mese_monster.lua @@ -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)