strike back when hit by other mobs

This commit is contained in:
Sokomine 2023-03-16 16:10:07 +01:00
parent 7f8e486d48
commit 2e735d1b77
2 changed files with 5 additions and 3 deletions

View File

@ -29,16 +29,18 @@ end
guards.guard_data = {
-- type needs to be "npc" - else it doesn't know how to follow
type = "npc", -- "guard",
passive = true,
passive = false, -- we are a guard...
damage = 9,
attack_type = "dogfight",
attacks_monsters = true,
attack_monsters = true,
attack_npcs = false,
attack_chance = 80,
owner_loyal = false,
pathfinding = false,
hp_min = 60,
hp_max = 100,
armor = 0,
armor = 100,
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
visual = "mesh",
visual_size = {x = 1, y = 1},

View File

@ -94,7 +94,7 @@ end
guards.on_step = function(self, dtime, moveresult)
if(self.order ~= "patrol") then
if(self.order ~= "patrol" or self.state == "attack") then
return true
end