mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Re-implement neutral mob switch
This commit is contained in:
parent
13c321e8f2
commit
31ded5e40f
1 changed files with 15 additions and 0 deletions
|
@ -64,6 +64,21 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
|||
return
|
||||
end
|
||||
|
||||
--neutral passive mobs switch to neutral hostile
|
||||
if self.neutral then
|
||||
--drop in variables for attacking (stops crash)
|
||||
self.attacking = hitter
|
||||
self.punch_timer = 0
|
||||
self.hostile = true
|
||||
--hostile_cooldown timer is initialized here
|
||||
self.hostile_cooldown_timer = self.hostile_cooldown
|
||||
|
||||
--initialize the group attack (check for other mobs in area, make them neutral hostile)
|
||||
if self.group_attack then
|
||||
mobs.group_attack_initialization(self)
|
||||
end
|
||||
end
|
||||
|
||||
--turn skittish mobs away and RUN
|
||||
if self.skittish then
|
||||
|
||||
|
|
Loading…
Reference in a new issue