@@ -77,13 +77,30 @@ local function female_brain(self)
7777 end
7878
7979 if mobkit .timer (self ,1 ) then
80+ local childent = nil
81+ local predator = nil
82+ local danger = " "
8083 local prty = mobkit .get_queue_priority (self )
8184 local obj = self .object
8285 local pos = self .object :get_pos ()
8386 local bosspos = water_life .headpos (self )
8487 local calf = water_life .pregnant (self )
8588 local dna = water_life .dna (self )
89+ local baby = wildcow .whereismum (self ,8 ,true ) -- true searches for calfs, not females
90+ if baby and # baby > 0 then
91+ childent = baby [1 ]:get_luaentity () -- get the entity to do further checks
92+ end
8693
94+ if childent then
95+ predator = water_life .get_closest_enemy (childent ,true )
96+ if predator then
97+ if predator :is_player () then
98+ danger = " \n DANGER: " .. predator :get_player_name ()
99+ else
100+ danger = " \n DANGER: " .. predator :get_luaentity ().name
101+ end
102+ end
103+ end
87104
88105 if calf > 0 then
89106 calf = os.clock () - calf
@@ -119,10 +136,22 @@ local function female_brain(self)
119136
120137 obj :set_nametag_attributes ({
121138 color = ' #ff7373' ,
122- text = tostring (water_life .is_alive (self )).. " \n " .. kepala .. " \n " .. hamil .. " \n " .. tostring (water_life .hunger (self )).. " % hunger\n " .. tostring (water_life .horny (self )).. " % horny" ,
139+ text = tostring (water_life .is_alive (self )).. " \n " .. kepala .. " \n " .. hamil .. " \n " .. tostring (water_life .hunger (self )).. " % hunger\n " .. tostring (water_life .horny (self )).. " % horny" .. danger ,
123140 })
124141 end
125-
142+
143+ if prty < 50 and predator and baby [1 ] then -- do not mess with MAMA !
144+ local ppos = predator :get_pos ()
145+ local bpos = baby [1 ]:get_pos ()
146+ local dist = water_life .dist2tgt (childent ,predator )
147+ if math.abs (ppos .y - bpos .y ) < 3 and dist < 8 and not water_life .inwater (predator ) then
148+ wildcow .hq_overrun (self ,50 ,predator )
149+ end
150+ end
151+
152+
153+
154+
126155 if prty < 20 and water_life .inwater (self .object ) then
127156 mobkit .hq_liquid_recovery (self ,20 )
128157 water_life .hunger (self ,- 5 )
0 commit comments