diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index dbc8ef85b17..0f05c0fe12b 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -79,6 +79,8 @@ #define COMSIG_KB_SILICON_TOGGLEMODULETWO_DOWN "keybinding_silicon_togglemoduletwo_down" #define COMSIG_KB_SILICON_TOGGLEMODULETHREE_DOWN "keybinding_silicon_togglemodulethree_down" #define COMSIG_KB_SILICON_UNEQUIPMODULE_DOWN "keybinding_silicon_unequipmodule_down" +#define COMSIG_KB_SILION_UNDEPLOY_DOWN "keybinding_silicon_undeploy_down" +#define COMSIG_KB_SILICON_RECONNECT_DOWN "keybinding_silicon_reconnect_down" //Movement #define COMSIG_KB_MOVEMENT_NORTH_DOWN "keybinding_movement_north_down" diff --git a/code/datums/keybinding/_defines.dm b/code/datums/keybinding/_defines.dm index 7d4ae382227..5f0bbae164b 100644 --- a/code/datums/keybinding/_defines.dm +++ b/code/datums/keybinding/_defines.dm @@ -5,6 +5,7 @@ #define CATEGORY_CARBON "CARBON" #define CATEGORY_HUMAN "HUMAN" #define CATEGORY_ROBOT "ROBOT" +#define CATEGORY_AI "AI" #define CATEGORY_MISC "MISC" #define CATEGORY_MOVEMENT "MOVEMENT" #define CATEGORY_COMMUNICATION "COMMUNICATION" @@ -17,4 +18,5 @@ #define WEIGHT_LIVING 50 #define WEIGHT_DEAD 60 #define WEIGHT_EMOTE 70 +#define WEIGHT_AI 80 #define WEIGHT_LOWEST 999 diff --git a/code/datums/keybinding/artificial_intelligence.dm b/code/datums/keybinding/artificial_intelligence.dm new file mode 100644 index 00000000000..c7430c237c6 --- /dev/null +++ b/code/datums/keybinding/artificial_intelligence.dm @@ -0,0 +1,21 @@ +/datum/keybinding/artificial_intelligence + category = CATEGORY_AI + weight = WEIGHT_AI + +/datum/keybinding/artificial_intelligence/can_use(client/user) + return isAI(user.mob) + +/datum/keybinding/artificial_intelligence/reconnect + hotkey_keys = list("-") + name = "reconnect" + full_name = "Reconnect to shell" + description = "Reconnects you to your most recently used AI shell" + keybind_signal = COMSIG_KB_SILICON_RECONNECT_DOWN + +/datum/keybinding/artificial_intelligence/reconnect/down(client/user) + . = ..() + if(.) + return + var/mob/living/silicon/ai/our_ai = user.mob + our_ai.deploy_to_shell(our_ai.redeploy_action.last_used_shell) + return TRUE diff --git a/code/datums/keybinding/robot.dm b/code/datums/keybinding/robot.dm index de941732275..3aac0deac96 100644 --- a/code/datums/keybinding/robot.dm +++ b/code/datums/keybinding/robot.dm @@ -64,3 +64,22 @@ var/mob/living/silicon/robot/R = user.mob R.uneq_active() return TRUE + +/datum/keybinding/robot/undeploy + category = CATEGORY_AI + hotkey_keys = list("=") + name = "undeploy" + full_name = "Disconnect from shell" + description = "Returns you to your AI core" + keybind_signal = COMSIG_KB_SILION_UNDEPLOY_DOWN + +/datum/keybinding/robot/undeploy/down(client/user) + . = ..() + if(.) + return + var/mob/living/silicon/robot/shell/our_shell = user.mob + //We make sure our shell is actually a shell + if(our_shell.shell == FALSE) + return + our_shell.undeploy() + return TRUE diff --git a/tgstation.dme b/tgstation.dme index 17acf43b94a..a7ec88805ad 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1323,6 +1323,7 @@ #include "code\datums\keybinding\_defines.dm" #include "code\datums\keybinding\_keybindings.dm" #include "code\datums\keybinding\admin.dm" +#include "code\datums\keybinding\artificial_intelligence.dm" #include "code\datums\keybinding\carbon.dm" #include "code\datums\keybinding\client.dm" #include "code\datums\keybinding\communication.dm"