-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathcarbon_stripping.dm
143 lines (103 loc) · 3.59 KB
/
carbon_stripping.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/datum/strippable_item/mob_item_slot/head
key = STRIPPABLE_ITEM_HEAD
item_slot = ITEM_SLOT_HEAD
/datum/strippable_item/mob_item_slot/back
key = STRIPPABLE_ITEM_BACK
item_slot = ITEM_SLOT_BACK
/datum/strippable_item/mob_item_slot/back/get_alternate_action(atom/source, mob/user)
. = ..()
if (.)
return
return get_strippable_alternate_action_internals(get_item(source), source)
/datum/strippable_item/mob_item_slot/back/alternate_action(atom/source, mob/user)
. = ..()
if (.)
return
return strippable_alternate_action_internals(get_item(source), source, user)
/datum/strippable_item/mob_item_slot/mask
key = STRIPPABLE_ITEM_MASK
item_slot = ITEM_SLOT_MASK
/datum/strippable_item/mob_item_slot/neck
key = STRIPPABLE_ITEM_NECK
item_slot = ITEM_SLOT_NECK
/datum/strippable_item/mob_item_slot/handcuffs
key = STRIPPABLE_ITEM_HANDCUFFS
item_slot = ITEM_SLOT_HANDCUFFED
/datum/strippable_item/mob_item_slot/handcuffs/should_show(atom/source, mob/user)
if (!iscarbon(source))
return FALSE
var/mob/living/carbon/carbon_source = source
return !isnull(carbon_source.handcuffed)
// You shouldn't be able to equip things to handcuff slots.
/datum/strippable_item/mob_item_slot/handcuffs/try_equip(atom/source, obj/item/equipping, mob/user)
return FALSE
/datum/strippable_item/mob_item_slot/legcuffs
key = STRIPPABLE_ITEM_LEGCUFFS
item_slot = ITEM_SLOT_LEGCUFFED
/datum/strippable_item/mob_item_slot/legcuffs/should_show(atom/source, mob/user)
if (!iscarbon(source))
return FALSE
var/mob/living/carbon/carbon_source = source
return !isnull(carbon_source.legcuffed)
// You shouldn't be able to equip things to legcuff slots.
/datum/strippable_item/mob_item_slot/legcuffs/try_equip(atom/source, obj/item/equipping, mob/user)
return FALSE
/// A strippable item for a hand
/datum/strippable_item/hand
// Putting dangerous clothing in our hand is fine.
warn_dangerous_clothing = FALSE
/// Which hand?
var/hand_index
/datum/strippable_item/hand/get_item(atom/source)
if (!ismob(source))
return null
var/mob/mob_source = source
return mob_source.get_item_for_held_index(hand_index)
/datum/strippable_item/hand/try_equip(atom/source, obj/item/equipping, mob/user)
. = ..()
if (!.)
return FALSE
if (!ismob(source))
return FALSE
var/mob/mob_source = source
if (!mob_source.can_put_in_hand(equipping, hand_index))
to_chat(src, "<span class='warning'>\The [equipping] doesn't fit in that place!</span>")
return FALSE
return TRUE
/datum/strippable_item/hand/start_equip(atom/source, obj/item/equipping, mob/user)
. = ..()
if (!.)
return
if (!ismob(source))
return FALSE
var/mob/mob_source = source
if (!do_after(user, equipping.equip_delay_other, source))
return FALSE
if (!mob_source.can_put_in_hand(equipping, hand_index))
return FALSE
if (!user.temporarilyRemoveItemFromInventory(equipping))
return FALSE
return TRUE
/datum/strippable_item/hand/finish_equip(atom/source, obj/item/equipping, mob/user)
if (!iscarbon(source))
return FALSE
var/mob/mob_source = source
mob_source.put_in_hand(equipping, hand_index)
/datum/strippable_item/hand/start_unequip(atom/source, mob/user)
. = ..()
if (!.)
return
return start_unequip_mob(get_item(source), source, user)
/datum/strippable_item/hand/finish_unequip(atom/source, mob/user, place_in_hand = FALSE)
var/obj/item/item = get_item(source)
if (isnull(item))
return FALSE
if (!ismob(source))
return FALSE
return finish_unequip_mob(item, source, user, place_in_hand)
/datum/strippable_item/hand/left
key = STRIPPABLE_ITEM_LHAND
hand_index = 1
/datum/strippable_item/hand/right
key = STRIPPABLE_ITEM_RHAND
hand_index = 2