diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm index 206ba88b317..c86160db025 100644 --- a/code/modules/mob/living/basic/bots/_bots.dm +++ b/code/modules/mob/living/basic/bots/_bots.dm @@ -6,6 +6,8 @@ GLOBAL_LIST_INIT(command_strings, list( "home" = "RETURN HOME", )) +#define SENTIENT_BOT_RESET_TIMER 45 SECONDS + /mob/living/basic/bot icon = 'icons/mob/silicon/aibots.dmi' layer = MOB_LAYER @@ -101,7 +103,7 @@ GLOBAL_LIST_INIT(command_strings, list( AddElement(/datum/element/relay_attackers) RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(handle_loop_movement)) RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(after_attacked)) - RegisterSignal(src, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access)) + RegisterSignal(src, COMSIG_OBJ_ALLOWED, PROC_REF(attempt_access)) ADD_TRAIT(src, TRAIT_NO_GLIDE, INNATE_TRAIT) GLOB.bots_list += src @@ -758,9 +760,7 @@ GLOBAL_LIST_INIT(command_strings, list( /mob/living/basic/bot/proc/attempt_access(mob/bot, obj/door_attempt) SIGNAL_HANDLER - if(door_attempt.check_access(access_card)) - return ACCESS_ALLOWED - return ACCESS_DISALLOWED + return (door_attempt.check_access(access_card) ? COMPONENT_OBJ_ALLOW : COMPONENT_OBJ_DISALLOW) /mob/living/basic/bot/proc/generate_speak_list() return null @@ -783,6 +783,8 @@ GLOBAL_LIST_INIT(command_strings, list( access_card.set_access(access_to_grant) speak("Responding.", radio_channel) update_bot_mode(new_mode = BOT_SUMMON) + if(client) //if we're sentient, we reset ourselves after a short period + addtimer(CALLBACK(src, PROC_REF(bot_reset)), SENTIENT_BOT_RESET_TIMER) return TRUE /mob/living/basic/bot/proc/set_ai_caller(mob/living/caller) @@ -809,3 +811,5 @@ GLOBAL_LIST_INIT(command_strings, list( /mob/living/basic/bot/proc/on_bot_movement(atom/movable/source, atom/oldloc, dir, forced) return + +#undef SENTIENT_BOT_RESET_TIMER diff --git a/code/modules/mob/living/basic/bots/bot_ai.dm b/code/modules/mob/living/basic/bots/bot_ai.dm index 36600f244e7..16ca5200308 100644 --- a/code/modules/mob/living/basic/bots/bot_ai.dm +++ b/code/modules/mob/living/basic/bots/bot_ai.dm @@ -34,6 +34,13 @@ if(. & AI_CONTROLLER_INCOMPATIBLE) return RegisterSignal(new_pawn, COMSIG_BOT_RESET, PROC_REF(reset_bot)) + RegisterSignal(new_pawn, COMSIG_AI_BLACKBOARD_KEY_CLEARED(BB_BOT_SUMMON_TARGET), PROC_REF(clear_summon)) + +/datum/ai_controller/basic_controller/bot/proc/clear_summon() + SIGNAL_HANDLER + + var/mob/living/basic/bot/bot_pawn = pawn + bot_pawn.bot_reset() /datum/ai_controller/basic_controller/bot/able_to_run() var/mob/living/basic/bot/bot_pawn = pawn diff --git a/code/modules/mob/living/basic/bots/medbot/medbot.dm b/code/modules/mob/living/basic/bots/medbot/medbot.dm index b611ff2eadd..7c6b2c9c198 100644 --- a/code/modules/mob/living/basic/bots/medbot/medbot.dm +++ b/code/modules/mob/living/basic/bots/medbot/medbot.dm @@ -7,14 +7,13 @@ icon_state = "medibot0" base_icon_state = "medibot" density = FALSE - anchored = FALSE health = 20 maxHealth = 20 speed = 2 light_power = 0.8 light_color = "#99ccff" pass_flags = PASSMOB | PASSFLAPS - status_flags = CANSTUN + status_flags = (CANPUSH | CANSTUN) ai_controller = /datum/ai_controller/basic_controller/bot/medbot req_one_access = list(ACCESS_ROBOTICS, ACCESS_MEDICAL)