basic cleanbots refactor and new janitor skillchip (#80128)

## About The Pull Request
this pr refacotrs cleanbots into basic bots. also adds a new skillchip
for janitrs. this skillchip will allow janitors to communicate with
cleanbots and order them around, like pointing at something and telling
them to clean it. also now the cleanbot has an inbuilt mop which it will
use to smack mice and cockroaches

## Why It's Good For The Game
refactors cleanbots into basic bots and fixes them getting stuck
sometimes while patrolling. also janitors being able to order them
around can make them a bit more useful as tools for the janitor

## Changelog
🆑
refactor: cleanbots are refactored into basic bots. please report all
bugs
fix: fixes cleanbots getting stuck sometimes while patrolling
add: janitors get a new skillchip which allow them to communicate with
cleanbots
/🆑
This commit is contained in:
Ben10Omintrix
2023-12-08 16:26:10 -07:00
committed by GitHub
parent 77c891a2d0
commit af67bd7490
34 changed files with 768 additions and 534 deletions
+26 -21
View File
@@ -80,6 +80,12 @@ GLOBAL_LIST_INIT(command_strings, list(
var/datum/action/cooldown/bot_announcement/pa_system
/// Type of bot_announcement ability we want
var/announcement_type
///list of traits we apply and remove when turning on/off
var/static/list/on_toggle_traits = list(
TRAIT_INCAPACITATED,
TRAIT_IMMOBILIZED,
TRAIT_HANDS_BLOCKED,
)
/// If true we will offer this
COOLDOWN_DECLARE(offer_ghosts_cooldown)
@@ -167,7 +173,7 @@ GLOBAL_LIST_INIT(command_strings, list(
/mob/living/basic/bot/proc/turn_off()
bot_mode_flags &= ~BOT_MODE_ON
add_traits(list(TRAIT_INCAPACITATED, TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), POWER_LACK_TRAIT)
add_traits(on_toggle_traits, POWER_LACK_TRAIT)
set_light_on(bot_mode_flags & BOT_MODE_ON ? TRUE : FALSE)
bot_reset() //Resets an AI's call, should it exist.
balloon_alert(src, "turned off")
@@ -550,10 +556,8 @@ GLOBAL_LIST_INIT(command_strings, list(
if("patroloff")
bot_reset() //HOLD IT!! //OBJECTION!!
bot_mode_flags &= ~BOT_MODE_AUTOPATROL
if("patrolon")
bot_mode_flags |= BOT_MODE_AUTOPATROL
if("summon")
summon_bot(user, user_access = user_access)
if("ejectpai")
@@ -573,8 +577,8 @@ GLOBAL_LIST_INIT(command_strings, list(
data["has_access"] = check_access(user)
data["locked"] = !(bot_access_flags & BOT_CONTROL_PANEL_OPEN)
data["settings"] = list()
if(bot_access_flags & BOT_CONTROL_PANEL_OPEN || issilicon(user) || isAdminGhostAI(user))
data["settings"]["pai_inserted"] = !!paicard
if((bot_access_flags & BOT_CONTROL_PANEL_OPEN) || issilicon(user) || isAdminGhostAI(user))
data["settings"]["pai_inserted"] = !isnull(paicard)
data["settings"]["allow_possession"] = bot_mode_flags & BOT_MODE_CAN_BE_SAPIENT
data["settings"]["possession_enabled"] = can_be_possessed
data["settings"]["airplane_mode"] = !(bot_mode_flags & BOT_MODE_REMOTE_ENABLED)
@@ -584,12 +588,13 @@ GLOBAL_LIST_INIT(command_strings, list(
return data
// Actions received from TGUI
/mob/living/basic/bot/ui_act(action, params)
/mob/living/basic/bot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
if(. || !isliving(ui.user))
return
if(!check_access(usr))
to_chat(usr, span_warning("Access denied."))
var/mob/living/the_user = ui.user
if(!check_access(the_user))
balloon_alert(the_user, "access denied!")
return
if(action == "lock")
@@ -609,39 +614,39 @@ GLOBAL_LIST_INIT(command_strings, list(
if("airplane")
bot_mode_flags ^= BOT_MODE_REMOTE_ENABLED
if("hack")
if(!(issilicon(usr) || isAdminGhostAI(usr)))
if(!(issilicon(the_user) || isAdminGhostAI(the_user)))
return
if(!(bot_access_flags & BOT_COVER_EMAGGED))
bot_access_flags |= (BOT_COVER_EMAGGED|BOT_COVER_HACKED)
bot_access_flags &= ~BOT_CONTROL_PANEL_OPEN
to_chat(usr, span_warning("You overload [src]'s [hackables]."))
message_admins("Safety lock of [ADMIN_LOOKUPFLW(src)] was disabled by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_VERBOSEJMP(src)]")
usr.log_message("disabled safety lock of [src]", LOG_GAME)
to_chat(the_user, span_warning("You overload [src]'s [hackables]."))
message_admins("Safety lock of [ADMIN_LOOKUPFLW(src)] was disabled by [ADMIN_LOOKUPFLW(the_user)] in [ADMIN_VERBOSEJMP(the_user)]")
the_user.log_message("disabled safety lock of [the_user]", LOG_GAME)
bot_reset()
to_chat(src, span_userdanger("(#$*#$^^( OVERRIDE DETECTED"))
to_chat(src, span_boldnotice(get_emagged_message()))
return
if(!(bot_access_flags & BOT_COVER_HACKED))
to_chat(usr, span_boldannounce("You fail to repair [src]'s [hackables]."))
to_chat(the_user, span_boldannounce("You fail to repair [src]'s [hackables]."))
return
bot_access_flags &= ~(BOT_COVER_EMAGGED|BOT_COVER_HACKED)
to_chat(usr, span_notice("You reset the [src]'s [hackables]."))
usr.log_message("re-enabled safety lock of [src]", LOG_GAME)
to_chat(the_user, span_notice("You reset the [src]'s [hackables]."))
the_user.log_message("re-enabled safety lock of [src]", LOG_GAME)
bot_reset()
to_chat(src, span_userdanger("Software restored to standard."))
to_chat(src, span_boldnotice(possessed_message))
if("eject_pai")
if(!paicard)
return
to_chat(usr, span_notice("You eject [paicard] from [initial(src.name)]."))
ejectpai(usr)
to_chat(the_user, span_notice("You eject [paicard] from [initial(src.name)]."))
ejectpai(the_user)
if("toggle_personality")
if (can_be_possessed)
disable_possession(usr)
disable_possession(the_user)
else
enable_possession(usr)
enable_possession(the_user)
if("rename")
rename(usr)
rename(the_user)
/mob/living/basic/bot/update_icon_state()
icon_state = "[isnull(base_icon_state) ? initial(icon_state) : base_icon_state][bot_mode_flags & BOT_MODE_ON]"