-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Its time to go to heaven my child (Divine Warning) #3303
Changes from 14 commits
72e399b
e9c015f
8083ab3
55fd3ba
e6ea099
055e9f1
0e0c342
bc8c191
a857a03
a632eec
d4d942b
ea1e505
bdcb744
5e5d753
a58af80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,77 @@ | ||||||
#define HEAVEN_TIMETOGO (1<<0) | ||||||
#define HEAVEN_TIMETOGO_PLAYED (1<<1) | ||||||
|
||||||
/atom/movable/screen/fullscreen/divine | ||||||
icon = 'monkestation/code/modules/divine_warning/icons/divine_warning.dmi' | ||||||
icon_state = "he_waits_for_you" | ||||||
layer = EMISSIVE_LAYER_UNBLOCKABLE | ||||||
alpha = 120 | ||||||
|
||||||
/mob/living/proc/flash_divine_overlay(alpha = 120, soundvolume = 80, time = 2 SECONDS, force = FALSE) | ||||||
if(client?.prefs?.read_preference(/datum/preference/toggle/darkened_flash)) | ||||||
clear_fullscreen("divine", time) | ||||||
return | ||||||
if (COOLDOWN_FINISHED(src, divine_cooldown) || force) | ||||||
soundvolume *= 0.8 | ||||||
SEND_SOUND(src, sound('monkestation/code/modules/divine_warning/sounds/divine.ogg', volume = soundvolume)) | ||||||
overlay_fullscreen("divine", /atom/movable/screen/fullscreen/divine, 1, alpha) | ||||||
COOLDOWN_START(src, divine_cooldown, 2.5 SECONDS) | ||||||
clear_fullscreen("divine", time) | ||||||
|
||||||
/mob/living/death(gibbed) | ||||||
. = ..() | ||||||
if (QDELETED(client) || stat == DEAD) | ||||||
return | ||||||
|
||||||
if (HAS_TRAIT(src, TRAIT_SPIRITUAL) || mind?.holy_role) | ||||||
SEND_SOUND(src, sound('monkestation/code/modules/divine_warning/sounds/divine.ogg', 80)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see previous suggestion regarding |
||||||
COOLDOWN_START(src, divine_cooldown, 2.5 SECONDS) | ||||||
|
||||||
/mob/living | ||||||
COOLDOWN_DECLARE(divine_cooldown) | ||||||
var/heaven_flags = 0 | ||||||
|
||||||
/mob/living/update_damage_hud() | ||||||
. = ..() | ||||||
// if (!client || !HAS_TRAIT(src, TRAIT_DIVINE)) return | ||||||
if (QDELETED(client)) | ||||||
return | ||||||
|
||||||
if(health <= hardcrit_threshold && (HAS_TRAIT(src, TRAIT_SPIRITUAL) || mind?.holy_role) && stat != DEAD) | ||||||
// playsound(src, 'monkestation/code/modules/divine_warning/sounds/divine.ogg', 60, TRUE, use_reverb = TRUE, pressure_affected = FALSE, ) | ||||||
var/severity = 0.2 | ||||||
switch(health) | ||||||
if(-40 to -30) | ||||||
severity = 0.5 | ||||||
heaven_flags = NONE | ||||||
if(-50 to -40) | ||||||
severity = 1 | ||||||
heaven_flags = 0 | ||||||
if(-50 to -40) | ||||||
severity = 2 | ||||||
heaven_flags = 0 | ||||||
Comment on lines
+47
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was this a typo? there's two duplicate sets of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah typo |
||||||
if(-60 to -50) | ||||||
severity = 3 | ||||||
heaven_flags = 0 | ||||||
if(-70 to -60) | ||||||
severity = 4 | ||||||
heaven_flags = 0 | ||||||
if(-90 to -70) | ||||||
severity = 5 | ||||||
heaven_flags = 0 | ||||||
if(-95 to -90) | ||||||
severity = 6 | ||||||
heaven_flags |= HEAVEN_TIMETOGO | ||||||
if(-INFINITY to -95) | ||||||
severity = 7 | ||||||
heaven_flags |= HEAVEN_TIMETOGO | ||||||
if (heaven_flags & HEAVEN_TIMETOGO && !(heaven_flags & HEAVEN_TIMETOGO_PLAYED)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
just to be safe, bitwise ops not wrapped in () has caused issues in the past, so let's be 100% sure |
||||||
SEND_SOUND(src, sound('monkestation/code/modules/divine_warning/sounds/heaven_time.ogg')) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. playsound_local |
||||||
heaven_flags |= HEAVEN_TIMETOGO_PLAYED | ||||||
|
||||||
var/alpha = /atom/movable/screen/fullscreen/divine/base_divine::alpha * (severity / 10) | ||||||
Check failure on line 72 in monkestation/code/modules/divine_warning/code/effects.dm
|
||||||
flleeppyy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
var/soundvolume = 100 * (severity / 10) | ||||||
flash_divine_overlay(alpha, soundvolume) | ||||||
|
||||||
#undef HEAVEN_TIMETOGO | ||||||
#undef HEAVEN_TIMETOGO_PLAYED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo,
playsound_local
should be used, so it respects the volume mixer and suchThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does playsound_local ignore
can_hear()
?