mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 21:49:11 +01:00
A Tale of Blobs and Man
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
/mob/living/Initialize()
|
||||
if(ai_holder_type)
|
||||
ai_holder = new ai_holder_type(src)
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.hud_used = new /datum/hud(H)
|
||||
H.instantiate_hud(H.hud_used)
|
||||
return ..()
|
||||
|
||||
/mob/living/Destroy()
|
||||
@@ -220,7 +224,7 @@
|
||||
/datum/ai_holder/proc/handle_stance_strategical()
|
||||
ai_log("++++++++++ Slow Process Beginning ++++++++++", AI_LOG_TRACE)
|
||||
ai_log("handle_stance_strategical() : Called.", AI_LOG_TRACE)
|
||||
|
||||
|
||||
//We got left around for some reason. Goodbye cruel world.
|
||||
if(!holder)
|
||||
qdel(src)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
. = hearers(vision_range, holder) - holder // Remove ourselves to prevent suicidal decisions. ~ SRC is the ai_holder.
|
||||
. -= dview_mob // Not the dview mob either, nerd.
|
||||
|
||||
var/static/hostile_machines = typecacheof(list(/obj/machinery/porta_turret, /obj/mecha))
|
||||
var/static/hostile_machines = typecacheof(list(/obj/machinery/porta_turret, /obj/mecha, /obj/structure/blob))
|
||||
|
||||
for(var/HM in typecache_filter_list(range(vision_range, holder), hostile_machines))
|
||||
if(can_see(holder, HM, vision_range))
|
||||
@@ -75,7 +75,7 @@
|
||||
/datum/ai_holder/proc/give_target(new_target, urgent = FALSE)
|
||||
ai_log("give_target() : Given '[new_target]', urgent=[urgent].", AI_LOG_TRACE)
|
||||
target = new_target
|
||||
|
||||
|
||||
if(target != null)
|
||||
lose_target_time = 0
|
||||
track_target_position()
|
||||
@@ -155,6 +155,11 @@
|
||||
return FALSE // Turrets won't get hurt if they're still in their cover.
|
||||
return TRUE
|
||||
|
||||
if(istype(the_target, /obj/structure/blob)) // Blob mobs are always blob faction, but the blob can anger other things.
|
||||
var/obj/structure/blob/Blob = the_target
|
||||
if(holder.faction == Blob.faction)
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
// return FALSE
|
||||
|
||||
@@ -189,12 +194,12 @@
|
||||
ai_log("remove_target() : Entering.", AI_LOG_TRACE)
|
||||
if(target)
|
||||
target = null
|
||||
|
||||
|
||||
lose_target_time = 0
|
||||
give_up_movement()
|
||||
lose_target_position()
|
||||
set_stance(STANCE_IDLE)
|
||||
|
||||
|
||||
// Check if target is visible to us.
|
||||
/datum/ai_holder/proc/can_see_target(atom/movable/the_target, view_range = vision_range)
|
||||
ai_log("can_see_target() : Entering.", AI_LOG_TRACE)
|
||||
@@ -274,7 +279,7 @@
|
||||
// Sets a few vars so mobs that threaten will react faster to an attacker or someone who attacked them before.
|
||||
/datum/ai_holder/proc/on_attacked(atom/movable/AM)
|
||||
last_conflict_time = world.time
|
||||
add_attacker(AM)
|
||||
add_attacker(AM)
|
||||
|
||||
// Checks to see if an atom attacked us lately
|
||||
/datum/ai_holder/proc/check_attacker(var/atom/movable/A)
|
||||
@@ -287,7 +292,7 @@
|
||||
// Forgive this attacker
|
||||
/datum/ai_holder/proc/remove_attacker(var/atom/movable/A)
|
||||
attackers -= A.name
|
||||
|
||||
|
||||
// Causes targeting to prefer targeting the taunter if possible.
|
||||
// This generally occurs if more than one option is within striking distance, including the taunter.
|
||||
// Otherwise the default filter will prefer the closest target.
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
return ATTACK_ON_COOLDOWN
|
||||
return attack_target(A) // This will set click cooldown.
|
||||
|
||||
/mob/living/carbon/human/IAttack(atom/A)
|
||||
if(!canClick()) // Still on cooldown from a "click".
|
||||
return FALSE
|
||||
return ClickOn(A) // Except this is an actual fake "click".
|
||||
|
||||
/mob/living/proc/IRangedAttack(atom/A)
|
||||
return FALSE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user