|
118 | 118 | /obj/machinery/suit_modifier/attackby(var/obj/item/I, var/mob/user)
|
119 | 119 | if(istype(I, /obj/item/rig_module) && user.drop_item(I, src))
|
120 | 120 | playsound(src, 'sound/machines/click.ogg', 50, 1)
|
121 |
| - say("\The [I] installed.", class = "binaryradio") |
| 121 | + say("Preparing \the [I] for installation.", class = "binaryradio") |
122 | 122 | modules_to_install.Add(I)
|
123 | 123 | return
|
124 | 124 | if(istype(I, /obj/item/weapon/cell) && !cell && user.drop_item(I, src))
|
125 | 125 | playsound(src, 'sound/machines/click.ogg', 50, 1)
|
126 |
| - say("\The [I] installed.", class = "binaryradio") |
| 126 | + say("Preparing \the [I] for installation.", class = "binaryradio") |
127 | 127 | cell = I
|
128 | 128 | return
|
129 | 129 | .=..()
|
|
135 | 135 | return
|
136 | 136 | if(is_locking(/mob/living/carbon/human))
|
137 | 137 | playsound(src, 'sound/machines/buzz-two.ogg', 50, 0)
|
138 |
| - say("Unit Occupied.", class = "binaryradio") |
| 138 | + say("Error: Unit occupied.", class = "binaryradio") |
139 | 139 | return
|
140 | 140 | if(!ishuman(user))
|
141 | 141 | return
|
|
146 | 146 | var/obj/item/clothing/suit/space/rig/worn_rig = worn_suit
|
147 | 147 | if(!modules_to_install.len && !cell)
|
148 | 148 | if(worn_rig.modules.len)
|
149 |
| - say("Installed modules detected.", class = "binaryradio") |
150 | 149 | process_module_removal(H)
|
151 | 150 | return
|
152 |
| - say("No upgrade available.", class = "binaryradio") |
| 151 | + say("Error: No modules detected and no upgrades available.", class = "binaryradio") |
153 | 152 | return
|
154 | 153 | process_module_installation(H)
|
155 | 154 | return
|
|
158 | 157 | else if(istype(worn_suit, /obj/item/clothing/suit/space/vox))
|
159 | 158 | process_suit_replace(H, vox_suits)
|
160 | 159 | else
|
161 |
| - say("Unable to detect compatible spacesuit on [H].", class = "binaryradio") |
| 160 | + say("Error: Unable to detect compatible spacesuit on [H].", class = "binaryradio") |
162 | 161 | else if((modules_to_install.len || cell) && !activated)
|
163 |
| - var/obj/removed = input(user, "Choose an upgrade to remove from [src].", src) as null|anything in modules_to_install + cell |
| 162 | + var/obj/removed = input(user, "Choose an upgrade to remove from \the [src].", src.name) as null|anything in modules_to_install + cell |
164 | 163 | if(!removed || activated || !user.Adjacent(src) || user.incapacitated())
|
165 | 164 | return
|
166 | 165 | user.put_in_hands(removed)
|
|
239 | 238 | filtered_suit_list[entry] = list(suit_list[entry][SUIT_INDEX], suit_list[entry][HELMET_INDEX])
|
240 | 239 | return filtered_suit_list
|
241 | 240 |
|
| 241 | +/** |
| 242 | + * Changes a vox/plasmaman suit. |
| 243 | + */ |
242 | 244 | /obj/machinery/suit_modifier/proc/process_suit_replace(mob/living/carbon/human/guy, list/suit_list)
|
243 | 245 | if(activated)
|
244 | 246 | return
|
245 | 247 | activated = TRUE
|
246 | 248 | use_power = MACHINE_POWER_USE_ACTIVE
|
247 | 249 | lock_atom(guy)
|
| 250 | + var/obj/item/clothing/suit/space/oldsuit = guy.get_item_by_slot(slot_wear_suit) |
| 251 | + var/obj/item/clothing/head/helmet/space/oldhelmet = guy.get_item_by_slot(slot_head) |
| 252 | + oldsuit?.canremove = FALSE |
| 253 | + oldhelmet?.canremove = FALSE |
248 | 254 | activation_animation()
|
249 |
| - var/obj/item/clothing/suit/space/chosen_job = input(guy, "What kind of model do you wish to apply?") as null|anything in filter_suit_list(guy, suit_list) |
250 |
| - if(!chosen_job || activated || guy.incapacitated() || guy.loc != loc) |
| 255 | + var/chosen_job = input(guy, "What kind of model do you wish to apply?", src.name) as null|anything in filter_suit_list(guy, suit_list) |
| 256 | + if(!chosen_job || guy.incapacitated() || guy.loc != loc) |
251 | 257 | cancel_animation()
|
252 | 258 | unlock_atom(guy)
|
253 | 259 | use_power = MACHINE_POWER_USE_IDLE
|
254 | 260 | activated = FALSE
|
| 261 | + if(!oldsuit?.current_glue_state) |
| 262 | + oldsuit?.canremove = TRUE |
| 263 | + if(!oldhelmet?.current_glue_state) |
| 264 | + oldhelmet?.canremove = TRUE |
255 | 265 | return
|
256 | 266 | working_animation()
|
257 | 267 | var/obj/item/clothing/suit/space/chosen_suit = suit_list[chosen_job][SUIT_INDEX]
|
258 | 268 | var/obj/item/clothing/head/helmet/space/chosen_helmet = suit_list[chosen_job][HELMET_INDEX]
|
| 269 | + say("Repainting \the [oldsuit ? oldsuit.name : "suit"] into the [lowertext(chosen_job)] model.", class = "binaryradio") |
259 | 270 | spawn(rand(3,10) / apply_multiplier)
|
260 | 271 | playsound(src, 'sound/effects/spray3.ogg', 30, 1)
|
261 | 272 | spawn(rand(20,30) / apply_multiplier)
|
262 | 273 | playsound(src, 'sound/effects/spray2.ogg', 30, 1)
|
263 | 274 | spawn(5 SECONDS / apply_multiplier)
|
264 | 275 | playsound(src, 'sound/effects/spray.ogg', 30, 1)
|
265 | 276 | if(do_after(guy, src, 8 SECONDS / apply_multiplier, needhand = FALSE))
|
266 |
| - var/obj/item/clothing/suit/space/oldsuit = guy.get_item_by_slot(slot_wear_suit) |
267 | 277 | if(oldsuit)
|
268 | 278 | guy.equip_to_slot(new chosen_suit, slot_wear_suit)
|
269 | 279 | qdel(oldsuit)
|
270 | 280 | guy.update_inv_wear_suit()
|
271 |
| - var/obj/item/clothing/head/helmet/space/oldhelmet = guy.get_item_by_slot(slot_head) |
272 | 281 | if(oldhelmet)
|
273 | 282 | guy.equip_to_slot(new chosen_helmet, slot_head)
|
274 | 283 | qdel(oldhelmet)
|
275 | 284 | guy.update_inv_head()
|
| 285 | + else |
| 286 | + if(!oldsuit?.current_glue_state) |
| 287 | + oldsuit?.canremove = TRUE |
| 288 | + if(!oldhelmet?.current_glue_state) |
| 289 | + oldhelmet?.canremove = TRUE |
276 | 290 | unlock_atom(guy)
|
277 | 291 | finished_animation()
|
278 | 292 | use_power = MACHINE_POWER_USE_IDLE
|
279 | 293 | activated = FALSE
|
280 | 294 |
|
| 295 | +/** |
| 296 | + * Adds a module to a rigsuit |
| 297 | + */ |
281 | 298 | /obj/machinery/suit_modifier/proc/process_module_installation(var/mob/living/carbon/human/H)
|
282 | 299 | if(activated)
|
283 | 300 | return
|
|
296 | 313 | if(!install_result[1]) //more versatile check, allows for custom install conditions.
|
297 | 314 | say(install_result[2], class = "binaryradio")
|
298 | 315 | continue
|
| 316 | + say("Installing \the [RM] into \the [R].", class = "binaryradio") |
299 | 317 | playsound(src, 'sound/mecha/hydraulic.ogg', 40, 1)
|
300 | 318 | spawn(rand(4 SECONDS, 5 SECONDS) / apply_multiplier)
|
301 | 319 | playsound(src, 'sound/items/Welder.ogg', 50, 1)
|
302 | 320 | if(do_after(H, src, 8 SECONDS / apply_multiplier, needhand = FALSE))
|
303 |
| - say("Installing [RM] into \the [R].", class = "binaryradio") |
304 | 321 | R.modules.Add(RM)
|
305 | 322 | RM.rig = R
|
306 | 323 | RM.forceMove(R)
|
307 | 324 | modules_to_install.Remove(RM)
|
308 | 325 | if(cell) //Can't answer the prompt if you're incapacitated.
|
309 | 326 | var/choice = alert(H, "Do you wish to install [cell]?", src, "Yes", "No")
|
310 | 327 | if((choice == "Yes") && H.Adjacent(src) && !H.incapacitated())
|
311 |
| - say("Installing [cell] into to \the [R].", class = "binaryradio") |
| 328 | + say("Installing \the [cell] into to \the [R].", class = "binaryradio") |
312 | 329 | playsound(src, 'sound/mecha/hydraulic.ogg', 40, 1)
|
313 | 330 | spawn(rand(4 SECONDS, 5 SECONDS) / apply_multiplier)
|
314 | 331 | playsound(src, 'sound/misc/click.ogg', 50, 1)
|
|
325 | 342 | use_power = MACHINE_POWER_USE_IDLE
|
326 | 343 | activated = FALSE
|
327 | 344 |
|
| 345 | +/** |
| 346 | + * Removes a module from a rigsuit |
| 347 | + */ |
328 | 348 | /obj/machinery/suit_modifier/proc/process_module_removal(var/mob/living/carbon/human/H)
|
329 | 349 | if(activated)
|
330 | 350 | return
|
|
340 | 360 | lock_atom(H)
|
341 | 361 | R.deactivate_suit()
|
342 | 362 | activation_animation()
|
343 |
| - var/obj/item/rig_module/RM = input(H, "Choose an upgrade to remove from [R].", R) as null|anything in R.modules |
| 363 | + var/obj/item/rig_module/RM = input(H, "Choose an upgrade to remove from [R].", src.name) as null|anything in R.modules |
344 | 364 | if(!RM|| !H.Adjacent(src) || H.incapacitated())
|
345 | 365 | cancel_animation()
|
346 | 366 | if(!R.current_glue_state)
|
|
350 | 370 | use_power = MACHINE_POWER_USE_IDLE
|
351 | 371 | activated = FALSE
|
352 | 372 | return
|
353 |
| - say("Uninstalling [RM] from \the [R].", class = "binaryradio") |
354 | 373 | working_animation()
|
| 374 | + say("Uninstalling \the [RM] from \the [R].", class = "binaryradio") |
355 | 375 | playsound(src, 'sound/mecha/hydraulic.ogg', 40, 1)
|
356 | 376 | spawn(rand(4 SECONDS, 5 SECONDS) / apply_multiplier)
|
357 | 377 | playsound(src, 'sound/items/Welder.ogg', 60, 1)
|
|
0 commit comments