|
28 | 28 | /datum/mutation/human/antenna/get_visual_indicator() |
29 | 29 | return visual_indicators[type][1] |
30 | 30 |
|
31 | | -/datum/mutation/human/mindreader |
32 | | - name = "Mind Reader" |
33 | | - desc = "The affected person can look into the recent memories of others." |
34 | | - quality = POSITIVE |
35 | | - text_gain_indication = span_notice("You hear distant voices at the corners of your mind.") |
36 | | - text_lose_indication = span_notice("The distant voices fade.") |
37 | | - power_path = /datum/action/cooldown/spell/pointed/mindread |
38 | | - instability = 40 |
39 | | - difficulty = 8 |
40 | | - locked = TRUE |
41 | | - |
42 | | -/datum/action/cooldown/spell/pointed/mindread |
43 | | - name = "Mindread" |
44 | | - desc = "Read the target's mind." |
45 | | - button_icon_state = "mindread" |
46 | | - cooldown_time = 5 SECONDS |
47 | | - spell_requirements = SPELL_REQUIRES_NO_ANTIMAGIC |
48 | | - antimagic_flags = MAGIC_RESISTANCE_MIND |
49 | | - ranged_mousepointer = 'icons/effects/mouse_pointers/mindswap_target.dmi' |
50 | | - |
51 | | -/datum/action/cooldown/spell/pointed/mindread/is_valid_target(atom/cast_on) |
52 | | - if(!isliving(cast_on)) |
53 | | - return FALSE |
54 | | - var/mob/living/living_cast_on = cast_on |
55 | | - if(!living_cast_on.mind) |
56 | | - to_chat(owner, span_warning("[cast_on] has no mind to read!")) |
57 | | - return FALSE |
58 | | - if(living_cast_on.stat == DEAD) |
59 | | - to_chat(owner, span_warning("[cast_on] is dead!")) |
60 | | - return FALSE |
61 | | - |
62 | | - return TRUE |
63 | | - |
64 | | -/datum/action/cooldown/spell/pointed/mindread/cast(mob/living/cast_on) |
65 | | - . = ..() |
66 | | - if(cast_on.can_block_magic(MAGIC_RESISTANCE_MIND, charge_cost = 0)) |
67 | | - to_chat(owner, span_warning("As you reach into [cast_on]'s mind, \ |
68 | | - you are stopped by a mental blockage. It seems you've been foiled.")) |
69 | | - return |
70 | | - |
71 | | - if(cast_on == owner) |
72 | | - to_chat(owner, span_warning("You plunge into your mind... Yep, it's your mind.")) |
73 | | - return |
74 | | - |
75 | | - to_chat(owner, span_boldnotice("You plunge into [cast_on]'s mind...")) |
76 | | - if(prob(20)) |
77 | | - // chance to alert the read-ee |
78 | | - to_chat(cast_on, span_danger("You feel something foreign enter your mind.")) |
79 | | - |
80 | | - var/list/recent_speech = list() |
81 | | - var/list/say_log = list() |
82 | | - var/log_source = cast_on.logging |
83 | | - //this whole loop puts the read-ee's say logs into say_log in an easy to access way |
84 | | - for(var/log_type in log_source) |
85 | | - var/nlog_type = text2num(log_type) |
86 | | - if(nlog_type & LOG_SAY) |
87 | | - var/list/reversed = log_source[log_type] |
88 | | - if(islist(reversed)) |
89 | | - say_log = reverse_range(reversed.Copy()) |
90 | | - break |
91 | | - |
92 | | - for(var/spoken_memory in say_log) |
93 | | - //up to 3 random lines of speech, favoring more recent speech |
94 | | - if(length(recent_speech) >= 3) |
95 | | - break |
96 | | - if(prob(50)) |
97 | | - continue |
98 | | - // log messages with tags like telepathy are displayed like "(Telepathy to Ckey/(target)) "greetings""" |
99 | | - // by splitting the text by using a " delimiter, we can grab JUST the greetings part |
100 | | - recent_speech[spoken_memory] = splittext(say_log[spoken_memory], "\"", 1, 0, TRUE)[3] |
101 | | - |
102 | | - if(length(recent_speech)) |
103 | | - to_chat(owner, span_boldnotice("You catch some drifting memories of their past conversations...")) |
104 | | - for(var/spoken_memory in recent_speech) |
105 | | - to_chat(owner, span_notice("[recent_speech[spoken_memory]]")) |
106 | | - |
107 | | - if(iscarbon(cast_on)) |
108 | | - var/mob/living/carbon/carbon_cast_on = cast_on |
109 | | - to_chat(owner, span_boldnotice("You find that their intent is to [carbon_cast_on.a_intent]...")) |
110 | | - to_chat(owner, span_boldnotice("You uncover that [carbon_cast_on.p_their()] true identity is [carbon_cast_on.mind.name].")) |
111 | | - |
112 | | -/datum/mutation/human/mindreader/New(class_ = MUT_OTHER, timer, datum/mutation/human/copymut) |
113 | | - ..() |
114 | | - if(!(type in visual_indicators)) |
115 | | - visual_indicators[type] = list(mutable_appearance('icons/effects/genetics.dmi', "antenna", -FRONT_MUTATIONS_LAYER+1)) |
116 | | - |
117 | | -/datum/mutation/human/mindreader/get_visual_indicator() |
118 | | - return visual_indicators[type][1] |
0 commit comments