mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
Tweak or break AI
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user