/
transform.dm
196 lines (167 loc) · 5.85 KB
/
transform.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/datum/action/changeling/transform
name = "Transform"
desc = "We take on the appearance and voice of one we have absorbed. Costs 5 chemicals."
button_icon_state = "transform"
chemical_cost = 5
dna_cost = CHANGELING_POWER_INNATE
req_dna = 1
req_human = TRUE
/obj/item/clothing/glasses/changeling
name = "flesh"
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/glasses/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/clothing/under/changeling
name = "flesh"
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/under/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/clothing/suit/changeling
name = "flesh"
allowed = list(/obj/item/changeling)
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/suit/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/clothing/head/changeling
name = "flesh"
icon_state = null
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/head/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/clothing/shoes/changeling
name = "flesh"
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/shoes/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/clothing/gloves/changeling
name = "flesh"
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/gloves/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/clothing/mask/changeling
name = "flesh"
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/clothing/mask/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/changeling
name = "flesh"
slot_flags = ALL
item_flags = DROPDEL
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/changeling/attack_hand(mob/user, list/modifiers)
if(loc == user && IS_CHANGELING(user))
to_chat(user, span_notice("You reabsorb [src] into your body."))
qdel(src)
return
. = ..()
/obj/item/changeling/id
slot_flags = ITEM_SLOT_ID
/// Cached flat icon of the ID
var/icon/cached_flat_icon
/// HUD job icon of the ID
var/hud_icon
/obj/item/changeling/id/equipped(mob/user, slot, initial)
. = ..()
if(hud_icon)
var/image/holder = user.hud_list[ID_HUD]
var/icon/I = icon(user.icon, user.icon_state, user.dir)
holder.pixel_y = I.Height() - world.icon_size
holder.icon_state = hud_icon
/**
* Returns cached flat icon of the ID, creates one if there is not one already cached
*/
/obj/item/changeling/id/proc/get_cached_flat_icon()
if(!cached_flat_icon)
cached_flat_icon = getFlatIcon(src)
cached_flat_icon.Crop(ID_ICON_BORDERS)
return cached_flat_icon
/obj/item/changeling/id/get_id_examine_strings(mob/user)
. = ..()
. += list("[icon2html(get_cached_flat_icon(), user, extra_classes = "bigicon")]")
/obj/item/changeling/id/get_examine_string(mob/user, thats = FALSE)
return "[icon2html(get_cached_flat_icon(), user)] [thats? "That's ":""][get_examine_name(user)]" //displays all overlays in chat
//Change our DNA to that of somebody we've absorbed.
/datum/action/changeling/transform/sting_action(mob/living/carbon/human/user)
var/datum/antagonist/changeling/changeling = IS_CHANGELING(user)
var/datum/changeling_profile/chosen_prof = changeling.select_dna()
if(!chosen_prof)
return
..()
changeling.transform(user, chosen_prof)
SEND_SIGNAL(user, COMSIG_CHANGELING_TRANSFORM)
return TRUE
/**
* Gives a changeling a list of all possible dnas in their profiles to choose from and returns profile containing their chosen dna
*/
/datum/antagonist/changeling/proc/select_dna()
var/mob/living/carbon/user = owner.current
if(!istype(user))
return
var/list/disguises = list("Drop Flesh Disguise" = image(icon = 'icons/hud/radial.dmi', icon_state = "radial_drop"))
for(var/datum/changeling_profile/current_profile as anything in stored_profiles)
var/datum/icon_snapshot/snap = current_profile.profile_snapshot
var/image/disguise_image = image(icon = snap.icon, icon_state = snap.icon_state)
disguise_image.overlays = snap.overlays
disguises[current_profile.name] = disguise_image
var/chosen_name = show_radial_menu(user, user, disguises, custom_check = CALLBACK(src, PROC_REF(check_menu), user), radius = 40, require_near = TRUE, tooltips = TRUE)
if(!chosen_name)
return
if(chosen_name == "Drop Flesh Disguise")
for(var/slot in slot2type)
if(istype(user.vars[slot], slot2type[slot]))
qdel(user.vars[slot])
for(var/i in user.all_scars)
var/datum/scar/iter_scar = i
if(iter_scar.fake)
qdel(iter_scar)
return
var/datum/changeling_profile/prof = get_dna(chosen_name)
return prof
/**
* Checks if we are allowed to interact with a radial menu
*
* Arguments:
* * user The carbon mob interacting with the menu
*/
/datum/antagonist/changeling/proc/check_menu(mob/living/carbon/user)
if(!istype(user))
return FALSE
var/datum/antagonist/changeling/changeling_datum = IS_CHANGELING(user)
if(!changeling_datum)
return FALSE
return TRUE