diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 8e2205bc8dd..9a0ef0460a3 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -618,3 +618,6 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define INTENT_GRAB "grab" #define INTENT_DISARM "disarm" #define INTENT_HARM "harm" +// NOTE: This is not a real intent! It's used to allow +// the alternate intent selection stlye (clockwise) +#define INTENT_NEXT "next" diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index e37ffdb8378..af5acd416c0 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -201,7 +201,7 @@ usr.a_intent_change(INTENT_DISARM) else - usr.a_intent_change("right") + usr.a_intent_change(INTENT_NEXT) /obj/screen/act_intent/alien icon = 'icons/mob/screen_alien.dmi' @@ -649,4 +649,3 @@ if(word_messages.len && talk_cooldown < world.time) talk_cooldown = world.time + 10 L.say(pick(word_messages)) - diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index bf6686b1e93..1bb16d72502 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -280,29 +280,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return 1 return 0 -//converts intent-strings into numbers and back -/proc/intent_numeric(argument) - if(istext(argument)) - switch(argument) - if(INTENT_HELP) - return 0 - if(INTENT_DISARM) - return 1 - if(INTENT_GRAB) - return 2 - else - return 3 - else - switch(argument) - if(0) - return INTENT_HELP - if(1) - return INTENT_DISARM - if(2) - return INTENT_GRAB - else - return INTENT_HARM - //change a mob's act-intent. Input the intent as a string such as "help" or use "right"/"left /mob/verb/a_intent_change(input as text) set name = "a-intent" @@ -312,10 +289,16 @@ It's fairly easy to fix if dealing with single letters but not so much with comp switch(input) if(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM) a_intent = input - if("right") - a_intent = intent_numeric((intent_numeric(a_intent) + 1) % 4) - if("left") - a_intent = intent_numeric((intent_numeric(a_intent) + 3) % 4) + if(INTENT_NEXT) + switch (a_intent) + if(INTENT_HELP) + a_intent = INTENT_DISARM + if(INTENT_DISARM) + a_intent = INTENT_GRAB + if(INTENT_GRAB) + a_intent = INTENT_HARM + if(INTENT_HARM) + a_intent = INTENT_HELP if(hud_used && hud_used.action_intent) hud_used.action_intent.icon_state = "[a_intent]" @@ -326,8 +309,16 @@ It's fairly easy to fix if dealing with single letters but not so much with comp a_intent = INTENT_HELP if(INTENT_HARM) a_intent = INTENT_HARM - if("right","left") - a_intent = intent_numeric(intent_numeric(a_intent) - 3) + if(INTENT_NEXT) + switch (a_intent) + if(INTENT_HELP) + a_intent = INTENT_DISARM + if(INTENT_DISARM) + a_intent = INTENT_GRAB + if(INTENT_GRAB) + a_intent = INTENT_HARM + if(INTENT_HARM) + a_intent = INTENT_HELP if(hud_used && hud_used.action_intent) hud_used.action_intent.icon_state = "[a_intent]"