mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
added group_attack in cow,goat,warthog and npc
added group attack if not tamed and type(name) identical fixed crash if unknow node in function env_damage
This commit is contained in:
parent
69ce8e8266
commit
1020b080aa
@ -317,6 +317,7 @@ function mobs:register_mob(name, def)
|
||||
local nod = minetest.get_node_or_nil(pos)
|
||||
if not nod then return end ; -- print ("standing in "..nod.name)
|
||||
local nodef = minetest.registered_nodes[nod.name]
|
||||
if not nodef then return end
|
||||
pos.y = pos.y + 1
|
||||
|
||||
-- water
|
||||
@ -1185,8 +1186,10 @@ end
|
||||
local obj = nil
|
||||
for _, oir in pairs(minetest.get_objects_inside_radius(hitter:getpos(), 5)) do
|
||||
obj = oir:get_luaentity()
|
||||
if obj then
|
||||
if obj
|
||||
and obj.name == self.name then
|
||||
if obj.group_attack == true
|
||||
and not obj.tamed
|
||||
and obj.state ~= "attack" then
|
||||
obj.do_attack(obj, hitter, 1)
|
||||
end
|
||||
|
@ -6,6 +6,7 @@ mobs:register_mob("mobs:cow", {
|
||||
type = "animal",
|
||||
-- aggressive, does 5 damage to player when threatened
|
||||
passive = false,
|
||||
group_attack = true,
|
||||
attack_type = "dogfight",
|
||||
damage = 4,
|
||||
-- health & armor
|
||||
|
@ -6,6 +6,7 @@ mobs:register_mob("mobs:goat", {
|
||||
type = "animal",
|
||||
-- aggressive, does 5 damage to player when threatened
|
||||
passive = false,
|
||||
group_attack = true,
|
||||
attack_type = "dogfight",
|
||||
damage = 4,
|
||||
-- health & armor
|
||||
|
@ -13,6 +13,7 @@ mobs:register_mob("mobs:npc", {
|
||||
type = "npc",
|
||||
-- aggressive, deals 6 damage to player/monster when hit
|
||||
passive = false,
|
||||
group_attack = true,
|
||||
damage = 5, -- 3 damages if tamed
|
||||
attack_type = "dogfight",
|
||||
attacks_monsters = true,
|
||||
|
@ -6,6 +6,7 @@ mobs:register_mob("mobs:pumba", {
|
||||
type = "animal",
|
||||
-- aggressive, deals 5 damage to player when threatened
|
||||
passive = false,
|
||||
group_attack = true,
|
||||
attack_type = "dogfight",
|
||||
damage = 4,
|
||||
-- health & armor
|
||||
|
Loading…
Reference in New Issue
Block a user