[no gbp] some few bot fixes (#80208)

## About The Pull Request
i forgto to set this in my last prs closes #80204 
also closes #80252

## Why It's Good For The Game
ais can summon bots 

## Changelog
🆑
fix: AIs can summon bots again
fix: cleanbots can clean floors directly underneath them and prioritize
floors nearest to them
fix: medbots drop empty medkits now
/🆑
This commit is contained in:
Ben10Omintrix
2023-12-11 20:00:08 -07:00
committed by GitHub
parent bbfd721af5
commit 40f3926de8
7 changed files with 72 additions and 35 deletions
+12 -4
View File
@@ -91,6 +91,9 @@ GLOBAL_LIST_INIT(command_strings, list(
/mob/living/basic/bot/Initialize(mapload)
. = ..()
AddElement(/datum/element/relay_attackers)
RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(after_attacked))
RegisterSignal(src, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access))
ADD_TRAIT(src, TRAIT_NO_GLIDE, INNATE_TRAIT)
GLOB.bots_list += src
@@ -181,6 +184,7 @@ GLOBAL_LIST_INIT(command_strings, list(
/mob/living/basic/bot/Destroy()
GLOB.bots_list -= src
calling_ai_ref = null
QDEL_NULL(paicard)
QDEL_NULL(pa_system)
QDEL_NULL(internal_radio)
@@ -521,8 +525,7 @@ GLOBAL_LIST_INIT(command_strings, list(
return
if(istype(item_to_drop, /obj/item/storage))
var/obj/item/storage/storage_to_drop = item_to_drop
storage_to_drop.emptyStorage()
item_to_drop.contents = list()
return
if(!istype(item_to_drop, /obj/item/gun/energy))
@@ -778,11 +781,12 @@ GLOBAL_LIST_INIT(command_strings, list(
initial_access = access_card.access.Copy()
/mob/living/basic/bot/proc/summon_bot(atom/caller, user_access = list(), grant_all_access = FALSE)
/mob/living/basic/bot/proc/summon_bot(atom/caller, turf/turf_destination, user_access = list(), grant_all_access = FALSE)
if(isAI(caller) && !set_ai_caller(caller))
return FALSE
bot_reset(bypass_ai_reset = isAI(caller))
ai_controller?.set_blackboard_key(BB_BOT_SUMMON_TARGET, get_turf(caller))
var/turf/destination = turf_destination ? turf_destination : get_turf(caller)
ai_controller?.set_blackboard_key(BB_BOT_SUMMON_TARGET, destination)
var/list/access_to_grant = grant_all_access ? REGION_ACCESS_ALL_STATION : user_access + initial_access
access_card.set_access(access_to_grant)
speak("Responding.", radio_channel)
@@ -801,3 +805,7 @@ GLOBAL_LIST_INIT(command_strings, list(
update_appearance()
if(update_hud)
diag_hud_set_botmode()
/mob/living/basic/bot/proc/after_attacked(datum/source, atom/attacker, attack_flags)
if(attack_flags & ATTACKER_DAMAGING_ATTACK)
do_sparks(number = 5, cardinal_only = TRUE, source = src)