diff --git a/_maps/_basemap.dm b/_maps/_basemap.dm index 213211fc42..9bb74575f0 100644 --- a/_maps/_basemap.dm +++ b/_maps/_basemap.dm @@ -1,4 +1,4 @@ -//#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it. +#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it. #include "map_files\generic\CentCom.dmm" diff --git a/code/__DEFINES/_flags/return_values.dm b/code/__DEFINES/_flags/return_values.dm index 1bcb54bdb7..80908fdc8e 100644 --- a/code/__DEFINES/_flags/return_values.dm +++ b/code/__DEFINES/_flags/return_values.dm @@ -12,6 +12,10 @@ #define NO_AUTO_CLICKDELAY_HANDLING (1<<2) /// Only used with UnarmedAttack(). Interrupts unarmed attack from progressing. #define INTERRUPT_UNARMED_ATTACK (1<<3) +/// Attack hand should not set next action even if the atom wants it to be an action +#define ATTACK_HAND_IGNORE_ACTION (1<<4) +/// Attack hand should not at all check last_action/attack_hand_speed even if the atom wants to +#define ATTACK_HAND_IGNORE_CLICKDELAY (1<<5) // UnarmedAttack() flags /// Attack is from a parry counterattack diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 362a15005c..008dd06d1e 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -34,25 +34,25 @@ return SEND_SIGNAL(src, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, A) - return . | A.attack_hand(src, intent, flags) + return . | A.attack_hand(src, intent, flags, .) -/atom/proc/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) +/atom/proc/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags, clickchain_flags) SHOULD_NOT_SLEEP(TRUE) if(!(interaction_flags_atom & INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND)) add_fingerprint(user) if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, user) & COMPONENT_NO_ATTACK_HAND) return - if(attack_hand_speed) + if(attack_hand_speed && !(clickchain_flags & ATTACK_HAND_IGNORE_CLICKDELAY)) if(!user.CheckActionCooldown(attack_hand_speed)) return if(interaction_flags_atom & INTERACT_ATOM_ATTACK_HAND) . = _try_interact(user) - on_attack_hand(user, act_intent, unarmed_attack_flags) - if(attack_hand_unwieldlyness) - user.DelayNextAction(attack_hand_unwieldlyness, considered_action = attack_hand_is_action) - else if(attack_hand_is_action) - user.DelayNextAction() - return attack_hand_is_action + INVOKE_ASYNC(src, .proc/on_attack_hand, user, act_intent, unarmed_attack_flags) + if(!(clickchain_flags & ATTACK_HAND_IGNORE_ACTION)) + if(attack_hand_unwieldlyness) + user.DelayNextAction(attack_hand_unwieldlyness, considered_action = attack_hand_is_action) + else if(attack_hand_is_action) + user.DelayNextAction() /atom/proc/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) @@ -62,7 +62,6 @@ return interact(user) if(can_interact(user)) return interact(user) - return FALSE /atom/proc/can_interact(mob/user) if(!user.can_interact_with(src)) @@ -92,8 +91,7 @@ else add_fingerprint(user) if(interaction_flags_atom & INTERACT_ATOM_UI_INTERACT) - return ui_interact(user) - return FALSE + ui_interact(user) /* /mob/living/carbon/human/RestrainedClickOn(var/atom/A) ---carbons will handle this diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm index f30fa02879..df74f8e49e 100644 --- a/code/modules/clothing/gloves/miscellaneous.dm +++ b/code/modules/clothing/gloves/miscellaneous.dm @@ -109,7 +109,7 @@ if(warcry) M.say("[warcry]", ignore_spam = TRUE, forced = TRUE) - return NO_AUTO_CLICKDELAY_HANDLING + return NO_AUTO_CLICKDELAY_HANDLING | ATTACK_HAND_IGNORE_ACTION /obj/item/clothing/gloves/fingerless/pugilist/rapid/AltClick(mob/user) var/input = stripped_input(user,"What do you want your battlecry to be? Max length of 6 characters.", ,"", 7) @@ -137,7 +137,7 @@ else M.SetNextAction(CLICK_CD_RAPID) - return NO_AUTO_CLICKDELAY_HANDLING + return NO_AUTO_CLICKDELAY_HANDLING | ATTACK_HAND_IGNORE_ACTION /obj/item/clothing/gloves/botanic_leather name = "botanist's leather gloves"