From 1c585d8275d43ab5e0b513a1f8f0b6b853c1855a Mon Sep 17 00:00:00 2001 From: Eman Date: Fri, 12 Jul 2019 14:27:48 +0200 Subject: [PATCH] AI can now change its intent By pressing four or clicking on the on-screen object, the AI can now change its intent. This is only useful (for now) for when the AI is controlling a mech, as it can now punch people instead of pushing them. --- code/_onclick/hud/ai.dm | 8 +++++++- code/_onclick/hud/screen_objects.dm | 3 +++ code/modules/keybindings/bindings_ai.dm | 6 ++++++ code/modules/mob/mob_helpers.dm | 2 +- paradise.dme | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 code/modules/keybindings/bindings_ai.dm diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index 0b1a6d1c6c4..dc98d887279 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -256,4 +256,10 @@ //Add multicamera camera using = new /obj/screen/ai/add_multicam() using.screen_loc = ui_ai_add_multicam - static_inventory += using \ No newline at end of file + static_inventory += using + +//Intent + using = new /obj/screen/act_intent/robot/AI() + using.icon_state = mymob.a_intent + static_inventory += using + action_intent = using \ No newline at end of file diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 91c8d6250b4..a0274c30616 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -95,6 +95,9 @@ icon = 'icons/mob/screen_robot.dmi' screen_loc = ui_borg_intents +/obj/screen/act_intent/robot/AI + screen_loc = "EAST-1:32,SOUTH:70" + /obj/screen/mov_intent name = "run/walk toggle" icon_state = "running" diff --git a/code/modules/keybindings/bindings_ai.dm b/code/modules/keybindings/bindings_ai.dm new file mode 100644 index 00000000000..b496f3521f9 --- /dev/null +++ b/code/modules/keybindings/bindings_ai.dm @@ -0,0 +1,6 @@ +/mob/living/silicon/ai/key_down(_key, client/user) + switch(_key) + if("4") + a_intent_change(INTENT_HOTKEY_LEFT) + return + return ..() \ No newline at end of file diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a26131b9504..791f9bb8eed 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -369,7 +369,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) if(hud_used && hud_used.action_intent) hud_used.action_intent.icon_state = "[a_intent]" - else if(isrobot(src) || islarva(src) || isanimal(src)) + else if(isrobot(src) || islarva(src) || isanimal(src) || isAI(src)) switch(input) if(INTENT_HELP) a_intent = INTENT_HELP diff --git a/paradise.dme b/paradise.dme index aa90c6b58b7..47c1f439140 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1590,6 +1590,7 @@ #include "code\modules\hydroponics\grown\towercap.dm" #include "code\modules\karma\karma.dm" #include "code\modules\keybindings\bindings_admin.dm" +#include "code\modules\keybindings\bindings_ai.dm" #include "code\modules\keybindings\bindings_atom.dm" #include "code\modules\keybindings\bindings_carbon.dm" #include "code\modules\keybindings\bindings_client.dm"