|
99 | 99 | /datum/action/chameleon_outfit/Trigger() |
100 | 100 | return select_outfit(owner) |
101 | 101 |
|
102 | | -/datum/action/chameleon_outfit/proc/select_outfit(mob/user, datum/outfit/outfit = null) |
| 102 | +/datum/action/chameleon_outfit/proc/select_outfit(mob/user) |
103 | 103 | if(!user || !IsAvailable(feedback = FALSE)) |
104 | 104 | return FALSE |
105 | 105 | var/datum/outfit/O |
106 | | - if(isnull(outfit)) //If no outfit is passed, get the user to decide |
107 | | - var/selected = tgui_input_list(user, "Select outfit to change into", "Chameleon Outfit", outfit_options) |
108 | | - if(!IsAvailable(feedback = FALSE) || QDELETED(src) || QDELETED(user)) |
109 | | - return FALSE |
110 | | - var/outfit_type = outfit_options[selected] |
111 | | - if(!outfit_type) |
112 | | - return FALSE |
113 | | - O = new outfit_type() |
114 | | - var/list/outfit_types = O.get_chameleon_disguise_info() |
115 | | - for(var/V in user.chameleon_item_actions) |
116 | | - var/datum/action/item_action/chameleon/change/A = V |
117 | | - var/done = FALSE |
118 | | - for(var/T in outfit_types) |
119 | | - for(var/name in A.chameleon_list) |
120 | | - if(A.chameleon_list[name] == T) |
121 | | - A.update_look(user, T) |
122 | | - outfit_types -= T |
123 | | - done = TRUE |
124 | | - break |
125 | | - if(done) |
126 | | - break |
127 | | - else //If a specific outfit is passed through |
128 | | - var/list/types = outfit.get_chameleon_disguise_info() |
129 | | - for(var/T in types) |
130 | | - for(var/V in user.chameleon_item_actions) |
131 | | - var/datum/action/item_action/chameleon/change/A = V |
132 | | - if(istype(T, A.chameleon_type)) |
| 106 | + var/selected = tgui_input_list(user, "Select outfit to change into", "Chameleon Outfit", outfit_options) |
| 107 | + if(!IsAvailable(feedback = FALSE) || QDELETED(src) || QDELETED(user)) |
| 108 | + return FALSE |
| 109 | + var/outfit_type = outfit_options[selected] |
| 110 | + if(!outfit_type) |
| 111 | + return FALSE |
| 112 | + O = new outfit_type() |
| 113 | + var/list/outfit_types = O.get_chameleon_disguise_info() |
| 114 | + for(var/V in user.chameleon_item_actions) |
| 115 | + var/datum/action/item_action/chameleon/change/A = V |
| 116 | + var/done = FALSE |
| 117 | + for(var/T in outfit_types) |
| 118 | + for(var/name in A.chameleon_list) |
| 119 | + if(A.chameleon_list[name] == T) |
133 | 120 | A.update_look(user, T) |
134 | | - return TRUE |
| 121 | + outfit_types -= T |
| 122 | + done = TRUE |
| 123 | + break |
| 124 | + if(done) |
| 125 | + break |
135 | 126 | //hardsuit helmets/suit hoods |
136 | 127 | if(O.toggle_helmet && (ispath(O.suit, /obj/item/clothing/suit/space/hardsuit) || ispath(O.suit, /obj/item/clothing/suit/hooded)) && ishuman(user)) |
137 | 128 | var/mob/living/carbon/human/H = user |
|
218 | 209 | O.ears = T.ears |
219 | 210 | O.glasses = T.glasses |
220 | 211 | O.mask = T.wear_mask |
221 | | - var/datum/action/chameleon_outfit/select = locate(/datum/action/chameleon_outfit) in owner.actions |
222 | | - select.select_outfit(owner, O) |
| 212 | + O.back = T.back |
| 213 | + var/list/types = O.get_chameleon_disguise_info() |
| 214 | + for(var/Y in types) |
| 215 | + for(var/V in owner.chameleon_item_actions) |
| 216 | + var/datum/action/item_action/chameleon/change/A = V |
| 217 | + if(A.chameleon_blacklist[Y]) |
| 218 | + continue |
| 219 | + if(istype(Y, A.chameleon_type)) //Need to make sure it's the right type, wouldn't want to wear an armour vest on your head. |
| 220 | + A.update_look(owner, Y) |
| 221 | + A.copying = TRUE |
| 222 | + A.copy_target = T |
223 | 223 | to_chat(owner, span_notice("Successfully copied [T]!")) |
224 | 224 | toggle_button() |
225 | 225 |
|
|
233 | 233 | var/emp_timer |
234 | 234 | var/current_disguise = null |
235 | 235 | var/syndicate = FALSE |
| 236 | + var/copying = FALSE |
| 237 | + var/mob/living/copy_target |
236 | 238 |
|
237 | 239 | /datum/action/item_action/chameleon/change/Grant(mob/M) |
238 | 240 | if(M && (owner != M)) |
|
279 | 281 | if(!picked_item) |
280 | 282 | return |
281 | 283 | update_look(user, picked_item) |
| 284 | + copying = FALSE |
282 | 285 |
|
283 | 286 | /datum/action/item_action/chameleon/change/proc/random_look(mob/user) |
284 | 287 | var/picked_name = pick(chameleon_list) |
|
0 commit comments