Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 8984f0f

Browse files
authored
Assorted stripping fixes (#22647)
* make monkeys strippable * prevent stripping window from duplicating * remove old unused exploitable href code * fix corgi hat stripping * sorta fixes alien/monkey stripping * Revert "sorta fixes alien/monkey stripping" This reverts commit fcf79b1. * no longer require mask if helmet support internals
1 parent 560fd05 commit 8984f0f

File tree

11 files changed

+27
-122
lines changed

11 files changed

+27
-122
lines changed

code/__DEFINES/dcs/signals/signals_object.dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
#define COMSIG_ITEM_DROPPED "item_drop"
131131
///from base of mob/dropItemToGround(): (mob/user)
132132
#define COMSIG_ITEM_PREDROPPED "item_predrop"
133-
///from base of /mob/living/stripPanelUnequip(): (obj/item/what, mob/who, where)
133+
///from base of /start_unequip_mob(): (obj/item/what, mob/who, where)
134134
#define COMSIG_ITEM_PRESTRIP "item_prestrip"
135135

136136
///from base of obj/item/pickup(): (/mob/taker)
@@ -144,25 +144,25 @@
144144
///from base of mob/living/carbon/attacked_by(): (mob/living/carbon/target, mob/living/user, hit_zone)
145145
#define COMSIG_ITEM_ATTACK_ZONE "item_attack_zone"
146146

147-
/// from /datum/component/cleave_attack/perform_sweep(): (atom/target, obj/item/item, mob/living/user, params)
147+
/// from /datum/component/cleave_attack/perform_sweep(): (atom/target, obj/item/item, mob/living/user, params)
148148
#define COMSIG_ATOM_CLEAVE_ATTACK "atom_cleave_attack"
149149
// allows cleave attack to hit things it normally wouldn't
150150
#define ATOM_ALLOW_CLEAVE_ATTACK (1<<0)
151151

152152
/// Called before an item is embedded (mob/living/carbon/target = carbon that it is getting embedded into)
153-
#define COMSIG_ITEM_EMBEDDED "mob_carbon_embedded"
153+
#define COMSIG_ITEM_EMBEDDED "mob_carbon_embedded"
154154
// Prevents the embed
155155
#define COMSIG_ITEM_BLOCK_EMBED (1 << 0)
156156

157157
/// Called before an item is removed from being embedded (mob/living/carbon/embedded = carbon that is currently embedded)
158-
#define COMSIG_ITEM_EMBED_REMOVAL "mob_carbon_embed_removal"
158+
#define COMSIG_ITEM_EMBED_REMOVAL "mob_carbon_embed_removal"
159159
// Prevents the removal of the embed
160160
#define COMSIG_ITEM_BLOCK_EMBED_REMOVAL (1 << 0)
161161
// Qdels the object when it is removed instead of droping it
162162
#define COMSIG_ITEM_QDEL_EMBED_REMOVAL (1 << 1)
163163

164164
/// Called every life tick for the embedded mob when the item is embedded (mob/living/carbon/embedded = carbon that is currently embedded)
165-
#define COMSIG_ITEM_EMBED_TICK "mob_carbon_embed_tick"
165+
#define COMSIG_ITEM_EMBED_TICK "mob_carbon_embed_tick"
166166
// Prevents the rest of the tick logic for the item from proccessing
167167
#define COMSIG_ITEM_BLOCK_EMBED_TICK (1 << 0)
168168

code/datums/elements/strippable.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
if (!isnull(should_strip_proc_path) && !call(source, should_strip_proc_path)(user))
5151
return
5252

53-
var/datum/strip_menu/strip_menu
53+
var/datum/strip_menu/strip_menu = LAZYACCESS(strip_menus, source)
5454

5555
if (isnull(strip_menu))
5656
strip_menu = new(source, src)
@@ -268,6 +268,7 @@
268268

269269
/// A utility function for `/datum/strippable_item`s to start unequipping an item from a mob.
270270
/proc/start_unequip_mob(obj/item/item, mob/source, mob/user, strip_delay)
271+
SEND_SIGNAL(item, COMSIG_ITEM_PRESTRIP, user)
271272
if (!do_after(user, strip_delay || item.strip_delay, source, interaction_key = REF(item)))
272273
return FALSE
273274

code/modules/mob/living/carbon/alien/larva/larva.dm

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,3 @@
5959
/mob/living/carbon/alien/larva/start_pulling(atom/movable/AM, state, force = move_force, supress_message = FALSE)
6060
return
6161

62-
/mob/living/carbon/alien/larva/stripPanelUnequip(obj/item/what, mob/who)
63-
to_chat(src, span_warning("You don't have the dexterity to do this!"))
64-
return
65-
66-
/mob/living/carbon/alien/larva/stripPanelEquip(obj/item/what, mob/who)
67-
to_chat(src, span_warning("You don't have the dexterity to do this!"))
68-
return

code/modules/mob/living/carbon/human/human_stripping.dm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,12 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
165165

166166
var/mob/living/carbon/carbon_source = source
167167

168-
var/obj/item/clothing/mask = carbon_source.wear_mask
169-
if (!istype(mask))
170-
return
168+
var/obj/item/clothing/head = carbon_source.head
169+
if (istype(head) && (head.clothing_flags & HEADINTERNALS) && istype(item, /obj/item/tank))
170+
return isnull(carbon_source.internal) ? "enable_internals" : "disable_internals"
171171

172-
if ((mask.clothing_flags & MASKINTERNALS) && istype(item, /obj/item/tank))
172+
var/obj/item/clothing/mask = carbon_source.wear_mask
173+
if (istype(mask) && (mask.clothing_flags & MASKINTERNALS) && istype(item, /obj/item/tank))
173174
return isnull(carbon_source.internal) ? "enable_internals" : "disable_internals"
174175

175176
/proc/strippable_alternate_action_internals(obj/item/item, atom/source, mob/user)

code/modules/mob/living/carbon/monkey/monkey.dm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
blood_volume = BLOOD_VOLUME_MONKEY // Yogs -- Makes monkeys/xenos have different amounts of blood from normal carbonbois
2222
can_be_held = TRUE
2323

24+
GLOBAL_LIST_INIT(strippable_monkey_items, create_strippable_list(list(
25+
/datum/strippable_item/mob_item_slot/head,
26+
/datum/strippable_item/mob_item_slot/back,
27+
/datum/strippable_item/mob_item_slot/mask,
28+
/datum/strippable_item/mob_item_slot/neck,
29+
/datum/strippable_item/hand/left,
30+
/datum/strippable_item/hand/right,
31+
/datum/strippable_item/mob_item_slot/handcuffs,
32+
/datum/strippable_item/mob_item_slot/legcuffs,
33+
)))
34+
2435
/mob/living/carbon/monkey/Initialize(mapload, cubespawned=FALSE, mob/spawner)
2536
add_verb(src, /mob/living/proc/mob_sleep)
2637
add_verb(src, /mob/living/proc/lay_down)
@@ -46,6 +57,7 @@
4657
create_dna(src)
4758
dna.initialize_dna(random_blood_type())
4859
AddComponent(/datum/component/bloodysoles/feet)
60+
AddElement(/datum/element/strippable, GLOB.strippable_monkey_items)
4961

5062
/mob/living/carbon/monkey/Destroy()
5163
SSmobs.cubemonkeys -= src

code/modules/mob/living/living.dm

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -877,58 +877,6 @@
877877
animate(src, pixel_y = get_standard_pixel_y_offset(lying), time = 1 SECONDS)
878878
setMovetype(movement_type & ~FLOATING)
879879

880-
// The src mob is trying to strip an item from someone
881-
// Override if a certain type of mob should be behave differently when stripping items (can't, for example)
882-
/mob/living/stripPanelUnequip(obj/item/what, mob/who, where)
883-
if(!what.canStrip(who))
884-
to_chat(src, span_warning("You can't remove \the [what.name], it appears to be stuck!"))
885-
return
886-
who.visible_message(span_danger("[src] tries to remove [who]'s [what.name]."), \
887-
span_userdanger("[src] tries to remove [who]'s [what.name]."))
888-
what.add_fingerprint(src)
889-
SEND_SIGNAL(what, COMSIG_ITEM_PRESTRIP)
890-
if(do_after(src, what.strip_delay, who, interaction_key = REF(what)))
891-
if(what && Adjacent(who))
892-
if(islist(where))
893-
var/list/L = where
894-
if(what == who.get_item_for_held_index(L[2]))
895-
if(what.doStrip(src, who))
896-
log_combat(src, who, "stripped [what] off")
897-
if(what == who.get_item_by_slot(where))
898-
if(what.doStrip(src, who))
899-
log_combat(src, who, "stripped [what] off")
900-
901-
// The src mob is trying to place an item on someone
902-
// Override if a certain mob should be behave differently when placing items (can't, for example)
903-
/mob/living/stripPanelEquip(obj/item/what, mob/who, where)
904-
what = src.get_active_held_item()
905-
if(what && (HAS_TRAIT(what, TRAIT_NODROP)))
906-
to_chat(src, span_warning("You can't put \the [what.name] on [who], it's stuck to your hand!"))
907-
return
908-
if(what)
909-
var/list/where_list
910-
var/final_where
911-
912-
if(islist(where))
913-
where_list = where
914-
final_where = where[1]
915-
else
916-
final_where = where
917-
918-
if(!what.mob_can_equip(who, src, final_where, TRUE, TRUE))
919-
to_chat(src, span_warning("\The [what.name] doesn't fit in that place!"))
920-
return
921-
922-
visible_message(span_notice("[src] tries to put [what] on [who]."))
923-
if(do_after(src, what.equip_delay_other, who))
924-
if(what && Adjacent(who) && what.mob_can_equip(who, src, final_where, TRUE, TRUE))
925-
if(temporarilyRemoveItemFromInventory(what))
926-
if(where_list)
927-
if(!who.put_in_hand(what, where_list[2]))
928-
what.forceMove(get_turf(who))
929-
else
930-
who.equip_to_slot(what, where, TRUE)
931-
932880
/mob/living/singularity_pull(S, current_size)
933881
..()
934882
if(current_size >= STAGE_SIX) //your puny magboots/wings/whatever will not save you against supermatter singularity

code/modules/mob/living/silicon/pai/pai_defense.dm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@
6363
src.visible_message(span_warning("The electrically-charged projectile disrupts [src]'s holomatrix, forcing [src] to fold in!"))
6464
. = ..(Proj)
6565

66-
/mob/living/silicon/pai/stripPanelUnequip(obj/item/what, mob/who, where) //prevents stripping
67-
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."))
68-
69-
/mob/living/silicon/pai/stripPanelEquip(obj/item/what, mob/who, where) //prevents stripping
70-
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."))
71-
7266
/mob/living/silicon/pai/ignite_mob(mob/living/silicon/pai/P)
7367
return FALSE //No we're not flammable
7468

code/modules/mob/living/silicon/silicon.dm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,6 @@
263263
/mob/living/silicon/put_in_hand_check() // This check is for borgs being able to receive items, not put them in others' hands.
264264
return 0
265265

266-
// The src mob is trying to place an item on someone
267-
// But the src mob is a silicon!! Disable.
268-
/mob/living/silicon/stripPanelEquip(obj/item/what, mob/who, slot)
269-
return 0
270-
271-
272266
/mob/living/silicon/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //Secbots won't hunt silicon units
273267
return -10
274268

code/modules/mob/living/simple_animal/friendly/dog.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ GLOBAL_LIST_INIT(strippable_corgi_items, create_strippable_list(list(
169169

170170
corgi_source.place_on_head(equipping, user)
171171

172-
/datum/strippable_item/corgi_head/finish_unequip(atom/source, obj/item/equipping, mob/user)
172+
/datum/strippable_item/corgi_head/finish_unequip(atom/source, mob/user)
173173
var/mob/living/simple_animal/pet/dog/corgi/corgi_source = source
174174
if (!istype(corgi_source))
175175
return

code/modules/mob/living/simple_animal/simple_animal.dm

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
var/music_component = null
112112
var/music_path = null
113113

114-
114+
115115

116116
/mob/living/simple_animal/Initialize(mapload)
117117
. = ..()
@@ -340,7 +340,7 @@
340340
del_on_death = FALSE
341341
qdel(src)
342342
return
343-
343+
344344
health = 0
345345
icon_state = icon_dead
346346
if(flip_on_death)
@@ -427,18 +427,6 @@
427427
return FALSE
428428
return TRUE
429429

430-
/mob/living/simple_animal/stripPanelUnequip(obj/item/what, mob/who, where)
431-
if(!canUseTopic(who, BE_CLOSE))
432-
return
433-
else
434-
..()
435-
436-
/mob/living/simple_animal/stripPanelEquip(obj/item/what, mob/who, where)
437-
if(!canUseTopic(who, BE_CLOSE))
438-
return
439-
else
440-
..()
441-
442430
/mob/living/simple_animal/update_mobility(value_otherwise = TRUE)
443431
if(IsUnconscious() || IsParalyzed() || IsStun() || IsKnockdown() || IsParalyzed() || stat || resting)
444432
drop_all_held_items()

0 commit comments

Comments
 (0)