1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-12-25 18:20:20 +01:00

monsters will always attack creatura mobs, anything else will defend it's owner if attacked.

This commit is contained in:
tenplus1 2023-05-26 16:17:58 +01:00
parent 194c9f7847
commit 05f0550876

10
api.lua
View File

@ -1958,15 +1958,19 @@ function mob_class:general_attack()
elseif creatura and ent and ent._cmi_is_mob ~= true elseif creatura and ent and ent._cmi_is_mob ~= true
and ent.hitbox and ent.stand_node then and ent.hitbox and ent.stand_node then
-- monsters attack all creatura mobs, npc and animals will only attack
-- if the animal owner is currently being attacked by creatura mob
if self.name == ent.name if self.name == ent.name
or self.type ~= "monster" or (self.type ~= "monster"
and self.owner ~= (ent._target and ent._target:get_player_name() or "."))
or (self.specific_attack or (self.specific_attack
and not check_for(ent.name, self.specific_attack)) then and not check_for(ent.name, self.specific_attack)) then
objs[n] = nil objs[n] = nil
-- print("- creatura", n, self.name, ent.name) --print("-- creatura", ent.name)
end end
-- or are we a mob? -- ent.hitbox is a creatura mob identifier -- or are we a mob?
elseif ent and ent._cmi_is_mob then elseif ent and ent._cmi_is_mob then
-- remove mobs not to attack -- remove mobs not to attack