Skip to content

Commit

Permalink
misc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
RipGrayson committed Sep 27, 2023
1 parent e3a9962 commit 41e91c1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
53 changes: 26 additions & 27 deletions code/game/objects/machinery/bots/bots.dm
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -26,7 +26,6 @@
///icon to set while active
var/active_icon_state = null


/obj/machinery/bot/Initialize(mapload)
. = ..()
if(SStts.tts_enabled)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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."
Expand Down
8 changes: 7 additions & 1 deletion code/game/objects/machinery/bots/cleanbot.dm
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -146,13 +146,15 @@
/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
if(prob(15))
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
Expand All @@ -161,3 +163,7 @@
qdel(O)
else
O.clean_blood()

/obj/machinery/bot/cleanbot/Destroy()
. = ..()
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)
4 changes: 4 additions & 0 deletions code/game/objects/machinery/bots/roomba.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@
if(sucked.stat != CONSCIOUS)
qdel(sucked)
counter++

/obj/machinery/bot/roomba/Destroy()
. = ..()
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)

0 comments on commit 41e91c1

Please sign in to comment.