mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 11:38:12 +01:00
@@ -3,16 +3,19 @@
|
||||
// Used when a target is out of sight or invisible.
|
||||
/datum/ai_holder/proc/engage_unseen_enemy()
|
||||
ai_log("engage_unseen_enemy() : Entering.", AI_LOG_TRACE)
|
||||
// Also handled in strategic updates but handling it here allows for more fine resolution timeouts
|
||||
if((lose_target_time+lose_target_timeout) >= world.time)
|
||||
return remove_target()
|
||||
// Lets do some last things before giving up.
|
||||
if(conserve_ammo || !holder.ICheckRangedAttack(target_last_seen_turf))
|
||||
if(get_dist(holder, target_last_seen_turf) > 1) // We last saw them over there.
|
||||
// Go to where you last saw the enemy.
|
||||
return give_destination(target_last_seen_turf, 1, TRUE) // Sets stance as well
|
||||
else if(lose_target_time < world.time) // We last saw them next to us, so do a blind attack on that tile.
|
||||
if(melee_on_tile(target_last_seen_turf) != ATTACK_SUCCESSFUL && intelligence_level >= AI_NORMAL)
|
||||
var/obj/O = find_escape_route()
|
||||
if(istype(O))
|
||||
return give_destination(get_turf(O), 0, TRUE)
|
||||
// We last saw them next to us, so do a blind attack on that tile.
|
||||
else if(melee_on_tile(target_last_seen_turf) != ATTACK_SUCCESSFUL && intelligence_level >= AI_NORMAL)
|
||||
var/obj/O = find_escape_route()
|
||||
if(istype(O))
|
||||
return give_destination(get_turf(O), 0, TRUE)
|
||||
else
|
||||
return find_target()
|
||||
else
|
||||
|
||||
@@ -183,6 +183,7 @@
|
||||
give_up_movement()
|
||||
lose_target_position()
|
||||
set_stance(STANCE_IDLE)
|
||||
return TRUE
|
||||
|
||||
// Check if target is visible to us.
|
||||
/datum/ai_holder/proc/can_see_target(atom/movable/the_target, view_range = vision_range)
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
if(large_cocoon)
|
||||
C.icon_state = pick("cocoon_large1","cocoon_large2","cocoon_large3")
|
||||
|
||||
ai_holder.target = null
|
||||
ai_holder.remove_target()
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -188,6 +188,7 @@
|
||||
retaliate = 1
|
||||
cooperative = TRUE
|
||||
speak_chance = 1
|
||||
lose_target_timeout = 0 // Easily distracted
|
||||
|
||||
/datum/ai_holder/simple_mob/woof/hostile
|
||||
hostile = 1
|
||||
|
||||
Reference in New Issue
Block a user