-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathmesmerize.dm
146 lines (137 loc) · 6.42 KB
/
mesmerize.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
/**
* MEZMERIZE
* Locks a target in place for a certain amount of time.
*
* Level 2: Additionally mutes
* Level 3: Can be used through face protection
* Level 5: Doesn't need to be facing you anymore
*/
/datum/action/cooldown/bloodsucker/targeted/mesmerize
name = "Mesmerize"
desc = "Dominate the mind of a mortal who can see your eyes."
button_icon_state = "power_mez"
power_explanation = "Mesmerize:\n\
Click any player to attempt to mesmerize them. This process takes 5 seconds and will be interrupted on movement.\n\
You cannot wear anything covering your face, and both parties must be facing eachother. Obviously, both parties need to not be blind. \n\
If your target is already mesmerized or a Monster Hunter, the Power will fail.\n\
Once mesmerized, the target will be unable to move for a certain amount of time, scaling with level.\n\
At level 1, your target will additionally be muted.\n\
At level 3, you will be able to use the power through items covering your face.\n\
At level 5, you will be able to mesmerize regardless of your target's direction.\n\
Higher levels will increase the time of the mesmerize's freeze."
power_flags = BP_AM_TOGGLE
check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS
purchase_flags = BLOODSUCKER_CAN_BUY|VASSAL_CAN_BUY
bloodcost = 30
cooldown_time = 20 SECONDS
target_range = 8
power_activates_immediately = FALSE
prefire_message = "Whom will you subvert to your will?"
ascended_power = /datum/action/cooldown/bloodsucker/targeted/mesmerize/shadow
var/mesmerizingtime = 5 SECONDS
/datum/action/cooldown/bloodsucker/targeted/mesmerize/CanUse(mob/living/carbon/user)
. = ..()
if(!.) // Default checks
return FALSE
if(!user.getorganslot(ORGAN_SLOT_EYES))
to_chat(user, span_warning("You have no eyes with which to mesmerize."))
return FALSE
// Check: Eyes covered?
if(istype(user) && (user.is_eyes_covered() && level_current <= 2) || !isturf(user.loc))
to_chat(user, span_warning("Your eyes are concealed from sight."))
return FALSE
return TRUE
/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckValidTarget(atom/target_atom)
. = ..()
if(!.)
return FALSE
return isliving(target_atom)
/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckCanTarget(atom/target_atom)
. = ..()
if(!.)
return FALSE
var/mob/living/current_target = target_atom // We already know it's carbon due to CheckValidTarget()
// No mind
if(!current_target.mind)
to_chat(owner, span_warning("[current_target] is mindless."))
return FALSE
// Bloodsucker
if(IS_BLOODSUCKER(current_target))
to_chat(owner, span_notice("Bloodsuckers are immune to [src]."))
return FALSE
// Dead/Unconscious
if(current_target.stat > CONSCIOUS)
to_chat(owner, "[current_target] is not [(current_target.stat == DEAD || HAS_TRAIT(current_target, TRAIT_FAKEDEATH)) ? "alive" : "conscious"].")
return FALSE
// Target has eyes?
if(!current_target.getorganslot(ORGAN_SLOT_EYES))
to_chat(owner, span_warning("[current_target] has no eyes."))
return FALSE
// Target blind?
if(current_target.eye_blind > 0)
to_chat(owner, span_warning("[current_target] is blind."))
return FALSE
//Facing target?
if(!is_A_facing_B(owner, current_target)) // in unsorted.dm
to_chat(owner, span_warning("You must be facing [current_target]."))
return FALSE
// Target facing me? (On the floor, they're facing everyone)
if(((current_target.mobility_flags & MOBILITY_STAND) && !is_A_facing_B(current_target, owner) && level_current <= 4))
to_chat(owner, span_warning("[current_target] must be facing you."))
return FALSE
return TRUE
/datum/action/cooldown/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/target_atom)
. = ..()
var/mob/living/target = target_atom
var/mob/living/user = owner
to_chat(owner, span_notice("Attempting to hypnotically gaze [target]..."))
if(!power_activates_immediately)
if(!do_after(user, mesmerizingtime, target))
return
power_activated_sucessfully() // PAY COST! BEGIN COOLDOWN!
var/power_time = 90 + level_current * 15
if(IS_MONSTERHUNTER(target))
to_chat(target, span_warning("You feel your eyes burn for a while, but it passes."))
return
if(HAS_TRAIT_FROM(target, TRAIT_MUTE, BLOODSUCKER_TRAIT))
to_chat(owner, span_notice("[target] is already in a hypnotic gaze."))
return
if(iscarbon(target))
var/mob/living/carbon/mesmerized = target
to_chat(owner, span_notice("Successfully mesmerized [mesmerized]."))
if(level_current >= 1)
ADD_TRAIT(mesmerized, TRAIT_MUTE, BLOODSUCKER_TRAIT)
mesmerized.Immobilize(power_time)
//mesmerized.silent += power_time / 10 // Silent isn't based on ticks.
mesmerized.next_move = world.time + power_time // <--- Use direct change instead. We want an unmodified delay to their next move // mesmerized.changeNext_move(power_time) // check click.dm
mesmerized.notransform = TRUE // <--- Fuck it. We tried using next_move, but they could STILL resist. We're just doing a hard freeze.
addtimer(CALLBACK(src, PROC_REF(end_mesmerize), user, target), power_time)
if(issilicon(target))
var/mob/living/silicon/mesmerized = target
mesmerized.emp_act(EMP_HEAVY)
DeactivatePower()
/datum/action/cooldown/bloodsucker/targeted/mesmerize/proc/end_mesmerize(mob/living/user, mob/living/target)
target.notransform = FALSE
REMOVE_TRAIT(target, TRAIT_MUTE, BLOODSUCKER_TRAIT)
// They Woke Up! (Notice if within view)
if(istype(user) && target.stat == CONSCIOUS && (target in view(6, get_turf(user))))
to_chat(owner, span_warning("[target] snapped out of their trance."))
/datum/action/cooldown/bloodsucker/targeted/mesmerize/shadow
name = "Glare"
background_icon = 'icons/mob/actions/actions_lasombra_bloodsucker.dmi'
active_background_icon_state = "lasombra_power_on"
base_background_icon_state = "lasombra_power_off"
button_icon = 'icons/mob/actions/actions_lasombra_bloodsucker.dmi'
button_icon_state = "power_glare"
additional_text = "Additionally makes the stun downtime based on distance, being instant when adjacent."
purchase_flags = LASOMBRA_CAN_BUY
ascended_power = null
/datum/action/cooldown/bloodsucker/targeted/mesmerize/shadow/FireTargetedPower(atom/target_atom)
var/mob/living/target = target_atom
var/mob/living/user = owner
if(target.Adjacent(user))
power_activates_immediately = TRUE
else
mesmerizingtime = initial(mesmerizingtime) - ((-get_dist(target, user) + 8 )/2) SECONDS //won't screw you up that bad if you miss it barely
power_activates_immediately = FALSE
return ..()