-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathtransform_procs.dm
660 lines (527 loc) · 18.5 KB
/
transform_procs.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
#define TRANSFORMATION_DURATION 22
/mob/living/carbon/proc/monkeyize(tr_flags = (TR_KEEPITEMS | TR_KEEPVIRUS | TR_KEEPSTUNS | TR_KEEPREAGENTS | TR_DEFAULTMSG))
if (notransform || transformation_timer)
return
if(has_horror_inside())
to_chat(src, "<span class='warning'>You feel something strongly clinging to your humanity!</span>")
return
//Handle items on mob
if(tr_flags & TR_KEEPITEMS)
var/Itemlist = get_equipped_items(TRUE)
Itemlist += held_items
for(var/obj/item/W in Itemlist)
dropItemToGround(W)
//Make mob invisible and spawn animation
notransform = TRUE
Paralyze(TRANSFORMATION_DURATION, ignore_canstun = TRUE)
icon = null
cut_overlays()
invisibility = INVISIBILITY_MAXIMUM
new /obj/effect/temp_visual/monkeyify(loc)
transformation_timer = addtimer(CALLBACK(src, PROC_REF(finish_monkeyize), tr_flags), TRANSFORMATION_DURATION, TIMER_UNIQUE)
/mob/living/carbon/proc/finish_monkeyize(tr_flags)
transformation_timer = null
var/list/missing_bodyparts_zones = get_missing_limbs()
//first implants & organs
var/list/stored_implants = list()
var/list/int_organs = list()
if (tr_flags & TR_KEEPIMPLANTS)
for(var/X in implants)
var/obj/item/implant/IMP = X
stored_implants += IMP
IMP.removed(src, 1, 1)
var/obj/item/cavity_object
var/obj/item/bodypart/chest/CH = get_bodypart(BODY_ZONE_CHEST)
if(CH.cavity_item)
cavity_object = CH.cavity_item
CH.cavity_item = null
var/mob/living/carbon/monkey/O = new /mob/living/carbon/monkey( loc )
// hash the original name?
if(tr_flags & TR_HASHNAME)
O.name = "monkey ([copytext_char(md5(real_name), 2, 6)])"
O.real_name = "monkey ([copytext_char(md5(real_name), 2, 6)])"
//handle DNA and other attributes
dna.transfer_identity(O)
O.updateappearance(icon_update=0)
if(tr_flags & TR_KEEPSE)
O.dna.mutation_index = dna.mutation_index
O.dna.default_mutation_genes = dna.default_mutation_genes
O.dna.set_se(1, GET_INITIALIZED_MUTATION(RACEMUT))
if(suiciding)
O.set_suicide(suiciding)
if(hellbound)
O.hellbound = hellbound
O.set_combat_mode(TRUE, TRUE)
//keep viruses?
if (tr_flags & TR_KEEPVIRUS)
O.diseases = diseases
diseases = list()
for(var/thing in O.diseases)
var/datum/disease/D = thing
D.affected_mob = O
//keep damage?
if (tr_flags & TR_KEEPDAMAGE)
O.setToxLoss(getToxLoss(), 0)
O.adjustBruteLoss(getBruteLoss(), 0)
O.setOxyLoss(getOxyLoss(), 0)
O.setCloneLoss(getCloneLoss(), 0)
O.adjustFireLoss(getFireLoss(), 0)
O.setOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN))
O.updatehealth()
O.radiation = radiation
O.blood_volume = blood_volume * MONKIFY_BLOOD_COEFFICIENT
//re-add implants to new mob
if (tr_flags & TR_KEEPIMPLANTS)
for(var/Y in implants)
var/obj/item/implant/IMP = Y
IMP.implant(O, null, 1)
//re-add organs to new mob. this order prevents moving the mind to a brain at any point
if(tr_flags & TR_KEEPORGANS)
for(var/X in O.internal_organs)
var/obj/item/organ/I = X
I.Remove(O, 1)
if(mind)
mind.transfer_to(O)
var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
var/datum/action/changeling/humanform/hf = new
changeling.purchasedpowers += hf
changeling.regain_powers()
for(var/X in internal_organs)
var/obj/item/organ/I = X
int_organs += I
I.Remove(src, 1)
for(var/X in int_organs)
var/obj/item/organ/I = X
I.Insert(O, 1)
var/obj/item/bodypart/chest/torso = O.get_bodypart(BODY_ZONE_CHEST)
if(cavity_object)
torso.cavity_item = cavity_object //cavity item is given to the new chest
cavity_object.forceMove(O)
for(var/missing_zone in missing_bodyparts_zones)
var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
BP.drop_limb(1)
if(!(tr_flags & TR_KEEPORGANS)) //we didn't already get rid of the organs of the newly spawned mob
for(var/X in O.internal_organs)
var/obj/item/organ/G = X
if(BP.body_zone == check_zone(G.zone))
if(mind && mind.has_antag_datum(/datum/antagonist/changeling) && istype(G, /obj/item/organ/brain))
continue //so headless changelings don't lose their brain when transforming
qdel(G) //we lose the organs in the missing limbs
qdel(BP)
//transfer stuns
if(tr_flags & TR_KEEPSTUNS)
O.Stun(AmountStun(), ignore_canstun = TRUE)
O.Knockdown(AmountKnockdown(), ignore_canstun = TRUE)
O.Immobilize(AmountImmobilized(), ignore_canstun = TRUE)
O.Paralyze(AmountParalyzed(), ignore_canstun = TRUE)
O.Unconscious(AmountUnconscious(), ignore_canstun = TRUE)
O.Sleeping(AmountSleeping(), ignore_canstun = TRUE)
//transfer reagents
if(tr_flags & TR_KEEPREAGENTS)
reagents.trans_to(O, reagents.total_volume)
//transfer mind if we didn't yet
if(mind)
mind.transfer_to(O)
var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
var/datum/action/changeling/humanform/hf = new
changeling.purchasedpowers += hf
changeling.regain_powers()
if (tr_flags & TR_DEFAULTMSG)
to_chat(O, "<B>You are now a monkey.</B>")
for(var/A in loc.vars)
if(loc.vars[A] == src)
loc.vars[A] = O
transfer_observers_to(O)
. = O
transfer_trait_datums(O)
qdel(src)
////////////////////////// Humanize //////////////////////////////
//Could probably be merged with monkeyize but other transformations got their own procs, too
/mob/living/carbon/proc/humanize(tr_flags = (TR_KEEPITEMS | TR_KEEPVIRUS | TR_KEEPSTUNS | TR_KEEPREAGENTS | TR_DEFAULTMSG), datum/changelingprofile/chosen_prof)
if (notransform || transformation_timer)
return
//now the rest
if (tr_flags & TR_KEEPITEMS)
var/Itemlist = get_equipped_items(TRUE)
Itemlist += held_items
for(var/obj/item/W in Itemlist)
dropItemToGround(W, TRUE)
if (client)
client.screen -= W
//Make mob invisible and spawn animation
notransform = TRUE
Paralyze(TRANSFORMATION_DURATION, ignore_canstun = TRUE)
icon = null
cut_overlays()
invisibility = INVISIBILITY_MAXIMUM
new /obj/effect/temp_visual/monkeyify/humanify(loc)
transformation_timer = addtimer(CALLBACK(src, PROC_REF(finish_humanize), tr_flags, chosen_prof), TRANSFORMATION_DURATION, TIMER_UNIQUE)
/mob/living/carbon/proc/finish_humanize(tr_flags, datum/changelingprofile/chosen_prof)
transformation_timer = null
var/list/stored_implants = list()
var/list/int_organs = list()
if (tr_flags & TR_KEEPIMPLANTS)
for(var/X in implants)
var/obj/item/implant/IMP = X
stored_implants += IMP
IMP.removed(src, 1, 1)
var/list/missing_bodyparts_zones = get_missing_limbs()
var/obj/item/cavity_object
var/obj/item/bodypart/chest/CH = get_bodypart(BODY_ZONE_CHEST)
if(CH.cavity_item)
cavity_object = CH.cavity_item
CH.cavity_item = null
var/mob/living/carbon/human/O = new( loc )
for(var/obj/item/C in O.loc)
O.equip_to_appropriate_slot(C)
dna.transfer_identity(O)
O.updateappearance(mutcolor_update=1)
if(findtext(O.dna.real_name, "monkey", 1, 7)) //7 == length("monkey") + 1
O.real_name = random_unique_name(O.gender)
O.dna.generate_unique_enzymes(O)
else
O.real_name = O.dna.real_name
O.name = O.real_name
if(tr_flags & TR_KEEPSE)
O.dna.mutation_index = dna.mutation_index
O.dna.default_mutation_genes = dna.default_mutation_genes
O.dna.set_se(0, GET_INITIALIZED_MUTATION(RACEMUT))
O.domutcheck()
if(suiciding)
O.set_suicide(suiciding)
if(hellbound)
O.hellbound = hellbound
//keep viruses?
if (tr_flags & TR_KEEPVIRUS)
O.diseases = diseases
diseases = list()
for(var/thing in O.diseases)
var/datum/disease/D = thing
D.affected_mob = O
O.med_hud_set_status()
//keep damage?
if (tr_flags & TR_KEEPDAMAGE)
O.setToxLoss(getToxLoss(), 0)
O.adjustBruteLoss(getBruteLoss(), 0)
O.setOxyLoss(getOxyLoss(), 0)
O.setCloneLoss(getCloneLoss(), 0)
O.adjustFireLoss(getFireLoss(), 0)
O.adjustOrganLoss(ORGAN_SLOT_BRAIN, getOrganLoss(ORGAN_SLOT_BRAIN))
O.updatehealth()
O.radiation = radiation
O.blood_volume = blood_volume / MONKIFY_BLOOD_COEFFICIENT
//re-add implants to new mob
if (tr_flags & TR_KEEPIMPLANTS)
for(var/Y in implants)
var/obj/item/implant/IMP = Y
IMP.implant(O, null, 1)
if(tr_flags & TR_KEEPORGANS)
for(var/X in O.internal_organs)
var/obj/item/organ/I = X
I.Remove(O, 1)
if(mind)
mind.transfer_to(O)
var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
for(var/datum/action/changeling/humanform/HF in changeling.purchasedpowers)
changeling.purchasedpowers -= HF
changeling.regain_powers()
for(var/X in internal_organs)
var/obj/item/organ/I = X
int_organs += I
I.Remove(src, 1)
for(var/X in int_organs)
var/obj/item/organ/I = X
I.Insert(O, 1)
var/obj/item/bodypart/chest/torso = get_bodypart(BODY_ZONE_CHEST)
if(cavity_object)
torso.cavity_item = cavity_object //cavity item is given to the new chest
cavity_object.forceMove(O)
for(var/missing_zone in missing_bodyparts_zones)
var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
BP.drop_limb(1)
if(!(tr_flags & TR_KEEPORGANS)) //we didn't already get rid of the organs of the newly spawned mob
for(var/X in O.internal_organs)
var/obj/item/organ/G = X
if(BP.body_zone == check_zone(G.zone))
if(mind && mind.has_antag_datum(/datum/antagonist/changeling) && istype(G, /obj/item/organ/brain))
continue //so headless changelings don't lose their brain when transforming
qdel(G) //we lose the organs in the missing limbs
qdel(BP)
//transfer stuns
if(tr_flags & TR_KEEPSTUNS)
O.Stun(AmountStun(), ignore_canstun = TRUE)
O.Knockdown(AmountKnockdown(), ignore_canstun = TRUE)
O.Immobilize(AmountImmobilized(), ignore_canstun = TRUE)
O.Paralyze(AmountParalyzed(), ignore_canstun = TRUE)
O.Unconscious(AmountUnconscious(), ignore_canstun = TRUE)
O.Sleeping(AmountSleeping(), ignore_canstun = TRUE)
//transfer reagents
if(tr_flags & TR_KEEPREAGENTS)
reagents.trans_to(O, reagents.total_volume)
if(mind)
mind.transfer_to(O)
var/datum/antagonist/changeling/changeling = O.mind.has_antag_datum(/datum/antagonist/changeling)
if(changeling)
for(var/datum/action/changeling/humanform/HF in changeling.purchasedpowers)
changeling.purchasedpowers -= HF
changeling.regain_powers()
O.set_combat_mode(FALSE, TRUE)
if (tr_flags & TR_DEFAULTMSG)
to_chat(O, "<B>You are now a human.</B>")
transfer_observers_to(O)
. = O
for(var/A in loc.vars)
if(loc.vars[A] == src)
loc.vars[A] = O
transfer_trait_datums(O)
if(chosen_prof)
changeling_transform(O, chosen_prof)
qdel(src)
/mob/living/carbon/human/AIize(client/preference_source, move = TRUE)
if(notransform)
return
return ..()
/mob/living/carbon/AIize(client/preference_source, move = TRUE)
if (notransform)
return
notransform = TRUE
Paralyze(1, ignore_canstun = TRUE)
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
icon = null
SetInvisibility(INVISIBILITY_MAXIMUM)
return ..()
/mob/proc/AIize(client/preference_source, move = TRUE)
var/list/turf/core_loc = list()
for(var/obj/machinery/ai/data_core/core in GLOB.data_cores)
if(core.valid_data_core())
core_loc |= core.loc
if(!length(core_loc))
message_admins("No valid data core for [src]. Yell at a mapper! The AI will die.")
if(client)
stop_sound_channel(CHANNEL_LOBBYMUSIC)
var/mob/living/silicon/ai/our_AI = new /mob/living/silicon/ai(pick(core_loc), null, src)
. = our_AI
if(preference_source)
apply_pref_name(/datum/preference/name/ai, preference_source)
qdel(src)
/mob/living/carbon/human/proc/Robotize(delete_items = 0, transfer_after = TRUE)
if (notransform)
return
notransform = TRUE
Paralyze(1, ignore_canstun = TRUE)
for(var/obj/item/W in src)
if(delete_items)
qdel(W)
else
dropItemToGround(W)
regenerate_icons()
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts)
qdel(t)
var/mob/living/silicon/robot/R = new /mob/living/silicon/robot(loc)
R.gender = gender
R.invisibility = 0
if(client)
R.updatename(client)
if(mind) //TODO
if(!transfer_after)
mind.active = FALSE
mind.transfer_to(R)
else if(transfer_after)
R.key = key
if(R.mmi)
R.mmi.name = "[initial(R.mmi.name)]: [real_name]"
if(R.mmi.brain)
R.mmi.brain.name = "[real_name]'s brain"
if(R.mmi.brainmob)
R.mmi.brainmob.real_name = real_name //the name of the brain inside the cyborg is the robotized human's name.
R.mmi.brainmob.name = real_name
R.job = "Cyborg"
R.notify_ai(NEW_BORG)
. = R
if(R.ckey && is_banned_from(R.ckey, "Cyborg"))
INVOKE_ASYNC(R, TYPE_PROC_REF(/mob/living/silicon/robot, replace_banned_cyborg))
qdel(src)
/mob/living/silicon/robot/proc/replace_banned_cyborg()
to_chat(src, "<b>You are job banned from cyborg! Appeal your job ban if you want to avoid this in the future!</b>")
ghostize(FALSE)
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [src]?", "[src]", null, "Cyborg", 50, src)
if(LAZYLEN(candidates))
var/mob/dead/observer/chosen_candidate = pick(candidates)
message_admins("[key_name_admin(chosen_candidate)] has taken control of ([key_name_admin(src)]) to replace a jobbanned player.")
key = chosen_candidate.key
//human -> alien
/mob/living/carbon/human/proc/Alienize()
if (notransform)
return
notransform = TRUE
mobility_flags = NONE
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts)
qdel(t)
var/alien_caste = pick("Hunter","Sentinel","Drone")
var/mob/living/carbon/alien/humanoid/new_xeno
switch(alien_caste)
if("Hunter")
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc)
if("Sentinel")
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc)
if("Drone")
new_xeno = new /mob/living/carbon/alien/humanoid/drone(loc)
new_xeno.set_combat_mode(TRUE, TRUE)
new_xeno.key = key
update_atom_languages()
to_chat(new_xeno, "<B>You are now an alien.</B>")
. = new_xeno
qdel(src)
/mob/living/carbon/human/proc/slimeize(reproduce as num)
if (notransform)
return
notransform = TRUE
mobility_flags = NONE
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts)
qdel(t)
var/mob/living/simple_animal/slime/new_slime
if(reproduce)
var/number = pick(14;2,3,4) //reproduce (has a small chance of producing 3 or 4 offspring)
var/list/babies = list()
for(var/i=1,i<=number,i++)
var/mob/living/simple_animal/slime/M = new/mob/living/simple_animal/slime(loc)
M.set_nutrition(round(nutrition/number))
step_away(M,src)
babies += M
new_slime = pick(babies)
else
new_slime = new /mob/living/simple_animal/slime(loc)
new_slime.set_combat_mode(TRUE, TRUE)
new_slime.key = key
to_chat(new_slime, "<B>You are now a slime. Skreee!</B>")
. = new_slime
qdel(src)
/mob/proc/become_overmind(starting_points = 60, pointmodifier = 1, announcement_delay = 6000)
var/mob/camera/blob/B = new /mob/camera/blob(get_turf(src), starting_points, pointmodifier, announcement_delay)
B.key = key
. = B
qdel(src)
/mob/living/carbon/human/proc/corgize()
if (notransform)
return
notransform = TRUE
Paralyze(1, ignore_canstun = TRUE)
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts) //this really should not be necessary
qdel(t)
var/mob/living/simple_animal/pet/dog/corgi/new_corgi = new /mob/living/simple_animal/pet/dog/corgi (loc)
new_corgi.set_combat_mode(TRUE, TRUE)
new_corgi.key = key
to_chat(new_corgi, "<B>You are now a Corgi. Yap Yap!</B>")
. = new_corgi
qdel(src)
/mob/living/carbon/proc/gorillize()
if(notransform)
return
notransform = TRUE
Paralyze(1, ignore_canstun = TRUE)
SSblackbox.record_feedback("amount", "gorillas_created", 1)
var/Itemlist = get_equipped_items(TRUE)
Itemlist += held_items
for(var/obj/item/W in Itemlist)
dropItemToGround(W, TRUE)
regenerate_icons()
icon = null
invisibility = INVISIBILITY_MAXIMUM
var/mob/living/simple_animal/hostile/gorilla/new_gorilla = new (get_turf(src))
new_gorilla.set_combat_mode(TRUE, TRUE)
if(mind)
mind.transfer_to(new_gorilla)
else
new_gorilla.key = key
to_chat(new_gorilla, "<B>You are now a gorilla. Ooga ooga!</B>")
. = new_gorilla
qdel(src)
/mob/living/carbon/human/proc/pacmanize()
if (notransform)
return
notransform = TRUE
Paralyze(1, ignore_canstun = TRUE)
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts) //this really should not be necessary
qdel(t)
var/mob/living/simple_animal/pacman/new_pacman = new /mob/living/simple_animal/pacman (loc)
new_pacman.set_combat_mode(TRUE, TRUE)
new_pacman.key = key
to_chat(new_pacman, "<B>You are now a pacman. I LOVE PACMAN!</B>")
. = new_pacman
qdel(src)
/mob/living/carbon/human/Animalize()
var/list/mobtypes = typesof(/mob/living/simple_animal)
var/mobpath = input("Which type of mob should [src] turn into?", "Choose a type") in mobtypes
if(!safe_animal(mobpath))
to_chat(usr, span_danger("Sorry but this mob type is currently unavailable."))
return
if(notransform)
return
notransform = TRUE
Paralyze(1, ignore_canstun = TRUE)
for(var/obj/item/W in src)
dropItemToGround(W)
regenerate_icons()
icon = null
invisibility = INVISIBILITY_MAXIMUM
for(var/t in bodyparts)
qdel(t)
var/mob/living/new_mob = new mobpath(src.loc)
new_mob.key = key
new_mob.set_combat_mode(TRUE, TRUE)
to_chat(new_mob, "You suddenly feel more... animalistic.")
. = new_mob
qdel(src)
/mob/proc/Animalize()
var/list/mobtypes = typesof(/mob/living/simple_animal)
var/mobpath = input(usr, "Which type of mob should [src] turn into?", "Choose a type", sortList(mobtypes, /proc/cmp_typepaths_asc))
if(!safe_animal(mobpath))
to_chat(usr, span_danger("Sorry but this mob type is currently unavailable."))
return
var/mob/living/new_mob = new mobpath(src.loc)
new_mob.key = key
new_mob.set_combat_mode(TRUE, TRUE)
to_chat(new_mob, "You feel more... animalistic")
. = new_mob
qdel(src)
/* Certain mob types have problems and should not be allowed to be controlled by players.
*
* This proc is here to force coders to manually place their mob in this list, hopefully tested.
* This also gives a place to explain -why- players shouldnt be turn into certain mobs and hopefully someone can fix them.
*/
/mob/proc/safe_animal(MP)
//Bad mobs! - Remember to add a comment explaining what's wrong with the mob
if(!MP)
return 0 //Sanity, this should never happen.
// if(ispath(MP, /mob/living/simple_animal/pet/cat))
// return 0 //Template
//Not in here? Must be good!
return 1
#undef TRANSFORMATION_DURATION