From 1856360aca2bcd98c196b7497de9bdb223df0301 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 16 Jan 2022 23:47:49 +0100 Subject: [PATCH] [MIRROR] You can now tip borgs over [MDB IGNORE] (#10740) * You can now tip borgs over (#64097) I hate Silicon Teaches Silicon that they should still live within the Crew rather than above them, otherwise people will tip you over and no one would want to help tip you back up. The timers also, for the most part, match handcuff timers, so there's already a human counterpart of this. Even if it wasn't intentional. Changelog cl JohnFulpWillard and theOOZ qol: Tipping mobs over all runs on right click, rather than running on both right and left click. balance: You can now tip Borgs over. /cl * You can now tip borgs over Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: GoldenAlpharex --- code/datums/components/tippable.dm | 22 ++++++++--------- .../modules/mob/living/silicon/robot/robot.dm | 11 +++++++++ .../mob/living/silicon/robot/robot_defense.dm | 24 +++++++++---------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/code/datums/components/tippable.dm b/code/datums/components/tippable.dm index 191523011c6..b81013a8365 100644 --- a/code/datums/components/tippable.dm +++ b/code/datums/components/tippable.dm @@ -18,12 +18,13 @@ var/datum/callback/post_untipped_callback /datum/component/tippable/Initialize( - tip_time = 3 SECONDS, - untip_time = 1 SECONDS, - self_right_time = 60 SECONDS, - datum/callback/pre_tipped_callback, - datum/callback/post_tipped_callback, - datum/callback/post_untipped_callback) + tip_time = 3 SECONDS, + untip_time = 1 SECONDS, + self_right_time = 60 SECONDS, + datum/callback/pre_tipped_callback, + datum/callback/post_tipped_callback, + datum/callback/post_untipped_callback, +) if(!isliving(parent)) return COMPONENT_INCOMPATIBLE @@ -36,10 +37,10 @@ src.post_untipped_callback = post_untipped_callback /datum/component/tippable/RegisterWithParent() - RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND, .proc/interact_with_tippable) + RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND_SECONDARY, .proc/interact_with_tippable) /datum/component/tippable/UnregisterFromParent() - UnregisterSignal(parent, COMSIG_ATOM_ATTACK_HAND) + UnregisterSignal(parent, COMSIG_ATOM_ATTACK_HAND_SECONDARY) /datum/component/tippable/Destroy() if(pre_tipped_callback) @@ -55,9 +56,8 @@ * * source - the mob being tipped over * user - the mob interacting with source - * modifiers - list of on click modifiers (we only tip mobs over using right click!) */ -/datum/component/tippable/proc/interact_with_tippable(mob/living/source, mob/user, modifiers) +/datum/component/tippable/proc/interact_with_tippable(mob/living/source, mob/user) SIGNAL_HANDLER var/mob/living/living_user = user @@ -68,7 +68,7 @@ if(is_tipped) INVOKE_ASYNC(src, .proc/try_untip, source, user) - else if(LAZYACCESS(modifiers, RIGHT_CLICK)) + else INVOKE_ASYNC(src, .proc/try_tip, source, user) return COMPONENT_CANCEL_ATTACK_CHAIN diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 38c05dbbd78..23657cad3cd 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -4,6 +4,11 @@ spark_system.attach(src) ADD_TRAIT(src, TRAIT_CAN_STRIP, INNATE_TRAIT) + AddComponent(/datum/component/tippable, \ + tip_time = 3 SECONDS, \ + untip_time = 2 SECONDS, \ + self_right_time = 60 SECONDS, \ + post_tipped_callback = CALLBACK(src, .proc/after_tip_over)) wires = new /datum/wires/robot(src) AddElement(/datum/element/empprotection, EMP_PROTECT_WIRES) @@ -305,6 +310,12 @@ return FALSE return ..() + +/mob/living/silicon/robot/proc/after_tip_over(mob/user) + if(hat) + hat.forceMove(drop_location()) + unbuckle_all_mobs() + /mob/living/silicon/robot/proc/allowed(mob/M) //check if it doesn't require any access at all if(check_access(null)) diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index 5035055472e..73adba88e67 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -277,20 +277,20 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real return -//ATTACK HAND IGNORING PARENT RETURN VALUE /mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user, list/modifiers) add_fingerprint(user) - if(opened && !wiresexposed && !issilicon(user)) - if(cell) - cell.update_appearance() - cell.add_fingerprint(user) - user.put_in_active_hand(cell) - to_chat(user, span_notice("You remove \the [cell].")) - cell = null - update_icons() - diag_hud_set_borgcell() - else if(!opened) - ..() + if(!opened) + return ..() + if(!wiresexposed && !issilicon(user)) + if(!cell) + return + cell.update_appearance() + cell.add_fingerprint(user) + user.put_in_active_hand(cell) + to_chat(user, span_notice("You remove \the [cell].")) + cell = null + update_icons() + diag_hud_set_borgcell() /mob/living/silicon/robot/attack_hulk(mob/living/carbon/human/user) . = ..()