Update api.lua
This commit is contained in:
parent
95f3e98867
commit
bfcd5582b0
6
api.lua
6
api.lua
|
@ -191,6 +191,7 @@ mobs.mob_class = {
|
||||||
attack_animals = false,
|
attack_animals = false,
|
||||||
attack_players = true,
|
attack_players = true,
|
||||||
attack_npcs = true,
|
attack_npcs = true,
|
||||||
|
attack_allies = false,
|
||||||
friendly_fire = true,
|
friendly_fire = true,
|
||||||
facing_fence = false,
|
facing_fence = false,
|
||||||
_breed_countdown = nil,
|
_breed_countdown = nil,
|
||||||
|
@ -1913,6 +1914,7 @@ function mob_class:general_attack()
|
||||||
or (not self.attack_animals and ent.type == "animal")
|
or (not self.attack_animals and ent.type == "animal")
|
||||||
or (not self.attack_monsters and ent.type == "monster")
|
or (not self.attack_monsters and ent.type == "monster")
|
||||||
or (not self.attack_npcs and ent.type == "npc")
|
or (not self.attack_npcs and ent.type == "npc")
|
||||||
|
or (not self.attack_allies and self.alliance == ent.alliance)
|
||||||
or (self.specific_attack and not check_for(ent.name, self.specific_attack)) then
|
or (self.specific_attack and not check_for(ent.name, self.specific_attack)) then
|
||||||
objs[n] = nil
|
objs[n] = nil
|
||||||
--print("- mob", n, self.name, ent.name)
|
--print("- mob", n, self.name, ent.name)
|
||||||
|
@ -3603,6 +3605,7 @@ minetest.register_entity(":" .. name, setmetatable({
|
||||||
},
|
},
|
||||||
|
|
||||||
name = name,
|
name = name,
|
||||||
|
alliance = def.allaince,
|
||||||
type = def.type,
|
type = def.type,
|
||||||
_nametag = def.nametag,
|
_nametag = def.nametag,
|
||||||
attack_type = def.attack_type,
|
attack_type = def.attack_type,
|
||||||
|
@ -3688,6 +3691,7 @@ minetest.register_entity(":" .. name, setmetatable({
|
||||||
attack_animals = def.attack_animals,
|
attack_animals = def.attack_animals,
|
||||||
attack_players = def.attack_players,
|
attack_players = def.attack_players,
|
||||||
attack_npcs = def.attack_npcs,
|
attack_npcs = def.attack_npcs,
|
||||||
|
attack_allies = def.attack_allies,
|
||||||
specific_attack = def.specific_attack,
|
specific_attack = def.specific_attack,
|
||||||
friendly_fire = def.friendly_fire,
|
friendly_fire = def.friendly_fire,
|
||||||
runaway_from = def.runaway_from,
|
runaway_from = def.runaway_from,
|
||||||
|
@ -4968,4 +4972,4 @@ minetest.register_chatcommand("clear_mobs", {
|
||||||
|
|
||||||
minetest.chat_send_player(name, S("@1 mobs removed.", count))
|
minetest.chat_send_player(name, S("@1 mobs removed.", count))
|
||||||
end
|
end
|
||||||
})
|
})
|
Loading…
Reference in New Issue