Skip to content

Commit

Permalink
stop lurking on crit and small handle_ai_shot refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx committed Oct 23, 2023
1 parent 714ad2b commit 39ac21f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@

/mob/living/carbon/xenomorph/lurker/handle_ai_shot(obj/projectile/P)
if(P.firer)
var/distance = get_dist(src, P.firer)
if(distance > world.view)
if(prob(LURKING_IGNORE_SHOT_CHANCE))
return
if(prob(LURKING_IGNORE_SHOT_CHANCE))
return

var/datum/xeno_ai_movement/linger/lurking/lurker_ai = ai_movement_handler
if(lurker_ai && istype(lurker_ai))
lurker_ai.stop_lurking()

SSxeno_pathfinding.calculate_path(src, P.firer, distance, src, CALLBACK(src, PROC_REF(set_path)), list(src, P.firer))
SSxeno_pathfinding.calculate_path(src, P.firer, ai_range, src, CALLBACK(src, PROC_REF(set_path)), list(src, P.firer))

/mob/living/carbon/xenomorph/lurker/ai_move_target(delta_time)
if(throwing)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ Make sure their actual health updates immediately.*/
if(!lying)
update_canmove()

var/datum/xeno_ai_movement/linger/lurking/AI = ai_movement_handler
if(AI && istype(AI))
AI.stop_lurking()

/mob/living/carbon/xenomorph/proc/handle_luminosity()
var/new_luminosity = 0
if(caste)
Expand Down

0 comments on commit 39ac21f

Please sign in to comment.