diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm index 15eb628df71..0c6af0d5963 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm @@ -93,7 +93,6 @@ //from base of client/MouseUp(): (/client, object, location, control, params) #define COMSIG_CLIENT_MOUSEDRAG "client_mousedrag" ///Called on user, from base of /datum/strippable_item/try_(un)equip() (atom/target, obj/item/equipping?) -///also from /mob/living/stripPanel(Un)equip)() #define COMSIG_TRY_STRIP "try_strip" #define COMPONENT_CANT_STRIP (1<<0) ///From /datum/component/creamed/Initialize() diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index 7f27bbcceae..ea57974a103 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -496,7 +496,7 @@ return min( ui_status_only_living(user, owner), ui_status_user_has_free_hands(user, owner), - ui_status_user_is_adjacent(user, owner), + ui_status_user_is_adjacent(user, owner, allow_tk = FALSE), HAS_TRAIT(user, TRAIT_CAN_STRIP) ? UI_INTERACTIVE : UI_UPDATE, max( ui_status_user_is_conscious_and_lying_down(user), diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 21976c6c9f8..8f04b809a85 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -70,14 +70,5 @@ /mob/living/carbon/alien/larva/start_pulling(atom/movable/AM, state, force = move_force, supress_message = FALSE) return -/mob/living/carbon/alien/larva/stripPanelUnequip(obj/item/what, mob/who) - to_chat(src, span_warning("You don't have the dexterity to do this!")) - return - -/mob/living/carbon/alien/larva/stripPanelEquip(obj/item/what, mob/who) - to_chat(src, span_warning("You don't have the dexterity to do this!")) - return - - /mob/living/carbon/alien/larva/canBeHandcuffed() return TRUE diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 8fbd861c9f2..9b060773507 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1004,77 +1004,6 @@ if(!was_weightless) ADD_TRAIT(src, TRAIT_MOVE_FLOATING, NO_GRAVITY_TRAIT) -// The src mob is trying to strip an item from someone -// Override if a certain type of mob should be behave differently when stripping items (can't, for example) -/mob/living/stripPanelUnequip(obj/item/what, mob/who, where) - if(SEND_SIGNAL(src, COMSIG_TRY_STRIP, who, what) & COMPONENT_CANT_STRIP) - return - if(!what.canStrip(who)) - to_chat(src, span_warning("You can't remove \the [what.name], it appears to be stuck!")) - return - who.visible_message(span_warning("[src] tries to remove [who]'s [what.name]."), \ - span_userdanger("[src] tries to remove your [what.name]."), null, null, src) - to_chat(src, span_danger("You try to remove [who]'s [what.name]...")) - log_message("[key_name(who)] is being stripped of [what] by [key_name(src)]", LOG_ATTACK, color="red") - who.log_message("[key_name(who)] is being stripped of [what] by [key_name(src)]", LOG_VICTIM, color="red", log_globally = FALSE) - what.add_fingerprint(src) - if(do_mob(src, who, what.strip_delay, interaction_key = what)) - if(what && Adjacent(who)) - if(islist(where)) - var/list/L = where - if(what == who.get_item_for_held_index(L[2])) - if(what.doStrip(src, who)) - log_message("[key_name(who)] has been stripped of [what] by [key_name(src)]", LOG_ATTACK, color="red") - who.log_message("[key_name(who)] has been stripped of [what] by [key_name(src)]", LOG_VICTIM, color="red", log_globally = FALSE) - if(what == who.get_item_by_slot(where)) - if(what.doStrip(src, who)) - log_message("[key_name(who)] has been stripped of [what] by [key_name(src)]", LOG_ATTACK, color="red") - who.log_message("[key_name(who)] has been stripped of [what] by [key_name(src)]", LOG_VICTIM, color="red", log_globally = FALSE) - -// The src mob is trying to place an item on someone -// Override if a certain mob should be behave differently when placing items (can't, for example) -/mob/living/stripPanelEquip(obj/item/what, mob/who, where) - what = src.get_active_held_item() - if(!what || (SEND_SIGNAL(src, COMSIG_TRY_STRIP, who, what) & COMPONENT_CANT_STRIP)) - return - if(HAS_TRAIT(what, TRAIT_NODROP)) - to_chat(src, span_warning("You can't put \the [what.name] on [who], it's stuck to your hand!")) - return - if(what) - var/list/where_list - var/final_where - - if(islist(where)) - where_list = where - final_where = where[1] - else - final_where = where - - if(!what.mob_can_equip(who, src, final_where, TRUE, TRUE)) - to_chat(src, span_warning("\The [what.name] doesn't fit in that place!")) - return - if(istype(what,/obj/item/clothing)) - var/obj/item/clothing/c = what - if(c.clothing_flags & DANGEROUS_OBJECT) - who.visible_message(span_danger("[src] tries to put [what] on [who]."), \ - span_userdanger("[src] tries to put [what] on you."), null, null, src) - else - who.visible_message(span_notice("[src] tries to put [what] on [who]."), \ - span_notice("[src] tries to put [what] on you."), null, null, src) - to_chat(src, span_notice("You try to put [what] on [who]...")) - log_message("[key_name(who)] is having [what] put on them by [key_name(src)]", LOG_ATTACK, color="red") - who.log_message("[key_name(who)] is having [what] put on them by [key_name(src)]", LOG_VICTIM, color="red", log_globally=FALSE) - if(do_mob(src, who, what.equip_delay_other)) - if(what && Adjacent(who) && what.mob_can_equip(who, src, final_where, TRUE, TRUE)) - if(temporarilyRemoveItemFromInventory(what)) - if(where_list) - if(!who.put_in_hand(what, where_list[2])) - what.forceMove(get_turf(who)) - else - who.equip_to_slot(what, where, TRUE) - log_message("[key_name(who)] had [what] put on them by [key_name(src)]", LOG_ATTACK, color="red") - who.log_message("[key_name(who)] had [what] put on them by [key_name(src)]", LOG_VICTIM, color="red", log_globally = FALSE) - /mob/living/singularity_pull(S, current_size) ..() if(move_resist == INFINITY) diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm index 27bb9f1c59e..6a4263fd56c 100644 --- a/code/modules/mob/living/silicon/pai/pai_defense.dm +++ b/code/modules/mob/living/silicon/pai/pai_defense.dm @@ -61,12 +61,6 @@ src.visible_message(span_warning("The electrically-charged projectile disrupts [src]'s holomatrix, forcing [src] to fold in!")) . = ..(Proj) -/mob/living/silicon/pai/stripPanelUnequip(obj/item/what, mob/who, where) //prevents stripping - to_chat(src, span_warning("Your holochassis stutters and warps intensely as you attempt to interact with the object, forcing you to cease lest the field fail.")) - -/mob/living/silicon/pai/stripPanelEquip(obj/item/what, mob/who, where) //prevents stripping - to_chat(src, span_warning("Your holochassis stutters and warps intensely as you attempt to interact with the object, forcing you to cease lest the field fail.")) - /mob/living/silicon/pai/IgniteMob(mob/living/silicon/pai/P) return FALSE //No we're not flammable diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 2c96a5de828..42edfe81672 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -332,12 +332,6 @@ /mob/living/silicon/put_in_hand_check() // This check is for borgs being able to receive items, not put them in others' hands. return FALSE -// The src mob is trying to place an item on someone -// But the src mob is a silicon!! Disable. -/mob/living/silicon/stripPanelEquip(obj/item/what, mob/who, slot) - return FALSE - - /mob/living/silicon/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //Secbots won't hunt silicon units return -10 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 4e4d0048d3d..6b5d80ea5c1 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -534,19 +534,6 @@ if(target) return new childspawn(target) -/mob/living/simple_animal/stripPanelUnequip(obj/item/what, mob/who, where) - if(!canUseTopic(who, BE_CLOSE)) - return - else - ..() - -/mob/living/simple_animal/stripPanelEquip(obj/item/what, mob/who, where) - if(!canUseTopic(who, BE_CLOSE)) - return - else - ..() - - /mob/living/simple_animal/update_resting() if(resting) ADD_TRAIT(src, TRAIT_IMMOBILIZED, RESTING_TRAIT) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 3d7145f32d0..092acbbd44e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -736,39 +736,11 @@ * * handles the strip panel equip and unequip as well if "item" sent */ /mob/Topic(href, href_list) - var/mob/user = usr - if(href_list["mach_close"]) var/t1 = text("window=[href_list["mach_close"]]") unset_machine() src << browse(null, t1) - if(user != src) - if(href_list["item"] && user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY)) - var/slot = text2num(href_list["item"]) - var/hand_index = text2num(href_list["hand_index"]) - var/obj/item/what - if(hand_index) - what = get_item_for_held_index(hand_index) - slot = list(slot,hand_index) - else - what = get_item_by_slot(slot) - if(what) - if(!(what.item_flags & ABSTRACT)) - user.stripPanelUnequip(what,src,slot) - else - user.stripPanelEquip(what,src,slot) - -// The src mob is trying to strip an item from someone -// Defined in living.dm -/mob/proc/stripPanelUnequip(obj/item/what, mob/who) - return - -// The src mob is trying to place an item on someone -// Defined in living.dm -/mob/proc/stripPanelEquip(obj/item/what, mob/who) - return - /** * Controls if a mouse drop succeeds (return null if it doesnt) */ diff --git a/code/modules/tgui/states.dm b/code/modules/tgui/states.dm index 2c8c5ce10a4..88861aadfa9 100644 --- a/code/modules/tgui/states.dm +++ b/code/modules/tgui/states.dm @@ -100,7 +100,7 @@ * * return UI_state The state of the UI. */ -/mob/living/proc/shared_living_ui_distance(atom/movable/src_object, viewcheck = TRUE) +/mob/living/proc/shared_living_ui_distance(atom/movable/src_object, viewcheck = TRUE, allow_tk = TRUE) // If the object is obscured, close it. if(viewcheck && !(src_object in view(src))) return UI_CLOSE @@ -117,7 +117,7 @@ // Otherwise, we got nothing. return UI_CLOSE -/mob/living/carbon/human/shared_living_ui_distance(atom/movable/src_object, viewcheck = TRUE) - if(dna.check_mutation(TK) && tkMaxRangeCheck(src, src_object)) +/mob/living/carbon/human/shared_living_ui_distance(atom/movable/src_object, viewcheck = TRUE, allow_tk = TRUE) + if(allow_tk && dna.check_mutation(TK) && tkMaxRangeCheck(src, src_object)) return UI_INTERACTIVE return ..() diff --git a/code/modules/tgui/status_composers.dm b/code/modules/tgui/status_composers.dm index 023292199eb..c4bbb3e7bfc 100644 --- a/code/modules/tgui/status_composers.dm +++ b/code/modules/tgui/status_composers.dm @@ -15,10 +15,10 @@ /// far away users will be able to see, and anyone farther won't see anything. /// Dead users will receive updates no matter what, though you likely want to add /// a [`ui_status_only_living`] check for finer observer interactions. -/proc/ui_status_user_is_adjacent(mob/user, atom/source) +/proc/ui_status_user_is_adjacent(mob/user, atom/source, allow_tk = TRUE) if (isliving(user)) var/mob/living/living_user = user - return living_user.shared_living_ui_distance(source) + return living_user.shared_living_ui_distance(source, allow_tk = allow_tk) else return UI_UPDATE