Skip to content

Commit

Permalink
do not bait while current target is in sight and home locating tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx committed Oct 28, 2023
1 parent 98a293e commit e036032
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions code/modules/mob/living/carbon/xenomorph/ai/movement/lurking.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@
preferred = TRUE
break

if(idle_xeno.current_target)
var/our_target = idle_xeno.current_target
if(our_target)
var/potential_home_dir = get_dir(idle_xeno, potential_home)
var/current_target_dir = get_dir(idle_xeno, idle_xeno.current_target)
var/current_target_dir = get_dir(idle_xeno, our_target)

if(current_target_dir == potential_home_dir || current_target_dir == turn(potential_home_dir, 45) || current_target_dir == turn(potential_home_dir, -45))
continue

if(get_dist(potential_home, our_target) > stalking_distance)
continue

var/xeno_to_potential_home_distance = get_dist(idle_xeno, potential_home)
if(xeno_to_potential_home_distance > shortest_distance)
continue
Expand Down Expand Up @@ -129,7 +133,12 @@
if(!annoyed_xeno.current_target || !ai_lurking)
return

if(get_dist(annoyed_xeno, annoyed_xeno.current_target) > 10)
var/target_distance = get_dist(annoyed_xeno, annoyed_xeno.current_target)

if(target_distance < world.view)
return

if(target_distance > 10)
annoyance = 0
total_baits = 0
return
Expand Down Expand Up @@ -166,11 +175,11 @@
baiting_xeno.say(pick(LURKER_BAIT_TAUNTS))
if("Interact")
if(!interact_random(baiting_xeno))
try_bait(no_interact = TRUE)
return
return try_bait(no_interact = TRUE)

total_baits++
annoyance = 0
return bait

#undef LURKER_BAIT_TYPES
#undef LURKER_BAIT_EMOTES
Expand Down

0 comments on commit e036032

Please sign in to comment.