Update api.lua
This commit is contained in:
parent
0fb7c78ac0
commit
847b1da2f7
7
api.lua
7
api.lua
|
@ -134,6 +134,7 @@ mobs.mob_class = {
|
||||||
owner = "",
|
owner = "",
|
||||||
order = "",
|
order = "",
|
||||||
jump_height = 4,
|
jump_height = 4,
|
||||||
|
alliance = nil,
|
||||||
lifetimer = 180, -- 3 minutes
|
lifetimer = 180, -- 3 minutes
|
||||||
texture_mods = "",
|
texture_mods = "",
|
||||||
view_range = 5,
|
view_range = 5,
|
||||||
|
@ -191,7 +192,6 @@ 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,
|
||||||
|
@ -1914,7 +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 (not self.alliance == nil 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)
|
||||||
|
@ -3605,7 +3605,7 @@ minetest.register_entity(":" .. name, setmetatable({
|
||||||
},
|
},
|
||||||
|
|
||||||
name = name,
|
name = name,
|
||||||
alliance = def.allaince,
|
alliance = def.alliance,
|
||||||
type = def.type,
|
type = def.type,
|
||||||
_nametag = def.nametag,
|
_nametag = def.nametag,
|
||||||
attack_type = def.attack_type,
|
attack_type = def.attack_type,
|
||||||
|
@ -3691,7 +3691,6 @@ 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,
|
||||||
|
|
Loading…
Reference in New Issue