-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathjellypeople.dm
769 lines (651 loc) · 26.2 KB
/
jellypeople.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
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
/datum/species/jelly
// Entirely alien beings that seem to be made entirely out of gel. They have three eyes and a skeleton visible within them.
name = "Jellyperson"
plural_form = "Jellypeople"
id = SPECIES_JELLYPERSON
monitor_icon = "cloud"
monitor_color = "#f2505d"
default_color = "00FF90"
say_mod = "chirps"
bubble_icon = BUBBLE_SLIME
species_traits = list(MUTCOLORS, EYECOLOR, STABLEBLOOD, HAIR, HAS_FLESH)
inherent_traits = list(TRAIT_TOXINLOVER)
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/slime
exotic_blood = /datum/reagent/toxin/slimejelly
exotic_bloodtype = "J" //this isn't used for anything other than bloodsplatter colours
mutanttongue = /obj/item/organ/tongue/slime
mutantlungs = /obj/item/organ/lungs/slime
damage_overlay_type = ""
coldmod = 3
heatmod = 0.5
burnmod = 0.8 // now only 20% as effective!
changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_PRIDE | MIRROR_MAGIC | RACE_SWAP | ERT_SPAWN | SLIME_EXTRACT
species_language_holder = /datum/language_holder/jelly
swimming_component = /datum/component/swimming/dissolve
hair_color = "mutcolor"
hair_alpha = 140
liked_food = TOXIC | MEAT //tasty toxins or raw meat
disliked_food = ALCOHOL | JUNKFOOD //junkfood is too oily, and alcohol is a disinfectant
toxic_food = PINEAPPLE //enzymes dissolve the jelly from the inside
species_abilities = list(/datum/action/innate/regenerate_limbs)
var/soggy = FALSE
/datum/species/jelly/on_species_loss(mob/living/carbon/C)
C.faction -= "slime"
C.remove_movespeed_modifier("slime_person_wet")
return ..()
/datum/species/jelly/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
C.faction |= "slime"
/datum/species/jelly/spec_life(mob/living/carbon/human/H)
handle_wetness(H)
if(H.stat == DEAD) //can't farm slime jelly from a dead slime/jelly person indefinitely
return
if(!H.blood_volume)
H.blood_volume += 5
H.adjustBruteLoss(5)
to_chat(H, span_danger("You feel empty!"))
switch(H.blood_volume)
if(0 to (BLOOD_VOLUME_GENERIC * BLOOD_BAD_MULTI))
Cannibalize_Body(H)
if((BLOOD_VOLUME_GENERIC * BLOOD_BAD_MULTI) to (BLOOD_VOLUME_GENERIC * BLOOD_OKAY_MULTI))
if(prob(5))
to_chat(H, span_danger("You feel drained!"))
if((BLOOD_VOLUME_GENERIC * BLOOD_OKAY_MULTI) to BLOOD_VOLUME_GENERIC)
if(H.nutrition >= NUTRITION_LEVEL_STARVING)
H.blood_volume += 3
H.adjust_nutrition(-2.5)
if(BLOOD_VOLUME_GENERIC to INFINITY)
H.adjustCloneLoss(-0.5) //slowly re-knit cell damage
var/datum/action/innate/regenerate_limbs/ability = locate() in instantiated_abilities
if(ability)
ability.build_all_button_icons()
/datum/species/jelly/proc/handle_wetness(mob/living/carbon/human/H)
var/datum/status_effect/fire_handler/wet_stacks/wetness = H.has_status_effect(/datum/status_effect/fire_handler/wet_stacks)
if(wetness && wetness.stacks >= 1) // needs at least 1 wetness stack to do anything
H.add_movespeed_modifier("slime_person_wet", update = TRUE, priority = 102, multiplicative_slowdown = 0.5, blacklisted_movetypes=(FLYING|FLOATING))
H.adjustCloneLoss(2)
if(H.stat != DEAD)
H.set_jitter_if_lower(10 SECONDS)
H.set_stutter_if_lower(1 SECONDS)
if(!soggy)//play once when it starts
H.emote("scream")
to_chat(H, span_userdanger("Every cell in your body begins to break down from the excess of water, get dry!"))
H.adjust_wet_stacks(-1)
soggy = TRUE
else if(soggy)
H.remove_movespeed_modifier("slime_person_wet")
to_chat(H, "You breathe a sigh of relief as you dry off.")
soggy = FALSE
/datum/species/jelly/proc/Cannibalize_Body(mob/living/carbon/human/H)
var/list/limbs_to_consume = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) - H.get_missing_limbs()
var/obj/item/bodypart/consumed_limb
if(!limbs_to_consume.len)
H.losebreath++
return
if(H.get_num_legs(FALSE)) //Legs go before arms
limbs_to_consume -= list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM)
consumed_limb = H.get_bodypart(pick(limbs_to_consume))
consumed_limb.drop_limb()
to_chat(H, span_userdanger("Your [consumed_limb] is drawn back into your body, unable to maintain its shape!"))
qdel(consumed_limb)
H.blood_volume += 20
/datum/species/jelly/random_name(gender,unique,lastname)//they have no lore, just use human names for now i guess
if(unique)
return random_unique_name()
return random_unique_name()
/datum/species/jelly/get_species_description()
return ""//"TODO: RIP in peace Skrem"
/datum/species/jelly/get_species_lore()
return list(
""//"TODO: RIP in peace Skrem"
)
/datum/species/jelly/get_butt_sprite()
return BUTT_SPRITE_SLIME
/datum/species/jelly/create_pref_unique_perks()
var/list/to_add = list()
to_add += list(list(
SPECIES_PERK_TYPE = SPECIES_NEGATIVE_PERK,
SPECIES_PERK_ICON = "splotch",
SPECIES_PERK_NAME = "Unstable Form",
SPECIES_PERK_DESC = "[plural_form] are made entirely of jelly, losing enough will result in them cannibalizing their own limbs to survive.",
),
list(
SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK,
SPECIES_PERK_ICON = "hand-sparkles",
SPECIES_PERK_NAME = "Regenerate Limbs",
SPECIES_PERK_DESC = "Being made entirely of jelly means [plural_form] can reform lost limbs from nothing assuming they have enough extra to spare.",
))
return to_add
// Slimes have both NOBLOOD and an exotic bloodtype set, so they need to be handled uniquely here.
/datum/species/jelly/create_pref_blood_perks()
var/list/to_add = list()
to_add += list(list(
SPECIES_PERK_TYPE = SPECIES_NEUTRAL_PERK,
SPECIES_PERK_ICON = "tint",
SPECIES_PERK_NAME = "Jelly Blood",
SPECIES_PERK_DESC = "[plural_form] don't have blood, but instead have toxic [initial(exotic_blood.name)]! This means they will heal from toxin damage but get hurt by toxin healing. \
Jelly is extremely important, and having low jelly will make medical treatment very difficult.",
))
return to_add
/datum/action/innate/regenerate_limbs
name = "Regenerate Limbs"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeheal"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
overlay_icon_state = "bg_alien_border"
/datum/action/innate/regenerate_limbs/IsAvailable(feedback = FALSE)
if(..())
var/mob/living/carbon/human/H = owner
var/list/limbs_to_heal = H.get_missing_limbs()
if(limbs_to_heal.len < 1)
return 0
if(H.blood_volume >= BLOOD_VOLUME_OKAY(H) + REGEN_BLOOD_REQUIREMENT)
return 1
return 0
/datum/action/innate/regenerate_limbs/Activate()
var/mob/living/carbon/human/H = owner
var/list/limbs_to_heal = H.get_missing_limbs()
if(limbs_to_heal.len < 1)
to_chat(H, span_notice("You feel intact enough as it is."))
return
to_chat(H, span_notice("You focus intently on your missing [limbs_to_heal.len >= 2 ? "limbs" : "limb"]..."))
if(H.blood_volume >= REGEN_BLOOD_REQUIREMENT*limbs_to_heal.len + BLOOD_VOLUME_OKAY(H))
H.regenerate_limbs()
H.blood_volume -= REGEN_BLOOD_REQUIREMENT*limbs_to_heal.len
to_chat(H, span_notice("...and after a moment you finish reforming!"))
return
else if(H.blood_volume >= REGEN_BLOOD_REQUIREMENT)//We can partially heal some limbs
while(H.blood_volume >= BLOOD_VOLUME_OKAY(H) + REGEN_BLOOD_REQUIREMENT)
var/healed_limb = pick(limbs_to_heal)
H.regenerate_limb(healed_limb)
limbs_to_heal -= healed_limb
H.blood_volume -= REGEN_BLOOD_REQUIREMENT
to_chat(H, span_warning("...but there is not enough of you to fix everything! You must attain more mass to heal completely!"))
return
to_chat(H, span_warning("...but there is not enough of you to go around! You must attain more mass to heal!"))
////////////////////////////////////////////////////////SLIMEPEOPLE///////////////////////////////////////////////////////////////////
//Slime people are able to split like slimes, retaining a single mind that can swap between bodies.
/datum/species/jelly/slime
name = "Slimeperson"
plural_form = "Slimepeople"
id = SPECIES_SLIMEPERSON
default_color = "00FFFF"
species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,STABLEBLOOD, HAS_FLESH)
say_mod = "says"
hair_color = "mutcolor"
hair_alpha = 150
ignored_by = list(/mob/living/simple_animal/slime)
species_abilities = list(
/datum/action/innate/regenerate_limbs,
/datum/action/innate/split_body,
/datum/action/innate/swap_body
)
var/list/mob/living/carbon/bodies
/datum/species/jelly/slime/on_species_loss(mob/living/carbon/C)
LAZYREMOVE(bodies, C)// This means that the other bodies maintain a link
// so if someone mindswapped into them, they'd still be shared.
bodies = null
C.blood_volume = min(C.blood_volume, BLOOD_VOLUME_NORMAL(C))
..()
/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species)
..()
if(ishuman(C))
LAZYADD(bodies, C)
//If you're cloned you get your body pool back
/datum/species/jelly/slime/copy_properties_from(datum/species/jelly/slime/old_species)
bodies = old_species.bodies
/datum/species/jelly/slime/spec_life(mob/living/carbon/human/H)
if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
if(prob(5))
to_chat(H, span_notice("You feel very bloated!"))
else if(H.nutrition >= NUTRITION_LEVEL_WELL_FED)
H.blood_volume += 3
H.adjust_nutrition(-2.5)
return ..()
/datum/action/innate/split_body
name = "Split Body"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimesplit"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
overlay_icon_state = "bg_alien_border"
/datum/action/innate/split_body/IsAvailable(feedback = FALSE)
if(..())
var/mob/living/carbon/human/H = owner
if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
return 1
return 0
/datum/action/innate/split_body/Activate()
var/mob/living/carbon/human/H = owner
if(!isslimeperson(H))
return
CHECK_DNA_AND_SPECIES(H)
H.visible_message("<span class='notice'>[owner] gains a look of \
concentration while standing perfectly still.</span>",
"<span class='notice'>You focus intently on moving your body while \
standing perfectly still...</span>")
H.notransform = TRUE
if(do_after(owner, 6 SECONDS, owner, FALSE))
if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
make_dupe()
else
to_chat(H, span_warning("...but there is not enough of you to go around! You must attain more mass to split!"))
else
to_chat(H, span_warning("...but fail to stand perfectly still!"))
H.notransform = FALSE
/datum/action/innate/split_body/proc/make_dupe()
var/mob/living/carbon/human/H = owner
CHECK_DNA_AND_SPECIES(H)
var/mob/living/carbon/human/spare = new /mob/living/carbon/human(H.loc)
spare.underwear = "Nude"
H.dna.transfer_identity(spare, transfer_SE=1)
spare.dna.features["mcolor"] = pick("#FFFFFF","#7F7F7F", "#7FFF7F", "#7F7FFF", "#FF7F7F", "#7FFFFF", "#FF7FFF", "#FFFF7F")
spare.dna.update_uf_block(DNA_MUTANT_COLOR_BLOCK)
spare.real_name = spare.dna.real_name
spare.name = spare.dna.real_name
spare.updateappearance(mutcolor_update=1)
spare.domutcheck()
spare.Move(get_step(H.loc, pick(NORTH,SOUTH,EAST,WEST)))
H.blood_volume *= 0.45
H.notransform = 0
var/datum/species/jelly/slime/origin_datum = H.dna.species
LAZYADD(origin_datum.bodies, spare)
var/datum/species/jelly/slime/spare_datum = spare.dna.species
spare_datum.bodies = origin_datum.bodies
H.transfer_trait_datums(spare)
H.mind.transfer_to(spare)
spare.visible_message("<span class='warning'>[H] distorts as a new body \
\"steps out\" of [H.p_them()].</span>",
"<span class='notice'>...and after a moment of disorentation, \
you're besides yourself!</span>")
/datum/action/innate/swap_body
name = "Swap Body"
check_flags = NONE
button_icon_state = "slimeswap"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
overlay_icon_state = "bg_alien_border"
/datum/action/innate/swap_body/Activate()
if(!isslimeperson(owner))
to_chat(owner, span_warning("You are not a slimeperson."))
Remove(owner)
else
ui_interact(owner)
/datum/action/innate/swap_body/ui_host(mob/user)
return owner
/datum/action/innate/swap_body/ui_state(mob/user)
return GLOB.not_incapacitated_state
/datum/action/innate/swap_body/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "SlimeBodySwapper", name)
ui.open()
/datum/action/innate/swap_body/ui_data(mob/user)
var/mob/living/carbon/human/H = owner
if(!isslimeperson(H))
return
var/datum/species/jelly/slime/SS = H.dna.species
var/list/data = list()
data["bodies"] = list()
for(var/b in SS.bodies)
var/mob/living/carbon/human/body = b
if(!body || QDELETED(body) || !isslimeperson(body))
SS.bodies -= b
continue
var/list/L = list()
// HTML colors need a # prefix
L["htmlcolor"] = body.dna.features["mcolor"]
L["area"] = get_area_name(body, TRUE)
var/stat = "error"
switch(body.stat)
if(CONSCIOUS)
stat = "Conscious"
//yogs start
if(SOFT_CRIT)
stat = "Barely Conscious"
//yogs end
if(UNCONSCIOUS)
stat = "Unconscious"
if(DEAD)
stat = "Dead"
var/occupied
if(body == H)
occupied = "owner"
else if(body.mind && body.mind.active)
occupied = "stranger"
else
occupied = "available"
L["status"] = stat
L["exoticblood"] = body.blood_volume
L["name"] = body.name
L["ref"] = "[REF(body)]"
L["occupied"] = occupied
var/button
if(occupied == "owner")
button = "selected"
else if(occupied == "stranger")
button = "danger"
else if(can_swap(body))
button = null
else
button = "disabled"
L["swap_button_state"] = button
L["swappable"] = (occupied == "available") && can_swap(body)
data["bodies"] += list(L)
return data
/datum/action/innate/swap_body/ui_act(action, params)
if(..())
return
var/mob/living/carbon/human/H = owner
if(!isslimeperson(owner))
return
if(!H.mind || !H.mind.active)
return
switch(action)
if("swap")
var/datum/species/jelly/slime/SS = H.dna.species
var/mob/living/carbon/human/selected = locate(params["ref"]) in SS.bodies
if(!can_swap(selected))
return
// SStgui.close_uis(src) // yogs - don't.
swap_to_dupe(H.mind, selected)
/datum/action/innate/swap_body/proc/can_swap(mob/living/carbon/human/dupe)
var/mob/living/carbon/human/H = owner
if(!isslimeperson(H))
return FALSE
var/datum/species/jelly/slime/SS = H.dna.species
if(QDELETED(dupe)) //Is there a body?
LAZYREMOVE(SS.bodies, dupe)
return FALSE
if(!isslimeperson(dupe)) //Is it a slimeperson?
LAZYREMOVE(SS.bodies, dupe)
return FALSE
if(H.stat != CONSCIOUS) //Are we alive and awake?
return FALSE
if(dupe.stat != CONSCIOUS) //Is it alive and awake?
return FALSE
if(dupe?.mind?.active) //Is it unoccupied?
return FALSE
if(!LAZYFIND(SS.bodies, dupe)) //Do we actually own it?
return FALSE
return TRUE
/datum/action/innate/swap_body/proc/swap_to_dupe(datum/mind/M, mob/living/carbon/human/dupe)
if(!can_swap(dupe)) //sanity check
return
if(M.current.stat == CONSCIOUS)
M.current.visible_message("<span class='notice'>[M.current] \
stops moving and starts staring vacantly into space.</span>",
span_notice("You stop moving this body..."))
else
to_chat(M.current, span_notice("You abandon this body..."))
M.current.transfer_trait_datums(dupe)
M.transfer_to(dupe)
dupe.visible_message("<span class='notice'>[dupe] blinks and looks \
around.</span>",
span_notice("...and move this one instead."))
////////////////////////////////////////////////////////////////////////////////////
//--------------------------------Luminescents------------------------------------//
////////////////////////////////////////////////////////////////////////////////////
/**
* Luminescents are able to consume and use slime extracts, without them decaying.
*/
/datum/species/jelly/luminescent
name = "Luminescent"
plural_form = null
id = SPECIES_LUMINESCENT
say_mod = "says"
var/glow_intensity = LUMINESCENT_DEFAULT_GLOW
species_abilities = list(
/datum/action/innate/regenerate_limbs,
/datum/action/innate/integrate_extract,
/datum/action/innate/use_extract,
/datum/action/innate/use_extract/major
)
var/obj/item/slime_extract/current_extract
var/extract_cooldown = 0
/// Internal dummy used to glow (very cool)
var/obj/effect/dummy/lighting_obj/moblight/species/glow
/datum/species/jelly/luminescent/Destroy(force, ...)
. = ..()
QDEL_NULL(glow)
/datum/species/jelly/luminescent/on_species_loss(mob/living/carbon/C)
..()
if(current_extract)
current_extract.forceMove(C.drop_location())
current_extract = null
QDEL_NULL(glow)
/datum/species/jelly/luminescent/on_species_gain(mob/living/carbon/C, datum/species/old_species)
..()
glow = C.mob_light(light_type = /obj/effect/dummy/lighting_obj/moblight/species)
update_glow(C)
/datum/species/jelly/luminescent/proc/update_slime_actions(mob/living/carbon/C)
for(var/datum/action/ability as anything in C.actions)
ability.build_all_button_icons()
/datum/species/jelly/luminescent/proc/update_glow(mob/living/carbon/C, intensity)
if(intensity)
glow_intensity = intensity
glow.set_light_range_power_color(glow_intensity, glow_intensity, C.dna.features["mcolor"])
/datum/action/innate/integrate_extract
name = "Integrate Extract"
desc = "Eat a slime extract to use its properties."
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeconsume"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
overlay_icon_state = "bg_alien_border"
var/datum/species/jelly/luminescent/species
/datum/action/innate/integrate_extract/link_to(Target)
. = ..()
if(ishuman(target))
var/mob/living/carbon/human/humie = target
if(humie?.dna?.species)
species = humie.dna.species
/datum/action/innate/integrate_extract/update_button_name(atom/movable/screen/movable/action_button/button, force = FALSE)
var/datum/species/jelly/luminescent/species = target
if(!istype(species) || !species.current_extract)
name = "Integrate Extract"
desc = "Eat a slime extract to use its properties."
else
name = "Eject Extract"
desc = "Eject your current slime extract."
return ..()
/datum/action/innate/integrate_extract/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force)
var/datum/species/jelly/luminescent/species = target
if(!istype(species) || !species.current_extract)
button_icon_state = "slimeconsume"
else
button_icon_state = "slimeeject"
return ..()
/datum/action/innate/integrate_extract/Activate()
var/mob/living/carbon/human/H = owner
if(!is_species(H, /datum/species/jelly/luminescent) || !species)
return
CHECK_DNA_AND_SPECIES(H)
if(species.current_extract)
var/obj/item/slime_extract/S = species.current_extract
if(!H.put_in_active_hand(S))
S.forceMove(H.drop_location())
species.current_extract = null
to_chat(H, span_notice("You eject [S]."))
species.update_slime_actions(H)
else
var/obj/item/I = H.get_active_held_item()
if(istype(I, /obj/item/slime_extract))
var/obj/item/slime_extract/S = I
if(!S.Uses)
to_chat(H, span_warning("[I] is spent! You cannot integrate it."))
return
if(!H.temporarilyRemoveItemFromInventory(S))
return
S.forceMove(H)
species.current_extract = S
to_chat(H, span_notice("You consume [I], and you feel it pulse within you..."))
species.update_slime_actions(H)
else
to_chat(H, span_warning("You need to hold an unused slime extract in your active hand!"))
/datum/action/innate/use_extract
name = "Extract Minor Activation"
desc = "Pulse the slime extract with energized jelly to activate it."
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeuse1"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
overlay_icon_state = "bg_alien_border"
var/activation_type = SLIME_ACTIVATE_MINOR
var/datum/species/jelly/luminescent/species
/datum/action/innate/use_extract/link_to(Target)
. = ..()
if(ishuman(target))
var/mob/living/carbon/human/humie = target
if(humie?.dna?.species)
species = humie.dna.species
/datum/action/innate/use_extract/IsAvailable(feedback = FALSE)
if(..())
if(species && species.current_extract && (world.time > species.extract_cooldown))
return TRUE
return FALSE
/datum/action/innate/use_extract/apply_button_icon(atom/movable/screen/movable/action_button/current_button, force)
..(current_button, TRUE)
if(species && species.current_extract)
current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state))
/datum/action/innate/use_extract/Activate()
var/mob/living/carbon/human/H = owner
if(!is_species(H, /datum/species/jelly/luminescent) || !species || H.incapacitated())
return
CHECK_DNA_AND_SPECIES(H)
if(species.current_extract)
species.extract_cooldown = world.time + 100
var/cooldown = species.current_extract.activate(H, species, activation_type)
species.extract_cooldown = world.time + cooldown
/datum/action/innate/use_extract/major
name = "Extract Major Activation"
desc = "Pulse the slime extract with plasma jelly to activate it."
button_icon_state = "slimeuse2"
activation_type = SLIME_ACTIVATE_MAJOR
///////////////////////////////////STARGAZERS//////////////////////////////////////////
//Stargazers are the telepathic branch of jellypeople, able to project psychic messages and to link minds with willing participants.
/datum/species/jelly/stargazer
name = "Stargazer"
plural_form = null
id = SPECIES_STARGAZER
species_abilities = list(
/datum/action/innate/regenerate_limbs,
/datum/action/cooldown/spell/touch/link_minds,
/datum/action/innate/project_thought
)
/datum/action/cooldown/spell/touch/link_minds
name = "Link Minds"
desc = "Link someone's mind to your Slime Link, allowing them to communicate telepathically with other linked minds."
button_icon_state = "mindlink"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
overlay_icon_state = "bg_alien_border"
spell_requirements = NONE
invocation_type = INVOCATION_NONE
var/list/datum/action/speech_abilities = list()
/datum/action/cooldown/spell/touch/link_minds/Grant(mob/grant_to)
. = ..()
var/datum/action/innate/slime_speech/action = new(grant_to)
action.Grant(grant_to)
action.linkage = src
speech_abilities += action
/datum/action/cooldown/spell/touch/link_minds/Remove(mob/living/remove_from)
for(var/datum/action/ability as anything in speech_abilities)
ability.Remove(ability.owner)
qdel(ability)
return ..()
/datum/action/cooldown/spell/touch/link_minds/cast_on_hand_hit(obj/item/melee/touch_attack/hand, atom/target, mob/living/carbon/caster)
if(!isliving(target))
return
var/mob/living/victim = target
to_chat(caster, span_notice("You begin linking [victim]'s mind to yours..."))
to_chat(victim, span_warning("You feel a foreign presence within your mind..."))
if(!do_after(caster, 5 SECONDS, victim))
return
for(var/datum/action/ability as anything in victim.actions)
if(istype(ability, /datum/action/innate/slime_speech))
var/datum/action/innate/slime_speech/speaker = ability
if(speaker.linkage == src)
speech_abilities -= speaker
speaker.Remove(victim)
qdel(speaker)
to_chat(caster, span_notice("You release [victim] from your Slime Link."))
to_chat(victim, span_notice("You are no longer connected to [caster.real_name]'s Slime Link."))
return TRUE
var/datum/action/innate/slime_speech/action = new(victim)
action.Grant(victim)
action.linkage = src
speech_abilities += action
to_chat(caster, span_notice("You connect [victim]'s mind to your slime link!"))
to_chat(victim, span_notice("You are now connected to [caster.real_name]'s Slime Link."))
return TRUE
/datum/action/innate/slime_speech
name = "Slimelink"
desc = "Send a psychic message to everyone connected to your slime link."
button_icon_state = "link_speech"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
var/datum/action/cooldown/spell/touch/link_minds/linkage
/datum/action/innate/slime_speech/Activate()
var/mob/living/carbon/human/H = owner
if(!linkage)
to_chat(H, span_warning("The link seems to have been severed..."))
Remove(H)
return
var/message = sanitize(input("Message:", "Slime Telepathy") as text|null)
if(QDELETED(H) || H.stat == DEAD)
return
if(!linkage)
to_chat(H, span_warning("The link seems to have been severed..."))
Remove(H)
return
if(message)
var/msg = "<i><font color=#008CA2>\[[linkage.owner.real_name]'s Slime Link\] <b>[H]:</b> [message]</font></i>"
log_directed_talk(H, linkage.owner, msg, LOG_SAY, "slime link")
for(var/X in linkage.speech_abilities)
var/datum/action/innate/linked_speech = X
if(!linked_speech || !istype(linked_speech))
continue
to_chat(linked_speech.owner, msg)
for(var/X in GLOB.dead_mob_list)
var/mob/M = X
var/link = FOLLOW_LINK(M, H)
to_chat(M, "[link] [msg]")
/datum/action/innate/project_thought
name = "Send Thought"
desc = "Send a private psychic message to someone you can see."
button_icon_state = "send_mind"
button_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
overlay_icon_state = "bg_alien_border"
/datum/action/innate/project_thought/Activate()
var/mob/living/carbon/human/H = owner
if(H.stat == DEAD)
return
if(!is_species(H, /datum/species/jelly/stargazer))
return
CHECK_DNA_AND_SPECIES(H)
var/list/options = list()
for(var/mob/living/Ms in oview(H))
options += Ms
var/mob/living/M = input("Select who to send your message to:","Send thought to?",null) as null|mob in options
if(!M)
return
if(M.can_block_magic(MAGIC_RESISTANCE_MIND, charge_cost = 0))
to_chat(H, span_notice("As you try to communicate with [M], you're suddenly stopped by a vision of a massive tinfoil wall that streches beyond visible range. It seems you've been foiled."))
return
var/msg = sanitize(input("Message:", "Telepathy") as text|null)
if(msg)
if(M.can_block_magic(MAGIC_RESISTANCE_MIND, charge_cost = 0))
to_chat(H, span_notice("As you try to communicate with [M], you're suddenly stopped by a vision of a massive tinfoil wall that streches beyond visible range. It seems you've been foiled."))
return
log_directed_talk(H, M, msg, LOG_SAY, "slime telepathy")
to_chat(M, "[span_notice("You hear an alien voice in your head... ")]<font color=#008CA2>[msg]</font>")
to_chat(H, span_notice("You telepathically said: \"[msg]\" to [M]"))
for(var/dead in GLOB.dead_mob_list)
if(!isobserver(dead))
continue
var/follow_link_user = FOLLOW_LINK(dead, H)
var/follow_link_target = FOLLOW_LINK(dead, M)
to_chat(dead, "[follow_link_user] [span_name("[H]")] [span_alertalien("Slime Telepathy --> ")] [follow_link_target] [span_name("[M]")] [span_noticealien("[msg]")]")