-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
blind.dm
43 lines (35 loc) · 1.32 KB
/
blind.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
/datum/action/cooldown/spell/pointed/blind
name = "Blind"
desc = "This spell temporarily blinds a single target."
button_icon_state = "blind"
ranged_mousepointer = 'icons/effects/mouse_pointers/blind_target.dmi'
sound = 'sound/magic/blind.ogg'
school = SCHOOL_TRANSMUTATION
cooldown_time = 30 SECONDS
cooldown_reduction_per_rank = 6.25 SECONDS
invocation = "STI KALY"
invocation_type = INVOCATION_WHISPER
spell_requirements = SPELL_REQUIRES_NO_ANTIMAGIC
active_msg = "You prepare to blind a target..."
/// The amount of blind to apply
var/eye_blind_duration = 20 SECONDS
/// The amount of blurriness to apply
var/eye_blur_duration = 40 SECONDS
/datum/action/cooldown/spell/pointed/blind/is_valid_target(atom/cast_on)
. = ..()
if(!.)
return FALSE
if(!ishuman(cast_on))
return FALSE
var/mob/living/carbon/human/human_target = cast_on
return !is_blind(human_target)
/datum/action/cooldown/spell/pointed/blind/cast(mob/living/carbon/human/cast_on)
. = ..()
if(cast_on.can_block_magic(antimagic_flags))
to_chat(cast_on, span_notice("Your eye itches, but it passes momentarily."))
to_chat(owner, span_warning("The spell had no effect!"))
return FALSE
to_chat(cast_on, span_warning("Your eyes cry out in pain!"))
cast_on.adjust_blindness(eye_blind_duration)
cast_on.adjust_eye_blur(eye_blur_duration)
return TRUE