Skip to content

Commit

Permalink
ai_start_pulling and "move" order now overrides attack target
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx committed Apr 3, 2024
1 parent ad8ebba commit baae000
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@

var/atom/movable/target = processing_xeno.current_target
if(get_dist(processing_xeno, target) <= 1)
INVOKE_ASYNC(processing_xeno, TYPE_PROC_REF(/mob, start_pulling), target)
processing_xeno.face_atom(target)
processing_xeno.swap_hand()
processing_xeno.ai_start_pulling(target)

processing_xeno.ai_move_target(delta_time)
return TRUE
30 changes: 20 additions & 10 deletions code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,23 @@

a_intent = INTENT_HARM

var/patrol_lenght = length(patrol_points)
if(patrol_lenght == 1)
ai_move_patrol(delta_time)
return TRUE

if(!current_target)
if(length(patrol_points))
if(patrol_lenght)
ai_move_patrol(delta_time)
else
ai_move_idle(delta_time)
return TRUE

ai_move_idle(delta_time)
return TRUE

if(GLOB.ai_capture_crit && target_distance <= 1 && ishuman(current_target))
if(GLOB.ai_capture_crit && ishuman(current_target))
var/mob/living/carbon/human/human_target = current_target
if(human_target.stat != CONSCIOUS)
if(!pulling)
INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, start_pulling), human_target)
face_atom(human_target)
swap_hand()

if(human_target.stat != CONSCIOUS && target_distance <= 1)
ai_start_pulling(human_target)
ai_move_hive(delta_time)
return TRUE

Expand Down Expand Up @@ -442,3 +444,11 @@
if(cycled_turf.x == min_x_value)
min_x_turfs += cycled_turf
return min_x_turfs

/mob/living/carbon/xenomorph/proc/ai_start_pulling(atom/movable/target)
if(pulling)
return

INVOKE_ASYNC(src, TYPE_PROC_REF(/mob, start_pulling), target)
face_atom(target)
swap_hand()

0 comments on commit baae000

Please sign in to comment.