From 41e91c1f4102bf6fa8ff47ec3511bb9fc56834c4 Mon Sep 17 00:00:00 2001 From: Zam Avaeana Date: Wed, 27 Sep 2023 18:57:08 -0400 Subject: [PATCH] misc improvements --- code/game/objects/machinery/bots/bots.dm | 53 ++++++++++---------- code/game/objects/machinery/bots/cleanbot.dm | 8 ++- code/game/objects/machinery/bots/roomba.dm | 4 ++ 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/code/game/objects/machinery/bots/bots.dm b/code/game/objects/machinery/bots/bots.dm index 19b870b5ba886..58a26df6ffe27 100755 --- a/code/game/objects/machinery/bots/bots.dm +++ b/code/game/objects/machinery/bots/bots.dm @@ -1,6 +1,6 @@ /obj/machinery/bot name = "generic utility robot" - desc = "a generic utility robot, you shouldn't be seeing this in game. If you do ahelp." + desc = "a generic utility robot, ahelp if you see this in game." icon = 'icons/obj/aibots.dmi' density = FALSE anchored = FALSE @@ -26,7 +26,6 @@ ///icon to set while active var/active_icon_state = null - /obj/machinery/bot/Initialize(mapload) . = ..() if(SStts.tts_enabled) @@ -67,6 +66,7 @@ /obj/machinery/bot/examine(mob/user, distance, infix, suffix) . = ..() . += "A panel on the top says it has cleaned [counter] items!" + . += "It is currently [is_active ? "on" : "off"]." /obj/machinery/bot/proc/reactivate() stuck_counter = 0 @@ -95,41 +95,40 @@ switch(tgui_alert(user, "Do you you want to turn the [src] [is_active ? "off" : "on"]?" , "Cleanbot activation", list("No", "Yes"))) if("Yes") if(is_active) - if(length(shutdownsentences)) - say(pick(shutdownsentences)) - is_active = FALSE - stop_processing() + bot_shutdown(user) else - if(length(awakeningsentences)) - say(pick(awakeningsentences)) - is_active = TRUE - start_processing() + bot_startup(user) /obj/machinery/bot/attack_ai(mob/user) if(!alter_operating_mode) to_chat(user, "This robot has a firewall and cannot be remotely accessed.") return if(is_active) - balloon_alert_to_viewers("Powers off") - is_active = FALSE - if(deactivation_animation) - flick("[deactivation_animation]", src) - if(length(shutdownsentences)) - say(pick(shutdownsentences)) - icon_state = "[initial(icon_state)]" - stop_processing() + bot_shutdown(user) else - balloon_alert_to_viewers("Powers on") - is_active = TRUE - if(activation_animation) - flick("[activation_animation]", src) - if(length(awakeningsentences)) - say(pick(awakeningsentences)) + bot_startup(user) + +/obj/machinery/bot/proc/bot_shutdown(mob/living/user) + icon_state = "[initial(icon_state)]" + balloon_alert_to_viewers("Powers off") + if(deactivation_animation) + flick("[deactivation_animation]", src) + if(length(shutdownsentences)) + say(pick(shutdownsentences)) + is_active = FALSE + stop_processing() + +/obj/machinery/bot/proc/bot_startup(mob/living/user) + icon_state = active_icon_state + balloon_alert_to_viewers("Powers on") + if(activation_animation) + flick("[activation_animation]", src) + if(length(awakeningsentences)) say(pick(awakeningsentences)) - icon_state = active_icon_state - start_processing() + is_active = TRUE + start_processing() -//these bots are mostly for decoration, you can't turn them on by default +//these bots are mostly for decoration, you can't turn them on and they have no behavior aside from randomly moving /obj/machinery/bot/medbot name = "Medibot" desc = "A little medical robot. He looks somewhat underwhelmed." diff --git a/code/game/objects/machinery/bots/cleanbot.dm b/code/game/objects/machinery/bots/cleanbot.dm index f8b53f707c031..bb402125e8f98 100755 --- a/code/game/objects/machinery/bots/cleanbot.dm +++ b/code/game/objects/machinery/bots/cleanbot.dm @@ -1,7 +1,7 @@ /// A medical bot designed to clean up blood and other trash that accumulates in medbay /obj/machinery/bot/cleanbot name = "Nanotrasen cleanbot" - desc = "A robot cleaning automaton, an offshoot of the trash-cleaning roomba . The cleanbot is designed to clean dirt and blood from floors, and thankfully it does not touch items. It has an off and on switch." + desc = "A robot cleaning automaton, an offshoot of the trash-cleaning roomba. The cleanbot is designed to clean dirt and blood from floors, and thankfully it does not touch items. It has an off and on switch." icon = 'icons/obj/aibots.dmi' icon_state = "cleanbot0" density = FALSE @@ -146,6 +146,7 @@ /obj/machinery/bot/cleanbot/proc/clean(atom/movable/O as obj|mob) var/turf/currentturf = get_turf(src) if(istype(O, /obj/effect/decal/cleanable)) + playsound(loc, 'sound/effects/slosh.ogg', 25, 1) currentturf.wet_floor() flick("cleanbot-c", src) ++counter @@ -153,6 +154,7 @@ say(pick(sentences)) qdel(O) else if(istype(O, /obj/item/trash) || istype(O, /obj/item/shard) || istype(O, /obj/item/ammo_casing) || istype(O, /obj/effect/turf_decal/tracks/wheels/bloody)) + playsound(loc, 'sound/effects/slosh.ogg', 25, 1) currentturf.wet_floor() flick("cleanbot-c", src) ++counter @@ -161,3 +163,7 @@ qdel(O) else O.clean_blood() + +/obj/machinery/bot/cleanbot/Destroy() + . = ..() + UnregisterSignal(src, COMSIG_MOVABLE_MOVED) diff --git a/code/game/objects/machinery/bots/roomba.dm b/code/game/objects/machinery/bots/roomba.dm index e4dbb0e64be36..6d32b6f20a48c 100755 --- a/code/game/objects/machinery/bots/roomba.dm +++ b/code/game/objects/machinery/bots/roomba.dm @@ -121,3 +121,7 @@ if(sucked.stat != CONSCIOUS) qdel(sucked) counter++ + +/obj/machinery/bot/roomba/Destroy() + . = ..() + UnregisterSignal(src, COMSIG_MOVABLE_MOVED)