Skip to content

Commit 3638db0

Browse files
committed
glare
1 parent 28711cd commit 3638db0

File tree

12 files changed

+108
-11
lines changed

12 files changed

+108
-11
lines changed

code/datums/actions/action.dm

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,21 @@
151151
return FALSE
152152
if((check_flags & AB_CHECK_HANDS_BLOCKED) && HAS_TRAIT(owner, TRAIT_HANDS_BLOCKED))
153153
if (feedback)
154-
to_chat(owner, span_warning("You cannot use [name] without hands!"))
154+
to_chat(owner, span_warning("You cannot use [name] without hands."))
155155
return FALSE
156156
if((check_flags & AB_CHECK_IMMOBILE) && HAS_TRAIT(owner, TRAIT_IMMOBILIZED))
157157
if (feedback)
158-
to_chat(owner, span_warning("You cannot use [name] while immobilized!"))
158+
to_chat(owner, span_warning("You cannot use [name] while immobilized."))
159159
return FALSE
160160
if((check_flags & AB_CHECK_LYING) && isliving(owner))
161161
var/mob/living/action_owner = owner
162162
if(action_owner.body_position == LYING_DOWN)
163163
if (feedback)
164-
to_chat(owner, span_warning("You cannot use [name] while lying down!"))
164+
to_chat(owner, span_warning("You cannot use [name] while lying down."))
165165
return FALSE
166166
if((check_flags & AB_CHECK_CONSCIOUS) && owner.stat != CONSCIOUS)
167167
if (feedback)
168-
to_chat(owner, span_warning("You cannot use [name] while unconscious!"))
168+
to_chat(owner, span_warning("You cannot use [name] while unconscious."))
169169
return FALSE
170170
return TRUE
171171

code/datums/actions/cooldown_action.dm

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define COOLDOWN_NO_DISPLAY_TIME (180 SECONDS)
2-
31
/// Preset for an action that has a cooldown.
42
/datum/action/cooldown
53
check_flags = NONE
@@ -67,19 +65,22 @@
6765
/datum/action/cooldown/create_button()
6866
var/atom/movable/screen/movable/action_button/button = ..()
6967
button.maptext = ""
70-
button.maptext_x = 6
68+
button.maptext_x = 3
7169
button.maptext_y = 2
72-
button.maptext_width = 24
70+
button.maptext_width = 28
7371
button.maptext_height = 12
7472
return button
7573

7674
/datum/action/cooldown/update_button_status(atom/movable/screen/movable/action_button/button, force = FALSE)
7775
. = ..()
7876
var/time_left = max(next_use_time - world.time, 0)
79-
if(!text_cooldown || !owner || time_left == 0 || time_left >= COOLDOWN_NO_DISPLAY_TIME)
77+
if(!text_cooldown || !owner || time_left == 0)
8078
button.maptext = ""
8179
else
82-
button.maptext = MAPTEXT("<b>[round(time_left/10, 0.1)]</b>")
80+
if(time_left > 60 SECONDS)
81+
button.maptext = MAPTEXT("<b>[ceil(time_left/600)] min")
82+
else
83+
button.maptext = MAPTEXT("<b>[round(time_left/10, 0.1)]</b>")
8384

8485
if(!IsAvailable() || !is_action_active(button))
8586
return

code/game/objects/effects/temporary_visuals/miscellaneous.dm

+7
Original file line numberDiff line numberDiff line change
@@ -571,3 +571,10 @@
571571
pixel_y = -16
572572
base_pixel_y = -16
573573
duration = 10
574+
575+
/obj/effect/temp_visual/vamp_glare
576+
icon = 'goon/icons/64x64.dmi'
577+
icon_state = "glare"
578+
pixel_x = -16
579+
pixel_y = -8
580+
duration = 2 SECONDS

code/modules/antagonists/vampire/blood_plague.dm

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
pathogen_flags = NONE
1515
spread_flags = PATHOGEN_SPREAD_BLOOD
16+
visibility_flags = HIDDEN_SCANNER|HIDDEN_PANDEMIC
1617

1718
/datum/pathogen/blood_plague/on_process(delta_time, times_fired)
1819
if(affected_mob.stat != CONSCIOUS)

code/modules/antagonists/vampire/vampire.dm

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
var/list/innate_actions = list(
1616
/datum/action/cooldown/neck_bite,
17+
/datum/action/cooldown/glare,
1718
)
1819

1920
/datum/antagonist/vampire/New()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/datum/action/cooldown/glare
2+
name = "Glare"
3+
desc = "Enfeeble a target with a single glare."
4+
button_icon = 'goon/icons/actions.dmi'
5+
button_icon_state = "hypno"
6+
ranged_mousepointer = 'icons/effects/mouse_pointers/cult_target.dmi'
7+
8+
check_flags = AB_CHECK_CONSCIOUS
9+
click_to_activate = TRUE
10+
11+
cooldown_time = 180 SECONDS
12+
13+
/datum/action/cooldown/glare/is_valid_target(atom/cast_on)
14+
var/mob/living/carbon/human/victim = cast_on
15+
if(!istype(cast_on))
16+
return FALSE
17+
18+
if(victim == owner)
19+
return FALSE
20+
21+
if(victim.stat != CONSCIOUS)
22+
return FALSE
23+
24+
if(get_dist(victim, cast_on) > 2)
25+
to_chat(owner, span_warning("[victim] is too far away."))
26+
return FALSE
27+
28+
if(victim.loc != owner.loc)
29+
var/victim_to_attacker = get_dir(victim, owner)
30+
if(victim.dir & REVERSE_DIR(victim_to_attacker))
31+
to_chat(owner, span_warning("[victim] is not looking at you."))
32+
return FALSE
33+
return TRUE
34+
35+
/datum/action/cooldown/glare/IsAvailable(feedback)
36+
. = ..()
37+
if(!.)
38+
return
39+
40+
if(owner.incapacitated(IGNORE_RESTRAINTS|IGNORE_GRAB))
41+
if (feedback)
42+
to_chat(owner, span_warning("You cannot use [name] while incapacitated."))
43+
return FALSE
44+
45+
var/mob/living/carbon/human/human_owner = owner
46+
var/obj/item/organ/eyes/eyes = human_owner.getorganslot(ORGAN_SLOT_EYES)
47+
if(!eyes || (eyes.organ_flags & ORGAN_DEAD))
48+
if (feedback)
49+
to_chat(owner, span_warning("You cannot use [name] while you have no eyes."))
50+
return FALSE
51+
52+
if(human_owner.is_blind())
53+
if (feedback)
54+
to_chat(owner, span_warning("You cannot use [name] while you are blind."))
55+
return FALSE
56+
57+
/datum/action/cooldown/glare/Activate(atom/target)
58+
. = ..()
59+
var/mob/living/carbon/human/victim = target
60+
61+
glare_visual(get_turf(owner))
62+
addtimer(CALLBACK(src, PROC_REF(glare_visual), victim.loc), 0.1 SECONDS)
63+
playsound(target, 'goon/sounds/glare.ogg', 50, TRUE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE)
64+
owner.visible_message(span_notice("[owner] glances into [target]'s eyes."), vision_distance = COMBAT_MESSAGE_RANGE)
65+
66+
if(victim.get_total_tint() || victim.get_eye_protection())
67+
return // Lol owned
68+
69+
if(!victim.flash_act(INFINITY, FALSE, FALSE, TRUE))
70+
return // Lol owned
71+
72+
victim.stamina.adjust(-300)
73+
victim.adjust_drowsyness(50)
74+
75+
/datum/action/cooldown/glare/proc/glare_visual(loc)
76+
new /obj/effect/temp_visual/vamp_glare(loc)

code/modules/antagonists/vampire/vampire_actions/neck_bite.dm

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
. = ..()
6565

6666
spawn(-1)
67+
ADD_TRAIT(user, TRAIT_MUTE, ref(src))
6768
var/image/succ_image = image('goon/icons/actions.dmi', "blood")
6869
while(TRUE)
6970
if(!can_bite(user, victim))
@@ -75,6 +76,8 @@
7576

7677
siphon_blood(user, victim)
7778

79+
REMOVE_TRAIT(user, TRAIT_MUTE, ref(src))
80+
7881
/datum/action/cooldown/neck_bite/proc/siphon_blood(mob/living/carbon/human/user, mob/living/carbon/human/victim)
7982
user.visible_message(span_danger("[user] siphons blood from [victim]'s neck!"), vision_distance = COMBAT_MESSAGE_RANGE, ignored_mobs = victim)
8083
if(victim.stat == CONSCIOUS)
@@ -165,7 +168,7 @@
165168

166169
for(var/obj/item/hand_item/grab/grab in user.active_grabs)
167170
var/mob/living/carbon/human/potential_victim = grab.affecting
168-
if(!ishuman(potential_victim))
171+
if(!ishuman(potential_victim) || ismonkey(potential_victim))
169172
if(ismob(potential_victim) && error_string_ptr)
170173
*error_string_ptr = "You cannot feast on [potential_victim]."
171174
continue

code/modules/antagonists/vampire/vampire_states/vampire_bloodlust.dm

+4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@
77

88
/datum/vampire_state/bloodlust/enter_state(mob/living/carbon/human/host)
99
. = ..()
10+
host.add_movespeed_modifier(/datum/movespeed_modifier/vampire_bloodlust)
1011
host.mob_mood.add_mood_event("vampire", /datum/mood_event/vampire_bloodlust)
12+
host.stats.set_skill_modifier(2, /datum/rpg_skill/skirmish, "vampire")
1113

1214
/datum/vampire_state/bloodlust/exit_state(mob/living/carbon/human/host)
1315
. = ..()
1416
host.mob_mood.clear_mood_event("vampire")
17+
host.stats.remove_skill_modifier(/datum/rpg_skill/skirmish, "vampire")
18+
host.remove_movespeed_modifier(/datum/movespeed_modifier/vampire_bloodlust)
1519

1620
/datum/vampire_state/bloodlust/tick(delta_time, mob/living/carbon/human/host)
1721
. = ..()

code/modules/movespeed/modifiers/misc.dm

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
slowdown = -0.65
66
blacklisted_movetypes = (FLYING|FLOATING)
77

8+
/datum/movespeed_modifier/vampire_bloodlust
9+
slowdown = -1
10+
811
/datum/movespeed_modifier/vampire_starving
912
slowdown = 1
1013

daedalus.dme

+1
Original file line numberDiff line numberDiff line change
@@ -2309,6 +2309,7 @@
23092309
#include "code\modules\antagonists\traitor\objectives\steal.dm"
23102310
#include "code\modules\antagonists\vampire\blood_plague.dm"
23112311
#include "code\modules\antagonists\vampire\vampire.dm"
2312+
#include "code\modules\antagonists\vampire\vampire_actions\glare.dm"
23122313
#include "code\modules\antagonists\vampire\vampire_actions\neck_bite.dm"
23132314
#include "code\modules\antagonists\vampire\vampire_states\_vampire_states.dm"
23142315
#include "code\modules\antagonists\vampire\vampire_states\vampire_bloodlust.dm"

goon/icons/64x64.dmi

278 KB
Binary file not shown.

goon/sounds/glare.ogg

3.34 KB
Binary file not shown.

0 commit comments

Comments
 (0)