mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
committed by
Chompstation Bot
parent
4e39cb8cfc
commit
5c39c85412
@@ -3,23 +3,20 @@
|
||||
// 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()
|
||||
return find_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.
|
||||
// We conserve ammo (or can't shoot) so walk closer
|
||||
if(get_dist(holder, target_last_seen_turf) > 1)
|
||||
return give_destination(target_last_seen_turf, 1, TRUE) // Sets stance as well
|
||||
// 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()
|
||||
// We're right there, look around?
|
||||
else
|
||||
return find_target()
|
||||
// Shoot in their direction angrily
|
||||
else
|
||||
return shoot_near_turf(target_last_seen_turf)
|
||||
|
||||
|
||||
@@ -69,6 +69,10 @@
|
||||
// Step 4, give us our selected target.
|
||||
/datum/ai_holder/proc/give_target(new_target, urgent = FALSE)
|
||||
ai_log("give_target() : Given '[new_target]', urgent=[urgent].", AI_LOG_TRACE)
|
||||
|
||||
if(target)
|
||||
remove_target()
|
||||
|
||||
target = new_target
|
||||
|
||||
if(target != null)
|
||||
|
||||
Reference in New Issue
Block a user